@mx-cartographer/experiences 9.4.12-alpha.al1 → 9.4.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 +3 -2
- package/dist/common/context/hooks.d.ts +1 -0
- package/dist/common/context/hooks.es.js +18 -17
- package/dist/common/context/hooks.es.js.map +1 -1
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +130 -129
- package/dist/common/utils/Theme.es.js +37 -37
- package/dist/common/utils/Theme.es.js.map +1 -1
- package/dist/core/stores/InsightsV2Store.d.ts +24 -7
- package/dist/core/stores/InsightsV2Store.es.js +18 -23
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/core/types/AppData.d.ts +8 -9
- package/dist/core/types/Client.d.ts +19 -19
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.d.ts +4 -27
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js +253 -206
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.d.ts +5 -4
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +12 -20
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/index.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.d.ts +9 -43
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js +12 -79
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js +35 -13
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +17 -13
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js +7 -7
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +17 -13
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +19 -25
- package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/createVariantBlock.d.ts +29 -0
- package/dist/insights-v2/blocks/createVariantBlock.es.js +13 -0
- package/dist/insights-v2/blocks/createVariantBlock.es.js.map +1 -0
- package/dist/insights-v2/components/chartblocks/BarchartV2.es.js +24 -25
- package/dist/insights-v2/components/chartblocks/BarchartV2.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +18 -19
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +52 -50
- package/dist/insights-v2/mappings/blocks.es.js +20 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
## [9.4.12] - 09-02-2026
|
|
2
2
|
|
|
3
|
-
- **CHANGED** - the
|
|
4
|
-
- **
|
|
3
|
+
- **CHANGED** - insights-v2 action drilldown refactor for readability: `InsightsV2Store`'s action drawer now carries an opaque `context` envelope (read via the new `useActionContext<T>()` hook) instead of block-specific fields, opened through a single generic `openActionDrawer`; added a `createVariantBlock` factory for variant→component dispatch with an unknown-variant fallback, and simplified `MakeTransferActionBlock`/`layout.ts` (WEC-1774)
|
|
4
|
+
- **ADDED** - `StepChartBlock` to the insights-v2 ChartBlocks barrel export (was missing from the public entry point) (WEC-1774)
|
|
5
|
+
- **FIXED** - insights-v2 post-review cleanups: `BudgetBlock` icon computed as a JSX element instead of a component defined during render (avoids remount); `DonutChart` uses a data-driven React key; removed dead `.recharts-wrapper` selectors from `DoubleBarChart`/`BarchartV2`; wrapped `DefaultPlaceholder` in `observer`; oxfmt formatting in the figma-to-code script (WEC-1774)
|
|
5
6
|
|
|
6
7
|
## [9.4.11] - 09-02-2026
|
|
7
8
|
|
|
@@ -15,6 +15,7 @@ export declare const useGoalStore: () => import('../../core').GoalStore;
|
|
|
15
15
|
export declare const useHelpStore: () => import('../../core').HelpStore;
|
|
16
16
|
export declare const useHoldingStore: () => import('../../core').HoldingStore;
|
|
17
17
|
export declare const useInsightsV2Store: () => import('../../core').InsightsV2Store;
|
|
18
|
+
export declare const useActionContext: <T>() => T | undefined;
|
|
18
19
|
export declare const useMerchantStore: () => import('../../core').MerchantStore;
|
|
19
20
|
export declare const useNetWorthStore: () => import('../../core').NetWorthStore;
|
|
20
21
|
export declare const useNotificationStore: () => import('../../core').NotificationStore;
|
|
@@ -5,13 +5,14 @@ var e = (t = "useGlobalStore") => {
|
|
|
5
5
|
const o = r.useContext(a);
|
|
6
6
|
if (!o) throw new Error(`${t}() must be used within the GlobalDataContext`);
|
|
7
7
|
return o;
|
|
8
|
-
}, i = () => e("useAccountStore").globalStore.accountStore, g = () => e("useAppConfig").globalStore.appDataStore.appConfig, b = () => e("useAnalyticsStore").globalStore.analyticsStore, c = () => e("useBudgetsStore").globalStore.budgetsStore, v = () => e("useCashflowStore").globalStore.cashflowStore, C = () => e("useCategoryStore").globalStore.categoryStore, d = () => e("useConnectStore").globalStore.connectStore, h = () => e("useDebtsStore").globalStore.debtsStore, p = () => e("useFinstrongStore").globalStore.finstrongStore, f = () => e("useGlobalStore").globalStore,
|
|
8
|
+
}, i = () => e("useAccountStore").globalStore.accountStore, g = () => e("useAppConfig").globalStore.appDataStore.appConfig, b = () => e("useAnalyticsStore").globalStore.analyticsStore, c = () => e("useBudgetsStore").globalStore.budgetsStore, v = () => e("useCashflowStore").globalStore.cashflowStore, C = () => e("useCategoryStore").globalStore.categoryStore, d = () => e("useConnectStore").globalStore.connectStore, h = () => e("useDebtsStore").globalStore.debtsStore, p = () => e("useFinstrongStore").globalStore.finstrongStore, f = () => e("useGlobalStore").globalStore, x = () => e("useGlobalUiStore").globalStore.globalUiStore, w = () => e("globalCopyStore").globalStore.copyStore.copy, G = () => e("useGoalStore").globalStore.goalStore, y = () => e("useHelpStore").globalStore.helpStore, m = () => e("useHoldingStore").globalStore.holdingStore, A = () => e("useInsightsV2Store").globalStore.insightsV2Store, E = () => e("useActionContext").globalStore.insightsV2Store.actionDrawer.context, W = () => e("useMerchantStore").globalStore.merchantStore, D = () => e("useNetWorthStore").globalStore.netWorthStore, T = () => e("useNotificationStore").globalStore.notificationStore, V = () => e("useRecurringTransactionsStore").globalStore.recurringTransactionsStore, U = () => e("useSettingsStore").globalStore.settingsStore, H = () => e("useTransactionStore").globalStore.transactionStore, N = () => e("useTrendsStore").globalStore.trendsStore, P = () => e("useUserStore").globalStore.userStore, L = () => ({ onError: e().onError }), R = () => ({ onEvent: e().onEvent }), B = () => ({ onLoad: e().onLoad }), F = () => ({ onPageView: e().onPageView }), n = (t = "useWidgetContainerContext") => {
|
|
9
9
|
const o = r.useContext(s);
|
|
10
10
|
if (!o) throw new Error(`${t}() must be used within the WidgetContainerContext`);
|
|
11
11
|
return o;
|
|
12
|
-
},
|
|
12
|
+
}, I = () => n();
|
|
13
13
|
export {
|
|
14
14
|
i as useAccountStore,
|
|
15
|
+
E as useActionContext,
|
|
15
16
|
b as useAnalyticsStore,
|
|
16
17
|
g as useAppConfig,
|
|
17
18
|
c as useBudgetsStore,
|
|
@@ -19,29 +20,29 @@ export {
|
|
|
19
20
|
C as useCategoryStore,
|
|
20
21
|
d as useConnectStore,
|
|
21
22
|
h as useDebtStore,
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
L as useError,
|
|
24
|
+
R as useEvent,
|
|
24
25
|
p as useFinstrongStore,
|
|
25
|
-
|
|
26
|
+
w as useGlobalCopyStore,
|
|
26
27
|
e as useGlobalDataContext,
|
|
27
28
|
f as useGlobalStore,
|
|
28
|
-
|
|
29
|
+
x as useGlobalUiStore,
|
|
29
30
|
G as useGoalStore,
|
|
30
31
|
y as useHelpStore,
|
|
31
32
|
m as useHoldingStore,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
A as useInsightsV2Store,
|
|
34
|
+
B as useLoad,
|
|
34
35
|
W as useMerchantStore,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
D as useNetWorthStore,
|
|
37
|
+
T as useNotificationStore,
|
|
38
|
+
F as usePageView,
|
|
39
|
+
V as useRecurringTransactionsStore,
|
|
40
|
+
U as useSettingsStore,
|
|
41
|
+
H as useTransactionStore,
|
|
42
|
+
N as useTrendsStore,
|
|
43
|
+
P as useUserStore,
|
|
43
44
|
n as useWidgetContainerContext,
|
|
44
|
-
|
|
45
|
+
I as useWidgetContainerProvider
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
//# sourceMappingURL=hooks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.es.js","names":[],"sources":["../../../src/common/context/hooks.tsx"],"sourcesContent":["import React from 'react'\nimport { GlobalDataContext } from './GlobalDataProvider'\nimport { WidgetContainerContext } from './WidgetContainerProvider'\n\nexport const useGlobalDataContext = (providerName = 'useGlobalStore') => {\n const context = React.useContext(GlobalDataContext)\n\n if (!context) {\n throw new Error(`${providerName}() must be used within the GlobalDataContext`)\n }\n return context\n}\n\nexport const useAccountStore = () =>\n useGlobalDataContext('useAccountStore').globalStore.accountStore\nexport const useAppConfig = () =>\n useGlobalDataContext('useAppConfig').globalStore.appDataStore.appConfig\nexport const useAnalyticsStore = () =>\n useGlobalDataContext('useAnalyticsStore').globalStore.analyticsStore\nexport const useBudgetsStore = () =>\n useGlobalDataContext('useBudgetsStore').globalStore.budgetsStore\nexport const useCashflowStore = () =>\n useGlobalDataContext('useCashflowStore').globalStore.cashflowStore\nexport const useCategoryStore = () =>\n useGlobalDataContext('useCategoryStore').globalStore.categoryStore\nexport const useConnectStore = () =>\n useGlobalDataContext('useConnectStore').globalStore.connectStore\nexport const useDebtStore = () => useGlobalDataContext('useDebtsStore').globalStore.debtsStore\nexport const useFinstrongStore = () =>\n useGlobalDataContext('useFinstrongStore').globalStore.finstrongStore\nexport const useGlobalStore = () => useGlobalDataContext('useGlobalStore').globalStore\nexport const useGlobalUiStore = () =>\n useGlobalDataContext('useGlobalUiStore').globalStore.globalUiStore\nexport const useGlobalCopyStore = () =>\n useGlobalDataContext('globalCopyStore').globalStore.copyStore.copy\nexport const useGoalStore = () => useGlobalDataContext('useGoalStore').globalStore.goalStore\nexport const useHelpStore = () => useGlobalDataContext('useHelpStore').globalStore.helpStore\nexport const useHoldingStore = () =>\n useGlobalDataContext('useHoldingStore').globalStore.holdingStore\nexport const useInsightsV2Store = () =>\n useGlobalDataContext('useInsightsV2Store').globalStore.insightsV2Store\nexport const useMerchantStore = () =>\n useGlobalDataContext('useMerchantStore').globalStore.merchantStore\nexport const useNetWorthStore = () =>\n useGlobalDataContext('useNetWorthStore').globalStore.netWorthStore\nexport const useNotificationStore = () =>\n useGlobalDataContext('useNotificationStore').globalStore.notificationStore\nexport const useRecurringTransactionsStore = () =>\n useGlobalDataContext('useRecurringTransactionsStore').globalStore.recurringTransactionsStore\nexport const useSettingsStore = () =>\n useGlobalDataContext('useSettingsStore').globalStore.settingsStore\nexport const useTransactionStore = () =>\n useGlobalDataContext('useTransactionStore').globalStore.transactionStore\nexport const useTrendsStore = () => useGlobalDataContext('useTrendsStore').globalStore.trendsStore\nexport const useUserStore = () => useGlobalDataContext('useUserStore').globalStore.userStore\n\nexport const useError = () => ({ onError: useGlobalDataContext().onError })\nexport const useEvent = () => ({ onEvent: useGlobalDataContext().onEvent })\nexport const useLoad = () => ({ onLoad: useGlobalDataContext().onLoad })\nexport const usePageView = () => ({ onPageView: useGlobalDataContext().onPageView })\n\nexport const useWidgetContainerContext = (providerName = 'useWidgetContainerContext') => {\n const context = React.useContext(WidgetContainerContext)\n\n if (!context) {\n throw new Error(`${providerName}() must be used within the WidgetContainerContext`)\n }\n\n return context\n}\n\nexport const useWidgetContainerProvider = () => useWidgetContainerContext()\n"],"mappings":";;;AAIA,IAAa,IAAA,CAAwB,IAAe,qBAAqB;AACvE,QAAM,IAAU,EAAM,WAAW,CAAiB;AAElD,MAAI,CAAC,EACH,OAAM,IAAI,MAAM,GAAG,CAAA,8CAA0D;AAE/E,SAAO;AACT,GAEa,IAAA,MACX,EAAqB,iBAAiB,EAAE,YAAY,cACzC,IAAA,MACX,EAAqB,cAAc,EAAE,YAAY,aAAa,WACnD,IAAA,MACX,EAAqB,mBAAmB,EAAE,YAAY,gBAC3C,IAAA,MACX,EAAqB,iBAAiB,EAAE,YAAY,cACzC,IAAA,MACX,EAAqB,kBAAkB,EAAE,YAAY,eAC1C,IAAA,MACX,EAAqB,kBAAkB,EAAE,YAAY,eAC1C,IAAA,MACX,EAAqB,iBAAiB,EAAE,YAAY,cACzC,IAAA,MAAqB,EAAqB,eAAe,EAAE,YAAY,YACvE,IAAA,MACX,EAAqB,mBAAmB,EAAE,YAAY,gBAC3C,IAAA,MAAuB,EAAqB,gBAAgB,EAAE,aAC9D,IAAA,MACX,EAAqB,kBAAkB,EAAE,YAAY,eAC1C,IAAA,MACX,EAAqB,iBAAiB,EAAE,YAAY,UAAU,MACnD,IAAA,MAAqB,EAAqB,cAAc,EAAE,YAAY,WACtE,IAAA,MAAqB,EAAqB,cAAc,EAAE,YAAY,WACtE,IAAA,MACX,EAAqB,iBAAiB,EAAE,YAAY,cACzC,IAAA,MACX,EAAqB,oBAAoB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"hooks.es.js","names":[],"sources":["../../../src/common/context/hooks.tsx"],"sourcesContent":["import React from 'react'\nimport { GlobalDataContext } from './GlobalDataProvider'\nimport { WidgetContainerContext } from './WidgetContainerProvider'\n\nexport const useGlobalDataContext = (providerName = 'useGlobalStore') => {\n const context = React.useContext(GlobalDataContext)\n\n if (!context) {\n throw new Error(`${providerName}() must be used within the GlobalDataContext`)\n }\n return context\n}\n\nexport const useAccountStore = () =>\n useGlobalDataContext('useAccountStore').globalStore.accountStore\nexport const useAppConfig = () =>\n useGlobalDataContext('useAppConfig').globalStore.appDataStore.appConfig\nexport const useAnalyticsStore = () =>\n useGlobalDataContext('useAnalyticsStore').globalStore.analyticsStore\nexport const useBudgetsStore = () =>\n useGlobalDataContext('useBudgetsStore').globalStore.budgetsStore\nexport const useCashflowStore = () =>\n useGlobalDataContext('useCashflowStore').globalStore.cashflowStore\nexport const useCategoryStore = () =>\n useGlobalDataContext('useCategoryStore').globalStore.categoryStore\nexport const useConnectStore = () =>\n useGlobalDataContext('useConnectStore').globalStore.connectStore\nexport const useDebtStore = () => useGlobalDataContext('useDebtsStore').globalStore.debtsStore\nexport const useFinstrongStore = () =>\n useGlobalDataContext('useFinstrongStore').globalStore.finstrongStore\nexport const useGlobalStore = () => useGlobalDataContext('useGlobalStore').globalStore\nexport const useGlobalUiStore = () =>\n useGlobalDataContext('useGlobalUiStore').globalStore.globalUiStore\nexport const useGlobalCopyStore = () =>\n useGlobalDataContext('globalCopyStore').globalStore.copyStore.copy\nexport const useGoalStore = () => useGlobalDataContext('useGoalStore').globalStore.goalStore\nexport const useHelpStore = () => useGlobalDataContext('useHelpStore').globalStore.helpStore\nexport const useHoldingStore = () =>\n useGlobalDataContext('useHoldingStore').globalStore.holdingStore\nexport const useInsightsV2Store = () =>\n useGlobalDataContext('useInsightsV2Store').globalStore.insightsV2Store\n// Typed accessor for the action drawer's opaque, block-specific context. The\n// reading component must be an `observer` (the store read is what tracks it).\nexport const useActionContext = <T,>(): T | undefined =>\n useGlobalDataContext('useActionContext').globalStore.insightsV2Store.actionDrawer.context as\n | T\n | undefined\nexport const useMerchantStore = () =>\n useGlobalDataContext('useMerchantStore').globalStore.merchantStore\nexport const useNetWorthStore = () =>\n useGlobalDataContext('useNetWorthStore').globalStore.netWorthStore\nexport const useNotificationStore = () =>\n useGlobalDataContext('useNotificationStore').globalStore.notificationStore\nexport const useRecurringTransactionsStore = () =>\n useGlobalDataContext('useRecurringTransactionsStore').globalStore.recurringTransactionsStore\nexport const useSettingsStore = () =>\n useGlobalDataContext('useSettingsStore').globalStore.settingsStore\nexport const useTransactionStore = () =>\n useGlobalDataContext('useTransactionStore').globalStore.transactionStore\nexport const useTrendsStore = () => useGlobalDataContext('useTrendsStore').globalStore.trendsStore\nexport const useUserStore = () => useGlobalDataContext('useUserStore').globalStore.userStore\n\nexport const useError = () => ({ onError: useGlobalDataContext().onError })\nexport const useEvent = () => ({ onEvent: useGlobalDataContext().onEvent })\nexport const useLoad = () => ({ onLoad: useGlobalDataContext().onLoad })\nexport const usePageView = () => ({ onPageView: useGlobalDataContext().onPageView })\n\nexport const useWidgetContainerContext = (providerName = 'useWidgetContainerContext') => {\n const context = React.useContext(WidgetContainerContext)\n\n if (!context) {\n throw new Error(`${providerName}() must be used within the WidgetContainerContext`)\n }\n\n return context\n}\n\nexport const useWidgetContainerProvider = () => useWidgetContainerContext()\n"],"mappings":";;;AAIA,IAAa,IAAA,CAAwB,IAAe,qBAAqB;AACvE,QAAM,IAAU,EAAM,WAAW,CAAiB;AAElD,MAAI,CAAC,EACH,OAAM,IAAI,MAAM,GAAG,CAAA,8CAA0D;AAE/E,SAAO;AACT,GAEa,IAAA,MACX,EAAqB,iBAAiB,EAAE,YAAY,cACzC,IAAA,MACX,EAAqB,cAAc,EAAE,YAAY,aAAa,WACnD,IAAA,MACX,E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,YAAY,EAAqB,EAAE,WAAW,IAErE,IAAA,CAA6B,IAAe,gCAAgC;AACvF,QAAM,IAAU,EAAM,WAAW,CAAsB;AAEvD,MAAI,CAAC,EACH,OAAM,IAAI,MAAM,GAAG,CAAA,mDAA+D;AAGpF,SAAO;AACT,GAEa,IAAA,MAAmC,EAA0B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { useAccountStore, useAppConfig, useBudgetsStore, useCashflowStore, useCategoryStore, useDebtStore, useError, useEvent, useLoad, useFinstrongStore, useGlobalStore, useGlobalUiStore, useGlobalCopyStore, useGoalStore, useHelpStore, useHoldingStore, useInsightsV2Store, useMerchantStore, useNetWorthStore, useNotificationStore, usePageView, useRecurringTransactionsStore, useSettingsStore, useTransactionStore, useTrendsStore, useUserStore, useWidgetContainerProvider, } from './hooks';
|
|
1
|
+
export { useAccountStore, useAppConfig, useBudgetsStore, useCashflowStore, useCategoryStore, useDebtStore, useError, useEvent, useLoad, useFinstrongStore, useGlobalStore, useGlobalUiStore, useGlobalCopyStore, useGoalStore, useHelpStore, useHoldingStore, useInsightsV2Store, useActionContext, useMerchantStore, useNetWorthStore, useNotificationStore, usePageView, useRecurringTransactionsStore, useSettingsStore, useTransactionStore, useTrendsStore, useUserStore, useWidgetContainerProvider, } from './hooks';
|
|
2
2
|
export { GlobalDataContext, GlobalDataProvider } from './GlobalDataProvider';
|
|
3
3
|
export { WidgetContainerContext, WidgetContainerProvider } from './WidgetContainerProvider';
|
package/dist/common/index.es.js
CHANGED
|
@@ -2,158 +2,159 @@ import { buildDynamicCopy as r, buildPluralCopy as t } from "../core/utils/Local
|
|
|
2
2
|
import m, { CalendarSelectionTypes as i } from "./components/calendar/Calendar.es.js";
|
|
3
3
|
import a from "./components/charts/StatusBar.es.js";
|
|
4
4
|
import p from "./components/charts/Donut.es.js";
|
|
5
|
-
import
|
|
5
|
+
import f from "./hooks/useAccountDisplayName.es.js";
|
|
6
6
|
import { useCombineEvents as C, useCombinePageviews as S } from "./hooks/useCombineEvents.es.js";
|
|
7
7
|
import { GlobalDataContext as c, GlobalDataProvider as T } from "./context/GlobalDataProvider.es.js";
|
|
8
8
|
import { WidgetContainerContext as E, WidgetContainerProvider as D } from "./context/WidgetContainerProvider.es.js";
|
|
9
|
-
import { useAccountStore as _,
|
|
10
|
-
import { useInsightsEnabled as
|
|
11
|
-
import { useScreenSize as
|
|
12
|
-
import
|
|
13
|
-
import { useWidgetHeaderStyles as
|
|
14
|
-
import { useWidgetLoadTimer as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
9
|
+
import { useAccountStore as _, useActionContext as N, useAppConfig as A, useBudgetsStore as y, useCashflowStore as P, useCategoryStore as b, useDebtStore as O, useError as G, useEvent as W, useFinstrongStore as L, useGlobalCopyStore as R, useGlobalStore as U, useGlobalUiStore as v, useGoalStore as B, useHelpStore as h, useHoldingStore as w, useInsightsV2Store as x, useLoad as M, useMerchantStore as Y, useNetWorthStore as H, useNotificationStore as F, usePageView as z, useRecurringTransactionsStore as V, useSettingsStore as k, useTransactionStore as q, useTrendsStore as K, useUserStore as Z, useWidgetContainerProvider as j } from "./context/hooks.es.js";
|
|
10
|
+
import { useInsightsEnabled as Q } from "./hooks/useInsightsEnabled.es.js";
|
|
11
|
+
import { useScreenSize as $ } from "./hooks/useScreenSize.es.js";
|
|
12
|
+
import ro from "./hooks/usePrevious.es.js";
|
|
13
|
+
import { useWidgetHeaderStyles as eo } from "./hooks/useWidgetHeaderStyles.es.js";
|
|
14
|
+
import { useWidgetLoadTimer as io } from "./hooks/useWidgetLoadTimer.es.js";
|
|
15
|
+
import ao from "./components/dialog/Dialog.es.js";
|
|
16
|
+
import po from "./components/drawer/Drawer.es.js";
|
|
17
17
|
import fo from "./components/daterangeselector/DateRangeSelector.es.js";
|
|
18
|
-
import { ANALYTICS_EVENTS as
|
|
19
|
-
import { CONNECTIONS_WIDGET_ID as
|
|
20
|
-
import { formatCurrency as
|
|
21
|
-
import { GlobalStore as
|
|
22
|
-
import { INCOME_ACCOUNT_TYPES as
|
|
23
|
-
import { RECURRENCE_COPY as
|
|
24
|
-
import { LOADING_STATUS as
|
|
25
|
-
import { DEFAULT_DONUT_SIZE as
|
|
26
|
-
import { Sizes as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import { GlobalAccountFilter as
|
|
34
|
-
import
|
|
35
|
-
import { WidgetContainer as
|
|
36
|
-
import
|
|
37
|
-
import
|
|
18
|
+
import { ANALYTICS_EVENTS as Co } from "./constants/Analytics.es.js";
|
|
19
|
+
import { CONNECTIONS_WIDGET_ID as go, CONNECT_WIDGET_ID as co, MemberConnectionStatus as To } from "./constants/Connect.es.js";
|
|
20
|
+
import { formatCurrency as Do, formatOrdinal as Io, formatPercentage as _o, generateEqualIntervals as No, getCurrencyCodes as Ao, getPluralRules as yo } from "../core/utils/NumberFormatting.es.js";
|
|
21
|
+
import { GlobalStore as bo } from "../core/stores/GlobalStore.es.js";
|
|
22
|
+
import { INCOME_ACCOUNT_TYPES as Go, PAYMENT_ACCOUNT_TYPES as Wo, SPENDING_ACCOUNT_TYPES as Lo } from "./constants/Account.es.js";
|
|
23
|
+
import { RECURRENCE_COPY as Uo } from "./constants/ScheduledPayment.es.js";
|
|
24
|
+
import { LOADING_STATUS as Bo } from "./constants/SpendingPlan.es.js";
|
|
25
|
+
import { DEFAULT_DONUT_SIZE as wo, DEFAULT_STROKE_WIDTH as xo } from "./constants/Donut.es.js";
|
|
26
|
+
import { Sizes as Yo, TOUCH_TARGET as Ho } from "./constants/Sizes.es.js";
|
|
27
|
+
import zo from "./components/donuts/MultiSegmentDonut.es.js";
|
|
28
|
+
import ko from "./components/donuts/SingleSegmentDonut.es.js";
|
|
29
|
+
import Ko from "./components/ErrorBoundary.es.js";
|
|
30
|
+
import jo from "./components/Error.es.js";
|
|
31
|
+
import Qo from "./components/MicroWidgetContainer.es.js";
|
|
32
|
+
import $o from "./components/MiniWidgetContainer.es.js";
|
|
33
|
+
import { GlobalAccountFilter as rr } from "./components/GlobalAccountFilter.es.js";
|
|
34
|
+
import er from "./components/Loader.es.js";
|
|
35
|
+
import { WidgetContainer as ir } from "./components/WidgetContainer.es.js";
|
|
36
|
+
import ar from "./components/ConnectDrawer.es.js";
|
|
37
|
+
import pr from "./components/CurrencyDialog.es.js";
|
|
38
38
|
import fr from "./components/CurrencyInput.es.js";
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
39
|
+
import Cr from "./components/ResponsiveButton.es.js";
|
|
40
|
+
import gr from "./components/SearchBox.es.js";
|
|
41
|
+
import Tr from "./components/SelectionBox.es.js";
|
|
42
|
+
import Er from "./components/TabContentContainer.es.js";
|
|
43
|
+
import Ir from "./components/IconBacking.es.js";
|
|
44
|
+
import Nr from "./components/DataRow.es.js";
|
|
45
45
|
import yr from "./components/InformationTooltip.es.js";
|
|
46
|
-
import { ConnectCard as
|
|
47
|
-
import { CurrencyText as
|
|
48
|
-
import { EmptyState as
|
|
49
|
-
import { ListItemAction as
|
|
50
|
-
import { ListItemRow as
|
|
51
|
-
import { ListItemWrapper as
|
|
52
|
-
import { Select as
|
|
53
|
-
import { ToggleButtonListItem as
|
|
54
|
-
import { ToggleListItem as
|
|
55
|
-
import { analyticsSession as
|
|
56
|
-
import { getClientComponentOverrides as
|
|
46
|
+
import { ConnectCard as br } from "./components/ConnectCard.es.js";
|
|
47
|
+
import { CurrencyText as Gr } from "./components/CurrencyText.es.js";
|
|
48
|
+
import { EmptyState as Lr } from "./components/EmptyState.es.js";
|
|
49
|
+
import { ListItemAction as Ur } from "./components/ListItemAction.es.js";
|
|
50
|
+
import { ListItemRow as Br } from "./components/ListItemRow.es.js";
|
|
51
|
+
import { ListItemWrapper as wr } from "./components/ListItemWrapper.es.js";
|
|
52
|
+
import { Select as Mr } from "./components/Select.es.js";
|
|
53
|
+
import { ToggleButtonListItem as Hr } from "./components/listitems/ToggleButtonListItem.es.js";
|
|
54
|
+
import { ToggleListItem as zr } from "./components/listitems/ToggleListItem.es.js";
|
|
55
|
+
import { analyticsSession as kr } from "./utils/Analytics.es.js";
|
|
56
|
+
import { getClientComponentOverrides as Kr, getClientCustomizations as Zr, getClientPaletteOptions as jr, getClientTheme as Jr } from "./utils/Theme.es.js";
|
|
57
57
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
Co as ANALYTICS_EVENTS,
|
|
59
|
+
go as CONNECTIONS_WIDGET_ID,
|
|
60
|
+
co as CONNECT_WIDGET_ID,
|
|
61
61
|
m as Calendar,
|
|
62
62
|
i as CalendarSelectionTypes,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
br as ConnectCard,
|
|
64
|
+
ar as ConnectDrawer,
|
|
65
|
+
pr as CurrencyDialog,
|
|
66
66
|
fr as CurrencyInput,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
Gr as CurrencyText,
|
|
68
|
+
wo as DEFAULT_DONUT_SIZE,
|
|
69
|
+
xo as DEFAULT_STROKE_WIDTH,
|
|
70
|
+
Nr as DataRow,
|
|
71
71
|
fo as DateRangeSelector,
|
|
72
|
-
|
|
72
|
+
ao as Dialog,
|
|
73
73
|
p as Donut,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
po as Drawer,
|
|
75
|
+
Lr as EmptyState,
|
|
76
|
+
jo as Error,
|
|
77
|
+
Ko as ErrorBoundary,
|
|
78
|
+
rr as GlobalAccountFilter,
|
|
79
79
|
c as GlobalDataContext,
|
|
80
80
|
T as GlobalDataProvider,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
bo as GlobalStore,
|
|
82
|
+
Go as INCOME_ACCOUNT_TYPES,
|
|
83
|
+
Ir as IconBacking,
|
|
84
84
|
yr as InformationTooltip,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
Bo as LOADING_STATUS,
|
|
86
|
+
Ur as ListItemAction,
|
|
87
|
+
Br as ListItemRow,
|
|
88
|
+
wr as ListItemWrapper,
|
|
89
|
+
er as Loader,
|
|
90
|
+
To as MemberConnectionStatus,
|
|
91
|
+
Qo as MicroWidgetContainer,
|
|
92
|
+
$o as MiniWidgetContainer,
|
|
93
|
+
zo as MultiSegmentDonut,
|
|
94
|
+
Wo as PAYMENT_ACCOUNT_TYPES,
|
|
95
|
+
Uo as RECURRENCE_COPY,
|
|
96
|
+
Cr as ResponsiveButton,
|
|
97
|
+
Lo as SPENDING_ACCOUNT_TYPES,
|
|
98
|
+
gr as SearchBox,
|
|
99
|
+
Mr as Select,
|
|
100
|
+
Tr as SelectionBox,
|
|
101
|
+
ko as SingleSegmentDonut,
|
|
102
|
+
Yo as Sizes,
|
|
103
103
|
a as StatusBar,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
Ho as TOUCH_TARGET,
|
|
105
|
+
Er as TabContentContainer,
|
|
106
|
+
Hr as ToggleButtonListItem,
|
|
107
|
+
zr as ToggleListItem,
|
|
108
|
+
ir as WidgetContainer,
|
|
109
109
|
E as WidgetContainerContext,
|
|
110
110
|
D as WidgetContainerProvider,
|
|
111
|
-
|
|
111
|
+
kr as analyticsSession,
|
|
112
112
|
r as buildDynamicCopy,
|
|
113
113
|
t as buildPluralCopy,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
Do as formatCurrency,
|
|
115
|
+
Io as formatOrdinal,
|
|
116
|
+
_o as formatPercentage,
|
|
117
|
+
No as generateEqualIntervals,
|
|
118
|
+
Kr as getClientComponentOverrides,
|
|
119
|
+
Zr as getClientCustomizations,
|
|
120
|
+
jr as getClientPaletteOptions,
|
|
121
|
+
Jr as getClientTheme,
|
|
122
|
+
Ao as getCurrencyCodes,
|
|
123
123
|
yo as getPluralRules,
|
|
124
|
-
|
|
124
|
+
f as useAccountDisplayName,
|
|
125
125
|
_ as useAccountStore,
|
|
126
|
-
N as
|
|
126
|
+
N as useActionContext,
|
|
127
|
+
A as useAppConfig,
|
|
127
128
|
y as useBudgetsStore,
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
P as useCashflowStore,
|
|
130
|
+
b as useCategoryStore,
|
|
130
131
|
C as useCombineEvents,
|
|
131
132
|
S as useCombinePageviews,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
133
|
+
O as useDebtStore,
|
|
134
|
+
G as useError,
|
|
135
|
+
W as useEvent,
|
|
136
|
+
L as useFinstrongStore,
|
|
137
|
+
R as useGlobalCopyStore,
|
|
138
|
+
U as useGlobalStore,
|
|
139
|
+
v as useGlobalUiStore,
|
|
140
|
+
B as useGoalStore,
|
|
141
|
+
h as useHelpStore,
|
|
142
|
+
w as useHoldingStore,
|
|
143
|
+
Q as useInsightsEnabled,
|
|
144
|
+
x as useInsightsV2Store,
|
|
145
|
+
M as useLoad,
|
|
146
|
+
Y as useMerchantStore,
|
|
147
|
+
H as useNetWorthStore,
|
|
148
|
+
F as useNotificationStore,
|
|
149
|
+
z as usePageView,
|
|
150
|
+
ro as usePrevious,
|
|
151
|
+
V as useRecurringTransactionsStore,
|
|
152
|
+
$ as useScreenSize,
|
|
153
|
+
k as useSettingsStore,
|
|
154
|
+
q as useTransactionStore,
|
|
155
|
+
K as useTrendsStore,
|
|
156
|
+
Z as useUserStore,
|
|
157
|
+
j as useWidgetContainerProvider,
|
|
158
|
+
eo as useWidgetHeaderStyles,
|
|
159
|
+
io as useWidgetLoadTimer
|
|
159
160
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { alpha as h, darken as
|
|
2
|
-
var
|
|
1
|
+
import { alpha as h, darken as y, lighten as b } from "@mui/material";
|
|
2
|
+
var x = [
|
|
3
3
|
"fontFamily",
|
|
4
4
|
"h1",
|
|
5
5
|
"h2",
|
|
@@ -11,7 +11,7 @@ var M = [
|
|
|
11
11
|
"subtitle1",
|
|
12
12
|
"subtitle2",
|
|
13
13
|
"tiny"
|
|
14
|
-
],
|
|
14
|
+
], v = [
|
|
15
15
|
{
|
|
16
16
|
key: "primary",
|
|
17
17
|
override: "primary_color",
|
|
@@ -48,23 +48,23 @@ var M = [
|
|
|
48
48
|
light: "success_color",
|
|
49
49
|
dark: "success_color_dark"
|
|
50
50
|
}
|
|
51
|
-
],
|
|
51
|
+
], O = [...v, {
|
|
52
52
|
key: "grey",
|
|
53
53
|
override: "neutral_color",
|
|
54
54
|
light: "neutral_color",
|
|
55
55
|
dark: "neutral_color_dark"
|
|
56
|
-
}],
|
|
57
|
-
const
|
|
58
|
-
for (const { key: k, override:
|
|
59
|
-
const
|
|
60
|
-
|
|
56
|
+
}], T = (r, t, a, i) => {
|
|
57
|
+
const d = t === "dark", s = i ?? r?.mode ?? t, e = {};
|
|
58
|
+
for (const { key: k, override: R, light: C, dark: f } of O) {
|
|
59
|
+
const g = a?.[R] ?? r?.[d ? f : C];
|
|
60
|
+
g && (e[k] = g);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const p = d && s !== "browser", _ = (k) => p ? { dark: k } : { light: k }, n = a?.background_color ?? r?.background_color, c = a?.paper_color ?? r?.paper_color;
|
|
63
63
|
(n || c) && (e.background = {
|
|
64
|
-
...n && { default:
|
|
65
|
-
...c && { paper:
|
|
64
|
+
...n && { default: _(n) },
|
|
65
|
+
...c && { paper: _(c) }
|
|
66
66
|
});
|
|
67
|
-
const o = a?.font_name || r?.body_font_name || r?.system_font, u = a?.header_font_name || r?.header_font_name, l = a?.use_glass ?? r?.use_glass, m = a?.
|
|
67
|
+
const o = a?.font_name || r?.body_font_name || r?.system_font, u = a?.header_font_name || r?.header_font_name, l = a?.use_glass ?? r?.use_glass, m = a?.corner_radius ?? r?.card_corner_radius;
|
|
68
68
|
return {
|
|
69
69
|
...Object.keys(e).length > 0 && { paletteOptions: e },
|
|
70
70
|
...(o || u) && { typographyOptions: {
|
|
@@ -72,18 +72,18 @@ var M = [
|
|
|
72
72
|
...u && { headerFontFamily: u }
|
|
73
73
|
} },
|
|
74
74
|
...l !== void 0 && { styleOptions: { useGlass: l } },
|
|
75
|
-
...
|
|
75
|
+
...m !== void 0 && { shapeOptions: { borderRadius: m } }
|
|
76
76
|
};
|
|
77
|
-
},
|
|
78
|
-
const
|
|
77
|
+
}, $ = (r, t, a) => {
|
|
78
|
+
const i = a?.master?.style, d = {
|
|
79
79
|
MuiTabs: { styleOverrides: { indicator: { backgroundColor: r.palette.primary.light } } },
|
|
80
80
|
MuiPickersCalendarHeader: { styleOverrides: { switchViewButton: {
|
|
81
81
|
color: r.palette.primary.lighter,
|
|
82
82
|
"&:hover": { backgroundColor: h(r.palette.primary.light, 0.1) }
|
|
83
83
|
} } }
|
|
84
|
-
}, s =
|
|
84
|
+
}, s = t?.button_corner_radius, e = i?.corner_radius ?? t?.card_corner_radius;
|
|
85
85
|
return { components: {
|
|
86
|
-
...
|
|
86
|
+
...d,
|
|
87
87
|
...s !== void 0 && {
|
|
88
88
|
MuiButton: { styleOverrides: { root: {
|
|
89
89
|
borderRadius: `${s}px`,
|
|
@@ -104,21 +104,21 @@ var M = [
|
|
|
104
104
|
MuiPaper: { styleOverrides: { rounded: { borderRadius: `${e}px` } } }
|
|
105
105
|
}
|
|
106
106
|
} };
|
|
107
|
-
},
|
|
108
|
-
const a = t === "dark",
|
|
109
|
-
for (const { key:
|
|
110
|
-
const
|
|
111
|
-
|
|
107
|
+
}, w = (r, t) => {
|
|
108
|
+
const a = t === "dark", i = {};
|
|
109
|
+
for (const { key: d, light: s, dark: e } of O) {
|
|
110
|
+
const p = r?.[a ? e : s];
|
|
111
|
+
p && (i[d] = p);
|
|
112
112
|
}
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
const
|
|
116
|
-
lighter:
|
|
117
|
-
light:
|
|
113
|
+
return i;
|
|
114
|
+
}, F = (r, t, a) => {
|
|
115
|
+
const i = r.palette.mode === "dark", d = (a?.master?.style?.font_name || t?.body_font_name || t?.system_font) ?? r.typography.fontFamily, s = (o, u) => o ? {
|
|
116
|
+
lighter: b(o, 0.5),
|
|
117
|
+
light: b(o, 0.25),
|
|
118
118
|
main: o,
|
|
119
|
-
dark:
|
|
120
|
-
darker:
|
|
121
|
-
} : u, e = Object.fromEntries(
|
|
119
|
+
dark: y(o, 0.25),
|
|
120
|
+
darker: y(o, 0.5)
|
|
121
|
+
} : u, e = Object.fromEntries(v.map(({ key: o, light: u, dark: l }) => [o, s(t?.[i ? l : u], r.palette[o])])), p = Object.fromEntries(x.map((o) => [o, o === "fontFamily" ? d : { fontFamily: d }])), _ = {
|
|
122
122
|
MuiTabs: { styleOverrides: { indicator: { backgroundColor: e.primary.light } } },
|
|
123
123
|
MuiPickersCalendarHeader: { styleOverrides: { switchViewButton: {
|
|
124
124
|
color: e.primary.lighter,
|
|
@@ -126,10 +126,10 @@ var M = [
|
|
|
126
126
|
} } }
|
|
127
127
|
}, n = t?.button_corner_radius, c = t?.card_corner_radius;
|
|
128
128
|
return {
|
|
129
|
-
typography:
|
|
129
|
+
typography: p,
|
|
130
130
|
palette: e,
|
|
131
131
|
components: {
|
|
132
|
-
...
|
|
132
|
+
..._,
|
|
133
133
|
...n && {
|
|
134
134
|
MuiButton: { styleOverrides: { root: {
|
|
135
135
|
borderRadius: `${n}px`,
|
|
@@ -151,10 +151,10 @@ var M = [
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
$ as getClientComponentOverrides,
|
|
155
|
+
T as getClientCustomizations,
|
|
156
|
+
w as getClientPaletteOptions,
|
|
157
|
+
F as getClientTheme
|
|
158
158
|
};
|
|
159
159
|
|
|
160
160
|
//# sourceMappingURL=Theme.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.es.js","names":[],"sources":["../../../src/common/utils/Theme.ts"],"sourcesContent":["import { alpha, darken, lighten, PaletteColor, PaletteMode, Theme } from '@mui/material'\nimport type { Customizations } from '@mxenabled/mxui'\n\nimport type { ClientStyleProfile } from '../../core'\nimport { ClientConfig, StyleConfig } from '../../core/types/AppData'\n\ntype PaletteOptions = NonNullable<Customizations['paletteOptions']>\ntype ModeColorOptions = Partial<NonNullable<NonNullable<PaletteOptions['background']>['default']>>\n\nconst TYPOGRAPHY_VARIANTS = [\n 'fontFamily',\n 'h1',\n 'h2',\n 'h3',\n 'body1',\n 'body2',\n 'button',\n 'caption',\n 'subtitle1',\n 'subtitle2',\n 'tiny',\n] as const\n\nconst PALETTE_CONFIG = [\n { key: 'primary', override: 'primary_color', light: 'primary_color', dark: 'primary_color_dark' },\n {\n key: 'secondary',\n override: 'secondary_color',\n light: 'secondary_color',\n dark: 'secondary_color_dark',\n },\n { key: 'error', override: 'error_color', light: 'error_color', dark: 'error_color_dark' },\n { key: 'warning', override: 'warning_color', light: 'warning_color', dark: 'warning_color_dark' },\n { key: 'info', override: 'info_color', light: 'info_color', dark: 'info_color_dark' },\n { key: 'success', override: 'success_color', light: 'success_color', dark: 'success_color_dark' },\n] as const\n\nconst SEED_CONFIG = [\n ...PALETTE_CONFIG,\n { key: 'grey', override: 'neutral_color', light: 'neutral_color', dark: 'neutral_color_dark' },\n] as const\n\nexport const getClientCustomizations = (\n clientStyleProfile: ClientStyleProfile,\n mode: PaletteMode,\n styleConfig?: StyleConfig,\n requestedMode?: ClientStyleProfile['mode'],\n): Customizations => {\n const isDark = mode === 'dark'\n const requested = requestedMode ?? clientStyleProfile?.mode ?? mode\n\n const paletteOptions: PaletteOptions = {}\n for (const { key, override, light, dark } of SEED_CONFIG) {\n const color = styleConfig?.[override] ?? clientStyleProfile?.[isDark ? dark : light]\n if (color) paletteOptions[key] = color\n }\n\n const useDarkSlot = isDark && requested !== 'browser'\n const asModeColor = (color: string): ModeColorOptions =>\n useDarkSlot ? { dark: color } : { light: color }\n const backgroundColor = styleConfig?.background_color ?? clientStyleProfile?.background_color\n const paperColor = styleConfig?.paper_color ?? clientStyleProfile?.paper_color\n if (backgroundColor || paperColor) {\n paletteOptions.background = {\n ...(backgroundColor && { default: asModeColor(backgroundColor) }),\n ...(paperColor && { paper: asModeColor(paperColor) }),\n } as PaletteOptions['background']\n }\n\n const fontFamily =\n styleConfig?.font_name || clientStyleProfile?.body_font_name || clientStyleProfile?.system_font\n const headerFontFamily = styleConfig?.header_font_name || clientStyleProfile?.header_font_name\n\n const useGlass = styleConfig?.use_glass ?? clientStyleProfile?.use_glass\n const cardRadius = styleConfig?.card_corner_radius ?? clientStyleProfile?.card_corner_radius\n // Cards render at 2x the shape token (MXUI's defaults: token 4, Paper 8), so the\n // client's card radius is halved here and applied at full value to MuiCard/MuiPaper\n // via getClientComponentOverrides\n const borderRadius = cardRadius !== undefined ? cardRadius / 2 : undefined\n\n return {\n ...(Object.keys(paletteOptions).length > 0 && { paletteOptions }),\n ...((fontFamily || headerFontFamily) && {\n typographyOptions: {\n ...(fontFamily && { fontFamily }),\n ...(headerFontFamily && { headerFontFamily }),\n },\n }),\n ...(useGlass !== undefined && { styleOptions: { useGlass } }),\n ...(borderRadius !== undefined && { shapeOptions: { borderRadius } }),\n }\n}\n\nexport const getClientComponentOverrides = (\n theme: Theme,\n clientStyleProfile: ClientStyleProfile,\n clientConfig?: ClientConfig,\n) => {\n const styleConfig = clientConfig?.master?.style\n\n const baseComponents = {\n MuiTabs: {\n styleOverrides: {\n indicator: { backgroundColor: theme.palette.primary.light },\n },\n },\n MuiPickersCalendarHeader: {\n styleOverrides: {\n switchViewButton: {\n color: theme.palette.primary.lighter,\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n },\n },\n }\n\n const buttonRadius = styleConfig?.button_corner_radius ?? clientStyleProfile?.button_corner_radius\n const cardRadius = styleConfig?.card_corner_radius ?? clientStyleProfile?.card_corner_radius\n\n const components = {\n ...baseComponents,\n ...(buttonRadius !== undefined && {\n MuiButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: {\n borderRadius: `${buttonRadius}px`,\n minWidth: buttonRadius,\n minHeight: buttonRadius,\n },\n },\n },\n MuiToggleButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n }),\n ...(cardRadius !== undefined && {\n MuiCard: {\n styleOverrides: { root: { borderRadius: `${cardRadius}px` } },\n },\n MuiPaper: {\n styleOverrides: {\n rounded: { borderRadius: `${cardRadius}px` },\n },\n },\n }),\n }\n\n return { components }\n}\n\n/** @deprecated Use `getClientCustomizations` and pass the result to `createMXTheme` */\nexport const getClientPaletteOptions = (\n clientStyleProfile: ClientStyleProfile,\n mode: PaletteMode,\n): Record<string, string> => {\n const isDark = mode === 'dark'\n const options: Record<string, string> = {}\n\n for (const { key, light, dark } of SEED_CONFIG) {\n const color = clientStyleProfile?.[isDark ? dark : light] as string | undefined\n if (color) options[key] = color\n }\n\n return options\n}\n\n/** @deprecated Build the theme with `getClientCustomizations` + `createMXTheme` and merge `getClientComponentOverrides` on top */\nexport const getClientTheme = (\n theme: Theme,\n clientStyleProfile: ClientStyleProfile,\n clientConfig?: ClientConfig,\n) => {\n const isDark = theme.palette.mode === 'dark'\n const font =\n (clientConfig?.master?.style?.font_name ||\n clientStyleProfile?.body_font_name ||\n clientStyleProfile?.system_font) ??\n theme.typography.fontFamily\n\n const generatePalette = (color: string | undefined, defaultColor: PaletteColor) =>\n color\n ? {\n lighter: lighten(color, 0.5),\n light: lighten(color, 0.25),\n main: color,\n dark: darken(color, 0.25),\n darker: darken(color, 0.5),\n }\n : defaultColor\n\n const palette = Object.fromEntries(\n PALETTE_CONFIG.map(({ key, light, dark }) => [\n key,\n generatePalette(\n clientStyleProfile?.[isDark ? dark : light] as string | undefined,\n theme.palette[key],\n ),\n ]),\n )\n\n const typography = Object.fromEntries(\n TYPOGRAPHY_VARIANTS.map((variant) => [\n variant,\n variant === 'fontFamily' ? font : { fontFamily: font },\n ]),\n )\n\n const baseComponents = {\n MuiTabs: {\n styleOverrides: {\n indicator: { backgroundColor: palette.primary.light },\n },\n },\n MuiPickersCalendarHeader: {\n styleOverrides: {\n switchViewButton: {\n color: palette.primary.lighter,\n '&:hover': { backgroundColor: alpha(palette.primary.light, 0.1) },\n },\n },\n },\n }\n\n const buttonRadius = clientStyleProfile?.button_corner_radius\n const cardRadius = clientStyleProfile?.card_corner_radius\n\n const components = {\n ...baseComponents,\n ...(buttonRadius && {\n MuiButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: {\n borderRadius: `${buttonRadius}px`,\n minWidth: buttonRadius,\n minHeight: buttonRadius,\n },\n },\n },\n MuiToggleButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n }),\n ...(cardRadius && {\n MuiCard: {\n styleOverrides: { root: { borderRadius: `${cardRadius}px` } },\n },\n }),\n ...(cardRadius && {\n MuiPaper: {\n styleOverrides: {\n rounded: { borderRadius: `${cardRadius}px` },\n },\n },\n }),\n }\n\n return { typography, palette, components }\n}\n"],"mappings":";AASA,IAAM,IAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEM,IAAiB;AAAA,EACrB;AAAA,IAAE,KAAK;AAAA,IAAW,UAAU;AAAA,IAAiB,OAAO;AAAA,IAAiB,MAAM;AAAA,EAAqB;AAAA,EAChG;AAAA,IACE,KAAK;AAAA,IACL,UAAU;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IAAE,KAAK;AAAA,IAAS,UAAU;AAAA,IAAe,OAAO;AAAA,IAAe,MAAM;AAAA,EAAmB;AAAA,EACxF;AAAA,IAAE,KAAK;AAAA,IAAW,UAAU;AAAA,IAAiB,OAAO;AAAA,IAAiB,MAAM;AAAA,EAAqB;AAAA,EAChG;AAAA,IAAE,KAAK;AAAA,IAAQ,UAAU;AAAA,IAAc,OAAO;AAAA,IAAc,MAAM;AAAA,EAAkB;AAAA,EACpF;AAAA,IAAE,KAAK;AAAA,IAAW,UAAU;AAAA,IAAiB,OAAO;AAAA,IAAiB,MAAM;AAAA,EAAqB;AAClG,GAEM,IAAc,CAClB,GAAG,GACH;AAAA,EAAE,KAAK;AAAA,EAAQ,UAAU;AAAA,EAAiB,OAAO;AAAA,EAAiB,MAAM;AAAqB,CAC/F,GAEa,IAAA,CACX,GACA,GACA,GACA,MACmB;AACnB,QAAM,IAAS,MAAS,QAClB,IAAY,KAAiB,GAAoB,QAAQ,GAEzD,IAAiC,CAAC;AACxC,aAAW,EAAE,KAAA,GAAK,UAAA,GAAU,OAAA,GAAO,MAAA,EAAA,KAAU,GAAa;AACxD,UAAM,IAAQ,IAAc,CAAA,KAAa,IAAqB,IAAS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B,EACf,gBAAgB,EACd,MAAM;AAAA,UAAE,cAAc,GAAG,CAAA;AAAA,UAAkB,eAAe;AAAA,QAAO,EACnE,EACF;AAAA,MACF;AAAA,MACA,GAAI,KAAc,EAChB,SAAS,EACP,gBAAgB,EAAE,MAAM,EAAE,cAAc,GAAG,CAAA,KAAe,EAAE,EAC9D,EACF;AAAA,MACA,GAAI,KAAc,EAChB,UAAU,EACR,gBAAgB,EACd,SAAS,EAAE,cAAc,GAAG,CAAA,KAAe,EAC7C,EACF,EACF;AAAA,IAG4B;AAAA,EAAW;AAC3C"}
|
|
1
|
+
{"version":3,"file":"Theme.es.js","names":[],"sources":["../../../src/common/utils/Theme.ts"],"sourcesContent":["import { alpha, darken, lighten, PaletteColor, PaletteMode, Theme } from '@mui/material'\nimport type { Customizations } from '@mxenabled/mxui'\n\nimport type { ClientStyleProfile } from '../../core'\nimport { ClientConfig, StyleConfig } from '../../core/types/AppData'\n\ntype PaletteOptions = NonNullable<Customizations['paletteOptions']>\ntype ModeColorOptions = Partial<NonNullable<NonNullable<PaletteOptions['background']>['default']>>\n\nconst TYPOGRAPHY_VARIANTS = [\n 'fontFamily',\n 'h1',\n 'h2',\n 'h3',\n 'body1',\n 'body2',\n 'button',\n 'caption',\n 'subtitle1',\n 'subtitle2',\n 'tiny',\n] as const\n\nconst PALETTE_CONFIG = [\n { key: 'primary', override: 'primary_color', light: 'primary_color', dark: 'primary_color_dark' },\n {\n key: 'secondary',\n override: 'secondary_color',\n light: 'secondary_color',\n dark: 'secondary_color_dark',\n },\n { key: 'error', override: 'error_color', light: 'error_color', dark: 'error_color_dark' },\n { key: 'warning', override: 'warning_color', light: 'warning_color', dark: 'warning_color_dark' },\n { key: 'info', override: 'info_color', light: 'info_color', dark: 'info_color_dark' },\n { key: 'success', override: 'success_color', light: 'success_color', dark: 'success_color_dark' },\n] as const\n\nconst SEED_CONFIG = [\n ...PALETTE_CONFIG,\n { key: 'grey', override: 'neutral_color', light: 'neutral_color', dark: 'neutral_color_dark' },\n] as const\n\nexport const getClientCustomizations = (\n clientStyleProfile: ClientStyleProfile,\n mode: PaletteMode,\n styleConfig?: StyleConfig,\n requestedMode?: ClientStyleProfile['mode'],\n): Customizations => {\n const isDark = mode === 'dark'\n const requested = requestedMode ?? clientStyleProfile?.mode ?? mode\n\n const paletteOptions: PaletteOptions = {}\n for (const { key, override, light, dark } of SEED_CONFIG) {\n const color = styleConfig?.[override] ?? clientStyleProfile?.[isDark ? dark : light]\n if (color) paletteOptions[key] = color\n }\n\n const useDarkSlot = isDark && requested !== 'browser'\n const asModeColor = (color: string): ModeColorOptions =>\n useDarkSlot ? { dark: color } : { light: color }\n const backgroundColor = styleConfig?.background_color ?? clientStyleProfile?.background_color\n const paperColor = styleConfig?.paper_color ?? clientStyleProfile?.paper_color\n if (backgroundColor || paperColor) {\n paletteOptions.background = {\n ...(backgroundColor && { default: asModeColor(backgroundColor) }),\n ...(paperColor && { paper: asModeColor(paperColor) }),\n } as PaletteOptions['background']\n }\n\n const fontFamily =\n styleConfig?.font_name || clientStyleProfile?.body_font_name || clientStyleProfile?.system_font\n const headerFontFamily = styleConfig?.header_font_name || clientStyleProfile?.header_font_name\n\n const useGlass = styleConfig?.use_glass ?? clientStyleProfile?.use_glass\n const borderRadius = styleConfig?.corner_radius ?? clientStyleProfile?.card_corner_radius\n\n return {\n ...(Object.keys(paletteOptions).length > 0 && { paletteOptions }),\n ...((fontFamily || headerFontFamily) && {\n typographyOptions: {\n ...(fontFamily && { fontFamily }),\n ...(headerFontFamily && { headerFontFamily }),\n },\n }),\n ...(useGlass !== undefined && { styleOptions: { useGlass } }),\n ...(borderRadius !== undefined && { shapeOptions: { borderRadius } }),\n }\n}\n\nexport const getClientComponentOverrides = (\n theme: Theme,\n clientStyleProfile: ClientStyleProfile,\n clientConfig?: ClientConfig,\n) => {\n const styleConfig = clientConfig?.master?.style\n\n const baseComponents = {\n MuiTabs: {\n styleOverrides: {\n indicator: { backgroundColor: theme.palette.primary.light },\n },\n },\n MuiPickersCalendarHeader: {\n styleOverrides: {\n switchViewButton: {\n color: theme.palette.primary.lighter,\n '&:hover': { backgroundColor: alpha(theme.palette.primary.light, 0.1) },\n },\n },\n },\n }\n\n const buttonRadius = clientStyleProfile?.button_corner_radius\n const cardRadius = styleConfig?.corner_radius ?? clientStyleProfile?.card_corner_radius\n\n const components = {\n ...baseComponents,\n ...(buttonRadius !== undefined && {\n MuiButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: {\n borderRadius: `${buttonRadius}px`,\n minWidth: buttonRadius,\n minHeight: buttonRadius,\n },\n },\n },\n MuiToggleButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n }),\n ...(cardRadius !== undefined && {\n MuiCard: {\n styleOverrides: { root: { borderRadius: `${cardRadius}px` } },\n },\n MuiPaper: {\n styleOverrides: {\n rounded: { borderRadius: `${cardRadius}px` },\n },\n },\n }),\n }\n\n return { components }\n}\n\n/** @deprecated Use `getClientCustomizations` and pass the result to `createMXTheme` */\nexport const getClientPaletteOptions = (\n clientStyleProfile: ClientStyleProfile,\n mode: PaletteMode,\n): Record<string, string> => {\n const isDark = mode === 'dark'\n const options: Record<string, string> = {}\n\n for (const { key, light, dark } of SEED_CONFIG) {\n const color = clientStyleProfile?.[isDark ? dark : light] as string | undefined\n if (color) options[key] = color\n }\n\n return options\n}\n\n/** @deprecated Build the theme with `getClientCustomizations` + `createMXTheme` and merge `getClientComponentOverrides` on top */\nexport const getClientTheme = (\n theme: Theme,\n clientStyleProfile: ClientStyleProfile,\n clientConfig?: ClientConfig,\n) => {\n const isDark = theme.palette.mode === 'dark'\n const font =\n (clientConfig?.master?.style?.font_name ||\n clientStyleProfile?.body_font_name ||\n clientStyleProfile?.system_font) ??\n theme.typography.fontFamily\n\n const generatePalette = (color: string | undefined, defaultColor: PaletteColor) =>\n color\n ? {\n lighter: lighten(color, 0.5),\n light: lighten(color, 0.25),\n main: color,\n dark: darken(color, 0.25),\n darker: darken(color, 0.5),\n }\n : defaultColor\n\n const palette = Object.fromEntries(\n PALETTE_CONFIG.map(({ key, light, dark }) => [\n key,\n generatePalette(\n clientStyleProfile?.[isDark ? dark : light] as string | undefined,\n theme.palette[key],\n ),\n ]),\n )\n\n const typography = Object.fromEntries(\n TYPOGRAPHY_VARIANTS.map((variant) => [\n variant,\n variant === 'fontFamily' ? font : { fontFamily: font },\n ]),\n )\n\n const baseComponents = {\n MuiTabs: {\n styleOverrides: {\n indicator: { backgroundColor: palette.primary.light },\n },\n },\n MuiPickersCalendarHeader: {\n styleOverrides: {\n switchViewButton: {\n color: palette.primary.lighter,\n '&:hover': { backgroundColor: alpha(palette.primary.light, 0.1) },\n },\n },\n },\n }\n\n const buttonRadius = clientStyleProfile?.button_corner_radius\n const cardRadius = clientStyleProfile?.card_corner_radius\n\n const components = {\n ...baseComponents,\n ...(buttonRadius && {\n MuiButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: {\n borderRadius: `${buttonRadius}px`,\n minWidth: buttonRadius,\n minHeight: buttonRadius,\n },\n },\n },\n MuiToggleButton: {\n styleOverrides: {\n root: { borderRadius: `${buttonRadius}px`, textTransform: 'none' },\n },\n },\n }),\n ...(cardRadius && {\n MuiCard: {\n styleOverrides: { root: { borderRadius: `${cardRadius}px` } },\n },\n }),\n ...(cardRadius && {\n MuiPaper: {\n styleOverrides: {\n rounded: { borderRadius: `${cardRadius}px` },\n },\n },\n }),\n }\n\n return { typography, palette, components }\n}\n"],"mappings":";AASA,IAAM,IAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEM,IAAiB;AAAA,EACrB;AAAA,IAAE,KAAK;AAAA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