@bigbinary/neeto-themes-frontend 4.2.4-beta1 → 4.2.4-beta3

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.
@@ -1,5 +1,5 @@
1
1
  import { shallow } from 'zustand/shallow';
2
- import { Suspense, lazy, useId, useEffect, createElement, useState, memo, useRef, useCallback, useMemo } from 'react';
2
+ import { Suspense, lazy, useId, useEffect, createElement, useState, useMemo, memo, useRef, useCallback } from 'react';
3
3
  import { Toastr, Spinner, Typography, Button, Label, ColorPicker, Select, Slider, Checkbox, Switch, Input, Tooltip, Popover, Badge, Alert } from '@bigbinary/neeto-atoms';
4
4
  import { hyphenate, isPresent, findBy, findIndexBy, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, capitalize, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
5
5
  import { useQueryParams, useBreakpoints, PageTitle } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
@@ -1433,9 +1433,13 @@ var Customize = function Customize(_ref) {
1433
1433
  _useListThemes$data2$ = _useListThemes$data2.defaultThemes,
1434
1434
  defaultThemes = _useListThemes$data2$ === void 0 ? [] : _useListThemes$data2$,
1435
1435
  isLoadingSystemThemes = _useListThemes.isLoading;
1436
- var themeToCustomize = isCustomizingSystemTheme ? buildSystemThemeCopy(findBy({
1436
+ var sourceTheme = isCustomizingSystemTheme ? findBy({
1437
1437
  id: sourceThemeId
1438
- }, defaultThemes)) : themeData;
1438
+ }, defaultThemes) : null;
1439
+ var systemThemeCopy = useMemo(function () {
1440
+ return buildSystemThemeCopy(sourceTheme);
1441
+ }, [sourceTheme === null || sourceTheme === void 0 ? void 0 : sourceTheme.id]);
1442
+ var themeToCustomize = isCustomizingSystemTheme ? systemThemeCopy : themeData;
1439
1443
  var isLoading = isFetchingSchema || isLoadingTheme || isCustomizingSystemTheme && isLoadingSystemThemes;
1440
1444
  var isThemeGlobalTheme = themeId && (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
1441
1445
  var isCurrentThemeAndGlobalThemeSame = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id);
@@ -1481,10 +1485,16 @@ var Customize = function Customize(_ref) {
1481
1485
  onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 || onApplyThemeSuccess(theme);
1482
1486
  case 9:
1483
1487
  onCreateTheme(theme);
1488
+ if (isNewThemeRoute()) {
1489
+ _context.next = 12;
1490
+ break;
1491
+ }
1492
+ return _context.abrupt("return");
1493
+ case 12:
1484
1494
  history.replace(buildUrl(buildPathname(routes.themes.edit), {
1485
1495
  themeId: theme.id
1486
1496
  }));
1487
- case 11:
1497
+ case 13:
1488
1498
  case "end":
1489
1499
  return _context.stop();
1490
1500
  }