@mx-cartographer/experiences 9.7.10 → 9.7.12
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 +12 -0
- package/dist/core/types/Insights.d.ts +9 -4
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.d.ts +5 -0
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +27 -11
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +26 -20
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +82 -74
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +5 -5
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +4 -4
- package/dist/insights-v2/blocks/ComponentBlocks/DirectDepositBlock/DirectDepositBlock.es.js +6 -6
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +52 -37
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +5 -0
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +11 -6
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +56 -56
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [9.7.12] - 10-20-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - `transaction_block` `status_message` variant: no rows, an icon + message banner (`StatusMessageCard`, `role="status"`) from `instance_slot.data.message` and `instance_slot.data.icon` (through `LogoFromGuid`, so a malformed `ICO-` guid drops only the icon). Renders nothing, and warns, without a non-blank message; the icon is `aria-hidden`. Uncategorized Transactions V2's `complete` card ("All Categorized!"); story included (WEC-2005)
|
|
4
|
+
- **CHANGED** - `TransactionListBlock` reads the rows from `drilldown_data.transaction_guids`, and from `instance_slot_data.transaction_guids` only when that key is absent. A list that is present but not all strings, from either source, lists no transactions and warns (WEC-2005)
|
|
5
|
+
- **CHANGED** - `DrilldownData` values may be a `string[]` (WEC-2005)
|
|
6
|
+
- **FIXED** - An edit made in an insight's Transaction Details drawer (category, date, memo...) tells the host the beat is stale (`staleBeatGuid`, as the `refreshBeat` effect does), so a sampled beat's card, such as Uncategorized Transactions V2's count, refreshes without a page reload (WEC-2005)
|
|
7
|
+
|
|
8
|
+
## [9.7.11] - 10-20-2026
|
|
9
|
+
|
|
10
|
+
- **CHANGED** - `AccountBlock` renders its confetti-tile and detailed-hero logos from `instance_slot.data.logo` through `LogoFromGuid` (the guid prefix picks merchant / institution / category / `ICO-` icon), replacing `DepositLogo`, the `depositIcons` map and the flat `merchant_guid` / `category_guid` / `institution_guid` logo inputs. An `ICO-` logo on the confetti tile keeps its look (an outlined 24px glyph on the `success.main` square), drawn with `Icon` as `IconComponent` does. Stories send the logo (with `amount` / `header_text` / `sub_text`) on `data` (WEC-1929)
|
|
11
|
+
- **CHANGED** - `UnifiedDepositMini` story rebuilt on the real deposit envelope; its `in_description_cta` variant is `merchant_budget` (Unified Deposit always has a merchant) (WEC-1929)
|
|
12
|
+
|
|
1
13
|
## [9.7.10] - 10-20-2026
|
|
2
14
|
|
|
3
15
|
- **FIXED** - Cash Back `image_block` (`image_with_overlay` variant) reads the Insights 2.0 `instance_slot.data` (`amount`, `image`) instead of the legacy top-level `instance_slot_data`, so the card draws the reward amount rather than `$0.00`; and `imageMap` is keyed by the snake_case `cash_back` the backend sends (was camelCase `cashBack`), so the `CashBack.png` background resolves. The overlay amount is omitted when `amount` is missing or non-finite, and the background is dropped (no `url(undefined)`) when the image key is unknown. Test and story moved to the V2 slot shape (WEC-1516)
|
|
@@ -31,10 +31,12 @@ export interface Pill {
|
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction
|
|
34
|
-
* Details drawer)
|
|
35
|
-
*
|
|
34
|
+
* Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string
|
|
35
|
+
* lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or
|
|
36
|
+
* user actions (memo, tags, hide, flag come from the transaction store). Values come from the
|
|
37
|
+
* server, so a reader still checks each value's runtime shape.
|
|
36
38
|
*/
|
|
37
|
-
export type DrilldownData = Record<string, string | number | boolean | null>;
|
|
39
|
+
export type DrilldownData = Record<string, string | number | boolean | null | string[]>;
|
|
38
40
|
export interface InsightsPayload {
|
|
39
41
|
widget_type: WidgetType;
|
|
40
42
|
instance_slot: InstanceSlot;
|
|
@@ -60,7 +62,10 @@ export interface InsightsPayload {
|
|
|
60
62
|
variant?: string;
|
|
61
63
|
/** V2, `embedded` envelope only: the transaction-row pill. */
|
|
62
64
|
pill?: Pill;
|
|
63
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list
|
|
67
|
+
* drawer shows (`{ transaction_guids: [...] }`).
|
|
68
|
+
*/
|
|
64
69
|
drilldown_data?: DrilldownData;
|
|
65
70
|
footer?: Footer;
|
|
66
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer). A flat hash shared by every CTA of the card, omitted when the insight has none.\n * Never carries copy or user actions (memo, tags, hide, flag come from the transaction store).\n */\nexport type DrilldownData = Record<string, string | number | boolean | null>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /** V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`. */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n}\n"],"mappings":"AAyTA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
1
|
+
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string\n * lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or\n * user actions (memo, tags, hide, flag come from the transaction store). Values come from the\n * server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n}\n"],"mappings":"AA8TA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.d.ts
CHANGED
|
@@ -24,6 +24,11 @@ interface TransactionDetailsBlockState {
|
|
|
24
24
|
* A guid the store does not have resolves to `undefined` (the block's error state) rather than to
|
|
25
25
|
* any beat-level snapshot, so inline edits can never be made against a stale copy.
|
|
26
26
|
*
|
|
27
|
+
* An edit made here (category, date, memo...) replaces the transaction in the store. The beat's card
|
|
28
|
+
* is built from live data (a sampled beat's count), so the host is told the beat is stale, the same
|
|
29
|
+
* signal a CTA's `refreshBeat` effect sends; pulse refetches the sample on it, as its legacy cards do
|
|
30
|
+
* through `shouldUpdateOnTransactionChange`.
|
|
31
|
+
*
|
|
27
32
|
* Actions are not beat-configurable on the v2 contract: `instance_slot_data` is not part of it (the
|
|
28
33
|
* LargeTransactionV2 payload omits the key entirely), so top actions are always the defaults and
|
|
29
34
|
* bottom actions are derived from the triggering CTA's variant.
|
package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
-
import { useActionContext as
|
|
2
|
-
import { getBottomActionsByVariant as
|
|
3
|
-
import { resolveTopActions as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useActionContext as _, useGlobalStore as y, useInsightsV2Store as h, useTransactionStore as v } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { getBottomActionsByVariant as A } from "./util.es.js";
|
|
3
|
+
import { resolveTopActions as T } from "./transactionDetailsActions.es.js";
|
|
4
|
+
import e from "react";
|
|
5
|
+
var E = (r) => {
|
|
6
|
+
const { detailedTransactions: d, isTransactionDataLoaded: u, transactions: p } = v(), { emitUpdate: a } = y(), { actionDrawer: g } = h(), { transaction_guid: m } = _() ?? {}, i = r.insights_payload, t = m ?? i?.primary_transaction_guid, f = t ? d.find((n) => n.guid === t) : void 0, c = t ? p.find((n) => n.guid === t) : void 0, o = c ? JSON.stringify(c) : void 0, s = e.useRef({
|
|
7
|
+
guid: t,
|
|
8
|
+
snapshot: o
|
|
9
|
+
});
|
|
10
|
+
return e.useEffect(() => {
|
|
11
|
+
if (!o) return;
|
|
12
|
+
const n = s.current.guid === t && s.current.snapshot !== void 0, l = s.current.snapshot !== o;
|
|
13
|
+
s.current = {
|
|
14
|
+
guid: t,
|
|
15
|
+
snapshot: o
|
|
16
|
+
}, n && l && a({ staleBeatGuid: r.guid });
|
|
17
|
+
}, [
|
|
18
|
+
t,
|
|
19
|
+
o,
|
|
20
|
+
r.guid,
|
|
21
|
+
a
|
|
22
|
+
]), {
|
|
23
|
+
bottomActions: A(g, i?.primary_cta, i?.secondary_cta, i?.in_description_cta),
|
|
24
|
+
isLoading: !u,
|
|
25
|
+
topActions: T(),
|
|
26
|
+
transaction: f
|
|
11
27
|
};
|
|
12
28
|
};
|
|
13
29
|
export {
|
|
14
|
-
|
|
30
|
+
E as useTransactionDetailsBlock
|
|
15
31
|
};
|
|
16
32
|
|
|
17
33
|
//# sourceMappingURL=useTransactionDetailsBlock.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTransactionDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useTransactionDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.ts"],"sourcesContent":["import React from 'react'\n\nimport {\n useActionContext,\n useGlobalStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat, Transaction, DrilldownPayload } from '../../../core'\nimport type { BottomActions, TopActions } from '../../../transactions/constants/Actions'\nimport { getBottomActionsByVariant } from './util'\nimport { resolveTopActions } from './transactionDetailsActions'\n\ninterface TransactionDetailsBlockState {\n bottomActions: BottomActions[]\n /** True while the store is still loading; the block shows a loader instead of an empty state. */\n isLoading: boolean\n topActions: TopActions[]\n /** `undefined` once loading finishes means the transaction could not be resolved. */\n transaction?: Transaction\n}\n\n/**\n * Resolves which transaction this drawer is about, and which inline actions it offers.\n *\n * The subject comes from one of two places:\n * 1. `actionContext.transaction_guid` — set by a parent drawer (e.g. a row tapped in\n * `TransactionHistoryBlock`) when this drawer is opened nested.\n * 2. `insights_payload.primary_transaction_guid` — the ditto contract for every beat whose\n * `primary_cta_block` is `transaction_details_block`.\n *\n * The guid is then looked up in `transactionStore.detailedTransactions` rather than used directly,\n * because `TransactionDetails` needs the *detailed* shape (account + category + taggings joined in)\n * and edits must write through to the same store object the rest of the app renders. `buildDetailed\n * Transactions` inside the store is this repo's equivalent of pulse's `buildTransactionDetails`.\n * A guid the store does not have resolves to `undefined` (the block's error state) rather than to\n * any beat-level snapshot, so inline edits can never be made against a stale copy.\n *\n * An edit made here (category, date, memo...) replaces the transaction in the store. The beat's card\n * is built from live data (a sampled beat's count), so the host is told the beat is stale, the same\n * signal a CTA's `refreshBeat` effect sends; pulse refetches the sample on it, as its legacy cards do\n * through `shouldUpdateOnTransactionChange`.\n *\n * Actions are not beat-configurable on the v2 contract: `instance_slot_data` is not part of it (the\n * LargeTransactionV2 payload omits the key entirely), so top actions are always the defaults and\n * bottom actions are derived from the triggering CTA's variant.\n */\nexport const useTransactionDetailsBlock = (beat: Beat): TransactionDetailsBlockState => {\n const { detailedTransactions, isTransactionDataLoaded, transactions } = useTransactionStore()\n const { emitUpdate } = useGlobalStore()\n\n const { actionDrawer } = useInsightsV2Store()\n\n const { transaction_guid } = useActionContext<DrilldownPayload>() ?? {}\n const payload = beat.insights_payload\n\n const guid = transaction_guid ?? payload?.primary_transaction_guid\n\n const transaction = guid\n ? detailedTransactions.find((transaction) => transaction.guid === guid)\n : undefined\n\n // Every store load swaps in new objects, so an edit is a change in the transaction's content, not\n // its identity. The snapshot is per guid: opening another transaction is not an edit of the last.\n const stored = guid ? transactions.find((transaction) => transaction.guid === guid) : undefined\n const snapshot = stored ? JSON.stringify(stored) : undefined\n const seen = React.useRef({ guid, snapshot })\n\n React.useEffect(() => {\n if (!snapshot) return\n\n const isEdit = seen.current.guid === guid && seen.current.snapshot !== undefined\n const changed = seen.current.snapshot !== snapshot\n seen.current = { guid, snapshot }\n if (isEdit && changed) emitUpdate({ staleBeatGuid: beat.guid })\n }, [guid, snapshot, beat.guid, emitUpdate])\n\n const bottomActions = getBottomActionsByVariant(\n actionDrawer,\n payload?.primary_cta,\n payload?.secondary_cta,\n payload?.in_description_cta,\n )\n return {\n bottomActions,\n isLoading: !isTransactionDataLoaded,\n topActions: resolveTopActions(),\n transaction,\n }\n}\n"],"mappings":";;;;AA+CA,IAAa,IAAA,CAA8B,MAA6C;AACtF,QAAM,EAAE,sBAAA,GAAsB,yBAAA,GAAyB,cAAA,EAAA,IAAiB,EAAoB,GACtF,EAAE,YAAA,EAAA,IAAe,EAAe,GAEhC,EAAE,cAAA,EAAA,IAAiB,EAAmB,GAEtC,EAAE,kBAAA,EAAA,IAAqB,EAAmC,KAAK,CAAC,GAChE,IAAU,EAAK,kBAEf,IAAO,KAAoB,GAAS,0BAEpC,IAAc,IAChB,EAAqB,KAAA,CAAM,MAAgB,EAAY,SAAS,CAAI,IACpE,QAIE,IAAS,IAAO,EAAa,KAAA,CAAM,MAAgB,EAAY,SAAS,CAAI,IAAI,QAChF,IAAW,IAAS,KAAK,UAAU,CAAM,IAAI,QAC7C,IAAO,EAAM,OAAO;AAAA,IAAE,MAAA;AAAA,IAAM,UAAA;AAAA,EAAS,CAAC;AAE5C,SAAA,EAAM,UAAA,MAAgB;AACpB,QAAI,CAAC,EAAU;AAEf,UAAM,IAAS,EAAK,QAAQ,SAAS,KAAQ,EAAK,QAAQ,aAAa,QACjE,IAAU,EAAK,QAAQ,aAAa;AAC1C,IAAA,EAAK,UAAU;AAAA,MAAE,MAAA;AAAA,MAAM,UAAA;AAAA,IAAS,GAC5B,KAAU,KAAS,EAAW,EAAE,eAAe,EAAK,KAAK,CAAC;AAAA,EAChE,GAAG;AAAA,IAAC;AAAA,IAAM;AAAA,IAAU,EAAK;AAAA,IAAM;AAAA,EAAU,CAAC,GAQnC;AAAA,IACL,eAPoB,EACpB,GACA,GAAS,aACT,GAAS,eACT,GAAS,kBAGT;AAAA,IACA,WAAW,CAAC;AAAA,IACZ,YAAY,EAAkB;AAAA,IAC9B,aAAA;AAAA,EACF;AACF"}
|
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import
|
|
1
|
+
import { useGlobalCopyStore as _, useInsightsV2Store as p, useTransactionStore as f } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import y from "../../../common/components/drawer/Drawer.es.js";
|
|
3
3
|
import h from "../../../transactions/components/shared/TransactionList.es.js";
|
|
4
|
-
import { selectTransactionsByGuids as
|
|
4
|
+
import { selectTransactionsByGuids as C } from "../../CommonUtils.es.js";
|
|
5
5
|
import { TransactionDetailsBlock as T } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
6
|
-
import
|
|
7
|
-
import { observer as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import v from "react";
|
|
7
|
+
import { observer as w } from "mobx-react-lite";
|
|
8
|
+
import { Fragment as k, jsx as i, jsxs as D } from "react/jsx-runtime";
|
|
9
|
+
var S = (s) => Array.isArray(s) && s.every((t) => typeof t == "string"), B = (s) => {
|
|
10
|
+
const t = s.insights_payload?.drilldown_data, o = s.insights_payload?.instance_slot_data ?? {}, [a, n] = t && Object.hasOwn(t, "transaction_guids") ? ["drilldown_data", t.transaction_guids] : ["instance_slot_data", o.transaction_guids];
|
|
11
|
+
if (n != null) {
|
|
12
|
+
if (S(n)) return n;
|
|
13
|
+
console.warn(`[TransactionListBlock] ${a}.transaction_guids is not a list of guids — listing no transactions.`);
|
|
14
|
+
}
|
|
15
|
+
}, I = w(function({ beat: t }) {
|
|
16
|
+
const { common: o, insights_feed: a } = _(), { setActionContext: n } = p(), e = f(), [c, r] = v.useState(!1), l = B(t), d = C(e.detailedTransactions, l), m = (g) => {
|
|
17
|
+
n({ transaction_guid: g }), r(!0);
|
|
18
|
+
}, u = () => {
|
|
19
|
+
r(!1), n({ transaction_guid: void 0 });
|
|
14
20
|
};
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
onClick:
|
|
17
|
-
transaction:
|
|
18
|
-
}), /* @__PURE__ */
|
|
19
|
-
ariaLabelClose:
|
|
21
|
+
return /* @__PURE__ */ D(k, { children: [/* @__PURE__ */ i(h, {
|
|
22
|
+
onClick: m,
|
|
23
|
+
transaction: d
|
|
24
|
+
}), /* @__PURE__ */ i(y, {
|
|
25
|
+
ariaLabelClose: o.close_aria,
|
|
20
26
|
isOpen: c,
|
|
21
|
-
onClose:
|
|
22
|
-
title:
|
|
23
|
-
children: /* @__PURE__ */
|
|
27
|
+
onClose: u,
|
|
28
|
+
title: a.general.transaction_details_title,
|
|
29
|
+
children: /* @__PURE__ */ i(T, { beat: t })
|
|
24
30
|
})] });
|
|
25
31
|
});
|
|
26
32
|
export {
|
|
27
|
-
|
|
33
|
+
I as TransactionListBlock
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
//# sourceMappingURL=TransactionListBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat } from '../../../core'\nimport type { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { TransactionList } from '../../../transactions'\nimport { selectTransactionsByGuids } from '../../CommonUtils'\n\nexport interface TransactionListBlockProps {\n beat: Beat\n}\n\n/**\n * Opens a date-grouped list of the transactions a beat points at. Tapping a row stacks\n * the Transaction Details drawer over the list.\n *\n * ActionBlockLayer owns the outer Drawer (title, close button, copy-loaded gate).\n */\nexport const TransactionListBlock = observer(function TransactionListBlock({\n beat,\n}: TransactionListBlockProps) {\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const { setActionContext } = useInsightsV2Store()\n const transactionStore = useTransactionStore()\n\n const [isDetailsOpen, setIsDetailsOpen] = React.useState(false)\n\n const
|
|
1
|
+
{"version":3,"file":"TransactionListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat } from '../../../core'\nimport type { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { TransactionList } from '../../../transactions'\nimport { selectTransactionsByGuids } from '../../CommonUtils'\n\nconst isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string')\n\n/**\n * The guids the drawer lists. V2 envelopes send them on `drilldown_data`, V1 on\n * `instance_slot_data`, which is read only when the V2 key is absent. The payload is untrusted, so\n * a present but malformed list fails closed (no rows, and a warning) rather than showing the other\n * source's rows; a non-array would otherwise reach new Set() inside selectTransactionsByGuids and\n * match per-character.\n */\nconst resolveTransactionGuids = (beat: Beat): string[] | undefined => {\n const drilldown = beat.insights_payload?.drilldown_data\n const slotData = (beat.insights_payload?.instance_slot_data ?? {}) as InsightsInstanceSlotData\n const [source, value]: [string, unknown] =\n drilldown && Object.hasOwn(drilldown, 'transaction_guids')\n ? ['drilldown_data', drilldown.transaction_guids]\n : ['instance_slot_data', slotData.transaction_guids]\n\n if (value == null) return undefined\n if (isStringArray(value)) return value\n\n console.warn(\n `[TransactionListBlock] ${source}.transaction_guids is not a list of guids — listing no transactions.`,\n )\n return undefined\n}\n\nexport interface TransactionListBlockProps {\n beat: Beat\n}\n\n/**\n * Opens a date-grouped list of the transactions a beat points at. Tapping a row stacks\n * the Transaction Details drawer over the list.\n *\n * ActionBlockLayer owns the outer Drawer (title, close button, copy-loaded gate).\n */\nexport const TransactionListBlock = observer(function TransactionListBlock({\n beat,\n}: TransactionListBlockProps) {\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const { setActionContext } = useInsightsV2Store()\n const transactionStore = useTransactionStore()\n\n const [isDetailsOpen, setIsDetailsOpen] = React.useState(false)\n\n const guids = resolveTransactionGuids(beat)\n const transactions = selectTransactionsByGuids(transactionStore.detailedTransactions, guids)\n\n const handleRowClick = (guid: string) => {\n setActionContext({ transaction_guid: guid })\n setIsDetailsOpen(true)\n }\n\n const handleDetailsClose = () => {\n setIsDetailsOpen(false)\n // Clear only the key this nested drawer owns — same convention as TransactionHistoryBlock.\n // `setActionContext` merges, so an explicit `{}` would be a no-op; naming the key keeps the\n // outer drawer's own context intact.\n setActionContext({ transaction_guid: undefined })\n }\n\n return (\n <>\n <TransactionList onClick={handleRowClick} transaction={transactions} />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isDetailsOpen}\n onClose={handleDetailsClose}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAAA,CAAiB,MACrB,MAAM,QAAQ,CAAK,KAAK,EAAM,MAAA,CAAO,MAAS,OAAO,KAAS,QAAQ,GASlE,IAAA,CAA2B,MAAqC;AACpE,QAAM,IAAY,EAAK,kBAAkB,gBACnC,IAAY,EAAK,kBAAkB,sBAAsB,CAAC,GAC1D,CAAC,GAAQ,CAAA,IACb,KAAa,OAAO,OAAO,GAAW,mBAAmB,IACrD,CAAC,kBAAkB,EAAU,iBAAiB,IAC9C,CAAC,sBAAsB,EAAS,iBAAiB;AAEvD,MAAI,KAAS,MACb;AAAA,QAAI,EAAc,CAAK,EAAG,QAAO;AAEjC,YAAQ,KACN,0BAA0B,CAAA,sEAC5B;AAAA;AAEF,GAYa,IAAuB,EAAS,SAA8B,EACzE,MAAA,EAAA,GAC4B;AAC5B,QAAM,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAiB,EAAmB,GACzE,EAAE,kBAAA,EAAA,IAAqB,EAAmB,GAC1C,IAAmB,EAAoB,GAEvC,CAAC,GAAe,CAAA,IAAoB,EAAM,SAAS,EAAK,GAExD,IAAQ,EAAwB,CAAI,GACpC,IAAe,EAA0B,EAAiB,sBAAsB,CAAK,GAErF,IAAA,CAAkB,MAAiB;AACvC,IAAA,EAAiB,EAAE,kBAAkB,EAAK,CAAC,GAC3C,EAAiB,EAAI;AAAA,EACvB,GAEM,IAAA,MAA2B;AAC/B,IAAA,EAAiB,EAAK,GAItB,EAAiB,EAAE,kBAAkB,OAAU,CAAC;AAAA,EAClD;AAEA,SACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAiB,SAAS;AAAA,IAAgB,aAAa;AAAA,EAAe,CAAA,GACtE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,GAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -1,48 +1,45 @@
|
|
|
1
|
-
import { slot as
|
|
1
|
+
import { slot as d } from "../../../../core/types/Insights.es.js";
|
|
2
2
|
import { formatCurrency as I } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
-
import { useContainerDimensions as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { ReactComponent as
|
|
8
|
-
import { ReactComponent as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
3
|
+
import { useContainerDimensions as G } from "../../../hooks/useContainerDimensions.es.js";
|
|
4
|
+
import { Confetti as O } from "../../../components/shared/Confetti.es.js";
|
|
5
|
+
import W from "../../../components/DirectDepositCard.es.js";
|
|
6
|
+
import S from "../../../components/LogoFromGuid.es.js";
|
|
7
|
+
import { ReactComponent as q } from "../../../components/shared/images/PaidOffCard.es.js";
|
|
8
|
+
import { ReactComponent as J } from "../../../components/shared/images/SavingsAccountDeposit.es.js";
|
|
9
|
+
import { statusIconName as K } from "../../../components/statusIcon.es.js";
|
|
10
|
+
import { resolveVariantConfig as M } from "../../resolveVariantConfig.es.js";
|
|
11
|
+
import { HeaderComponent as Q } from "./HeaderComponent.es.js";
|
|
12
|
+
import { getLayoutConfig as U } from "./layout.es.js";
|
|
13
|
+
import { IconComponent as X } from "./IconComponent.es.js";
|
|
14
|
+
import { useRef as Y } from "react";
|
|
14
15
|
import e from "@mui/material/Stack";
|
|
15
|
-
import { Text as
|
|
16
|
-
import { Icon as
|
|
16
|
+
import { Text as l } from "@mxenabled/mxui";
|
|
17
|
+
import { Icon as D } from "@mxenabled/mx-icons";
|
|
17
18
|
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
18
|
-
import { useTheme as
|
|
19
|
-
import
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, vo = ({ payload: N }) => {
|
|
24
|
-
const x = X(), g = Q(null), { height: b, width: v } = j(g), { instance_slot: i } = N, { variant: p, account_name: L, account_type: z, status_text: G, institution_guid: d, institution_name: h, icon_name: $, merchant_guid: A, merchant_name: y, category_guid: B } = i, { data: a } = i, l = a !== void 0, f = m(a, "amount"), u = l ? typeof f == "number" && Number.isFinite(f) ? f : void 0 : i.amount, _ = m(a, "sub_text"), w = typeof _ == "string" ? _ : void 0, R = l ? w : i.sub_text, F = l ? w : i.label, C = m(a, "header_text"), s = l ? typeof C == "string" ? C : void 0 : i.header_text, T = m(a, "logo"), t = q(K(x), p, "default", "AccountBlock");
|
|
25
|
-
if (t?.isDetailed) return /* @__PURE__ */ o(E, {
|
|
19
|
+
import { useTheme as Z } from "@mui/material/styles";
|
|
20
|
+
import s from "@mui/material/Box";
|
|
21
|
+
var wo = ({ payload: z }) => {
|
|
22
|
+
const f = Z(), x = Y(null), { height: g, width: b } = G(x), { instance_slot: n } = z, { variant: y, account_name: L, account_type: F, status_text: $, institution_guid: j, institution_name: A, icon_name: B, merchant_name: P } = n, { data: a } = n, u = a !== void 0, p = d(a, "amount"), m = u ? typeof p == "number" && Number.isFinite(p) ? p : void 0 : n.amount, v = d(a, "sub_text"), w = typeof v == "string" ? v : void 0, R = u ? w : n.sub_text, V = u ? w : n.label, _ = d(a, "header_text"), c = u ? typeof _ == "string" ? _ : void 0 : n.header_text, i = d(a, "logo"), t = M(U(f), y, "default", "AccountBlock");
|
|
23
|
+
if (t?.isDetailed) return /* @__PURE__ */ o(W, {
|
|
26
24
|
...t.detailed,
|
|
27
|
-
logo: /* @__PURE__ */ o(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}),
|
|
25
|
+
logo: i?.guid ? /* @__PURE__ */ o(S, {
|
|
26
|
+
logo: i,
|
|
27
|
+
size: 48
|
|
28
|
+
}) : null,
|
|
32
29
|
name: L,
|
|
33
|
-
statusLabel:
|
|
34
|
-
subtitle:
|
|
30
|
+
statusLabel: $,
|
|
31
|
+
subtitle: F
|
|
35
32
|
});
|
|
36
33
|
if (t?.isConfetti) {
|
|
37
|
-
const
|
|
38
|
-
paidOffCard: /* @__PURE__ */ o(
|
|
34
|
+
const h = K(i?.guid), H = {
|
|
35
|
+
paidOffCard: /* @__PURE__ */ o(s, {
|
|
39
36
|
sx: {
|
|
40
37
|
flexShrink: 0,
|
|
41
38
|
height: 32,
|
|
42
39
|
position: "relative",
|
|
43
40
|
width: 44
|
|
44
41
|
},
|
|
45
|
-
children: /* @__PURE__ */ o(
|
|
42
|
+
children: /* @__PURE__ */ o(q, {
|
|
46
43
|
"aria-hidden": !0,
|
|
47
44
|
role: "presentation",
|
|
48
45
|
style: {
|
|
@@ -52,13 +49,13 @@ var Y = {
|
|
|
52
49
|
}
|
|
53
50
|
})
|
|
54
51
|
}),
|
|
55
|
-
savings: /* @__PURE__ */ o(
|
|
52
|
+
savings: /* @__PURE__ */ o(J, {
|
|
56
53
|
"aria-hidden": !0,
|
|
57
54
|
height: 55,
|
|
58
55
|
role: "presentation",
|
|
59
56
|
width: 55
|
|
60
57
|
}),
|
|
61
|
-
logo: /* @__PURE__ */ o(
|
|
58
|
+
logo: /* @__PURE__ */ o(s, {
|
|
62
59
|
sx: {
|
|
63
60
|
borderRadius: "4px",
|
|
64
61
|
flexShrink: 0,
|
|
@@ -66,27 +63,38 @@ var Y = {
|
|
|
66
63
|
overflow: "hidden",
|
|
67
64
|
width: 48
|
|
68
65
|
},
|
|
69
|
-
children: /* @__PURE__ */ o(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
children: h ? /* @__PURE__ */ o(e, {
|
|
67
|
+
"data-icon": h,
|
|
68
|
+
sx: {
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
bgcolor: "success.main",
|
|
71
|
+
height: "100%",
|
|
72
|
+
justifyContent: "center",
|
|
73
|
+
width: "100%"
|
|
74
|
+
},
|
|
75
|
+
children: /* @__PURE__ */ o(D, {
|
|
76
|
+
"aria-hidden": !0,
|
|
77
|
+
name: h,
|
|
78
|
+
size: 24,
|
|
79
|
+
sx: { color: "success.contrastText" }
|
|
80
|
+
})
|
|
81
|
+
}) : i?.guid ? /* @__PURE__ */ o(S, {
|
|
82
|
+
logo: i,
|
|
83
|
+
size: 48
|
|
84
|
+
}) : null
|
|
77
85
|
})
|
|
78
|
-
}[t.graphic ?? "logo"],
|
|
86
|
+
}[t.graphic ?? "logo"], C = d(a, "secondary_text"), N = typeof C == "string" && C || (P ?? A), T = t.secondarySource === "merchant" ? N : V, k = T ? /* @__PURE__ */ o(l, {
|
|
79
87
|
color: t.secondaryColor,
|
|
80
88
|
variant: t.secondaryVariant,
|
|
81
|
-
children:
|
|
82
|
-
}) : null,
|
|
89
|
+
children: T
|
|
90
|
+
}) : null, E = m != null ? /* @__PURE__ */ o(l, {
|
|
83
91
|
bold: !0,
|
|
84
92
|
color: "success.dark",
|
|
85
93
|
variant: t.amountVariant,
|
|
86
|
-
children: `${t.amountPrefix ?? ""}${I(
|
|
94
|
+
children: `${t.amountPrefix ?? ""}${I(m, "0,0.00")}`
|
|
87
95
|
}) : null;
|
|
88
|
-
return /* @__PURE__ */ r(
|
|
89
|
-
ref:
|
|
96
|
+
return /* @__PURE__ */ r(s, {
|
|
97
|
+
ref: x,
|
|
90
98
|
sx: {
|
|
91
99
|
backgroundImage: t.gradient,
|
|
92
100
|
bgcolor: "background.paper",
|
|
@@ -95,17 +103,17 @@ var Y = {
|
|
|
95
103
|
p: 16,
|
|
96
104
|
width: "100%"
|
|
97
105
|
},
|
|
98
|
-
children: [/* @__PURE__ */ o(
|
|
106
|
+
children: [/* @__PURE__ */ o(s, {
|
|
99
107
|
sx: {
|
|
100
108
|
inset: 0,
|
|
101
109
|
pointerEvents: "none",
|
|
102
110
|
position: "absolute",
|
|
103
111
|
zIndex: 1
|
|
104
112
|
},
|
|
105
|
-
children: /* @__PURE__ */ o(
|
|
106
|
-
height:
|
|
107
|
-
shouldRun:
|
|
108
|
-
width:
|
|
113
|
+
children: /* @__PURE__ */ o(O, {
|
|
114
|
+
height: g,
|
|
115
|
+
shouldRun: g > 0 && b > 0,
|
|
116
|
+
width: b
|
|
109
117
|
})
|
|
110
118
|
}), /* @__PURE__ */ r(e, {
|
|
111
119
|
sx: {
|
|
@@ -115,16 +123,16 @@ var Y = {
|
|
|
115
123
|
width: "100%",
|
|
116
124
|
zIndex: 2
|
|
117
125
|
},
|
|
118
|
-
children: [t.categoryStrip &&
|
|
126
|
+
children: [t.categoryStrip && c && /* @__PURE__ */ o(s, {
|
|
119
127
|
sx: {
|
|
120
128
|
bgcolor: "success.main",
|
|
121
129
|
px: 12,
|
|
122
130
|
py: 4
|
|
123
131
|
},
|
|
124
|
-
children: /* @__PURE__ */ o(
|
|
132
|
+
children: /* @__PURE__ */ o(l, {
|
|
125
133
|
color: "success.contrastText",
|
|
126
134
|
variant: "caption",
|
|
127
|
-
children:
|
|
135
|
+
children: c
|
|
128
136
|
})
|
|
129
137
|
}), /* @__PURE__ */ r(e, {
|
|
130
138
|
sx: {
|
|
@@ -141,21 +149,21 @@ var Y = {
|
|
|
141
149
|
flexDirection: "row",
|
|
142
150
|
...t.rowSx
|
|
143
151
|
},
|
|
144
|
-
children: [/* @__PURE__ */ o(
|
|
152
|
+
children: [/* @__PURE__ */ o(s, {
|
|
145
153
|
sx: {
|
|
146
154
|
display: "flex",
|
|
147
155
|
flexShrink: 0
|
|
148
156
|
},
|
|
149
|
-
children:
|
|
157
|
+
children: H
|
|
150
158
|
}), /* @__PURE__ */ r(e, {
|
|
151
159
|
sx: {
|
|
152
160
|
flex: "1 0 0",
|
|
153
161
|
minWidth: 0
|
|
154
162
|
},
|
|
155
163
|
children: [
|
|
156
|
-
t.secondaryPosition === "above" &&
|
|
157
|
-
|
|
158
|
-
t.secondaryPosition === "below" &&
|
|
164
|
+
t.secondaryPosition === "above" && k,
|
|
165
|
+
E,
|
|
166
|
+
t.secondaryPosition === "below" && k
|
|
159
167
|
]
|
|
160
168
|
})]
|
|
161
169
|
})]
|
|
@@ -170,10 +178,10 @@ var Y = {
|
|
|
170
178
|
children: /* @__PURE__ */ r(e, {
|
|
171
179
|
sx: {
|
|
172
180
|
borderRadius: "8px",
|
|
173
|
-
boxShadow:
|
|
181
|
+
boxShadow: f.shadows[1],
|
|
174
182
|
width: "100%"
|
|
175
183
|
},
|
|
176
|
-
children: [
|
|
184
|
+
children: [c && /* @__PURE__ */ o(Q, { headerText: c }), /* @__PURE__ */ r(e, {
|
|
177
185
|
sx: {
|
|
178
186
|
alignItems: "center",
|
|
179
187
|
bgcolor: "background.paper",
|
|
@@ -182,31 +190,31 @@ var Y = {
|
|
|
182
190
|
px: 16,
|
|
183
191
|
py: 12,
|
|
184
192
|
width: "100%",
|
|
185
|
-
...
|
|
193
|
+
...c && {
|
|
186
194
|
borderTopLeftRadius: "0",
|
|
187
195
|
borderTopRightRadius: "0"
|
|
188
196
|
},
|
|
189
|
-
...(
|
|
197
|
+
...(j || B || i?.guid) && { flexDirection: "row" }
|
|
190
198
|
},
|
|
191
|
-
children: [/* @__PURE__ */ o(
|
|
192
|
-
logo:
|
|
193
|
-
slot:
|
|
194
|
-
variant:
|
|
195
|
-
}), /* @__PURE__ */ r(e, { children: [
|
|
199
|
+
children: [/* @__PURE__ */ o(X, {
|
|
200
|
+
logo: i,
|
|
201
|
+
slot: n,
|
|
202
|
+
variant: y
|
|
203
|
+
}), /* @__PURE__ */ r(e, { children: [m != null && /* @__PURE__ */ o(l, {
|
|
196
204
|
variant: "h2",
|
|
197
|
-
children: I(
|
|
205
|
+
children: I(m, "0,0.00")
|
|
198
206
|
}), /* @__PURE__ */ r(e, {
|
|
199
207
|
sx: {
|
|
200
208
|
gap: 8,
|
|
201
209
|
flexDirection: "row",
|
|
202
210
|
alignItems: "center"
|
|
203
211
|
},
|
|
204
|
-
children: [t.sub_logo && /* @__PURE__ */ o(
|
|
212
|
+
children: [t.sub_logo && /* @__PURE__ */ o(D, {
|
|
205
213
|
color: "warning",
|
|
206
214
|
fill: !0,
|
|
207
215
|
name: t.sub_logo,
|
|
208
216
|
size: 20
|
|
209
|
-
}), R && /* @__PURE__ */ o(
|
|
217
|
+
}), R && /* @__PURE__ */ o(l, {
|
|
210
218
|
color: "text.secondary",
|
|
211
219
|
variant: "caption",
|
|
212
220
|
children: R
|
|
@@ -217,7 +225,7 @@ var Y = {
|
|
|
217
225
|
});
|
|
218
226
|
};
|
|
219
227
|
export {
|
|
220
|
-
|
|
228
|
+
wo as default
|
|
221
229
|
};
|
|
222
230
|
|
|
223
231
|
//# sourceMappingURL=AccountBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useRef } from 'react'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { DepositLogo } from '../../../components/ComponentBlocks/DepositLogo'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport { Confetti } from '../../../components/shared/Confetti'\nimport { ReactComponent as PaidOffCardGraphic } from '../../../components/shared/images/PaidOffCard.svg'\nimport { ReactComponent as SavingsGraphic } from '../../../components/shared/images/SavingsAccountDeposit.svg'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\n/** Default generic-tile icon per deposit variant, used when no merchant/institution logo. */\nconst depositIcons: Record<string, string> = {\n deposit_received: 'payments',\n status_on_track: 'monetization_on',\n}\n\nconst AccountBlock = ({ payload }: { payload: InsightsPayload; beatGuid?: string }) => {\n const theme = useTheme()\n const containerRef = useRef<HTMLDivElement>(null)\n const { height, width } = useContainerDimensions(containerRef)\n const { instance_slot } = payload\n const {\n variant,\n account_name,\n account_type,\n status_text,\n institution_guid,\n institution_name,\n icon_name,\n merchant_guid,\n merchant_name,\n category_guid,\n } = instance_slot\n // V2 variants fill `instance_slot.data` (ditto's account_block slots) and it is then the whole\n // truth: a slot it leaves empty, or sends with the wrong kind, draws nothing rather than falling\n // back to the stale flat field it supersedes. Beats not yet migrated send no `data` and keep the\n // flat fields.\n const { data } = instance_slot\n const v2 = data !== undefined\n const dataAmount = slot<unknown>(data, 'amount')\n const amount = v2\n ? typeof dataAmount === 'number' && Number.isFinite(dataAmount)\n ? dataAmount\n : undefined\n : instance_slot.amount\n // One V2 slot feeds the line under the amount on both tiles. V1 called it `sub_text` on the\n // standard tile and `label` on the confetti tile, so each keeps its own flat field.\n const dataSubText = slot<unknown>(data, 'sub_text')\n const v2SubText = typeof dataSubText === 'string' ? dataSubText : undefined\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const dataHeaderText = slot<unknown>(data, 'header_text')\n const header_text = v2\n ? typeof dataHeaderText === 'string'\n ? dataHeaderText\n : undefined\n : instance_slot.header_text\n const logo = slot<LogoRef>(data, 'logo')\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // \"Detailed\" hero variants — the logo-over-card account hero the Direct Deposit block also\n // renders, addressed through `account_block` per the architecture doc's Account block variants.\n // The account facts arrive flat on the slot (`account_name`, `account_type`, `status_text`).\n // The logo's accessible name is the institution name; a slot that sends only the guid falls\n // back to it rather than leaving the hero logo unnamed.\n if (layoutConfig?.isDetailed) {\n return (\n <DirectDepositCard\n {...layoutConfig.detailed}\n logo={\n <DepositLogo\n iconName=\"account_balance\"\n institutionGuid={institution_guid ?? ''}\n institutionName={institution_name ?? institution_guid ?? ''}\n />\n }\n name={account_name}\n statusLabel={status_text}\n subtitle={account_type}\n />\n )\n }\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n <DepositLogo\n categoryGuid={category_guid}\n iconName={depositIcons[variant as keyof typeof depositIcons] ?? 'payments'}\n institutionGuid={institution_guid}\n institutionName={institution_name}\n merchantGuid={merchant_guid}\n merchantName={merchant_name}\n />\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n const secondaryText =\n layoutConfig.secondarySource === 'merchant' ? (merchant_name ?? institution_name) : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\n {secondaryText}\n </Text>\n ) : null\n // No figure for a missing amount: `formatCurrency` would print a confident `$0.00`.\n const amountText =\n amount != null ? (\n <Text bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\n </Text>\n ) : null\n\n return (\n <Box\n ref={containerRef}\n sx={{\n backgroundImage: layoutConfig.gradient,\n bgcolor: 'background.paper',\n overflow: 'hidden',\n position: 'relative',\n p: 16,\n width: '100%',\n }}\n >\n <Box\n sx={{\n inset: 0,\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 1,\n }}\n >\n <Confetti height={height} shouldRun={height > 0 && width > 0} width={width} />\n </Box>\n\n <Stack\n sx={{\n borderRadius: '8px',\n overflow: 'hidden',\n position: 'relative',\n width: '100%',\n zIndex: 2,\n }}\n >\n {layoutConfig.categoryStrip && header_text && (\n <Box sx={{ bgcolor: 'success.main', px: 12, py: 4 }}>\n <Text color=\"success.contrastText\" variant=\"caption\">\n {header_text}\n </Text>\n </Box>\n )}\n\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'success.lighter',\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: '8px',\n // With a strip above, the body's top corners tuck under it (no double border line).\n ...(layoutConfig.categoryStrip && {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTop: 0,\n }),\n flexDirection: 'row',\n ...layoutConfig.rowSx,\n }}\n >\n <Box sx={{ display: 'flex', flexShrink: 0 }}>{graphic}</Box>\n\n <Stack sx={{ flex: '1 0 0', minWidth: 0 }}>\n {layoutConfig.secondaryPosition === 'above' && secondary}\n {amountText}\n {layoutConfig.secondaryPosition === 'below' && secondary}\n </Stack>\n </Stack>\n </Stack>\n </Box>\n )\n }\n\n return (\n <Stack\n sx={{\n background: layoutConfig.background,\n p: 16,\n }}\n >\n <Stack\n sx={{\n borderRadius: '8px',\n boxShadow: theme.shadows[1],\n width: '100%',\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n gap: 16,\n px: 16,\n py: 12,\n width: '100%',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n ...((institution_guid || icon_name || logo?.guid) && {\n flexDirection: 'row',\n }),\n }}\n >\n <IconComponent logo={logo} slot={instance_slot} variant={variant} />\n\n <Stack>\n {amount != null && <Text variant=\"h2\">{formatCurrency(amount, '0,0.00')}</Text>}\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n {sub_text && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {sub_text}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,IAAM,IAAuC;AAAA,EAC3C,kBAAkB;AAAA,EAClB,iBAAiB;AACnB,GAEM,KAAA,CAAgB,EAAE,SAAA,EAAA,MAA+D;AACrF,QAAM,IAAQ,EAAS,GACjB,IAAe,EAAuB,IAAI,GAC1C,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAuB,CAAY,GACv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AA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAiB,SAAQ;AAAA,YAClC,UAAA;AAAA,UACG,CAAA,CAEH;AAAA,QACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,MACF,CAAA,CAAA;AAAA;EACF,CAAA;AAEX"}
|
|
1
|
+
{"version":3,"file":"AccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useRef } from 'react'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport { Confetti } from '../../../components/shared/Confetti'\nimport { ReactComponent as PaidOffCardGraphic } from '../../../components/shared/images/PaidOffCard.svg'\nimport { ReactComponent as SavingsGraphic } from '../../../components/shared/images/SavingsAccountDeposit.svg'\nimport { statusIconName } from '../../../components/statusIcon'\nimport { useContainerDimensions } from '../../../hooks/useContainerDimensions'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { HeaderComponent } from './HeaderComponent'\nimport { IconComponent } from './IconComponent'\nimport { getLayoutConfig } from './layout'\n\nconst AccountBlock = ({ payload }: { payload: InsightsPayload; beatGuid?: string }) => {\n const theme = useTheme()\n const containerRef = useRef<HTMLDivElement>(null)\n const { height, width } = useContainerDimensions(containerRef)\n const { instance_slot } = payload\n const {\n variant,\n account_name,\n account_type,\n status_text,\n institution_guid,\n institution_name,\n icon_name,\n merchant_name,\n } = instance_slot\n // V2 variants fill `instance_slot.data` (ditto's account_block slots) and it is then the whole\n // truth: a slot it leaves empty, or sends with the wrong kind, draws nothing rather than falling\n // back to the stale flat field it supersedes. Beats not yet migrated send no `data` and keep the\n // flat fields.\n const { data } = instance_slot\n const v2 = data !== undefined\n const dataAmount = slot<unknown>(data, 'amount')\n const amount = v2\n ? typeof dataAmount === 'number' && Number.isFinite(dataAmount)\n ? dataAmount\n : undefined\n : instance_slot.amount\n // One V2 slot feeds the line under the amount on both tiles. V1 called it `sub_text` on the\n // standard tile and `label` on the confetti tile, so each keeps its own flat field.\n const dataSubText = slot<unknown>(data, 'sub_text')\n const v2SubText = typeof dataSubText === 'string' ? dataSubText : undefined\n const sub_text = v2 ? v2SubText : instance_slot.sub_text\n const label = v2 ? v2SubText : instance_slot.label\n const dataHeaderText = slot<unknown>(data, 'header_text')\n const header_text = v2\n ? typeof dataHeaderText === 'string'\n ? dataHeaderText\n : undefined\n : instance_slot.header_text\n const logo = slot<LogoRef>(data, 'logo')\n const layoutConfig = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n 'default',\n 'AccountBlock',\n )\n\n // \"Detailed\" hero variants — the logo-over-card account hero the Direct Deposit block also\n // renders, addressed through `account_block` per the architecture doc's Account block variants.\n // The account facts arrive flat on the slot (`account_name`, `account_type`, `status_text`).\n // The logo's accessible name is the institution name; a slot that sends only the guid falls\n // back to it rather than leaving the hero logo unnamed.\n if (layoutConfig?.isDetailed) {\n return (\n <DirectDepositCard\n {...layoutConfig.detailed}\n logo={logo?.guid ? <LogoFromGuid logo={logo} size={48} /> : null}\n name={account_name}\n statusLabel={status_text}\n subtitle={account_type}\n />\n )\n }\n\n // Confetti-backed celebration variants (deposits, payoff, savings) — a success-tinted card\n // on a gradient + confetti wash. Everything variant-specific is flat on `layoutConfig`.\n if (layoutConfig?.isConfetti) {\n const confettiIcon = statusIconName(logo?.guid)\n const graphics: Record<string, React.ReactNode> = {\n paidOffCard: (\n // SVG is 58x46 but the card sits at (0,14) with the check badge overflowing top-right.\n // Box it to the card's real 44x32 footprint and shift the SVG up so it aligns with the text.\n <Box sx={{ flexShrink: 0, height: 32, position: 'relative', width: 44 }}>\n <PaidOffCardGraphic\n aria-hidden={true}\n role=\"presentation\"\n style={{ left: 0, position: 'absolute', top: -14 }}\n />\n </Box>\n ),\n savings: <SavingsGraphic aria-hidden={true} height={55} role=\"presentation\" width={55} />,\n logo: (\n <Box\n sx={{\n borderRadius: '4px',\n flexShrink: 0,\n height: 48,\n overflow: 'hidden',\n width: 48,\n }}\n >\n {/* An ICO- icon keeps the tile's look: an outlined 24px glyph in success.contrastText on\n the success.main square. It is drawn with Icon, as IconComponent does, because\n LogoFromGuid fills every ICO- glyph. Any other guid renders via LogoFromGuid. */}\n {confettiIcon ? (\n <Stack\n data-icon={confettiIcon}\n sx={{\n alignItems: 'center',\n bgcolor: 'success.main',\n height: '100%',\n justifyContent: 'center',\n width: '100%',\n }}\n >\n <Icon\n aria-hidden={true}\n name={confettiIcon}\n size={24}\n sx={{ color: 'success.contrastText' }}\n />\n </Stack>\n ) : logo?.guid ? (\n <LogoFromGuid logo={logo} size={48} />\n ) : null}\n </Box>\n ),\n }\n const graphic = graphics[layoutConfig.graphic ?? 'logo']\n\n // Deposit cards show the payer name — a merchant when we have one, otherwise the institution.\n // V2 sends it resolved as `data.secondary_text`; the flat fields remain the fallback.\n const dataSecondaryText = slot<unknown>(data, 'secondary_text')\n const payer =\n (typeof dataSecondaryText === 'string' && dataSecondaryText) ||\n (merchant_name ?? institution_name)\n const secondaryText = layoutConfig.secondarySource === 'merchant' ? payer : label\n const secondary = secondaryText ? (\n <Text color={layoutConfig.secondaryColor} variant={layoutConfig.secondaryVariant}>\n {secondaryText}\n </Text>\n ) : null\n // No figure for a missing amount: `formatCurrency` would print a confident `$0.00`.\n const amountText =\n amount != null ? (\n <Text bold={true} color=\"success.dark\" variant={layoutConfig.amountVariant}>\n {`${layoutConfig.amountPrefix ?? ''}${formatCurrency(amount, '0,0.00')}`}\n </Text>\n ) : null\n\n return (\n <Box\n ref={containerRef}\n sx={{\n backgroundImage: layoutConfig.gradient,\n bgcolor: 'background.paper',\n overflow: 'hidden',\n position: 'relative',\n p: 16,\n width: '100%',\n }}\n >\n <Box\n sx={{\n inset: 0,\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 1,\n }}\n >\n <Confetti height={height} shouldRun={height > 0 && width > 0} width={width} />\n </Box>\n\n <Stack\n sx={{\n borderRadius: '8px',\n overflow: 'hidden',\n position: 'relative',\n width: '100%',\n zIndex: 2,\n }}\n >\n {layoutConfig.categoryStrip && header_text && (\n <Box sx={{ bgcolor: 'success.main', px: 12, py: 4 }}>\n <Text color=\"success.contrastText\" variant=\"caption\">\n {header_text}\n </Text>\n </Box>\n )}\n\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'success.lighter',\n border: '1px solid',\n borderColor: 'success.main',\n borderRadius: '8px',\n // With a strip above, the body's top corners tuck under it (no double border line).\n ...(layoutConfig.categoryStrip && {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTop: 0,\n }),\n flexDirection: 'row',\n ...layoutConfig.rowSx,\n }}\n >\n <Box sx={{ display: 'flex', flexShrink: 0 }}>{graphic}</Box>\n\n <Stack sx={{ flex: '1 0 0', minWidth: 0 }}>\n {layoutConfig.secondaryPosition === 'above' && secondary}\n {amountText}\n {layoutConfig.secondaryPosition === 'below' && secondary}\n </Stack>\n </Stack>\n </Stack>\n </Box>\n )\n }\n\n return (\n <Stack\n sx={{\n background: layoutConfig.background,\n p: 16,\n }}\n >\n <Stack\n sx={{\n borderRadius: '8px',\n boxShadow: theme.shadows[1],\n width: '100%',\n }}\n >\n {header_text && <HeaderComponent headerText={header_text} />}\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n gap: 16,\n px: 16,\n py: 12,\n width: '100%',\n ...(header_text && {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n }),\n ...((institution_guid || icon_name || logo?.guid) && {\n flexDirection: 'row',\n }),\n }}\n >\n <IconComponent logo={logo} slot={instance_slot} variant={variant} />\n\n <Stack>\n {amount != null && <Text variant=\"h2\">{formatCurrency(amount, '0,0.00')}</Text>}\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n {layoutConfig.sub_logo && (\n <Icon color=\"warning\" fill={true} name={layoutConfig.sub_logo} size={20} />\n )}\n {sub_text && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {sub_text}\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n )\n}\n\nexport default AccountBlock\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,KAAA,CAAgB,EAAE,SAAA,EAAA,MAA+D;AACrF,QAAM,IAAQ,EAAS,GACjB,IAAe,EAAuB,IAAI,GAC1C,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAuB,CAAY,GACvD,EAAE,eAAA,EAAA,IAAkB,GACpB,EACJ,SAAA,GACA,cAAA,GACA,cAAA,GACA,aAAA,GACA,kBAAA,GACA,kBAAA,GACA,WAAA,GACA,eAAA,EAAA,IACE,GAKE,EAAE,MAAA,EAAA,IAAS,GACX,IAAK,MAAS,QACd,IAAa,EAAc,GAAM,QAAQ,GACzC,IAAS,IACX,OAAO,KAAe,YAAY,OAAO,SAAS,CAAU,IAC1D,IACA,SACF,EAAc,QAGZ,IAAc,EAAc,GAAM,UAAU,GAC5C,IAAY,OAAO,KAAgB,WAAW,IAAc,QAC5D,IAAW,IAAK,IAAY,EAAc,UAC1C,IAAQ,IAAK,IAAY,EAAc,OACvC,IAAiB,EAAc,GAAM,aAAa,GAClD,IAAc,IAChB,OAAO,KAAmB,WACxB,IACA,SACF,EAAc,aACZ,IAAO,EAAc,GAAM,MAAM,GACjC,IAAe,EACnB,EAAgB,CAAK,GACrB,GACA,WACA,cACF;AAOA,MAAI,GAAc,WAChB,QACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI,EAAa;AAAA,IACjB,MAAM,GAAM,OAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,I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AS;AAAA,UACT,cAAc;AAAA,UACd,KAAK;AAAA,UACL,IAAI;AAAA,UACJ,IAAI;AAAA,UACJ,OAAO;AAAA,UACP,GAAI,KAAe;AAAA,YACjB,qBAAqB;AAAA,YACrB,sBAAsB;AAAA,UACxB;AAAA,UACA,IAAK,KAAoB,KAAa,GAAM,SAAS,EACnD,eAAe,MACjB;AAAA,QACF;AAAA,QAhBF,UAAA,CAkBE,gBAAA,EAAC,GAAD;AAAA,UAAqB,MAAA;AAAA,UAAM,MAAM;AAAA,UAAwB,SAAA;AAAA,QAAU,CAAA,GAEnE,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,KAAU,QAAQ,gBAAA,EAAC,GAAD;AAAA,UAAM,SAAQ;AAAA,UAAM,UAAA,EAAe,GAAQ,QAAQ;AAAA,QAAQ,CAAA,GAC9E,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI;AAAA,YAAE,KAAK;AAAA,YAAG,eAAe;AAAA,YAAO,YAAY;AAAA,UAAS;AAAA,UAAhE,UAAA,CACG,EAAa,YACZ,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAU,MAAM;AAAA,YAAM,MAAM,EAAa;AAAA,YAAU,MAAM;AAAA,UAAK,CAAA,GAE3E,KACC,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAiB,SAAQ;AAAA,YAClC,UAAA;AAAA,UACG,CAAA,CAEH;AAAA,QACF,CAAA,CAAA,EAAA,CAAA,CACF;AAAA,MACF,CAAA,CAAA;AAAA;EACF,CAAA;AAEX"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import c from "../../../../common/components/IconBacking.es.js";
|
|
2
|
-
import
|
|
3
|
-
import { getLayoutConfig as g } from "./layout.es.js";
|
|
4
|
-
import f from "../../../components/LogoFromGuid.es.js";
|
|
2
|
+
import u from "../../../components/LogoFromGuid.es.js";
|
|
5
3
|
import { statusIconName as d } from "../../../components/statusIcon.es.js";
|
|
4
|
+
import { resolveVariantConfig as g } from "../../resolveVariantConfig.es.js";
|
|
5
|
+
import { getLayoutConfig as f } from "./layout.es.js";
|
|
6
6
|
import { InstitutionLogo as p } from "@mxenabled/mxui";
|
|
7
7
|
import { Icon as n } from "@mxenabled/mx-icons";
|
|
8
8
|
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
import { useTheme as b } from "@mui/material/styles";
|
|
10
10
|
import { Stack as a } from "@mui/material";
|
|
11
11
|
var y = ({ slot: i, variant: s, logo: e }) => {
|
|
12
|
-
const m = b(), o =
|
|
12
|
+
const m = b(), o = g(f(m), s, "default", "AccountBlock");
|
|
13
13
|
if (/^INS-[A-Za-z0-9-]+$/.test(e?.guid ?? "")) return /* @__PURE__ */ l(a, {
|
|
14
14
|
sx: {
|
|
15
15
|
alignItems: "center",
|
|
16
16
|
flexDirection: "row",
|
|
17
17
|
position: "relative"
|
|
18
18
|
},
|
|
19
|
-
children: [/* @__PURE__ */ r(
|
|
19
|
+
children: [/* @__PURE__ */ r(u, {
|
|
20
20
|
logo: e,
|
|
21
21
|
size: 48
|
|
22
22
|
}), o.badge && /* @__PURE__ */ r(c, {
|
|
@@ -2,9 +2,9 @@ import { DATE_FORMATS_INTL as R, formatDate as k } from "../../../../core/consta
|
|
|
2
2
|
import { useGlobalCopyStore as F } from "../../../../common/context/hooks.es.js";
|
|
3
3
|
import { slot as f } from "../../../../core/types/Insights.es.js";
|
|
4
4
|
import { formatCurrency as i, formatPercentage as N } from "../../../../core/utils/NumberFormatting.es.js";
|
|
5
|
-
import
|
|
5
|
+
import P from "../../../components/LogoFromGuid.es.js";
|
|
6
6
|
import { resolveVariantConfig as B } from "../../resolveVariantConfig.es.js";
|
|
7
|
-
import Y from "../../../components/
|
|
7
|
+
import { DepositLogo as Y } from "../../../components/ComponentBlocks/DepositLogo.es.js";
|
|
8
8
|
import G from "../../../components/DebtPayoffCard.es.js";
|
|
9
9
|
import j from "../../../components/TransactionListCard.es.js";
|
|
10
10
|
import { parseDueDate as I } from "../RepeatingTransactionBlock/weekStrip.es.js";
|
|
@@ -23,7 +23,7 @@ var U = 32, W = /* @__PURE__ */ new Set([
|
|
|
23
23
|
}, [o, b]), p) {
|
|
24
24
|
const r = f(s, "series"), O = (Array.isArray(r) ? r : []).filter($).map((a) => ({
|
|
25
25
|
amount: typeof a.amount == "number" ? i(a.amount, "0,0.00") : "",
|
|
26
|
-
leading: /* @__PURE__ */ l(
|
|
26
|
+
leading: /* @__PURE__ */ l(P, {
|
|
27
27
|
logo: a.logo,
|
|
28
28
|
size: U
|
|
29
29
|
}),
|
|
@@ -59,7 +59,7 @@ var U = 32, W = /* @__PURE__ */ new Set([
|
|
|
59
59
|
..._.style,
|
|
60
60
|
balance: D ? i(y, "0,0.00") : void 0,
|
|
61
61
|
balanceLabel: D ? e.balance_label : void 0,
|
|
62
|
-
logo: /* @__PURE__ */ l(
|
|
62
|
+
logo: /* @__PURE__ */ l(Y, {
|
|
63
63
|
iconName: Z(d),
|
|
64
64
|
institutionGuid: S ?? "",
|
|
65
65
|
institutionName: x ?? ""
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import g from "../../../components/
|
|
1
|
+
import { directDepositVariant as f, getLayoutConfig as l } from "./layout.es.js";
|
|
2
|
+
import D from "../../../components/DirectDepositCard.es.js";
|
|
3
|
+
import { DepositLogo as g } from "../../../components/ComponentBlocks/DepositLogo.es.js";
|
|
4
4
|
import { jsx as o } from "react/jsx-runtime";
|
|
5
5
|
import { useTheme as _ } from "@mui/material/styles";
|
|
6
6
|
var L = ({ payload: i }) => {
|
|
7
|
-
const e = _(), { instance_slot: n } = i, { account_name: a, account_type: s, institution_guid: r, institution_name: c, status_text: m, variant: u } = n, t =
|
|
8
|
-
return /* @__PURE__ */ o(
|
|
7
|
+
const e = _(), { instance_slot: n } = i, { account_name: a, account_type: s, institution_guid: r, institution_name: c, status_text: m, variant: u } = n, t = l(e), p = t[u] ?? t[f.SetUpDirectDeposit];
|
|
8
|
+
return /* @__PURE__ */ o(D, {
|
|
9
9
|
...p,
|
|
10
|
-
logo: /* @__PURE__ */ o(
|
|
10
|
+
logo: /* @__PURE__ */ o(g, {
|
|
11
11
|
iconName: "account_balance",
|
|
12
12
|
institutionName: c ?? "",
|
|
13
13
|
institutionGuid: r ?? ""
|
|
@@ -12,6 +12,9 @@ interface TransactionBlockProps {
|
|
|
12
12
|
* This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo
|
|
13
13
|
* alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.
|
|
14
14
|
*
|
|
15
|
+
* `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a
|
|
16
|
+
* `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).
|
|
17
|
+
*
|
|
15
18
|
* A header, when the variant shows one, comes from `instance_slot.data.header_text` (the
|
|
16
19
|
* transaction date, or "{count} transactions"). It deliberately does *not* come from the first
|
|
17
20
|
* row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here
|
|
@@ -1,74 +1,89 @@
|
|
|
1
|
-
import { useCategoryStore as
|
|
2
|
-
import { slot as
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import { resolveVariantConfig as y } from "../../resolveVariantConfig.es.js";
|
|
1
|
+
import { useCategoryStore as _ } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import { slot as s } from "../../../../core/types/Insights.es.js";
|
|
3
|
+
import { formatCurrency as y } from "../../../../core/utils/NumberFormatting.es.js";
|
|
5
4
|
import { logoFromRef as h } from "../../../components/shared/EntityLogo.es.js";
|
|
6
|
-
import x from "../../../components/
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
5
|
+
import x from "../../../components/LogoFromGuid.es.js";
|
|
6
|
+
import { resolveVariantConfig as v } from "../../resolveVariantConfig.es.js";
|
|
7
|
+
import C from "../../../components/TransactionListCard.es.js";
|
|
8
|
+
import I from "../../../components/StatusMessageCard.es.js";
|
|
9
|
+
import { getLayoutConfig as G, transactionBlockVariant as L } from "./layout.es.js";
|
|
10
|
+
import { observer as T } from "mobx-react-lite";
|
|
11
|
+
import { CategoryIcon as S, InstitutionLogo as O, MerchantLogo as k } from "@mxenabled/mxui";
|
|
12
|
+
import { Icon as z } from "@mxenabled/mx-icons";
|
|
11
13
|
import { jsx as o } from "react/jsx-runtime";
|
|
12
|
-
import { useTheme as
|
|
13
|
-
import
|
|
14
|
-
var
|
|
14
|
+
import { useTheme as B } from "@mui/material/styles";
|
|
15
|
+
import c from "@mui/material/Box";
|
|
16
|
+
var i = 32, b = Math.round(i * 0.625), M = 20, R = (n, a) => {
|
|
15
17
|
const t = h(n.logo, n.primary_text);
|
|
16
18
|
if (t) {
|
|
17
|
-
if (t.logo_name) return /* @__PURE__ */ o(
|
|
19
|
+
if (t.logo_name) return /* @__PURE__ */ o(c, {
|
|
18
20
|
sx: {
|
|
19
21
|
alignItems: "center",
|
|
20
22
|
display: "flex",
|
|
21
|
-
height:
|
|
23
|
+
height: i,
|
|
22
24
|
justifyContent: "center",
|
|
23
|
-
width:
|
|
25
|
+
width: i
|
|
24
26
|
},
|
|
25
|
-
children: /* @__PURE__ */ o(
|
|
27
|
+
children: /* @__PURE__ */ o(z, {
|
|
26
28
|
name: t.logo_name,
|
|
27
|
-
size:
|
|
29
|
+
size: b,
|
|
28
30
|
sx: { color: t.logo_color }
|
|
29
31
|
})
|
|
30
32
|
});
|
|
31
|
-
if (t.merchant_guid) return /* @__PURE__ */ o(
|
|
33
|
+
if (t.merchant_guid) return /* @__PURE__ */ o(k, {
|
|
32
34
|
alt: t.merchant_name ?? "",
|
|
33
35
|
categoryGuid: t.category_guid ? a(t.category_guid) : "",
|
|
34
36
|
merchantGuid: t.merchant_guid,
|
|
35
|
-
size:
|
|
37
|
+
size: i
|
|
36
38
|
});
|
|
37
|
-
if (t.institution_guid) return /* @__PURE__ */ o(
|
|
39
|
+
if (t.institution_guid) return /* @__PURE__ */ o(O, {
|
|
38
40
|
alt: t.institution_name ?? "",
|
|
39
41
|
institutionGuid: t.institution_guid,
|
|
40
|
-
size:
|
|
42
|
+
size: i
|
|
41
43
|
});
|
|
42
44
|
if (t.category_guid) {
|
|
43
45
|
const e = a(t.category_guid);
|
|
44
|
-
return /* @__PURE__ */ o(
|
|
46
|
+
return /* @__PURE__ */ o(c, {
|
|
45
47
|
"data-testid": `category-icon-${e}`,
|
|
46
48
|
sx: { display: "flex" },
|
|
47
|
-
children: /* @__PURE__ */ o(
|
|
49
|
+
children: /* @__PURE__ */ o(S, {
|
|
48
50
|
categoryGuid: e,
|
|
49
|
-
size:
|
|
51
|
+
size: i
|
|
50
52
|
})
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
},
|
|
55
|
-
const a =
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
}, K = T(({ payload: n }) => {
|
|
57
|
+
const a = B(), { getTopLevelCategoryGuid: t } = _(), { data: e, variant: u } = n.instance_slot, { background: d, cardVariant: l, showHeader: f, statusMessage: p } = v(G(a), u, L.NoHeader, "TransactionBlock");
|
|
58
|
+
if (p) {
|
|
59
|
+
const r = s(e, "message");
|
|
60
|
+
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ o(I, {
|
|
61
|
+
icon: /* @__PURE__ */ o(c, {
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
sx: { display: "flex" },
|
|
64
|
+
children: /* @__PURE__ */ o(x, {
|
|
65
|
+
logo: s(e, "icon"),
|
|
66
|
+
size: M
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
message: r
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const m = s(e, "series"), g = s(e, "header_text");
|
|
73
|
+
return !Array.isArray(m) || !m.length ? null : /* @__PURE__ */ o(C, {
|
|
74
|
+
background: d,
|
|
75
|
+
header: f && typeof g == "string" ? g : void 0,
|
|
61
76
|
variant: l,
|
|
62
|
-
rows:
|
|
63
|
-
amount: typeof
|
|
64
|
-
leading:
|
|
65
|
-
subtitle:
|
|
66
|
-
title:
|
|
77
|
+
rows: m.map((r) => ({
|
|
78
|
+
amount: typeof r.amount == "number" ? y(r.amount, "0,0.00") : "",
|
|
79
|
+
leading: R(r, t),
|
|
80
|
+
subtitle: r.secondary_text ?? "",
|
|
81
|
+
title: r.primary_text ?? ""
|
|
67
82
|
}))
|
|
68
83
|
});
|
|
69
84
|
});
|
|
70
85
|
export {
|
|
71
|
-
|
|
86
|
+
K as TransactionBlock
|
|
72
87
|
};
|
|
73
88
|
|
|
74
89
|
//# sourceMappingURL=TransactionBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const { data, variant } = payload.instance_slot\n const
|
|
1
|
+
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 20\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const { background, cardVariant, showHeader, statusMessage } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n return (\n <TransactionListCard\n background={background}\n header={header}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?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
|
9
9
|
* - `InfoWash` — borderless row on the blue slot wash (e.g. Subscription Detected).
|
|
10
10
|
* - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected
|
|
11
11
|
* Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.
|
|
12
|
+
* - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`
|
|
13
|
+
* (Uncategorized Transactions V2 `complete`, "All Categorized!").
|
|
12
14
|
*/
|
|
13
15
|
export declare const transactionBlockVariant: {
|
|
14
16
|
readonly WithHeader: "with_header";
|
|
@@ -16,6 +18,7 @@ export declare const transactionBlockVariant: {
|
|
|
16
18
|
readonly UncategorizedTransaction: "uncategorized_transaction";
|
|
17
19
|
readonly InfoWash: "info_wash";
|
|
18
20
|
readonly WarningWash: "warning_wash";
|
|
21
|
+
readonly StatusMessage: "status_message";
|
|
19
22
|
};
|
|
20
23
|
export type TransactionBlockVariant = (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant];
|
|
21
24
|
export interface TransactionLayoutConfig {
|
|
@@ -25,6 +28,8 @@ export interface TransactionLayoutConfig {
|
|
|
25
28
|
cardVariant?: 'default' | 'primary';
|
|
26
29
|
/** CSS background for the slot behind the card; the card then renders borderless on paper. */
|
|
27
30
|
background?: string;
|
|
31
|
+
/** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */
|
|
32
|
+
statusMessage?: boolean;
|
|
28
33
|
}
|
|
29
34
|
/** Per-variant `TransactionListCard` props (mirrors DirectDepositBlock's `getLayoutConfig`). */
|
|
30
35
|
export declare const getLayoutConfig: (theme: Theme) => Record<TransactionBlockVariant, TransactionLayoutConfig>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { WARNING_WASH_GRADIENT as
|
|
1
|
+
import { WARNING_WASH_GRADIENT as r, getPrimaryWashGradient as s } from "../../../components/celebrationGradients.es.js";
|
|
2
2
|
var a = {
|
|
3
3
|
WithHeader: "with_header",
|
|
4
4
|
NoHeader: "no_header",
|
|
5
5
|
UncategorizedTransaction: "uncategorized_transaction",
|
|
6
6
|
InfoWash: "info_wash",
|
|
7
|
-
WarningWash: "warning_wash"
|
|
8
|
-
|
|
7
|
+
WarningWash: "warning_wash",
|
|
8
|
+
StatusMessage: "status_message"
|
|
9
|
+
}, n = (e) => ({
|
|
9
10
|
[a.WithHeader]: { showHeader: !0 },
|
|
10
11
|
[a.NoHeader]: { showHeader: !1 },
|
|
11
12
|
[a.UncategorizedTransaction]: {
|
|
@@ -14,15 +15,19 @@ var a = {
|
|
|
14
15
|
},
|
|
15
16
|
[a.InfoWash]: {
|
|
16
17
|
showHeader: !1,
|
|
17
|
-
background:
|
|
18
|
+
background: s(e)
|
|
18
19
|
},
|
|
19
20
|
[a.WarningWash]: {
|
|
20
21
|
showHeader: !1,
|
|
21
|
-
background:
|
|
22
|
+
background: r
|
|
23
|
+
},
|
|
24
|
+
[a.StatusMessage]: {
|
|
25
|
+
showHeader: !1,
|
|
26
|
+
statusMessage: !0
|
|
22
27
|
}
|
|
23
28
|
});
|
|
24
29
|
export {
|
|
25
|
-
|
|
30
|
+
n as getLayoutConfig,
|
|
26
31
|
a as transactionBlockVariant
|
|
27
32
|
};
|
|
28
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — borderless row on the blue slot wash (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card then renders borderless on paper. */\n background?: string\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DirectDepositBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n },\n})\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — borderless row on the blue slot wash (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card then renders borderless on paper. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DirectDepositBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n },\n [transactionBlockVariant.StatusMessage]: { showHeader: false, statusMessage: true },\n})\n"],"mappings":";AAoBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GAiBa,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,EAC1C;AAAA,EACC,CAAA,EAAwB,WAAA,GAAc;AAAA,IACrC,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AAAA,EACC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IAAE,YAAY;AAAA,IAAO,eAAe;AAAA,EAAK;AACpF"}
|
|
@@ -27,34 +27,34 @@ import mo from "./components/SaveAnExtraCard.es.js";
|
|
|
27
27
|
import ao from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
28
28
|
import fo from "./components/SavingsOpportunityCard.es.js";
|
|
29
29
|
import no from "./blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import Co from "./
|
|
33
|
-
import ko from "./components/
|
|
34
|
-
import ho from "./
|
|
35
|
-
import Ao from "./
|
|
36
|
-
import Lo from "./
|
|
37
|
-
import
|
|
38
|
-
import Ro from "./
|
|
39
|
-
import Oo from "./components/
|
|
40
|
-
import yo from "./components/
|
|
41
|
-
import Mo from "./components/
|
|
42
|
-
import _o from "./components/
|
|
43
|
-
import Vo from "./components/
|
|
44
|
-
import
|
|
45
|
-
import No from "./components/
|
|
46
|
-
import
|
|
47
|
-
import {
|
|
48
|
-
import Ko from "./components/
|
|
49
|
-
import Xo from "./components/
|
|
50
|
-
import Zo from "./components/
|
|
51
|
-
import
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import cr from "./components/
|
|
57
|
-
import sr from "./components/
|
|
30
|
+
import lo from "./components/StatusMessageCard.es.js";
|
|
31
|
+
import { transactionBlockVariant as Bo } from "./blocks/ComponentBlocks/TransactionBlock/layout.es.js";
|
|
32
|
+
import { TransactionBlock as Co } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
33
|
+
import ko from "./components/AmountPill.es.js";
|
|
34
|
+
import ho from "./components/SubscriptionHeroCard.es.js";
|
|
35
|
+
import Ao from "./blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
36
|
+
import Lo from "./components/WithdrawalCard.es.js";
|
|
37
|
+
import Io from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
38
|
+
import { SVGImageBlock as Ro } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
39
|
+
import Oo from "./components/shared/StatusSnackbar.es.js";
|
|
40
|
+
import yo from "./components/FeedbackDialog.es.js";
|
|
41
|
+
import Mo from "./components/FeedbackModal.es.js";
|
|
42
|
+
import _o from "./components/ConnectionDetailDrillDown.es.js";
|
|
43
|
+
import Vo from "./components/SurveyModal.es.js";
|
|
44
|
+
import Go from "./components/InsightErrorCard.es.js";
|
|
45
|
+
import { ErrorCard as No } from "./components/ErrorCard.es.js";
|
|
46
|
+
import jo from "./components/BadgedTile.es.js";
|
|
47
|
+
import { OverflowMenu as zo } from "./components/OverflowMenu.es.js";
|
|
48
|
+
import { InsightOptionsMenu as Ko } from "./components/InsightOptionsMenu.es.js";
|
|
49
|
+
import Xo from "./components/StatusBadge.es.js";
|
|
50
|
+
import Zo from "./components/CompactInsightCard.es.js";
|
|
51
|
+
import or from "./components/DesignateEmergencySavingsCard.es.js";
|
|
52
|
+
import { FeedbackBar as tr } from "./components/FeedbackBar.es.js";
|
|
53
|
+
import { DismissInsightDialog as ir } from "./components/DismissInsightDialog.es.js";
|
|
54
|
+
import { HiddenConfirmationCard as pr } from "./components/HiddenConfirmationCard.es.js";
|
|
55
|
+
import { LoadingCard as er } from "./components/LoadingCard.es.js";
|
|
56
|
+
import { ObsolesceBanner as cr } from "./components/ObsolesceBanner.es.js";
|
|
57
|
+
import sr from "./components/BaseLayout.es.js";
|
|
58
58
|
import Br from "./components/LogoTile.es.js";
|
|
59
59
|
import Cr from "./components/LogoClusterCard.es.js";
|
|
60
60
|
import kr from "./components/MerchantHighlightCard.es.js";
|
|
@@ -63,68 +63,68 @@ export {
|
|
|
63
63
|
P as AccountBlock,
|
|
64
64
|
R as AccountHeroCard,
|
|
65
65
|
x as AccountSwitchBlock,
|
|
66
|
-
|
|
66
|
+
ko as AmountPill,
|
|
67
67
|
f as BAR_ARIA_LABEL,
|
|
68
68
|
e as BAR_CHART_VARIANTS,
|
|
69
|
-
|
|
69
|
+
jo as BadgedTile,
|
|
70
70
|
k as BarchartBlock,
|
|
71
|
-
|
|
71
|
+
sr as BaseLayout,
|
|
72
72
|
W as BudgetBlock,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Zo as CompactInsightCard,
|
|
74
|
+
_o as ConnectionDetailDrillDown,
|
|
75
75
|
q as DebtPayoffCard,
|
|
76
76
|
Y as DebtsBlock,
|
|
77
|
-
|
|
77
|
+
or as DesignateEmergencySavingsCard,
|
|
78
78
|
U as DirectDepositBlock,
|
|
79
79
|
O as DirectDepositCard,
|
|
80
|
-
|
|
80
|
+
ir as DismissInsightDialog,
|
|
81
81
|
L as DonutChartBlock,
|
|
82
82
|
h as DoubleBarChartBlock,
|
|
83
83
|
I as DoubleProgressBarBlock,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
No as ErrorCard,
|
|
85
|
+
tr as FeedbackBar,
|
|
86
|
+
yo as FeedbackDialog,
|
|
87
|
+
Mo as FeedbackModal,
|
|
88
88
|
d as HOST_ACTIONS,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
pr as HiddenConfirmationCard,
|
|
90
|
+
Go as InsightErrorCard,
|
|
91
|
+
Ko as InsightOptionsMenu,
|
|
92
92
|
J as InsightTransactionRow,
|
|
93
|
-
|
|
93
|
+
er as LoadingCard,
|
|
94
94
|
Cr as LogoClusterCard,
|
|
95
95
|
y as LogoFromGuid,
|
|
96
96
|
Br as LogoTile,
|
|
97
97
|
kr as MerchantHighlightCard,
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
cr as ObsolesceBanner,
|
|
99
|
+
zo as OverflowMenu,
|
|
100
100
|
hr as P2PLogoStack,
|
|
101
101
|
ro as RepeatingTransactionBlock,
|
|
102
|
-
|
|
102
|
+
Ro as SVGImageBlock,
|
|
103
103
|
mo as SaveAnExtraCard,
|
|
104
104
|
ao as SaveExtraBlock,
|
|
105
105
|
no as SavingsOpportunityBlock,
|
|
106
106
|
fo as SavingsOpportunityCard,
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
Xo as StatusBadge,
|
|
108
|
+
lo as StatusMessageCard,
|
|
109
109
|
r as StatusPill,
|
|
110
|
-
|
|
110
|
+
Oo as StatusSnackbar,
|
|
111
111
|
A as StepChartBlock,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
ho as SubscriptionHeroCard,
|
|
113
|
+
Vo as SurveyModal,
|
|
114
|
+
Co as TransactionBlock,
|
|
115
115
|
Q as TransactionListCard,
|
|
116
116
|
F as TransferLogoCard,
|
|
117
117
|
ro as UpcomingBillBlock,
|
|
118
118
|
$ as UpcomingBillCard,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
Ao as UpcomingSubscriptionBlock,
|
|
120
|
+
Io as WithdrawalBlock,
|
|
121
|
+
Lo as WithdrawalCard,
|
|
122
122
|
n as barChartVariant,
|
|
123
123
|
c as buildChartData,
|
|
124
124
|
l as buildDataSeries,
|
|
125
125
|
E as isLogoGuid,
|
|
126
126
|
m as resolveInsightRender,
|
|
127
|
-
|
|
127
|
+
Bo as transactionBlockVariant,
|
|
128
128
|
a as useBeatActions,
|
|
129
129
|
g as useBeatCtaActions,
|
|
130
130
|
C as useCtaHandler
|