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

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);