@bigbinary/neeto-themes-frontend 2.1.5 → 2.1.7
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/NeetoThemesBuilder.js +17 -11
- package/dist/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/NeetoThemesBuilder.js +112 -138
- package/dist/cjs/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/hooks.js +2 -4
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/index.js +3 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils.js +1 -3
- package/dist/cjs/utils.js.map +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{index-da3e7846.js → index-CvV1tFYS.js} +5 -5
- package/dist/{index-da3e7846.js.map → index-CvV1tFYS.js.map} +1 -1
- package/dist/{index-33a71cf7.js → index-D6l2IgrM.js} +6 -12
- package/dist/index-D6l2IgrM.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/{useThemeUtils-8ebfd58f.js → useThemeUtils-VrVvqk7M.js} +3 -7
- package/dist/{useThemeUtils-8ebfd58f.js.map → useThemeUtils-VrVvqk7M.js.map} +1 -1
- package/dist/{useThemeUtils-500caefe.js → useThemeUtils-j1OwYSmN.js} +2 -2
- package/dist/{useThemeUtils-500caefe.js.map → useThemeUtils-j1OwYSmN.js.map} +1 -1
- package/dist/utils.js +1 -1
- package/package.json +99 -95
- package/dist/index-33a71cf7.js.map +0 -1
|
@@ -6,8 +6,8 @@ import { useMutationWithInvalidation, withT, useBreakpoints, withTitle } from '@
|
|
|
6
6
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
7
7
|
import { useQuery } from '@tanstack/react-query';
|
|
8
8
|
import axios from 'axios';
|
|
9
|
-
import { B as BASE_URL,
|
|
10
|
-
import { Q as QUERY_KEYS, a as useConfigStore, b as useThemeStore, u as useThemeUtils } from './useThemeUtils-
|
|
9
|
+
import { B as BASE_URL, b as scrollElementIntoView, c as setCustomCSS, g as getDominantColorFromUrl, i as isFunction } from './index-CvV1tFYS.js';
|
|
10
|
+
import { Q as QUERY_KEYS, a as useConfigStore, b as useThemeStore, u as useThemeUtils } from './useThemeUtils-j1OwYSmN.js';
|
|
11
11
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
12
12
|
import classnames from 'classnames';
|
|
13
13
|
import Collapse from '@bigbinary/neeto-icons/Collapse';
|
|
@@ -27,7 +27,7 @@ import Down from '@bigbinary/neeto-icons/Down';
|
|
|
27
27
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
28
28
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
29
29
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
30
|
-
import
|
|
30
|
+
import ImageUploader from '@bigbinary/neeto-image-uploader-frontend/ImageUploader';
|
|
31
31
|
import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
32
32
|
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
33
33
|
import { isEmpty, negate } from 'ramda';
|
|
@@ -228,6 +228,12 @@ var FONT_OPTIONS = [{
|
|
|
228
228
|
}, {
|
|
229
229
|
label: "Dancing Script",
|
|
230
230
|
value: "Dancing Script, cursive"
|
|
231
|
+
}, {
|
|
232
|
+
label: "Tw Cent",
|
|
233
|
+
value: "Tw Cen MT, Tahoma, sans-serif"
|
|
234
|
+
}, {
|
|
235
|
+
label: "Comic Sans",
|
|
236
|
+
value: "Comic Sans MS, cursive"
|
|
231
237
|
}];
|
|
232
238
|
var THEME_VALIDATION_SCHEMA = yup.object().shape({
|
|
233
239
|
name: yup.string().required("Name is required")
|
|
@@ -570,7 +576,7 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
570
576
|
key: "".concat(name, "_position")
|
|
571
577
|
}, values.properties);
|
|
572
578
|
var handleImageChange = /*#__PURE__*/function () {
|
|
573
|
-
var _ref2 = _asyncToGenerator(
|
|
579
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(image) {
|
|
574
580
|
var dominantColor;
|
|
575
581
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
576
582
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -613,7 +619,7 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
613
619
|
}();
|
|
614
620
|
return /*#__PURE__*/jsxs("div", {
|
|
615
621
|
className: "space-y-3",
|
|
616
|
-
"data-cy": "theme-style-".concat(joinHyphenCase(label)),
|
|
622
|
+
"data-cy": "theme-style-".concat(label ? joinHyphenCase(label) : "image-block"),
|
|
617
623
|
children: [label && /*#__PURE__*/jsx("div", {
|
|
618
624
|
className: "flex items-center justify-between",
|
|
619
625
|
children: /*#__PURE__*/jsx(Typography, {
|
|
@@ -911,7 +917,7 @@ var Properties = function Properties(_ref) {
|
|
|
911
917
|
}
|
|
912
918
|
};
|
|
913
919
|
useEffect(function () {
|
|
914
|
-
onPropertiesChange === null || onPropertiesChange === void 0
|
|
920
|
+
onPropertiesChange === null || onPropertiesChange === void 0 ? void 0 : onPropertiesChange(values, handleChange, handleColorChange);
|
|
915
921
|
setTheme(values);
|
|
916
922
|
setThemeState({
|
|
917
923
|
previewingTheme: values
|
|
@@ -981,13 +987,13 @@ var Properties = function Properties(_ref) {
|
|
|
981
987
|
}, key);
|
|
982
988
|
case "position_selector":
|
|
983
989
|
{
|
|
984
|
-
var _findBy3;
|
|
990
|
+
var _findBy3, _findBy3$options;
|
|
985
991
|
var index = findIndexBy({
|
|
986
992
|
key: key
|
|
987
993
|
}, values.properties);
|
|
988
994
|
var options = (_findBy3 = findBy({
|
|
989
995
|
key: key
|
|
990
|
-
}, themePropertiesSchema)) === null || _findBy3 === void 0
|
|
996
|
+
}, themePropertiesSchema)) === null || _findBy3 === void 0 ? void 0 : (_findBy3$options = _findBy3.options) === null || _findBy3$options === void 0 ? void 0 : _findBy3$options.map(toLabelAndValue);
|
|
991
997
|
return /*#__PURE__*/jsx(SelectBlock, {
|
|
992
998
|
label: buildLabel(key, kind),
|
|
993
999
|
options: options || POSITION_OPTIONS,
|
|
@@ -1105,7 +1111,7 @@ var Customize = function Customize(_ref) {
|
|
|
1105
1111
|
resetForm({
|
|
1106
1112
|
values: values
|
|
1107
1113
|
});
|
|
1108
|
-
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0
|
|
1114
|
+
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 ? void 0 : onUpdateThemeSuccess(values);
|
|
1109
1115
|
}
|
|
1110
1116
|
});
|
|
1111
1117
|
};
|
|
@@ -1177,7 +1183,7 @@ var Customize = function Customize(_ref) {
|
|
|
1177
1183
|
style: "text",
|
|
1178
1184
|
onClick: function onClick() {
|
|
1179
1185
|
var _popoverInstance$hide;
|
|
1180
|
-
return popoverInstance === null || popoverInstance === void 0
|
|
1186
|
+
return popoverInstance === null || popoverInstance === void 0 ? void 0 : (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
1181
1187
|
}
|
|
1182
1188
|
}), /*#__PURE__*/jsx(Typography, {
|
|
1183
1189
|
className: "w-72 pr-5",
|
|
@@ -1772,7 +1778,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1772
1778
|
});
|
|
1773
1779
|
setThemeBeingApplied({});
|
|
1774
1780
|
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1775
|
-
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0
|
|
1781
|
+
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 ? void 0 : onApplyThemeSuccess(theme);
|
|
1776
1782
|
}
|
|
1777
1783
|
}),
|
|
1778
1784
|
applyTheme = _useApplyTheme.mutate,
|