@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
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
import { shallow } from 'zustand/shallow';
|
|
2
|
-
import { createElement, useEffect,
|
|
2
|
+
import { useState, createElement, useEffect, useRef, memo, useCallback } from 'react';
|
|
3
3
|
import { t as t$1 } from 'i18next';
|
|
4
|
-
import {
|
|
5
|
-
import { useMutationWithInvalidation, withT, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
|
+
import { hyphenate, findBy, findIndexBy, isPresent, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
|
|
5
|
+
import { useMutationWithInvalidation, withT, useBreakpoints, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
6
6
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
7
7
|
import { useQuery } from '@tanstack/react-query';
|
|
8
8
|
import axios from 'axios';
|
|
9
|
-
import { B as BASE_URL,
|
|
10
|
-
import { Q as QUERY_KEYS, a as useConfigStore, b as useThemeStore, u as useThemeUtils } from './useThemeUtils-
|
|
9
|
+
import { B as BASE_URL, b as scrollElementIntoView, c as setCustomCSS, g as getDominantColorFromUrl, i as isFunction } from './index-CvV1tFYS.js';
|
|
10
|
+
import { Q as QUERY_KEYS, a as useConfigStore, b as useThemeStore, u as useThemeUtils } from './useThemeUtils-BCO-i9ZG.js';
|
|
11
11
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
12
|
+
import classnames from 'classnames';
|
|
13
|
+
import Collapse from '@bigbinary/neeto-icons/Collapse';
|
|
12
14
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
15
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
13
16
|
import { useTranslation, Trans } from 'react-i18next';
|
|
14
17
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
15
18
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
16
19
|
import Close from '@bigbinary/neeto-icons/Close';
|
|
17
|
-
import Button from '@bigbinary/neetoui/Button';
|
|
18
20
|
import Popover from '@bigbinary/neetoui/Popover';
|
|
19
21
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
22
|
+
import Switch from '@bigbinary/neetoui/Switch';
|
|
23
|
+
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
20
24
|
import Form from '@bigbinary/neetoui/formik/Form';
|
|
21
25
|
import * as yup from 'yup';
|
|
26
|
+
import Editor from '@monaco-editor/react';
|
|
22
27
|
import { useFormikContext, Field } from 'formik';
|
|
28
|
+
import Down from '@bigbinary/neeto-icons/Down';
|
|
23
29
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
24
30
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
25
31
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
26
|
-
import
|
|
32
|
+
import ImageUploader from '@bigbinary/neeto-image-uploader-frontend/ImageUploader';
|
|
27
33
|
import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
28
34
|
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
29
35
|
import { isEmpty, negate } from 'ramda';
|
|
@@ -32,21 +38,20 @@ import CenterAlign from '@bigbinary/neeto-icons/CenterAlign';
|
|
|
32
38
|
import LeftAlign from '@bigbinary/neeto-icons/LeftAlign';
|
|
33
39
|
import ColorPicker from '@bigbinary/neetoui/ColorPicker';
|
|
34
40
|
import { Slider } from 'antd';
|
|
35
|
-
import classnames from 'classnames';
|
|
36
41
|
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
37
|
-
import Switch from '@bigbinary/neetoui/Switch';
|
|
38
42
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
39
43
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
44
|
+
import Rating from '@bigbinary/neeto-icons/Rating';
|
|
40
45
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
41
46
|
import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
|
|
42
47
|
import Plus from '@bigbinary/neeto-icons/Plus';
|
|
43
48
|
import 'zustand';
|
|
44
49
|
|
|
45
|
-
var show$
|
|
50
|
+
var show$2 = function show(entityId) {
|
|
46
51
|
return axios.get("".concat(BASE_URL, "/api/v1/entities/").concat(entityId));
|
|
47
52
|
};
|
|
48
53
|
var entitiesApi = {
|
|
49
|
-
show: show$
|
|
54
|
+
show: show$2
|
|
50
55
|
};
|
|
51
56
|
|
|
52
57
|
var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
@@ -61,7 +66,7 @@ var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
|
61
66
|
|
|
62
67
|
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}}
|
|
63
68
|
|
|
64
|
-
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsdUJBRUUsWUFBQSxDQURBLFVBQUYsQ0FHRSw2Q0FHRSwyQ0FBQSxDQURBLHlCQUFBLENBREEsV0FDSixDQUdJLDBCQUxGLDZDQU1JLFdBQUosQ0FDRixDQUNJLDBCQVJGLDZDQVNJLFdBRUosQ0FDRixDQUFJLDJFQUVFLGtCQUFBLENBREEsZ0JBR04sQ0FDSSwyRUFDRSwwQkFBQSxDQUNBLGVBQ04sQ0FFUSw0SUFDRSxZQUFWLENBTUUsc0RBR0UsV0FBQSxDQURBLHlCQUFBLENBREEsaUJBRkosQ0FRQSw4Q0FDRSxvREFBQSxDQUNBLHlEQUxGLENBUUEsc0NBQ0UsdURBQUEsQ0FDQSw0REFMRixDQVFBLGdEQUNFLG9EQUFBLENBQ0EseURBTEYsQ0FRQSx5Q0FDRSw2QkFBQSxDQUNBLGtDQUxGLENBTUUscUdBRUUsbUJBTEoiLCJzb3VyY2VzQ29udGVudCI6WyJAaW1wb3J0IFwiLi4vYWJzdHJhY3RzL3ZhcmlhYmxlc1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O1xuICAgIGZsZXgtZ3JvdzogMTtcbiAgfVxufVxuXG4ubmVldG8tdGhlbWVzLXRoZW1lLXRodW1ibmFpbC0tcHJldmlldy1hY3RpdmUge1xuICBib3JkZXItY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTYwMCkpICFpbXBvcnRhbnQ7XG4gIG91dGxpbmU6IDFweCBzb2xpZCByZ2IodmFyKC0tbmVldG8tdWktZ3JheS02MDApKSAhaW1wb3J0YW50O1xufVxuXG4ubmVldG8tdGhlbWVzLXRoZW1lLXRodW1ibmFpbC0tYWN0aXZlIHtcbiAgYm9yZGVyLWNvbG9yOiByZ2IodmFyKC0tbmVldG8tdWktcHJpbWFyeS01MDApKSAhaW1wb3J0YW50O1xuICBvdXRsaW5lOiAycHggc29saWQgcmdiKHZhcigtLW5lZXRvLXVpLXByaW1hcnktNTAwKSkgIWltcG9ydGFudDtcbn1cblxuLm5lZXRvLXRoZW1lcy10aGVtZS10aHVtYm5haWwtLWhpZ2hsaWdodC1hY3RpdmUge1xuICBib3JkZXItY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTQwMCkpICFpbXBvcnRhbnQ7XG4gIG91dGxpbmU6IDJweCBzb2xpZCByZ2IodmFyKC0tbmVldG8tdWktZ3JheS00MDApKSAhaW1wb3J0YW50O1xufVxuXG4ubmVldG8tdGhlbWVzLXRoZW1lLXRodW1ibmFpbF9fYXBwbHktYnRuIHtcbiAgLS1uZWV0by11aS1idG4tcGFkZGluZy14OiAxMnB4O1xuICAtLW5lZXRvLXVpLWJ0bi1ib3JkZXItcmFkaXVzOiAxMDBweDtcbiAgJjpkaXNhYmxlZCxcbiAgJltkaXNhYmxlZF0ge1xuICAgIG9wYWNpdHk6IDEgIWltcG9ydGFudDtcbiAgfVxufVxuIl19 */";
|
|
69
|
+
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsdUJBRUUsWUFBQSxDQURBLFVBQUYsQ0FHRSw2Q0FHRSwyQ0FBQSxDQURBLFdBQUEsQ0FJQSxNQUFBLENBR0EsZ0JBQUEsQ0FMQSxjQUFBLENBQ0EsS0FBQSxDQUVBLGVBQUEsQ0FOQSxVQUFBLENBT0EsV0FBSixDQUdJLHVEQUVFLGNBQUEsQ0FEQSxxQkFBTixDQUlJLG9DQWhCRiw2Q0FpQkksV0FESixDQUNGLENBR0ksb0NBcEJGLDZDQXVCSSx5QkFBQSxDQUZBLGFBQUEsQ0FDQSxpQkFDSixDQUNGLENBRUkscUNBMUJGLDZDQTJCSSxXQUNKLENBQ0YsQ0FDSSxxQ0E5QkYsNkNBK0JJLFdBRUosQ0FDRixDQUFJLHdEQUVFLFdBQUEsQ0FDQSxXQUFBLENBRkEsT0FJTixDQUFNLHVGQUNFLG1CQUVSLENBQVEsb0NBSEYsdUZBSUksU0FHUixDQUNGLENBRFEsb0NBUEYsdUZBU0ksUUFBQSxDQURBLFVBS1IsQ0FDRixDQURNLHNGQUNFLFlBR1IsQ0FDSSwyRUFFRSxrQkFBQSxDQURBLGdCQUVOLENBRUksMk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AgIHZpc2liaWxpdHk6IHZpc2libGU7XG4gICAgcGFkZGluZy10b3A6IDRweDtcbiAgfVxuICAmLS1jbG9zZWQge1xuICAgIG1heC1oZWlnaHQ6IDBweDtcbiAgICBvcGFjaXR5OiAwO1xuICAgIHZpc2liaWxpdHk6IGhpZGRlbjtcbiAgfVxufVxuXG4ubmVldG8tdGhlbWVzLW5hbm8tc2VjdGlvbl9fdGl0bGU6Zm9jdXMtdmlzaWJsZSB7XG4gIGJveC1zaGFkb3c6IDAgMCAwIDNweCByZ2JhKHZhcigtLW5lZXRvLXVpLXByaW1hcnktNTAwKSwgMTUlKTtcbn1cblxuLm5lZXRvLXRoZW1lcy1uYW5vLWdsb2JhbC10aGVtZS1pY29uIHtcbiAgY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS13YXJuaW5nLTUwMCkpO1xuICBmaWxsOiByZ2IodmFyKC0tbmVldG8tdWktd2FybmluZy0xMDApKTtcbn1cbiJdfQ== */";
|
|
65
70
|
n(css,{});
|
|
66
71
|
|
|
67
72
|
var _excluded$1 = ["themeId"];
|
|
@@ -72,7 +77,7 @@ var list = function list(entityId) {
|
|
|
72
77
|
}
|
|
73
78
|
});
|
|
74
79
|
};
|
|
75
|
-
var show = function show(id) {
|
|
80
|
+
var show$1 = function show(id) {
|
|
76
81
|
return axios.get("".concat(BASE_URL, "/api/v1/themes/").concat(id));
|
|
77
82
|
};
|
|
78
83
|
var create = function create(payload) {
|
|
@@ -100,14 +105,22 @@ var apply = function apply(_ref2) {
|
|
|
100
105
|
entity: payload
|
|
101
106
|
});
|
|
102
107
|
};
|
|
108
|
+
var applyGlobalTheme = function applyGlobalTheme(_ref3) {
|
|
109
|
+
var themeId = _ref3.themeId,
|
|
110
|
+
payload = _ref3.payload;
|
|
111
|
+
return axios.post("".concat(BASE_URL, "/api/v1/themes/").concat(themeId, "/apply_global_theme"), {
|
|
112
|
+
theme: payload
|
|
113
|
+
});
|
|
114
|
+
};
|
|
103
115
|
var themesApi = {
|
|
104
116
|
list: list,
|
|
105
|
-
show: show,
|
|
117
|
+
show: show$1,
|
|
106
118
|
create: create,
|
|
107
119
|
update: update,
|
|
108
120
|
destroy: destroy,
|
|
109
121
|
clone: clone,
|
|
110
|
-
apply: apply
|
|
122
|
+
apply: apply,
|
|
123
|
+
applyGlobalTheme: applyGlobalTheme
|
|
111
124
|
};
|
|
112
125
|
|
|
113
126
|
var useListThemes = function useListThemes(entityId) {
|
|
@@ -127,7 +140,7 @@ var useListThemes = function useListThemes(entityId) {
|
|
|
127
140
|
};
|
|
128
141
|
var useCreateTheme = function useCreateTheme() {
|
|
129
142
|
return useMutationWithInvalidation(themesApi.create, {
|
|
130
|
-
keysToInvalidate: [QUERY_KEYS.THEMES_LIST]
|
|
143
|
+
keysToInvalidate: [[QUERY_KEYS.THEMES_LIST], [QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
131
144
|
});
|
|
132
145
|
};
|
|
133
146
|
var useUpdateTheme = function useUpdateTheme(themeId) {
|
|
@@ -137,7 +150,7 @@ var useUpdateTheme = function useUpdateTheme(themeId) {
|
|
|
137
150
|
payload: payload
|
|
138
151
|
});
|
|
139
152
|
}, {
|
|
140
|
-
keysToInvalidate: [[QUERY_KEYS.THEMES_LIST], [QUERY_KEYS.THEME_ENTITY_DETAILS], [QUERY_KEYS.THEME_DETAILS, themeId]]
|
|
153
|
+
keysToInvalidate: [[QUERY_KEYS.THEMES_LIST], [QUERY_KEYS.THEME_ENTITY_DETAILS], [QUERY_KEYS.THEME_DETAILS, themeId], [QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
141
154
|
});
|
|
142
155
|
};
|
|
143
156
|
var useDeleteTheme = function useDeleteTheme() {
|
|
@@ -157,6 +170,32 @@ var useApplyTheme = function useApplyTheme(_ref) {
|
|
|
157
170
|
onSuccess: onSuccess
|
|
158
171
|
});
|
|
159
172
|
};
|
|
173
|
+
var useApplyGlobalTheme = function useApplyGlobalTheme() {
|
|
174
|
+
return useMutationWithInvalidation(themesApi.applyGlobalTheme, {
|
|
175
|
+
keysToInvalidate: [[QUERY_KEYS.GLOBAL_THEME_DETAILS]]
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
var show = function show(entityType) {
|
|
180
|
+
return axios.get("".concat(BASE_URL, "/api/v1/global_theme"), {
|
|
181
|
+
params: {
|
|
182
|
+
entity_type: entityType
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
var globalThemesApi = {
|
|
187
|
+
show: show
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
var useShowGlobalTheme = function useShowGlobalTheme(entityType) {
|
|
191
|
+
return useQuery({
|
|
192
|
+
queryKey: [QUERY_KEYS.GLOBAL_THEME_DETAILS, entityType],
|
|
193
|
+
queryFn: function queryFn() {
|
|
194
|
+
return globalThemesApi.show(entityType);
|
|
195
|
+
},
|
|
196
|
+
enabled: !!entityType
|
|
197
|
+
});
|
|
198
|
+
};
|
|
160
199
|
|
|
161
200
|
var POSITION_OPTIONS = [{
|
|
162
201
|
label: "Left",
|
|
@@ -225,6 +264,12 @@ var FONT_OPTIONS = [{
|
|
|
225
264
|
}, {
|
|
226
265
|
label: "Dancing Script",
|
|
227
266
|
value: "Dancing Script, cursive"
|
|
267
|
+
}, {
|
|
268
|
+
label: "Tw Cent",
|
|
269
|
+
value: "Tw Cen MT, Tahoma, sans-serif"
|
|
270
|
+
}, {
|
|
271
|
+
label: "Comic Sans",
|
|
272
|
+
value: "Comic Sans MS, cursive"
|
|
228
273
|
}];
|
|
229
274
|
var THEME_VALIDATION_SCHEMA = yup.object().shape({
|
|
230
275
|
name: yup.string().required("Name is required")
|
|
@@ -233,7 +278,154 @@ var OVERLAY_OPACITY_SLIDER_MARKS = {
|
|
|
233
278
|
0: " "
|
|
234
279
|
};
|
|
235
280
|
var HUNDRED = 100;
|
|
281
|
+
var ACCORDIAN_OPEN_STATE = {
|
|
282
|
+
name: true,
|
|
283
|
+
style: true,
|
|
284
|
+
images: false,
|
|
285
|
+
customcss: false
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
var DESIGN_SCREENS = {
|
|
289
|
+
THEMES: "Themes",
|
|
290
|
+
Customize: "Customize",
|
|
291
|
+
CustomCSS: "CustomCSS"
|
|
292
|
+
};
|
|
293
|
+
var ONE_MEGABYTE = 1;
|
|
236
294
|
|
|
295
|
+
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; }
|
|
296
|
+
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; }
|
|
297
|
+
var Card$2 = function Card(_ref) {
|
|
298
|
+
var _ref$title = _ref.title,
|
|
299
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
300
|
+
children = _ref.children,
|
|
301
|
+
name = _ref.name,
|
|
302
|
+
className = _ref.className;
|
|
303
|
+
var _useState = useState(ACCORDIAN_OPEN_STATE),
|
|
304
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
305
|
+
accordianOpenState = _useState2[0],
|
|
306
|
+
setAccordianOpenState = _useState2[1];
|
|
307
|
+
return /*#__PURE__*/jsxs("div", {
|
|
308
|
+
"data-cy": "theme-".concat(hyphenate(title), "-properties"),
|
|
309
|
+
className: classnames("neeto-themes-nano-section neeto-ui-border-gray-200 border-b pt-2 transition-all duration-300 last:border-none", className, {
|
|
310
|
+
"pb-2": !accordianOpenState[name],
|
|
311
|
+
"pb-3": accordianOpenState[name]
|
|
312
|
+
}),
|
|
313
|
+
children: [title && /*#__PURE__*/jsxs("button", {
|
|
314
|
+
className: "neeto-themes-nano-section__title flex w-full cursor-pointer items-center justify-between px-1 py-2 focus:outline-none",
|
|
315
|
+
type: "button",
|
|
316
|
+
onClick: function onClick() {
|
|
317
|
+
return setAccordianOpenState(_objectSpread$5(_objectSpread$5({}, accordianOpenState), {}, _defineProperty({}, name, !accordianOpenState[name])));
|
|
318
|
+
},
|
|
319
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
320
|
+
className: "min-w-0 flex-grow text-left",
|
|
321
|
+
component: "span",
|
|
322
|
+
"data-cy": "theme-properties",
|
|
323
|
+
lineHeight: "normal",
|
|
324
|
+
style: "h4",
|
|
325
|
+
weight: "semibold",
|
|
326
|
+
children: title
|
|
327
|
+
}), /*#__PURE__*/jsx(Down, {
|
|
328
|
+
size: 20,
|
|
329
|
+
className: classnames("transition-all duration-300", {
|
|
330
|
+
"rotate-180": accordianOpenState[name]
|
|
331
|
+
})
|
|
332
|
+
})]
|
|
333
|
+
}), children && /*#__PURE__*/jsx("div", {
|
|
334
|
+
className: classnames("neeto-themes-nano-section__content w-full space-y-3 overflow-hidden px-1 transition-all duration-300", {
|
|
335
|
+
"neeto-themes-nano-section__content--closed": !accordianOpenState[name],
|
|
336
|
+
"neeto-themes-nano-section__content--open pb-1": accordianOpenState[name]
|
|
337
|
+
}),
|
|
338
|
+
children: children
|
|
339
|
+
})]
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
var isScreenCustomCSS = function isScreenCustomCSS(screen) {
|
|
344
|
+
return screen === DESIGN_SCREENS.CustomCSS;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
var CustomCSS = function CustomCSS(_ref) {
|
|
348
|
+
var onEditCSSClick = _ref.onEditCSSClick,
|
|
349
|
+
currentScreen = _ref.currentScreen;
|
|
350
|
+
var _useTranslation = useTranslation(),
|
|
351
|
+
t = _useTranslation.t;
|
|
352
|
+
var _useFormikContext = useFormikContext(),
|
|
353
|
+
values = _useFormikContext.values,
|
|
354
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
355
|
+
var _useConfigStore = useConfigStore(function (store) {
|
|
356
|
+
return {
|
|
357
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
358
|
+
};
|
|
359
|
+
}, shallow),
|
|
360
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
361
|
+
var customCSS = findBy({
|
|
362
|
+
kind: "custom_css"
|
|
363
|
+
}, values.properties);
|
|
364
|
+
if (!customCSS) return null;
|
|
365
|
+
var parentElementClass = findBy({
|
|
366
|
+
kind: "custom_css"
|
|
367
|
+
}, themePropertiesSchema).parentClass;
|
|
368
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
369
|
+
var handleEditorToggle = function handleEditorToggle() {
|
|
370
|
+
if (!isCustomCssScreen) return onEditCSSClick(DESIGN_SCREENS.CustomCSS);
|
|
371
|
+
onEditCSSClick(DESIGN_SCREENS.Customize);
|
|
372
|
+
return setTimeout(function () {
|
|
373
|
+
scrollElementIntoView("css-editor");
|
|
374
|
+
}, 400);
|
|
375
|
+
};
|
|
376
|
+
var handleChange = function handleChange(value) {
|
|
377
|
+
var index = findIndexBy({
|
|
378
|
+
key: customCSS.key
|
|
379
|
+
}, values.properties);
|
|
380
|
+
if (index !== -1 && values.properties[index].value !== value) {
|
|
381
|
+
setFieldValue("properties[".concat(index, "].value"), value);
|
|
382
|
+
setCustomCSS({
|
|
383
|
+
css: value,
|
|
384
|
+
elementId: customCSS.key,
|
|
385
|
+
parentElementClass: parentElementClass
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
return /*#__PURE__*/jsx("div", {
|
|
390
|
+
className: "neeto-themes-sidebar__custom-css-wrapper",
|
|
391
|
+
id: "css-editor",
|
|
392
|
+
children: /*#__PURE__*/jsx(Card$2, {
|
|
393
|
+
name: "customcss",
|
|
394
|
+
title: isCustomCssScreen ? "" : t("neetoThemes.build.leftSideBar.themes.customCSS"),
|
|
395
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
396
|
+
className: "w-full",
|
|
397
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
398
|
+
className: "neeto-themes-sidebar__custom-css-editor-header w-full justify-end gap-1 rounded-b-none p-2",
|
|
399
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
400
|
+
size: "small",
|
|
401
|
+
style: "secondary",
|
|
402
|
+
label: isCustomCssScreen ? t("neetoThemes.buttons.minimizeEditor") : t("neetoThemes.buttons.expandEditor"),
|
|
403
|
+
onClick: handleEditorToggle
|
|
404
|
+
})
|
|
405
|
+
}), /*#__PURE__*/jsx(Editor, {
|
|
406
|
+
language: "css",
|
|
407
|
+
theme: "vs-dark",
|
|
408
|
+
value: customCSS.value,
|
|
409
|
+
className: classnames({
|
|
410
|
+
rounded: true,
|
|
411
|
+
"css-editor-height__expanded": isCustomCssScreen,
|
|
412
|
+
"css-editor-height__regular": !isCustomCssScreen
|
|
413
|
+
}),
|
|
414
|
+
options: {
|
|
415
|
+
scrollBeyondLastLine: false,
|
|
416
|
+
minimap: {
|
|
417
|
+
enabled: false
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
onChange: handleChange
|
|
421
|
+
})]
|
|
422
|
+
})
|
|
423
|
+
})
|
|
424
|
+
});
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
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; }
|
|
428
|
+
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; }
|
|
237
429
|
var buildInitialValues = function buildInitialValues(theme, themePropertiesSchema) {
|
|
238
430
|
if (isPresent(theme)) return theme;
|
|
239
431
|
return {
|
|
@@ -241,56 +433,82 @@ var buildInitialValues = function buildInitialValues(theme, themePropertiesSchem
|
|
|
241
433
|
properties: themePropertiesSchema.map(function (_ref) {
|
|
242
434
|
var key = _ref.key,
|
|
243
435
|
kind = _ref.kind,
|
|
244
|
-
defaultValue = _ref.defaultValue
|
|
436
|
+
defaultValue = _ref.defaultValue,
|
|
437
|
+
_ref$order = _ref.order,
|
|
438
|
+
order = _ref$order === void 0 ? null : _ref$order;
|
|
245
439
|
switch (kind) {
|
|
246
440
|
case "color":
|
|
247
|
-
return {
|
|
441
|
+
return _objectSpread$4({
|
|
248
442
|
value: defaultValue,
|
|
249
443
|
kind: "color",
|
|
250
444
|
key: key
|
|
251
|
-
}
|
|
445
|
+
}, order !== null && {
|
|
446
|
+
order: order
|
|
447
|
+
});
|
|
252
448
|
case "font_family":
|
|
253
|
-
return {
|
|
449
|
+
return _objectSpread$4({
|
|
254
450
|
value: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
|
255
451
|
kind: "font_family",
|
|
256
452
|
key: key
|
|
257
|
-
}
|
|
453
|
+
}, order !== null && {
|
|
454
|
+
order: order
|
|
455
|
+
});
|
|
258
456
|
case "overlay_opacity":
|
|
259
|
-
return {
|
|
457
|
+
return _objectSpread$4({
|
|
260
458
|
value: 0,
|
|
261
459
|
kind: "overlay_opacity",
|
|
262
460
|
key: key
|
|
263
|
-
}
|
|
461
|
+
}, order !== null && {
|
|
462
|
+
order: order
|
|
463
|
+
});
|
|
264
464
|
case "slider":
|
|
265
|
-
return {
|
|
465
|
+
return _objectSpread$4({
|
|
266
466
|
value: 0,
|
|
267
467
|
kind: "slider",
|
|
268
468
|
key: key
|
|
269
|
-
}
|
|
469
|
+
}, order !== null && {
|
|
470
|
+
order: order
|
|
471
|
+
});
|
|
270
472
|
case "radius":
|
|
271
|
-
return {
|
|
473
|
+
return _objectSpread$4({
|
|
272
474
|
value: defaultValue,
|
|
273
475
|
kind: "radius",
|
|
274
476
|
key: key
|
|
275
|
-
}
|
|
477
|
+
}, order !== null && {
|
|
478
|
+
order: order
|
|
479
|
+
});
|
|
276
480
|
case "boolean":
|
|
277
|
-
return {
|
|
481
|
+
return _objectSpread$4({
|
|
278
482
|
value: String(defaultValue),
|
|
279
483
|
kind: "boolean",
|
|
280
484
|
key: key
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
485
|
+
}, order !== null && {
|
|
486
|
+
order: order
|
|
487
|
+
});
|
|
488
|
+
case "order_selector":
|
|
489
|
+
return _objectSpread$4({
|
|
284
490
|
value: defaultValue,
|
|
285
|
-
kind: "
|
|
491
|
+
kind: "order_selector",
|
|
286
492
|
key: key
|
|
287
|
-
}
|
|
493
|
+
}, order !== null && {
|
|
494
|
+
order: order
|
|
495
|
+
});
|
|
288
496
|
case "alignment_block":
|
|
289
|
-
return {
|
|
497
|
+
return _objectSpread$4({
|
|
290
498
|
value: defaultValue,
|
|
291
499
|
kind: "alignment_block",
|
|
292
500
|
key: key
|
|
293
|
-
}
|
|
501
|
+
}, order !== null && {
|
|
502
|
+
order: order
|
|
503
|
+
});
|
|
504
|
+
case "custom_css":
|
|
505
|
+
return _objectSpread$4({
|
|
506
|
+
value: defaultValue,
|
|
507
|
+
kind: "custom_css",
|
|
508
|
+
key: key
|
|
509
|
+
}, order !== null && {
|
|
510
|
+
order: order
|
|
511
|
+
});
|
|
294
512
|
default:
|
|
295
513
|
return null;
|
|
296
514
|
}
|
|
@@ -333,29 +551,6 @@ var buildLabel = function buildLabel(key, kind) {
|
|
|
333
551
|
return t$1("neetoThemes.properties.".concat(snakeToCamelCase(kind), ".").concat(snakeToCamelCase(key)));
|
|
334
552
|
};
|
|
335
553
|
|
|
336
|
-
var Card$2 = function Card(_ref) {
|
|
337
|
-
var _ref$title = _ref.title,
|
|
338
|
-
title = _ref$title === void 0 ? "" : _ref$title,
|
|
339
|
-
children = _ref.children;
|
|
340
|
-
return /*#__PURE__*/jsxs("div", {
|
|
341
|
-
className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white space-y-3 border p-4",
|
|
342
|
-
"data-cy": "theme-".concat(hyphenate(title), "-properties"),
|
|
343
|
-
children: [title && /*#__PURE__*/jsx("div", {
|
|
344
|
-
className: "flex items-center justify-between",
|
|
345
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
346
|
-
"data-cy": "theme-properties",
|
|
347
|
-
lineHeight: "normal",
|
|
348
|
-
style: "h4",
|
|
349
|
-
weight: "semibold",
|
|
350
|
-
children: title
|
|
351
|
-
})
|
|
352
|
-
}), children && /*#__PURE__*/jsx("div", {
|
|
353
|
-
className: "space-y-4",
|
|
354
|
-
children: children
|
|
355
|
-
})]
|
|
356
|
-
});
|
|
357
|
-
};
|
|
358
|
-
|
|
359
554
|
var SelectBlock = function SelectBlock(_ref) {
|
|
360
555
|
var label = _ref.label,
|
|
361
556
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -364,7 +559,7 @@ var SelectBlock = function SelectBlock(_ref) {
|
|
|
364
559
|
options = _ref.options,
|
|
365
560
|
onChange = _ref.onChange;
|
|
366
561
|
return /*#__PURE__*/jsxs("div", {
|
|
367
|
-
className: "flex items-center justify-between
|
|
562
|
+
className: "flex items-center justify-between",
|
|
368
563
|
"data-cy": "theme-style-".concat(joinHyphenCase(label)),
|
|
369
564
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
370
565
|
"data-cy": "logo-field-labels",
|
|
@@ -382,12 +577,6 @@ var SelectBlock = function SelectBlock(_ref) {
|
|
|
382
577
|
});
|
|
383
578
|
};
|
|
384
579
|
|
|
385
|
-
var DESIGN_SCREENS = {
|
|
386
|
-
THEMES: "Themes",
|
|
387
|
-
Customize: "Customize"
|
|
388
|
-
};
|
|
389
|
-
var ONE_MEGABYTE = 1;
|
|
390
|
-
|
|
391
580
|
var ImageBlock = function ImageBlock(_ref) {
|
|
392
581
|
var _findBy;
|
|
393
582
|
var label = _ref.label,
|
|
@@ -423,7 +612,7 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
423
612
|
key: "".concat(name, "_position")
|
|
424
613
|
}, values.properties);
|
|
425
614
|
var handleImageChange = /*#__PURE__*/function () {
|
|
426
|
-
var _ref2 = _asyncToGenerator(
|
|
615
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(image) {
|
|
427
616
|
var dominantColor;
|
|
428
617
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
429
618
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -465,8 +654,8 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
465
654
|
};
|
|
466
655
|
}();
|
|
467
656
|
return /*#__PURE__*/jsxs("div", {
|
|
468
|
-
className: "space-y-3
|
|
469
|
-
"data-cy": "theme-style-".concat(joinHyphenCase(label)),
|
|
657
|
+
className: "space-y-3",
|
|
658
|
+
"data-cy": "theme-style-".concat(label ? joinHyphenCase(label) : "image-block"),
|
|
470
659
|
children: [label && /*#__PURE__*/jsx("div", {
|
|
471
660
|
className: "flex items-center justify-between",
|
|
472
661
|
children: /*#__PURE__*/jsx(Typography, {
|
|
@@ -475,7 +664,7 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
475
664
|
children: label
|
|
476
665
|
})
|
|
477
666
|
}), /*#__PURE__*/jsxs("div", {
|
|
478
|
-
className: "space-y-3
|
|
667
|
+
className: "space-y-3",
|
|
479
668
|
children: [/*#__PURE__*/createElement(ImageUploader, {
|
|
480
669
|
uploadConfig: uploadConfig,
|
|
481
670
|
className: "h-40 w-full",
|
|
@@ -498,21 +687,21 @@ var ImageBlock = function ImageBlock(_ref) {
|
|
|
498
687
|
};
|
|
499
688
|
|
|
500
689
|
var Images = function Images(_ref) {
|
|
501
|
-
var attribute = _ref.attribute
|
|
690
|
+
var attribute = _ref.attribute,
|
|
691
|
+
className = _ref.className;
|
|
502
692
|
var _useFormikContext = useFormikContext(),
|
|
503
693
|
values = _useFormikContext.values;
|
|
504
694
|
var key = snakeToCamelCase(attribute);
|
|
505
695
|
var title = buildLabel(key, "image");
|
|
506
696
|
var imageData = values[key];
|
|
507
697
|
return /*#__PURE__*/jsx(Card$2, {
|
|
698
|
+
className: className,
|
|
508
699
|
title: title,
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
name: key
|
|
515
|
-
})
|
|
700
|
+
name: "images",
|
|
701
|
+
children: /*#__PURE__*/jsx(ImageBlock, {
|
|
702
|
+
attribute: attribute,
|
|
703
|
+
imageData: imageData,
|
|
704
|
+
name: key
|
|
516
705
|
})
|
|
517
706
|
});
|
|
518
707
|
};
|
|
@@ -521,7 +710,7 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
521
710
|
var label = _ref.label,
|
|
522
711
|
name = _ref.name;
|
|
523
712
|
return /*#__PURE__*/jsxs("div", {
|
|
524
|
-
className: "flex items-center justify-between gap-2
|
|
713
|
+
className: "flex items-center justify-between gap-2",
|
|
525
714
|
"data-cy": joinHyphenCase(label),
|
|
526
715
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
527
716
|
"data-cy": "style-fields-labels",
|
|
@@ -533,12 +722,22 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
533
722
|
var value = _ref2.field.value,
|
|
534
723
|
setFieldValue = _ref2.form.setFieldValue;
|
|
535
724
|
return /*#__PURE__*/jsxs("div", {
|
|
536
|
-
className: "flex items-center
|
|
725
|
+
className: "neeto-ui-border-gray-300 neeto-themes-nano-alignment-block flex items-center border",
|
|
537
726
|
children: [/*#__PURE__*/jsx(Button, {
|
|
727
|
+
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-left",
|
|
538
728
|
"data-cy": "alignment-left",
|
|
539
|
-
|
|
540
|
-
size: "large",
|
|
729
|
+
size: "medium",
|
|
541
730
|
style: value === "left" ? "primary" : "text",
|
|
731
|
+
icon: function icon() {
|
|
732
|
+
return /*#__PURE__*/jsx(LeftAlign, {
|
|
733
|
+
size: 20,
|
|
734
|
+
className: classnames({
|
|
735
|
+
rounded: true,
|
|
736
|
+
"neeto-ui-text-primary-800": value === "left",
|
|
737
|
+
"neeto-ui-text-gray-600": value !== "left"
|
|
738
|
+
})
|
|
739
|
+
});
|
|
740
|
+
},
|
|
542
741
|
tooltipProps: {
|
|
543
742
|
content: "Left align",
|
|
544
743
|
position: "bottom"
|
|
@@ -546,11 +745,23 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
|
|
|
546
745
|
onClick: function onClick() {
|
|
547
746
|
return setFieldValue(name, "left");
|
|
548
747
|
}
|
|
748
|
+
}), /*#__PURE__*/jsx("div", {
|
|
749
|
+
className: "neeto-themes-nano-alignment-divider"
|
|
549
750
|
}), /*#__PURE__*/jsx(Button, {
|
|
751
|
+
className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-center",
|
|
550
752
|
"data-cy": "alignment-center",
|
|
551
|
-
|
|
552
|
-
size: "large",
|
|
753
|
+
size: "medium",
|
|
553
754
|
style: value === "center" ? "primary" : "text",
|
|
755
|
+
icon: function icon() {
|
|
756
|
+
return /*#__PURE__*/jsx(CenterAlign, {
|
|
757
|
+
size: 20,
|
|
758
|
+
className: classnames({
|
|
759
|
+
rounded: true,
|
|
760
|
+
"neeto-ui-text-primary-800": value === "center",
|
|
761
|
+
"neeto-ui-text-gray-600": value !== "center"
|
|
762
|
+
})
|
|
763
|
+
});
|
|
764
|
+
},
|
|
554
765
|
tooltipProps: {
|
|
555
766
|
content: "Center align",
|
|
556
767
|
position: "bottom"
|
|
@@ -572,7 +783,7 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
572
783
|
onChange = _ref.onChange,
|
|
573
784
|
showTransparencyControl = _ref.showTransparencyControl;
|
|
574
785
|
return /*#__PURE__*/jsxs("div", {
|
|
575
|
-
className: "flex items-center justify-between
|
|
786
|
+
className: "flex items-center justify-between",
|
|
576
787
|
"data-cy": "theme-style-".concat(joinHyphenCase(label)),
|
|
577
788
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
578
789
|
"data-cy": "style-fields-labels",
|
|
@@ -582,7 +793,8 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
582
793
|
color: color,
|
|
583
794
|
onChange: onChange,
|
|
584
795
|
showTransparencyControl: showTransparencyControl,
|
|
585
|
-
showEyeDropper: true
|
|
796
|
+
showEyeDropper: true,
|
|
797
|
+
size: "medium"
|
|
586
798
|
})]
|
|
587
799
|
});
|
|
588
800
|
};
|
|
@@ -597,7 +809,7 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
597
809
|
options = _ref.options,
|
|
598
810
|
onChange = _ref.onChange;
|
|
599
811
|
return /*#__PURE__*/jsxs("div", {
|
|
600
|
-
className: "flex items-center justify-between
|
|
812
|
+
className: "flex items-center justify-between",
|
|
601
813
|
"data-cy": "theme-style-".concat(joinHyphenCase(label)),
|
|
602
814
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
603
815
|
"data-cy": "style-fields-labels",
|
|
@@ -632,7 +844,7 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
632
844
|
max = _ref.max,
|
|
633
845
|
marks = _ref.marks;
|
|
634
846
|
return /*#__PURE__*/jsxs("div", {
|
|
635
|
-
className: "flex items-center justify-between gap-3
|
|
847
|
+
className: "flex items-center justify-between gap-3",
|
|
636
848
|
"data-cy": "theme-style-".concat(joinHyphenCase(label)),
|
|
637
849
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
638
850
|
"data-cy": "style-fields-labels",
|
|
@@ -665,7 +877,7 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
665
877
|
var translationKey = "neetoThemes.properties.boolean.".concat(name, "HelpText");
|
|
666
878
|
var doesHelpTextExist = i18n.exists(translationKey);
|
|
667
879
|
return /*#__PURE__*/jsxs("div", {
|
|
668
|
-
className: "flex items-center justify-between
|
|
880
|
+
className: "flex items-center justify-between",
|
|
669
881
|
children: [/*#__PURE__*/jsxs("div", {
|
|
670
882
|
className: "inline-flex items-center gap-4",
|
|
671
883
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
@@ -689,7 +901,8 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
689
901
|
};
|
|
690
902
|
|
|
691
903
|
var Properties = function Properties(_ref) {
|
|
692
|
-
var onPropertiesChange = _ref.onPropertiesChange
|
|
904
|
+
var onPropertiesChange = _ref.onPropertiesChange,
|
|
905
|
+
className = _ref.className;
|
|
693
906
|
var _useTranslation = useTranslation(),
|
|
694
907
|
t = _useTranslation.t;
|
|
695
908
|
var _useConfigStore = useConfigStore(function (store) {
|
|
@@ -740,138 +953,130 @@ var Properties = function Properties(_ref) {
|
|
|
740
953
|
}
|
|
741
954
|
};
|
|
742
955
|
useEffect(function () {
|
|
743
|
-
onPropertiesChange === null || onPropertiesChange === void 0
|
|
956
|
+
onPropertiesChange === null || onPropertiesChange === void 0 ? void 0 : onPropertiesChange(values, handleChange, handleColorChange);
|
|
744
957
|
setTheme(values);
|
|
745
958
|
setThemeState({
|
|
746
959
|
previewingTheme: values
|
|
747
960
|
});
|
|
748
961
|
}, [values]);
|
|
749
962
|
return /*#__PURE__*/jsx(Card$2, {
|
|
963
|
+
className: className,
|
|
964
|
+
name: "style",
|
|
750
965
|
title: t("neetoThemes.common.style"),
|
|
751
|
-
children:
|
|
752
|
-
|
|
753
|
-
children: [filterBy({
|
|
754
|
-
kind: "font_family"
|
|
755
|
-
}, values.properties).map(function (_ref3) {
|
|
756
|
-
var key = _ref3.key,
|
|
757
|
-
value = _ref3.value,
|
|
758
|
-
kind = _ref3.kind;
|
|
759
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(FontPickerBlock, {
|
|
760
|
-
label: buildLabel(key, kind),
|
|
761
|
-
options: FONT_OPTIONS,
|
|
762
|
-
value: findBy({
|
|
763
|
-
value: value || null
|
|
764
|
-
}, FONT_OPTIONS),
|
|
765
|
-
onChange: function onChange(_ref4) {
|
|
766
|
-
var value = _ref4.value;
|
|
767
|
-
handleChange(key, value);
|
|
768
|
-
}
|
|
769
|
-
}, key);
|
|
770
|
-
}), filterBy({
|
|
771
|
-
kind: "color"
|
|
772
|
-
}, values.properties).map(function (_ref5) {
|
|
966
|
+
children: values.properties.sort(function (a, b) {
|
|
967
|
+
var order = function order(key) {
|
|
773
968
|
var _findBy;
|
|
774
|
-
|
|
775
|
-
value = _ref5.value,
|
|
776
|
-
kind = _ref5.kind;
|
|
777
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(ColorBlock, {
|
|
778
|
-
color: value,
|
|
779
|
-
label: buildLabel(key, kind),
|
|
780
|
-
showTransparencyControl: ((_findBy = findBy({
|
|
781
|
-
key: key
|
|
782
|
-
}, themePropertiesSchema)) === null || _findBy === void 0 ? void 0 : _findBy.showTransparencyControl) || false,
|
|
783
|
-
onChange: handleColorChange(key)
|
|
784
|
-
}, key);
|
|
785
|
-
}), filterBy({
|
|
786
|
-
kind: "radius"
|
|
787
|
-
}, values.properties).map(function (_ref6) {
|
|
788
|
-
var key = _ref6.key,
|
|
789
|
-
value = _ref6.value,
|
|
790
|
-
kind = _ref6.kind;
|
|
791
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(SliderBlock, {
|
|
792
|
-
label: buildLabel(key, kind),
|
|
793
|
-
max: 50,
|
|
794
|
-
min: 0,
|
|
795
|
-
value: Number(value) || 0,
|
|
796
|
-
onChange: function onChange(radius) {
|
|
797
|
-
return handleChange(key, radius, "".concat(radius, "px"));
|
|
798
|
-
}
|
|
799
|
-
}, key);
|
|
800
|
-
}), filterBy({
|
|
801
|
-
kind: "overlay_opacity"
|
|
802
|
-
}, values.properties).map(function (_ref7) {
|
|
803
|
-
var key = _ref7.key,
|
|
804
|
-
value = _ref7.value,
|
|
805
|
-
kind = _ref7.kind;
|
|
806
|
-
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(SliderBlock, {
|
|
807
|
-
label: buildLabel(key, kind),
|
|
808
|
-
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
809
|
-
max: HUNDRED,
|
|
810
|
-
min: negate(HUNDRED),
|
|
811
|
-
value: Number(value) || 0,
|
|
812
|
-
onChange: function onChange(opacity) {
|
|
813
|
-
return handleOverlayChange(key, opacity);
|
|
814
|
-
}
|
|
815
|
-
}, key);
|
|
816
|
-
}), filterBy({
|
|
817
|
-
kind: "position_selector"
|
|
818
|
-
}, values.properties).map(function (_ref8) {
|
|
819
|
-
var _findBy2;
|
|
820
|
-
var key = _ref8.key,
|
|
821
|
-
kind = _ref8.kind,
|
|
822
|
-
value = _ref8.value;
|
|
823
|
-
var index = findIndexBy({
|
|
969
|
+
return ((_findBy = findBy({
|
|
824
970
|
key: key
|
|
825
|
-
},
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
971
|
+
}, themePropertiesSchema)) === null || _findBy === void 0 ? void 0 : _findBy.order) || Infinity;
|
|
972
|
+
};
|
|
973
|
+
return order(a.key) - order(b.key);
|
|
974
|
+
}).map(function (_ref3) {
|
|
975
|
+
var _findBy2;
|
|
976
|
+
var key = _ref3.key,
|
|
977
|
+
value = _ref3.value,
|
|
978
|
+
kind = _ref3.kind;
|
|
979
|
+
var isCurrentPropertyVisible = isPropertyVisible(key, values, themePropertiesSchema);
|
|
980
|
+
if (!isCurrentPropertyVisible) return null;
|
|
981
|
+
switch (kind) {
|
|
982
|
+
case "font_family":
|
|
983
|
+
return /*#__PURE__*/jsx(FontPickerBlock, {
|
|
984
|
+
label: buildLabel(key, kind),
|
|
985
|
+
options: FONT_OPTIONS,
|
|
986
|
+
value: findBy({
|
|
987
|
+
value: value || null
|
|
988
|
+
}, FONT_OPTIONS),
|
|
989
|
+
onChange: function onChange(_ref4) {
|
|
990
|
+
var value = _ref4.value;
|
|
991
|
+
return handleChange(key, value);
|
|
992
|
+
}
|
|
993
|
+
}, key);
|
|
994
|
+
case "color":
|
|
995
|
+
return /*#__PURE__*/jsx(ColorBlock, {
|
|
996
|
+
color: value,
|
|
997
|
+
label: buildLabel(key, kind),
|
|
998
|
+
showTransparencyControl: ((_findBy2 = findBy({
|
|
999
|
+
key: key
|
|
1000
|
+
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.showTransparencyControl) || false,
|
|
1001
|
+
onChange: handleColorChange(key)
|
|
1002
|
+
}, key);
|
|
1003
|
+
case "radius":
|
|
1004
|
+
return /*#__PURE__*/jsx(SliderBlock, {
|
|
1005
|
+
label: buildLabel(key, kind),
|
|
1006
|
+
max: 50,
|
|
1007
|
+
min: 0,
|
|
1008
|
+
value: Number(value) || 0,
|
|
1009
|
+
onChange: function onChange(radius) {
|
|
1010
|
+
return handleChange(key, radius, "".concat(radius, "px"));
|
|
1011
|
+
}
|
|
1012
|
+
}, key);
|
|
1013
|
+
case "overlay_opacity":
|
|
1014
|
+
return /*#__PURE__*/jsx(SliderBlock, {
|
|
1015
|
+
label: buildLabel(key, kind),
|
|
1016
|
+
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
1017
|
+
max: HUNDRED,
|
|
1018
|
+
min: negate(HUNDRED),
|
|
1019
|
+
value: Number(value) || 0,
|
|
1020
|
+
onChange: function onChange(opacity) {
|
|
1021
|
+
return handleOverlayChange(key, opacity);
|
|
1022
|
+
}
|
|
1023
|
+
}, key);
|
|
1024
|
+
case "position_selector":
|
|
1025
|
+
{
|
|
1026
|
+
var _findBy3, _findBy3$options;
|
|
1027
|
+
var index = findIndexBy({
|
|
1028
|
+
key: key
|
|
1029
|
+
}, values.properties);
|
|
1030
|
+
var options = (_findBy3 = findBy({
|
|
1031
|
+
key: key
|
|
1032
|
+
}, themePropertiesSchema)) === null || _findBy3 === void 0 ? void 0 : (_findBy3$options = _findBy3.options) === null || _findBy3$options === void 0 ? void 0 : _findBy3$options.map(toLabelAndValue);
|
|
1033
|
+
return /*#__PURE__*/jsx(SelectBlock, {
|
|
1034
|
+
label: buildLabel(key, kind),
|
|
1035
|
+
options: options || POSITION_OPTIONS,
|
|
1036
|
+
placeholder: "left",
|
|
1037
|
+
value: toLabelAndValue(value),
|
|
1038
|
+
onChange: function onChange(option) {
|
|
1039
|
+
return setFieldValue("properties[".concat(index, "].value"), option.value);
|
|
1040
|
+
}
|
|
1041
|
+
}, key);
|
|
836
1042
|
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
name: snakeToCamelCase(key),
|
|
851
|
-
onChange: function onChange(e) {
|
|
852
|
-
return setFieldValue("properties[".concat(index, "].value"), String(e.target.checked));
|
|
1043
|
+
case "boolean":
|
|
1044
|
+
{
|
|
1045
|
+
var _index = findIndexBy({
|
|
1046
|
+
key: key
|
|
1047
|
+
}, values.properties);
|
|
1048
|
+
return /*#__PURE__*/jsx(SwitchBlock, {
|
|
1049
|
+
checked: value !== "false",
|
|
1050
|
+
label: buildLabel(key, kind),
|
|
1051
|
+
name: snakeToCamelCase(key),
|
|
1052
|
+
onChange: function onChange(e) {
|
|
1053
|
+
return setFieldValue("properties[".concat(_index, "].value"), String(e.target.checked));
|
|
1054
|
+
}
|
|
1055
|
+
}, key);
|
|
853
1056
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
})]
|
|
1057
|
+
case "alignment_block":
|
|
1058
|
+
{
|
|
1059
|
+
var _index2 = findIndexBy({
|
|
1060
|
+
key: key
|
|
1061
|
+
}, values.properties);
|
|
1062
|
+
return /*#__PURE__*/jsx(AlignmentBlock, {
|
|
1063
|
+
label: buildLabel(key, kind),
|
|
1064
|
+
name: "properties[".concat(_index2, "].value")
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
default:
|
|
1068
|
+
return null;
|
|
1069
|
+
}
|
|
868
1070
|
})
|
|
869
1071
|
});
|
|
870
1072
|
};
|
|
871
1073
|
|
|
872
1074
|
var ThemeMeta = withT(function (_ref) {
|
|
873
|
-
var t = _ref.t
|
|
1075
|
+
var t = _ref.t,
|
|
1076
|
+
className = _ref.className;
|
|
874
1077
|
return /*#__PURE__*/jsx(Card$2, {
|
|
1078
|
+
className: className,
|
|
1079
|
+
name: "name",
|
|
875
1080
|
title: t("neetoThemes.common.name"),
|
|
876
1081
|
children: /*#__PURE__*/jsx(Input, {
|
|
877
1082
|
autoFocus: true,
|
|
@@ -890,7 +1095,9 @@ var Customize = function Customize(_ref) {
|
|
|
890
1095
|
onApplyTheme = _ref.onApplyTheme,
|
|
891
1096
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
892
1097
|
onPropertiesChange = _ref.onPropertiesChange,
|
|
893
|
-
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess
|
|
1098
|
+
onUpdateThemeSuccess = _ref.onUpdateThemeSuccess,
|
|
1099
|
+
onEditCSSClick = _ref.onEditCSSClick,
|
|
1100
|
+
currentScreen = _ref.currentScreen;
|
|
894
1101
|
var _useTranslation = useTranslation(),
|
|
895
1102
|
t = _useTranslation.t;
|
|
896
1103
|
var _useState = useState({}),
|
|
@@ -907,6 +1114,12 @@ var Customize = function Customize(_ref) {
|
|
|
907
1114
|
entityType = _useConfigStore.entityType;
|
|
908
1115
|
var _useThemeUtils = useThemeUtils(),
|
|
909
1116
|
currentTheme = _useThemeUtils.currentTheme;
|
|
1117
|
+
var _useShowGlobalTheme = useShowGlobalTheme(entityType),
|
|
1118
|
+
_useShowGlobalTheme$d = _useShowGlobalTheme.data,
|
|
1119
|
+
_useShowGlobalTheme$d2 = _useShowGlobalTheme$d === void 0 ? {} : _useShowGlobalTheme$d,
|
|
1120
|
+
_useShowGlobalTheme$d3 = _useShowGlobalTheme$d2.globalTheme,
|
|
1121
|
+
globalTheme = _useShowGlobalTheme$d3 === void 0 ? {} : _useShowGlobalTheme$d3;
|
|
1122
|
+
var isThemeGlobalTheme = (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
|
|
910
1123
|
var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
|
|
911
1124
|
var submitBtnRef = useRef(null);
|
|
912
1125
|
var _useCreateTheme = useCreateTheme(),
|
|
@@ -916,12 +1129,18 @@ var Customize = function Customize(_ref) {
|
|
|
916
1129
|
updateTheme = _useUpdateTheme.mutate,
|
|
917
1130
|
isUpdating = _useUpdateTheme.isPending;
|
|
918
1131
|
var isSubmitting = isCreating || isUpdating;
|
|
1132
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1133
|
+
var handleGlobalThemeSwitchChange = function handleGlobalThemeSwitchChange(e, setFieldValue) {
|
|
1134
|
+
setFieldValue("shouldSetAsGlobalTheme", e.target.checked);
|
|
1135
|
+
};
|
|
919
1136
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
920
1137
|
var resetForm = _ref2.resetForm;
|
|
921
1138
|
var imageData = buildImageData(values, themePropertiesSchema);
|
|
922
1139
|
var themeToSave = _objectSpread$1({
|
|
923
1140
|
propertiesAttributes: values.properties,
|
|
924
|
-
name: values.name
|
|
1141
|
+
name: values.name,
|
|
1142
|
+
shouldSetAsGlobalTheme: values.shouldSetAsGlobalTheme,
|
|
1143
|
+
entityType: values.entityType
|
|
925
1144
|
}, imageData);
|
|
926
1145
|
if (!themeId) {
|
|
927
1146
|
return createTheme(themeToSave, {
|
|
@@ -939,34 +1158,74 @@ var Customize = function Customize(_ref) {
|
|
|
939
1158
|
resetForm({
|
|
940
1159
|
values: values
|
|
941
1160
|
});
|
|
942
|
-
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0
|
|
1161
|
+
onUpdateThemeSuccess === null || onUpdateThemeSuccess === void 0 ? void 0 : onUpdateThemeSuccess(values);
|
|
943
1162
|
}
|
|
944
1163
|
});
|
|
945
1164
|
};
|
|
946
1165
|
return /*#__PURE__*/jsx(Form, {
|
|
947
1166
|
formikProps: {
|
|
948
|
-
initialValues: buildInitialValues(theme, themePropertiesSchema),
|
|
1167
|
+
initialValues: _objectSpread$1(_objectSpread$1({}, buildInitialValues(theme, themePropertiesSchema)), {}, {
|
|
1168
|
+
shouldSetAsGlobalTheme: isThemeGlobalTheme,
|
|
1169
|
+
entityType: entityType
|
|
1170
|
+
}),
|
|
949
1171
|
validationSchema: THEME_VALIDATION_SCHEMA,
|
|
1172
|
+
enableReinitialize: true,
|
|
950
1173
|
onSubmit: onSubmit
|
|
951
1174
|
},
|
|
952
1175
|
children: function children(_ref4) {
|
|
953
|
-
var dirty = _ref4.dirty
|
|
1176
|
+
var dirty = _ref4.dirty,
|
|
1177
|
+
values = _ref4.values,
|
|
1178
|
+
setFieldValue = _ref4.setFieldValue;
|
|
954
1179
|
return /*#__PURE__*/jsxs("div", {
|
|
955
1180
|
className: "neeto-themes-sidebar__scroll",
|
|
956
1181
|
children: [/*#__PURE__*/jsxs("div", {
|
|
957
|
-
className: "flex flex-col
|
|
958
|
-
children: [/*#__PURE__*/jsx(ThemeMeta, {
|
|
959
|
-
|
|
1182
|
+
className: "neeto-themes-sidebar__scroll-content flex flex-grow flex-col px-4 pb-4 lg:px-5",
|
|
1183
|
+
children: [/*#__PURE__*/jsx(ThemeMeta, {
|
|
1184
|
+
className: classnames({
|
|
1185
|
+
hidden: isCustomCssScreen
|
|
1186
|
+
})
|
|
1187
|
+
}), /*#__PURE__*/jsx(Properties, {
|
|
1188
|
+
onPropertiesChange: onPropertiesChange,
|
|
1189
|
+
className: classnames({
|
|
1190
|
+
hidden: isCustomCssScreen
|
|
1191
|
+
})
|
|
960
1192
|
}), filterBy({
|
|
961
1193
|
kind: "image"
|
|
962
1194
|
}, themePropertiesSchema).map(function (_ref5) {
|
|
963
1195
|
var key = _ref5.key;
|
|
964
1196
|
return /*#__PURE__*/jsx(Images, {
|
|
965
|
-
attribute: key
|
|
1197
|
+
attribute: key,
|
|
1198
|
+
className: classnames({
|
|
1199
|
+
hidden: isCustomCssScreen
|
|
1200
|
+
})
|
|
966
1201
|
}, key);
|
|
1202
|
+
}), /*#__PURE__*/jsx(CustomCSS, {
|
|
1203
|
+
currentScreen: currentScreen,
|
|
1204
|
+
onEditCSSClick: onEditCSSClick
|
|
1205
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1206
|
+
className: "neeto-ui-bg-gray-50 neeto-ui-border-gray-200 mt-2 flex flex-col space-y-2 border p-2",
|
|
1207
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
1208
|
+
disabled: !isThemeGlobalTheme,
|
|
1209
|
+
content: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.tooltipContent"),
|
|
1210
|
+
children: /*#__PURE__*/jsx(Switch, {
|
|
1211
|
+
checked: values.shouldSetAsGlobalTheme,
|
|
1212
|
+
disabled: isThemeGlobalTheme,
|
|
1213
|
+
name: "shouldSetAsGlobalTheme",
|
|
1214
|
+
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.label"),
|
|
1215
|
+
onChange: function onChange(e) {
|
|
1216
|
+
return handleGlobalThemeSwitchChange(e, setFieldValue);
|
|
1217
|
+
}
|
|
1218
|
+
})
|
|
1219
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1220
|
+
className: "text-sm",
|
|
1221
|
+
style: "body2",
|
|
1222
|
+
children: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.helpText", {
|
|
1223
|
+
entityType: entityType
|
|
1224
|
+
})
|
|
1225
|
+
})]
|
|
967
1226
|
})]
|
|
968
1227
|
}), /*#__PURE__*/jsxs("div", {
|
|
969
|
-
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",
|
|
1228
|
+
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",
|
|
970
1229
|
children: [/*#__PURE__*/jsx(Button, {
|
|
971
1230
|
"data-cy": "reset-button",
|
|
972
1231
|
disabled: !dirty || isSubmitting,
|
|
@@ -998,7 +1257,7 @@ var Customize = function Customize(_ref) {
|
|
|
998
1257
|
style: "text",
|
|
999
1258
|
onClick: function onClick() {
|
|
1000
1259
|
var _popoverInstance$hide;
|
|
1001
|
-
return popoverInstance === null || popoverInstance === void 0
|
|
1260
|
+
return popoverInstance === null || popoverInstance === void 0 ? void 0 : (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
1002
1261
|
}
|
|
1003
1262
|
}), /*#__PURE__*/jsx(Typography, {
|
|
1004
1263
|
className: "w-72 pr-5",
|
|
@@ -1189,7 +1448,9 @@ var Card = function Card(_ref) {
|
|
|
1189
1448
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
1190
1449
|
onCloneTheme = _ref.onCloneTheme,
|
|
1191
1450
|
isHighLightedTheme = _ref.isHighLightedTheme,
|
|
1451
|
+
isGlobalTheme = _ref.isGlobalTheme,
|
|
1192
1452
|
onApplyTheme = _ref.onApplyTheme,
|
|
1453
|
+
onApplyGlobalTheme = _ref.onApplyGlobalTheme,
|
|
1193
1454
|
Thumbnail$1 = _ref.thumbnail;
|
|
1194
1455
|
var _useTranslation = useTranslation(),
|
|
1195
1456
|
t = _useTranslation.t;
|
|
@@ -1205,6 +1466,9 @@ var Card = function Card(_ref) {
|
|
|
1205
1466
|
var handleDeleteTheme = function handleDeleteTheme() {
|
|
1206
1467
|
return onDeleteTheme(id, name, appliedCount);
|
|
1207
1468
|
};
|
|
1469
|
+
var handleApplyGlobalTheme = function handleApplyGlobalTheme() {
|
|
1470
|
+
return onApplyGlobalTheme(id);
|
|
1471
|
+
};
|
|
1208
1472
|
return /*#__PURE__*/jsx("div", {
|
|
1209
1473
|
className: "group space-y-2 pt-0.5",
|
|
1210
1474
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
@@ -1256,13 +1520,19 @@ var Card = function Card(_ref) {
|
|
|
1256
1520
|
theme: theme
|
|
1257
1521
|
})]
|
|
1258
1522
|
}), /*#__PURE__*/jsxs("div", {
|
|
1259
|
-
className: "flex items-start justify-between gap-1 p-
|
|
1260
|
-
children: [/*#__PURE__*/
|
|
1261
|
-
className: "
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1523
|
+
className: "neeto-ui-border-gray-100 flex items-start justify-between gap-1 border-t p-2",
|
|
1524
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1525
|
+
className: "flex items-center space-x-2",
|
|
1526
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1527
|
+
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
1528
|
+
"data-cy": "theme-name",
|
|
1529
|
+
lineHeight: "snug",
|
|
1530
|
+
style: "body2",
|
|
1531
|
+
children: name
|
|
1532
|
+
}), isGlobalTheme && /*#__PURE__*/jsx(Rating, {
|
|
1533
|
+
className: "neeto-themes-nano-global-theme-icon",
|
|
1534
|
+
size: 18
|
|
1535
|
+
})]
|
|
1266
1536
|
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
1267
1537
|
dropdownButtonProps: {
|
|
1268
1538
|
size: "small"
|
|
@@ -1284,6 +1554,12 @@ var Card = function Card(_ref) {
|
|
|
1284
1554
|
"data-cy": "clone-theme-menu-item",
|
|
1285
1555
|
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.clone"),
|
|
1286
1556
|
onClick: handleCloneTheme
|
|
1557
|
+
}, {
|
|
1558
|
+
key: "set-as-global-theme",
|
|
1559
|
+
"data-cy": "set-as-global-theme-menu-item",
|
|
1560
|
+
label: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.label"),
|
|
1561
|
+
isVisible: !isGlobalTheme,
|
|
1562
|
+
onClick: handleApplyGlobalTheme
|
|
1287
1563
|
}, {
|
|
1288
1564
|
key: "divider",
|
|
1289
1565
|
type: "divider",
|
|
@@ -1333,12 +1609,26 @@ var Themes = function Themes(_ref) {
|
|
|
1333
1609
|
}, shallow),
|
|
1334
1610
|
setThemeState = _useThemeStore.setThemeState,
|
|
1335
1611
|
previewingTheme = _useThemeStore.previewingTheme;
|
|
1612
|
+
var _useConfigStore = useConfigStore(function (store) {
|
|
1613
|
+
return {
|
|
1614
|
+
entityType: store["entityType"]
|
|
1615
|
+
};
|
|
1616
|
+
}, shallow),
|
|
1617
|
+
entityType = _useConfigStore.entityType;
|
|
1336
1618
|
var _useState = useState(""),
|
|
1337
1619
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1338
1620
|
searchQuery = _useState2[0],
|
|
1339
1621
|
setSearchQuery = _useState2[1];
|
|
1340
1622
|
var _useCloneTheme = useCloneTheme(),
|
|
1341
1623
|
cloneTheme = _useCloneTheme.mutate;
|
|
1624
|
+
var _useApplyGlobalTheme = useApplyGlobalTheme(),
|
|
1625
|
+
applyGlobalTheme = _useApplyGlobalTheme.mutate;
|
|
1626
|
+
var _useShowGlobalTheme = useShowGlobalTheme(entityType),
|
|
1627
|
+
_useShowGlobalTheme$d = _useShowGlobalTheme.data,
|
|
1628
|
+
_useShowGlobalTheme$d2 = _useShowGlobalTheme$d === void 0 ? {} : _useShowGlobalTheme$d,
|
|
1629
|
+
_useShowGlobalTheme$d3 = _useShowGlobalTheme$d2.globalTheme,
|
|
1630
|
+
globalTheme = _useShowGlobalTheme$d3 === void 0 ? {} : _useShowGlobalTheme$d3,
|
|
1631
|
+
isLoadingGlobalTheme = _useShowGlobalTheme.isLoading;
|
|
1342
1632
|
useEffect(function () {
|
|
1343
1633
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
1344
1634
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -1367,7 +1657,16 @@ var Themes = function Themes(_ref) {
|
|
|
1367
1657
|
}
|
|
1368
1658
|
});
|
|
1369
1659
|
};
|
|
1370
|
-
|
|
1660
|
+
var handleApplyGlobalTheme = function handleApplyGlobalTheme(themeId) {
|
|
1661
|
+
var payload = {
|
|
1662
|
+
entityType: entityType
|
|
1663
|
+
};
|
|
1664
|
+
applyGlobalTheme({
|
|
1665
|
+
themeId: themeId,
|
|
1666
|
+
payload: payload
|
|
1667
|
+
});
|
|
1668
|
+
};
|
|
1669
|
+
if (isLoading || isCurrentThemeLoading || isLoadingGlobalTheme) {
|
|
1371
1670
|
return /*#__PURE__*/jsx("div", {
|
|
1372
1671
|
className: "flex h-full w-full items-center justify-center",
|
|
1373
1672
|
children: /*#__PURE__*/jsx(Spinner, {})
|
|
@@ -1389,13 +1688,13 @@ var Themes = function Themes(_ref) {
|
|
|
1389
1688
|
children: t("neetoThemes.common.noResultsFound")
|
|
1390
1689
|
}), isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxs(Fragment, {
|
|
1391
1690
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
1392
|
-
className: "my-4 px-
|
|
1691
|
+
className: "my-4 px-6 uppercase lg:px-5 xl:px-6",
|
|
1393
1692
|
"data-cy": "system-themes-header",
|
|
1394
1693
|
style: "h6",
|
|
1395
1694
|
weight: "semibold",
|
|
1396
1695
|
children: t("neetoThemes.build.leftSideBar.themes.systemThemes")
|
|
1397
1696
|
}), /*#__PURE__*/jsx("div", {
|
|
1398
|
-
className: "flex flex-col gap-4 px-
|
|
1697
|
+
className: "flex flex-col gap-4 px-6 pb-10 lg:px-5 xl:px-6",
|
|
1399
1698
|
"data-cy": "system-themes",
|
|
1400
1699
|
children: filteredDefaultThemes.map(function (theme) {
|
|
1401
1700
|
return /*#__PURE__*/createElement(Card$1, {
|
|
@@ -1403,9 +1702,11 @@ var Themes = function Themes(_ref) {
|
|
|
1403
1702
|
theme: theme,
|
|
1404
1703
|
thumbnail: thumbnail,
|
|
1405
1704
|
active: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id,
|
|
1705
|
+
isGlobalTheme: (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === theme.id,
|
|
1406
1706
|
isPreviewing: (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id,
|
|
1407
1707
|
key: theme.id,
|
|
1408
1708
|
isApplyingTheme: isApplyingTheme && (themeBeingApplied === null || themeBeingApplied === void 0 ? void 0 : themeBeingApplied.id) === theme.id,
|
|
1709
|
+
onApplyGlobalTheme: handleApplyGlobalTheme,
|
|
1409
1710
|
onCloneTheme: handleCloneTheme,
|
|
1410
1711
|
onSetPreviewTheme: setPreviewTheme
|
|
1411
1712
|
});
|
|
@@ -1433,9 +1734,11 @@ var Themes = function Themes(_ref) {
|
|
|
1433
1734
|
theme: theme,
|
|
1434
1735
|
thumbnail: thumbnail,
|
|
1435
1736
|
active: isActive,
|
|
1737
|
+
isGlobalTheme: (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === theme.id,
|
|
1436
1738
|
isHighLightedTheme: theme.id === themeToHighlight,
|
|
1437
1739
|
key: theme.id,
|
|
1438
1740
|
isApplyingTheme: isApplyingTheme && (themeBeingApplied === null || themeBeingApplied === void 0 ? void 0 : themeBeingApplied.id) === theme.id,
|
|
1741
|
+
onApplyGlobalTheme: handleApplyGlobalTheme,
|
|
1439
1742
|
onCloneTheme: handleCloneTheme,
|
|
1440
1743
|
onDeleteTheme: !isActive && onDeleteTheme,
|
|
1441
1744
|
onSetPreviewTheme: setPreviewTheme
|
|
@@ -1454,56 +1757,57 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1454
1757
|
themeToEdit = _ref.themeToEdit;
|
|
1455
1758
|
var _useTranslation = useTranslation(),
|
|
1456
1759
|
t = _useTranslation.t;
|
|
1457
|
-
|
|
1760
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1761
|
+
if (currentScreen === DESIGN_SCREENS.THEMES) {
|
|
1458
1762
|
return /*#__PURE__*/jsx("div", {
|
|
1459
|
-
className: "neeto-themes-sidebar__header px-
|
|
1763
|
+
className: "neeto-themes-sidebar__header px-6 lg:px-5 xl:px-6",
|
|
1460
1764
|
children: /*#__PURE__*/jsxs("div", {
|
|
1461
|
-
className: "flex items-center justify-
|
|
1462
|
-
children: [/*#__PURE__*/jsx(
|
|
1463
|
-
"data-cy": "customize-themes-back-button",
|
|
1464
|
-
icon: LeftArrow,
|
|
1465
|
-
iconPosition: "left",
|
|
1466
|
-
style: "text",
|
|
1467
|
-
tooltipProps: {
|
|
1468
|
-
content: t("neetoThemes.buttons.backToThemes"),
|
|
1469
|
-
position: "top"
|
|
1470
|
-
},
|
|
1471
|
-
onClick: function onClick() {
|
|
1472
|
-
return handleBackPress(themeToEdit);
|
|
1473
|
-
}
|
|
1474
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
1765
|
+
className: "flex items-center justify-between space-x-2",
|
|
1766
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1475
1767
|
"data-cy": "themes-header",
|
|
1476
1768
|
lineHeight: "normal",
|
|
1477
1769
|
style: "h3",
|
|
1478
1770
|
weight: "semibold",
|
|
1479
|
-
children:
|
|
1771
|
+
children: t("neetoThemes.build.leftSideBar.headerTabs.themes")
|
|
1772
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1773
|
+
className: "self-end",
|
|
1774
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
1775
|
+
"data-cy": "customize-themes-add-theme-button",
|
|
1776
|
+
icon: Plus,
|
|
1777
|
+
iconPosition: "left",
|
|
1778
|
+
style: "text",
|
|
1779
|
+
tooltipProps: {
|
|
1780
|
+
content: t("neetoThemes.buttons.addNewTheme"),
|
|
1781
|
+
position: "top"
|
|
1782
|
+
},
|
|
1783
|
+
onClick: handleCreateNewTheme
|
|
1784
|
+
})
|
|
1480
1785
|
})]
|
|
1481
1786
|
})
|
|
1482
1787
|
});
|
|
1483
1788
|
}
|
|
1484
1789
|
return /*#__PURE__*/jsx("div", {
|
|
1485
|
-
className: "neeto-themes-sidebar__header px-4
|
|
1790
|
+
className: "neeto-themes-sidebar__header px-4",
|
|
1486
1791
|
children: /*#__PURE__*/jsxs("div", {
|
|
1487
|
-
className: "flex items-center justify-
|
|
1488
|
-
children: [/*#__PURE__*/jsx(
|
|
1792
|
+
className: "flex items-center justify-start space-x-2",
|
|
1793
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
1794
|
+
"data-cy": "customize-themes-back-button",
|
|
1795
|
+
icon: LeftArrow,
|
|
1796
|
+
iconPosition: "left",
|
|
1797
|
+
style: "text",
|
|
1798
|
+
tooltipProps: {
|
|
1799
|
+
content: isCustomCssScreen ? t("neetoThemes.buttons.backToEdit") : t("neetoThemes.buttons.backToThemes"),
|
|
1800
|
+
position: "top"
|
|
1801
|
+
},
|
|
1802
|
+
onClick: function onClick() {
|
|
1803
|
+
return handleBackPress(themeToEdit);
|
|
1804
|
+
}
|
|
1805
|
+
}), /*#__PURE__*/jsxs(Typography, {
|
|
1489
1806
|
"data-cy": "themes-header",
|
|
1490
1807
|
lineHeight: "normal",
|
|
1491
1808
|
style: "h3",
|
|
1492
1809
|
weight: "semibold",
|
|
1493
|
-
children: t("neetoThemes.build.leftSideBar.
|
|
1494
|
-
}), /*#__PURE__*/jsx("div", {
|
|
1495
|
-
className: "self-end",
|
|
1496
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
1497
|
-
"data-cy": "customize-themes-add-theme-button",
|
|
1498
|
-
icon: Plus,
|
|
1499
|
-
iconPosition: "left",
|
|
1500
|
-
style: "text",
|
|
1501
|
-
tooltipProps: {
|
|
1502
|
-
content: t("neetoThemes.buttons.addNewTheme"),
|
|
1503
|
-
position: "top"
|
|
1504
|
-
},
|
|
1505
|
-
onClick: handleCreateNewTheme
|
|
1506
|
-
})
|
|
1810
|
+
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")]
|
|
1507
1811
|
})]
|
|
1508
1812
|
})
|
|
1509
1813
|
});
|
|
@@ -1532,6 +1836,16 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1532
1836
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1533
1837
|
themeBeingApplied = _useState8[0],
|
|
1534
1838
|
setThemeBeingApplied = _useState8[1];
|
|
1839
|
+
var _useBreakpoints = useBreakpoints(),
|
|
1840
|
+
isSize = _useBreakpoints.isSize;
|
|
1841
|
+
var isLargerScreen = !isSize("mobile");
|
|
1842
|
+
var _useState9 = useState(!isLargerScreen),
|
|
1843
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
1844
|
+
isThemesSidebarCollapsed = _useState10[0],
|
|
1845
|
+
setIsThemesSidebarCollapsed = _useState10[1];
|
|
1846
|
+
useEffect(function () {
|
|
1847
|
+
setIsThemesSidebarCollapsed(!isLargerScreen);
|
|
1848
|
+
}, [isLargerScreen]);
|
|
1535
1849
|
var _useConfigStore = useConfigStore(function (store) {
|
|
1536
1850
|
return {
|
|
1537
1851
|
entityType: store["entityType"],
|
|
@@ -1582,13 +1896,14 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1582
1896
|
});
|
|
1583
1897
|
setThemeBeingApplied({});
|
|
1584
1898
|
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1585
|
-
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0
|
|
1899
|
+
onApplyThemeSuccess === null || onApplyThemeSuccess === void 0 ? void 0 : onApplyThemeSuccess(theme);
|
|
1586
1900
|
}
|
|
1587
1901
|
}),
|
|
1588
1902
|
applyTheme = _useApplyTheme.mutate,
|
|
1589
1903
|
isApplyingTheme = _useApplyTheme.isPending;
|
|
1590
1904
|
var themeToDelete = useRef(null);
|
|
1591
1905
|
var themeToEdit = useRef(null);
|
|
1906
|
+
var isCustomCssScreen = isScreenCustomCSS(currentScreen);
|
|
1592
1907
|
var handleEditTheme = function handleEditTheme(theme) {
|
|
1593
1908
|
themeToEdit.current = theme;
|
|
1594
1909
|
setCurrentScreen(DESIGN_SCREENS.Customize);
|
|
@@ -1608,7 +1923,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1608
1923
|
setThemeState({
|
|
1609
1924
|
previewingTheme: currentTheme
|
|
1610
1925
|
});
|
|
1611
|
-
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1926
|
+
setCurrentScreen(isCustomCssScreen ? DESIGN_SCREENS.Customize : DESIGN_SCREENS.THEMES);
|
|
1612
1927
|
themeToEdit.current = null;
|
|
1613
1928
|
};
|
|
1614
1929
|
var highlightTheme = function highlightTheme(themeToHighlight) {
|
|
@@ -1648,53 +1963,73 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1648
1963
|
}
|
|
1649
1964
|
});
|
|
1650
1965
|
}, [deleteTheme, themeToDelete]);
|
|
1651
|
-
return /*#__PURE__*/jsxs(
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
currentTheme: currentTheme,
|
|
1663
|
-
defaultThemes: defaultThemes,
|
|
1664
|
-
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
1665
|
-
highlightTheme: highlightTheme,
|
|
1666
|
-
isApplyingTheme: isApplyingTheme,
|
|
1667
|
-
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
1668
|
-
onApplyTheme: onApplyTheme,
|
|
1669
|
-
themeBeingApplied: themeBeingApplied,
|
|
1670
|
-
themeToHighlight: themeToHighlight,
|
|
1671
|
-
themes: themes,
|
|
1672
|
-
thumbnail: thumbnail,
|
|
1673
|
-
isLoading: isLoading || isFetchingSchema,
|
|
1674
|
-
onDeleteTheme: handleDelete,
|
|
1675
|
-
onEditTheme: handleEditTheme
|
|
1676
|
-
}) : /*#__PURE__*/jsx(Customize, {
|
|
1677
|
-
isApplyingTheme: isApplyingTheme,
|
|
1678
|
-
onApplyTheme: onApplyTheme,
|
|
1679
|
-
onCreateTheme: onCreateTheme,
|
|
1680
|
-
onPropertiesChange: onPropertiesChange,
|
|
1681
|
-
onUpdateThemeSuccess: onUpdateThemeSuccess,
|
|
1682
|
-
theme: themeToEdit.current,
|
|
1683
|
-
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
|
|
1684
|
-
}), /*#__PURE__*/jsx(MemoizedAlert, {
|
|
1685
|
-
isOpen: isDeleteAlertOpen,
|
|
1686
|
-
isSubmitting: isDeleting,
|
|
1687
|
-
title: t("neetoThemes.alerts.title.deleteTheme"),
|
|
1688
|
-
message: t("neetoThemes.alerts.message.deleteTheme", {
|
|
1689
|
-
name: (_themeToDelete$curren2 = themeToDelete.current) === null || _themeToDelete$curren2 === void 0 ? void 0 : _themeToDelete$curren2.name,
|
|
1690
|
-
count: (_themeToDelete$curren3 = themeToDelete.current) === null || _themeToDelete$curren3 === void 0 ? void 0 : _themeToDelete$curren3.appliedCount,
|
|
1691
|
-
defaultThemeName: defaultThemeName,
|
|
1692
|
-
entityType: t("neetoThemes.entityType.".concat(entityType.toLowerCase()), {
|
|
1693
|
-
count: (_themeToDelete$curren4 = themeToDelete.current) === null || _themeToDelete$curren4 === void 0 ? void 0 : _themeToDelete$curren4.appliedCount
|
|
1694
|
-
})
|
|
1966
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
1967
|
+
children: [!isThemesSidebarCollapsed && /*#__PURE__*/jsx("div", {
|
|
1968
|
+
className: "neeto-themes-sidebar__backdrop",
|
|
1969
|
+
onClick: function onClick() {
|
|
1970
|
+
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
1971
|
+
}
|
|
1972
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1973
|
+
className: classnames("neeto-themes-sidebar neeto-ui-border-gray-200 flex-shrink-0 border-r transition-all duration-300", {
|
|
1974
|
+
"neeto-themes-sidebar--expanded": isCustomCssScreen
|
|
1975
|
+
}, {
|
|
1976
|
+
"neeto-themes-sidebar--collapsed": isThemesSidebarCollapsed
|
|
1695
1977
|
}),
|
|
1696
|
-
|
|
1697
|
-
|
|
1978
|
+
children: [/*#__PURE__*/jsx(TitleBar, {
|
|
1979
|
+
currentScreen: currentScreen,
|
|
1980
|
+
handleBackPress: handleBackPress,
|
|
1981
|
+
handleCreateNewTheme: function handleCreateNewTheme() {
|
|
1982
|
+
return handleEditTheme({});
|
|
1983
|
+
},
|
|
1984
|
+
isNewTheme: !((_themeToEdit$current = themeToEdit.current) !== null && _themeToEdit$current !== void 0 && _themeToEdit$current.id),
|
|
1985
|
+
themeToEdit: themeToEdit.current
|
|
1986
|
+
}), currentScreen === DESIGN_SCREENS.THEMES ? /*#__PURE__*/jsx(Themes, {
|
|
1987
|
+
currentTheme: currentTheme,
|
|
1988
|
+
defaultThemes: defaultThemes,
|
|
1989
|
+
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
1990
|
+
highlightTheme: highlightTheme,
|
|
1991
|
+
isApplyingTheme: isApplyingTheme,
|
|
1992
|
+
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
1993
|
+
onApplyTheme: onApplyTheme,
|
|
1994
|
+
themeBeingApplied: themeBeingApplied,
|
|
1995
|
+
themeToHighlight: themeToHighlight,
|
|
1996
|
+
themes: themes,
|
|
1997
|
+
thumbnail: thumbnail,
|
|
1998
|
+
isLoading: isLoading || isFetchingSchema,
|
|
1999
|
+
onDeleteTheme: handleDelete,
|
|
2000
|
+
onEditTheme: handleEditTheme
|
|
2001
|
+
}) : /*#__PURE__*/jsx(Customize, {
|
|
2002
|
+
currentScreen: currentScreen,
|
|
2003
|
+
isApplyingTheme: isApplyingTheme,
|
|
2004
|
+
onApplyTheme: onApplyTheme,
|
|
2005
|
+
onCreateTheme: onCreateTheme,
|
|
2006
|
+
onPropertiesChange: onPropertiesChange,
|
|
2007
|
+
onUpdateThemeSuccess: onUpdateThemeSuccess,
|
|
2008
|
+
theme: themeToEdit.current,
|
|
2009
|
+
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id,
|
|
2010
|
+
onEditCSSClick: setCurrentScreen
|
|
2011
|
+
}), /*#__PURE__*/jsx(MemoizedAlert, {
|
|
2012
|
+
isOpen: isDeleteAlertOpen,
|
|
2013
|
+
isSubmitting: isDeleting,
|
|
2014
|
+
title: t("neetoThemes.alerts.title.deleteTheme"),
|
|
2015
|
+
message: t("neetoThemes.alerts.message.deleteTheme", {
|
|
2016
|
+
name: (_themeToDelete$curren2 = themeToDelete.current) === null || _themeToDelete$curren2 === void 0 ? void 0 : _themeToDelete$curren2.name,
|
|
2017
|
+
count: (_themeToDelete$curren3 = themeToDelete.current) === null || _themeToDelete$curren3 === void 0 ? void 0 : _themeToDelete$curren3.appliedCount,
|
|
2018
|
+
defaultThemeName: defaultThemeName,
|
|
2019
|
+
entityType: t("neetoThemes.entityType.".concat(entityType.toLowerCase()), {
|
|
2020
|
+
count: (_themeToDelete$curren4 = themeToDelete.current) === null || _themeToDelete$curren4 === void 0 ? void 0 : _themeToDelete$curren4.appliedCount
|
|
2021
|
+
})
|
|
2022
|
+
}),
|
|
2023
|
+
onClose: handleCloseDeleteAlert,
|
|
2024
|
+
onSubmit: handleDeleteTheme
|
|
2025
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
2026
|
+
className: "neeto-themes-sidebar__toggler",
|
|
2027
|
+
icon: Collapse,
|
|
2028
|
+
style: "secondary",
|
|
2029
|
+
onClick: function onClick() {
|
|
2030
|
+
setIsThemesSidebarCollapsed(!isThemesSidebarCollapsed);
|
|
2031
|
+
}
|
|
2032
|
+
})]
|
|
1698
2033
|
})]
|
|
1699
2034
|
});
|
|
1700
2035
|
};
|
|
@@ -1770,7 +2105,7 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1770
2105
|
})]
|
|
1771
2106
|
});
|
|
1772
2107
|
};
|
|
1773
|
-
var index = withTitle(NeetoThemesBuilder, t$1("neetoThemes.common.
|
|
2108
|
+
var index = withTitle(NeetoThemesBuilder, t$1("neetoThemes.common.theme"));
|
|
1774
2109
|
|
|
1775
2110
|
export { index as default };
|
|
1776
2111
|
//# sourceMappingURL=NeetoThemesBuilder.js.map
|