muffin-admin 3.12.1 → 3.12.3

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.
@@ -7,7 +7,7 @@ import { AdminContext, AdminUI, AppBar, Layout, localStorageStore, Login, } from
7
7
  import { ConfirmationProvider } from "./common";
8
8
  import { useMuffinAdminOpts } from "./hooks";
9
9
  import { buildProvider, muffinTranslations } from "./i18n";
10
- import { buildAdmin, findBuilder, findIcon, setupAdmin } from "./utils";
10
+ import { buildAdmin, deepMerge, findBuilder, findIcon, setupAdmin } from "./utils";
11
11
  export function MuffinAdmin(props) {
12
12
  const opts = useMuffinAdminOpts();
13
13
  const { resources = [], auth, adminProps, apiUrl, locales: backendLocales } = opts;
@@ -15,7 +15,7 @@ export function MuffinAdmin(props) {
15
15
  const muffinI18nProvider = buildProvider(backendLocales
16
16
  ? Object.fromEntries(Object.entries(muffinTranslations).map(([locale, messages]) => [
17
17
  locale,
18
- Object.assign(Object.assign(Object.assign({}, messages), backendLocales[locale]), (buildAdmin(["locale", locale]) || {})),
18
+ deepMerge({}, messages, backendLocales[locale], buildAdmin(["locale", locale]) || {}),
19
19
  ]))
20
20
  : muffinTranslations);
21
21
  const { basename, authProvider = findBuilder(["authprovider"])(auth), dataProvider = findBuilder(["dataprovider"])(apiUrl), catchAll, dashboard = findBuilder(["dashboard"]), disableTelemetry, error, i18nProvider = muffinI18nProvider, layout = findBuilder(["layout"]), loading, loginPage = findBuilder(["loginpage"]), authCallbackPage, notification, queryClient, requireAuth = auth.required, store = localStorageStore(), ready, theme, lightTheme, darkTheme, defaultTheme, title = "React Admin", } = props;
@@ -34,7 +34,7 @@ function MuffinListGridButtons() {
34
34
  setupAdmin(["list-grid-buttons"], MuffinListGridButtons);
35
35
  function MuffinListToolbar() {
36
36
  const { actions: baseActions = [], help, list: { create }, } = useMuffinResourceOpts();
37
- const actions = baseActions.filter((a) => a.view.includes("list"));
37
+ const actions = baseActions.filter((a) => { var _a; return (_a = a.view) === null || _a === void 0 ? void 0 : _a.includes("list"); });
38
38
  return (_jsxs(TopToolbar, { children: [help && _jsx(HelpLink, { href: help }), _jsx(SelectColumnsButton, {}), _jsx(FilterButton, {}), actions.length ? actions.map((props) => _jsx(ActionButton, Object.assign({}, props), props.id)) : null, create && _jsx(CreateButton, {}), _jsx(ExportButton, {})] }));
39
39
  }
40
40
  setupAdmin(["list-toolbar"], MuffinListToolbar);