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