@bigbinary/neeto-themes-frontend 4.0.18 → 4.0.19

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.
@@ -22,10 +22,13 @@
22
22
  "useTheme": "Apply",
23
23
  "previewTheme": "Preview",
24
24
  "customizeStyle": "Customize style",
25
+ "addImage": "Add image",
25
26
  "addLogo": "Add logo",
26
27
  "changeLogo": "Change logo",
27
28
  "addCoverImage": "Add cover image",
28
29
  "changeCoverImage": "Change cover image",
30
+ "addBackgroundImage": "Add background image",
31
+ "changeBackgroundImage": "Change background image",
29
32
  "activeTheme": "Active theme",
30
33
  "defaultTheme": "(default theme)",
31
34
  "edit": "Edit",
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-05-23T05:05:52.478Z
1
+ Built at 2026-05-27T16:06:22.794Z
@@ -1,13 +1,13 @@
1
1
  import { shallow } from 'zustand/shallow';
2
2
  import { Suspense, lazy, useEffect, createElement, useState, useRef, memo, useCallback } from 'react';
3
- import { isPresent, hyphenate, findBy, findIndexBy, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
3
+ import { isPresent, hyphenate, findBy, findIndexBy, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, humanize, capitalize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
4
4
  import { useMutationWithInvalidation, useQueryParams, useBreakpoints, PageTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
5
5
  import Spinner from '@bigbinary/neetoui/Spinner';
6
6
  import { useTranslation, Trans } from 'react-i18next';
7
7
  import { B as BASE_URL, b as scrollElementIntoView, c as setCustomCSS, g as getDominantColorFromUrl, i as isEditThemeRoute, d as isFunction, e as isNewThemeRoute } from './index-JpAFUrB8.js';
8
8
  import { useQuery, useQueryClient } from '@tanstack/react-query';
9
9
  import axios from 'axios';
10
- import { Q as QUERY_KEYS, b as useConfigStore, a as useExpandedSection, c as useThemeStore, u as useThemeUtils, P as POSITION_OPTIONS, H as HUNDRED, O as OVERLAY_OPACITY_SLIDER_MARKS, F as FONT_OPTIONS, T as THEME_VALIDATION_SCHEMA, A as APPLY_SPINNER_DELAY } from './useExpandedSection-BkPg-7yk.js';
10
+ import { Q as QUERY_KEYS, b as useConfigStore, a as useExpandedSection, c as useThemeStore, u as useThemeUtils, P as POSITION_OPTIONS, H as HUNDRED, O as OVERLAY_OPACITY_SLIDER_MARKS, F as FONT_OPTIONS, d as useSyncExpandedSectionFromUrl, T as THEME_VALIDATION_SCHEMA, A as APPLY_SPINNER_DELAY } from './useExpandedSection-D9J7nzlC.js';
11
11
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
12
12
  import classnames from 'classnames';
13
13
  import { joinHyphenCase, buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
@@ -18,13 +18,13 @@ import { useHistory, useParams, Switch as Switch$1, Route } from 'react-router-d
18
18
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
19
19
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
20
20
  import Close from '@bigbinary/neeto-icons/Close';
21
+ import { isEmpty, negate, isNotNil } from 'ramda';
21
22
  import Popover from '@bigbinary/neetoui/Popover';
22
23
  import Typography from '@bigbinary/neetoui/Typography';
23
24
  import Switch from '@bigbinary/neetoui/Switch';
24
25
  import Tooltip from '@bigbinary/neetoui/Tooltip';
25
26
  import Form from '@bigbinary/neetoui/formik/Form';
26
27
  import BlockNavigation from '@bigbinary/neetoui/formik/BlockNavigation';
27
- import { isEmpty, negate, isNotNil } from 'ramda';
28
28
  import { useFormikContext, Field } from 'formik';
29
29
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
30
30
  import i18n, { t as t$1 } from 'i18next';
@@ -49,7 +49,6 @@ import Search from '@bigbinary/neeto-molecules/Search';
49
49
  import AddImage from '@bigbinary/neeto-icons/AddImage';
50
50
  import CodeBlock from '@bigbinary/neeto-icons/CodeBlock';
51
51
  import ColorPicker$1 from '@bigbinary/neeto-icons/ColorPicker';
52
- import Image from '@bigbinary/neeto-icons/Image';
53
52
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
54
53
  import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
55
54
  import RightArrow from '@bigbinary/neeto-icons/RightArrow';
@@ -1372,6 +1371,7 @@ var Customize = function Customize(_ref) {
1372
1371
  currentScreen = _ref.currentScreen;
1373
1372
  var _useTranslation = useTranslation(),
1374
1373
  t = _useTranslation.t;
1374
+ useSyncExpandedSectionFromUrl();
1375
1375
  var history = useHistory();
1376
1376
  var _useState = useState({}),
1377
1377
  _useState2 = _slicedToArray(_useState, 2),
@@ -1570,11 +1570,11 @@ var Customize = function Customize(_ref) {
1570
1570
  type: "reset"
1571
1571
  }), /*#__PURE__*/jsx(Button, {
1572
1572
  "data-testid": "save-changes-button",
1573
+ disabled: !dirty && (themeData === null || themeData === void 0 ? void 0 : themeData.id) || isSubmitting || !isValid,
1573
1574
  label: t("neetoThemes.buttons.save"),
1574
1575
  loading: isSubmitting,
1575
1576
  ref: submitBtnRef,
1576
- type: "submit",
1577
- disabled: !dirty && (themeData === null || themeData === void 0 ? void 0 : themeData.id) || isSubmitting || !isValid
1577
+ type: "submit"
1578
1578
  })]
1579
1579
  }), /*#__PURE__*/jsx(Popover, {
1580
1580
  appendTo: function appendTo() {
@@ -1724,7 +1724,6 @@ var Thumbnail = function Thumbnail(_ref) {
1724
1724
  };
1725
1725
 
1726
1726
  var Card$1 = function Card(_ref) {
1727
- var _theme$logo, _theme$coverImage;
1728
1727
  var _ref$active = _ref.active,
1729
1728
  active = _ref$active === void 0 ? false : _ref$active,
1730
1729
  isPreviewing = _ref.isPreviewing,
@@ -1740,8 +1739,17 @@ var Card$1 = function Card(_ref) {
1740
1739
  Thumbnail$1 = _ref.thumbnail;
1741
1740
  var _useTranslation = useTranslation(),
1742
1741
  t = _useTranslation.t;
1742
+ var _useConfigStore = useConfigStore(function (store) {
1743
+ return {
1744
+ themePropertiesSchema: store["themePropertiesSchema"]
1745
+ };
1746
+ }, shallow),
1747
+ themePropertiesSchema = _useConfigStore.themePropertiesSchema;
1743
1748
  var id = theme.id,
1744
1749
  name = theme.name;
1750
+ var imageProperties = filterBy({
1751
+ kind: "image"
1752
+ }, themePropertiesSchema);
1745
1753
  var handleDeleteTheme = function handleDeleteTheme() {
1746
1754
  return onDeleteTheme(id, name);
1747
1755
  };
@@ -1865,16 +1873,19 @@ var Card$1 = function Card(_ref) {
1865
1873
  label: t("neetoThemes.common.customizeStyle"),
1866
1874
  testId: "quick-customize-style",
1867
1875
  onClick: handleQuickEdit("style")
1868
- }), /*#__PURE__*/jsx(QuickActionRow, {
1869
- icon: AddImage,
1870
- testId: "quick-add-logo",
1871
- label: t((_theme$logo = theme.logo) !== null && _theme$logo !== void 0 && _theme$logo.url ? "neetoThemes.common.changeLogo" : "neetoThemes.common.addLogo"),
1872
- onClick: handleQuickEdit("logo")
1873
- }), /*#__PURE__*/jsx(QuickActionRow, {
1874
- icon: Image,
1875
- testId: "quick-add-cover-image",
1876
- label: t((_theme$coverImage = theme.coverImage) !== null && _theme$coverImage !== void 0 && _theme$coverImage.url ? "neetoThemes.common.changeCoverImage" : "neetoThemes.common.addCoverImage"),
1877
- onClick: handleQuickEdit("coverImage")
1876
+ }), imageProperties.map(function (_ref2) {
1877
+ var _theme$camelKey;
1878
+ var key = _ref2.key;
1879
+ var camelKey = snakeToCamelCase(key);
1880
+ var hasImage = isPresent((_theme$camelKey = theme[camelKey]) === null || _theme$camelKey === void 0 ? void 0 : _theme$camelKey.url);
1881
+ var action = hasImage ? "change" : "add";
1882
+ var specificKey = "neetoThemes.common.".concat(action).concat(capitalize(camelKey));
1883
+ return /*#__PURE__*/jsx(QuickActionRow, {
1884
+ icon: AddImage,
1885
+ label: t([specificKey, "neetoThemes.common.addImage"]),
1886
+ testId: "quick-add-".concat(hyphenate(key)),
1887
+ onClick: handleQuickEdit(camelKey)
1888
+ }, key);
1878
1889
  }), /*#__PURE__*/jsx(QuickActionRow, {
1879
1890
  icon: CodeBlock,
1880
1891
  label: t("neetoThemes.build.leftSideBar.themes.customCSS"),