@bigbinary/neeto-themes-frontend 2.2.0 → 3.0.1
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/README.md +74 -36
- package/app/javascript/src/translations/en.json +12 -3
- package/dist/NeetoThemesBuilder.js +843 -469
- package/dist/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/NeetoThemesBuilder.js +896 -551
- 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 +16 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils.js +2 -3
- package/dist/cjs/utils.js.map +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{index-9e15a8b1.js → index-CvV1tFYS.js} +30 -7
- package/dist/index-CvV1tFYS.js.map +1 -0
- package/dist/{index-2666fca8.js → index-D6l2IgrM.js} +32 -14
- package/dist/index-D6l2IgrM.js.map +1 -0
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/{useThemeUtils-36f2ce5a.js → useThemeUtils-BCO-i9ZG.js} +5 -3
- package/dist/useThemeUtils-BCO-i9ZG.js.map +1 -0
- package/dist/{useThemeUtils-38895e4a.js → useThemeUtils-P5tn1h2B.js} +6 -8
- package/dist/useThemeUtils-P5tn1h2B.js.map +1 -0
- package/dist/utils.js +1 -1
- package/package.json +102 -97
- package/dist/index-2666fca8.js.map +0 -1
- package/dist/index-9e15a8b1.js.map +0 -1
- package/dist/useThemeUtils-36f2ce5a.js.map +0 -1
- package/dist/useThemeUtils-38895e4a.js.map +0 -1
|
@@ -8,46 +8,48 @@ 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-P5tn1h2B.js');
|
|
13
13
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
14
|
+
var classnames = require('classnames');
|
|
15
|
+
var Collapse = require('@bigbinary/neeto-icons/Collapse');
|
|
14
16
|
var Alert = require('@bigbinary/neetoui/Alert');
|
|
17
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
15
18
|
var reactI18next = require('react-i18next');
|
|
16
19
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
17
20
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
18
21
|
var Close = require('@bigbinary/neeto-icons/Close');
|
|
19
|
-
var Button = require('@bigbinary/neetoui/Button');
|
|
20
22
|
var Popover = require('@bigbinary/neetoui/Popover');
|
|
21
23
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
24
|
+
var Switch = require('@bigbinary/neetoui/Switch');
|
|
25
|
+
var Tooltip = require('@bigbinary/neetoui/Tooltip');
|
|
22
26
|
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
23
27
|
var yup = require('yup');
|
|
28
|
+
var Editor = require('@monaco-editor/react');
|
|
24
29
|
var formik = require('formik');
|
|
30
|
+
var Down = require('@bigbinary/neeto-icons/Down');
|
|
25
31
|
var jsxRuntime = require('react/jsx-runtime');
|
|
26
|
-
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
27
|
-
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
28
|
-
var neetoImageUploaderFrontend = require('@bigbinary/neeto-image-uploader-frontend');
|
|
29
|
-
var utils$1 = require('@bigbinary/neeto-commons-frontend/utils');
|
|
30
|
-
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
31
32
|
var ramda = require('ramda');
|
|
32
|
-
var
|
|
33
|
+
var utils$1 = require('@bigbinary/neeto-commons-frontend/utils');
|
|
33
34
|
var CenterAlign = require('@bigbinary/neeto-icons/CenterAlign');
|
|
34
35
|
var LeftAlign = require('@bigbinary/neeto-icons/LeftAlign');
|
|
35
36
|
var ColorPicker = require('@bigbinary/neetoui/ColorPicker');
|
|
37
|
+
var Select = require('@bigbinary/neetoui/Select');
|
|
36
38
|
var antd = require('antd');
|
|
37
|
-
var classnames = require('classnames');
|
|
38
39
|
var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
|
|
39
|
-
var
|
|
40
|
+
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
41
|
+
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
42
|
+
var ImageUploader = require('@bigbinary/neeto-image-uploader-frontend/ImageUploader');
|
|
43
|
+
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
40
44
|
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
41
45
|
var Search = require('@bigbinary/neeto-molecules/Search');
|
|
46
|
+
var Rating = require('@bigbinary/neeto-icons/Rating');
|
|
42
47
|
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
43
48
|
var LeftArrow = require('@bigbinary/neeto-icons/LeftArrow');
|
|
44
49
|
var Plus = require('@bigbinary/neeto-icons/Plus');
|
|
45
50
|
require('zustand');
|
|
46
51
|
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
function _interopNamespace(e) {
|
|
50
|
-
if (e && e.__esModule) return e;
|
|
52
|
+
function _interopNamespaceDefault(e) {
|
|
51
53
|
var n = Object.create(null);
|
|
52
54
|
if (e) {
|
|
53
55
|
Object.keys(e).forEach(function (k) {
|
|
@@ -60,43 +62,17 @@ function _interopNamespace(e) {
|
|
|
60
62
|
}
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
|
-
n
|
|
65
|
+
n.default = e;
|
|
64
66
|
return Object.freeze(n);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
var
|
|
68
|
-
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
69
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
70
|
-
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
71
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
72
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
73
|
-
var Close__default = /*#__PURE__*/_interopDefaultLegacy(Close);
|
|
74
|
-
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
75
|
-
var Popover__default = /*#__PURE__*/_interopDefaultLegacy(Popover);
|
|
76
|
-
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
77
|
-
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
78
|
-
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
79
|
-
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
80
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
81
|
-
var Toastr__default = /*#__PURE__*/_interopDefaultLegacy(Toastr);
|
|
82
|
-
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
83
|
-
var CenterAlign__default = /*#__PURE__*/_interopDefaultLegacy(CenterAlign);
|
|
84
|
-
var LeftAlign__default = /*#__PURE__*/_interopDefaultLegacy(LeftAlign);
|
|
85
|
-
var ColorPicker__default = /*#__PURE__*/_interopDefaultLegacy(ColorPicker);
|
|
86
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
87
|
-
var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
|
|
88
|
-
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
89
|
-
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
90
|
-
var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
|
|
91
|
-
var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
92
|
-
var LeftArrow__default = /*#__PURE__*/_interopDefaultLegacy(LeftArrow);
|
|
93
|
-
var Plus__default = /*#__PURE__*/_interopDefaultLegacy(Plus);
|
|
69
|
+
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
94
70
|
|
|
95
|
-
var show$
|
|
96
|
-
return
|
|
71
|
+
var show$2 = function show(entityId) {
|
|
72
|
+
return axios.get("".concat(utils.BASE_URL, "/api/v1/entities/").concat(entityId));
|
|
97
73
|
};
|
|
98
74
|
var entitiesApi = {
|
|
99
|
-
show: show$
|
|
75
|
+
show: show$2
|
|
100
76
|
};
|
|
101
77
|
|
|
102
78
|
var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
@@ -111,53 +87,61 @@ var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
|
111
87
|
|
|
112
88
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
113
89
|
|
|
114
|
-
var css = ".neeto-themes__wrapper{display:flex;width:100%}.neeto-themes__wrapper .neeto-themes-sidebar{background-color:rgb(var(--neeto-ui-white));height:calc(100vh - 64px);width:240px}@media (min-width:1024px){.neeto-themes__wrapper .neeto-themes-sidebar{width:280px}}@media (min-width:1280px){.neeto-themes__wrapper .neeto-themes-sidebar{width:320px}}.neeto-themes__wrapper .neeto-themes-sidebar .neeto-themes-sidebar__header{padding-bottom:8px;padding-top:16px}.neeto-themes__wrapper .neeto-themes-sidebar .neeto-themes-sidebar__scroll{height:calc(100vh - 120px);overflow-y:auto}.neeto-themes__wrapper .neeto-themes-sidebar .neeto-themes-sidebar__scroll .neeto-ui-colorpicker__target .neeto-ui-colorpicker-target__code{display:none}.neeto-themes__wrapper .neeto-themes-preview__wrapper{flex-grow:1;height:calc(100vh - 64px);position:relative}.neeto-themes-theme-thumbnail--preview-active{border-color:rgb(var(--neeto-ui-gray-600))!important;outline:1px solid rgb(var(--neeto-ui-gray-600))!important}.neeto-themes-theme-thumbnail--active{border-color:rgb(var(--neeto-ui-primary-500))!important;outline:2px solid rgb(var(--neeto-ui-primary-500))!important}.neeto-themes-theme-thumbnail--highlight-active{border-color:rgb(var(--neeto-ui-gray-400))!important;outline:2px solid rgb(var(--neeto-ui-gray-400))!important}.neeto-themes-theme-thumbnail__apply-btn{--neeto-ui-btn-padding-x:12px;--neeto-ui-btn-border-radius:100px}.neeto-themes-theme-thumbnail__apply-btn:disabled,.neeto-themes-theme-thumbnail__apply-btn[disabled]{opacity:1!important}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsdUJBRUUsWUFBQSxDQURBLFVBQUYsQ0FHRSw2Q0FHRSwyQ0FBQSxDQURBLHlCQUFBLENBREEsV0FDSixDQUdJLDBCQUxGLDZDQU1JLFdBQUosQ0FDRixDQUNJLDBCQVJGLDZDQVNJLFdBRUosQ0FDRixDQUFJLDJFQUVFLGtCQUFBLENBREEsZ0JBR04sQ0FD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XG4ubmVldG8tdGhlbWVzLXRoZW1lLXRodW1ibmFpbF9fYXBwbHktYnRuIHtcbiAgLS1uZWV0by11aS1idG4tcGFkZGluZy14OiAxMnB4O1xuICAtLW5lZXRvLXVpLWJ0bi1ib3JkZXItcmFkaXVzOiAxMDBweDtcbiAgJjpkaXNhYmxlZCxcbiAgJltkaXNhYmxlZF0ge1xuICAgIG9wYWNpdHk6IDEgIWltcG9ydGFudDtcbiAgfVxufVxuIl19 */";
|
|
90
|
+
var css = ".neeto-themes__wrapper{display:flex;width:100%}.neeto-themes__wrapper .neeto-themes-sidebar{background-color:rgb(var(--neeto-ui-white));height:100%;left:0;padding-top:24px;position:fixed;top:0;transition:none;width:100%;z-index:102}.neeto-themes__wrapper .neeto-themes-sidebar--expanded{max-width:100%;width:520px!important}@media screen and (min-width:576px){.neeto-themes__wrapper .neeto-themes-sidebar{width:280px}}@media screen and (min-width:767px){.neeto-themes__wrapper .neeto-themes-sidebar{height:calc(100vh - 64px);padding-top:0;position:relative}}@media screen and (min-width:1024px){.neeto-themes__wrapper .neeto-themes-sidebar{width:320px}}@media screen and (min-width:1280px){.neeto-themes__wrapper .neeto-themes-sidebar{width:340px}}.neeto-themes__wrapper .neeto-themes-sidebar--collapsed{max-width:0;min-width:0;width:0}.neeto-themes__wrapper .neeto-themes-sidebar--collapsed .neeto-themes-sidebar__toggler{transform:scale(-1)}@media screen and (max-width:767px){.neeto-themes__wrapper .neeto-themes-sidebar--collapsed .neeto-themes-sidebar__toggler{top:109px}}@media screen and (max-width:576px){.neeto-themes__wrapper .neeto-themes-sidebar--collapsed .neeto-themes-sidebar__toggler{left:8px;right:auto}}.neeto-themes__wrapper .neeto-themes-sidebar--collapsed .neeto-themes-sidebar__header{display:none}.neeto-themes__wrapper .neeto-themes-sidebar .neeto-themes-sidebar__header{padding-bottom:8px;padding-top:16px}.neeto-themes__wrapper .neeto-themes-sidebar .neeto-themes-sidebar__scroll{display:flex;flex-direction:column;height:calc(100vh - 120px);overflow-y:auto}.neeto-themes__wrapper .neeto-themes-sidebar .neeto-themes-sidebar__scroll .neeto-ui-colorpicker__target .neeto-ui-colorpicker-target__code{display:none}.neeto-themes__wrapper .css-editor-height__expanded{height:calc(100vh - 300px)}.neeto-themes__wrapper .css-editor-height__regular{height:384px}.neeto-themes__wrapper .neeto-themes-preview__wrapper{flex-grow:1;height:calc(100vh - 64px);position:relative}.neeto-themes-theme-thumbnail--preview-active{border-color:rgb(var(--neeto-ui-gray-600))!important;outline:1px solid rgb(var(--neeto-ui-gray-600))!important}.neeto-themes-theme-thumbnail--active{border-color:rgb(var(--neeto-ui-primary-500))!important;outline:2px solid rgb(var(--neeto-ui-primary-500))!important}.neeto-themes-theme-thumbnail--highlight-active{border-color:rgb(var(--neeto-ui-gray-400))!important;outline:2px solid rgb(var(--neeto-ui-gray-400))!important}.neeto-themes-theme-thumbnail__apply-btn{--neeto-ui-btn-padding-x:12px;--neeto-ui-btn-border-radius:100px}.neeto-themes-theme-thumbnail__apply-btn:disabled,.neeto-themes-theme-thumbnail__apply-btn[disabled]{opacity:1!important}.neeto-themes-sidebar__custom-css-editor-header{background-color:#1e1e1e;border-top-left-radius:var(--neeto-ui-rounded-lg);border-top-right-radius:var(--neeto-ui-rounded-lg);display:flex}@media screen and (max-width:576px){.neeto-themes-sidebar__custom-css-editor-header{display:none}}.neeto-themes-sidebar .monaco-editor,.neeto-themes-sidebar .overflow-guard{border-bottom-left-radius:var(--neeto-ui-rounded-lg);border-bottom-right-radius:var(--neeto-ui-rounded-lg)}.neeto-themes-sidebar__custom-css-wrapper .neeto-themes-nano-section{border-bottom:0!important}.neeto-themes-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);display:none;height:100%;left:0;position:fixed;top:0;visibility:hidden;width:100%;z-index:101}@media screen and (max-width:767px){.neeto-themes-sidebar__backdrop{display:block;visibility:visible}}.neeto-themes-sidebar__toggler{flex-shrink:0;left:calc(100% + 8px);position:absolute;top:8px;transition:color .3s ease-in-out}@media screen and (min-width:1024px){.neeto-themes-sidebar__toggler{opacity:0;pointer-events:none}}@media screen and (max-width:576px){.neeto-themes-sidebar__toggler{left:auto;right:24px}}.neeto-themes-nano-alignment-block{border-radius:6px}.neeto-themes-nano-alignment-button{--neeto-ui-btn-padding-x:12px!important}.neeto-themes-nano-alignment-button__alignment-left{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.neeto-themes-nano-alignment-button__alignment-center{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.neeto-themes-nano-alignment-button.neeto-ui-btn--style-primary{--neeto-ui-btn-bg-color:rgb(var(--neeto-ui-primary-100))!important;--neeto-ui-btn-hover-bg-color:rgb(var(--neeto-ui-primary-100))!important}.neeto-themes-nano-alignment-divider{background:rgb(var(--neeto-ui-gray-200));height:32px;width:1px}.neeto-themes-nano-section__content--open{max-height:1500px;opacity:1;padding-top:4px;visibility:visible}.neeto-themes-nano-section__content--closed{max-height:0;opacity:0;visibility:hidden}.neeto-themes-nano-section__title:focus-visible{box-shadow:0 0 0 3px rgba(var(--neeto-ui-primary-500),15%)}.neeto-themes-nano-global-theme-icon{fill:rgb(var(--neeto-ui-warning-100));color:rgb(var(--neeto-ui-warning-500))}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsdUJBRUUsWUFBQSxDQURBLFVBQUYsQ0FHRSw2Q0FHRSwyQ0FBQSxDQURBLFdBQUEsQ0FJQSxNQUFBLENBR0EsZ0JBQUEsQ0FMQSxjQUFBLENBQ0EsS0FBQSxDQUVBLGVBQUEsQ0FOQSxVQUFBLENBT0EsV0FBSixDQUdJLHVEQUVFLGNBQUEsQ0FEQSxxQkFBTixDQUlJLG9DQWhCRiw2Q0FpQkksV0FESixDQUNGLENBR0ksb0NBcEJGLDZDQX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diKHZhcigtLW5lZXRvLXVpLXByaW1hcnktMTAwKSkgIWltcG9ydGFudDtcbiAgfVxufVxuXG4ubmVldG8tdGhlbWVzLW5hbm8tYWxpZ25tZW50LWRpdmlkZXIge1xuICB3aWR0aDogMXB4O1xuICBoZWlnaHQ6IDMycHg7XG4gIGJhY2tncm91bmQ6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTIwMCkpO1xufVxuXG4ubmVldG8tdGhlbWVzLW5hbm8tc2VjdGlvbl9fY29udGVudCB7XG4gICYtLW9wZW4ge1xuICAgIG1heC1oZWlnaHQ6IDE1MDBweDtcbiAgICBvcGFjaXR5OiAxO1xuICAgIHZpc2liaWxpdHk6IHZpc2libGU7XG4gICAgcGFkZGluZy10b3A6IDRweDtcbiAgfVxuICAmLS1jbG9zZWQge1xuICAgIG1heC1oZWlnaHQ6IDBweDtcbiAgICBvcGFjaXR5OiAwO1xuICAgIHZpc2liaWxpdHk6IGhpZGRlbjtcbiAgfVxufVxuXG4ubmVldG8tdGhlbWVzLW5hbm8tc2VjdGlvbl9fdGl0bGU6Zm9jdXMtdmlzaWJsZSB7XG4gIGJveC1zaGFkb3c6IDAgMCAwIDNweCByZ2JhKHZhcigtLW5lZXRvLXVpLXByaW1hcnktNTAwKSwgMTUlKTtcbn1cblxuLm5lZXRvLXRoZW1lcy1uYW5vLWdsb2JhbC10aGVtZS1pY29uIHtcbiAgY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS13YXJuaW5nLTUwMCkpO1xuICBmaWxsOiByZ2IodmFyKC0tbmVldG8tdWktd2FybmluZy0xMDApKTtcbn1cbiJdfQ== */";
|
|
115
91
|
n(css,{});
|
|
116
92
|
|
|
117
93
|
var _excluded$1 = ["themeId"];
|
|
118
94
|
var list = function list(entityId) {
|
|
119
|
-
return
|
|
95
|
+
return axios.get("".concat(utils.BASE_URL, "/api/v1/themes"), {
|
|
120
96
|
params: {
|
|
121
97
|
entity_id: entityId
|
|
122
98
|
}
|
|
123
99
|
});
|
|
124
100
|
};
|
|
125
|
-
var show = function show(id) {
|
|
126
|
-
return
|
|
101
|
+
var show$1 = function show(id) {
|
|
102
|
+
return axios.get("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id));
|
|
127
103
|
};
|
|
128
104
|
var create = function create(payload) {
|
|
129
|
-
return
|
|
105
|
+
return axios.post("".concat(utils.BASE_URL, "/api/v1/themes"), {
|
|
130
106
|
theme: payload
|
|
131
107
|
});
|
|
132
108
|
};
|
|
133
109
|
var update = function update(_ref) {
|
|
134
110
|
var id = _ref.id,
|
|
135
111
|
payload = _ref.payload;
|
|
136
|
-
return
|
|
112
|
+
return axios.put("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id), {
|
|
137
113
|
theme: payload
|
|
138
114
|
});
|
|
139
115
|
};
|
|
140
116
|
var destroy = function destroy(id) {
|
|
141
|
-
return
|
|
117
|
+
return axios["delete"]("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id));
|
|
142
118
|
};
|
|
143
119
|
var clone = function clone(id) {
|
|
144
|
-
return
|
|
120
|
+
return axios.post("".concat(utils.BASE_URL, "/api/v1/themes/").concat(id, "/clone"));
|
|
145
121
|
};
|
|
146
122
|
var apply = function apply(_ref2) {
|
|
147
123
|
var themeId = _ref2.themeId,
|
|
148
|
-
payload =
|
|
149
|
-
return
|
|
124
|
+
payload = _objectWithoutProperties(_ref2, _excluded$1);
|
|
125
|
+
return axios.post("".concat(utils.BASE_URL, "/api/v1/themes/").concat(themeId, "/apply"), {
|
|
150
126
|
entity: payload
|
|
151
127
|
});
|
|
152
128
|
};
|
|
129
|
+
var applyGlobalTheme = function applyGlobalTheme(_ref3) {
|
|
130
|
+
var themeId = _ref3.themeId,
|
|
131
|
+
payload = _ref3.payload;
|
|
132
|
+
return axios.post("".concat(utils.BASE_URL, "/api/v1/themes/").concat(themeId, "/apply_global_theme"), {
|
|
133
|
+
theme: payload
|
|
134
|
+
});
|
|
135
|
+
};
|
|
153
136
|
var themesApi = {
|
|
154
137
|
list: list,
|
|
155
|
-
show: show,
|
|
138
|
+
show: show$1,
|
|
156
139
|
create: create,
|
|
157
140
|
update: update,
|
|
158
141
|
destroy: destroy,
|
|
159
142
|
clone: clone,
|
|
160
|
-
apply: apply
|
|
143
|
+
apply: apply,
|
|
144
|
+
applyGlobalTheme: applyGlobalTheme
|
|
161
145
|
};
|
|
162
146
|
|
|
163
147
|
var useListThemes = function useListThemes(entityId) {
|
|
@@ -177,7 +161,7 @@ var useListThemes = function useListThemes(entityId) {
|
|
|
177
161
|
};
|
|
178
162
|
var useCreateTheme = function useCreateTheme() {
|
|
179
163
|
return reactUtils.useMutationWithInvalidation(themesApi.create, {
|
|
180
|
-
keysToInvalidate: [useThemeUtils.QUERY_KEYS.THEMES_LIST]
|
|
164
|
+
keysToInvalidate: [[useThemeUtils.QUERY_KEYS.THEMES_LIST], [useThemeUtils.QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
181
165
|
});
|
|
182
166
|
};
|
|
183
167
|
var useUpdateTheme = function useUpdateTheme(themeId) {
|
|
@@ -187,7 +171,7 @@ var useUpdateTheme = function useUpdateTheme(themeId) {
|
|
|
187
171
|
payload: payload
|
|
188
172
|
});
|
|
189
173
|
}, {
|
|
190
|
-
keysToInvalidate: [[useThemeUtils.QUERY_KEYS.THEMES_LIST], [useThemeUtils.QUERY_KEYS.THEME_ENTITY_DETAILS], [useThemeUtils.QUERY_KEYS.THEME_DETAILS, themeId]]
|
|
174
|
+
keysToInvalidate: [[useThemeUtils.QUERY_KEYS.THEMES_LIST], [useThemeUtils.QUERY_KEYS.THEME_ENTITY_DETAILS], [useThemeUtils.QUERY_KEYS.THEME_DETAILS, themeId], [useThemeUtils.QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
191
175
|
});
|
|
192
176
|
};
|
|
193
177
|
var useDeleteTheme = function useDeleteTheme() {
|
|
@@ -207,6 +191,32 @@ var useApplyTheme = function useApplyTheme(_ref) {
|
|
|
207
191
|
onSuccess: onSuccess
|
|
208
192
|
});
|
|
209
193
|
};
|
|
194
|
+
var useApplyGlobalTheme = function useApplyGlobalTheme() {
|
|
195
|
+
return reactUtils.useMutationWithInvalidation(themesApi.applyGlobalTheme, {
|
|
196
|
+
keysToInvalidate: [[useThemeUtils.QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
var show = function show(entityType) {
|
|
201
|
+
return axios.get("".concat(utils.BASE_URL, "/api/v1/global_theme"), {
|
|
202
|
+
params: {
|
|
203
|
+
entity_type: entityType
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
var globalThemesApi = {
|
|
208
|
+
show: show
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
var useShowGlobalTheme = function useShowGlobalTheme(entityType) {
|
|
212
|
+
return reactQuery.useQuery({
|
|
213
|
+
queryKey: [useThemeUtils.QUERY_KEYS.GLOBAL_THEME_DETAILS, entityType],
|
|
214
|
+
queryFn: function queryFn() {
|
|
215
|
+
return globalThemesApi.show(entityType);
|
|
216
|
+
},
|
|
217
|
+
enabled: !!entityType
|
|
218
|
+
});
|
|
219
|
+
};
|
|
210
220
|
|
|
211
221
|
var POSITION_OPTIONS = [{
|
|
212
222
|
label: "Left",
|
|
@@ -275,6 +285,12 @@ var FONT_OPTIONS = [{
|
|
|
275
285
|
}, {
|
|
276
286
|
label: "Dancing Script",
|
|
277
287
|
value: "Dancing Script, cursive"
|
|
288
|
+
}, {
|
|
289
|
+
label: "Tw Cent",
|
|
290
|
+
value: "Tw Cen MT, Tahoma, sans-serif"
|
|
291
|
+
}, {
|
|
292
|
+
label: "Comic Sans",
|
|
293
|
+
value: "Comic Sans MS, cursive"
|
|
278
294
|
}];
|
|
279
295
|
var THEME_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
280
296
|
name: yup__namespace.string().required("Name is required")
|
|
@@ -283,7 +299,154 @@ var OVERLAY_OPACITY_SLIDER_MARKS = {
|
|
|
283
299
|
0: " "
|
|
284
300
|
};
|
|
285
301
|
var HUNDRED = 100;
|
|
302
|
+
var ACCORDIAN_OPEN_STATE = {
|
|
303
|
+
name: true,
|
|
304
|
+
style: true,
|
|
305
|
+
images: false,
|
|
306
|
+
customcss: false
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
var DESIGN_SCREENS = {
|
|
310
|
+
THEMES: "Themes",
|
|
311
|
+
Customize: "Customize",
|
|
312
|
+
CustomCSS: "CustomCSS"
|
|
313
|
+
};
|
|
314
|
+
var ONE_MEGABYTE = 1;
|
|
315
|
+
|
|
316
|
+
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; }
|
|
317
|
+
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; }
|
|
318
|
+
var Card$2 = function Card(_ref) {
|
|
319
|
+
var _ref$title = _ref.title,
|
|
320
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
321
|
+
children = _ref.children,
|
|
322
|
+
name = _ref.name,
|
|
323
|
+
className = _ref.className;
|
|
324
|
+
var _useState = react.useState(ACCORDIAN_OPEN_STATE),
|
|
325
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
326
|
+
accordianOpenState = _useState2[0],
|
|
327
|
+
setAccordianOpenState = _useState2[1];
|
|
328
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
329
|
+
"data-cy": "theme-".concat(neetoCist.hyphenate(title), "-properties"),
|
|
330
|
+
className: classnames("neeto-themes-nano-section neeto-ui-border-gray-200 border-b pt-2 transition-all duration-300 last:border-none", className, {
|
|
331
|
+
"pb-2": !accordianOpenState[name],
|
|
332
|
+
"pb-3": accordianOpenState[name]
|
|
333
|
+
}),
|
|
334
|
+
children: [title && /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
335
|
+
className: "neeto-themes-nano-section__title flex w-full cursor-pointer items-center justify-between px-1 py-2 focus:outline-none",
|
|
336
|
+
type: "button",
|
|
337
|
+
onClick: function onClick() {
|
|
338
|
+
return setAccordianOpenState(_objectSpread$5(_objectSpread$5({}, accordianOpenState), {}, _defineProperty({}, name, !accordianOpenState[name])));
|
|
339
|
+
},
|
|
340
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
341
|
+
className: "min-w-0 flex-grow text-left",
|
|
342
|
+
component: "span",
|
|
343
|
+
"data-cy": "theme-properties",
|
|
344
|
+
lineHeight: "normal",
|
|
345
|
+
style: "h4",
|
|
346
|
+
weight: "semibold",
|
|
347
|
+
children: title
|
|
348
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Down, {
|
|
349
|
+
size: 20,
|
|
350
|
+
className: classnames("transition-all duration-300", {
|
|
351
|
+
"rotate-180": accordianOpenState[name]
|
|
352
|
+
})
|
|
353
|
+
})]
|
|
354
|
+
}), children && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
355
|
+
className: classnames("neeto-themes-nano-section__content w-full space-y-3 overflow-hidden px-1 transition-all duration-300", {
|
|
356
|
+
"neeto-themes-nano-section__content--closed": !accordianOpenState[name],
|
|
357
|
+
"neeto-themes-nano-section__content--open pb-1": accordianOpenState[name]
|
|
358
|
+
}),
|
|
359
|
+
children: children
|
|
360
|
+
})]
|
|
361
|
+
});
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
var isScreenCustomCSS = function isScreenCustomCSS(screen) {
|
|
365
|
+
return screen === DESIGN_SCREENS.CustomCSS;
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
var CustomCSS = function CustomCSS(_ref) {
|
|
369
|
+
var onEditCSSClick = _ref.onEditCSSClick,
|
|
370
|
+
currentScreen = _ref.currentScreen;
|
|
371
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
372
|
+
t = _useTranslation.t;
|
|
373
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
374
|
+
values = _useFormikContext.values,
|
|
375
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
376
|
+
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
377
|
+
return {
|
|
378
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
379
|
+
};
|
|
380
|
+
}, shallow.shallow),
|
|
381
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
382
|
+
var customCSS = neetoCist.findBy({
|
|
383
|
+
kind: "custom_css"
|
|
384
|
+
}, values.properties);
|
|
385
|
+
if (!customCSS) return null;
|
|
386
|
+
var parentElementClass = neetoCist.findBy({
|
|
387
|
+
kind: "custom_css"
|
|
388
|
+
}, themePropertiesSchema).parentClass;
|
|
389
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
390
|
+
var handleEditorToggle = function handleEditorToggle() {
|
|
391
|
+
if (!isCustomCssScreen) return onEditCSSClick(DESIGN_SCREENS.CustomCSS);
|
|
392
|
+
onEditCSSClick(DESIGN_SCREENS.Customize);
|
|
393
|
+
return setTimeout(function () {
|
|
394
|
+
utils.scrollElementIntoView("css-editor");
|
|
395
|
+
}, 400);
|
|
396
|
+
};
|
|
397
|
+
var handleChange = function handleChange(value) {
|
|
398
|
+
var index = neetoCist.findIndexBy({
|
|
399
|
+
key: customCSS.key
|
|
400
|
+
}, values.properties);
|
|
401
|
+
if (index !== -1 && values.properties[index].value !== value) {
|
|
402
|
+
setFieldValue("properties[".concat(index, "].value"), value);
|
|
403
|
+
utils.setCustomCSS({
|
|
404
|
+
css: value,
|
|
405
|
+
elementId: customCSS.key,
|
|
406
|
+
parentElementClass: parentElementClass
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
411
|
+
className: "neeto-themes-sidebar__custom-css-wrapper",
|
|
412
|
+
id: "css-editor",
|
|
413
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Card$2, {
|
|
414
|
+
name: "customcss",
|
|
415
|
+
title: isCustomCssScreen ? "" : t("neetoThemes.build.leftSideBar.themes.customCSS"),
|
|
416
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
417
|
+
className: "w-full",
|
|
418
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
419
|
+
className: "neeto-themes-sidebar__custom-css-editor-header w-full justify-end gap-1 rounded-b-none p-2",
|
|
420
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
421
|
+
size: "small",
|
|
422
|
+
style: "secondary",
|
|
423
|
+
label: isCustomCssScreen ? t("neetoThemes.buttons.minimizeEditor") : t("neetoThemes.buttons.expandEditor"),
|
|
424
|
+
onClick: handleEditorToggle
|
|
425
|
+
})
|
|
426
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Editor, {
|
|
427
|
+
language: "css",
|
|
428
|
+
theme: "vs-dark",
|
|
429
|
+
value: customCSS.value,
|
|
430
|
+
className: classnames({
|
|
431
|
+
rounded: true,
|
|
432
|
+
"css-editor-height__expanded": isCustomCssScreen,
|
|
433
|
+
"css-editor-height__regular": !isCustomCssScreen
|
|
434
|
+
}),
|
|
435
|
+
options: {
|
|
436
|
+
scrollBeyondLastLine: false,
|
|
437
|
+
minimap: {
|
|
438
|
+
enabled: false
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
onChange: handleChange
|
|
442
|
+
})]
|
|
443
|
+
})
|
|
444
|
+
})
|
|
445
|
+
});
|
|
446
|
+
};
|
|
286
447
|
|
|
448
|
+
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; }
|
|
449
|
+
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; }
|
|
287
450
|
var buildInitialValues = function buildInitialValues(theme, themePropertiesSchema) {
|
|
288
451
|
if (neetoCist.isPresent(theme)) return theme;
|
|
289
452
|
return {
|
|
@@ -291,56 +454,92 @@ var buildInitialValues = function buildInitialValues(theme, themePropertiesSchem
|
|
|
291
454
|
properties: themePropertiesSchema.map(function (_ref) {
|
|
292
455
|
var key = _ref.key,
|
|
293
456
|
kind = _ref.kind,
|
|
294
|
-
defaultValue = _ref.defaultValue
|
|
457
|
+
defaultValue = _ref.defaultValue,
|
|
458
|
+
_ref$order = _ref.order,
|
|
459
|
+
order = _ref$order === void 0 ? null : _ref$order,
|
|
460
|
+
dependsOn = _ref.dependsOn;
|
|
295
461
|
switch (kind) {
|
|
296
462
|
case "color":
|
|
297
|
-
return {
|
|
463
|
+
return _objectSpread$4({
|
|
298
464
|
value: defaultValue,
|
|
299
465
|
kind: "color",
|
|
300
|
-
key: key
|
|
301
|
-
|
|
466
|
+
key: key,
|
|
467
|
+
dependsOn: dependsOn
|
|
468
|
+
}, order !== null && {
|
|
469
|
+
order: order
|
|
470
|
+
});
|
|
302
471
|
case "font_family":
|
|
303
|
-
return {
|
|
472
|
+
return _objectSpread$4({
|
|
304
473
|
value: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
|
305
474
|
kind: "font_family",
|
|
306
|
-
key: key
|
|
307
|
-
|
|
475
|
+
key: key,
|
|
476
|
+
dependsOn: dependsOn
|
|
477
|
+
}, order !== null && {
|
|
478
|
+
order: order
|
|
479
|
+
});
|
|
308
480
|
case "overlay_opacity":
|
|
309
|
-
return {
|
|
481
|
+
return _objectSpread$4({
|
|
310
482
|
value: 0,
|
|
311
483
|
kind: "overlay_opacity",
|
|
312
|
-
key: key
|
|
313
|
-
|
|
484
|
+
key: key,
|
|
485
|
+
dependsOn: dependsOn
|
|
486
|
+
}, order !== null && {
|
|
487
|
+
order: order
|
|
488
|
+
});
|
|
314
489
|
case "slider":
|
|
315
|
-
return {
|
|
490
|
+
return _objectSpread$4({
|
|
316
491
|
value: 0,
|
|
317
492
|
kind: "slider",
|
|
318
|
-
key: key
|
|
319
|
-
|
|
493
|
+
key: key,
|
|
494
|
+
dependsOn: dependsOn
|
|
495
|
+
}, order !== null && {
|
|
496
|
+
order: order
|
|
497
|
+
});
|
|
320
498
|
case "radius":
|
|
321
|
-
return {
|
|
499
|
+
return _objectSpread$4({
|
|
322
500
|
value: defaultValue,
|
|
323
501
|
kind: "radius",
|
|
324
|
-
key: key
|
|
325
|
-
|
|
502
|
+
key: key,
|
|
503
|
+
dependsOn: dependsOn
|
|
504
|
+
}, order !== null && {
|
|
505
|
+
order: order
|
|
506
|
+
});
|
|
326
507
|
case "boolean":
|
|
327
|
-
return {
|
|
508
|
+
return _objectSpread$4({
|
|
328
509
|
value: String(defaultValue),
|
|
329
510
|
kind: "boolean",
|
|
330
|
-
key: key
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
511
|
+
key: key,
|
|
512
|
+
dependsOn: dependsOn
|
|
513
|
+
}, order !== null && {
|
|
514
|
+
order: order
|
|
515
|
+
});
|
|
516
|
+
case "order_selector":
|
|
517
|
+
return _objectSpread$4({
|
|
334
518
|
value: defaultValue,
|
|
335
|
-
kind: "
|
|
336
|
-
key: key
|
|
337
|
-
|
|
519
|
+
kind: "order_selector",
|
|
520
|
+
key: key,
|
|
521
|
+
dependsOn: dependsOn
|
|
522
|
+
}, order !== null && {
|
|
523
|
+
order: order
|
|
524
|
+
});
|
|
338
525
|
case "alignment_block":
|
|
339
|
-
return {
|
|
526
|
+
return _objectSpread$4({
|
|
340
527
|
value: defaultValue,
|
|
341
528
|
kind: "alignment_block",
|
|
342
|
-
key: key
|
|
343
|
-
|
|
529
|
+
key: key,
|
|
530
|
+
dependsOn: dependsOn
|
|
531
|
+
}, order !== null && {
|
|
532
|
+
order: order
|
|
533
|
+
});
|
|
534
|
+
case "custom_css":
|
|
535
|
+
return _objectSpread$4({
|
|
536
|
+
value: defaultValue,
|
|
537
|
+
kind: "custom_css",
|
|
538
|
+
key: key,
|
|
539
|
+
dependsOn: dependsOn
|
|
540
|
+
}, order !== null && {
|
|
541
|
+
order: order
|
|
542
|
+
});
|
|
344
543
|
default:
|
|
345
544
|
return null;
|
|
346
545
|
}
|
|
@@ -382,188 +581,27 @@ var isPropertyVisible = function isPropertyVisible(key, formikValues, themePrope
|
|
|
382
581
|
var buildLabel = function buildLabel(key, kind) {
|
|
383
582
|
return i18next.t("neetoThemes.properties.".concat(neetoCist.snakeToCamelCase(kind), ".").concat(neetoCist.snakeToCamelCase(key)));
|
|
384
583
|
};
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white space-y-3 border p-4",
|
|
392
|
-
"data-cy": "theme-".concat(neetoCist.hyphenate(title), "-properties"),
|
|
393
|
-
children: [title && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
394
|
-
className: "flex items-center justify-between",
|
|
395
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
396
|
-
"data-cy": "theme-properties",
|
|
397
|
-
lineHeight: "normal",
|
|
398
|
-
style: "h4",
|
|
399
|
-
weight: "semibold",
|
|
400
|
-
children: title
|
|
401
|
-
})
|
|
402
|
-
}), children && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
403
|
-
className: "space-y-4",
|
|
404
|
-
children: children
|
|
405
|
-
})]
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
var SelectBlock = function SelectBlock(_ref) {
|
|
410
|
-
var label = _ref.label,
|
|
411
|
-
_ref$placeholder = _ref.placeholder,
|
|
412
|
-
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
413
|
-
value = _ref.value,
|
|
414
|
-
options = _ref.options,
|
|
415
|
-
onChange = _ref.onChange;
|
|
416
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
417
|
-
className: "flex items-center justify-between py-3 first:pt-0 last:pb-0",
|
|
418
|
-
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
419
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
420
|
-
"data-cy": "logo-field-labels",
|
|
421
|
-
style: "body2",
|
|
422
|
-
children: label
|
|
423
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
424
|
-
className: "w-40",
|
|
425
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
|
|
426
|
-
onChange: onChange,
|
|
427
|
-
options: options,
|
|
428
|
-
placeholder: placeholder,
|
|
429
|
-
value: value
|
|
430
|
-
})
|
|
431
|
-
})]
|
|
584
|
+
var buildProperties = function buildProperties(values, condition, themePropertiesSchema) {
|
|
585
|
+
values.forEach(function (value) {
|
|
586
|
+
themePropertiesSchema.forEach(function (theme) {
|
|
587
|
+
if (!(value.key === theme.key)) return;
|
|
588
|
+
value.dependsOn = theme.dependsOn;
|
|
589
|
+
});
|
|
432
590
|
});
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
var label = _ref.label,
|
|
444
|
-
name = _ref.name,
|
|
445
|
-
_ref$imageData = _ref.imageData,
|
|
446
|
-
imageData = _ref$imageData === void 0 ? {} : _ref$imageData,
|
|
447
|
-
_ref$uploadConfig = _ref.uploadConfig,
|
|
448
|
-
uploadConfig = _ref$uploadConfig === void 0 ? {
|
|
449
|
-
maxImageSize: ONE_MEGABYTE
|
|
450
|
-
} : _ref$uploadConfig,
|
|
451
|
-
attribute = _ref.attribute;
|
|
452
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
453
|
-
t = _useTranslation.t;
|
|
454
|
-
var _useFormikContext = formik.useFormikContext(),
|
|
455
|
-
setFieldValue = _useFormikContext.setFieldValue,
|
|
456
|
-
values = _useFormikContext.values;
|
|
457
|
-
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
458
|
-
return {
|
|
459
|
-
themePropertiesSchema: store["themePropertiesSchema"]
|
|
460
|
-
};
|
|
461
|
-
}, shallow.shallow),
|
|
462
|
-
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
463
|
-
var propertySchema = neetoCist.findBy({
|
|
464
|
-
key: attribute
|
|
465
|
-
}, themePropertiesSchema);
|
|
466
|
-
var enablePositionChanger = (propertySchema === null || propertySchema === void 0 ? void 0 : propertySchema.enablePositionChanger) || false;
|
|
467
|
-
var options = propertySchema === null || propertySchema === void 0 ? void 0 : propertySchema.options;
|
|
468
|
-
var positionKeyInSchema = neetoCist.findBy({
|
|
469
|
-
key: "".concat(name, "_position")
|
|
470
|
-
}, themePropertiesSchema);
|
|
471
|
-
var isPositionChangerVisible = enablePositionChanger && (imageData === null || imageData === void 0 ? void 0 : imageData.url) && neetoCist.isPresent(positionKeyInSchema);
|
|
472
|
-
var positionKeyIndex = neetoCist.findIndexBy({
|
|
473
|
-
key: "".concat(name, "_position")
|
|
474
|
-
}, values.properties);
|
|
475
|
-
var handleImageChange = /*#__PURE__*/function () {
|
|
476
|
-
var _ref2 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(image) {
|
|
477
|
-
var dominantColor;
|
|
478
|
-
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
479
|
-
while (1) switch (_context.prev = _context.next) {
|
|
480
|
-
case 0:
|
|
481
|
-
_context.prev = 0;
|
|
482
|
-
if (!(ramda.isEmpty(image.signedId) || ramda.isEmpty(image.url))) {
|
|
483
|
-
_context.next = 4;
|
|
484
|
-
break;
|
|
485
|
-
}
|
|
486
|
-
setFieldValue(name, {
|
|
487
|
-
signedId: null,
|
|
488
|
-
url: image.url
|
|
489
|
-
});
|
|
490
|
-
return _context.abrupt("return");
|
|
491
|
-
case 4:
|
|
492
|
-
_context.next = 6;
|
|
493
|
-
return utils.getDominantColorFromUrl(image.url);
|
|
494
|
-
case 6:
|
|
495
|
-
dominantColor = _context.sent;
|
|
496
|
-
setFieldValue(name, {
|
|
497
|
-
signedId: image.signedId,
|
|
498
|
-
url: image.url,
|
|
499
|
-
dominantColor: dominantColor
|
|
500
|
-
});
|
|
501
|
-
_context.next = 13;
|
|
502
|
-
break;
|
|
503
|
-
case 10:
|
|
504
|
-
_context.prev = 10;
|
|
505
|
-
_context.t0 = _context["catch"](0);
|
|
506
|
-
Toastr__default["default"].error(_context.t0);
|
|
507
|
-
case 13:
|
|
508
|
-
case "end":
|
|
509
|
-
return _context.stop();
|
|
510
|
-
}
|
|
511
|
-
}, _callee, null, [[0, 10]]);
|
|
512
|
-
}));
|
|
513
|
-
return function handleImageChange(_x) {
|
|
514
|
-
return _ref2.apply(this, arguments);
|
|
515
|
-
};
|
|
516
|
-
}();
|
|
517
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
518
|
-
className: "space-y-3 py-3 first:pt-0 last:pb-0",
|
|
519
|
-
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
520
|
-
children: [label && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
521
|
-
className: "flex items-center justify-between",
|
|
522
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
523
|
-
"data-cy": "style-fields-labels",
|
|
524
|
-
style: "body2",
|
|
525
|
-
children: label
|
|
526
|
-
})
|
|
527
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
528
|
-
className: "space-y-3 divide-y divide-gray-200",
|
|
529
|
-
children: [/*#__PURE__*/react.createElement(neetoImageUploaderFrontend.ImageUploader, {
|
|
530
|
-
uploadConfig: uploadConfig,
|
|
531
|
-
className: "h-40 w-full",
|
|
532
|
-
key: imageData === null || imageData === void 0 ? void 0 : imageData.url,
|
|
533
|
-
src: imageData === null || imageData === void 0 ? void 0 : imageData.url,
|
|
534
|
-
onUploadComplete: handleImageChange
|
|
535
|
-
}), isPositionChangerVisible && /*#__PURE__*/jsxRuntime.jsx(SelectBlock, {
|
|
536
|
-
label: buildLabel("".concat(name, "Position"), "image"),
|
|
537
|
-
options: options || POSITION_OPTIONS,
|
|
538
|
-
placeholder: t("neetoThemes.common.left"),
|
|
539
|
-
value: neetoCist.toLabelAndValue(((_findBy = neetoCist.findBy({
|
|
540
|
-
key: "".concat(name, "_position")
|
|
541
|
-
}, values.properties)) === null || _findBy === void 0 ? void 0 : _findBy.value) || (positionKeyInSchema === null || positionKeyInSchema === void 0 ? void 0 : positionKeyInSchema.defaultValue)),
|
|
542
|
-
onChange: function onChange(option) {
|
|
543
|
-
return setFieldValue("properties[".concat(positionKeyIndex, "].value"), option.value);
|
|
544
|
-
}
|
|
545
|
-
})]
|
|
546
|
-
})]
|
|
591
|
+
if (condition) {
|
|
592
|
+
return neetoCist.filterBy({
|
|
593
|
+
dependsOn: condition
|
|
594
|
+
}, values);
|
|
595
|
+
}
|
|
596
|
+
var imageKeys = new Set();
|
|
597
|
+
neetoCist.filterBy({
|
|
598
|
+
kind: "image"
|
|
599
|
+
}, themePropertiesSchema).forEach(function (ele) {
|
|
600
|
+
return imageKeys.add(ele.key);
|
|
547
601
|
});
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
var attribute = _ref.attribute;
|
|
552
|
-
var _useFormikContext = formik.useFormikContext(),
|
|
553
|
-
values = _useFormikContext.values;
|
|
554
|
-
var key = neetoCist.snakeToCamelCase(attribute);
|
|
555
|
-
var title = buildLabel(key, "image");
|
|
556
|
-
var imageData = values[key];
|
|
557
|
-
return /*#__PURE__*/jsxRuntime.jsx(Card$2, {
|
|
558
|
-
title: title,
|
|
559
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
560
|
-
className: "divide-y divide-gray-200",
|
|
561
|
-
children: /*#__PURE__*/jsxRuntime.jsx(ImageBlock, {
|
|
562
|
-
attribute: attribute,
|
|
563
|
-
imageData: imageData,
|
|
564
|
-
name: key
|
|
565
|
-
})
|
|
566
|
-
})
|
|
602
|
+
return values === null || values === void 0 ? void 0 : values.filter(function (_ref2) {
|
|
603
|
+
var dependsOn = _ref2.dependsOn;
|
|
604
|
+
return !imageKeys.has(dependsOn);
|
|
567
605
|
});
|
|
568
606
|
};
|
|
569
607
|
|
|
@@ -571,9 +609,9 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
571
609
|
var label = _ref.label,
|
|
572
610
|
name = _ref.name;
|
|
573
611
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
574
|
-
className: "flex items-center justify-between gap-2
|
|
612
|
+
className: "flex items-center justify-between gap-2",
|
|
575
613
|
"data-cy": utils$1.joinHyphenCase(label),
|
|
576
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
614
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
577
615
|
"data-cy": "style-fields-labels",
|
|
578
616
|
style: "body2",
|
|
579
617
|
children: label
|
|
@@ -583,12 +621,22 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
583
621
|
var value = _ref2.field.value,
|
|
584
622
|
setFieldValue = _ref2.form.setFieldValue;
|
|
585
623
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
586
|
-
className: "flex items-center
|
|
587
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
624
|
+
className: "neeto-ui-border-gray-300 neeto-themes-nano-alignment-block flex items-center border",
|
|
625
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
626
|
+
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-left",
|
|
588
627
|
"data-cy": "alignment-left",
|
|
589
|
-
|
|
590
|
-
size: "large",
|
|
628
|
+
size: "medium",
|
|
591
629
|
style: value === "left" ? "primary" : "text",
|
|
630
|
+
icon: function icon() {
|
|
631
|
+
return /*#__PURE__*/jsxRuntime.jsx(LeftAlign, {
|
|
632
|
+
size: 20,
|
|
633
|
+
className: classnames({
|
|
634
|
+
rounded: true,
|
|
635
|
+
"neeto-ui-text-primary-800": value === "left",
|
|
636
|
+
"neeto-ui-text-gray-600": value !== "left"
|
|
637
|
+
})
|
|
638
|
+
});
|
|
639
|
+
},
|
|
592
640
|
tooltipProps: {
|
|
593
641
|
content: "Left align",
|
|
594
642
|
position: "bottom"
|
|
@@ -596,11 +644,23 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
596
644
|
onClick: function onClick() {
|
|
597
645
|
return setFieldValue(name, "left");
|
|
598
646
|
}
|
|
599
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
647
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
648
|
+
className: "neeto-themes-nano-alignment-divider"
|
|
649
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
650
|
+
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-center",
|
|
600
651
|
"data-cy": "alignment-center",
|
|
601
|
-
|
|
602
|
-
size: "large",
|
|
652
|
+
size: "medium",
|
|
603
653
|
style: value === "center" ? "primary" : "text",
|
|
654
|
+
icon: function icon() {
|
|
655
|
+
return /*#__PURE__*/jsxRuntime.jsx(CenterAlign, {
|
|
656
|
+
size: 20,
|
|
657
|
+
className: classnames({
|
|
658
|
+
rounded: true,
|
|
659
|
+
"neeto-ui-text-primary-800": value === "center",
|
|
660
|
+
"neeto-ui-text-gray-600": value !== "center"
|
|
661
|
+
})
|
|
662
|
+
});
|
|
663
|
+
},
|
|
604
664
|
tooltipProps: {
|
|
605
665
|
content: "Center align",
|
|
606
666
|
position: "bottom"
|
|
@@ -622,23 +682,24 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
622
682
|
onChange = _ref.onChange,
|
|
623
683
|
showTransparencyControl = _ref.showTransparencyControl;
|
|
624
684
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
625
|
-
className: "flex items-center justify-between
|
|
685
|
+
className: "flex items-center justify-between",
|
|
626
686
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
627
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
687
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
628
688
|
"data-cy": "style-fields-labels",
|
|
629
689
|
style: "body2",
|
|
630
690
|
children: label
|
|
631
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
691
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ColorPicker, {
|
|
632
692
|
color: color,
|
|
633
693
|
onChange: onChange,
|
|
634
694
|
showTransparencyControl: showTransparencyControl,
|
|
635
|
-
showEyeDropper: true
|
|
695
|
+
showEyeDropper: true,
|
|
696
|
+
size: "medium"
|
|
636
697
|
})]
|
|
637
698
|
});
|
|
638
699
|
};
|
|
639
700
|
|
|
640
701
|
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; }
|
|
641
|
-
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) {
|
|
702
|
+
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; }
|
|
642
703
|
var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
643
704
|
var label = _ref.label,
|
|
644
705
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -647,15 +708,15 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
647
708
|
options = _ref.options,
|
|
648
709
|
onChange = _ref.onChange;
|
|
649
710
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
650
|
-
className: "flex items-center justify-between
|
|
711
|
+
className: "flex items-center justify-between",
|
|
651
712
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
652
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
713
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
653
714
|
"data-cy": "style-fields-labels",
|
|
654
715
|
style: "body2",
|
|
655
716
|
children: label
|
|
656
717
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
657
718
|
className: "w-40",
|
|
658
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
719
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
659
720
|
onChange: onChange,
|
|
660
721
|
options: options,
|
|
661
722
|
placeholder: placeholder,
|
|
@@ -674,6 +735,32 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
674
735
|
});
|
|
675
736
|
};
|
|
676
737
|
|
|
738
|
+
var SelectBlock = function SelectBlock(_ref) {
|
|
739
|
+
var label = _ref.label,
|
|
740
|
+
_ref$placeholder = _ref.placeholder,
|
|
741
|
+
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
742
|
+
value = _ref.value,
|
|
743
|
+
options = _ref.options,
|
|
744
|
+
onChange = _ref.onChange;
|
|
745
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
746
|
+
className: "flex items-center justify-between",
|
|
747
|
+
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
748
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
749
|
+
"data-cy": "logo-field-labels",
|
|
750
|
+
style: "body2",
|
|
751
|
+
children: label
|
|
752
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
753
|
+
className: "w-40",
|
|
754
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
755
|
+
onChange: onChange,
|
|
756
|
+
options: options,
|
|
757
|
+
placeholder: placeholder,
|
|
758
|
+
value: value
|
|
759
|
+
})
|
|
760
|
+
})]
|
|
761
|
+
});
|
|
762
|
+
};
|
|
763
|
+
|
|
677
764
|
var SliderBlock = function SliderBlock(_ref) {
|
|
678
765
|
var label = _ref.label,
|
|
679
766
|
onChange = _ref.onChange,
|
|
@@ -682,9 +769,9 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
682
769
|
max = _ref.max,
|
|
683
770
|
marks = _ref.marks;
|
|
684
771
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
685
|
-
className: "flex items-center justify-between gap-3
|
|
772
|
+
className: "flex items-center justify-between gap-3",
|
|
686
773
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
687
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
774
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
688
775
|
"data-cy": "style-fields-labels",
|
|
689
776
|
style: "body2",
|
|
690
777
|
children: label
|
|
@@ -704,33 +791,34 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
704
791
|
|
|
705
792
|
var _excluded = ["label", "name"];
|
|
706
793
|
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; }
|
|
707
|
-
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) {
|
|
794
|
+
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; }
|
|
708
795
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
709
796
|
var label = _ref.label,
|
|
710
797
|
name = _ref.name,
|
|
711
|
-
switchProps =
|
|
798
|
+
switchProps = _objectWithoutProperties(_ref, _excluded);
|
|
712
799
|
var _useTranslation = reactI18next.useTranslation(),
|
|
713
800
|
t = _useTranslation.t,
|
|
714
801
|
i18n = _useTranslation.i18n;
|
|
715
802
|
var translationKey = "neetoThemes.properties.boolean.".concat(name, "HelpText");
|
|
716
803
|
var doesHelpTextExist = i18n.exists(translationKey);
|
|
717
804
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
718
|
-
className: "flex items-center justify-between
|
|
805
|
+
className: "flex items-center justify-between",
|
|
806
|
+
"data-cy": "theme-style-content-background",
|
|
719
807
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
720
808
|
className: "inline-flex items-center gap-4",
|
|
721
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
809
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
722
810
|
"data-cy": "style-fields-labels",
|
|
723
811
|
style: "body2",
|
|
724
|
-
className:
|
|
812
|
+
className: classnames({
|
|
725
813
|
"w-32": doesHelpTextExist,
|
|
726
814
|
"w-auto": !doesHelpTextExist
|
|
727
815
|
}),
|
|
728
816
|
children: label
|
|
729
|
-
}), doesHelpTextExist && /*#__PURE__*/jsxRuntime.jsx(
|
|
817
|
+
}), doesHelpTextExist && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
|
|
730
818
|
className: "flex-shrink-0",
|
|
731
819
|
description: t(translationKey)
|
|
732
820
|
})]
|
|
733
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
821
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Switch, _objectSpread$2(_objectSpread$2({}, _objectSpread$2({
|
|
734
822
|
name: name
|
|
735
823
|
}, switchProps)), {}, {
|
|
736
824
|
"data-cy": "enable-background-color-toggle"
|
|
@@ -739,9 +827,8 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
739
827
|
};
|
|
740
828
|
|
|
741
829
|
var Properties = function Properties(_ref) {
|
|
742
|
-
var onPropertiesChange = _ref.onPropertiesChange
|
|
743
|
-
|
|
744
|
-
t = _useTranslation.t;
|
|
830
|
+
var onPropertiesChange = _ref.onPropertiesChange,
|
|
831
|
+
condition = _ref.condition;
|
|
745
832
|
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
746
833
|
return {
|
|
747
834
|
themePropertiesSchema: store["themePropertiesSchema"]
|
|
@@ -790,140 +877,262 @@ var Properties = function Properties(_ref) {
|
|
|
790
877
|
}
|
|
791
878
|
};
|
|
792
879
|
react.useEffect(function () {
|
|
793
|
-
onPropertiesChange === null || onPropertiesChange === void 0
|
|
880
|
+
onPropertiesChange === null || onPropertiesChange === void 0 ? void 0 : onPropertiesChange(values, handleChange, handleColorChange);
|
|
794
881
|
setTheme(values);
|
|
795
882
|
setThemeState({
|
|
796
883
|
previewingTheme: values
|
|
797
884
|
});
|
|
798
885
|
}, [values]);
|
|
799
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
className: "divide-y divide-gray-200",
|
|
803
|
-
children: [neetoCist.filterBy({
|
|
804
|
-
kind: "font_family"
|
|
805
|
-
}, values.properties).map(function (_ref3) {
|
|
806
|
-
var key = _ref3.key,
|
|
807
|
-
value = _ref3.value,
|
|
808
|
-
kind = _ref3.kind;
|
|
809
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(FontPickerBlock, {
|
|
810
|
-
label: buildLabel(key, kind),
|
|
811
|
-
options: FONT_OPTIONS,
|
|
812
|
-
value: neetoCist.findBy({
|
|
813
|
-
value: value || null
|
|
814
|
-
}, FONT_OPTIONS),
|
|
815
|
-
onChange: function onChange(_ref4) {
|
|
816
|
-
var value = _ref4.value;
|
|
817
|
-
handleChange(key, value);
|
|
818
|
-
}
|
|
819
|
-
}, key);
|
|
820
|
-
}), neetoCist.filterBy({
|
|
821
|
-
kind: "color"
|
|
822
|
-
}, values.properties).map(function (_ref5) {
|
|
886
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
887
|
+
children: buildProperties(values === null || values === void 0 ? void 0 : values.properties, condition, themePropertiesSchema).sort(function (a, b) {
|
|
888
|
+
var order = function order(key) {
|
|
823
889
|
var _findBy;
|
|
824
|
-
|
|
825
|
-
value = _ref5.value,
|
|
826
|
-
kind = _ref5.kind;
|
|
827
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(ColorBlock, {
|
|
828
|
-
color: value,
|
|
829
|
-
label: buildLabel(key, kind),
|
|
830
|
-
showTransparencyControl: ((_findBy = neetoCist.findBy({
|
|
831
|
-
key: key
|
|
832
|
-
}, themePropertiesSchema)) === null || _findBy === void 0 ? void 0 : _findBy.showTransparencyControl) || false,
|
|
833
|
-
onChange: handleColorChange(key)
|
|
834
|
-
}, key);
|
|
835
|
-
}), neetoCist.filterBy({
|
|
836
|
-
kind: "radius"
|
|
837
|
-
}, values.properties).map(function (_ref6) {
|
|
838
|
-
var key = _ref6.key,
|
|
839
|
-
value = _ref6.value,
|
|
840
|
-
kind = _ref6.kind;
|
|
841
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
842
|
-
label: buildLabel(key, kind),
|
|
843
|
-
max: 50,
|
|
844
|
-
min: 0,
|
|
845
|
-
value: Number(value) || 0,
|
|
846
|
-
onChange: function onChange(radius) {
|
|
847
|
-
return handleChange(key, radius, "".concat(radius, "px"));
|
|
848
|
-
}
|
|
849
|
-
}, key);
|
|
850
|
-
}), neetoCist.filterBy({
|
|
851
|
-
kind: "overlay_opacity"
|
|
852
|
-
}, values.properties).map(function (_ref7) {
|
|
853
|
-
var key = _ref7.key,
|
|
854
|
-
value = _ref7.value,
|
|
855
|
-
kind = _ref7.kind;
|
|
856
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
857
|
-
label: buildLabel(key, kind),
|
|
858
|
-
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
859
|
-
max: HUNDRED,
|
|
860
|
-
min: ramda.negate(HUNDRED),
|
|
861
|
-
value: Number(value) || 0,
|
|
862
|
-
onChange: function onChange(opacity) {
|
|
863
|
-
return handleOverlayChange(key, opacity);
|
|
864
|
-
}
|
|
865
|
-
}, key);
|
|
866
|
-
}), neetoCist.filterBy({
|
|
867
|
-
kind: "position_selector"
|
|
868
|
-
}, values.properties).map(function (_ref8) {
|
|
869
|
-
var _findBy2;
|
|
870
|
-
var key = _ref8.key,
|
|
871
|
-
kind = _ref8.kind,
|
|
872
|
-
value = _ref8.value;
|
|
873
|
-
var index = neetoCist.findIndexBy({
|
|
890
|
+
return ((_findBy = neetoCist.findBy({
|
|
874
891
|
key: key
|
|
875
|
-
},
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
892
|
+
}, themePropertiesSchema)) === null || _findBy === void 0 ? void 0 : _findBy.order) || Infinity;
|
|
893
|
+
};
|
|
894
|
+
return order(a.key) - order(b.key);
|
|
895
|
+
}).map(function (_ref3) {
|
|
896
|
+
var _findBy2;
|
|
897
|
+
var key = _ref3.key,
|
|
898
|
+
value = _ref3.value,
|
|
899
|
+
kind = _ref3.kind;
|
|
900
|
+
var isCurrentPropertyVisible = isPropertyVisible(key, values, themePropertiesSchema);
|
|
901
|
+
if (!isCurrentPropertyVisible) return null;
|
|
902
|
+
switch (kind) {
|
|
903
|
+
case "font_family":
|
|
904
|
+
return /*#__PURE__*/jsxRuntime.jsx(FontPickerBlock, {
|
|
905
|
+
label: buildLabel(key, kind),
|
|
906
|
+
options: FONT_OPTIONS,
|
|
907
|
+
value: neetoCist.findBy({
|
|
908
|
+
value: value || null
|
|
909
|
+
}, FONT_OPTIONS),
|
|
910
|
+
onChange: function onChange(_ref4) {
|
|
911
|
+
var value = _ref4.value;
|
|
912
|
+
return handleChange(key, value);
|
|
913
|
+
}
|
|
914
|
+
}, key);
|
|
915
|
+
case "color":
|
|
916
|
+
return /*#__PURE__*/jsxRuntime.jsx(ColorBlock, {
|
|
917
|
+
color: value,
|
|
918
|
+
label: buildLabel(key, kind),
|
|
919
|
+
showTransparencyControl: ((_findBy2 = neetoCist.findBy({
|
|
920
|
+
key: key
|
|
921
|
+
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.showTransparencyControl) || false,
|
|
922
|
+
onChange: handleColorChange(key)
|
|
923
|
+
}, key);
|
|
924
|
+
case "radius":
|
|
925
|
+
return /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
926
|
+
label: buildLabel(key, kind),
|
|
927
|
+
max: 50,
|
|
928
|
+
min: 0,
|
|
929
|
+
value: Number(value) || 0,
|
|
930
|
+
onChange: function onChange(radius) {
|
|
931
|
+
return handleChange(key, radius, "".concat(radius, "px"));
|
|
932
|
+
}
|
|
933
|
+
}, key);
|
|
934
|
+
case "overlay_opacity":
|
|
935
|
+
return /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
936
|
+
label: buildLabel(key, kind),
|
|
937
|
+
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
938
|
+
max: HUNDRED,
|
|
939
|
+
min: ramda.negate(HUNDRED),
|
|
940
|
+
value: Number(value) || 0,
|
|
941
|
+
onChange: function onChange(opacity) {
|
|
942
|
+
return handleOverlayChange(key, opacity);
|
|
943
|
+
}
|
|
944
|
+
}, key);
|
|
945
|
+
case "position_selector":
|
|
946
|
+
{
|
|
947
|
+
var _findBy3, _findBy3$options;
|
|
948
|
+
var index = neetoCist.findIndexBy({
|
|
949
|
+
key: key
|
|
950
|
+
}, values.properties);
|
|
951
|
+
var options = (_findBy3 = neetoCist.findBy({
|
|
952
|
+
key: key
|
|
953
|
+
}, themePropertiesSchema)) === null || _findBy3 === void 0 ? void 0 : (_findBy3$options = _findBy3.options) === null || _findBy3$options === void 0 ? void 0 : _findBy3$options.map(neetoCist.toLabelAndValue);
|
|
954
|
+
return /*#__PURE__*/jsxRuntime.jsx(SelectBlock, {
|
|
955
|
+
label: buildLabel(key, kind),
|
|
956
|
+
options: options || POSITION_OPTIONS,
|
|
957
|
+
placeholder: "left",
|
|
958
|
+
value: neetoCist.toLabelAndValue(value),
|
|
959
|
+
onChange: function onChange(option) {
|
|
960
|
+
return setFieldValue("properties[".concat(index, "].value"), option.value);
|
|
961
|
+
}
|
|
962
|
+
}, key);
|
|
886
963
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
name: neetoCist.snakeToCamelCase(key),
|
|
901
|
-
onChange: function onChange(e) {
|
|
902
|
-
return setFieldValue("properties[".concat(index, "].value"), String(e.target.checked));
|
|
964
|
+
case "boolean":
|
|
965
|
+
{
|
|
966
|
+
var _index = neetoCist.findIndexBy({
|
|
967
|
+
key: key
|
|
968
|
+
}, values.properties);
|
|
969
|
+
return /*#__PURE__*/jsxRuntime.jsx(SwitchBlock, {
|
|
970
|
+
checked: value !== "false",
|
|
971
|
+
label: buildLabel(key, kind),
|
|
972
|
+
name: neetoCist.snakeToCamelCase(key),
|
|
973
|
+
onChange: function onChange(e) {
|
|
974
|
+
return setFieldValue("properties[".concat(_index, "].value"), String(e.target.checked));
|
|
975
|
+
}
|
|
976
|
+
}, key);
|
|
903
977
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
})]
|
|
978
|
+
case "alignment_block":
|
|
979
|
+
{
|
|
980
|
+
var _index2 = neetoCist.findIndexBy({
|
|
981
|
+
key: key
|
|
982
|
+
}, values.properties);
|
|
983
|
+
return /*#__PURE__*/jsxRuntime.jsx(AlignmentBlock, {
|
|
984
|
+
label: buildLabel(key, kind),
|
|
985
|
+
name: "properties[".concat(_index2, "].value")
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
default:
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
918
991
|
})
|
|
919
992
|
});
|
|
920
993
|
};
|
|
921
994
|
|
|
995
|
+
var ImageBlock = function ImageBlock(_ref) {
|
|
996
|
+
var _findBy;
|
|
997
|
+
var label = _ref.label,
|
|
998
|
+
name = _ref.name,
|
|
999
|
+
_ref$imageData = _ref.imageData,
|
|
1000
|
+
imageData = _ref$imageData === void 0 ? {} : _ref$imageData,
|
|
1001
|
+
_ref$uploadConfig = _ref.uploadConfig,
|
|
1002
|
+
uploadConfig = _ref$uploadConfig === void 0 ? {
|
|
1003
|
+
maxImageSize: ONE_MEGABYTE
|
|
1004
|
+
} : _ref$uploadConfig,
|
|
1005
|
+
attribute = _ref.attribute;
|
|
1006
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
1007
|
+
t = _useTranslation.t;
|
|
1008
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
1009
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
1010
|
+
values = _useFormikContext.values;
|
|
1011
|
+
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
1012
|
+
return {
|
|
1013
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
1014
|
+
};
|
|
1015
|
+
}, shallow.shallow),
|
|
1016
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
1017
|
+
var propertySchema = neetoCist.findBy({
|
|
1018
|
+
key: attribute
|
|
1019
|
+
}, themePropertiesSchema);
|
|
1020
|
+
var enablePositionChanger = (propertySchema === null || propertySchema === void 0 ? void 0 : propertySchema.enablePositionChanger) || false;
|
|
1021
|
+
var options = propertySchema === null || propertySchema === void 0 ? void 0 : propertySchema.options;
|
|
1022
|
+
var positionKeyInSchema = neetoCist.findBy({
|
|
1023
|
+
key: "".concat(name, "_position")
|
|
1024
|
+
}, themePropertiesSchema);
|
|
1025
|
+
var isPositionChangerVisible = enablePositionChanger && (imageData === null || imageData === void 0 ? void 0 : imageData.url) && neetoCist.isPresent(positionKeyInSchema);
|
|
1026
|
+
var positionKeyIndex = neetoCist.findIndexBy({
|
|
1027
|
+
key: "".concat(name, "_position")
|
|
1028
|
+
}, values.properties);
|
|
1029
|
+
var handleImageChange = /*#__PURE__*/function () {
|
|
1030
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(image) {
|
|
1031
|
+
var dominantColor;
|
|
1032
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1033
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1034
|
+
case 0:
|
|
1035
|
+
_context.prev = 0;
|
|
1036
|
+
if (!(ramda.isEmpty(image.signedId) || ramda.isEmpty(image.url))) {
|
|
1037
|
+
_context.next = 4;
|
|
1038
|
+
break;
|
|
1039
|
+
}
|
|
1040
|
+
setFieldValue(name, {
|
|
1041
|
+
signedId: null,
|
|
1042
|
+
url: image.url
|
|
1043
|
+
});
|
|
1044
|
+
return _context.abrupt("return");
|
|
1045
|
+
case 4:
|
|
1046
|
+
_context.next = 6;
|
|
1047
|
+
return utils.getDominantColorFromUrl(image.url);
|
|
1048
|
+
case 6:
|
|
1049
|
+
dominantColor = _context.sent;
|
|
1050
|
+
setFieldValue(name, {
|
|
1051
|
+
signedId: image.signedId,
|
|
1052
|
+
url: image.url,
|
|
1053
|
+
dominantColor: dominantColor
|
|
1054
|
+
});
|
|
1055
|
+
_context.next = 13;
|
|
1056
|
+
break;
|
|
1057
|
+
case 10:
|
|
1058
|
+
_context.prev = 10;
|
|
1059
|
+
_context.t0 = _context["catch"](0);
|
|
1060
|
+
Toastr.error(_context.t0);
|
|
1061
|
+
case 13:
|
|
1062
|
+
case "end":
|
|
1063
|
+
return _context.stop();
|
|
1064
|
+
}
|
|
1065
|
+
}, _callee, null, [[0, 10]]);
|
|
1066
|
+
}));
|
|
1067
|
+
return function handleImageChange(_x) {
|
|
1068
|
+
return _ref2.apply(this, arguments);
|
|
1069
|
+
};
|
|
1070
|
+
}();
|
|
1071
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1072
|
+
className: "space-y-3",
|
|
1073
|
+
"data-cy": "theme-style-".concat(label ? utils$1.joinHyphenCase(label) : "image-block"),
|
|
1074
|
+
children: [label && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1075
|
+
className: "flex items-center justify-between",
|
|
1076
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1077
|
+
"data-cy": "style-fields-labels",
|
|
1078
|
+
style: "body2",
|
|
1079
|
+
children: label
|
|
1080
|
+
})
|
|
1081
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1082
|
+
className: "space-y-3",
|
|
1083
|
+
children: [/*#__PURE__*/react.createElement(ImageUploader, {
|
|
1084
|
+
uploadConfig: uploadConfig,
|
|
1085
|
+
className: "h-40 w-full",
|
|
1086
|
+
key: imageData === null || imageData === void 0 ? void 0 : imageData.url,
|
|
1087
|
+
src: imageData === null || imageData === void 0 ? void 0 : imageData.url,
|
|
1088
|
+
onUploadComplete: handleImageChange
|
|
1089
|
+
}), isPositionChangerVisible && /*#__PURE__*/jsxRuntime.jsx(SelectBlock, {
|
|
1090
|
+
label: buildLabel("".concat(name, "Position"), "image"),
|
|
1091
|
+
options: options || POSITION_OPTIONS,
|
|
1092
|
+
placeholder: t("neetoThemes.common.left"),
|
|
1093
|
+
value: neetoCist.toLabelAndValue(((_findBy = neetoCist.findBy({
|
|
1094
|
+
key: "".concat(name, "_position")
|
|
1095
|
+
}, values.properties)) === null || _findBy === void 0 ? void 0 : _findBy.value) || (positionKeyInSchema === null || positionKeyInSchema === void 0 ? void 0 : positionKeyInSchema.defaultValue)),
|
|
1096
|
+
onChange: function onChange(option) {
|
|
1097
|
+
return setFieldValue("properties[".concat(positionKeyIndex, "].value"), option.value);
|
|
1098
|
+
}
|
|
1099
|
+
})]
|
|
1100
|
+
})]
|
|
1101
|
+
});
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
var Images = function Images(_ref) {
|
|
1105
|
+
var attribute = _ref.attribute,
|
|
1106
|
+
className = _ref.className,
|
|
1107
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
1108
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
1109
|
+
values = _useFormikContext.values;
|
|
1110
|
+
var key = neetoCist.snakeToCamelCase(attribute);
|
|
1111
|
+
var title = buildLabel(key, "image");
|
|
1112
|
+
var imageData = values[key];
|
|
1113
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Card$2, {
|
|
1114
|
+
className: className,
|
|
1115
|
+
title: title,
|
|
1116
|
+
name: "images",
|
|
1117
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ImageBlock, {
|
|
1118
|
+
attribute: attribute,
|
|
1119
|
+
imageData: imageData,
|
|
1120
|
+
name: key
|
|
1121
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
1122
|
+
onPropertiesChange: onPropertiesChange,
|
|
1123
|
+
condition: attribute
|
|
1124
|
+
})]
|
|
1125
|
+
});
|
|
1126
|
+
};
|
|
1127
|
+
|
|
922
1128
|
var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
923
|
-
var t = _ref.t
|
|
1129
|
+
var t = _ref.t,
|
|
1130
|
+
className = _ref.className;
|
|
924
1131
|
return /*#__PURE__*/jsxRuntime.jsx(Card$2, {
|
|
1132
|
+
className: className,
|
|
1133
|
+
name: "name",
|
|
925
1134
|
title: t("neetoThemes.common.name"),
|
|
926
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1135
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
927
1136
|
autoFocus: true,
|
|
928
1137
|
"data-cy": "theme-name-property",
|
|
929
1138
|
name: "name"
|
|
@@ -932,7 +1141,7 @@ var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
|
932
1141
|
});
|
|
933
1142
|
|
|
934
1143
|
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; }
|
|
935
|
-
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) {
|
|
1144
|
+
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; }
|
|
936
1145
|
var Customize = function Customize(_ref) {
|
|
937
1146
|
var themeId = _ref.themeId,
|
|
938
1147
|
theme = _ref.theme,
|
|
@@ -940,11 +1149,13 @@ var Customize = function Customize(_ref) {
|
|
|
940
1149
|
onApplyTheme = _ref.onApplyTheme,
|
|
941
1150
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
942
1151
|
onPropertiesChange = _ref.onPropertiesChange,
|
|
943
|
-
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess
|
|
1152
|
+
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess,
|
|
1153
|
+
onEditCSSClick = _ref.onEditCSSClick,
|
|
1154
|
+
currentScreen = _ref.currentScreen;
|
|
944
1155
|
var _useTranslation = reactI18next.useTranslation(),
|
|
945
1156
|
t = _useTranslation.t;
|
|
946
1157
|
var _useState = react.useState({}),
|
|
947
|
-
_useState2 =
|
|
1158
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
948
1159
|
popoverInstance = _useState2[0],
|
|
949
1160
|
setPopoverInstance = _useState2[1];
|
|
950
1161
|
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
@@ -957,6 +1168,12 @@ var Customize = function Customize(_ref) {
|
|
|
957
1168
|
entityType = _useConfigStore.entityType;
|
|
958
1169
|
var _useThemeUtils = useThemeUtils.useThemeUtils(),
|
|
959
1170
|
currentTheme = _useThemeUtils.currentTheme;
|
|
1171
|
+
var _useShowGlobalTheme = useShowGlobalTheme(entityType),
|
|
1172
|
+
_useShowGlobalTheme$d = _useShowGlobalTheme.data,
|
|
1173
|
+
_useShowGlobalTheme$d2 = _useShowGlobalTheme$d === void 0 ? {} : _useShowGlobalTheme$d,
|
|
1174
|
+
_useShowGlobalTheme$d3 = _useShowGlobalTheme$d2.globalTheme,
|
|
1175
|
+
globalTheme = _useShowGlobalTheme$d3 === void 0 ? {} : _useShowGlobalTheme$d3;
|
|
1176
|
+
var isThemeGlobalTheme = (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
|
|
960
1177
|
var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
|
|
961
1178
|
var submitBtnRef = react.useRef(null);
|
|
962
1179
|
var _useCreateTheme = useCreateTheme(),
|
|
@@ -966,12 +1183,18 @@ var Customize = function Customize(_ref) {
|
|
|
966
1183
|
updateTheme = _useUpdateTheme.mutate,
|
|
967
1184
|
isUpdating = _useUpdateTheme.isPending;
|
|
968
1185
|
var isSubmitting = isCreating || isUpdating;
|
|
1186
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1187
|
+
var handleGlobalThemeSwitchChange = function handleGlobalThemeSwitchChange(e, setFieldValue) {
|
|
1188
|
+
setFieldValue("shouldSetAsGlobalTheme", e.target.checked);
|
|
1189
|
+
};
|
|
969
1190
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
970
1191
|
var resetForm = _ref2.resetForm;
|
|
971
1192
|
var imageData = buildImageData(values, themePropertiesSchema);
|
|
972
1193
|
var themeToSave = _objectSpread$1({
|
|
973
1194
|
propertiesAttributes: values.properties,
|
|
974
|
-
name: values.name
|
|
1195
|
+
name: values.name,
|
|
1196
|
+
shouldSetAsGlobalTheme: values.shouldSetAsGlobalTheme,
|
|
1197
|
+
entityType: values.entityType
|
|
975
1198
|
}, imageData);
|
|
976
1199
|
if (!themeId) {
|
|
977
1200
|
return createTheme(themeToSave, {
|
|
@@ -989,41 +1212,87 @@ var Customize = function Customize(_ref) {
|
|
|
989
1212
|
resetForm({
|
|
990
1213
|
values: values
|
|
991
1214
|
});
|
|
992
|
-
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0
|
|
1215
|
+
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 ? void 0 : onUpdateThemeSuccess(values);
|
|
993
1216
|
}
|
|
994
1217
|
});
|
|
995
1218
|
};
|
|
996
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1219
|
+
return /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
997
1220
|
formikProps: {
|
|
998
|
-
initialValues: buildInitialValues(theme, themePropertiesSchema),
|
|
1221
|
+
initialValues: _objectSpread$1(_objectSpread$1({}, buildInitialValues(theme, themePropertiesSchema)), {}, {
|
|
1222
|
+
shouldSetAsGlobalTheme: isThemeGlobalTheme,
|
|
1223
|
+
entityType: entityType
|
|
1224
|
+
}),
|
|
999
1225
|
validationSchema: THEME_VALIDATION_SCHEMA,
|
|
1226
|
+
enableReinitialize: true,
|
|
1000
1227
|
onSubmit: onSubmit
|
|
1001
1228
|
},
|
|
1002
1229
|
children: function children(_ref4) {
|
|
1003
|
-
var dirty = _ref4.dirty
|
|
1230
|
+
var dirty = _ref4.dirty,
|
|
1231
|
+
values = _ref4.values,
|
|
1232
|
+
setFieldValue = _ref4.setFieldValue;
|
|
1004
1233
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1005
1234
|
className: "neeto-themes-sidebar__scroll",
|
|
1006
1235
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1007
|
-
className: "flex flex-col
|
|
1008
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {
|
|
1009
|
-
|
|
1236
|
+
className: "neeto-themes-sidebar__scroll-content flex flex-grow flex-col px-4 pb-4 lg:px-5",
|
|
1237
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {
|
|
1238
|
+
className: classnames({
|
|
1239
|
+
hidden: isCustomCssScreen
|
|
1240
|
+
})
|
|
1241
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Card$2, {
|
|
1242
|
+
className: classnames({
|
|
1243
|
+
hidden: isCustomCssScreen
|
|
1244
|
+
}),
|
|
1245
|
+
name: "style",
|
|
1246
|
+
title: t("neetoThemes.common.style"),
|
|
1247
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
1248
|
+
onPropertiesChange: onPropertiesChange
|
|
1249
|
+
})
|
|
1010
1250
|
}), neetoCist.filterBy({
|
|
1011
1251
|
kind: "image"
|
|
1012
1252
|
}, themePropertiesSchema).map(function (_ref5) {
|
|
1013
1253
|
var key = _ref5.key;
|
|
1014
|
-
return /*#__PURE__*/
|
|
1015
|
-
|
|
1016
|
-
|
|
1254
|
+
return /*#__PURE__*/react.createElement(Images, {
|
|
1255
|
+
onPropertiesChange: onPropertiesChange,
|
|
1256
|
+
attribute: key,
|
|
1257
|
+
className: classnames({
|
|
1258
|
+
hidden: isCustomCssScreen
|
|
1259
|
+
}),
|
|
1260
|
+
key: key
|
|
1261
|
+
});
|
|
1262
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CustomCSS, {
|
|
1263
|
+
currentScreen: currentScreen,
|
|
1264
|
+
onEditCSSClick: onEditCSSClick
|
|
1265
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1266
|
+
className: "neeto-ui-bg-gray-50 neeto-ui-border-gray-200 mt-2 flex flex-col space-y-2 border p-2",
|
|
1267
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Tooltip, {
|
|
1268
|
+
disabled: !isThemeGlobalTheme,
|
|
1269
|
+
content: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.tooltipContent"),
|
|
1270
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Switch, {
|
|
1271
|
+
checked: values.shouldSetAsGlobalTheme,
|
|
1272
|
+
disabled: isThemeGlobalTheme,
|
|
1273
|
+
name: "shouldSetAsGlobalTheme",
|
|
1274
|
+
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.label"),
|
|
1275
|
+
onChange: function onChange(e) {
|
|
1276
|
+
return handleGlobalThemeSwitchChange(e, setFieldValue);
|
|
1277
|
+
}
|
|
1278
|
+
})
|
|
1279
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1280
|
+
className: "text-sm",
|
|
1281
|
+
style: "body2",
|
|
1282
|
+
children: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.helpText", {
|
|
1283
|
+
entityType: entityType
|
|
1284
|
+
})
|
|
1285
|
+
})]
|
|
1017
1286
|
})]
|
|
1018
1287
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1019
|
-
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",
|
|
1020
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1288
|
+
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",
|
|
1289
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1021
1290
|
"data-cy": "reset-button",
|
|
1022
1291
|
disabled: !dirty || isSubmitting,
|
|
1023
1292
|
label: t("neetoThemes.buttons.reset"),
|
|
1024
1293
|
style: "text",
|
|
1025
1294
|
type: "reset"
|
|
1026
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1295
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1027
1296
|
"data-cy": "save-changes-button",
|
|
1028
1297
|
disabled: !dirty && (theme === null || theme === void 0 ? void 0 : theme.id) || isSubmitting,
|
|
1029
1298
|
label: t("neetoThemes.buttons.save"),
|
|
@@ -1031,7 +1300,7 @@ var Customize = function Customize(_ref) {
|
|
|
1031
1300
|
ref: submitBtnRef,
|
|
1032
1301
|
type: "submit"
|
|
1033
1302
|
})]
|
|
1034
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1303
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Popover, {
|
|
1035
1304
|
appendTo: function appendTo() {
|
|
1036
1305
|
return document.body;
|
|
1037
1306
|
},
|
|
@@ -1041,16 +1310,16 @@ var Customize = function Customize(_ref) {
|
|
|
1041
1310
|
trigger: "click",
|
|
1042
1311
|
content: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1043
1312
|
className: "flex flex-col items-start gap-2",
|
|
1044
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1313
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1045
1314
|
className: "absolute right-1 top-1 z-0",
|
|
1046
|
-
icon:
|
|
1315
|
+
icon: Close,
|
|
1047
1316
|
size: "small",
|
|
1048
1317
|
style: "text",
|
|
1049
1318
|
onClick: function onClick() {
|
|
1050
1319
|
var _popoverInstance$hide;
|
|
1051
|
-
return popoverInstance === null || popoverInstance === void 0
|
|
1320
|
+
return popoverInstance === null || popoverInstance === void 0 ? void 0 : (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
1052
1321
|
}
|
|
1053
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1322
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1054
1323
|
className: "w-72 pr-5",
|
|
1055
1324
|
style: "body2",
|
|
1056
1325
|
weight: "normal",
|
|
@@ -1063,7 +1332,7 @@ var Customize = function Customize(_ref) {
|
|
|
1063
1332
|
entityType: entityType
|
|
1064
1333
|
}
|
|
1065
1334
|
})
|
|
1066
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1335
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1067
1336
|
disabled: isApplyingTheme,
|
|
1068
1337
|
label: t("neetoThemes.buttons.applyThisTheme"),
|
|
1069
1338
|
loading: isApplyingTheme,
|
|
@@ -1080,7 +1349,7 @@ var Customize = function Customize(_ref) {
|
|
|
1080
1349
|
};
|
|
1081
1350
|
|
|
1082
1351
|
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; }
|
|
1083
|
-
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) {
|
|
1352
|
+
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; }
|
|
1084
1353
|
var Check = function Check(props) {
|
|
1085
1354
|
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread(_objectSpread({
|
|
1086
1355
|
fill: "none",
|
|
@@ -1162,7 +1431,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1162
1431
|
}, shallow.shallow),
|
|
1163
1432
|
_useConfigStore$theme = _useConfigStore.themePropertiesSchema,
|
|
1164
1433
|
themePropertiesSchema = _useConfigStore$theme === void 0 ? [] : _useConfigStore$theme;
|
|
1165
|
-
var _themePropertiesSchem =
|
|
1434
|
+
var _themePropertiesSchem = _slicedToArray(themePropertiesSchema, 2),
|
|
1166
1435
|
colorObject1 = _themePropertiesSchem[0],
|
|
1167
1436
|
colorObject2 = _themePropertiesSchem[1];
|
|
1168
1437
|
var primaryLabel = neetoCist.humanize(colorObject1 === null || colorObject1 === void 0 ? void 0 : colorObject1.key);
|
|
@@ -1182,7 +1451,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1182
1451
|
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.key
|
|
1183
1452
|
}, theme.properties)) === null || _findBy === void 0 ? void 0 : _findBy.value;
|
|
1184
1453
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1185
|
-
className:
|
|
1454
|
+
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg border transition-all duration-300 ease-in-out", {
|
|
1186
1455
|
"neeto-ui-border-gray-400": !active,
|
|
1187
1456
|
"neeto-ui-border-gray-800 neeto-themes-theme-thumbnail--active": active,
|
|
1188
1457
|
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
@@ -1198,7 +1467,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1198
1467
|
className: "neeto-ui-rounded-lg p-3",
|
|
1199
1468
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1200
1469
|
className: "mb-3",
|
|
1201
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1470
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1202
1471
|
style: "h3",
|
|
1203
1472
|
weight: "semibold",
|
|
1204
1473
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -1207,7 +1476,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1207
1476
|
},
|
|
1208
1477
|
children: primaryLabel
|
|
1209
1478
|
})
|
|
1210
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1479
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1211
1480
|
className: "neeto-ui-text-gray-600",
|
|
1212
1481
|
style: "body2",
|
|
1213
1482
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -1239,7 +1508,9 @@ var Card = function Card(_ref) {
|
|
|
1239
1508
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
1240
1509
|
onCloneTheme = _ref.onCloneTheme,
|
|
1241
1510
|
isHighLightedTheme = _ref.isHighLightedTheme,
|
|
1511
|
+
isGlobalTheme = _ref.isGlobalTheme,
|
|
1242
1512
|
onApplyTheme = _ref.onApplyTheme,
|
|
1513
|
+
onApplyGlobalTheme = _ref.onApplyGlobalTheme,
|
|
1243
1514
|
Thumbnail$1 = _ref.thumbnail;
|
|
1244
1515
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1245
1516
|
t = _useTranslation.t;
|
|
@@ -1255,12 +1526,15 @@ var Card = function Card(_ref) {
|
|
|
1255
1526
|
var handleDeleteTheme = function handleDeleteTheme() {
|
|
1256
1527
|
return onDeleteTheme(id, name, appliedCount);
|
|
1257
1528
|
};
|
|
1529
|
+
var handleApplyGlobalTheme = function handleApplyGlobalTheme() {
|
|
1530
|
+
return onApplyGlobalTheme(id);
|
|
1531
|
+
};
|
|
1258
1532
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1259
1533
|
className: "group space-y-2 pt-0.5",
|
|
1260
1534
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
1261
1535
|
id: theme.id,
|
|
1262
1536
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1263
|
-
className:
|
|
1537
|
+
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg cursor-pointer border transition-all duration-300 ease-in-out", {
|
|
1264
1538
|
"neeto-ui-border-gray-200": !active,
|
|
1265
1539
|
"neeto-themes-theme-thumbnail--active": active,
|
|
1266
1540
|
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
@@ -1277,11 +1551,11 @@ var Card = function Card(_ref) {
|
|
|
1277
1551
|
className: "flex-shrink-0",
|
|
1278
1552
|
"data-cy": "active-theme-label"
|
|
1279
1553
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1280
|
-
className:
|
|
1554
|
+
className: classnames({
|
|
1281
1555
|
hidden: !isPreviewing,
|
|
1282
1556
|
"group-hover:block": true
|
|
1283
1557
|
}),
|
|
1284
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1558
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1285
1559
|
className: "neeto-themes-theme-thumbnail__apply-btn flex-shrink-0",
|
|
1286
1560
|
"data-cy": "apply-theme-button",
|
|
1287
1561
|
disabled: isApplyingTheme,
|
|
@@ -1306,14 +1580,20 @@ var Card = function Card(_ref) {
|
|
|
1306
1580
|
theme: theme
|
|
1307
1581
|
})]
|
|
1308
1582
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1309
|
-
className: "flex items-start justify-between gap-1 p-
|
|
1310
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
1311
|
-
className: "
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1583
|
+
className: "neeto-ui-border-gray-100 flex items-start justify-between gap-1 border-t p-2",
|
|
1584
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1585
|
+
className: "flex items-center space-x-2",
|
|
1586
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1587
|
+
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
1588
|
+
"data-cy": "theme-name",
|
|
1589
|
+
lineHeight: "snug",
|
|
1590
|
+
style: "body2",
|
|
1591
|
+
children: name
|
|
1592
|
+
}), isGlobalTheme && /*#__PURE__*/jsxRuntime.jsx(Rating, {
|
|
1593
|
+
className: "neeto-themes-nano-global-theme-icon",
|
|
1594
|
+
size: 18
|
|
1595
|
+
})]
|
|
1596
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
1317
1597
|
dropdownButtonProps: {
|
|
1318
1598
|
size: "small"
|
|
1319
1599
|
},
|
|
@@ -1334,6 +1614,12 @@ var Card = function Card(_ref) {
|
|
|
1334
1614
|
"data-cy": "clone-theme-menu-item",
|
|
1335
1615
|
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.clone"),
|
|
1336
1616
|
onClick: handleCloneTheme
|
|
1617
|
+
}, {
|
|
1618
|
+
key: "set-as-global-theme",
|
|
1619
|
+
"data-cy": "set-as-global-theme-menu-item",
|
|
1620
|
+
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.label"),
|
|
1621
|
+
isVisible: !isGlobalTheme,
|
|
1622
|
+
onClick: handleApplyGlobalTheme
|
|
1337
1623
|
}, {
|
|
1338
1624
|
key: "divider",
|
|
1339
1625
|
type: "divider",
|
|
@@ -1383,12 +1669,26 @@ var Themes = function Themes(_ref) {
|
|
|
1383
1669
|
}, shallow.shallow),
|
|
1384
1670
|
setThemeState = _useThemeStore.setThemeState,
|
|
1385
1671
|
previewingTheme = _useThemeStore.previewingTheme;
|
|
1672
|
+
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
1673
|
+
return {
|
|
1674
|
+
entityType: store["entityType"]
|
|
1675
|
+
};
|
|
1676
|
+
}, shallow.shallow),
|
|
1677
|
+
entityType = _useConfigStore.entityType;
|
|
1386
1678
|
var _useState = react.useState(""),
|
|
1387
|
-
_useState2 =
|
|
1679
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1388
1680
|
searchQuery = _useState2[0],
|
|
1389
1681
|
setSearchQuery = _useState2[1];
|
|
1390
1682
|
var _useCloneTheme = useCloneTheme(),
|
|
1391
1683
|
cloneTheme = _useCloneTheme.mutate;
|
|
1684
|
+
var _useApplyGlobalTheme = useApplyGlobalTheme(),
|
|
1685
|
+
applyGlobalTheme = _useApplyGlobalTheme.mutate;
|
|
1686
|
+
var _useShowGlobalTheme = useShowGlobalTheme(entityType),
|
|
1687
|
+
_useShowGlobalTheme$d = _useShowGlobalTheme.data,
|
|
1688
|
+
_useShowGlobalTheme$d2 = _useShowGlobalTheme$d === void 0 ? {} : _useShowGlobalTheme$d,
|
|
1689
|
+
_useShowGlobalTheme$d3 = _useShowGlobalTheme$d2.globalTheme,
|
|
1690
|
+
globalTheme = _useShowGlobalTheme$d3 === void 0 ? {} : _useShowGlobalTheme$d3,
|
|
1691
|
+
isLoadingGlobalTheme = _useShowGlobalTheme.isLoading;
|
|
1392
1692
|
react.useEffect(function () {
|
|
1393
1693
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
1394
1694
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -1417,35 +1717,44 @@ var Themes = function Themes(_ref) {
|
|
|
1417
1717
|
}
|
|
1418
1718
|
});
|
|
1419
1719
|
};
|
|
1420
|
-
|
|
1720
|
+
var handleApplyGlobalTheme = function handleApplyGlobalTheme(themeId) {
|
|
1721
|
+
var payload = {
|
|
1722
|
+
entityType: entityType
|
|
1723
|
+
};
|
|
1724
|
+
applyGlobalTheme({
|
|
1725
|
+
themeId: themeId,
|
|
1726
|
+
payload: payload
|
|
1727
|
+
});
|
|
1728
|
+
};
|
|
1729
|
+
if (isLoading || isCurrentThemeLoading || isLoadingGlobalTheme) {
|
|
1421
1730
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1422
1731
|
className: "flex h-full w-full items-center justify-center",
|
|
1423
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1732
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
1424
1733
|
});
|
|
1425
1734
|
}
|
|
1426
1735
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1427
1736
|
className: "neeto-themes-sidebar__scroll",
|
|
1428
1737
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1429
1738
|
className: "mb-6 space-y-3",
|
|
1430
|
-
children: [isSearchFieldVisible && /*#__PURE__*/jsxRuntime.jsx(
|
|
1739
|
+
children: [isSearchFieldVisible && /*#__PURE__*/jsxRuntime.jsx(Search, {
|
|
1431
1740
|
autoFocus: true,
|
|
1432
1741
|
autoComplete: "off",
|
|
1433
1742
|
className: "mb-4 mt-1 px-6",
|
|
1434
1743
|
placeholder: t("neetoThemes.common.searchThemes"),
|
|
1435
1744
|
onSearch: setSearchQuery
|
|
1436
|
-
}), ramda.isEmpty(filteredThemes) && ramda.isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsx(
|
|
1745
|
+
}), ramda.isEmpty(filteredThemes) && ramda.isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1437
1746
|
className: "text-center",
|
|
1438
1747
|
style: "body2",
|
|
1439
1748
|
children: t("neetoThemes.common.noResultsFound")
|
|
1440
1749
|
}), neetoCist.isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1441
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1442
|
-
className: "my-4 px-
|
|
1750
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1751
|
+
className: "my-4 px-6 uppercase lg:px-5 xl:px-6",
|
|
1443
1752
|
"data-cy": "system-themes-header",
|
|
1444
1753
|
style: "h6",
|
|
1445
1754
|
weight: "semibold",
|
|
1446
1755
|
children: t("neetoThemes.build.leftSideBar.themes.systemThemes")
|
|
1447
1756
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1448
|
-
className: "flex flex-col gap-4 px-
|
|
1757
|
+
className: "flex flex-col gap-4 px-6 pb-10 lg:px-5 xl:px-6",
|
|
1449
1758
|
"data-cy": "system-themes",
|
|
1450
1759
|
children: filteredDefaultThemes.map(function (theme) {
|
|
1451
1760
|
return /*#__PURE__*/react.createElement(Card$1, {
|
|
@@ -1453,9 +1762,11 @@ var Themes = function Themes(_ref) {
|
|
|
1453
1762
|
theme: theme,
|
|
1454
1763
|
thumbnail: thumbnail,
|
|
1455
1764
|
active: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id,
|
|
1765
|
+
isGlobalTheme: (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === theme.id,
|
|
1456
1766
|
isPreviewing: (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id,
|
|
1457
1767
|
key: theme.id,
|
|
1458
1768
|
isApplyingTheme: isApplyingTheme && (themeBeingApplied === null || themeBeingApplied === void 0 ? void 0 : themeBeingApplied.id) === theme.id,
|
|
1769
|
+
onApplyGlobalTheme: handleApplyGlobalTheme,
|
|
1459
1770
|
onCloneTheme: handleCloneTheme,
|
|
1460
1771
|
onSetPreviewTheme: setPreviewTheme
|
|
1461
1772
|
});
|
|
@@ -1464,7 +1775,7 @@ var Themes = function Themes(_ref) {
|
|
|
1464
1775
|
})]
|
|
1465
1776
|
}), neetoCist.isNotEmpty(filteredThemes) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1466
1777
|
className: "mb-6 space-y-3",
|
|
1467
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1778
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1468
1779
|
className: "my-4 px-6 uppercase",
|
|
1469
1780
|
"data-cy": "custom-themes-header",
|
|
1470
1781
|
style: "h6",
|
|
@@ -1483,9 +1794,11 @@ var Themes = function Themes(_ref) {
|
|
|
1483
1794
|
theme: theme,
|
|
1484
1795
|
thumbnail: thumbnail,
|
|
1485
1796
|
active: isActive,
|
|
1797
|
+
isGlobalTheme: (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === theme.id,
|
|
1486
1798
|
isHighLightedTheme: theme.id === themeToHighlight,
|
|
1487
1799
|
key: theme.id,
|
|
1488
1800
|
isApplyingTheme: isApplyingTheme && (themeBeingApplied === null || themeBeingApplied === void 0 ? void 0 : themeBeingApplied.id) === theme.id,
|
|
1801
|
+
onApplyGlobalTheme: handleApplyGlobalTheme,
|
|
1489
1802
|
onCloneTheme: handleCloneTheme,
|
|
1490
1803
|
onDeleteTheme: !isActive && onDeleteTheme,
|
|
1491
1804
|
onSetPreviewTheme: setPreviewTheme
|
|
@@ -1504,62 +1817,63 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1504
1817
|
themeToEdit = _ref.themeToEdit;
|
|
1505
1818
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1506
1819
|
t = _useTranslation.t;
|
|
1507
|
-
|
|
1820
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1821
|
+
if (currentScreen === DESIGN_SCREENS.THEMES) {
|
|
1508
1822
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1509
|
-
className: "neeto-themes-sidebar__header px-
|
|
1823
|
+
className: "neeto-themes-sidebar__header px-6 lg:px-5 xl:px-6",
|
|
1510
1824
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1511
|
-
className: "flex items-center justify-
|
|
1512
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1513
|
-
"data-cy": "customize-themes-back-button",
|
|
1514
|
-
icon: LeftArrow__default["default"],
|
|
1515
|
-
iconPosition: "left",
|
|
1516
|
-
style: "text",
|
|
1517
|
-
tooltipProps: {
|
|
1518
|
-
content: t("neetoThemes.buttons.backToThemes"),
|
|
1519
|
-
position: "top"
|
|
1520
|
-
},
|
|
1521
|
-
onClick: function onClick() {
|
|
1522
|
-
return handleBackPress(themeToEdit);
|
|
1523
|
-
}
|
|
1524
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
1825
|
+
className: "flex items-center justify-between space-x-2",
|
|
1826
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1525
1827
|
"data-cy": "themes-header",
|
|
1526
1828
|
lineHeight: "normal",
|
|
1527
1829
|
style: "h3",
|
|
1528
1830
|
weight: "semibold",
|
|
1529
|
-
children:
|
|
1831
|
+
children: t("neetoThemes.build.leftSideBar.headerTabs.themes")
|
|
1832
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1833
|
+
className: "self-end",
|
|
1834
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1835
|
+
"data-cy": "customize-themes-add-theme-button",
|
|
1836
|
+
icon: Plus,
|
|
1837
|
+
iconPosition: "left",
|
|
1838
|
+
style: "text",
|
|
1839
|
+
tooltipProps: {
|
|
1840
|
+
content: t("neetoThemes.buttons.addNewTheme"),
|
|
1841
|
+
position: "top"
|
|
1842
|
+
},
|
|
1843
|
+
onClick: handleCreateNewTheme
|
|
1844
|
+
})
|
|
1530
1845
|
})]
|
|
1531
1846
|
})
|
|
1532
1847
|
});
|
|
1533
1848
|
}
|
|
1534
1849
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1535
|
-
className: "neeto-themes-sidebar__header px-4
|
|
1850
|
+
className: "neeto-themes-sidebar__header px-4",
|
|
1536
1851
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1537
|
-
className: "flex items-center justify-
|
|
1538
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1852
|
+
className: "flex items-center justify-start space-x-2",
|
|
1853
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1854
|
+
"data-cy": "customize-themes-back-button",
|
|
1855
|
+
icon: LeftArrow,
|
|
1856
|
+
iconPosition: "left",
|
|
1857
|
+
style: "text",
|
|
1858
|
+
tooltipProps: {
|
|
1859
|
+
content: isCustomCssScreen ? t("neetoThemes.buttons.backToEdit") : t("neetoThemes.buttons.backToThemes"),
|
|
1860
|
+
position: "top"
|
|
1861
|
+
},
|
|
1862
|
+
onClick: function onClick() {
|
|
1863
|
+
return handleBackPress(themeToEdit);
|
|
1864
|
+
}
|
|
1865
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
|
|
1539
1866
|
"data-cy": "themes-header",
|
|
1540
1867
|
lineHeight: "normal",
|
|
1541
1868
|
style: "h3",
|
|
1542
1869
|
weight: "semibold",
|
|
1543
|
-
children: t("neetoThemes.build.leftSideBar.
|
|
1544
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1545
|
-
className: "self-end",
|
|
1546
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
1547
|
-
"data-cy": "customize-themes-add-theme-button",
|
|
1548
|
-
icon: Plus__default["default"],
|
|
1549
|
-
iconPosition: "left",
|
|
1550
|
-
style: "text",
|
|
1551
|
-
tooltipProps: {
|
|
1552
|
-
content: t("neetoThemes.buttons.addNewTheme"),
|
|
1553
|
-
position: "top"
|
|
1554
|
-
},
|
|
1555
|
-
onClick: handleCreateNewTheme
|
|
1556
|
-
})
|
|
1870
|
+
children: [currentScreen === DESIGN_SCREENS.Customize && (isNewTheme ? t("neetoThemes.build.leftSideBar.themes.createTheme.title") : t("neetoThemes.build.leftSideBar.themes.editTheme.title")), isCustomCssScreen && t("neetoThemes.build.leftSideBar.themes.customCSS")]
|
|
1557
1871
|
})]
|
|
1558
1872
|
})
|
|
1559
1873
|
});
|
|
1560
1874
|
};
|
|
1561
1875
|
|
|
1562
|
-
var MemoizedAlert = /*#__PURE__*/react.memo(
|
|
1876
|
+
var MemoizedAlert = /*#__PURE__*/react.memo(Alert);
|
|
1563
1877
|
var Sidebar = function Sidebar(_ref) {
|
|
1564
1878
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3, _themeToDelete$curren4;
|
|
1565
1879
|
var thumbnail = _ref.thumbnail,
|
|
@@ -1567,21 +1881,31 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1567
1881
|
onApplyThemeSuccess = _ref.onApplyThemeSuccess,
|
|
1568
1882
|
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
|
|
1569
1883
|
var _useState = react.useState(DESIGN_SCREENS.THEMES),
|
|
1570
|
-
_useState2 =
|
|
1884
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1571
1885
|
currentScreen = _useState2[0],
|
|
1572
1886
|
setCurrentScreen = _useState2[1];
|
|
1573
1887
|
var _useState3 = react.useState(false),
|
|
1574
|
-
_useState4 =
|
|
1888
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1575
1889
|
isDeleteAlertOpen = _useState4[0],
|
|
1576
1890
|
setIsDeleteAlertOpen = _useState4[1];
|
|
1577
1891
|
var _useState5 = react.useState(null),
|
|
1578
|
-
_useState6 =
|
|
1892
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1579
1893
|
themeToHighlight = _useState6[0],
|
|
1580
1894
|
setThemeToHighlight = _useState6[1];
|
|
1581
1895
|
var _useState7 = react.useState({}),
|
|
1582
|
-
_useState8 =
|
|
1896
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1583
1897
|
themeBeingApplied = _useState8[0],
|
|
1584
1898
|
setThemeBeingApplied = _useState8[1];
|
|
1899
|
+
var _useBreakpoints = reactUtils.useBreakpoints(),
|
|
1900
|
+
isSize = _useBreakpoints.isSize;
|
|
1901
|
+
var isLargerScreen = !isSize("mobile");
|
|
1902
|
+
var _useState9 = react.useState(!isLargerScreen),
|
|
1903
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
1904
|
+
isThemesSidebarCollapsed = _useState10[0],
|
|
1905
|
+
setIsThemesSidebarCollapsed = _useState10[1];
|
|
1906
|
+
react.useEffect(function () {
|
|
1907
|
+
setIsThemesSidebarCollapsed(!isLargerScreen);
|
|
1908
|
+
}, [isLargerScreen]);
|
|
1585
1909
|
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
1586
1910
|
return {
|
|
1587
1911
|
entityType: store["entityType"],
|
|
@@ -1632,13 +1956,14 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1632
1956
|
});
|
|
1633
1957
|
setThemeBeingApplied({});
|
|
1634
1958
|
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1635
|
-
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0
|
|
1959
|
+
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 ? void 0 : onApplyThemeSuccess(theme);
|
|
1636
1960
|
}
|
|
1637
1961
|
}),
|
|
1638
1962
|
applyTheme = _useApplyTheme.mutate,
|
|
1639
1963
|
isApplyingTheme = _useApplyTheme.isPending;
|
|
1640
1964
|
var themeToDelete = react.useRef(null);
|
|
1641
1965
|
var themeToEdit = react.useRef(null);
|
|
1966
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1642
1967
|
var handleEditTheme = function handleEditTheme(theme) {
|
|
1643
1968
|
themeToEdit.current = theme;
|
|
1644
1969
|
setCurrentScreen(DESIGN_SCREENS.Customize);
|
|
@@ -1658,7 +1983,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1658
1983
|
setThemeState({
|
|
1659
1984
|
previewingTheme: currentTheme
|
|
1660
1985
|
});
|
|
1661
|
-
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1986
|
+
setCurrentScreen(isCustomCssScreen ? DESIGN_SCREENS.Customize : DESIGN_SCREENS.THEMES);
|
|
1662
1987
|
themeToEdit.current = null;
|
|
1663
1988
|
};
|
|
1664
1989
|
var highlightTheme = function highlightTheme(themeToHighlight) {
|
|
@@ -1698,53 +2023,73 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1698
2023
|
}
|
|
1699
2024
|
});
|
|
1700
2025
|
}, [deleteTheme, themeToDelete]);
|
|
1701
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
currentTheme: currentTheme,
|
|
1713
|
-
defaultThemes: defaultThemes,
|
|
1714
|
-
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
1715
|
-
highlightTheme: highlightTheme,
|
|
1716
|
-
isApplyingTheme: isApplyingTheme,
|
|
1717
|
-
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
1718
|
-
onApplyTheme: onApplyTheme,
|
|
1719
|
-
themeBeingApplied: themeBeingApplied,
|
|
1720
|
-
themeToHighlight: themeToHighlight,
|
|
1721
|
-
themes: themes,
|
|
1722
|
-
thumbnail: thumbnail,
|
|
1723
|
-
isLoading: isLoading || isFetchingSchema,
|
|
1724
|
-
onDeleteTheme: handleDelete,
|
|
1725
|
-
onEditTheme: handleEditTheme
|
|
1726
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(Customize, {
|
|
1727
|
-
isApplyingTheme: isApplyingTheme,
|
|
1728
|
-
onApplyTheme: onApplyTheme,
|
|
1729
|
-
onCreateTheme: onCreateTheme,
|
|
1730
|
-
onPropertiesChange: onPropertiesChange,
|
|
1731
|
-
onUpdateThemeSuccess: onUpdateThemeSuccess,
|
|
1732
|
-
theme: themeToEdit.current,
|
|
1733
|
-
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
|
|
1734
|
-
}), /*#__PURE__*/jsxRuntime.jsx(MemoizedAlert, {
|
|
1735
|
-
isOpen: isDeleteAlertOpen,
|
|
1736
|
-
isSubmitting: isDeleting,
|
|
1737
|
-
title: t("neetoThemes.alerts.title.deleteTheme"),
|
|
1738
|
-
message: t("neetoThemes.alerts.message.deleteTheme", {
|
|
1739
|
-
name: (_themeToDelete$curren2 = themeToDelete.current) === null || _themeToDelete$curren2 === void 0 ? void 0 : _themeToDelete$curren2.name,
|
|
1740
|
-
count: (_themeToDelete$curren3 = themeToDelete.current) === null || _themeToDelete$curren3 === void 0 ? void 0 : _themeToDelete$curren3.appliedCount,
|
|
1741
|
-
defaultThemeName: defaultThemeName,
|
|
1742
|
-
entityType: t("neetoThemes.entityType.".concat(entityType.toLowerCase()), {
|
|
1743
|
-
count: (_themeToDelete$curren4 = themeToDelete.current) === null || _themeToDelete$curren4 === void 0 ? void 0 : _themeToDelete$curren4.appliedCount
|
|
1744
|
-
})
|
|
2026
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2027
|
+
children: [!isThemesSidebarCollapsed && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2028
|
+
className: "neeto-themes-sidebar__backdrop",
|
|
2029
|
+
onClick: function onClick() {
|
|
2030
|
+
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
2031
|
+
}
|
|
2032
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2033
|
+
className: classnames("neeto-themes-sidebar neeto-ui-border-gray-200 flex-shrink-0 border-r transition-all duration-300", {
|
|
2034
|
+
"neeto-themes-sidebar--expanded": isCustomCssScreen
|
|
2035
|
+
}, {
|
|
2036
|
+
"neeto-themes-sidebar--collapsed": isThemesSidebarCollapsed
|
|
1745
2037
|
}),
|
|
1746
|
-
|
|
1747
|
-
|
|
2038
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(TitleBar, {
|
|
2039
|
+
currentScreen: currentScreen,
|
|
2040
|
+
handleBackPress: handleBackPress,
|
|
2041
|
+
handleCreateNewTheme: function handleCreateNewTheme() {
|
|
2042
|
+
return handleEditTheme({});
|
|
2043
|
+
},
|
|
2044
|
+
isNewTheme: !((_themeToEdit$current = themeToEdit.current) !== null && _themeToEdit$current !== void 0 && _themeToEdit$current.id),
|
|
2045
|
+
themeToEdit: themeToEdit.current
|
|
2046
|
+
}), currentScreen === DESIGN_SCREENS.THEMES ? /*#__PURE__*/jsxRuntime.jsx(Themes, {
|
|
2047
|
+
currentTheme: currentTheme,
|
|
2048
|
+
defaultThemes: defaultThemes,
|
|
2049
|
+
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
2050
|
+
highlightTheme: highlightTheme,
|
|
2051
|
+
isApplyingTheme: isApplyingTheme,
|
|
2052
|
+
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
2053
|
+
onApplyTheme: onApplyTheme,
|
|
2054
|
+
themeBeingApplied: themeBeingApplied,
|
|
2055
|
+
themeToHighlight: themeToHighlight,
|
|
2056
|
+
themes: themes,
|
|
2057
|
+
thumbnail: thumbnail,
|
|
2058
|
+
isLoading: isLoading || isFetchingSchema,
|
|
2059
|
+
onDeleteTheme: handleDelete,
|
|
2060
|
+
onEditTheme: handleEditTheme
|
|
2061
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Customize, {
|
|
2062
|
+
currentScreen: currentScreen,
|
|
2063
|
+
isApplyingTheme: isApplyingTheme,
|
|
2064
|
+
onApplyTheme: onApplyTheme,
|
|
2065
|
+
onCreateTheme: onCreateTheme,
|
|
2066
|
+
onPropertiesChange: onPropertiesChange,
|
|
2067
|
+
onUpdateThemeSuccess: onUpdateThemeSuccess,
|
|
2068
|
+
theme: themeToEdit.current,
|
|
2069
|
+
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id,
|
|
2070
|
+
onEditCSSClick: setCurrentScreen
|
|
2071
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MemoizedAlert, {
|
|
2072
|
+
isOpen: isDeleteAlertOpen,
|
|
2073
|
+
isSubmitting: isDeleting,
|
|
2074
|
+
title: t("neetoThemes.alerts.title.deleteTheme"),
|
|
2075
|
+
message: t("neetoThemes.alerts.message.deleteTheme", {
|
|
2076
|
+
name: (_themeToDelete$curren2 = themeToDelete.current) === null || _themeToDelete$curren2 === void 0 ? void 0 : _themeToDelete$curren2.name,
|
|
2077
|
+
count: (_themeToDelete$curren3 = themeToDelete.current) === null || _themeToDelete$curren3 === void 0 ? void 0 : _themeToDelete$curren3.appliedCount,
|
|
2078
|
+
defaultThemeName: defaultThemeName,
|
|
2079
|
+
entityType: t("neetoThemes.entityType.".concat(entityType.toLowerCase()), {
|
|
2080
|
+
count: (_themeToDelete$curren4 = themeToDelete.current) === null || _themeToDelete$curren4 === void 0 ? void 0 : _themeToDelete$curren4.appliedCount
|
|
2081
|
+
})
|
|
2082
|
+
}),
|
|
2083
|
+
onClose: handleCloseDeleteAlert,
|
|
2084
|
+
onSubmit: handleDeleteTheme
|
|
2085
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2086
|
+
className: "neeto-themes-sidebar__toggler",
|
|
2087
|
+
icon: Collapse,
|
|
2088
|
+
style: "secondary",
|
|
2089
|
+
onClick: function onClick() {
|
|
2090
|
+
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
2091
|
+
}
|
|
2092
|
+
})]
|
|
1748
2093
|
})]
|
|
1749
2094
|
});
|
|
1750
2095
|
};
|
|
@@ -1815,12 +2160,12 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1815
2160
|
className: "neeto-themes-preview__wrapper",
|
|
1816
2161
|
children: isCurrentThemeLoading ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1817
2162
|
className: "m-auto flex h-full w-full items-center justify-center",
|
|
1818
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
2163
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
1819
2164
|
}) : children
|
|
1820
2165
|
})]
|
|
1821
2166
|
});
|
|
1822
2167
|
};
|
|
1823
|
-
var index = reactUtils.withTitle(NeetoThemesBuilder, i18next.t("neetoThemes.common.
|
|
2168
|
+
var index = reactUtils.withTitle(NeetoThemesBuilder, i18next.t("neetoThemes.common.theme"));
|
|
1824
2169
|
|
|
1825
2170
|
module.exports = index;
|
|
1826
2171
|
//# sourceMappingURL=NeetoThemesBuilder.js.map
|