@mx-cartographer/experiences 9.7.126 → 9.7.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +101 -105
  3. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
  4. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +44 -43
  5. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
  6. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +66 -65
  7. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  8. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +24 -30
  9. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
  10. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +84 -101
  11. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  12. package/dist/insights-v2/components/CategoryTile.d.ts +14 -0
  13. package/dist/insights-v2/components/CategoryTile.es.js +28 -0
  14. package/dist/insights-v2/components/CategoryTile.es.js.map +1 -0
  15. package/dist/insights-v2/components/ComponentBlocks/DepositLogo.d.ts +5 -16
  16. package/dist/insights-v2/components/ComponentBlocks/DepositLogo.es.js +14 -17
  17. package/dist/insights-v2/components/ComponentBlocks/DepositLogo.es.js.map +1 -1
  18. package/dist/insights-v2/components/LogoFromGuid.d.ts +3 -13
  19. package/dist/insights-v2/components/LogoFromGuid.es.js +21 -46
  20. package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -1
  21. package/dist/insights-v2/components/LogoMark.d.ts +19 -0
  22. package/dist/insights-v2/components/LogoMark.es.js +33 -0
  23. package/dist/insights-v2/components/LogoMark.es.js.map +1 -0
  24. package/dist/insights-v2/components/SubHeader.es.js +13 -27
  25. package/dist/insights-v2/components/SubHeader.es.js.map +1 -1
  26. package/dist/insights-v2/components/shared/EntityLogo.d.ts +2 -2
  27. package/dist/insights-v2/components/shared/EntityLogo.es.js.map +1 -1
  28. package/package.json +1 -1
