@mx-cartographer/experiences 9.7.39 → 9.7.40
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
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [9.7.40] - 10-23-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - date range year in the trends category details (MEW-4019)
|
|
4
|
+
|
|
1
5
|
## [9.7.39] - 10-23-2026
|
|
2
6
|
|
|
3
7
|
- **ADDED** - `account_list_block` action block for Monthly Obligations Status: the beat's calculation (current cash, estimated income, recurring expenses, remaining) from `drilldown_data`, then the accounts behind it from the account store with their total, behind "View accounts" on track and "View details" off track. Copy from the new `insights_feed.account_list` namespace; `formatSignedCurrency` moves from the Remaining Cash block to `core/utils/NumberFormatting`. Fixture, stories, tests and `docs/action-blocks/account-list-block.md` (MEW2-3363)
|
|
@@ -6,7 +6,7 @@ import { isBefore as u } from "date-fns/isBefore";
|
|
|
6
6
|
import { subMonths as m } from "date-fns/subMonths";
|
|
7
7
|
import { differenceInCalendarMonths as C } from "date-fns/differenceInCalendarMonths";
|
|
8
8
|
import { makeAutoObservable as S } from "mobx";
|
|
9
|
-
import { addSeconds as
|
|
9
|
+
import { addSeconds as T } from "date-fns/addSeconds";
|
|
10
10
|
var W = class {
|
|
11
11
|
globalStore;
|
|
12
12
|
selectedCategoryData = null;
|
|
@@ -14,7 +14,7 @@ var W = class {
|
|
|
14
14
|
visibleListLength = 5;
|
|
15
15
|
constructor(t) {
|
|
16
16
|
this.globalStore = t, this.selectedDateRange = {
|
|
17
|
-
start:
|
|
17
|
+
start: T(i(m(/* @__PURE__ */ new Date(), 6)), 1),
|
|
18
18
|
end: i(/* @__PURE__ */ new Date())
|
|
19
19
|
}, S(this);
|
|
20
20
|
}
|
|
@@ -54,7 +54,7 @@ var W = class {
|
|
|
54
54
|
return C(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
55
55
|
}
|
|
56
56
|
get selectedDateRangeMonthRange() {
|
|
57
|
-
return `${r(this.selectedDateRange.start, o.
|
|
57
|
+
return `${r(this.selectedDateRange.start, o.MONTH_SHORT_YEAR)} - ${r(this.selectedDateRange.end, o.MONTH_SHORT_YEAR)}`;
|
|
58
58
|
}
|
|
59
59
|
get visibleCategories() {
|
|
60
60
|
return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrendsStore.es.js","names":[],"sources":["../../../src/core/stores/TrendsStore.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\nimport { addSeconds } from 'date-fns/addSeconds'\nimport { differenceInCalendarMonths } from 'date-fns/differenceInCalendarMonths'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { subMonths } from 'date-fns/subMonths'\n\nimport type { DateRange, DetailedCategoryWithTransactions } from '../types'\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\nimport {\n buildCategoryDetailsChartData,\n filterAndSortCategoriesWithTransactions,\n} from '../utils/TrendsUtil'\nimport { findDetailedSubCategory, getDetailedCategoryTransactions } from '../utils/CategoryUtil'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class TrendsStore {\n globalStore: GlobalStore\n selectedCategoryData: DetailedCategoryWithTransactions | null = null\n selectedDateRange: DateRange\n visibleListLength: number = 5\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.selectedDateRange = {\n start: addSeconds(endOfMonth(subMonths(new Date(), 6)), 1),\n end: endOfMonth(new Date()),\n }\n makeAutoObservable(this)\n }\n\n setSelectedCategoryData = (data: DetailedCategoryWithTransactions | null) => {\n this.selectedCategoryData = data\n }\n\n /**\n * Resolve a category guid — top level or sub-category — to the data the\n * category details drawer renders.\n *\n * `detailedCategoriesWithTransactions` only holds top-level categories, and a\n * sub-category carries `totalAmount: 0` / `totalMonthlyAmounts: []` so it is\n * not double counted inside its parent. The drawer reads both fields, so a\n * sub-category is rebuilt from its own range total and monthly series.\n *\n * The tabular view only routes sub-category guids here today; the top-level\n * branch keeps this a complete resolver for any guid the drawer is given.\n * @param guid - Guid of the category to resolve\n */\n getCategoryWithTransactions = (guid: string): DetailedCategoryWithTransactions | undefined => {\n const { detailedCategories, detailedCategoriesWithTransactions } =\n this.globalStore.categoryStore\n\n const topLevelCategory = detailedCategoriesWithTransactions.find(\n (category) => category.guid === guid,\n )\n if (topLevelCategory) return topLevelCategory\n\n const subCategory = findDetailedSubCategory(detailedCategories, guid)\n if (!subCategory) return undefined\n\n const [subCategoryWithTransactions] = getDetailedCategoryTransactions(\n [\n {\n ...subCategory,\n totalAmount: subCategory.currentAmount,\n totalMonthlyAmounts: subCategory.monthlyAmounts,\n },\n ],\n this.globalStore.transactionStore.sortedTransactions,\n )\n\n return subCategoryWithTransactions\n }\n\n setSelectedDateRange = (dateRange: DateRange) => {\n this.selectedDateRange = dateRange\n }\n\n setVisibleListLength = (length: number) => {\n this.visibleListLength = length\n }\n\n get sortedDetailedCategoriesWithTransactions(): DetailedCategoryWithTransactions[] {\n return filterAndSortCategoriesWithTransactions(\n this.globalStore.categoryStore.detailedCategoriesWithTransactions,\n )\n }\n\n get isTransactionStoreIdle(): boolean {\n const { isTransactionDataLoaded, transactionsLoading } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !transactionsLoading\n }\n\n get isSelectedRangeLoaded(): boolean {\n const { isTransactionDataLoaded, cachedStartDate } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !isBefore(this.selectedDateRange.start, cachedStartDate)\n }\n\n get selectedDateRangeMonthCount(): number {\n return differenceInCalendarMonths(this.selectedDateRange.end, this.selectedDateRange.start) + 1\n }\n\n get selectedDateRangeMonthRange(): string {\n const startMonth = formatDate(this.selectedDateRange.start, DATE_FORMATS_INTL.
|
|
1
|
+
{"version":3,"file":"TrendsStore.es.js","names":[],"sources":["../../../src/core/stores/TrendsStore.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\nimport { addSeconds } from 'date-fns/addSeconds'\nimport { differenceInCalendarMonths } from 'date-fns/differenceInCalendarMonths'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { subMonths } from 'date-fns/subMonths'\n\nimport type { DateRange, DetailedCategoryWithTransactions } from '../types'\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\nimport {\n buildCategoryDetailsChartData,\n filterAndSortCategoriesWithTransactions,\n} from '../utils/TrendsUtil'\nimport { findDetailedSubCategory, getDetailedCategoryTransactions } from '../utils/CategoryUtil'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class TrendsStore {\n globalStore: GlobalStore\n selectedCategoryData: DetailedCategoryWithTransactions | null = null\n selectedDateRange: DateRange\n visibleListLength: number = 5\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.selectedDateRange = {\n start: addSeconds(endOfMonth(subMonths(new Date(), 6)), 1),\n end: endOfMonth(new Date()),\n }\n makeAutoObservable(this)\n }\n\n setSelectedCategoryData = (data: DetailedCategoryWithTransactions | null) => {\n this.selectedCategoryData = data\n }\n\n /**\n * Resolve a category guid — top level or sub-category — to the data the\n * category details drawer renders.\n *\n * `detailedCategoriesWithTransactions` only holds top-level categories, and a\n * sub-category carries `totalAmount: 0` / `totalMonthlyAmounts: []` so it is\n * not double counted inside its parent. The drawer reads both fields, so a\n * sub-category is rebuilt from its own range total and monthly series.\n *\n * The tabular view only routes sub-category guids here today; the top-level\n * branch keeps this a complete resolver for any guid the drawer is given.\n * @param guid - Guid of the category to resolve\n */\n getCategoryWithTransactions = (guid: string): DetailedCategoryWithTransactions | undefined => {\n const { detailedCategories, detailedCategoriesWithTransactions } =\n this.globalStore.categoryStore\n\n const topLevelCategory = detailedCategoriesWithTransactions.find(\n (category) => category.guid === guid,\n )\n if (topLevelCategory) return topLevelCategory\n\n const subCategory = findDetailedSubCategory(detailedCategories, guid)\n if (!subCategory) return undefined\n\n const [subCategoryWithTransactions] = getDetailedCategoryTransactions(\n [\n {\n ...subCategory,\n totalAmount: subCategory.currentAmount,\n totalMonthlyAmounts: subCategory.monthlyAmounts,\n },\n ],\n this.globalStore.transactionStore.sortedTransactions,\n )\n\n return subCategoryWithTransactions\n }\n\n setSelectedDateRange = (dateRange: DateRange) => {\n this.selectedDateRange = dateRange\n }\n\n setVisibleListLength = (length: number) => {\n this.visibleListLength = length\n }\n\n get sortedDetailedCategoriesWithTransactions(): DetailedCategoryWithTransactions[] {\n return filterAndSortCategoriesWithTransactions(\n this.globalStore.categoryStore.detailedCategoriesWithTransactions,\n )\n }\n\n get isTransactionStoreIdle(): boolean {\n const { isTransactionDataLoaded, transactionsLoading } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !transactionsLoading\n }\n\n get isSelectedRangeLoaded(): boolean {\n const { isTransactionDataLoaded, cachedStartDate } = this.globalStore.transactionStore\n return isTransactionDataLoaded && !isBefore(this.selectedDateRange.start, cachedStartDate)\n }\n\n get selectedDateRangeMonthCount(): number {\n return differenceInCalendarMonths(this.selectedDateRange.end, this.selectedDateRange.start) + 1\n }\n\n get selectedDateRangeMonthRange(): string {\n const startMonth = formatDate(this.selectedDateRange.start, DATE_FORMATS_INTL.MONTH_SHORT_YEAR)\n const endMonth = formatDate(this.selectedDateRange.end, DATE_FORMATS_INTL.MONTH_SHORT_YEAR)\n return `${startMonth} - ${endMonth}`\n }\n\n get visibleCategories(): DetailedCategoryWithTransactions[] {\n return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength)\n }\n\n get collapsedCategories(): DetailedCategoryWithTransactions[] {\n return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength)\n }\n\n get categoryDetailsChartData() {\n return buildCategoryDetailsChartData(\n this.selectedCategoryData,\n this.selectedDateRangeMonthCount,\n )\n }\n}\n"],"mappings":";;;;;;;;;AAiBA,IAAa,IAAb,MAAyB;AAAA,EACvB;AAAA,EACA,uBAAgE;AAAA,EAChE;AAAA,EACA,oB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