@bigbinary/neeto-themes-frontend 2.2.0 → 3.0.0
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 +644 -309
- package/dist/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/NeetoThemesBuilder.js +706 -400
- 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 +11 -8
- 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 +11 -6
- 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,24 +8,30 @@ 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
32
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
27
33
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
28
|
-
var
|
|
34
|
+
var ImageUploader = require('@bigbinary/neeto-image-uploader-frontend/ImageUploader');
|
|
29
35
|
var utils$1 = require('@bigbinary/neeto-commons-frontend/utils');
|
|
30
36
|
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
31
37
|
var ramda = require('ramda');
|
|
@@ -34,20 +40,16 @@ var CenterAlign = require('@bigbinary/neeto-icons/CenterAlign');
|
|
|
34
40
|
var LeftAlign = require('@bigbinary/neeto-icons/LeftAlign');
|
|
35
41
|
var ColorPicker = require('@bigbinary/neetoui/ColorPicker');
|
|
36
42
|
var antd = require('antd');
|
|
37
|
-
var classnames = require('classnames');
|
|
38
43
|
var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
|
|
39
|
-
var Switch = require('@bigbinary/neetoui/Switch');
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsdUJBRUUsWUFBQSxDQURBLFVBQUYsQ0FHRSw2Q0FHRSwyQ0FBQSxDQURBLHlCQUFBLENBREEsV0FDSixDQUdJLDBCQUxGLDZDQU1JLFdBQUosQ0FDRixDQUNJLDBCQVJGLDZDQVNJLFdBRUosQ0FDRixDQUFJLDJFQUVFLGtCQUFBLENBREEsZ0JBR04sQ0FDSSwyRUFDRSwwQkFBQSxDQUNBLGVBQ04sQ0FFUSw0SUFDRSxZQUFWLENBTUUsc0RBR0UsV0FBQSxDQURBLHlCQUFBLENBREEsaUJBRkosQ0FRQSw4Q0FDRSxvREFBQSxDQUNBLHlEQUxGLENBUUEsc0NBQ0UsdURBQUEsQ0FDQSw0REFMRixDQVFBLGdEQUNFLG9EQUFBLENBQ0EseURBTE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6IDEgIWltcG9ydGFudDtcbiAgfVxufVxuIl19 */";
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsdUJBRUUsWUFBQSxDQURBLFVBQUYsQ0FHRSw2Q0FHRSwyQ0FBQSxDQURBLFdBQUEsQ0FJQSxNQUFBLENBR0EsZ0JBQUEsQ0FMQSxjQUFBLENBQ0EsS0FBQSxDQUVBLGVBQUEsQ0FOQSxVQUFBLENBT0EsV0FBSixDQUdJLHVEQUVFLGNBQUEsQ0FEQSxxQkFBTixDQUlJLG9DQWhCRiw2Q0FpQkksV0FESixDQUNGLENBR0ksb0NBcEJGLDZDQXVCSSx5QkFBQSxDQUZBLGFBQUEsQ0FDQSxpQkFDSixDQUNGLENBRUkscUNBMUJGLDZDQTJCSSxXQUNKLENBQ0YsQ0FDSSxxQ0E5QkYsNkNBK0JJLFdBRUosQ0FDRixDQUFJLHdEQUVFLFdBQUEsQ0FDQSxXQUFBLENBRkEsT0FJTixDQUFNLHVGQUNFLG1CQUVSLENBQVEsb0NBSEYs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CkpO1xufVxuXG4ubmVldG8tdGhlbWVzLW5hbm8tc2VjdGlvbl9fY29udGVudCB7XG4gICYtLW9wZW4ge1xuICAgIG1heC1oZWlnaHQ6IDE1MDBweDtcbiAgICBvcGFjaXR5OiAxO1xuICAgIHZpc2liaWxpdHk6IHZpc2libGU7XG4gICAgcGFkZGluZy10b3A6IDRweDtcbiAgfVxuICAmLS1jbG9zZWQge1xuICAgIG1heC1oZWlnaHQ6IDBweDtcbiAgICBvcGFjaXR5OiAwO1xuICAgIHZpc2liaWxpdHk6IGhpZGRlbjtcbiAgfVxufVxuXG4ubmVldG8tdGhlbWVzLW5hbm8tc2VjdGlvbl9fdGl0bGU6Zm9jdXMtdmlzaWJsZSB7XG4gIGJveC1zaGFkb3c6IDAgMCAwIDNweCByZ2JhKHZhcigtLW5lZXRvLXVpLXByaW1hcnktNTAwKSwgMTUlKTtcbn1cblxuLm5lZXRvLXRoZW1lcy1uYW5vLWdsb2JhbC10aGVtZS1pY29uIHtcbiAgY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS13YXJuaW5nLTUwMCkpO1xuICBmaWxsOiByZ2IodmFyKC0tbmVldG8tdWktd2FybmluZy0xMDApKTtcbn1cbiJdfQ== */";
|
|
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
|
+
};
|
|
286
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
|
+
};
|
|
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,82 @@ 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;
|
|
295
460
|
switch (kind) {
|
|
296
461
|
case "color":
|
|
297
|
-
return {
|
|
462
|
+
return _objectSpread$4({
|
|
298
463
|
value: defaultValue,
|
|
299
464
|
kind: "color",
|
|
300
465
|
key: key
|
|
301
|
-
}
|
|
466
|
+
}, order !== null && {
|
|
467
|
+
order: order
|
|
468
|
+
});
|
|
302
469
|
case "font_family":
|
|
303
|
-
return {
|
|
470
|
+
return _objectSpread$4({
|
|
304
471
|
value: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
|
305
472
|
kind: "font_family",
|
|
306
473
|
key: key
|
|
307
|
-
}
|
|
474
|
+
}, order !== null && {
|
|
475
|
+
order: order
|
|
476
|
+
});
|
|
308
477
|
case "overlay_opacity":
|
|
309
|
-
return {
|
|
478
|
+
return _objectSpread$4({
|
|
310
479
|
value: 0,
|
|
311
480
|
kind: "overlay_opacity",
|
|
312
481
|
key: key
|
|
313
|
-
}
|
|
482
|
+
}, order !== null && {
|
|
483
|
+
order: order
|
|
484
|
+
});
|
|
314
485
|
case "slider":
|
|
315
|
-
return {
|
|
486
|
+
return _objectSpread$4({
|
|
316
487
|
value: 0,
|
|
317
488
|
kind: "slider",
|
|
318
489
|
key: key
|
|
319
|
-
}
|
|
490
|
+
}, order !== null && {
|
|
491
|
+
order: order
|
|
492
|
+
});
|
|
320
493
|
case "radius":
|
|
321
|
-
return {
|
|
494
|
+
return _objectSpread$4({
|
|
322
495
|
value: defaultValue,
|
|
323
496
|
kind: "radius",
|
|
324
497
|
key: key
|
|
325
|
-
}
|
|
498
|
+
}, order !== null && {
|
|
499
|
+
order: order
|
|
500
|
+
});
|
|
326
501
|
case "boolean":
|
|
327
|
-
return {
|
|
502
|
+
return _objectSpread$4({
|
|
328
503
|
value: String(defaultValue),
|
|
329
504
|
kind: "boolean",
|
|
330
505
|
key: key
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
506
|
+
}, order !== null && {
|
|
507
|
+
order: order
|
|
508
|
+
});
|
|
509
|
+
case "order_selector":
|
|
510
|
+
return _objectSpread$4({
|
|
334
511
|
value: defaultValue,
|
|
335
|
-
kind: "
|
|
512
|
+
kind: "order_selector",
|
|
336
513
|
key: key
|
|
337
|
-
}
|
|
514
|
+
}, order !== null && {
|
|
515
|
+
order: order
|
|
516
|
+
});
|
|
338
517
|
case "alignment_block":
|
|
339
|
-
return {
|
|
518
|
+
return _objectSpread$4({
|
|
340
519
|
value: defaultValue,
|
|
341
520
|
kind: "alignment_block",
|
|
342
521
|
key: key
|
|
343
|
-
}
|
|
522
|
+
}, order !== null && {
|
|
523
|
+
order: order
|
|
524
|
+
});
|
|
525
|
+
case "custom_css":
|
|
526
|
+
return _objectSpread$4({
|
|
527
|
+
value: defaultValue,
|
|
528
|
+
kind: "custom_css",
|
|
529
|
+
key: key
|
|
530
|
+
}, order !== null && {
|
|
531
|
+
order: order
|
|
532
|
+
});
|
|
344
533
|
default:
|
|
345
534
|
return null;
|
|
346
535
|
}
|
|
@@ -383,29 +572,6 @@ var buildLabel = function buildLabel(key, kind) {
|
|
|
383
572
|
return i18next.t("neetoThemes.properties.".concat(neetoCist.snakeToCamelCase(kind), ".").concat(neetoCist.snakeToCamelCase(key)));
|
|
384
573
|
};
|
|
385
574
|
|
|
386
|
-
var Card$2 = function Card(_ref) {
|
|
387
|
-
var _ref$title = _ref.title,
|
|
388
|
-
title = _ref$title === void 0 ? "" : _ref$title,
|
|
389
|
-
children = _ref.children;
|
|
390
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
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
575
|
var SelectBlock = function SelectBlock(_ref) {
|
|
410
576
|
var label = _ref.label,
|
|
411
577
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -414,15 +580,15 @@ var SelectBlock = function SelectBlock(_ref) {
|
|
|
414
580
|
options = _ref.options,
|
|
415
581
|
onChange = _ref.onChange;
|
|
416
582
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
417
|
-
className: "flex items-center justify-between
|
|
583
|
+
className: "flex items-center justify-between",
|
|
418
584
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
419
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
585
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
420
586
|
"data-cy": "logo-field-labels",
|
|
421
587
|
style: "body2",
|
|
422
588
|
children: label
|
|
423
589
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
424
590
|
className: "w-40",
|
|
425
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
591
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
426
592
|
onChange: onChange,
|
|
427
593
|
options: options,
|
|
428
594
|
placeholder: placeholder,
|
|
@@ -432,12 +598,6 @@ var SelectBlock = function SelectBlock(_ref) {
|
|
|
432
598
|
});
|
|
433
599
|
};
|
|
434
600
|
|
|
435
|
-
var DESIGN_SCREENS = {
|
|
436
|
-
THEMES: "Themes",
|
|
437
|
-
Customize: "Customize"
|
|
438
|
-
};
|
|
439
|
-
var ONE_MEGABYTE = 1;
|
|
440
|
-
|
|
441
601
|
var ImageBlock = function ImageBlock(_ref) {
|
|
442
602
|
var _findBy;
|
|
443
603
|
var label = _ref.label,
|
|
@@ -473,9 +633,9 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
473
633
|
key: "".concat(name, "_position")
|
|
474
634
|
}, values.properties);
|
|
475
635
|
var handleImageChange = /*#__PURE__*/function () {
|
|
476
|
-
var _ref2 =
|
|
636
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(image) {
|
|
477
637
|
var dominantColor;
|
|
478
|
-
return
|
|
638
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
479
639
|
while (1) switch (_context.prev = _context.next) {
|
|
480
640
|
case 0:
|
|
481
641
|
_context.prev = 0;
|
|
@@ -503,7 +663,7 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
503
663
|
case 10:
|
|
504
664
|
_context.prev = 10;
|
|
505
665
|
_context.t0 = _context["catch"](0);
|
|
506
|
-
|
|
666
|
+
Toastr.error(_context.t0);
|
|
507
667
|
case 13:
|
|
508
668
|
case "end":
|
|
509
669
|
return _context.stop();
|
|
@@ -515,18 +675,18 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
515
675
|
};
|
|
516
676
|
}();
|
|
517
677
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
518
|
-
className: "space-y-3
|
|
519
|
-
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
678
|
+
className: "space-y-3",
|
|
679
|
+
"data-cy": "theme-style-".concat(label ? utils$1.joinHyphenCase(label) : "image-block"),
|
|
520
680
|
children: [label && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
521
681
|
className: "flex items-center justify-between",
|
|
522
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
682
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
523
683
|
"data-cy": "style-fields-labels",
|
|
524
684
|
style: "body2",
|
|
525
685
|
children: label
|
|
526
686
|
})
|
|
527
687
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
528
|
-
className: "space-y-3
|
|
529
|
-
children: [/*#__PURE__*/react.createElement(
|
|
688
|
+
className: "space-y-3",
|
|
689
|
+
children: [/*#__PURE__*/react.createElement(ImageUploader, {
|
|
530
690
|
uploadConfig: uploadConfig,
|
|
531
691
|
className: "h-40 w-full",
|
|
532
692
|
key: imageData === null || imageData === void 0 ? void 0 : imageData.url,
|
|
@@ -548,21 +708,21 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
548
708
|
};
|
|
549
709
|
|
|
550
710
|
var Images = function Images(_ref) {
|
|
551
|
-
var attribute = _ref.attribute
|
|
711
|
+
var attribute = _ref.attribute,
|
|
712
|
+
className = _ref.className;
|
|
552
713
|
var _useFormikContext = formik.useFormikContext(),
|
|
553
714
|
values = _useFormikContext.values;
|
|
554
715
|
var key = neetoCist.snakeToCamelCase(attribute);
|
|
555
716
|
var title = buildLabel(key, "image");
|
|
556
717
|
var imageData = values[key];
|
|
557
718
|
return /*#__PURE__*/jsxRuntime.jsx(Card$2, {
|
|
719
|
+
className: className,
|
|
558
720
|
title: title,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
name: key
|
|
565
|
-
})
|
|
721
|
+
name: "images",
|
|
722
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ImageBlock, {
|
|
723
|
+
attribute: attribute,
|
|
724
|
+
imageData: imageData,
|
|
725
|
+
name: key
|
|
566
726
|
})
|
|
567
727
|
});
|
|
568
728
|
};
|
|
@@ -571,9 +731,9 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
571
731
|
var label = _ref.label,
|
|
572
732
|
name = _ref.name;
|
|
573
733
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
574
|
-
className: "flex items-center justify-between gap-2
|
|
734
|
+
className: "flex items-center justify-between gap-2",
|
|
575
735
|
"data-cy": utils$1.joinHyphenCase(label),
|
|
576
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
736
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
577
737
|
"data-cy": "style-fields-labels",
|
|
578
738
|
style: "body2",
|
|
579
739
|
children: label
|
|
@@ -583,12 +743,22 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
583
743
|
var value = _ref2.field.value,
|
|
584
744
|
setFieldValue = _ref2.form.setFieldValue;
|
|
585
745
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
586
|
-
className: "flex items-center
|
|
587
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
746
|
+
className: "neeto-ui-border-gray-300 neeto-themes-nano-alignment-block flex items-center border",
|
|
747
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
748
|
+
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-left",
|
|
588
749
|
"data-cy": "alignment-left",
|
|
589
|
-
|
|
590
|
-
size: "large",
|
|
750
|
+
size: "medium",
|
|
591
751
|
style: value === "left" ? "primary" : "text",
|
|
752
|
+
icon: function icon() {
|
|
753
|
+
return /*#__PURE__*/jsxRuntime.jsx(LeftAlign, {
|
|
754
|
+
size: 20,
|
|
755
|
+
className: classnames({
|
|
756
|
+
rounded: true,
|
|
757
|
+
"neeto-ui-text-primary-800": value === "left",
|
|
758
|
+
"neeto-ui-text-gray-600": value !== "left"
|
|
759
|
+
})
|
|
760
|
+
});
|
|
761
|
+
},
|
|
592
762
|
tooltipProps: {
|
|
593
763
|
content: "Left align",
|
|
594
764
|
position: "bottom"
|
|
@@ -596,11 +766,23 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
596
766
|
onClick: function onClick() {
|
|
597
767
|
return setFieldValue(name, "left");
|
|
598
768
|
}
|
|
599
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
769
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
770
|
+
className: "neeto-themes-nano-alignment-divider"
|
|
771
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
772
|
+
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-center",
|
|
600
773
|
"data-cy": "alignment-center",
|
|
601
|
-
|
|
602
|
-
size: "large",
|
|
774
|
+
size: "medium",
|
|
603
775
|
style: value === "center" ? "primary" : "text",
|
|
776
|
+
icon: function icon() {
|
|
777
|
+
return /*#__PURE__*/jsxRuntime.jsx(CenterAlign, {
|
|
778
|
+
size: 20,
|
|
779
|
+
className: classnames({
|
|
780
|
+
rounded: true,
|
|
781
|
+
"neeto-ui-text-primary-800": value === "center",
|
|
782
|
+
"neeto-ui-text-gray-600": value !== "center"
|
|
783
|
+
})
|
|
784
|
+
});
|
|
785
|
+
},
|
|
604
786
|
tooltipProps: {
|
|
605
787
|
content: "Center align",
|
|
606
788
|
position: "bottom"
|
|
@@ -622,23 +804,24 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
622
804
|
onChange = _ref.onChange,
|
|
623
805
|
showTransparencyControl = _ref.showTransparencyControl;
|
|
624
806
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
625
|
-
className: "flex items-center justify-between
|
|
807
|
+
className: "flex items-center justify-between",
|
|
626
808
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
627
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
809
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
628
810
|
"data-cy": "style-fields-labels",
|
|
629
811
|
style: "body2",
|
|
630
812
|
children: label
|
|
631
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
813
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ColorPicker, {
|
|
632
814
|
color: color,
|
|
633
815
|
onChange: onChange,
|
|
634
816
|
showTransparencyControl: showTransparencyControl,
|
|
635
|
-
showEyeDropper: true
|
|
817
|
+
showEyeDropper: true,
|
|
818
|
+
size: "medium"
|
|
636
819
|
})]
|
|
637
820
|
});
|
|
638
821
|
};
|
|
639
822
|
|
|
640
823
|
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) {
|
|
824
|
+
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
825
|
var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
643
826
|
var label = _ref.label,
|
|
644
827
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -647,15 +830,15 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
647
830
|
options = _ref.options,
|
|
648
831
|
onChange = _ref.onChange;
|
|
649
832
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
650
|
-
className: "flex items-center justify-between
|
|
833
|
+
className: "flex items-center justify-between",
|
|
651
834
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
652
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
835
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
653
836
|
"data-cy": "style-fields-labels",
|
|
654
837
|
style: "body2",
|
|
655
838
|
children: label
|
|
656
839
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
657
840
|
className: "w-40",
|
|
658
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
841
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
659
842
|
onChange: onChange,
|
|
660
843
|
options: options,
|
|
661
844
|
placeholder: placeholder,
|
|
@@ -682,9 +865,9 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
682
865
|
max = _ref.max,
|
|
683
866
|
marks = _ref.marks;
|
|
684
867
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
685
|
-
className: "flex items-center justify-between gap-3
|
|
868
|
+
className: "flex items-center justify-between gap-3",
|
|
686
869
|
"data-cy": "theme-style-".concat(utils$1.joinHyphenCase(label)),
|
|
687
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
870
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
688
871
|
"data-cy": "style-fields-labels",
|
|
689
872
|
style: "body2",
|
|
690
873
|
children: label
|
|
@@ -704,33 +887,33 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
704
887
|
|
|
705
888
|
var _excluded = ["label", "name"];
|
|
706
889
|
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) {
|
|
890
|
+
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
891
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
709
892
|
var label = _ref.label,
|
|
710
893
|
name = _ref.name,
|
|
711
|
-
switchProps =
|
|
894
|
+
switchProps = _objectWithoutProperties(_ref, _excluded);
|
|
712
895
|
var _useTranslation = reactI18next.useTranslation(),
|
|
713
896
|
t = _useTranslation.t,
|
|
714
897
|
i18n = _useTranslation.i18n;
|
|
715
898
|
var translationKey = "neetoThemes.properties.boolean.".concat(name, "HelpText");
|
|
716
899
|
var doesHelpTextExist = i18n.exists(translationKey);
|
|
717
900
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
718
|
-
className: "flex items-center justify-between
|
|
901
|
+
className: "flex items-center justify-between",
|
|
719
902
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
720
903
|
className: "inline-flex items-center gap-4",
|
|
721
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
904
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
722
905
|
"data-cy": "style-fields-labels",
|
|
723
906
|
style: "body2",
|
|
724
|
-
className:
|
|
907
|
+
className: classnames({
|
|
725
908
|
"w-32": doesHelpTextExist,
|
|
726
909
|
"w-auto": !doesHelpTextExist
|
|
727
910
|
}),
|
|
728
911
|
children: label
|
|
729
|
-
}), doesHelpTextExist && /*#__PURE__*/jsxRuntime.jsx(
|
|
912
|
+
}), doesHelpTextExist && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
|
|
730
913
|
className: "flex-shrink-0",
|
|
731
914
|
description: t(translationKey)
|
|
732
915
|
})]
|
|
733
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
916
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Switch, _objectSpread$2(_objectSpread$2({}, _objectSpread$2({
|
|
734
917
|
name: name
|
|
735
918
|
}, switchProps)), {}, {
|
|
736
919
|
"data-cy": "enable-background-color-toggle"
|
|
@@ -739,7 +922,8 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
739
922
|
};
|
|
740
923
|
|
|
741
924
|
var Properties = function Properties(_ref) {
|
|
742
|
-
var onPropertiesChange = _ref.onPropertiesChange
|
|
925
|
+
var onPropertiesChange = _ref.onPropertiesChange,
|
|
926
|
+
className = _ref.className;
|
|
743
927
|
var _useTranslation = reactI18next.useTranslation(),
|
|
744
928
|
t = _useTranslation.t;
|
|
745
929
|
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
@@ -790,140 +974,132 @@ var Properties = function Properties(_ref) {
|
|
|
790
974
|
}
|
|
791
975
|
};
|
|
792
976
|
react.useEffect(function () {
|
|
793
|
-
onPropertiesChange === null || onPropertiesChange === void 0
|
|
977
|
+
onPropertiesChange === null || onPropertiesChange === void 0 ? void 0 : onPropertiesChange(values, handleChange, handleColorChange);
|
|
794
978
|
setTheme(values);
|
|
795
979
|
setThemeState({
|
|
796
980
|
previewingTheme: values
|
|
797
981
|
});
|
|
798
982
|
}, [values]);
|
|
799
983
|
return /*#__PURE__*/jsxRuntime.jsx(Card$2, {
|
|
984
|
+
className: className,
|
|
985
|
+
name: "style",
|
|
800
986
|
title: t("neetoThemes.common.style"),
|
|
801
|
-
children:
|
|
802
|
-
|
|
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) {
|
|
987
|
+
children: values.properties.sort(function (a, b) {
|
|
988
|
+
var order = function order(key) {
|
|
823
989
|
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({
|
|
874
|
-
key: key
|
|
875
|
-
}, values.properties);
|
|
876
|
-
var options = (_findBy2 = neetoCist.findBy({
|
|
990
|
+
return ((_findBy = neetoCist.findBy({
|
|
877
991
|
key: key
|
|
878
|
-
}, themePropertiesSchema)) === null ||
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
992
|
+
}, themePropertiesSchema)) === null || _findBy === void 0 ? void 0 : _findBy.order) || Infinity;
|
|
993
|
+
};
|
|
994
|
+
return order(a.key) - order(b.key);
|
|
995
|
+
}).map(function (_ref3) {
|
|
996
|
+
var _findBy2;
|
|
997
|
+
var key = _ref3.key,
|
|
998
|
+
value = _ref3.value,
|
|
999
|
+
kind = _ref3.kind;
|
|
1000
|
+
var isCurrentPropertyVisible = isPropertyVisible(key, values, themePropertiesSchema);
|
|
1001
|
+
if (!isCurrentPropertyVisible) return null;
|
|
1002
|
+
switch (kind) {
|
|
1003
|
+
case "font_family":
|
|
1004
|
+
return /*#__PURE__*/jsxRuntime.jsx(FontPickerBlock, {
|
|
1005
|
+
label: buildLabel(key, kind),
|
|
1006
|
+
options: FONT_OPTIONS,
|
|
1007
|
+
value: neetoCist.findBy({
|
|
1008
|
+
value: value || null
|
|
1009
|
+
}, FONT_OPTIONS),
|
|
1010
|
+
onChange: function onChange(_ref4) {
|
|
1011
|
+
var value = _ref4.value;
|
|
1012
|
+
return handleChange(key, value);
|
|
1013
|
+
}
|
|
1014
|
+
}, key);
|
|
1015
|
+
case "color":
|
|
1016
|
+
return /*#__PURE__*/jsxRuntime.jsx(ColorBlock, {
|
|
1017
|
+
color: value,
|
|
1018
|
+
label: buildLabel(key, kind),
|
|
1019
|
+
showTransparencyControl: ((_findBy2 = neetoCist.findBy({
|
|
1020
|
+
key: key
|
|
1021
|
+
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.showTransparencyControl) || false,
|
|
1022
|
+
onChange: handleColorChange(key)
|
|
1023
|
+
}, key);
|
|
1024
|
+
case "radius":
|
|
1025
|
+
return /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
1026
|
+
label: buildLabel(key, kind),
|
|
1027
|
+
max: 50,
|
|
1028
|
+
min: 0,
|
|
1029
|
+
value: Number(value) || 0,
|
|
1030
|
+
onChange: function onChange(radius) {
|
|
1031
|
+
return handleChange(key, radius, "".concat(radius, "px"));
|
|
1032
|
+
}
|
|
1033
|
+
}, key);
|
|
1034
|
+
case "overlay_opacity":
|
|
1035
|
+
return /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
1036
|
+
label: buildLabel(key, kind),
|
|
1037
|
+
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
1038
|
+
max: HUNDRED,
|
|
1039
|
+
min: ramda.negate(HUNDRED),
|
|
1040
|
+
value: Number(value) || 0,
|
|
1041
|
+
onChange: function onChange(opacity) {
|
|
1042
|
+
return handleOverlayChange(key, opacity);
|
|
1043
|
+
}
|
|
1044
|
+
}, key);
|
|
1045
|
+
case "position_selector":
|
|
1046
|
+
{
|
|
1047
|
+
var _findBy3, _findBy3$options;
|
|
1048
|
+
var index = neetoCist.findIndexBy({
|
|
1049
|
+
key: key
|
|
1050
|
+
}, values.properties);
|
|
1051
|
+
var options = (_findBy3 = neetoCist.findBy({
|
|
1052
|
+
key: key
|
|
1053
|
+
}, themePropertiesSchema)) === null || _findBy3 === void 0 ? void 0 : (_findBy3$options = _findBy3.options) === null || _findBy3$options === void 0 ? void 0 : _findBy3$options.map(neetoCist.toLabelAndValue);
|
|
1054
|
+
return /*#__PURE__*/jsxRuntime.jsx(SelectBlock, {
|
|
1055
|
+
label: buildLabel(key, kind),
|
|
1056
|
+
options: options || POSITION_OPTIONS,
|
|
1057
|
+
placeholder: "left",
|
|
1058
|
+
value: neetoCist.toLabelAndValue(value),
|
|
1059
|
+
onChange: function onChange(option) {
|
|
1060
|
+
return setFieldValue("properties[".concat(index, "].value"), option.value);
|
|
1061
|
+
}
|
|
1062
|
+
}, key);
|
|
886
1063
|
}
|
|
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));
|
|
1064
|
+
case "boolean":
|
|
1065
|
+
{
|
|
1066
|
+
var _index = neetoCist.findIndexBy({
|
|
1067
|
+
key: key
|
|
1068
|
+
}, values.properties);
|
|
1069
|
+
return /*#__PURE__*/jsxRuntime.jsx(SwitchBlock, {
|
|
1070
|
+
checked: value !== "false",
|
|
1071
|
+
label: buildLabel(key, kind),
|
|
1072
|
+
name: neetoCist.snakeToCamelCase(key),
|
|
1073
|
+
onChange: function onChange(e) {
|
|
1074
|
+
return setFieldValue("properties[".concat(_index, "].value"), String(e.target.checked));
|
|
1075
|
+
}
|
|
1076
|
+
}, key);
|
|
903
1077
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
})]
|
|
1078
|
+
case "alignment_block":
|
|
1079
|
+
{
|
|
1080
|
+
var _index2 = neetoCist.findIndexBy({
|
|
1081
|
+
key: key
|
|
1082
|
+
}, values.properties);
|
|
1083
|
+
return /*#__PURE__*/jsxRuntime.jsx(AlignmentBlock, {
|
|
1084
|
+
label: buildLabel(key, kind),
|
|
1085
|
+
name: "properties[".concat(_index2, "].value")
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
default:
|
|
1089
|
+
return null;
|
|
1090
|
+
}
|
|
918
1091
|
})
|
|
919
1092
|
});
|
|
920
1093
|
};
|
|
921
1094
|
|
|
922
1095
|
var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
923
|
-
var t = _ref.t
|
|
1096
|
+
var t = _ref.t,
|
|
1097
|
+
className = _ref.className;
|
|
924
1098
|
return /*#__PURE__*/jsxRuntime.jsx(Card$2, {
|
|
1099
|
+
className: className,
|
|
1100
|
+
name: "name",
|
|
925
1101
|
title: t("neetoThemes.common.name"),
|
|
926
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1102
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
927
1103
|
autoFocus: true,
|
|
928
1104
|
"data-cy": "theme-name-property",
|
|
929
1105
|
name: "name"
|
|
@@ -932,7 +1108,7 @@ var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
|
932
1108
|
});
|
|
933
1109
|
|
|
934
1110
|
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) {
|
|
1111
|
+
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
1112
|
var Customize = function Customize(_ref) {
|
|
937
1113
|
var themeId = _ref.themeId,
|
|
938
1114
|
theme = _ref.theme,
|
|
@@ -940,11 +1116,13 @@ var Customize = function Customize(_ref) {
|
|
|
940
1116
|
onApplyTheme = _ref.onApplyTheme,
|
|
941
1117
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
942
1118
|
onPropertiesChange = _ref.onPropertiesChange,
|
|
943
|
-
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess
|
|
1119
|
+
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess,
|
|
1120
|
+
onEditCSSClick = _ref.onEditCSSClick,
|
|
1121
|
+
currentScreen = _ref.currentScreen;
|
|
944
1122
|
var _useTranslation = reactI18next.useTranslation(),
|
|
945
1123
|
t = _useTranslation.t;
|
|
946
1124
|
var _useState = react.useState({}),
|
|
947
|
-
_useState2 =
|
|
1125
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
948
1126
|
popoverInstance = _useState2[0],
|
|
949
1127
|
setPopoverInstance = _useState2[1];
|
|
950
1128
|
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
@@ -957,6 +1135,12 @@ var Customize = function Customize(_ref) {
|
|
|
957
1135
|
entityType = _useConfigStore.entityType;
|
|
958
1136
|
var _useThemeUtils = useThemeUtils.useThemeUtils(),
|
|
959
1137
|
currentTheme = _useThemeUtils.currentTheme;
|
|
1138
|
+
var _useShowGlobalTheme = useShowGlobalTheme(entityType),
|
|
1139
|
+
_useShowGlobalTheme$d = _useShowGlobalTheme.data,
|
|
1140
|
+
_useShowGlobalTheme$d2 = _useShowGlobalTheme$d === void 0 ? {} : _useShowGlobalTheme$d,
|
|
1141
|
+
_useShowGlobalTheme$d3 = _useShowGlobalTheme$d2.globalTheme,
|
|
1142
|
+
globalTheme = _useShowGlobalTheme$d3 === void 0 ? {} : _useShowGlobalTheme$d3;
|
|
1143
|
+
var isThemeGlobalTheme = (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
|
|
960
1144
|
var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
|
|
961
1145
|
var submitBtnRef = react.useRef(null);
|
|
962
1146
|
var _useCreateTheme = useCreateTheme(),
|
|
@@ -966,12 +1150,18 @@ var Customize = function Customize(_ref) {
|
|
|
966
1150
|
updateTheme = _useUpdateTheme.mutate,
|
|
967
1151
|
isUpdating = _useUpdateTheme.isPending;
|
|
968
1152
|
var isSubmitting = isCreating || isUpdating;
|
|
1153
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1154
|
+
var handleGlobalThemeSwitchChange = function handleGlobalThemeSwitchChange(e, setFieldValue) {
|
|
1155
|
+
setFieldValue("shouldSetAsGlobalTheme", e.target.checked);
|
|
1156
|
+
};
|
|
969
1157
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
970
1158
|
var resetForm = _ref2.resetForm;
|
|
971
1159
|
var imageData = buildImageData(values, themePropertiesSchema);
|
|
972
1160
|
var themeToSave = _objectSpread$1({
|
|
973
1161
|
propertiesAttributes: values.properties,
|
|
974
|
-
name: values.name
|
|
1162
|
+
name: values.name,
|
|
1163
|
+
shouldSetAsGlobalTheme: values.shouldSetAsGlobalTheme,
|
|
1164
|
+
entityType: values.entityType
|
|
975
1165
|
}, imageData);
|
|
976
1166
|
if (!themeId) {
|
|
977
1167
|
return createTheme(themeToSave, {
|
|
@@ -989,41 +1179,81 @@ var Customize = function Customize(_ref) {
|
|
|
989
1179
|
resetForm({
|
|
990
1180
|
values: values
|
|
991
1181
|
});
|
|
992
|
-
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0
|
|
1182
|
+
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 ? void 0 : onUpdateThemeSuccess(values);
|
|
993
1183
|
}
|
|
994
1184
|
});
|
|
995
1185
|
};
|
|
996
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
1186
|
+
return /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
997
1187
|
formikProps: {
|
|
998
|
-
initialValues: buildInitialValues(theme, themePropertiesSchema),
|
|
1188
|
+
initialValues: _objectSpread$1(_objectSpread$1({}, buildInitialValues(theme, themePropertiesSchema)), {}, {
|
|
1189
|
+
shouldSetAsGlobalTheme: isThemeGlobalTheme,
|
|
1190
|
+
entityType: entityType
|
|
1191
|
+
}),
|
|
999
1192
|
validationSchema: THEME_VALIDATION_SCHEMA,
|
|
1193
|
+
enableReinitialize: true,
|
|
1000
1194
|
onSubmit: onSubmit
|
|
1001
1195
|
},
|
|
1002
1196
|
children: function children(_ref4) {
|
|
1003
|
-
var dirty = _ref4.dirty
|
|
1197
|
+
var dirty = _ref4.dirty,
|
|
1198
|
+
values = _ref4.values,
|
|
1199
|
+
setFieldValue = _ref4.setFieldValue;
|
|
1004
1200
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1005
1201
|
className: "neeto-themes-sidebar__scroll",
|
|
1006
1202
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1007
|
-
className: "flex flex-col
|
|
1008
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {
|
|
1009
|
-
|
|
1203
|
+
className: "neeto-themes-sidebar__scroll-content flex flex-grow flex-col px-4 pb-4 lg:px-5",
|
|
1204
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {
|
|
1205
|
+
className: classnames({
|
|
1206
|
+
hidden: isCustomCssScreen
|
|
1207
|
+
})
|
|
1208
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
1209
|
+
onPropertiesChange: onPropertiesChange,
|
|
1210
|
+
className: classnames({
|
|
1211
|
+
hidden: isCustomCssScreen
|
|
1212
|
+
})
|
|
1010
1213
|
}), neetoCist.filterBy({
|
|
1011
1214
|
kind: "image"
|
|
1012
1215
|
}, themePropertiesSchema).map(function (_ref5) {
|
|
1013
1216
|
var key = _ref5.key;
|
|
1014
1217
|
return /*#__PURE__*/jsxRuntime.jsx(Images, {
|
|
1015
|
-
attribute: key
|
|
1218
|
+
attribute: key,
|
|
1219
|
+
className: classnames({
|
|
1220
|
+
hidden: isCustomCssScreen
|
|
1221
|
+
})
|
|
1016
1222
|
}, key);
|
|
1223
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CustomCSS, {
|
|
1224
|
+
currentScreen: currentScreen,
|
|
1225
|
+
onEditCSSClick: onEditCSSClick
|
|
1226
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1227
|
+
className: "neeto-ui-bg-gray-50 neeto-ui-border-gray-200 mt-2 flex flex-col space-y-2 border p-2",
|
|
1228
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Tooltip, {
|
|
1229
|
+
disabled: !isThemeGlobalTheme,
|
|
1230
|
+
content: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.tooltipContent"),
|
|
1231
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Switch, {
|
|
1232
|
+
checked: values.shouldSetAsGlobalTheme,
|
|
1233
|
+
disabled: isThemeGlobalTheme,
|
|
1234
|
+
name: "shouldSetAsGlobalTheme",
|
|
1235
|
+
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.label"),
|
|
1236
|
+
onChange: function onChange(e) {
|
|
1237
|
+
return handleGlobalThemeSwitchChange(e, setFieldValue);
|
|
1238
|
+
}
|
|
1239
|
+
})
|
|
1240
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1241
|
+
className: "text-sm",
|
|
1242
|
+
style: "body2",
|
|
1243
|
+
children: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.helpText", {
|
|
1244
|
+
entityType: entityType
|
|
1245
|
+
})
|
|
1246
|
+
})]
|
|
1017
1247
|
})]
|
|
1018
1248
|
}), /*#__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(
|
|
1249
|
+
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",
|
|
1250
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1021
1251
|
"data-cy": "reset-button",
|
|
1022
1252
|
disabled: !dirty || isSubmitting,
|
|
1023
1253
|
label: t("neetoThemes.buttons.reset"),
|
|
1024
1254
|
style: "text",
|
|
1025
1255
|
type: "reset"
|
|
1026
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1256
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1027
1257
|
"data-cy": "save-changes-button",
|
|
1028
1258
|
disabled: !dirty && (theme === null || theme === void 0 ? void 0 : theme.id) || isSubmitting,
|
|
1029
1259
|
label: t("neetoThemes.buttons.save"),
|
|
@@ -1031,7 +1261,7 @@ var Customize = function Customize(_ref) {
|
|
|
1031
1261
|
ref: submitBtnRef,
|
|
1032
1262
|
type: "submit"
|
|
1033
1263
|
})]
|
|
1034
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1264
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Popover, {
|
|
1035
1265
|
appendTo: function appendTo() {
|
|
1036
1266
|
return document.body;
|
|
1037
1267
|
},
|
|
@@ -1041,16 +1271,16 @@ var Customize = function Customize(_ref) {
|
|
|
1041
1271
|
trigger: "click",
|
|
1042
1272
|
content: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1043
1273
|
className: "flex flex-col items-start gap-2",
|
|
1044
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1274
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1045
1275
|
className: "absolute right-1 top-1 z-0",
|
|
1046
|
-
icon:
|
|
1276
|
+
icon: Close,
|
|
1047
1277
|
size: "small",
|
|
1048
1278
|
style: "text",
|
|
1049
1279
|
onClick: function onClick() {
|
|
1050
1280
|
var _popoverInstance$hide;
|
|
1051
|
-
return popoverInstance === null || popoverInstance === void 0
|
|
1281
|
+
return popoverInstance === null || popoverInstance === void 0 ? void 0 : (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
1052
1282
|
}
|
|
1053
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1283
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1054
1284
|
className: "w-72 pr-5",
|
|
1055
1285
|
style: "body2",
|
|
1056
1286
|
weight: "normal",
|
|
@@ -1063,7 +1293,7 @@ var Customize = function Customize(_ref) {
|
|
|
1063
1293
|
entityType: entityType
|
|
1064
1294
|
}
|
|
1065
1295
|
})
|
|
1066
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1296
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1067
1297
|
disabled: isApplyingTheme,
|
|
1068
1298
|
label: t("neetoThemes.buttons.applyThisTheme"),
|
|
1069
1299
|
loading: isApplyingTheme,
|
|
@@ -1080,7 +1310,7 @@ var Customize = function Customize(_ref) {
|
|
|
1080
1310
|
};
|
|
1081
1311
|
|
|
1082
1312
|
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) {
|
|
1313
|
+
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
1314
|
var Check = function Check(props) {
|
|
1085
1315
|
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread(_objectSpread({
|
|
1086
1316
|
fill: "none",
|
|
@@ -1162,7 +1392,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1162
1392
|
}, shallow.shallow),
|
|
1163
1393
|
_useConfigStore$theme = _useConfigStore.themePropertiesSchema,
|
|
1164
1394
|
themePropertiesSchema = _useConfigStore$theme === void 0 ? [] : _useConfigStore$theme;
|
|
1165
|
-
var _themePropertiesSchem =
|
|
1395
|
+
var _themePropertiesSchem = _slicedToArray(themePropertiesSchema, 2),
|
|
1166
1396
|
colorObject1 = _themePropertiesSchem[0],
|
|
1167
1397
|
colorObject2 = _themePropertiesSchem[1];
|
|
1168
1398
|
var primaryLabel = neetoCist.humanize(colorObject1 === null || colorObject1 === void 0 ? void 0 : colorObject1.key);
|
|
@@ -1182,7 +1412,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1182
1412
|
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.key
|
|
1183
1413
|
}, theme.properties)) === null || _findBy === void 0 ? void 0 : _findBy.value;
|
|
1184
1414
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1185
|
-
className:
|
|
1415
|
+
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg border transition-all duration-300 ease-in-out", {
|
|
1186
1416
|
"neeto-ui-border-gray-400": !active,
|
|
1187
1417
|
"neeto-ui-border-gray-800 neeto-themes-theme-thumbnail--active": active,
|
|
1188
1418
|
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
@@ -1198,7 +1428,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1198
1428
|
className: "neeto-ui-rounded-lg p-3",
|
|
1199
1429
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1200
1430
|
className: "mb-3",
|
|
1201
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1431
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1202
1432
|
style: "h3",
|
|
1203
1433
|
weight: "semibold",
|
|
1204
1434
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -1207,7 +1437,7 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
1207
1437
|
},
|
|
1208
1438
|
children: primaryLabel
|
|
1209
1439
|
})
|
|
1210
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1440
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1211
1441
|
className: "neeto-ui-text-gray-600",
|
|
1212
1442
|
style: "body2",
|
|
1213
1443
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -1239,7 +1469,9 @@ var Card = function Card(_ref) {
|
|
|
1239
1469
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
1240
1470
|
onCloneTheme = _ref.onCloneTheme,
|
|
1241
1471
|
isHighLightedTheme = _ref.isHighLightedTheme,
|
|
1472
|
+
isGlobalTheme = _ref.isGlobalTheme,
|
|
1242
1473
|
onApplyTheme = _ref.onApplyTheme,
|
|
1474
|
+
onApplyGlobalTheme = _ref.onApplyGlobalTheme,
|
|
1243
1475
|
Thumbnail$1 = _ref.thumbnail;
|
|
1244
1476
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1245
1477
|
t = _useTranslation.t;
|
|
@@ -1255,12 +1487,15 @@ var Card = function Card(_ref) {
|
|
|
1255
1487
|
var handleDeleteTheme = function handleDeleteTheme() {
|
|
1256
1488
|
return onDeleteTheme(id, name, appliedCount);
|
|
1257
1489
|
};
|
|
1490
|
+
var handleApplyGlobalTheme = function handleApplyGlobalTheme() {
|
|
1491
|
+
return onApplyGlobalTheme(id);
|
|
1492
|
+
};
|
|
1258
1493
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1259
1494
|
className: "group space-y-2 pt-0.5",
|
|
1260
1495
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
1261
1496
|
id: theme.id,
|
|
1262
1497
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1263
|
-
className:
|
|
1498
|
+
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg cursor-pointer border transition-all duration-300 ease-in-out", {
|
|
1264
1499
|
"neeto-ui-border-gray-200": !active,
|
|
1265
1500
|
"neeto-themes-theme-thumbnail--active": active,
|
|
1266
1501
|
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
@@ -1277,11 +1512,11 @@ var Card = function Card(_ref) {
|
|
|
1277
1512
|
className: "flex-shrink-0",
|
|
1278
1513
|
"data-cy": "active-theme-label"
|
|
1279
1514
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1280
|
-
className:
|
|
1515
|
+
className: classnames({
|
|
1281
1516
|
hidden: !isPreviewing,
|
|
1282
1517
|
"group-hover:block": true
|
|
1283
1518
|
}),
|
|
1284
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1519
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1285
1520
|
className: "neeto-themes-theme-thumbnail__apply-btn flex-shrink-0",
|
|
1286
1521
|
"data-cy": "apply-theme-button",
|
|
1287
1522
|
disabled: isApplyingTheme,
|
|
@@ -1306,14 +1541,20 @@ var Card = function Card(_ref) {
|
|
|
1306
1541
|
theme: theme
|
|
1307
1542
|
})]
|
|
1308
1543
|
}), /*#__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
|
-
|
|
1544
|
+
className: "neeto-ui-border-gray-100 flex items-start justify-between gap-1 border-t p-2",
|
|
1545
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1546
|
+
className: "flex items-center space-x-2",
|
|
1547
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1548
|
+
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
1549
|
+
"data-cy": "theme-name",
|
|
1550
|
+
lineHeight: "snug",
|
|
1551
|
+
style: "body2",
|
|
1552
|
+
children: name
|
|
1553
|
+
}), isGlobalTheme && /*#__PURE__*/jsxRuntime.jsx(Rating, {
|
|
1554
|
+
className: "neeto-themes-nano-global-theme-icon",
|
|
1555
|
+
size: 18
|
|
1556
|
+
})]
|
|
1557
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
1317
1558
|
dropdownButtonProps: {
|
|
1318
1559
|
size: "small"
|
|
1319
1560
|
},
|
|
@@ -1334,6 +1575,12 @@ var Card = function Card(_ref) {
|
|
|
1334
1575
|
"data-cy": "clone-theme-menu-item",
|
|
1335
1576
|
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.clone"),
|
|
1336
1577
|
onClick: handleCloneTheme
|
|
1578
|
+
}, {
|
|
1579
|
+
key: "set-as-global-theme",
|
|
1580
|
+
"data-cy": "set-as-global-theme-menu-item",
|
|
1581
|
+
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.label"),
|
|
1582
|
+
isVisible: !isGlobalTheme,
|
|
1583
|
+
onClick: handleApplyGlobalTheme
|
|
1337
1584
|
}, {
|
|
1338
1585
|
key: "divider",
|
|
1339
1586
|
type: "divider",
|
|
@@ -1383,12 +1630,26 @@ var Themes = function Themes(_ref) {
|
|
|
1383
1630
|
}, shallow.shallow),
|
|
1384
1631
|
setThemeState = _useThemeStore.setThemeState,
|
|
1385
1632
|
previewingTheme = _useThemeStore.previewingTheme;
|
|
1633
|
+
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
1634
|
+
return {
|
|
1635
|
+
entityType: store["entityType"]
|
|
1636
|
+
};
|
|
1637
|
+
}, shallow.shallow),
|
|
1638
|
+
entityType = _useConfigStore.entityType;
|
|
1386
1639
|
var _useState = react.useState(""),
|
|
1387
|
-
_useState2 =
|
|
1640
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1388
1641
|
searchQuery = _useState2[0],
|
|
1389
1642
|
setSearchQuery = _useState2[1];
|
|
1390
1643
|
var _useCloneTheme = useCloneTheme(),
|
|
1391
1644
|
cloneTheme = _useCloneTheme.mutate;
|
|
1645
|
+
var _useApplyGlobalTheme = useApplyGlobalTheme(),
|
|
1646
|
+
applyGlobalTheme = _useApplyGlobalTheme.mutate;
|
|
1647
|
+
var _useShowGlobalTheme = useShowGlobalTheme(entityType),
|
|
1648
|
+
_useShowGlobalTheme$d = _useShowGlobalTheme.data,
|
|
1649
|
+
_useShowGlobalTheme$d2 = _useShowGlobalTheme$d === void 0 ? {} : _useShowGlobalTheme$d,
|
|
1650
|
+
_useShowGlobalTheme$d3 = _useShowGlobalTheme$d2.globalTheme,
|
|
1651
|
+
globalTheme = _useShowGlobalTheme$d3 === void 0 ? {} : _useShowGlobalTheme$d3,
|
|
1652
|
+
isLoadingGlobalTheme = _useShowGlobalTheme.isLoading;
|
|
1392
1653
|
react.useEffect(function () {
|
|
1393
1654
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
1394
1655
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -1417,35 +1678,44 @@ var Themes = function Themes(_ref) {
|
|
|
1417
1678
|
}
|
|
1418
1679
|
});
|
|
1419
1680
|
};
|
|
1420
|
-
|
|
1681
|
+
var handleApplyGlobalTheme = function handleApplyGlobalTheme(themeId) {
|
|
1682
|
+
var payload = {
|
|
1683
|
+
entityType: entityType
|
|
1684
|
+
};
|
|
1685
|
+
applyGlobalTheme({
|
|
1686
|
+
themeId: themeId,
|
|
1687
|
+
payload: payload
|
|
1688
|
+
});
|
|
1689
|
+
};
|
|
1690
|
+
if (isLoading || isCurrentThemeLoading || isLoadingGlobalTheme) {
|
|
1421
1691
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1422
1692
|
className: "flex h-full w-full items-center justify-center",
|
|
1423
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1693
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
1424
1694
|
});
|
|
1425
1695
|
}
|
|
1426
1696
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1427
1697
|
className: "neeto-themes-sidebar__scroll",
|
|
1428
1698
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1429
1699
|
className: "mb-6 space-y-3",
|
|
1430
|
-
children: [isSearchFieldVisible && /*#__PURE__*/jsxRuntime.jsx(
|
|
1700
|
+
children: [isSearchFieldVisible && /*#__PURE__*/jsxRuntime.jsx(Search, {
|
|
1431
1701
|
autoFocus: true,
|
|
1432
1702
|
autoComplete: "off",
|
|
1433
1703
|
className: "mb-4 mt-1 px-6",
|
|
1434
1704
|
placeholder: t("neetoThemes.common.searchThemes"),
|
|
1435
1705
|
onSearch: setSearchQuery
|
|
1436
|
-
}), ramda.isEmpty(filteredThemes) && ramda.isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsx(
|
|
1706
|
+
}), ramda.isEmpty(filteredThemes) && ramda.isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1437
1707
|
className: "text-center",
|
|
1438
1708
|
style: "body2",
|
|
1439
1709
|
children: t("neetoThemes.common.noResultsFound")
|
|
1440
1710
|
}), neetoCist.isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1441
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1442
|
-
className: "my-4 px-
|
|
1711
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1712
|
+
className: "my-4 px-6 uppercase lg:px-5 xl:px-6",
|
|
1443
1713
|
"data-cy": "system-themes-header",
|
|
1444
1714
|
style: "h6",
|
|
1445
1715
|
weight: "semibold",
|
|
1446
1716
|
children: t("neetoThemes.build.leftSideBar.themes.systemThemes")
|
|
1447
1717
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1448
|
-
className: "flex flex-col gap-4 px-
|
|
1718
|
+
className: "flex flex-col gap-4 px-6 pb-10 lg:px-5 xl:px-6",
|
|
1449
1719
|
"data-cy": "system-themes",
|
|
1450
1720
|
children: filteredDefaultThemes.map(function (theme) {
|
|
1451
1721
|
return /*#__PURE__*/react.createElement(Card$1, {
|
|
@@ -1453,9 +1723,11 @@ var Themes = function Themes(_ref) {
|
|
|
1453
1723
|
theme: theme,
|
|
1454
1724
|
thumbnail: thumbnail,
|
|
1455
1725
|
active: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id,
|
|
1726
|
+
isGlobalTheme: (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === theme.id,
|
|
1456
1727
|
isPreviewing: (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id,
|
|
1457
1728
|
key: theme.id,
|
|
1458
1729
|
isApplyingTheme: isApplyingTheme && (themeBeingApplied === null || themeBeingApplied === void 0 ? void 0 : themeBeingApplied.id) === theme.id,
|
|
1730
|
+
onApplyGlobalTheme: handleApplyGlobalTheme,
|
|
1459
1731
|
onCloneTheme: handleCloneTheme,
|
|
1460
1732
|
onSetPreviewTheme: setPreviewTheme
|
|
1461
1733
|
});
|
|
@@ -1464,7 +1736,7 @@ var Themes = function Themes(_ref) {
|
|
|
1464
1736
|
})]
|
|
1465
1737
|
}), neetoCist.isNotEmpty(filteredThemes) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1466
1738
|
className: "mb-6 space-y-3",
|
|
1467
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1739
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1468
1740
|
className: "my-4 px-6 uppercase",
|
|
1469
1741
|
"data-cy": "custom-themes-header",
|
|
1470
1742
|
style: "h6",
|
|
@@ -1483,9 +1755,11 @@ var Themes = function Themes(_ref) {
|
|
|
1483
1755
|
theme: theme,
|
|
1484
1756
|
thumbnail: thumbnail,
|
|
1485
1757
|
active: isActive,
|
|
1758
|
+
isGlobalTheme: (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === theme.id,
|
|
1486
1759
|
isHighLightedTheme: theme.id === themeToHighlight,
|
|
1487
1760
|
key: theme.id,
|
|
1488
1761
|
isApplyingTheme: isApplyingTheme && (themeBeingApplied === null || themeBeingApplied === void 0 ? void 0 : themeBeingApplied.id) === theme.id,
|
|
1762
|
+
onApplyGlobalTheme: handleApplyGlobalTheme,
|
|
1489
1763
|
onCloneTheme: handleCloneTheme,
|
|
1490
1764
|
onDeleteTheme: !isActive && onDeleteTheme,
|
|
1491
1765
|
onSetPreviewTheme: setPreviewTheme
|
|
@@ -1504,62 +1778,63 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1504
1778
|
themeToEdit = _ref.themeToEdit;
|
|
1505
1779
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1506
1780
|
t = _useTranslation.t;
|
|
1507
|
-
|
|
1781
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1782
|
+
if (currentScreen === DESIGN_SCREENS.THEMES) {
|
|
1508
1783
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1509
|
-
className: "neeto-themes-sidebar__header px-
|
|
1784
|
+
className: "neeto-themes-sidebar__header px-6 lg:px-5 xl:px-6",
|
|
1510
1785
|
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"], {
|
|
1786
|
+
className: "flex items-center justify-between space-x-2",
|
|
1787
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
1525
1788
|
"data-cy": "themes-header",
|
|
1526
1789
|
lineHeight: "normal",
|
|
1527
1790
|
style: "h3",
|
|
1528
1791
|
weight: "semibold",
|
|
1529
|
-
children:
|
|
1792
|
+
children: t("neetoThemes.build.leftSideBar.headerTabs.themes")
|
|
1793
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1794
|
+
className: "self-end",
|
|
1795
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1796
|
+
"data-cy": "customize-themes-add-theme-button",
|
|
1797
|
+
icon: Plus,
|
|
1798
|
+
iconPosition: "left",
|
|
1799
|
+
style: "text",
|
|
1800
|
+
tooltipProps: {
|
|
1801
|
+
content: t("neetoThemes.buttons.addNewTheme"),
|
|
1802
|
+
position: "top"
|
|
1803
|
+
},
|
|
1804
|
+
onClick: handleCreateNewTheme
|
|
1805
|
+
})
|
|
1530
1806
|
})]
|
|
1531
1807
|
})
|
|
1532
1808
|
});
|
|
1533
1809
|
}
|
|
1534
1810
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1535
|
-
className: "neeto-themes-sidebar__header px-4
|
|
1811
|
+
className: "neeto-themes-sidebar__header px-4",
|
|
1536
1812
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1537
|
-
className: "flex items-center justify-
|
|
1538
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
1813
|
+
className: "flex items-center justify-start space-x-2",
|
|
1814
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1815
|
+
"data-cy": "customize-themes-back-button",
|
|
1816
|
+
icon: LeftArrow,
|
|
1817
|
+
iconPosition: "left",
|
|
1818
|
+
style: "text",
|
|
1819
|
+
tooltipProps: {
|
|
1820
|
+
content: isCustomCssScreen ? t("neetoThemes.buttons.backToEdit") : t("neetoThemes.buttons.backToThemes"),
|
|
1821
|
+
position: "top"
|
|
1822
|
+
},
|
|
1823
|
+
onClick: function onClick() {
|
|
1824
|
+
return handleBackPress(themeToEdit);
|
|
1825
|
+
}
|
|
1826
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
|
|
1539
1827
|
"data-cy": "themes-header",
|
|
1540
1828
|
lineHeight: "normal",
|
|
1541
1829
|
style: "h3",
|
|
1542
1830
|
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
|
-
})
|
|
1831
|
+
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
1832
|
})]
|
|
1558
1833
|
})
|
|
1559
1834
|
});
|
|
1560
1835
|
};
|
|
1561
1836
|
|
|
1562
|
-
var MemoizedAlert = /*#__PURE__*/react.memo(
|
|
1837
|
+
var MemoizedAlert = /*#__PURE__*/react.memo(Alert);
|
|
1563
1838
|
var Sidebar = function Sidebar(_ref) {
|
|
1564
1839
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3, _themeToDelete$curren4;
|
|
1565
1840
|
var thumbnail = _ref.thumbnail,
|
|
@@ -1567,21 +1842,31 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1567
1842
|
onApplyThemeSuccess = _ref.onApplyThemeSuccess,
|
|
1568
1843
|
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess;
|
|
1569
1844
|
var _useState = react.useState(DESIGN_SCREENS.THEMES),
|
|
1570
|
-
_useState2 =
|
|
1845
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1571
1846
|
currentScreen = _useState2[0],
|
|
1572
1847
|
setCurrentScreen = _useState2[1];
|
|
1573
1848
|
var _useState3 = react.useState(false),
|
|
1574
|
-
_useState4 =
|
|
1849
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1575
1850
|
isDeleteAlertOpen = _useState4[0],
|
|
1576
1851
|
setIsDeleteAlertOpen = _useState4[1];
|
|
1577
1852
|
var _useState5 = react.useState(null),
|
|
1578
|
-
_useState6 =
|
|
1853
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1579
1854
|
themeToHighlight = _useState6[0],
|
|
1580
1855
|
setThemeToHighlight = _useState6[1];
|
|
1581
1856
|
var _useState7 = react.useState({}),
|
|
1582
|
-
_useState8 =
|
|
1857
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1583
1858
|
themeBeingApplied = _useState8[0],
|
|
1584
1859
|
setThemeBeingApplied = _useState8[1];
|
|
1860
|
+
var _useBreakpoints = reactUtils.useBreakpoints(),
|
|
1861
|
+
isSize = _useBreakpoints.isSize;
|
|
1862
|
+
var isLargerScreen = !isSize("mobile");
|
|
1863
|
+
var _useState9 = react.useState(!isLargerScreen),
|
|
1864
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
1865
|
+
isThemesSidebarCollapsed = _useState10[0],
|
|
1866
|
+
setIsThemesSidebarCollapsed = _useState10[1];
|
|
1867
|
+
react.useEffect(function () {
|
|
1868
|
+
setIsThemesSidebarCollapsed(!isLargerScreen);
|
|
1869
|
+
}, [isLargerScreen]);
|
|
1585
1870
|
var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
|
|
1586
1871
|
return {
|
|
1587
1872
|
entityType: store["entityType"],
|
|
@@ -1632,13 +1917,14 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1632
1917
|
});
|
|
1633
1918
|
setThemeBeingApplied({});
|
|
1634
1919
|
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1635
|
-
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0
|
|
1920
|
+
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 ? void 0 : onApplyThemeSuccess(theme);
|
|
1636
1921
|
}
|
|
1637
1922
|
}),
|
|
1638
1923
|
applyTheme = _useApplyTheme.mutate,
|
|
1639
1924
|
isApplyingTheme = _useApplyTheme.isPending;
|
|
1640
1925
|
var themeToDelete = react.useRef(null);
|
|
1641
1926
|
var themeToEdit = react.useRef(null);
|
|
1927
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1642
1928
|
var handleEditTheme = function handleEditTheme(theme) {
|
|
1643
1929
|
themeToEdit.current = theme;
|
|
1644
1930
|
setCurrentScreen(DESIGN_SCREENS.Customize);
|
|
@@ -1658,7 +1944,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1658
1944
|
setThemeState({
|
|
1659
1945
|
previewingTheme: currentTheme
|
|
1660
1946
|
});
|
|
1661
|
-
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1947
|
+
setCurrentScreen(isCustomCssScreen ? DESIGN_SCREENS.Customize : DESIGN_SCREENS.THEMES);
|
|
1662
1948
|
themeToEdit.current = null;
|
|
1663
1949
|
};
|
|
1664
1950
|
var highlightTheme = function highlightTheme(themeToHighlight) {
|
|
@@ -1698,53 +1984,73 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1698
1984
|
}
|
|
1699
1985
|
});
|
|
1700
1986
|
}, [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
|
-
})
|
|
1987
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1988
|
+
children: [!isThemesSidebarCollapsed && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1989
|
+
className: "neeto-themes-sidebar__backdrop",
|
|
1990
|
+
onClick: function onClick() {
|
|
1991
|
+
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
1992
|
+
}
|
|
1993
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1994
|
+
className: classnames("neeto-themes-sidebar neeto-ui-border-gray-200 flex-shrink-0 border-r transition-all duration-300", {
|
|
1995
|
+
"neeto-themes-sidebar--expanded": isCustomCssScreen
|
|
1996
|
+
}, {
|
|
1997
|
+
"neeto-themes-sidebar--collapsed": isThemesSidebarCollapsed
|
|
1745
1998
|
}),
|
|
1746
|
-
|
|
1747
|
-
|
|
1999
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(TitleBar, {
|
|
2000
|
+
currentScreen: currentScreen,
|
|
2001
|
+
handleBackPress: handleBackPress,
|
|
2002
|
+
handleCreateNewTheme: function handleCreateNewTheme() {
|
|
2003
|
+
return handleEditTheme({});
|
|
2004
|
+
},
|
|
2005
|
+
isNewTheme: !((_themeToEdit$current = themeToEdit.current) !== null && _themeToEdit$current !== void 0 && _themeToEdit$current.id),
|
|
2006
|
+
themeToEdit: themeToEdit.current
|
|
2007
|
+
}), currentScreen === DESIGN_SCREENS.THEMES ? /*#__PURE__*/jsxRuntime.jsx(Themes, {
|
|
2008
|
+
currentTheme: currentTheme,
|
|
2009
|
+
defaultThemes: defaultThemes,
|
|
2010
|
+
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
2011
|
+
highlightTheme: highlightTheme,
|
|
2012
|
+
isApplyingTheme: isApplyingTheme,
|
|
2013
|
+
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
2014
|
+
onApplyTheme: onApplyTheme,
|
|
2015
|
+
themeBeingApplied: themeBeingApplied,
|
|
2016
|
+
themeToHighlight: themeToHighlight,
|
|
2017
|
+
themes: themes,
|
|
2018
|
+
thumbnail: thumbnail,
|
|
2019
|
+
isLoading: isLoading || isFetchingSchema,
|
|
2020
|
+
onDeleteTheme: handleDelete,
|
|
2021
|
+
onEditTheme: handleEditTheme
|
|
2022
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Customize, {
|
|
2023
|
+
currentScreen: currentScreen,
|
|
2024
|
+
isApplyingTheme: isApplyingTheme,
|
|
2025
|
+
onApplyTheme: onApplyTheme,
|
|
2026
|
+
onCreateTheme: onCreateTheme,
|
|
2027
|
+
onPropertiesChange: onPropertiesChange,
|
|
2028
|
+
onUpdateThemeSuccess: onUpdateThemeSuccess,
|
|
2029
|
+
theme: themeToEdit.current,
|
|
2030
|
+
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id,
|
|
2031
|
+
onEditCSSClick: setCurrentScreen
|
|
2032
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MemoizedAlert, {
|
|
2033
|
+
isOpen: isDeleteAlertOpen,
|
|
2034
|
+
isSubmitting: isDeleting,
|
|
2035
|
+
title: t("neetoThemes.alerts.title.deleteTheme"),
|
|
2036
|
+
message: t("neetoThemes.alerts.message.deleteTheme", {
|
|
2037
|
+
name: (_themeToDelete$curren2 = themeToDelete.current) === null || _themeToDelete$curren2 === void 0 ? void 0 : _themeToDelete$curren2.name,
|
|
2038
|
+
count: (_themeToDelete$curren3 = themeToDelete.current) === null || _themeToDelete$curren3 === void 0 ? void 0 : _themeToDelete$curren3.appliedCount,
|
|
2039
|
+
defaultThemeName: defaultThemeName,
|
|
2040
|
+
entityType: t("neetoThemes.entityType.".concat(entityType.toLowerCase()), {
|
|
2041
|
+
count: (_themeToDelete$curren4 = themeToDelete.current) === null || _themeToDelete$curren4 === void 0 ? void 0 : _themeToDelete$curren4.appliedCount
|
|
2042
|
+
})
|
|
2043
|
+
}),
|
|
2044
|
+
onClose: handleCloseDeleteAlert,
|
|
2045
|
+
onSubmit: handleDeleteTheme
|
|
2046
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2047
|
+
className: "neeto-themes-sidebar__toggler",
|
|
2048
|
+
icon: Collapse,
|
|
2049
|
+
style: "secondary",
|
|
2050
|
+
onClick: function onClick() {
|
|
2051
|
+
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
2052
|
+
}
|
|
2053
|
+
})]
|
|
1748
2054
|
})]
|
|
1749
2055
|
});
|
|
1750
2056
|
};
|
|
@@ -1815,12 +2121,12 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1815
2121
|
className: "neeto-themes-preview__wrapper",
|
|
1816
2122
|
children: isCurrentThemeLoading ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1817
2123
|
className: "m-auto flex h-full w-full items-center justify-center",
|
|
1818
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
2124
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
1819
2125
|
}) : children
|
|
1820
2126
|
})]
|
|
1821
2127
|
});
|
|
1822
2128
|
};
|
|
1823
|
-
var index = reactUtils.withTitle(NeetoThemesBuilder, i18next.t("neetoThemes.common.
|
|
2129
|
+
var index = reactUtils.withTitle(NeetoThemesBuilder, i18next.t("neetoThemes.common.theme"));
|
|
1824
2130
|
|
|
1825
2131
|
module.exports = index;
|
|
1826
2132
|
//# sourceMappingURL=NeetoThemesBuilder.js.map
|