@@ -0,0 +1,33 @@
1
+ import { useCategoryStore as e } from "../../common/context/hooks.es.js";
2
+ import o from "./CategoryTile.es.js";
3
+ import { observer as a } from "mobx-react-lite";
4
+ import { InstitutionLogo as u, MerchantLogo as m } from "@mxenabled/mxui";
5
+ import { Icon as c, IconList as f } from "@mxenabled/mx-icons";
6
+ import { jsx as n } from "react/jsx-runtime";
7
+ var s = (r) => Object.hasOwn(f, r) ? !0 : (console.warn(`[LogoMark] "${r}" names no mx-icons icon — rendering nothing.`), !1), h = a(({ logo: r, size: t }) => {
8
+ const { getTopLevelCategoryGuid: i } = e();
9
+ return r.logo_name ? s(r.logo_name) ? /* @__PURE__ */ n(c, {
10
+ fill: r.logo_fill,
11
+ name: r.logo_name,
12
+ size: t,
13
+ sx: { color: r.logo_color }
14
+ }) : null : r.merchant_guid ? /* @__PURE__ */ n(m, {
15
+ alt: r.merchant_name ?? "",
16
+ categoryGuid: r.category_guid ? i(r.category_guid) : "",
17
+ merchantGuid: r.merchant_guid,
18
+ size: t
19
+ }) : r.institution_guid ? /* @__PURE__ */ n(u, {
20
+ alt: r.institution_name ?? "",
21
+ institutionGuid: r.institution_guid,
22
+ size: t
23
+ }) : r.category_guid ? /* @__PURE__ */ n(o, {
24
+ categoryGuid: r.category_guid,
25
+ size: t
26
+ }) : null;
27
+ });
28
+ export {
29
+ h as default,
30
+ s as isKnownIcon
31
+ };
32
+
33
+ //# sourceMappingURL=LogoMark.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoMark.es.js","names":[],"sources":["../../../src/insights-v2/components/LogoMark.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { Icon, IconList } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\n\nimport { useCategoryStore } from '../../common'\nimport type { Logo } from '../../core'\n\nimport CategoryTile from './CategoryTile'\n\ninterface LogoMarkProps {\n logo: Logo\n size: number\n}\n\n/**\n * Whether mx-icons draws `name` (own keys only, so `constructor` is rejected). An unknown name would\n * draw an empty box, so it is logged and the caller draws nothing.\n */\nexport const isKnownIcon = (name: string): boolean => {\n if (Object.hasOwn(IconList, name)) return true\n\n console.warn(`[LogoMark] \"${name}\" names no mx-icons icon — rendering nothing.`)\n return false\n}\n\n/**\n * A resolved `Logo` as its mxui component. A merchant's fallback category walks up to its top-level\n * parent as `CategoryTile` does, since mxui only knows those. Reads the category store, so it renders\n * inside the app's providers.\n */\nconst LogoMark = observer(({ logo, size }: LogoMarkProps) => {\n const { getTopLevelCategoryGuid } = useCategoryStore()\n\n if (logo.logo_name) {\n if (!isKnownIcon(logo.logo_name)) return null\n\n return (\n <Icon\n fill={logo.logo_fill}\n name={logo.logo_name}\n size={size}\n sx={{ color: logo.logo_color }}\n />\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? getTopLevelCategoryGuid(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={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={size}\n />\n )\n }\n\n if (logo.category_guid) {\n return <CategoryTile categoryGuid={logo.category_guid} size={size} />\n }\n\n return null\n})\n\nexport default LogoMark\n"],"mappings":";;;;;;AAmBA,IAAa,IAAA,CAAe,MACtB,OAAO,OAAO,GAAU,CAAI,IAAU,MAE1C,QAAQ,KAAK,eAAe,CAAA,+CAAmD,GACxE,KAQH,IAAW,EAAA,CAAU,EAAE,MAAA,GAAM,MAAA,EAAA,MAA0B;AAC3D,QAAM,EAAE,yBAAA,EAAA,IAA4B,EAAiB;AAErD,SAAI,EAAK,YACF,EAAY,EAAK,SAAS,IAG7B,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAK;AAAA,IACX,MAAM,EAAK;AAAA,IACL,MAAA;AAAA,IACN,IAAI,EAAE,OAAO,EAAK,WAAW;AAAA,EAC9B,CAAA,IARsC,OAYvC,EAAK,gBAEL,gBAAA,EAAC,GAAD;AAAA,IACE,KAAK,EAAK,iBAAiB;AAAA,IAC3B,cAAc,EAAK,gBAAgB,EAAwB,EAAK,aAAa,IAAI;AAAA,IACjF,cAAc,EAAK;AAAA,IACb,MAAA;AAAA,EACP,CAAA,IAID,EAAK,mBAEL,gBAAA,EAAC,GAAD;AAAA,IACE,KAAK,EAAK,oBAAoB;AAAA,IAC9B,iBAAiB,EAAK;AAAA,IAChB,MAAA;AAAA,EACP,CAAA,IAID,EAAK,gBACA,gBAAA,EAAC,GAAD;AAAA,IAAc,cAAc,EAAK;AAAA,IAAqB,MAAA;AAAA,EAAO,CAAA,IAG/D;AACT,CAAC"}
@@ -1,43 +1,29 @@
1
- import n from "@mui/material/Stack";
2
- import { CategoryIcon as a, InstitutionLogo as u, MerchantLogo as c, Text as o } from "@mxenabled/mxui";
3
- import { Icon as s } from "@mxenabled/mx-icons";
4
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
5
- var m = (t) => t ? t.logo_name ? /* @__PURE__ */ r(s, {
6
- fill: t.logo_fill,
7
- name: t.logo_name,
8
- size: 16,
9
- sx: { color: t.logo_color }
10
- }) : t.merchant_guid ? /* @__PURE__ */ r(c, {
11
- alt: t.merchant_name,
12
- categoryGuid: t.category_guid,
13
- merchantGuid: t.merchant_guid,
14
- size: 16
15
- }) : t.institution_guid ? /* @__PURE__ */ r(u, {
16
- alt: t.institution_name,
17
- institutionGuid: t.institution_guid,
18
- size: 16
19
- }) : t.category_guid ? /* @__PURE__ */ r(a, {
20
- categoryGuid: t.category_guid,
21
- size: 16
22
- }) : null : null, x = ({ subtitle: t }) => {
23
- const { logo: e, text: i } = t;
24
- return /* @__PURE__ */ d(n, {
1
+ import a from "./LogoMark.es.js";
2
+ import i from "@mui/material/Stack";
3
+ import { Text as s } from "@mxenabled/mxui";
4
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
5
+ var l = ({ subtitle: t }) => {
6
+ const { logo: r, text: o } = t;
7
+ return /* @__PURE__ */ c(i, {
25
8
  sx: {
26
9
  alignItems: "center",
27
10
  flexDirection: "row",
28
11
  gap: 8
29
12
  },
30
- children: [m(e), /* @__PURE__ */ r(o, {
13
+ children: [r && /* @__PURE__ */ e(a, {
14
+ logo: r,
15
+ size: 16
16
+ }), /* @__PURE__ */ e(s, {
31
17
  color: "text.secondary",
32
18
  sx: { letterSpacing: "0.52px" },
33
19
  uppercase: !0,
34
20
  variant: "body2",
35
- children: i
21
+ children: o
36
22
  })]
37
23
  });
38
24
  };
39
25
  export {
40
- x as default
26
+ l as default
41
27
  };
42
28
 
43
29
  //# sourceMappingURL=SubHeader.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubHeader.es.js","names":[],"sources":["../../../src/insights-v2/components/SubHeader.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\nimport type { Logo, Subtitle } from '../../core'\n\ninterface SubHeaderProps {\n subtitle: Subtitle\n}\n\n// TODO: Ask backend to send the correct guid (institution_guid, merchant_guid, or category_guid)\n// per beat's logo, matching what that beat's subtitle is actually about.\nconst renderLogo = (logo: Logo | undefined) => {\n if (!logo) return null\n\n if (logo.logo_name) {\n return (\n <Icon fill={logo.logo_fill} name={logo.logo_name} size={16} sx={{ color: logo.logo_color }} />\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name as string}\n categoryGuid={logo.category_guid as string}\n merchantGuid={logo.merchant_guid}\n size={16}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name as string}\n institutionGuid={logo.institution_guid}\n size={16}\n />\n )\n }\n\n if (logo.category_guid) {\n return <CategoryIcon categoryGuid={logo.category_guid} size={16} />\n }\n\n return null\n}\n\nconst SubHeader = ({ subtitle }: SubHeaderProps) => {\n const { logo, text } = subtitle\n\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {renderLogo(logo)}\n {/* Figma `typography/body2 (upper)`: uppercased with 0.52px tracking. */}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n uppercase={true}\n variant=\"body2\"\n >\n {text}\n </Text>\n </Stack>\n )\n}\n\nexport default SubHeader\n"],"mappings":";;;;AAYA,IAAM,IAAA,CAAc,MACb,IAED,EAAK,YAEL,gBAAA,EAAC,GAAD;AAAA,EAAM,MAAM,EAAK;AAAA,EAAW,MAAM,EAAK;AAAA,EAAW,MAAM;AAAA,EAAI,IAAI,EAAE,OAAO,EAAK,WAAW;AAAI,CAAA,IAI7F,EAAK,gBAEL,gBAAA,EAAC,GAAD;AAAA,EACE,KAAK,EAAK;AAAA,EACV,cAAc,EAAK;AAAA,EACnB,cAAc,EAAK;AAAA,EACnB,MAAM;AACP,CAAA,IAID,EAAK,mBAEL,gBAAA,EAAC,GAAD;AAAA,EACE,KAAK,EAAK;AAAA,EACV,iBAAiB,EAAK;AAAA,EACtB,MAAM;AACP,CAAA,IAID,EAAK,gBACA,gBAAA,EAAC,GAAD;AAAA,EAAc,cAAc,EAAK;AAAA,EAAe,MAAM;AAAK,CAAA,IAG7D,OAjCW,MAoCd,IAAA,CAAa,EAAE,UAAA,EAAA,MAA+B;AAClD,QAAM,EAAE,MAAA,GAAM,MAAA,EAAA,IAAS;AAEvB,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,KAAK;AAAA,IAAE;AAAA,IAAhE,UAAA,CACG,EAAW,CAAI,GAEhB,gBAAA,EAAC,GAAD;AAAA,MACE,OAAM;AAAA,MACN,IAAI,EAAE,eAAe,SAAS;AAAA,MAC9B,WAAW;AAAA,MACX,SAAQ;AAAA,MAEP,UAAA;AAAA,IACG,CAAA,CACD;AAAA;AAEX"}
1
+ {"version":3,"file":"SubHeader.es.js","names":[],"sources":["../../../src/insights-v2/components/SubHeader.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport type { Subtitle } from '../../core'\n\nimport LogoMark from './LogoMark'\n\ninterface SubHeaderProps {\n subtitle: Subtitle\n}\n\nconst SubHeader = ({ subtitle }: SubHeaderProps) => {\n const { logo, text } = subtitle\n\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {logo && <LogoMark logo={logo} size={16} />}\n {/* Figma `typography/body2 (upper)`: uppercased with 0.52px tracking. */}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n uppercase={true}\n variant=\"body2\"\n >\n {text}\n </Text>\n </Stack>\n )\n}\n\nexport default SubHeader\n"],"mappings":";;;;AAYA,IAAM,IAAA,CAAa,EAAE,UAAA,EAAA,MAA+B;AAClD,QAAM,EAAE,MAAA,GAAM,MAAA,EAAA,IAAS;AAEvB,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,KAAK;AAAA,IAAE;AAAA,IAAhE,UAAA,CACG,KAAQ,gBAAA,EAAC,GAAD;AAAA,MAAgB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,GAE1C,gBAAA,EAAC,GAAD;AAAA,MACE,OAAM;AAAA,MACN,IAAI,EAAE,eAAe,SAAS;AAAA,MAC9B,WAAW;AAAA,MACX,SAAQ;AAAA,MAEP,UAAA;AAAA,IACG,CAAA,CACD;AAAA;AAEX"}
@@ -3,7 +3,7 @@ import { Logo, LogoRef } from '../../../core';
3
3
  * The V2 beat envelope (LargeTransactionV2 onward) sends an entity logo as an opaque guid instead
4
4
  * of V1's named `institution_guid` / `merchant_guid` / `category_guid` fields. The entity is
5
5
  * carried only by the guid's prefix, so this maps a guid back onto the named `Logo` shape the
6
- * existing renderers (`SubHeader`, mxui logo components) already understand.
6
+ * existing renderer (`LogoMark`) already understands.
7
7
  *
8
8
  * An unrecognized prefix returns `undefined` rather than guessing: rendering a merchant logo for
9
9
  * an institution guid would silently show the wrong image.
@@ -14,7 +14,7 @@ export declare const logoFromEntityGuid: (guid?: string, alt?: string) => Logo |
14
14
  * header and the rows go through, so the two can never disagree about precedence:
15
15
  *
16
16
  * - `icon` becomes V1's `logo_name` / `logo_color` and wins over `guid`, as `logo_name` does in
17
- * `SubHeader`.
17
+ * `LogoMark`.
18
18
  * - Otherwise `guid` resolves by prefix (`logoFromEntityGuid`). For an `MCH-` guid, a `CAT-`
19
19
  * `fallback_guid` becomes the merchant's `category_guid`: `MerchantLogo` draws that category as a
20
20
  * tile when the merchant image fails to load, and without it the tile is the Uncategorized icon.
@@ -1 +1 @@
1
- {"version":3,"file":"EntityLogo.es.js","names":[],"sources":["../../../../src/insights-v2/components/shared/EntityLogo.tsx"],"sourcesContent":["import type { Logo, LogoRef } from '../../../core'\n\n/**\n * The V2 beat envelope (LargeTransactionV2 onward) sends an entity logo as an opaque guid instead\n * of V1's named `institution_guid` / `merchant_guid` / `category_guid` fields. The entity is\n * carried only by the guid's prefix, so this maps a guid back onto the named `Logo` shape the\n * existing renderers (`SubHeader`, mxui logo components) already understand.\n *\n * An unrecognized prefix returns `undefined` rather than guessing: rendering a merchant logo for\n * an institution guid would silently show the wrong image.\n */\nexport const logoFromEntityGuid = (guid?: string, alt?: string): Logo | undefined => {\n if (!guid) return undefined\n\n if (guid.startsWith('INS-')) {\n return { institution_guid: guid, institution_name: alt }\n }\n\n if (guid.startsWith('MCH-')) {\n return { merchant_guid: guid, merchant_name: alt }\n }\n\n if (guid.startsWith('CAT-')) {\n return { category_guid: guid, category_name: alt }\n }\n\n // MXUI defines no `ICO-` prefix: `ICO-<name>` is our own contract for a filled mx-icons icon.\n // Unlike the entity prefixes above, the name (not the whole guid) becomes `logo_name`, and it must\n // be a non-empty icon slug, so the prefix is stripped and the remainder validated.\n if (guid.startsWith('ICO-')) {\n const icon = guid.slice(4)\n\n return /^[a-z0-9_-]+$/.test(icon) ? { logo_fill: true, logo_name: icon } : undefined\n }\n return undefined\n}\n\n/**\n * Resolves a V2 `LogoRef` (header or row) onto the named `Logo` shape. The one mapping both the\n * header and the rows go through, so the two can never disagree about precedence:\n *\n * - `icon` becomes V1's `logo_name` / `logo_color` and wins over `guid`, as `logo_name` does in\n * `SubHeader`.\n * - Otherwise `guid` resolves by prefix (`logoFromEntityGuid`). For an `MCH-` guid, a `CAT-`\n * `fallback_guid` becomes the merchant's `category_guid`: `MerchantLogo` draws that category as a\n * tile when the merchant image fails to load, and without it the tile is the Uncategorized icon.\n * Only a category fallback is applied, because a category tile is the only fallback\n * `MerchantLogo` has.\n *\n * `fallbackAlt` names the logo when the ref carries no `alt` (rows pass their `primary_text`).\n */\nexport const logoFromRef = (ref?: LogoRef, fallbackAlt?: string): Logo | undefined => {\n if (!ref) return undefined\n\n if (ref.icon) {\n return { logo_color: ref.color, logo_name: ref.icon }\n }\n\n const logo = logoFromEntityGuid(ref.guid, ref.alt ?? fallbackAlt)\n if (logo?.logo_name) {\n return ref.color ? { ...logo, logo_color: ref.color } : logo\n }\n\n if (logo?.merchant_guid && ref.fallback_guid?.startsWith('CAT-')) {\n return { ...logo, category_guid: ref.fallback_guid }\n }\n\n return logo\n}\n"],"mappings":"AAWA,IAAa,IAAA,CAAsB,GAAe,MAAmC;AACnF,MAAK,GAEL;AAAA,QAAI,EAAK,WAAW,MAAM,EACxB,QAAO;AAAA,MAAE,kBAAkB;AAAA,MAAM,kBAAkB;AAAA,IAAI;AAGzD,QAAI,EAAK,WAAW,MAAM,EACxB,QAAO;AAAA,MAAE,eAAe;AAAA,MAAM,eAAe;AAAA,IAAI;AAGnD,QAAI,EAAK,WAAW,MAAM,EACxB,QAAO;AAAA,MAAE,eAAe;AAAA,MAAM,eAAe;AAAA,IAAI;AAMnD,QAAI,EAAK,WAAW,MAAM,GAAG;AAC3B,YAAM,IAAO,EAAK,MAAM,CAAC;AAEzB,aAAO,gBAAgB,KAAK,CAAI,IAAI;AAAA,QAAE,WAAW;AAAA,QAAM,WAAW;AAAA,MAAK,IAAI;AAAA,IAC7E;AAAA;AAEF,GAgBa,IAAA,CAAe,GAAe,MAA2C;AACpF,MAAI,CAAC,EAAK;AAEV,MAAI,EAAI,KACN,QAAO;AAAA,IAAE,YAAY,EAAI;AAAA,IAAO,WAAW,EAAI;AAAA,EAAK;AAGtD,QAAM,IAAO,EAAmB,EAAI,MAAM,EAAI,OAAO,CAAW;AAChE,SAAI,GAAM,YACD,EAAI,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAM,YAAY,EAAI;AAAA,EAAM,IAAI,IAGtD,GAAM,iBAAiB,EAAI,eAAe,WAAW,MAAM,IACtD;AAAA,IAAE,GAAG;AAAA,IAAM,eAAe,EAAI;AAAA,EAAc,IAG9C;AACT"}
1
+ {"version":3,"file":"EntityLogo.es.js","names":[],"sources":["../../../../src/insights-v2/components/shared/EntityLogo.tsx"],"sourcesContent":["import type { Logo, LogoRef } from '../../../core'\n\n/**\n * The V2 beat envelope (LargeTransactionV2 onward) sends an entity logo as an opaque guid instead\n * of V1's named `institution_guid` / `merchant_guid` / `category_guid` fields. The entity is\n * carried only by the guid's prefix, so this maps a guid back onto the named `Logo` shape the\n * existing renderer (`LogoMark`) already understands.\n *\n * An unrecognized prefix returns `undefined` rather than guessing: rendering a merchant logo for\n * an institution guid would silently show the wrong image.\n */\nexport const logoFromEntityGuid = (guid?: string, alt?: string): Logo | undefined => {\n if (!guid) return undefined\n\n if (guid.startsWith('INS-')) {\n return { institution_guid: guid, institution_name: alt }\n }\n\n if (guid.startsWith('MCH-')) {\n return { merchant_guid: guid, merchant_name: alt }\n }\n\n if (guid.startsWith('CAT-')) {\n return { category_guid: guid, category_name: alt }\n }\n\n // MXUI defines no `ICO-` prefix: `ICO-<name>` is our own contract for a filled mx-icons icon.\n // Unlike the entity prefixes above, the name (not the whole guid) becomes `logo_name`, and it must\n // be a non-empty icon slug, so the prefix is stripped and the remainder validated.\n if (guid.startsWith('ICO-')) {\n const icon = guid.slice(4)\n\n return /^[a-z0-9_-]+$/.test(icon) ? { logo_fill: true, logo_name: icon } : undefined\n }\n return undefined\n}\n\n/**\n * Resolves a V2 `LogoRef` (header or row) onto the named `Logo` shape. The one mapping both the\n * header and the rows go through, so the two can never disagree about precedence:\n *\n * - `icon` becomes V1's `logo_name` / `logo_color` and wins over `guid`, as `logo_name` does in\n * `LogoMark`.\n * - Otherwise `guid` resolves by prefix (`logoFromEntityGuid`). For an `MCH-` guid, a `CAT-`\n * `fallback_guid` becomes the merchant's `category_guid`: `MerchantLogo` draws that category as a\n * tile when the merchant image fails to load, and without it the tile is the Uncategorized icon.\n * Only a category fallback is applied, because a category tile is the only fallback\n * `MerchantLogo` has.\n *\n * `fallbackAlt` names the logo when the ref carries no `alt` (rows pass their `primary_text`).\n */\nexport const logoFromRef = (ref?: LogoRef, fallbackAlt?: string): Logo | undefined => {\n if (!ref) return undefined\n\n if (ref.icon) {\n return { logo_color: ref.color, logo_name: ref.icon }\n }\n\n const logo = logoFromEntityGuid(ref.guid, ref.alt ?? fallbackAlt)\n if (logo?.logo_name) {\n return ref.color ? { ...logo, logo_color: ref.color } : logo\n }\n\n if (logo?.merchant_guid && ref.fallback_guid?.startsWith('CAT-')) {\n return { ...logo, category_guid: ref.fallback_guid }\n }\n\n return logo\n}\n"],"mappings":"AAWA,IAAa,IAAA,CAAsB,GAAe,MAAmC;AACnF,MAAK,GAEL;AAAA,QAAI,EAAK,WAAW,MAAM,EACxB,QAAO;AAAA,MAAE,kBAAkB;AAAA,MAAM,kBAAkB;AAAA,IAAI;AAGzD,QAAI,EAAK,WAAW,MAAM,EACxB,QAAO;AAAA,MAAE,eAAe;AAAA,MAAM,eAAe;AAAA,IAAI;AAGnD,QAAI,EAAK,WAAW,MAAM,EACxB,QAAO;AAAA,MAAE,eAAe;AAAA,MAAM,eAAe;AAAA,IAAI;AAMnD,QAAI,EAAK,WAAW,MAAM,GAAG;AAC3B,YAAM,IAAO,EAAK,MAAM,CAAC;AAEzB,aAAO,gBAAgB,KAAK,CAAI,IAAI;AAAA,QAAE,WAAW;AAAA,QAAM,WAAW;AAAA,MAAK,IAAI;AAAA,IAC7E;AAAA;AAEF,GAgBa,IAAA,CAAe,GAAe,MAA2C;AACpF,MAAI,CAAC,EAAK;AAEV,MAAI,EAAI,KACN,QAAO;AAAA,IAAE,YAAY,EAAI;AAAA,IAAO,WAAW,EAAI;AAAA,EAAK;AAGtD,QAAM,IAAO,EAAmB,EAAI,MAAM,EAAI,OAAO,CAAW;AAChE,SAAI,GAAM,YACD,EAAI,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAM,YAAY,EAAI;AAAA,EAAM,IAAI,IAGtD,GAAM,iBAAiB,EAAI,eAAe,WAAW,MAAM,IACtD;AAAA,IAAE,GAAG;AAAA,IAAM,eAAe,EAAI;AAAA,EAAc,IAG9C;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.126",
3
+ "version": "9.7.128",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",