@bigbinary/neeto-themes-frontend 4.0.17 → 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.
- package/app/javascript/src/translations/ar.json +24 -14
- package/app/javascript/src/translations/bg.json +24 -14
- package/app/javascript/src/translations/ca.json +24 -14
- package/app/javascript/src/translations/cs.json +24 -14
- package/app/javascript/src/translations/da.json +24 -14
- package/app/javascript/src/translations/de.json +24 -14
- package/app/javascript/src/translations/en.json +3 -0
- package/app/javascript/src/translations/es-MX.json +24 -14
- package/app/javascript/src/translations/es.json +24 -14
- package/app/javascript/src/translations/et.json +24 -14
- package/app/javascript/src/translations/fi.json +24 -14
- package/app/javascript/src/translations/fil.json +24 -14
- package/app/javascript/src/translations/fr.json +24 -14
- package/app/javascript/src/translations/he.json +24 -14
- package/app/javascript/src/translations/hi.json +24 -14
- package/app/javascript/src/translations/hr.json +24 -14
- package/app/javascript/src/translations/hu.json +24 -14
- package/app/javascript/src/translations/id.json +24 -14
- package/app/javascript/src/translations/it.json +24 -14
- package/app/javascript/src/translations/ja.json +24 -14
- package/app/javascript/src/translations/ko.json +24 -14
- package/app/javascript/src/translations/nl.json +24 -14
- package/app/javascript/src/translations/pl.json +24 -14
- package/app/javascript/src/translations/pt-BR.json +24 -14
- package/app/javascript/src/translations/pt.json +24 -14
- package/app/javascript/src/translations/ro.json +24 -14
- package/app/javascript/src/translations/ru.json +24 -14
- package/app/javascript/src/translations/sk.json +24 -14
- package/app/javascript/src/translations/sl.json +24 -14
- package/app/javascript/src/translations/sv.json +24 -14
- package/app/javascript/src/translations/th.json +24 -14
- package/app/javascript/src/translations/tr.json +24 -14
- package/app/javascript/src/translations/uk.json +24 -14
- package/app/javascript/src/translations/vi.json +24 -14
- package/app/javascript/src/translations/zh-CN.json +24 -14
- package/app/javascript/src/translations/zh-TW.json +24 -14
- package/dist/.ready +1 -1
- package/dist/NeetoThemesBuilder.js +28 -17
- package/dist/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/NeetoThemesBuilder.js +27 -16
- package/dist/cjs/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/hooks.js +1 -2
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/hooks.js +1 -2
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/{useExpandedSection-DvbcFXMx.js → useExpandedSection-B6w2AxTV.js} +40 -12
- package/dist/useExpandedSection-B6w2AxTV.js.map +1 -0
- package/dist/{useExpandedSection-BkPg-7yk.js → useExpandedSection-D9J7nzlC.js} +40 -13
- package/dist/useExpandedSection-D9J7nzlC.js.map +1 -0
- package/package.json +9 -9
- package/dist/useExpandedSection-BkPg-7yk.js.map +0 -1
- package/dist/useExpandedSection-DvbcFXMx.js.map +0 -1
|
@@ -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-
|
|
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
|
-
}),
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
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"),
|