@bigbinary/neeto-themes-frontend 2.0.9 → 2.1.0

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { shallow } from 'zustand/shallow';
2
2
  import { useEffect, createElement, useState, useRef, memo, useCallback } from 'react';
3
3
  import { t as t$1 } from 'i18next';
4
- import { isNotPresent, snakeToCamelCase, filterBy, findBy, isPresent, isNot, findIndexBy, toLabelAndValue, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
4
+ import { isNotPresent, snakeToCamelCase, filterBy, findBy, isPresent, isNot, hyphenate, findIndexBy, toLabelAndValue, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
5
5
  import { withImmutableActions, useMutationWithInvalidation, withT, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
6
6
  import Spinner from '@bigbinary/neetoui/Spinner';
7
7
  import { useQuery } from '@tanstack/react-query';
@@ -549,6 +549,7 @@ var Card$2 = function Card(_ref) {
549
549
  children = _ref.children;
550
550
  return /*#__PURE__*/jsxs("div", {
551
551
  className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white space-y-3 border p-4",
552
+ "data-cy": "theme-".concat(hyphenate(title), "-properties"),
552
553
  children: [title && /*#__PURE__*/jsx("div", {
553
554
  className: "flex items-center justify-between",
554
555
  children: /*#__PURE__*/jsx(Typography, {
@@ -930,7 +931,9 @@ var Properties = function Properties(_ref) {
930
931
  var index = findIndexBy({
931
932
  key: name
932
933
  }, values.properties);
933
- if (index !== -1) setFieldValue("properties[".concat(index, "].value"), value);
934
+ if (index !== -1 && values.properties[index].value !== value) {
935
+ setFieldValue("properties[".concat(index, "].value"), value);
936
+ }
934
937
  setVariable(snakeToCamelCase(name), variableValue !== null && variableValue !== void 0 ? variableValue : value);
935
938
  };
936
939
  var handleOverlayChange = function handleOverlayChange(key, value) {
@@ -1603,6 +1606,7 @@ var Themes = function Themes(_ref) {
1603
1606
  children: t("neetoThemes.build.leftSideBar.themes.systemThemes")
1604
1607
  }), /*#__PURE__*/jsx("div", {
1605
1608
  className: "flex flex-col gap-4 px-4 pb-10 lg:px-5 xl:px-6",
1609
+ "data-cy": "system-themes",
1606
1610
  children: filteredDefaultThemes.map(function (theme) {
1607
1611
  return /*#__PURE__*/createElement(Card$1, {
1608
1612
  onApplyTheme: onApplyTheme,
@@ -1628,6 +1632,7 @@ var Themes = function Themes(_ref) {
1628
1632
  children: t("neetoThemes.build.leftSideBar.themes.customThemes")
1629
1633
  }), /*#__PURE__*/jsx("div", {
1630
1634
  className: "flex flex-col gap-4 px-6",
1635
+ "data-cy": "custom-themes",
1631
1636
  children: filteredThemes.map(function (theme) {
1632
1637
  var isActive = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id;
1633
1638
  var isPreviewing = (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id;