@bigbinary/neeto-themes-frontend 1.1.13 → 1.1.15
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.cjs.js +72 -130
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +58 -125
- package/dist/index.js.map +1 -1
- package/package.json +14 -13
- package/types.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -2,22 +2,31 @@ import { shallow } from 'zustand/shallow';
|
|
|
2
2
|
import React, { useEffect, forwardRef, useImperativeHandle, Fragment, useMemo, useRef, useReducer, useCallback, useState, memo } from 'react';
|
|
3
3
|
import i18next, { t as t$2 } from 'i18next';
|
|
4
4
|
import { withImmutableActions, useMutationWithInvalidation, useDebounce, useFuncDebounce, withT, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
5
|
-
import
|
|
5
|
+
import Spinner$1 from '@bigbinary/neetoui/Spinner';
|
|
6
6
|
import { create as create$3 } from 'zustand';
|
|
7
7
|
import { isNotPresent, snakeToCamelCase, noop as noop$1, isPresent, findBy, keysToCamelCase, humanize, existsBy, filterBy, findIndexBy, isNot, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
8
|
+
import Alert from '@bigbinary/neetoui/Alert';
|
|
8
9
|
import { useTranslation, Trans } from 'react-i18next';
|
|
10
|
+
import '@bigbinary/neetoui/Toastr';
|
|
9
11
|
import { useQuery, useMutation } from 'react-query';
|
|
10
12
|
import axios from 'axios';
|
|
11
|
-
import { prop, mergeRight, equals, pipe, values, flatten as flatten$1, map, toUpper, join, isNil, isEmpty, mergeLeft, concat, __, inc
|
|
12
|
-
import
|
|
13
|
+
import { prop, mergeRight, equals, pipe, values, flatten as flatten$1, map, toUpper, join, isNil, isEmpty, mergeLeft, concat, __, inc } from 'ramda';
|
|
14
|
+
import Button$1 from '@bigbinary/neetoui/Button';
|
|
15
|
+
import Form from '@bigbinary/neetoui/formik/Form';
|
|
13
16
|
import * as yup from 'yup';
|
|
14
17
|
import { useFormikContext } from 'formik';
|
|
18
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
15
19
|
import classnames from 'classnames';
|
|
16
20
|
import { MenuHorizontal, LeftArrow, Plus } from '@bigbinary/neeto-icons';
|
|
21
|
+
import { Dropdown, Typography as Typography$1, Modal as Modal$1, Spinner, Tab, Button, Input, Toastr, Switch } from '@bigbinary/neetoui';
|
|
17
22
|
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
18
23
|
import { withEventTargetValue, joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
24
|
+
import ColorPicker from '@bigbinary/neetoui/ColorPicker';
|
|
25
|
+
import Select from '@bigbinary/neetoui/Select';
|
|
26
|
+
import Input$1 from '@bigbinary/neetoui/formik/Input';
|
|
19
27
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
20
28
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
29
|
+
import Tag from '@bigbinary/neetoui/Tag';
|
|
21
30
|
|
|
22
31
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
23
32
|
var useConfigStore = create$3(withImmutableActions(function (set) {
|
|
@@ -461,7 +470,7 @@ var hexToRgba = function hexToRgba(hex) {
|
|
|
461
470
|
return "".concat(r, ", ").concat(g, ", ").concat(b).concat(a !== undefined ? ", ".concat(a) : "");
|
|
462
471
|
};
|
|
463
472
|
|
|
464
|
-
var BASE_URL = "
|
|
473
|
+
var BASE_URL = "neeto_themes_engine";
|
|
465
474
|
|
|
466
475
|
var show$1 = function show(entityId) {
|
|
467
476
|
return axios.get("".concat(BASE_URL, "/api/v1/theme/entities/").concat(entityId));
|
|
@@ -2653,9 +2662,9 @@ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
2653
2662
|
|
|
2654
2663
|
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2655
2664
|
|
|
2656
|
-
function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose
|
|
2665
|
+
function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2657
2666
|
|
|
2658
|
-
function _objectWithoutPropertiesLoose
|
|
2667
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2659
2668
|
/**
|
|
2660
2669
|
* Convenience wrapper component for the `useDropzone` hook
|
|
2661
2670
|
*
|
|
@@ -3679,7 +3688,7 @@ var ImageDirectUpload = function ImageDirectUpload(_ref) {
|
|
|
3679
3688
|
})
|
|
3680
3689
|
}), /*#__PURE__*/React.createElement("div", {
|
|
3681
3690
|
className: "flex flex-col space-y-1"
|
|
3682
|
-
}, !isDisabled && /*#__PURE__*/React.createElement(Typography, {
|
|
3691
|
+
}, !isDisabled && /*#__PURE__*/React.createElement(Typography$1, {
|
|
3683
3692
|
className: "neeto-ui-text-gray-800 text-center leading-4",
|
|
3684
3693
|
style: "body2"
|
|
3685
3694
|
}, /*#__PURE__*/React.createElement(Trans, {
|
|
@@ -3690,7 +3699,7 @@ var ImageDirectUpload = function ImageDirectUpload(_ref) {
|
|
|
3690
3699
|
"data-cy": "neeto-image-uploader-browse-text"
|
|
3691
3700
|
})
|
|
3692
3701
|
}
|
|
3693
|
-
})), setIsAssetLibraryOpen && /*#__PURE__*/React.createElement(Typography, {
|
|
3702
|
+
})), setIsAssetLibraryOpen && /*#__PURE__*/React.createElement(Typography$1, {
|
|
3694
3703
|
className: "text-center leading-4",
|
|
3695
3704
|
style: "body2",
|
|
3696
3705
|
onClick: function onClick(e) {
|
|
@@ -3708,7 +3717,7 @@ var ImageDirectUpload = function ImageDirectUpload(_ref) {
|
|
|
3708
3717
|
})), /*#__PURE__*/React.createElement("input", _extends$1({}, getInputProps(), {
|
|
3709
3718
|
"data-cy": "neeto-image-uploader-file-input",
|
|
3710
3719
|
disabled: isDisabled
|
|
3711
|
-
})), /*#__PURE__*/React.createElement(Typography, {
|
|
3720
|
+
})), /*#__PURE__*/React.createElement(Typography$1, {
|
|
3712
3721
|
className: "neeto-ui-text-gray-700 text-center leading-4",
|
|
3713
3722
|
"data-cy": "neeto-image-uploader-restriction-message",
|
|
3714
3723
|
lineHeight: "snug",
|
|
@@ -5229,7 +5238,7 @@ var Controls = function Controls(_ref) {
|
|
|
5229
5238
|
disabled: isFullImage,
|
|
5230
5239
|
label: t("neetoImageUploader.labels.lockAspectRatio"),
|
|
5231
5240
|
onChange: onToggleAspectRatioLock
|
|
5232
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
5241
|
+
}), /*#__PURE__*/React.createElement(Typography$1, {
|
|
5233
5242
|
className: "mb-2 mt-6",
|
|
5234
5243
|
style: "body2"
|
|
5235
5244
|
}, t("neetoImageUploader.imageEditor.aspectRatio")), /*#__PURE__*/React.createElement("div", {
|
|
@@ -5241,7 +5250,7 @@ var Controls = function Controls(_ref) {
|
|
|
5241
5250
|
type: "number",
|
|
5242
5251
|
value: aspectRatio.width,
|
|
5243
5252
|
onChange: withEventTargetValue(handleAspectWidthChange)
|
|
5244
|
-
}), /*#__PURE__*/React.createElement(Typography, null, " : "), /*#__PURE__*/React.createElement(Input, {
|
|
5253
|
+
}), /*#__PURE__*/React.createElement(Typography$1, null, " : "), /*#__PURE__*/React.createElement(Input, {
|
|
5245
5254
|
"data-cy": "aspect-ratio-height-input",
|
|
5246
5255
|
disabled: isFullImage,
|
|
5247
5256
|
size: "small",
|
|
@@ -6046,7 +6055,7 @@ var _reactInfiniteScroller2 = _interopRequireDefault(_reactInfiniteScroller);
|
|
|
6046
6055
|
|
|
6047
6056
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6048
6057
|
|
|
6049
|
-
function _objectWithoutProperties
|
|
6058
|
+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
6050
6059
|
|
|
6051
6060
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6052
6061
|
|
|
@@ -6150,7 +6159,7 @@ var MasonryInfiniteScroller = (_temp2 = _class = function (_Component) {
|
|
|
6150
6159
|
_props.packed;
|
|
6151
6160
|
_props.position;
|
|
6152
6161
|
_props.sizes;
|
|
6153
|
-
var props = _objectWithoutProperties
|
|
6162
|
+
var props = _objectWithoutProperties(_props, ['children', 'className', 'style', 'pack', 'packed', 'position', 'sizes']);
|
|
6154
6163
|
|
|
6155
6164
|
return _react2.default.createElement(
|
|
6156
6165
|
_reactInfiniteScroller2.default,
|
|
@@ -6305,7 +6314,7 @@ var Images$1 = function Images(_ref) {
|
|
|
6305
6314
|
refetch();
|
|
6306
6315
|
}, [debouncedQuery]);
|
|
6307
6316
|
if (error) {
|
|
6308
|
-
return /*#__PURE__*/React.createElement(Typography, {
|
|
6317
|
+
return /*#__PURE__*/React.createElement(Typography$1, {
|
|
6309
6318
|
className: "mt-9 flex justify-center",
|
|
6310
6319
|
style: "body2"
|
|
6311
6320
|
}, t("neetoImageUploader.unsplash.errorMessage"));
|
|
@@ -6511,7 +6520,7 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
|
|
|
6511
6520
|
refetch();
|
|
6512
6521
|
}, [debouncedQuery]);
|
|
6513
6522
|
if (error) {
|
|
6514
|
-
return /*#__PURE__*/React.createElement(Typography, {
|
|
6523
|
+
return /*#__PURE__*/React.createElement(Typography$1, {
|
|
6515
6524
|
className: "mt-9 flex justify-center",
|
|
6516
6525
|
style: "body2"
|
|
6517
6526
|
}, t("neetoImageUploader.unsplash.errorMessage"));
|
|
@@ -6659,7 +6668,7 @@ var Modal = function Modal(_ref) {
|
|
|
6659
6668
|
className: "neeto-ui-bg-gray-400 absolute inset-0 z-50 flex h-full items-center justify-center opacity-50"
|
|
6660
6669
|
}, /*#__PURE__*/React.createElement(Spinner, null)), isNilOrEmpty(selectedImage) && isDragActive && /*#__PURE__*/React.createElement("div", _extends$1({
|
|
6661
6670
|
className: "neeto-ui-rounded-xl neeto-ui-bg-gray-400 absolute flex h-full w-full flex-col items-center justify-around border-4 border-dashed border-gray-900 opacity-40"
|
|
6662
|
-
}, getRootProps()), /*#__PURE__*/React.createElement(Typography, null, t("neetoImageUploader.common.dropHere"))), !isNilOrEmpty(selectedImage) ? /*#__PURE__*/React.createElement(ImageEditor, {
|
|
6671
|
+
}, getRootProps()), /*#__PURE__*/React.createElement(Typography$1, null, t("neetoImageUploader.common.dropHere"))), !isNilOrEmpty(selectedImage) ? /*#__PURE__*/React.createElement(ImageEditor, {
|
|
6663
6672
|
fixedAspectRatio: fixedAspectRatio,
|
|
6664
6673
|
handleImageEditComplete: handleImageEditComplete,
|
|
6665
6674
|
handleReset: function handleReset() {
|
|
@@ -6673,7 +6682,7 @@ var Modal = function Modal(_ref) {
|
|
|
6673
6682
|
onClick: function onClick(event) {
|
|
6674
6683
|
return event.stopPropagation();
|
|
6675
6684
|
}
|
|
6676
|
-
})), /*#__PURE__*/React.createElement(Modal$1.Header, null, /*#__PURE__*/React.createElement(Typography, {
|
|
6685
|
+
})), /*#__PURE__*/React.createElement(Modal$1.Header, null, /*#__PURE__*/React.createElement(Typography$1, {
|
|
6677
6686
|
style: "h2"
|
|
6678
6687
|
}, t("neetoImageUploader.common.imageLibrary"))), /*#__PURE__*/React.createElement("div", {
|
|
6679
6688
|
className: "px-6 py-2"
|
|
@@ -6708,7 +6717,7 @@ var Modal = function Modal(_ref) {
|
|
|
6708
6717
|
tab: activeTab
|
|
6709
6718
|
}), equals(activeTab, TABS[1].key) && /*#__PURE__*/React.createElement(Modal$1.Footer, {
|
|
6710
6719
|
className: "flex items-center justify-center gap-2"
|
|
6711
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
6720
|
+
}, /*#__PURE__*/React.createElement(Typography$1, {
|
|
6712
6721
|
style: "body2"
|
|
6713
6722
|
}, /*#__PURE__*/React.createElement(Trans, {
|
|
6714
6723
|
i18nKey: "neetoImageUploader.unsplash.poweredByUnsplash",
|
|
@@ -6722,7 +6731,7 @@ var Modal = function Modal(_ref) {
|
|
|
6722
6731
|
})))), /*#__PURE__*/React.createElement("input", getInputProps()));
|
|
6723
6732
|
};
|
|
6724
6733
|
|
|
6725
|
-
var _excluded
|
|
6734
|
+
var _excluded = ["key", "label"];
|
|
6726
6735
|
var Menu = Dropdown.Menu,
|
|
6727
6736
|
MenuItem = Dropdown.MenuItem;
|
|
6728
6737
|
var ImageUploader = function ImageUploader(_ref) {
|
|
@@ -6842,7 +6851,7 @@ var ImageUploader = function ImageUploader(_ref) {
|
|
|
6842
6851
|
}, /*#__PURE__*/React.createElement(Menu, null, options.map(function (_ref2) {
|
|
6843
6852
|
var key = _ref2.key,
|
|
6844
6853
|
label = _ref2.label,
|
|
6845
|
-
otherProps = _objectWithoutProperties$2(_ref2, _excluded
|
|
6854
|
+
otherProps = _objectWithoutProperties$2(_ref2, _excluded);
|
|
6846
6855
|
return /*#__PURE__*/React.createElement(MenuItem.Button, _extends$1({}, otherProps, {
|
|
6847
6856
|
key: key
|
|
6848
6857
|
}), label);
|
|
@@ -7169,13 +7178,13 @@ var Customize = function Customize(_ref) {
|
|
|
7169
7178
|
});
|
|
7170
7179
|
})), /*#__PURE__*/React.createElement("div", {
|
|
7171
7180
|
className: "neeto-ui-bg-white neeto-ui-shadow-s sticky bottom-0 left-0 right-0 flex justify-end gap-x-2 px-4 py-6"
|
|
7172
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
7181
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
7173
7182
|
"data-cy": "reset-button",
|
|
7174
7183
|
disabled: !dirty || isSubmitting,
|
|
7175
7184
|
label: t("neetoThemes.buttons.reset"),
|
|
7176
7185
|
style: "text",
|
|
7177
7186
|
type: "reset"
|
|
7178
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
7187
|
+
}), /*#__PURE__*/React.createElement(Button$1, {
|
|
7179
7188
|
"data-cy": "save-changes-button",
|
|
7180
7189
|
disabled: !dirty && (theme === null || theme === void 0 ? void 0 : theme.id) || isSubmitting,
|
|
7181
7190
|
label: t("neetoThemes.buttons.save"),
|
|
@@ -7185,36 +7194,6 @@ var Customize = function Customize(_ref) {
|
|
|
7185
7194
|
});
|
|
7186
7195
|
};
|
|
7187
7196
|
|
|
7188
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
7189
|
-
if (source == null) return {};
|
|
7190
|
-
var target = {};
|
|
7191
|
-
var sourceKeys = Object.keys(source);
|
|
7192
|
-
var key, i;
|
|
7193
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
7194
|
-
key = sourceKeys[i];
|
|
7195
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
7196
|
-
target[key] = source[key];
|
|
7197
|
-
}
|
|
7198
|
-
return target;
|
|
7199
|
-
}
|
|
7200
|
-
|
|
7201
|
-
function _objectWithoutProperties(source, excluded) {
|
|
7202
|
-
if (source == null) return {};
|
|
7203
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
7204
|
-
var key, i;
|
|
7205
|
-
if (Object.getOwnPropertySymbols) {
|
|
7206
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
7207
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
7208
|
-
key = sourceSymbolKeys[i];
|
|
7209
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
7210
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
7211
|
-
target[key] = source[key];
|
|
7212
|
-
}
|
|
7213
|
-
}
|
|
7214
|
-
return target;
|
|
7215
|
-
}
|
|
7216
|
-
|
|
7217
|
-
var _excluded = ["id", "name", "appliedCount", "properties"];
|
|
7218
7197
|
var Card = function Card(_ref) {
|
|
7219
7198
|
var _ref$active = _ref.active,
|
|
7220
7199
|
active = _ref$active === void 0 ? false : _ref$active,
|
|
@@ -7227,30 +7206,21 @@ var Card = function Card(_ref) {
|
|
|
7227
7206
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
7228
7207
|
onCloneTheme = _ref.onCloneTheme,
|
|
7229
7208
|
isHighLightedTheme = _ref.isHighLightedTheme,
|
|
7230
|
-
setThemeBeingApplied = _ref.setThemeBeingApplied
|
|
7209
|
+
setThemeBeingApplied = _ref.setThemeBeingApplied,
|
|
7210
|
+
Thumbnail = _ref.thumbnail;
|
|
7231
7211
|
var _useTranslation = useTranslation(),
|
|
7232
7212
|
t = _useTranslation.t;
|
|
7233
7213
|
var id = theme.id,
|
|
7234
7214
|
name = theme.name,
|
|
7235
|
-
appliedCount = theme.appliedCount
|
|
7236
|
-
properties = theme.properties,
|
|
7237
|
-
styles = _objectWithoutProperties(theme, _excluded);
|
|
7215
|
+
appliedCount = theme.appliedCount;
|
|
7238
7216
|
var _useConfigStore = useConfigStore(function (store) {
|
|
7239
7217
|
return {
|
|
7240
|
-
themeConfig: store["themeConfig"],
|
|
7241
7218
|
entityId: store["entityId"],
|
|
7242
7219
|
entityType: store["entityType"]
|
|
7243
7220
|
};
|
|
7244
7221
|
}, shallow),
|
|
7245
|
-
_useConfigStore$theme = _useConfigStore.themeConfig,
|
|
7246
|
-
themeConfig = _useConfigStore$theme === void 0 ? [] : _useConfigStore$theme,
|
|
7247
7222
|
entityId = _useConfigStore.entityId,
|
|
7248
7223
|
entityType = _useConfigStore.entityType;
|
|
7249
|
-
var _themeConfig = _slicedToArray$3(themeConfig, 2),
|
|
7250
|
-
colorObject1 = _themeConfig[0],
|
|
7251
|
-
colorObject2 = _themeConfig[1];
|
|
7252
|
-
var primaryLabel = humanize(colorObject1 === null || colorObject1 === void 0 ? void 0 : colorObject1.key);
|
|
7253
|
-
var secondaryLabel = humanize(colorObject2 === null || colorObject2 === void 0 ? void 0 : colorObject2.key);
|
|
7254
7224
|
var handleApplyThemeClick = function handleApplyThemeClick() {
|
|
7255
7225
|
if (isApplyingTheme) return;
|
|
7256
7226
|
setThemeBeingApplied(theme);
|
|
@@ -7269,64 +7239,19 @@ var Card = function Card(_ref) {
|
|
|
7269
7239
|
var handleDeleteTheme = function handleDeleteTheme() {
|
|
7270
7240
|
return onDeleteTheme(id, name, appliedCount);
|
|
7271
7241
|
};
|
|
7272
|
-
var primaryColor = findBy({
|
|
7273
|
-
key: colorObject1.key
|
|
7274
|
-
}, properties).value;
|
|
7275
|
-
var secondaryColor = findBy({
|
|
7276
|
-
key: colorObject2.key
|
|
7277
|
-
}, properties).value;
|
|
7278
|
-
var backgroundImageUrl = theme[snakeToCamelCase(findBy({
|
|
7279
|
-
useAsCardBackground: true
|
|
7280
|
-
}, themeConfig).key)].url;
|
|
7281
|
-
var isContentBackgroundEnabled = path(["layoutOptions", "isContentBackgroundEnabled"], styles);
|
|
7282
7242
|
return /*#__PURE__*/React.createElement("div", {
|
|
7283
7243
|
className: "group space-y-2 pt-0.5",
|
|
7284
7244
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
7285
|
-
id: theme.id
|
|
7286
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7287
|
-
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg border transition-all duration-300 ease-in-out", {
|
|
7288
|
-
"neeto-ui-border-gray-400": !active,
|
|
7289
|
-
"neeto-ui-border-gray-800 neeto-themes-theme-thumbnail--active": active,
|
|
7290
|
-
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
7291
|
-
"neeto-themes-theme-thumbnail--highlight-active": isHighLightedTheme
|
|
7292
|
-
}),
|
|
7293
|
-
style: {
|
|
7294
|
-
backgroundColor: path(["colorScheme", "backgroundColor"], styles),
|
|
7295
|
-
backgroundImage: backgroundImageUrl ? "url(".concat(backgroundImageUrl, ")") : "initial",
|
|
7296
|
-
backgroundSize: "cover"
|
|
7297
|
-
},
|
|
7245
|
+
id: theme.id,
|
|
7298
7246
|
onClick: function onClick() {
|
|
7299
7247
|
return onSetPreviewTheme(theme);
|
|
7300
7248
|
}
|
|
7301
|
-
}, /*#__PURE__*/React.createElement(
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
}
|
|
7308
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7309
|
-
className: "mb-3"
|
|
7310
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
7311
|
-
style: "h3",
|
|
7312
|
-
weight: "semibold"
|
|
7313
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
7314
|
-
style: {
|
|
7315
|
-
color: primaryColor
|
|
7316
|
-
}
|
|
7317
|
-
}, primaryLabel)), /*#__PURE__*/React.createElement(Typography, {
|
|
7318
|
-
className: "neeto-ui-text-gray-600",
|
|
7319
|
-
style: "body2"
|
|
7320
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
7321
|
-
style: {
|
|
7322
|
-
color: secondaryColor
|
|
7323
|
-
}
|
|
7324
|
-
}, secondaryLabel))), /*#__PURE__*/React.createElement("div", {
|
|
7325
|
-
className: "neeto-ui-rounded-lg h-5 w-12",
|
|
7326
|
-
style: {
|
|
7327
|
-
backgroundColor: path(["colorScheme", "buttonBackgroundColor"], styles)
|
|
7328
|
-
}
|
|
7329
|
-
})))), /*#__PURE__*/React.createElement("div", {
|
|
7249
|
+
}, Thumbnail && /*#__PURE__*/React.createElement(Thumbnail, {
|
|
7250
|
+
active: active,
|
|
7251
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
7252
|
+
isPreviewing: isPreviewing,
|
|
7253
|
+
theme: theme
|
|
7254
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7330
7255
|
className: "flex items-start justify-between gap-1"
|
|
7331
7256
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
7332
7257
|
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
@@ -7340,7 +7265,7 @@ var Card = function Card(_ref) {
|
|
|
7340
7265
|
"data-cy": "active-theme-label",
|
|
7341
7266
|
label: t("neetoThemes.common.active"),
|
|
7342
7267
|
style: "success"
|
|
7343
|
-
}) : /*#__PURE__*/React.createElement(Button, {
|
|
7268
|
+
}) : /*#__PURE__*/React.createElement(Button$1, {
|
|
7344
7269
|
className: "flex-shrink-0",
|
|
7345
7270
|
"data-cy": "apply-theme-button",
|
|
7346
7271
|
disabled: isApplyingTheme,
|
|
@@ -7392,7 +7317,8 @@ var Themes = function Themes(_ref) {
|
|
|
7392
7317
|
didScrollActiveThemeIntoView = _ref.didScrollActiveThemeIntoView,
|
|
7393
7318
|
isLoading = _ref.isLoading,
|
|
7394
7319
|
currentTheme = _ref.currentTheme,
|
|
7395
|
-
isCurrentThemeLoading = _ref.isCurrentThemeLoading
|
|
7320
|
+
isCurrentThemeLoading = _ref.isCurrentThemeLoading,
|
|
7321
|
+
thumbnail = _ref.thumbnail;
|
|
7396
7322
|
var _useTranslation = useTranslation(),
|
|
7397
7323
|
t = _useTranslation.t;
|
|
7398
7324
|
var _useThemeUtils = useThemeUtils(),
|
|
@@ -7458,7 +7384,7 @@ var Themes = function Themes(_ref) {
|
|
|
7458
7384
|
if (isLoading || isCurrentThemeLoading) {
|
|
7459
7385
|
return /*#__PURE__*/React.createElement("div", {
|
|
7460
7386
|
className: "flex h-full w-full items-center justify-center"
|
|
7461
|
-
}, /*#__PURE__*/React.createElement(Spinner, null));
|
|
7387
|
+
}, /*#__PURE__*/React.createElement(Spinner$1, null));
|
|
7462
7388
|
}
|
|
7463
7389
|
return /*#__PURE__*/React.createElement("div", {
|
|
7464
7390
|
className: "neeto-themes-sidebar__scroll"
|
|
@@ -7485,6 +7411,7 @@ var Themes = function Themes(_ref) {
|
|
|
7485
7411
|
onApplyTheme: onApplyTheme,
|
|
7486
7412
|
setThemeBeingApplied: setThemeBeingApplied,
|
|
7487
7413
|
theme: theme,
|
|
7414
|
+
thumbnail: thumbnail,
|
|
7488
7415
|
active: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id,
|
|
7489
7416
|
isPreviewing: (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id,
|
|
7490
7417
|
key: theme.id,
|
|
@@ -7510,6 +7437,7 @@ var Themes = function Themes(_ref) {
|
|
|
7510
7437
|
onEditTheme: onEditTheme,
|
|
7511
7438
|
setThemeBeingApplied: setThemeBeingApplied,
|
|
7512
7439
|
theme: theme,
|
|
7440
|
+
thumbnail: thumbnail,
|
|
7513
7441
|
active: isActive,
|
|
7514
7442
|
isHighLightedTheme: theme.id === themeToHighlight,
|
|
7515
7443
|
key: theme.id,
|
|
@@ -7533,7 +7461,7 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
7533
7461
|
className: "neeto-themes-sidebar__header px-4"
|
|
7534
7462
|
}, /*#__PURE__*/React.createElement("div", {
|
|
7535
7463
|
className: "flex items-center justify-start space-x-2"
|
|
7536
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
7464
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
7537
7465
|
"data-cy": "customize-themes-back-button",
|
|
7538
7466
|
icon: LeftArrow,
|
|
7539
7467
|
iconPosition: "left",
|
|
@@ -7561,7 +7489,7 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
7561
7489
|
weight: "semibold"
|
|
7562
7490
|
}, t("neetoThemes.build.leftSideBar.headerTabs.themes")), /*#__PURE__*/React.createElement("div", {
|
|
7563
7491
|
className: "self-end"
|
|
7564
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
7492
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
7565
7493
|
"data-cy": "customize-themes-add-theme-button",
|
|
7566
7494
|
icon: Plus,
|
|
7567
7495
|
iconPosition: "left",
|
|
@@ -7575,8 +7503,9 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
7575
7503
|
};
|
|
7576
7504
|
|
|
7577
7505
|
var MemoizedAlert = /*#__PURE__*/memo(Alert);
|
|
7578
|
-
var Sidebar = function Sidebar() {
|
|
7506
|
+
var Sidebar = function Sidebar(_ref) {
|
|
7579
7507
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3;
|
|
7508
|
+
var thumbnail = _ref.thumbnail;
|
|
7580
7509
|
var _useState = useState(DESIGN_SCREENS.THEMES),
|
|
7581
7510
|
_useState2 = _slicedToArray$3(_useState, 2),
|
|
7582
7511
|
currentScreen = _useState2[0],
|
|
@@ -7709,6 +7638,7 @@ var Sidebar = function Sidebar() {
|
|
|
7709
7638
|
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
7710
7639
|
themeToHighlight: themeToHighlight,
|
|
7711
7640
|
themes: themes,
|
|
7641
|
+
thumbnail: thumbnail,
|
|
7712
7642
|
isLoading: isLoading || isFetchingConfig,
|
|
7713
7643
|
onDeleteTheme: handleDelete,
|
|
7714
7644
|
onEditTheme: handleEditTheme
|
|
@@ -7733,7 +7663,8 @@ var Sidebar = function Sidebar() {
|
|
|
7733
7663
|
var NeetoThemes = function NeetoThemes(_ref) {
|
|
7734
7664
|
var children = _ref.children,
|
|
7735
7665
|
entityType = _ref.entityType,
|
|
7736
|
-
entityId = _ref.entityId
|
|
7666
|
+
entityId = _ref.entityId,
|
|
7667
|
+
thumbnail = _ref.thumbnail;
|
|
7737
7668
|
var _useThemeStore = useThemeStore(function (store) {
|
|
7738
7669
|
return {
|
|
7739
7670
|
isCurrentThemeLoading: store["isCurrentThemeLoading"]
|
|
@@ -7754,11 +7685,13 @@ var NeetoThemes = function NeetoThemes(_ref) {
|
|
|
7754
7685
|
}, []);
|
|
7755
7686
|
return /*#__PURE__*/React.createElement("div", {
|
|
7756
7687
|
className: "neeto-themes__wrapper"
|
|
7757
|
-
}, /*#__PURE__*/React.createElement(Sidebar,
|
|
7688
|
+
}, /*#__PURE__*/React.createElement(Sidebar, {
|
|
7689
|
+
thumbnail: thumbnail
|
|
7690
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7758
7691
|
className: "neeto-themes-preview__wrapper"
|
|
7759
7692
|
}, isCurrentThemeLoading ? /*#__PURE__*/React.createElement("div", {
|
|
7760
7693
|
className: "m-auto flex h-full w-full items-center justify-center"
|
|
7761
|
-
}, /*#__PURE__*/React.createElement(Spinner, null)) : children));
|
|
7694
|
+
}, /*#__PURE__*/React.createElement(Spinner$1, null)) : children));
|
|
7762
7695
|
};
|
|
7763
7696
|
var index = withTitle(NeetoThemes, t$2("neetoThemes.common.design"));
|
|
7764
7697
|
|