@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
|
@@ -8,8 +8,8 @@ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
|
8
8
|
var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
9
9
|
var reactQuery = require('@tanstack/react-query');
|
|
10
10
|
var axios = require('axios');
|
|
11
|
-
var utils = require('../index-
|
|
12
|
-
var useThemeUtils = require('../useThemeUtils-
|
|
11
|
+
var utils = require('../index-D6l2IgrM.js');
|
|
12
|
+
var useThemeUtils = require('../useThemeUtils-VrVvqk7M.js');
|
|
13
13
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
14
14
|
var classnames = require('classnames');
|
|
15
15
|
var Collapse = require('@bigbinary/neeto-icons/Collapse');
|
|
@@ -29,7 +29,7 @@ var Down = require('@bigbinary/neeto-icons/Down');
|
|
|
29
29
|
var jsxRuntime = require('react/jsx-runtime');
|
|
30
30
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
31
31
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
32
|
-
var
|
|
32
|
+
var ImageUploader = require('@bigbinary/neeto-image-uploader-frontend/ImageUploader');
|
|
33
33
|
var utils$1 = require('@bigbinary/neeto-commons-frontend/utils');
|
|
34
34
|
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
35
35
|
var ramda = require('ramda');
|
|
@@ -47,10 +47,7 @@ var LeftArrow = require('@bigbinary/neeto-icons/LeftArrow');
|
|
|
47
47
|
var Plus = require('@bigbinary/neeto-icons/Plus');
|
|
48
48
|
require('zustand');
|
|
49
49
|
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
function _interopNamespace(e) {
|
|
53
|
-
if (e && e.__esModule) return e;
|
|
50
|
+
function _interopNamespaceDefault(e) {
|
|
54
51
|
var n = Object.create(null);
|
|
55
52
|
if (e) {
|
|
56
53
|
Object.keys(e).forEach(function (k) {
|
|
@@ -63,43 +60,14 @@ function _interopNamespace(e) {
|
|
|
63
60
|
}
|
|
64
61
|
});
|
|
65
62
|
}
|
|
66
|
-
n
|
|
63
|
+
n.default = e;
|
|
67
64
|
return Object.freeze(n);
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
var
|
|
71
|
-
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
72
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
73
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
74
|
-
var Collapse__default = /*#__PURE__*/_interopDefaultLegacy(Collapse);
|
|
75
|
-
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
76
|
-
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
77
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
78
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
79
|
-
var Close__default = /*#__PURE__*/_interopDefaultLegacy(Close);
|
|
80
|
-
var Popover__default = /*#__PURE__*/_interopDefaultLegacy(Popover);
|
|
81
|
-
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
82
|
-
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
83
|
-
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
84
|
-
var Editor__default = /*#__PURE__*/_interopDefaultLegacy(Editor);
|
|
85
|
-
var Down__default = /*#__PURE__*/_interopDefaultLegacy(Down);
|
|
86
|
-
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
87
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
88
|
-
var Toastr__default = /*#__PURE__*/_interopDefaultLegacy(Toastr);
|
|
89
|
-
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
90
|
-
var CenterAlign__default = /*#__PURE__*/_interopDefaultLegacy(CenterAlign);
|
|
91
|
-
var LeftAlign__default = /*#__PURE__*/_interopDefaultLegacy(LeftAlign);
|
|
92
|
-
var ColorPicker__default = /*#__PURE__*/_interopDefaultLegacy(ColorPicker);
|
|
93
|
-
var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
|
|
94
|
-
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
95
|
-
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
96
|
-
var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
|
|
97
|
-
var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
98
|
-
var LeftArrow__default = /*#__PURE__*/_interopDefaultLegacy(LeftArrow);
|
|
99
|
-
var Plus__default = /*#__PURE__*/_interopDefaultLegacy(Plus);
|
|
67
|
+
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
100
68
|
|
|
101
69
|
var show$1 = function show(entityId) {
|
|
102
|
-
return
|
|
70
|
+
return axios.get("".concat(utils.BASE_URL, "/api/v1/entities/").concat(entityId));
|
|
103
71
|
};
|
|
104
72
|
var entitiesApi = {
|
|
105
73
|
show: show$1
|
|
@@ -122,37 +90,37 @@ n(css,{});
|
|
|
122
90
|
|
|
123
91
|
var _excluded$1 = ["themeId"];
|
|
124
92
|
var list = function list(entityId) {
|
|
125
|
-
return
|
|
93
|
+
return axios.get("".concat(utils.BASE_URL, "/api/v1/themes"), {
|
|
126
94
|
params: {
|
|
127
95
|
entity_id: entityId
|
|
128
96
|
}
|
|
129
97
|
});
|
|
130
98
|
};
|
|
131
99
|
var show = function show(id) {
|
|
132
|
-
return
|
|
100
|
+
return axios.get("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id));
|
|
133
101
|
};
|
|
134
102
|
var create = function create(payload) {
|
|
135
|
-
return
|
|
103
|
+
return axios.post("".concat(utils.BASE_URL, "/api/v1/themes"), {
|
|
136
104
|
theme: payload
|
|
137
105
|
});
|
|
138
106
|
};
|
|
139
107
|
var update = function update(_ref) {
|
|
140
108
|
var id = _ref.id,
|
|
141
109
|
payload = _ref.payload;
|
|
142
|
-
return
|
|
110
|
+
return axios.put("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id), {
|
|
143
111
|
theme: payload
|
|
144
112
|
});
|
|
145
113
|
};
|
|
146
114
|
var destroy = function destroy(id) {
|
|
147
|
-
return
|
|
115
|
+
return axios["delete"]("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id));
|
|
148
116
|
};
|
|
149
117
|
var clone = function clone(id) {
|
|
150
|
-
return
|
|
118
|
+
return axios.post("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id, "/clone"));
|
|
151
119
|
};
|
|
152
120
|
var apply = function apply(_ref2) {
|
|
153
121
|
var themeId = _ref2.themeId,
|
|
154
|
-
payload =
|
|
155
|
-
return
|
|
122
|
+
payload = _objectWithoutProperties(_ref2, _excluded$1);
|
|
123
|
+
return axios.post("".concat(utils.BASE_URL, "/api/v1/themes/").concat(themeId, "/apply"), {
|
|
156
124
|
entity: payload
|
|
157
125
|
});
|
|
158
126
|
};
|
|
@@ -281,6 +249,12 @@ var FONT_OPTIONS = [{
|
|
|
281
249
|
}, {
|
|
282
250
|
label: "Dancing Script",
|
|
283
251
|
value: "Dancing Script, cursive"
|
|
252
|
+
}, {
|
|
253
|
+
label: "Tw Cent",
|
|
254
|
+
value: "Tw Cen MT, Tahoma, sans-serif"
|
|
255
|
+
}, {
|
|
256
|
+
label: "Comic Sans",
|
|
257
|
+
value: "Comic Sans MS, cursive"
|
|
284
258
|
}];
|
|
285
259
|
var THEME_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
286
260
|
name: yup__namespace.string().required("Name is required")
|
|
@@ -304,7 +278,7 @@ var DESIGN_SCREENS = {
|
|
|
304
278
|
var ONE_MEGABYTE = 1;
|
|
305
279
|
|
|
306
280
|
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
307
|
-
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) {
|
|
281
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
308
282
|
var Card$2 = function Card(_ref) {
|
|
309
283
|
var _ref$title = _ref.title,
|
|
310
284
|
title = _ref$title === void 0 ? "" : _ref$title,
|
|
@@ -312,12 +286,12 @@ var Card$2 = function Card(_ref) {
|
|
|
312
286
|
name = _ref.name,
|
|
313
287
|
className = _ref.className;
|
|
314
288
|
var _useState = react.useState(ACCORDIAN_OPEN_STATE),
|
|
315
|
-
_useState2 =
|
|
289
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
316
290
|
accordianOpenState = _useState2[0],
|
|
317
291
|
setAccordianOpenState = _useState2[1];
|
|
318
292
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
319
293
|
"data-cy": "theme-".concat(neetoCist.hyphenate(title), "-properties"),
|
|
320
|
-
className:
|
|
294
|
+
className: classnames("neeto-themes-nano-section neeto-ui-border-gray-200 border-b pt-2 transition-all duration-300 last:border-none", className, {
|
|
321
295
|
"pb-2": !accordianOpenState[name],
|
|
322
296
|
"pb-3": accordianOpenState[name]
|
|
323
297
|
}),
|
|
@@ -325,9 +299,9 @@ var Card$2 = function Card(_ref) {
|
|
|
325
299
|
className: "neeto-themes-nano-section__title flex w-full cursor-pointer items-center justify-between px-1 py-2 focus:outline-none",
|
|
326
300
|
type: "button",
|
|
327
301
|
onClick: function onClick() {
|
|
328
|
-
return setAccordianOpenState(_objectSpread$5(_objectSpread$5({}, accordianOpenState), {},
|
|
302
|
+
return setAccordianOpenState(_objectSpread$5(_objectSpread$5({}, accordianOpenState), {}, _defineProperty({}, name, !accordianOpenState[name])));
|
|
329
303
|
},
|
|
330
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
304
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
331
305
|
className: "min-w-0 flex-grow text-left",
|
|
332
306
|
component: "span",
|
|
333
307
|
"data-cy": "theme-properties",
|
|
@@ -335,14 +309,14 @@ var Card$2 = function Card(_ref) {
|
|
|
335
309
|
style: "h4",
|
|
336
310
|
weight: "semibold",
|
|
337
311
|
children: title
|
|
338
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
312
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Down, {
|
|
339
313
|
size: 20,
|
|
340
|
-
className:
|
|
314
|
+
className: classnames("transition-all duration-300", {
|
|
341
315
|
"rotate-180": accordianOpenState[name]
|
|
342
316
|
})
|
|
343
317
|
})]
|
|
344
318
|
}), children && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
345
|
-
className:
|
|
319
|
+
className: classnames("neeto-themes-nano-section__content w-full space-y-3 overflow-hidden px-1 transition-all duration-300", {
|
|
346
320
|
"neeto-themes-nano-section__content--closed": !accordianOpenState[name],
|
|
347
321
|
"neeto-themes-nano-section__content--open pb-1": accordianOpenState[name]
|
|
348
322
|
}),
|
|
@@ -407,17 +381,17 @@ var CustomCSS = function CustomCSS(_ref) {
|
|
|
407
381
|
className: "w-full",
|
|
408
382
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
409
383
|
className: "neeto-themes-sidebar__custom-css-editor-header w-full justify-end gap-1 rounded-b-none p-2",
|
|
410
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
384
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
411
385
|
size: "small",
|
|
412
386
|
style: "secondary",
|
|
413
387
|
label: isCustomCssScreen ? t("neetoThemes.buttons.minimizeEditor") : t("neetoThemes.buttons.expandEditor"),
|
|
414
388
|
onClick: handleEditorToggle
|
|
415
389
|
})
|
|
416
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
390
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Editor, {
|
|
417
391
|
language: "css",
|
|
418
392
|
theme: "vs-dark",
|
|
419
393
|
value: customCSS.value,
|
|
420
|
-
className:
|
|
394
|
+
className: classnames({
|
|
421
395
|
rounded: true,
|
|
422
396
|
"css-editor-height__expanded": isCustomCssScreen,
|
|
423
397
|
"css-editor-height__regular": !isCustomCssScreen
|
|
@@ -436,7 +410,7 @@ var CustomCSS = function CustomCSS(_ref) {
|
|
|
436
410
|
};
|
|
437
411
|
|
|
438
412
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
439
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) {
|
|
413
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
440
414
|
var buildInitialValues = function buildInitialValues(theme, themePropertiesSchema) {
|
|
441
415
|
if (neetoCist.isPresent(theme)) return theme;
|
|
442
416
|
return {
|
|
@@ -572,13 +546,13 @@ var SelectBlock = function SelectBlock(_ref) {
|
|
|
572
546
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
573
547
|
className: "flex items-center justify-between",
|
|
574
548
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
575
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
549
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
576
550
|
"data-cy": "logo-field-labels",
|
|
577
551
|
style: "body2",
|
|
578
552
|
children: label
|
|
579
553
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
580
554
|
className: "w-40",
|
|
581
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
555
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
582
556
|
onChange: onChange,
|
|
583
557
|
options: options,
|
|
584
558
|
placeholder: placeholder,
|
|
@@ -623,9 +597,9 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
623
597
|
key: "".concat(name, "_position")
|
|
624
598
|
}, values.properties);
|
|
625
599
|
var handleImageChange = /*#__PURE__*/function () {
|
|
626
|
-
var _ref2 =
|
|
600
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(image) {
|
|
627
601
|
var dominantColor;
|
|
628
|
-
return
|
|
602
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
629
603
|
while (1) switch (_context.prev = _context.next) {
|
|
630
604
|
case 0:
|
|
631
605
|
_context.prev = 0;
|
|
@@ -653,7 +627,7 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
653
627
|
case 10:
|
|
654
628
|
_context.prev = 10;
|
|
655
629
|
_context.t0 = _context["catch"](0);
|
|
656
|
-
|
|
630
|
+
Toastr.error(_context.t0);
|
|
657
631
|
case 13:
|
|
658
632
|
case "end":
|
|
659
633
|
return _context.stop();
|
|
@@ -666,17 +640,17 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
666
640
|
}();
|
|
667
641
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
668
642
|
className: "space-y-3",
|
|
669
|
-
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
643
|
+
"data-cy": "theme-style-".concat(label ? utils$1.joinHyphenCase(label) : "image-block"),
|
|
670
644
|
children: [label && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
671
645
|
className: "flex items-center justify-between",
|
|
672
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
646
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
673
647
|
"data-cy": "style-fields-labels",
|
|
674
648
|
style: "body2",
|
|
675
649
|
children: label
|
|
676
650
|
})
|
|
677
651
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
678
652
|
className: "space-y-3",
|
|
679
|
-
children: [/*#__PURE__*/react.createElement(
|
|
653
|
+
children: [/*#__PURE__*/react.createElement(ImageUploader, {
|
|
680
654
|
uploadConfig: uploadConfig,
|
|
681
655
|
className: "h-40 w-full",
|
|
682
656
|
key: imageData === null || imageData === void 0 ? void 0 : imageData.url,
|
|
@@ -723,7 +697,7 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
723
697
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
724
698
|
className: "flex items-center justify-between gap-2",
|
|
725
699
|
"data-cy": utils$1.joinHyphenCase(label),
|
|
726
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
700
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
727
701
|
"data-cy": "style-fields-labels",
|
|
728
702
|
style: "body2",
|
|
729
703
|
children: label
|
|
@@ -734,15 +708,15 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
734
708
|
setFieldValue = _ref2.form.setFieldValue;
|
|
735
709
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
736
710
|
className: "neeto-ui-border-gray-300 neeto-themes-nano-alignment-block flex items-center border",
|
|
737
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
711
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
738
712
|
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-left",
|
|
739
713
|
"data-cy": "alignment-left",
|
|
740
714
|
size: "medium",
|
|
741
715
|
style: value === "left" ? "primary" : "text",
|
|
742
716
|
icon: function icon() {
|
|
743
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
717
|
+
return /*#__PURE__*/jsxRuntime.jsx(LeftAlign, {
|
|
744
718
|
size: 20,
|
|
745
|
-
className:
|
|
719
|
+
className: classnames({
|
|
746
720
|
rounded: true,
|
|
747
721
|
"neeto-ui-text-primary-800": value === "left",
|
|
748
722
|
"neeto-ui-text-gray-600": value !== "left"
|
|
@@ -758,15 +732,15 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
758
732
|
}
|
|
759
733
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
760
734
|
className: "neeto-themes-nano-alignment-divider"
|
|
761
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
735
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
762
736
|
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-center",
|
|
763
737
|
"data-cy": "alignment-center",
|
|
764
738
|
size: "medium",
|
|
765
739
|
style: value === "center" ? "primary" : "text",
|
|
766
740
|
icon: function icon() {
|
|
767
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
741
|
+
return /*#__PURE__*/jsxRuntime.jsx(CenterAlign, {
|
|
768
742
|
size: 20,
|
|
769
|
-
className:
|
|
743
|
+
className: classnames({
|
|
770
744
|
rounded: true,
|
|
771
745
|
"neeto-ui-text-primary-800": value === "center",
|
|
772
746
|
"neeto-ui-text-gray-600": value !== "center"
|
|
@@ -796,11 +770,11 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
796
770
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
797
771
|
className: "flex items-center justify-between",
|
|
798
772
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
799
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
773
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
800
774
|
"data-cy": "style-fields-labels",
|
|
801
775
|
style: "body2",
|
|
802
776
|
children: label
|
|
803
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
777
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ColorPicker, {
|
|
804
778
|
color: color,
|
|
805
779
|
onChange: onChange,
|
|
806
780
|
showTransparencyControl: showTransparencyControl,
|
|
@@ -811,7 +785,7 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
811
785
|
};
|
|
812
786
|
|
|
813
787
|
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
814
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) {
|
|
788
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
815
789
|
var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
816
790
|
var label = _ref.label,
|
|
817
791
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -822,13 +796,13 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
822
796
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
823
797
|
className: "flex items-center justify-between",
|
|
824
798
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
825
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
799
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
826
800
|
"data-cy": "style-fields-labels",
|
|
827
801
|
style: "body2",
|
|
828
802
|
children: label
|
|
829
803
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
830
804
|
className: "w-40",
|
|
831
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
805
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
832
806
|
onChange: onChange,
|
|
833
807
|
options: options,
|
|
834
808
|
placeholder: placeholder,
|
|
@@ -857,7 +831,7 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
857
831
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
858
832
|
className: "flex items-center justify-between gap-3",
|
|
859
833
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
860
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
834
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
861
835
|
"data-cy": "style-fields-labels",
|
|
862
836
|
style: "body2",
|
|
863
837
|
children: label
|
|
@@ -877,11 +851,11 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
877
851
|
|
|
878
852
|
var _excluded = ["label", "name"];
|
|
879
853
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
880
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) {
|
|
854
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
881
855
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
882
856
|
var label = _ref.label,
|
|
883
857
|
name = _ref.name,
|
|
884
|
-
switchProps =
|
|
858
|
+
switchProps = _objectWithoutProperties(_ref, _excluded);
|
|
885
859
|
var _useTranslation = reactI18next.useTranslation(),
|
|
886
860
|
t = _useTranslation.t,
|
|
887
861
|
i18n = _useTranslation.i18n;
|
|
@@ -891,19 +865,19 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
891
865
|
className: "flex items-center justify-between",
|
|
892
866
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
893
867
|
className: "inline-flex items-center gap-4",
|
|
894
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
868
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
895
869
|
"data-cy": "style-fields-labels",
|
|
896
870
|
style: "body2",
|
|
897
|
-
className:
|
|
871
|
+
className: classnames({
|
|
898
872
|
"w-32": doesHelpTextExist,
|
|
899
873
|
"w-auto": !doesHelpTextExist
|
|
900
874
|
}),
|
|
901
875
|
children: label
|
|
902
|
-
}), doesHelpTextExist && /*#__PURE__*/jsxRuntime.jsx(
|
|
876
|
+
}), doesHelpTextExist && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
|
|
903
877
|
className: "flex-shrink-0",
|
|
904
878
|
description: t(translationKey)
|
|
905
879
|
})]
|
|
906
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
880
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Switch, _objectSpread$2(_objectSpread$2({}, _objectSpread$2({
|
|
907
881
|
name: name
|
|
908
882
|
}, switchProps)), {}, {
|
|
909
883
|
"data-cy": "enable-background-color-toggle"
|
|
@@ -964,7 +938,7 @@ var Properties = function Properties(_ref) {
|
|
|
964
938
|
}
|
|
965
939
|
};
|
|
966
940
|
react.useEffect(function () {
|
|
967
|
-
onPropertiesChange === null || onPropertiesChange === void 0
|
|
941
|
+
onPropertiesChange === null || onPropertiesChange === void 0 ? void 0 : onPropertiesChange(values, handleChange, handleColorChange);
|
|
968
942
|
setTheme(values);
|
|
969
943
|
setThemeState({
|
|
970
944
|
previewingTheme: values
|
|
@@ -1034,13 +1008,13 @@ var Properties = function Properties(_ref) {
|
|
|
1034
1008
|
}, key);
|
|
1035
1009
|
case "position_selector":
|
|
1036
1010
|
{
|
|
1037
|
-
var _findBy3;
|
|
1011
|
+
var _findBy3, _findBy3$options;
|
|
1038
1012
|
var index = neetoCist.findIndexBy({
|
|
1039
1013
|
key: key
|
|
1040
1014
|
}, values.properties);
|
|
1041
1015
|
var options = (_findBy3 = neetoCist.findBy({
|
|
1042
1016
|
key: key
|
|
1043
|
-
}, themePropertiesSchema)) === null || _findBy3 === void 0
|
|
1017
|
+
}, themePropertiesSchema)) === null || _findBy3 === void 0 ? void 0 : (_findBy3$options = _findBy3.options) === null || _findBy3$options === void 0 ? void 0 : _findBy3$options.map(neetoCist.toLabelAndValue);
|
|
1044
1018
|
return /*#__PURE__*/jsxRuntime.jsx(SelectBlock, {
|
|
1045
1019
|
label: buildLabel(key, kind),
|
|
1046
1020
|
options: options || POSITION_OPTIONS,
|
|
@@ -1089,7 +1063,7 @@ var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
|
1089
1063
|
className: className,
|
|
1090
1064
|
name: "name",
|
|
1091
1065
|
title: t("neetoThemes.common.name"),
|
|
1092
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1066
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
1093
1067
|
autoFocus: true,
|
|
1094
1068
|
"data-cy": "theme-name-property",
|
|
1095
1069
|
name: "name"
|
|
@@ -1098,7 +1072,7 @@ var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
|
1098
1072
|
});
|
|
1099
1073
|
|
|
1100
1074
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1101
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) {
|
|
1075
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1102
1076
|
var Customize = function Customize(_ref) {
|
|
1103
1077
|
var themeId = _ref.themeId,
|
|
1104
1078
|
theme = _ref.theme,
|
|
@@ -1112,7 +1086,7 @@ var Customize = function Customize(_ref) {
|
|
|
1112
1086
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1113
1087
|
t = _useTranslation.t;
|
|
1114
1088
|
var _useState = react.useState({}),
|
|
1115
|
-
_useState2 =
|
|
1089
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1116
1090
|
popoverInstance = _useState2[0],
|
|
1117
1091
|
setPopoverInstance = _useState2[1];
|
|
1118
1092
|
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
@@ -1158,11 +1132,11 @@ var Customize = function Customize(_ref) {
|
|
|
1158
1132
|
resetForm({
|
|
1159
1133
|
values: values
|
|
1160
1134
|
});
|
|
1161
|
-
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0
|
|
1135
|
+
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 ? void 0 : onUpdateThemeSuccess(values);
|
|
1162
1136
|
}
|
|
1163
1137
|
});
|
|
1164
1138
|
};
|
|
1165
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1139
|
+
return /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
1166
1140
|
formikProps: {
|
|
1167
1141
|
initialValues: buildInitialValues(theme, themePropertiesSchema),
|
|
1168
1142
|
validationSchema: THEME_VALIDATION_SCHEMA,
|
|
@@ -1175,12 +1149,12 @@ var Customize = function Customize(_ref) {
|
|
|
1175
1149
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1176
1150
|
className: "neeto-themes-sidebar__scroll-content flex flex-grow flex-col px-4 pb-4 lg:px-5",
|
|
1177
1151
|
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {
|
|
1178
|
-
className:
|
|
1152
|
+
className: classnames({
|
|
1179
1153
|
hidden: isCustomCssScreen
|
|
1180
1154
|
})
|
|
1181
1155
|
}), /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
1182
1156
|
onPropertiesChange: onPropertiesChange,
|
|
1183
|
-
className:
|
|
1157
|
+
className: classnames({
|
|
1184
1158
|
hidden: isCustomCssScreen
|
|
1185
1159
|
})
|
|
1186
1160
|
}), neetoCist.filterBy({
|
|
@@ -1189,7 +1163,7 @@ var Customize = function Customize(_ref) {
|
|
|
1189
1163
|
var key = _ref5.key;
|
|
1190
1164
|
return /*#__PURE__*/jsxRuntime.jsx(Images, {
|
|
1191
1165
|
attribute: key,
|
|
1192
|
-
className:
|
|
1166
|
+
className: classnames({
|
|
1193
1167
|
hidden: isCustomCssScreen
|
|
1194
1168
|
})
|
|
1195
1169
|
}, key);
|
|
@@ -1199,13 +1173,13 @@ var Customize = function Customize(_ref) {
|
|
|
1199
1173
|
})]
|
|
1200
1174
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1201
1175
|
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 lg:px-5 xl:px-6",
|
|
1202
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1176
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1203
1177
|
"data-cy": "reset-button",
|
|
1204
1178
|
disabled: !dirty || isSubmitting,
|
|
1205
1179
|
label: t("neetoThemes.buttons.reset"),
|
|
1206
1180
|
style: "text",
|
|
1207
1181
|
type: "reset"
|
|
1208
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1182
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1209
1183
|
"data-cy": "save-changes-button",
|
|
1210
1184
|
disabled: !dirty && (theme === null || theme === void 0 ? void 0 : theme.id) || isSubmitting,
|
|
1211
1185
|
label: t("neetoThemes.buttons.save"),
|
|
@@ -1213,7 +1187,7 @@ var Customize = function Customize(_ref) {
|
|
|
1213
1187
|
ref: submitBtnRef,
|
|
1214
1188
|
type: "submit"
|
|
1215
1189
|
})]
|
|
1216
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1190
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Popover, {
|
|
1217
1191
|
appendTo: function appendTo() {
|
|
1218
1192
|
return document.body;
|
|
1219
1193
|
},
|
|
@@ -1223,16 +1197,16 @@ var Customize = function Customize(_ref) {
|
|
|
1223
1197
|
trigger: "click",
|
|
1224
1198
|
content: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1225
1199
|
className: "flex flex-col items-start gap-2",
|
|
1226
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1200
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1227
1201
|
className: "absolute right-1 top-1 z-0",
|
|
1228
|
-
icon:
|
|
1202
|
+
icon: Close,
|
|
1229
1203
|
size: "small",
|
|
1230
1204
|
style: "text",
|
|
1231
1205
|
onClick: function onClick() {
|
|
1232
1206
|
var _popoverInstance$hide;
|
|
1233
|
-
return popoverInstance === null || popoverInstance === void 0
|
|
1207
|
+
return popoverInstance === null || popoverInstance === void 0 ? void 0 : (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
1234
1208
|
}
|
|
1235
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1209
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1236
1210
|
className: "w-72 pr-5",
|
|
1237
1211
|
style: "body2",
|
|
1238
1212
|
weight: "normal",
|
|
@@ -1245,7 +1219,7 @@ var Customize = function Customize(_ref) {
|
|
|
1245
1219
|
entityType: entityType
|
|
1246
1220
|
}
|
|
1247
1221
|
})
|
|
1248
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1222
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1249
1223
|
disabled: isApplyingTheme,
|
|
1250
1224
|
label: t("neetoThemes.buttons.applyThisTheme"),
|
|
1251
1225
|
loading: isApplyingTheme,
|
|
@@ -1262,7 +1236,7 @@ var Customize = function Customize(_ref) {
|
|
|
1262
1236
|
};
|
|
1263
1237
|
|
|
1264
1238
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1265
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
1239
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1266
1240
|
var Check = function Check(props) {
|
|
1267
1241
|
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread(_objectSpread({
|
|
1268
1242
|
fill: "none",
|
|
@@ -1344,7 +1318,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1344
1318
|
}, shallow.shallow),
|
|
1345
1319
|
_useConfigStore$theme = _useConfigStore.themePropertiesSchema,
|
|
1346
1320
|
themePropertiesSchema = _useConfigStore$theme === void 0 ? [] : _useConfigStore$theme;
|
|
1347
|
-
var _themePropertiesSchem =
|
|
1321
|
+
var _themePropertiesSchem = _slicedToArray(themePropertiesSchema, 2),
|
|
1348
1322
|
colorObject1 = _themePropertiesSchem[0],
|
|
1349
1323
|
colorObject2 = _themePropertiesSchem[1];
|
|
1350
1324
|
var primaryLabel = neetoCist.humanize(colorObject1 === null || colorObject1 === void 0 ? void 0 : colorObject1.key);
|
|
@@ -1364,7 +1338,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1364
1338
|
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.key
|
|
1365
1339
|
}, theme.properties)) === null || _findBy === void 0 ? void 0 : _findBy.value;
|
|
1366
1340
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1367
|
-
className:
|
|
1341
|
+
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg border transition-all duration-300 ease-in-out", {
|
|
1368
1342
|
"neeto-ui-border-gray-400": !active,
|
|
1369
1343
|
"neeto-ui-border-gray-800 neeto-themes-theme-thumbnail--active": active,
|
|
1370
1344
|
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
@@ -1380,7 +1354,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1380
1354
|
className: "neeto-ui-rounded-lg p-3",
|
|
1381
1355
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1382
1356
|
className: "mb-3",
|
|
1383
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1357
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1384
1358
|
style: "h3",
|
|
1385
1359
|
weight: "semibold",
|
|
1386
1360
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -1389,7 +1363,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1389
1363
|
},
|
|
1390
1364
|
children: primaryLabel
|
|
1391
1365
|
})
|
|
1392
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1366
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1393
1367
|
className: "neeto-ui-text-gray-600",
|
|
1394
1368
|
style: "body2",
|
|
1395
1369
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -1442,7 +1416,7 @@ var Card = function Card(_ref) {
|
|
|
1442
1416
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
1443
1417
|
id: theme.id,
|
|
1444
1418
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1445
|
-
className:
|
|
1419
|
+
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg cursor-pointer border transition-all duration-300 ease-in-out", {
|
|
1446
1420
|
"neeto-ui-border-gray-200": !active,
|
|
1447
1421
|
"neeto-themes-theme-thumbnail--active": active,
|
|
1448
1422
|
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
@@ -1459,11 +1433,11 @@ var Card = function Card(_ref) {
|
|
|
1459
1433
|
className: "flex-shrink-0",
|
|
1460
1434
|
"data-cy": "active-theme-label"
|
|
1461
1435
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1462
|
-
className:
|
|
1436
|
+
className: classnames({
|
|
1463
1437
|
hidden: !isPreviewing,
|
|
1464
1438
|
"group-hover:block": true
|
|
1465
1439
|
}),
|
|
1466
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1440
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1467
1441
|
className: "neeto-themes-theme-thumbnail__apply-btn flex-shrink-0",
|
|
1468
1442
|
"data-cy": "apply-theme-button",
|
|
1469
1443
|
disabled: isApplyingTheme,
|
|
@@ -1489,13 +1463,13 @@ var Card = function Card(_ref) {
|
|
|
1489
1463
|
})]
|
|
1490
1464
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1491
1465
|
className: "neeto-ui-border-gray-100 flex items-start justify-between gap-1 border-t p-2",
|
|
1492
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1466
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1493
1467
|
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
1494
1468
|
"data-cy": "theme-name",
|
|
1495
1469
|
lineHeight: "snug",
|
|
1496
1470
|
style: "body2",
|
|
1497
1471
|
children: name
|
|
1498
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1472
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
1499
1473
|
dropdownButtonProps: {
|
|
1500
1474
|
size: "small"
|
|
1501
1475
|
},
|
|
@@ -1566,7 +1540,7 @@ var Themes = function Themes(_ref) {
|
|
|
1566
1540
|
setThemeState = _useThemeStore.setThemeState,
|
|
1567
1541
|
previewingTheme = _useThemeStore.previewingTheme;
|
|
1568
1542
|
var _useState = react.useState(""),
|
|
1569
|
-
_useState2 =
|
|
1543
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1570
1544
|
searchQuery = _useState2[0],
|
|
1571
1545
|
setSearchQuery = _useState2[1];
|
|
1572
1546
|
var _useCloneTheme = useCloneTheme(),
|
|
@@ -1602,25 +1576,25 @@ var Themes = function Themes(_ref) {
|
|
|
1602
1576
|
if (isLoading || isCurrentThemeLoading) {
|
|
1603
1577
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1604
1578
|
className: "flex h-full w-full items-center justify-center",
|
|
1605
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1579
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
1606
1580
|
});
|
|
1607
1581
|
}
|
|
1608
1582
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1609
1583
|
className: "neeto-themes-sidebar__scroll",
|
|
1610
1584
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1611
1585
|
className: "mb-6 space-y-3",
|
|
1612
|
-
children: [isSearchFieldVisible && /*#__PURE__*/jsxRuntime.jsx(
|
|
1586
|
+
children: [isSearchFieldVisible && /*#__PURE__*/jsxRuntime.jsx(Search, {
|
|
1613
1587
|
autoFocus: true,
|
|
1614
1588
|
autoComplete: "off",
|
|
1615
1589
|
className: "mb-4 mt-1 px-6",
|
|
1616
1590
|
placeholder: t("neetoThemes.common.searchThemes"),
|
|
1617
1591
|
onSearch: setSearchQuery
|
|
1618
|
-
}), ramda.isEmpty(filteredThemes) && ramda.isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsx(
|
|
1592
|
+
}), ramda.isEmpty(filteredThemes) && ramda.isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1619
1593
|
className: "text-center",
|
|
1620
1594
|
style: "body2",
|
|
1621
1595
|
children: t("neetoThemes.common.noResultsFound")
|
|
1622
1596
|
}), neetoCist.isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1623
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1597
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1624
1598
|
className: "my-4 px-6 uppercase lg:px-5 xl:px-6",
|
|
1625
1599
|
"data-cy": "system-themes-header",
|
|
1626
1600
|
style: "h6",
|
|
@@ -1646,7 +1620,7 @@ var Themes = function Themes(_ref) {
|
|
|
1646
1620
|
})]
|
|
1647
1621
|
}), neetoCist.isNotEmpty(filteredThemes) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1648
1622
|
className: "mb-6 space-y-3",
|
|
1649
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1623
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1650
1624
|
className: "my-4 px-6 uppercase",
|
|
1651
1625
|
"data-cy": "custom-themes-header",
|
|
1652
1626
|
style: "h6",
|
|
@@ -1692,7 +1666,7 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1692
1666
|
className: "neeto-themes-sidebar__header px-6 lg:px-5 xl:px-6",
|
|
1693
1667
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1694
1668
|
className: "flex items-center justify-between space-x-2",
|
|
1695
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1669
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1696
1670
|
"data-cy": "themes-header",
|
|
1697
1671
|
lineHeight: "normal",
|
|
1698
1672
|
style: "h3",
|
|
@@ -1700,9 +1674,9 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1700
1674
|
children: t("neetoThemes.build.leftSideBar.headerTabs.themes")
|
|
1701
1675
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1702
1676
|
className: "self-end",
|
|
1703
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1677
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1704
1678
|
"data-cy": "customize-themes-add-theme-button",
|
|
1705
|
-
icon:
|
|
1679
|
+
icon: Plus,
|
|
1706
1680
|
iconPosition: "left",
|
|
1707
1681
|
style: "text",
|
|
1708
1682
|
tooltipProps: {
|
|
@@ -1719,9 +1693,9 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1719
1693
|
className: "neeto-themes-sidebar__header px-4",
|
|
1720
1694
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1721
1695
|
className: "flex items-center justify-start space-x-2",
|
|
1722
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1696
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1723
1697
|
"data-cy": "customize-themes-back-button",
|
|
1724
|
-
icon:
|
|
1698
|
+
icon: LeftArrow,
|
|
1725
1699
|
iconPosition: "left",
|
|
1726
1700
|
style: "text",
|
|
1727
1701
|
tooltipProps: {
|
|
@@ -1731,7 +1705,7 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1731
1705
|
onClick: function onClick() {
|
|
1732
1706
|
return handleBackPress(themeToEdit);
|
|
1733
1707
|
}
|
|
1734
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
1708
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
|
|
1735
1709
|
"data-cy": "themes-header",
|
|
1736
1710
|
lineHeight: "normal",
|
|
1737
1711
|
style: "h3",
|
|
@@ -1742,7 +1716,7 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1742
1716
|
});
|
|
1743
1717
|
};
|
|
1744
1718
|
|
|
1745
|
-
var MemoizedAlert = /*#__PURE__*/react.memo(
|
|
1719
|
+
var MemoizedAlert = /*#__PURE__*/react.memo(Alert);
|
|
1746
1720
|
var Sidebar = function Sidebar(_ref) {
|
|
1747
1721
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3, _themeToDelete$curren4;
|
|
1748
1722
|
var thumbnail = _ref.thumbnail,
|
|
@@ -1750,26 +1724,26 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1750
1724
|
onApplyThemeSuccess = _ref.onApplyThemeSuccess,
|
|
1751
1725
|
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
|
|
1752
1726
|
var _useState = react.useState(DESIGN_SCREENS.THEMES),
|
|
1753
|
-
_useState2 =
|
|
1727
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1754
1728
|
currentScreen = _useState2[0],
|
|
1755
1729
|
setCurrentScreen = _useState2[1];
|
|
1756
1730
|
var _useState3 = react.useState(false),
|
|
1757
|
-
_useState4 =
|
|
1731
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1758
1732
|
isDeleteAlertOpen = _useState4[0],
|
|
1759
1733
|
setIsDeleteAlertOpen = _useState4[1];
|
|
1760
1734
|
var _useState5 = react.useState(null),
|
|
1761
|
-
_useState6 =
|
|
1735
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1762
1736
|
themeToHighlight = _useState6[0],
|
|
1763
1737
|
setThemeToHighlight = _useState6[1];
|
|
1764
1738
|
var _useState7 = react.useState({}),
|
|
1765
|
-
_useState8 =
|
|
1739
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1766
1740
|
themeBeingApplied = _useState8[0],
|
|
1767
1741
|
setThemeBeingApplied = _useState8[1];
|
|
1768
1742
|
var _useBreakpoints = reactUtils.useBreakpoints(),
|
|
1769
1743
|
isSize = _useBreakpoints.isSize;
|
|
1770
1744
|
var isLargerScreen = !isSize("mobile");
|
|
1771
1745
|
var _useState9 = react.useState(!isLargerScreen),
|
|
1772
|
-
_useState10 =
|
|
1746
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
1773
1747
|
isThemesSidebarCollapsed = _useState10[0],
|
|
1774
1748
|
setIsThemesSidebarCollapsed = _useState10[1];
|
|
1775
1749
|
react.useEffect(function () {
|
|
@@ -1825,7 +1799,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1825
1799
|
});
|
|
1826
1800
|
setThemeBeingApplied({});
|
|
1827
1801
|
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1828
|
-
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0
|
|
1802
|
+
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 ? void 0 : onApplyThemeSuccess(theme);
|
|
1829
1803
|
}
|
|
1830
1804
|
}),
|
|
1831
1805
|
applyTheme = _useApplyTheme.mutate,
|
|
@@ -1899,7 +1873,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1899
1873
|
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
1900
1874
|
}
|
|
1901
1875
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1902
|
-
className:
|
|
1876
|
+
className: classnames("neeto-themes-sidebar neeto-ui-border-gray-200 flex-shrink-0 border-r transition-all duration-300", {
|
|
1903
1877
|
"neeto-themes-sidebar--expanded": isCustomCssScreen
|
|
1904
1878
|
}, {
|
|
1905
1879
|
"neeto-themes-sidebar--collapsed": isThemesSidebarCollapsed
|
|
@@ -1951,9 +1925,9 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1951
1925
|
}),
|
|
1952
1926
|
onClose: handleCloseDeleteAlert,
|
|
1953
1927
|
onSubmit: handleDeleteTheme
|
|
1954
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1928
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1955
1929
|
className: "neeto-themes-sidebar__toggler",
|
|
1956
|
-
icon:
|
|
1930
|
+
icon: Collapse,
|
|
1957
1931
|
style: "secondary",
|
|
1958
1932
|
onClick: function onClick() {
|
|
1959
1933
|
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
@@ -2029,7 +2003,7 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
2029
2003
|
className: "neeto-themes-preview__wrapper",
|
|
2030
2004
|
children: isCurrentThemeLoading ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2031
2005
|
className: "m-auto flex h-full w-full items-center justify-center",
|
|
2032
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
2006
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
2033
2007
|
}) : children
|
|
2034
2008
|
})]
|
|
2035
2009
|
});
|