@bigbinary/neeto-themes-frontend 1.3.0-beta1 → 1.3.0-beta2
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/app/javascript/src/translations/en.json +3 -1
- package/dist/index.cjs.js +287 -143
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +286 -142
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shallow } from 'zustand/shallow';
|
|
2
|
-
import { useEffect, createElement,
|
|
2
|
+
import { useEffect, createElement, useState, useRef, memo, useCallback } from 'react';
|
|
3
3
|
import { t as t$1 } from 'i18next';
|
|
4
4
|
import { withImmutableActions, useMutationWithInvalidation, withT, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
5
5
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
@@ -7,7 +7,7 @@ import { create as create$1 } from 'zustand';
|
|
|
7
7
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
8
8
|
import { isNotPresent, snakeToCamelCase, filterBy, isPresent, isNot, findBy, findIndexBy, toLabelAndValue, humanize, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
9
9
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
10
|
-
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
11
11
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
12
12
|
import '@babel/runtime/regenerator';
|
|
13
13
|
import '@bigbinary/neetoui/Toastr';
|
|
@@ -16,11 +16,13 @@ import axios from 'axios';
|
|
|
16
16
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
17
17
|
import { prop, isEmpty, negate } from 'ramda';
|
|
18
18
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
19
|
+
import { Close, LeftArrow, Plus } from '@bigbinary/neeto-icons';
|
|
19
20
|
import Button from '@bigbinary/neetoui/Button';
|
|
21
|
+
import Popover from '@bigbinary/neetoui/Popover';
|
|
22
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
20
23
|
import Form from '@bigbinary/neetoui/formik/Form';
|
|
21
24
|
import * as yup from 'yup';
|
|
22
25
|
import { useFormikContext } from 'formik';
|
|
23
|
-
import Typography from '@bigbinary/neetoui/Typography';
|
|
24
26
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
25
27
|
import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
|
|
26
28
|
import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
@@ -30,10 +32,8 @@ import { Slider } from 'antd';
|
|
|
30
32
|
import Switch from '@bigbinary/neetoui/Switch';
|
|
31
33
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
32
34
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
33
|
-
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
34
|
-
import Tag from '@bigbinary/neetoui/Tag';
|
|
35
35
|
import classnames from 'classnames';
|
|
36
|
-
import
|
|
36
|
+
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
37
37
|
|
|
38
38
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
39
39
|
var useConfigStore = create$1(withImmutableActions(function (set) {
|
|
@@ -240,21 +240,20 @@ var useThemeUtils = function useThemeUtils() {
|
|
|
240
240
|
currentTheme = _useThemeStore.currentTheme;
|
|
241
241
|
var _useListSchema = useListSchema(),
|
|
242
242
|
isFetchingSchema = _useListSchema.isLoading,
|
|
243
|
-
data = _useListSchema.data
|
|
244
|
-
status = _useListSchema.status;
|
|
243
|
+
data = _useListSchema.data;
|
|
245
244
|
var _ref = data || {},
|
|
246
245
|
_ref$schema = _ref.schema,
|
|
247
246
|
themePropertiesSchema = _ref$schema === void 0 ? [] : _ref$schema,
|
|
248
247
|
_ref$variableNamesMap = _ref.variableNamesMap,
|
|
249
248
|
variableNamesMap = _ref$variableNamesMap === void 0 ? {} : _ref$variableNamesMap;
|
|
250
249
|
useEffect(function () {
|
|
251
|
-
if (
|
|
250
|
+
if (data) {
|
|
252
251
|
setConfigState({
|
|
253
252
|
themePropertiesSchema: data === null || data === void 0 ? void 0 : data.schema,
|
|
254
253
|
variableNamesMap: data === null || data === void 0 ? void 0 : data.variableNamesMap
|
|
255
254
|
});
|
|
256
255
|
}
|
|
257
|
-
}, [data
|
|
256
|
+
}, [data]);
|
|
258
257
|
useEffect(function () {
|
|
259
258
|
return setConfigState({
|
|
260
259
|
isFetchingSchema: isFetchingSchema
|
|
@@ -548,8 +547,8 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
548
547
|
});
|
|
549
548
|
};
|
|
550
549
|
|
|
551
|
-
function ownKeys$
|
|
552
|
-
function _objectSpread$
|
|
550
|
+
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; }
|
|
551
|
+
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; }
|
|
553
552
|
var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
554
553
|
var label = _ref.label,
|
|
555
554
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -575,7 +574,7 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
575
574
|
styles: {
|
|
576
575
|
option: function option(styles, _ref2) {
|
|
577
576
|
var data = _ref2.data;
|
|
578
|
-
return _objectSpread$
|
|
577
|
+
return _objectSpread$3(_objectSpread$3({}, styles), {}, {
|
|
579
578
|
fontFamily: data.value
|
|
580
579
|
});
|
|
581
580
|
}
|
|
@@ -640,8 +639,8 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
640
639
|
};
|
|
641
640
|
|
|
642
641
|
var _excluded = ["label", "name"];
|
|
643
|
-
function ownKeys$
|
|
644
|
-
function _objectSpread$
|
|
642
|
+
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; }
|
|
643
|
+
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; }
|
|
645
644
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
646
645
|
var label = _ref.label,
|
|
647
646
|
name = _ref.name,
|
|
@@ -651,23 +650,22 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
651
650
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
652
651
|
style: "body2",
|
|
653
652
|
children: label
|
|
654
|
-
}), /*#__PURE__*/jsx(Switch, _objectSpread$
|
|
653
|
+
}), /*#__PURE__*/jsx(Switch, _objectSpread$2({}, _objectSpread$2({
|
|
655
654
|
name: name
|
|
656
655
|
}, switchProps)))]
|
|
657
656
|
});
|
|
658
657
|
};
|
|
659
658
|
|
|
660
|
-
var Properties = function Properties() {
|
|
659
|
+
var Properties = function Properties(_ref) {
|
|
660
|
+
var onPropertiesChange = _ref.onPropertiesChange;
|
|
661
661
|
var _useTranslation = useTranslation(),
|
|
662
662
|
t = _useTranslation.t;
|
|
663
663
|
var _useConfigStore = useConfigStore(function (store) {
|
|
664
664
|
return {
|
|
665
|
-
themePropertiesSchema: store["themePropertiesSchema"]
|
|
666
|
-
onPropertiesChange: store["onPropertiesChange"]
|
|
665
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
667
666
|
};
|
|
668
667
|
}, shallow),
|
|
669
|
-
themePropertiesSchema = _useConfigStore.themePropertiesSchema
|
|
670
|
-
onPropertiesChange = _useConfigStore.onPropertiesChange;
|
|
668
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
671
669
|
var _useThemeStore = useThemeStore(function (store) {
|
|
672
670
|
return {
|
|
673
671
|
setThemeState: store["setThemeState"]
|
|
@@ -681,9 +679,9 @@ var Properties = function Properties() {
|
|
|
681
679
|
setVariable = _useThemeUtils.setVariable,
|
|
682
680
|
setTheme = _useThemeUtils.setTheme;
|
|
683
681
|
var handleColorChange = function handleColorChange(name) {
|
|
684
|
-
return function (
|
|
685
|
-
var hex =
|
|
686
|
-
rgb =
|
|
682
|
+
return function (_ref2) {
|
|
683
|
+
var hex = _ref2.hex,
|
|
684
|
+
rgb = _ref2.rgb;
|
|
687
685
|
handleChange(name, hex, "".concat(rgb.r, ", ").concat(rgb.g, ", ").concat(rgb.b, ", ").concat(rgb.a));
|
|
688
686
|
};
|
|
689
687
|
};
|
|
@@ -720,27 +718,27 @@ var Properties = function Properties() {
|
|
|
720
718
|
className: "divide-y divide-gray-200",
|
|
721
719
|
children: [filterBy({
|
|
722
720
|
kind: "font_family"
|
|
723
|
-
}, values.properties).map(function (
|
|
724
|
-
var key =
|
|
725
|
-
value =
|
|
726
|
-
kind =
|
|
721
|
+
}, values.properties).map(function (_ref3) {
|
|
722
|
+
var key = _ref3.key,
|
|
723
|
+
value = _ref3.value,
|
|
724
|
+
kind = _ref3.kind;
|
|
727
725
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(FontPickerBlock, {
|
|
728
726
|
label: buildLabel(key, kind),
|
|
729
727
|
options: FONT_OPTIONS,
|
|
730
728
|
value: findBy({
|
|
731
729
|
value: value || null
|
|
732
730
|
}, FONT_OPTIONS),
|
|
733
|
-
onChange: function onChange(
|
|
734
|
-
var value =
|
|
731
|
+
onChange: function onChange(_ref4) {
|
|
732
|
+
var value = _ref4.value;
|
|
735
733
|
handleChange(key, value);
|
|
736
734
|
}
|
|
737
735
|
}, key);
|
|
738
736
|
}), filterBy({
|
|
739
737
|
kind: "color"
|
|
740
|
-
}, values.properties).map(function (
|
|
741
|
-
var key =
|
|
742
|
-
value =
|
|
743
|
-
kind =
|
|
738
|
+
}, values.properties).map(function (_ref5) {
|
|
739
|
+
var key = _ref5.key,
|
|
740
|
+
value = _ref5.value,
|
|
741
|
+
kind = _ref5.kind;
|
|
744
742
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(ColorBlock, {
|
|
745
743
|
color: value,
|
|
746
744
|
label: buildLabel(key, kind),
|
|
@@ -748,10 +746,10 @@ var Properties = function Properties() {
|
|
|
748
746
|
}, key);
|
|
749
747
|
}), filterBy({
|
|
750
748
|
kind: "overlay_opacity"
|
|
751
|
-
}, values.properties).map(function (
|
|
752
|
-
var key =
|
|
753
|
-
value =
|
|
754
|
-
kind =
|
|
749
|
+
}, values.properties).map(function (_ref6) {
|
|
750
|
+
var key = _ref6.key,
|
|
751
|
+
value = _ref6.value,
|
|
752
|
+
kind = _ref6.kind;
|
|
755
753
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(SliderBlock, {
|
|
756
754
|
label: buildLabel(key, kind),
|
|
757
755
|
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
@@ -764,11 +762,11 @@ var Properties = function Properties() {
|
|
|
764
762
|
}, key);
|
|
765
763
|
}), filterBy({
|
|
766
764
|
kind: "position_selector"
|
|
767
|
-
}, values.properties).map(function (
|
|
765
|
+
}, values.properties).map(function (_ref7) {
|
|
768
766
|
var _findBy;
|
|
769
|
-
var key =
|
|
770
|
-
kind =
|
|
771
|
-
value =
|
|
767
|
+
var key = _ref7.key,
|
|
768
|
+
kind = _ref7.kind,
|
|
769
|
+
value = _ref7.value;
|
|
772
770
|
var index = findIndexBy({
|
|
773
771
|
key: key
|
|
774
772
|
}, values.properties);
|
|
@@ -786,10 +784,10 @@ var Properties = function Properties() {
|
|
|
786
784
|
}, key);
|
|
787
785
|
}), filterBy({
|
|
788
786
|
kind: "boolean"
|
|
789
|
-
}, values.properties).map(function (
|
|
790
|
-
var key =
|
|
791
|
-
kind =
|
|
792
|
-
value =
|
|
787
|
+
}, values.properties).map(function (_ref8) {
|
|
788
|
+
var key = _ref8.key,
|
|
789
|
+
kind = _ref8.kind,
|
|
790
|
+
value = _ref8.value;
|
|
793
791
|
var index = findIndexBy({
|
|
794
792
|
key: key
|
|
795
793
|
}, values.properties);
|
|
@@ -817,20 +815,33 @@ var ThemeMeta = withT(function (_ref) {
|
|
|
817
815
|
});
|
|
818
816
|
});
|
|
819
817
|
|
|
820
|
-
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; }
|
|
821
|
-
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; }
|
|
818
|
+
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; }
|
|
819
|
+
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; }
|
|
822
820
|
var Customize = function Customize(_ref) {
|
|
823
821
|
var themeId = _ref.themeId,
|
|
824
822
|
theme = _ref.theme,
|
|
825
|
-
onCreateTheme = _ref.onCreateTheme
|
|
823
|
+
onCreateTheme = _ref.onCreateTheme,
|
|
824
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
825
|
+
isApplyingTheme = _ref.isApplyingTheme,
|
|
826
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
826
827
|
var _useTranslation = useTranslation(),
|
|
827
828
|
t = _useTranslation.t;
|
|
829
|
+
var _useState = useState({}),
|
|
830
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
831
|
+
popoverInstance = _useState2[0],
|
|
832
|
+
setPopoverInstance = _useState2[1];
|
|
828
833
|
var _useConfigStore = useConfigStore(function (store) {
|
|
829
834
|
return {
|
|
830
|
-
themePropertiesSchema: store["themePropertiesSchema"]
|
|
835
|
+
themePropertiesSchema: store["themePropertiesSchema"],
|
|
836
|
+
entityType: store["entityType"]
|
|
831
837
|
};
|
|
832
838
|
}, shallow),
|
|
833
|
-
themePropertiesSchema = _useConfigStore.themePropertiesSchema
|
|
839
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema,
|
|
840
|
+
entityType = _useConfigStore.entityType;
|
|
841
|
+
var _useThemeUtils = useThemeUtils(),
|
|
842
|
+
currentTheme = _useThemeUtils.currentTheme;
|
|
843
|
+
var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
|
|
844
|
+
var submitBtnRef = useRef(null);
|
|
834
845
|
var _useCreateTheme = useCreateTheme(),
|
|
835
846
|
createTheme = _useCreateTheme.mutate,
|
|
836
847
|
isCreating = _useCreateTheme.isPending;
|
|
@@ -841,7 +852,7 @@ var Customize = function Customize(_ref) {
|
|
|
841
852
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
842
853
|
var resetForm = _ref2.resetForm;
|
|
843
854
|
var imageData = buildImageData(values, themePropertiesSchema);
|
|
844
|
-
var themeToSave = _objectSpread({
|
|
855
|
+
var themeToSave = _objectSpread$1({
|
|
845
856
|
propertiesAttributes: values.properties,
|
|
846
857
|
name: values.name
|
|
847
858
|
}, imageData);
|
|
@@ -849,6 +860,9 @@ var Customize = function Customize(_ref) {
|
|
|
849
860
|
return createTheme(themeToSave, {
|
|
850
861
|
onSuccess: function onSuccess(_ref3) {
|
|
851
862
|
var theme = _ref3.theme;
|
|
863
|
+
resetForm({
|
|
864
|
+
values: values
|
|
865
|
+
});
|
|
852
866
|
onCreateTheme(theme);
|
|
853
867
|
}
|
|
854
868
|
});
|
|
@@ -873,7 +887,9 @@ var Customize = function Customize(_ref) {
|
|
|
873
887
|
className: "neeto-themes-sidebar__scroll",
|
|
874
888
|
children: [/*#__PURE__*/jsxs("div", {
|
|
875
889
|
className: "flex flex-col gap-6 p-4",
|
|
876
|
-
children: [/*#__PURE__*/jsx(ThemeMeta, {}), /*#__PURE__*/jsx(Properties, {
|
|
890
|
+
children: [/*#__PURE__*/jsx(ThemeMeta, {}), /*#__PURE__*/jsx(Properties, {
|
|
891
|
+
onPropertiesChange: onPropertiesChange
|
|
892
|
+
}), filterBy({
|
|
877
893
|
kind: "image"
|
|
878
894
|
}, themePropertiesSchema).map(function (_ref5) {
|
|
879
895
|
var key = _ref5.key;
|
|
@@ -894,14 +910,127 @@ var Customize = function Customize(_ref) {
|
|
|
894
910
|
disabled: !dirty && (theme === null || theme === void 0 ? void 0 : theme.id) || isSubmitting,
|
|
895
911
|
label: t("neetoThemes.buttons.save"),
|
|
896
912
|
loading: isSubmitting,
|
|
913
|
+
ref: submitBtnRef,
|
|
897
914
|
type: "submit"
|
|
898
915
|
})]
|
|
916
|
+
}), /*#__PURE__*/jsx(Popover, {
|
|
917
|
+
appendTo: function appendTo() {
|
|
918
|
+
return document.body;
|
|
919
|
+
},
|
|
920
|
+
disabled: isEditingCurrentlyAppliedTheme,
|
|
921
|
+
position: "top",
|
|
922
|
+
reference: submitBtnRef,
|
|
923
|
+
trigger: "click",
|
|
924
|
+
content: /*#__PURE__*/jsxs("div", {
|
|
925
|
+
className: "flex flex-col items-start gap-2",
|
|
926
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
927
|
+
className: "absolute right-1 top-1 z-0",
|
|
928
|
+
icon: Close,
|
|
929
|
+
size: "small",
|
|
930
|
+
style: "text",
|
|
931
|
+
onClick: function onClick() {
|
|
932
|
+
var _popoverInstance$hide;
|
|
933
|
+
return popoverInstance === null || popoverInstance === void 0 || (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
934
|
+
}
|
|
935
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
936
|
+
className: "w-72 pr-5",
|
|
937
|
+
style: "body2",
|
|
938
|
+
weight: "normal",
|
|
939
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
940
|
+
components: {
|
|
941
|
+
bold: /*#__PURE__*/jsx("strong", {})
|
|
942
|
+
},
|
|
943
|
+
i18nKey: "neetoThemes.build.leftSideBar.themes.notAppliedYet",
|
|
944
|
+
values: {
|
|
945
|
+
entityType: entityType
|
|
946
|
+
}
|
|
947
|
+
})
|
|
948
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
949
|
+
disabled: isApplyingTheme,
|
|
950
|
+
label: t("neetoThemes.buttons.applyThisTheme"),
|
|
951
|
+
loading: isApplyingTheme,
|
|
952
|
+
onClick: function onClick() {
|
|
953
|
+
return onApplyTheme(theme);
|
|
954
|
+
}
|
|
955
|
+
})]
|
|
956
|
+
}),
|
|
957
|
+
onMount: setPopoverInstance
|
|
899
958
|
})]
|
|
900
959
|
});
|
|
901
960
|
}
|
|
902
961
|
});
|
|
903
962
|
};
|
|
904
963
|
|
|
964
|
+
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; }
|
|
965
|
+
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; }
|
|
966
|
+
var Check = function Check(props) {
|
|
967
|
+
return /*#__PURE__*/jsxs("svg", _objectSpread(_objectSpread({
|
|
968
|
+
fill: "none",
|
|
969
|
+
height: "24",
|
|
970
|
+
viewBox: "0 0 24 24",
|
|
971
|
+
width: "24",
|
|
972
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
973
|
+
}, props), {}, {
|
|
974
|
+
children: [/*#__PURE__*/jsxs("g", {
|
|
975
|
+
filter: "url(#filter0_d_9519_161)",
|
|
976
|
+
children: [/*#__PURE__*/jsx("rect", {
|
|
977
|
+
fill: "#4558F9",
|
|
978
|
+
height: "20",
|
|
979
|
+
rx: "10",
|
|
980
|
+
width: "20",
|
|
981
|
+
x: "2",
|
|
982
|
+
y: "2"
|
|
983
|
+
}), /*#__PURE__*/jsx("rect", {
|
|
984
|
+
height: "20",
|
|
985
|
+
rx: "10",
|
|
986
|
+
stroke: "#fff",
|
|
987
|
+
strokeWidth: "1.5",
|
|
988
|
+
width: "20",
|
|
989
|
+
x: "2",
|
|
990
|
+
y: "2"
|
|
991
|
+
}), /*#__PURE__*/jsx("path", {
|
|
992
|
+
d: "M16.375 9.5l-5.95 6.25-2.8-2.941",
|
|
993
|
+
stroke: "#fff",
|
|
994
|
+
strokeLinecap: "round",
|
|
995
|
+
strokeLinejoin: "round",
|
|
996
|
+
strokeWidth: "1.25"
|
|
997
|
+
})]
|
|
998
|
+
}), /*#__PURE__*/jsx("defs", {
|
|
999
|
+
children: /*#__PURE__*/jsxs("filter", {
|
|
1000
|
+
colorInterpolationFilters: "sRGB",
|
|
1001
|
+
filterUnits: "userSpaceOnUse",
|
|
1002
|
+
height: "23.5",
|
|
1003
|
+
id: "filter0_d_9519_161",
|
|
1004
|
+
width: "23.5",
|
|
1005
|
+
x: "0.25",
|
|
1006
|
+
y: "0.25",
|
|
1007
|
+
children: [/*#__PURE__*/jsx("feFlood", {
|
|
1008
|
+
floodOpacity: "0",
|
|
1009
|
+
result: "BackgroundImageFix"
|
|
1010
|
+
}), /*#__PURE__*/jsx("feColorMatrix", {
|
|
1011
|
+
"in": "SourceAlpha",
|
|
1012
|
+
result: "hardAlpha",
|
|
1013
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1014
|
+
}), /*#__PURE__*/jsx("feOffset", {}), /*#__PURE__*/jsx("feGaussianBlur", {
|
|
1015
|
+
stdDeviation: "0.5"
|
|
1016
|
+
}), /*#__PURE__*/jsx("feComposite", {
|
|
1017
|
+
in2: "hardAlpha",
|
|
1018
|
+
operator: "out"
|
|
1019
|
+
}), /*#__PURE__*/jsx("feColorMatrix", {
|
|
1020
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0"
|
|
1021
|
+
}), /*#__PURE__*/jsx("feBlend", {
|
|
1022
|
+
in2: "BackgroundImageFix",
|
|
1023
|
+
result: "effect1_dropShadow_9519_161"
|
|
1024
|
+
}), /*#__PURE__*/jsx("feBlend", {
|
|
1025
|
+
"in": "SourceGraphic",
|
|
1026
|
+
in2: "effect1_dropShadow_9519_161",
|
|
1027
|
+
result: "shape"
|
|
1028
|
+
})]
|
|
1029
|
+
})
|
|
1030
|
+
})]
|
|
1031
|
+
}));
|
|
1032
|
+
};
|
|
1033
|
+
|
|
905
1034
|
var Thumbnail = function Thumbnail(_ref) {
|
|
906
1035
|
var _theme$snakeToCamelCa, _findBy, _findBy2;
|
|
907
1036
|
var active = _ref.active,
|
|
@@ -988,35 +1117,17 @@ var Card = function Card(_ref) {
|
|
|
988
1117
|
onSetPreviewTheme = _ref.onSetPreviewTheme,
|
|
989
1118
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
990
1119
|
onEditTheme = _ref.onEditTheme,
|
|
991
|
-
applyTheme = _ref.applyTheme,
|
|
992
1120
|
theme = _ref.theme,
|
|
993
1121
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
994
1122
|
onCloneTheme = _ref.onCloneTheme,
|
|
995
1123
|
isHighLightedTheme = _ref.isHighLightedTheme,
|
|
996
|
-
|
|
1124
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
997
1125
|
Thumbnail$1 = _ref.thumbnail;
|
|
998
1126
|
var _useTranslation = useTranslation(),
|
|
999
1127
|
t = _useTranslation.t;
|
|
1000
1128
|
var id = theme.id,
|
|
1001
1129
|
name = theme.name,
|
|
1002
1130
|
appliedCount = theme.appliedCount;
|
|
1003
|
-
var _useConfigStore = useConfigStore(function (store) {
|
|
1004
|
-
return {
|
|
1005
|
-
entityId: store["entityId"],
|
|
1006
|
-
entityType: store["entityType"]
|
|
1007
|
-
};
|
|
1008
|
-
}, shallow),
|
|
1009
|
-
entityId = _useConfigStore.entityId,
|
|
1010
|
-
entityType = _useConfigStore.entityType;
|
|
1011
|
-
var handleApplyThemeClick = function handleApplyThemeClick() {
|
|
1012
|
-
if (isApplyingTheme) return;
|
|
1013
|
-
setThemeBeingApplied(theme);
|
|
1014
|
-
applyTheme({
|
|
1015
|
-
themeId: theme.id,
|
|
1016
|
-
entityId: entityId,
|
|
1017
|
-
entityType: entityType
|
|
1018
|
-
});
|
|
1019
|
-
};
|
|
1020
1131
|
var handleCloneTheme = function handleCloneTheme() {
|
|
1021
1132
|
return onCloneTheme(theme);
|
|
1022
1133
|
};
|
|
@@ -1026,55 +1137,73 @@ var Card = function Card(_ref) {
|
|
|
1026
1137
|
var handleDeleteTheme = function handleDeleteTheme() {
|
|
1027
1138
|
return onDeleteTheme(id, name, appliedCount);
|
|
1028
1139
|
};
|
|
1029
|
-
return /*#__PURE__*/
|
|
1140
|
+
return /*#__PURE__*/jsx("div", {
|
|
1030
1141
|
className: "group space-y-2 pt-0.5",
|
|
1031
1142
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
1032
1143
|
id: theme.id,
|
|
1033
|
-
children:
|
|
1144
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
1145
|
+
className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg cursor-pointer border transition-all duration-300 ease-in-out", {
|
|
1146
|
+
"neeto-ui-border-gray-200": !active,
|
|
1147
|
+
"neeto-themes-theme-thumbnail--active": active,
|
|
1148
|
+
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
1149
|
+
"neeto-themes-theme-thumbnail--highlight-active": isHighLightedTheme
|
|
1150
|
+
}),
|
|
1034
1151
|
onClick: function onClick() {
|
|
1035
1152
|
return onSetPreviewTheme(theme);
|
|
1036
1153
|
},
|
|
1037
|
-
children:
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1154
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1155
|
+
className: "neeto-ui-rounded-lg relative overflow-hidden rounded-bl-none rounded-br-none transition-all duration-300 ease-in-out group-hover:opacity-85",
|
|
1156
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
1157
|
+
className: "absolute right-0 top-0 p-3",
|
|
1158
|
+
children: active ? /*#__PURE__*/jsx(Check, {
|
|
1159
|
+
className: "flex-shrink-0",
|
|
1160
|
+
"data-cy": "active-theme-label"
|
|
1161
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
1162
|
+
className: classnames({
|
|
1163
|
+
hidden: !isPreviewing,
|
|
1164
|
+
"group-hover:block": true
|
|
1165
|
+
}),
|
|
1166
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
1167
|
+
className: "neeto-themes-theme-thumbnail__apply-btn flex-shrink-0",
|
|
1168
|
+
"data-cy": "apply-theme-button",
|
|
1169
|
+
disabled: isApplyingTheme,
|
|
1170
|
+
label: t("neetoThemes.common.apply"),
|
|
1171
|
+
loading: isApplyingTheme,
|
|
1172
|
+
size: "small",
|
|
1173
|
+
style: "tertiary",
|
|
1174
|
+
onClick: function onClick() {
|
|
1175
|
+
return onApplyTheme(theme);
|
|
1176
|
+
}
|
|
1177
|
+
})
|
|
1178
|
+
})
|
|
1179
|
+
}), Thumbnail$1 ? /*#__PURE__*/jsx(Thumbnail$1, {
|
|
1180
|
+
active: active,
|
|
1181
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
1182
|
+
isPreviewing: isPreviewing,
|
|
1183
|
+
theme: theme
|
|
1184
|
+
}) : /*#__PURE__*/jsx(Thumbnail, {
|
|
1185
|
+
active: active,
|
|
1186
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
1187
|
+
isPreviewing: isPreviewing,
|
|
1188
|
+
theme: theme
|
|
1189
|
+
})]
|
|
1056
1190
|
}), /*#__PURE__*/jsxs("div", {
|
|
1057
|
-
className: "flex items-
|
|
1058
|
-
children: [
|
|
1059
|
-
className: "flex-
|
|
1060
|
-
"data-cy": "
|
|
1061
|
-
|
|
1062
|
-
style: "
|
|
1063
|
-
|
|
1064
|
-
className: "flex-shrink-0",
|
|
1065
|
-
"data-cy": "apply-theme-button",
|
|
1066
|
-
disabled: isApplyingTheme,
|
|
1067
|
-
label: t("neetoThemes.common.apply"),
|
|
1068
|
-
loading: isApplyingTheme,
|
|
1069
|
-
size: "small",
|
|
1070
|
-
style: "link",
|
|
1071
|
-
onClick: handleApplyThemeClick
|
|
1191
|
+
className: "flex items-start justify-between gap-1 p-3",
|
|
1192
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1193
|
+
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
1194
|
+
"data-cy": "theme-name",
|
|
1195
|
+
lineHeight: "snug",
|
|
1196
|
+
style: "body2",
|
|
1197
|
+
children: name
|
|
1072
1198
|
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
1073
1199
|
dropdownButtonProps: {
|
|
1074
1200
|
size: "small"
|
|
1075
1201
|
},
|
|
1076
1202
|
dropdownProps: {
|
|
1077
|
-
strategy: "fixed"
|
|
1203
|
+
strategy: "fixed",
|
|
1204
|
+
onClick: function onClick(e) {
|
|
1205
|
+
return e.stopPropagation();
|
|
1206
|
+
}
|
|
1078
1207
|
},
|
|
1079
1208
|
menuItems: [{
|
|
1080
1209
|
key: "edit",
|
|
@@ -1098,7 +1227,7 @@ var Card = function Card(_ref) {
|
|
|
1098
1227
|
}]
|
|
1099
1228
|
})]
|
|
1100
1229
|
})]
|
|
1101
|
-
})
|
|
1230
|
+
})
|
|
1102
1231
|
});
|
|
1103
1232
|
};
|
|
1104
1233
|
var Card$1 = /*#__PURE__*/memo(Card);
|
|
@@ -1111,12 +1240,14 @@ var Themes = function Themes(_ref) {
|
|
|
1111
1240
|
defaultThemes = _ref$defaultThemes === void 0 ? [] : _ref$defaultThemes,
|
|
1112
1241
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
1113
1242
|
themeToHighlight = _ref.themeToHighlight,
|
|
1114
|
-
highlightTheme = _ref.highlightTheme,
|
|
1115
1243
|
didScrollActiveThemeIntoView = _ref.didScrollActiveThemeIntoView,
|
|
1116
1244
|
isLoading = _ref.isLoading,
|
|
1117
1245
|
currentTheme = _ref.currentTheme,
|
|
1118
1246
|
isCurrentThemeLoading = _ref.isCurrentThemeLoading,
|
|
1119
|
-
thumbnail = _ref.thumbnail
|
|
1247
|
+
thumbnail = _ref.thumbnail,
|
|
1248
|
+
themeBeingApplied = _ref.themeBeingApplied,
|
|
1249
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
1250
|
+
isApplyingTheme = _ref.isApplyingTheme;
|
|
1120
1251
|
var _useTranslation = useTranslation(),
|
|
1121
1252
|
t = _useTranslation.t;
|
|
1122
1253
|
var _useThemeUtils = useThemeUtils(),
|
|
@@ -1133,24 +1264,8 @@ var Themes = function Themes(_ref) {
|
|
|
1133
1264
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1134
1265
|
searchQuery = _useState2[0],
|
|
1135
1266
|
setSearchQuery = _useState2[1];
|
|
1136
|
-
var _useState3 = useState({}),
|
|
1137
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1138
|
-
themeBeingApplied = _useState4[0],
|
|
1139
|
-
setThemeBeingApplied = _useState4[1];
|
|
1140
1267
|
var _useCloneTheme = useCloneTheme(),
|
|
1141
1268
|
cloneTheme = _useCloneTheme.mutate;
|
|
1142
|
-
var _useApplyTheme = useApplyTheme({
|
|
1143
|
-
onSuccess: function onSuccess(_ref2) {
|
|
1144
|
-
var theme = _ref2.theme;
|
|
1145
|
-
setTheme(theme);
|
|
1146
|
-
setThemeState({
|
|
1147
|
-
previewingTheme: theme
|
|
1148
|
-
});
|
|
1149
|
-
setThemeBeingApplied({});
|
|
1150
|
-
}
|
|
1151
|
-
}),
|
|
1152
|
-
applyTheme = _useApplyTheme.mutate,
|
|
1153
|
-
isApplyingTheme = _useApplyTheme.isPending;
|
|
1154
1269
|
useEffect(function () {
|
|
1155
1270
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
1156
1271
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -1173,9 +1288,9 @@ var Themes = function Themes(_ref) {
|
|
|
1173
1288
|
var isSearchFieldVisible = (themes === null || themes === void 0 ? void 0 : themes.length) + (defaultThemes === null || defaultThemes === void 0 ? void 0 : defaultThemes.length) > 10;
|
|
1174
1289
|
var handleCloneTheme = function handleCloneTheme(data) {
|
|
1175
1290
|
cloneTheme(data.id, {
|
|
1176
|
-
onSuccess: function onSuccess(
|
|
1177
|
-
var clonedTheme =
|
|
1178
|
-
|
|
1291
|
+
onSuccess: function onSuccess(_ref2) {
|
|
1292
|
+
var clonedTheme = _ref2.theme;
|
|
1293
|
+
onEditTheme(clonedTheme);
|
|
1179
1294
|
}
|
|
1180
1295
|
});
|
|
1181
1296
|
};
|
|
@@ -1210,8 +1325,7 @@ var Themes = function Themes(_ref) {
|
|
|
1210
1325
|
className: "flex flex-col gap-4 px-4 pb-10 lg:px-5 xl:px-6",
|
|
1211
1326
|
children: filteredDefaultThemes.map(function (theme) {
|
|
1212
1327
|
return /*#__PURE__*/createElement(Card$1, {
|
|
1213
|
-
|
|
1214
|
-
setThemeBeingApplied: setThemeBeingApplied,
|
|
1328
|
+
onApplyTheme: onApplyTheme,
|
|
1215
1329
|
theme: theme,
|
|
1216
1330
|
thumbnail: thumbnail,
|
|
1217
1331
|
active: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id,
|
|
@@ -1238,10 +1352,9 @@ var Themes = function Themes(_ref) {
|
|
|
1238
1352
|
var isActive = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id;
|
|
1239
1353
|
var isPreviewing = (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id;
|
|
1240
1354
|
return /*#__PURE__*/createElement(Card$1, {
|
|
1241
|
-
applyTheme: applyTheme,
|
|
1242
1355
|
isPreviewing: isPreviewing,
|
|
1356
|
+
onApplyTheme: onApplyTheme,
|
|
1243
1357
|
onEditTheme: onEditTheme,
|
|
1244
|
-
setThemeBeingApplied: setThemeBeingApplied,
|
|
1245
1358
|
theme: theme,
|
|
1246
1359
|
thumbnail: thumbnail,
|
|
1247
1360
|
active: isActive,
|
|
@@ -1321,7 +1434,8 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1321
1434
|
var MemoizedAlert = /*#__PURE__*/memo(Alert);
|
|
1322
1435
|
var Sidebar = function Sidebar(_ref) {
|
|
1323
1436
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3;
|
|
1324
|
-
var thumbnail = _ref.thumbnail
|
|
1437
|
+
var thumbnail = _ref.thumbnail,
|
|
1438
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
1325
1439
|
var _useState = useState(DESIGN_SCREENS.THEMES),
|
|
1326
1440
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1327
1441
|
currentScreen = _useState2[0],
|
|
@@ -1334,6 +1448,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1334
1448
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1335
1449
|
themeToHighlight = _useState6[0],
|
|
1336
1450
|
setThemeToHighlight = _useState6[1];
|
|
1451
|
+
var _useState7 = useState({}),
|
|
1452
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1453
|
+
themeBeingApplied = _useState8[0],
|
|
1454
|
+
setThemeBeingApplied = _useState8[1];
|
|
1337
1455
|
var _useConfigStore = useConfigStore(function (store) {
|
|
1338
1456
|
return {
|
|
1339
1457
|
entityType: store["entityType"],
|
|
@@ -1372,12 +1490,34 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1372
1490
|
var _useDeleteTheme = useDeleteTheme(),
|
|
1373
1491
|
deleteTheme = _useDeleteTheme.mutate,
|
|
1374
1492
|
isDeleting = _useDeleteTheme.isPending;
|
|
1493
|
+
var _useApplyTheme = useApplyTheme({
|
|
1494
|
+
onSuccess: function onSuccess(_ref2) {
|
|
1495
|
+
var theme = _ref2.theme;
|
|
1496
|
+
setTheme(theme);
|
|
1497
|
+
setThemeState({
|
|
1498
|
+
previewingTheme: theme
|
|
1499
|
+
});
|
|
1500
|
+
setThemeBeingApplied({});
|
|
1501
|
+
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1502
|
+
}
|
|
1503
|
+
}),
|
|
1504
|
+
applyTheme = _useApplyTheme.mutate,
|
|
1505
|
+
isApplyingTheme = _useApplyTheme.isLoading;
|
|
1375
1506
|
var themeToDelete = useRef(null);
|
|
1376
1507
|
var themeToEdit = useRef(null);
|
|
1377
1508
|
var handleEditTheme = function handleEditTheme(theme) {
|
|
1378
1509
|
themeToEdit.current = theme;
|
|
1379
1510
|
setCurrentScreen(DESIGN_SCREENS.Customize);
|
|
1380
1511
|
};
|
|
1512
|
+
var onApplyTheme = function onApplyTheme(theme) {
|
|
1513
|
+
if (isApplyingTheme) return;
|
|
1514
|
+
setThemeBeingApplied(theme);
|
|
1515
|
+
applyTheme({
|
|
1516
|
+
themeId: theme.id,
|
|
1517
|
+
entityId: entityId,
|
|
1518
|
+
entityType: entityType
|
|
1519
|
+
});
|
|
1520
|
+
};
|
|
1381
1521
|
var handleBackPress = function handleBackPress() {
|
|
1382
1522
|
setTheme(currentTheme);
|
|
1383
1523
|
setThemeState({
|
|
@@ -1396,13 +1536,11 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1396
1536
|
setThemeToHighlight(themeToHighlight.id);
|
|
1397
1537
|
};
|
|
1398
1538
|
var onCreateTheme = function onCreateTheme(createdTheme) {
|
|
1399
|
-
|
|
1539
|
+
themeToEdit.current = createdTheme;
|
|
1400
1540
|
setTheme(createdTheme);
|
|
1401
1541
|
setThemeState({
|
|
1402
1542
|
previewingTheme: createdTheme
|
|
1403
1543
|
});
|
|
1404
|
-
highlightTheme(createdTheme);
|
|
1405
|
-
themeToEdit.current = null;
|
|
1406
1544
|
};
|
|
1407
1545
|
var handleDelete = function handleDelete(themeId, name, appliedCount) {
|
|
1408
1546
|
setIsDeleteAlertOpen(true);
|
|
@@ -1451,7 +1589,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1451
1589
|
defaultThemes: defaultThemes,
|
|
1452
1590
|
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
1453
1591
|
highlightTheme: highlightTheme,
|
|
1592
|
+
isApplyingTheme: isApplyingTheme,
|
|
1454
1593
|
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
1594
|
+
onApplyTheme: onApplyTheme,
|
|
1595
|
+
themeBeingApplied: themeBeingApplied,
|
|
1455
1596
|
themeToHighlight: themeToHighlight,
|
|
1456
1597
|
themes: themes,
|
|
1457
1598
|
thumbnail: thumbnail,
|
|
@@ -1459,7 +1600,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1459
1600
|
onDeleteTheme: handleDelete,
|
|
1460
1601
|
onEditTheme: handleEditTheme
|
|
1461
1602
|
}) : /*#__PURE__*/jsx(Customize, {
|
|
1603
|
+
isApplyingTheme: isApplyingTheme,
|
|
1604
|
+
onApplyTheme: onApplyTheme,
|
|
1462
1605
|
onCreateTheme: onCreateTheme,
|
|
1606
|
+
onPropertiesChange: onPropertiesChange,
|
|
1463
1607
|
theme: themeToEdit.current,
|
|
1464
1608
|
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
|
|
1465
1609
|
}), /*#__PURE__*/jsx(MemoizedAlert, {
|
|
@@ -1498,13 +1642,13 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1498
1642
|
useEffect(function () {
|
|
1499
1643
|
setConfigState({
|
|
1500
1644
|
entityType: entityType,
|
|
1501
|
-
entityId: entityId
|
|
1502
|
-
onPropertiesChange: onPropertiesChange
|
|
1645
|
+
entityId: entityId
|
|
1503
1646
|
});
|
|
1504
1647
|
}, []);
|
|
1505
1648
|
return /*#__PURE__*/jsxs("div", {
|
|
1506
1649
|
className: "neeto-themes__wrapper",
|
|
1507
1650
|
children: [/*#__PURE__*/jsx(Sidebar, {
|
|
1651
|
+
onPropertiesChange: onPropertiesChange,
|
|
1508
1652
|
thumbnail: thumbnail
|
|
1509
1653
|
}), /*#__PURE__*/jsx("div", {
|
|
1510
1654
|
className: "neeto-themes-preview__wrapper",
|
|
@@ -1519,7 +1663,7 @@ var index = withTitle(NeetoThemesBuilder, t$1("neetoThemes.common.design"));
|
|
|
1519
1663
|
|
|
1520
1664
|
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}}
|
|
1521
1665
|
|
|
1522
|
-
var css = ".neeto-themes__wrapper{display:flex;width:100%}.neeto-themes__wrapper .neeto-themes-sidebar{background-color:rgb(var(--neeto-ui-white));box-shadow:var(--neeto-ui-shadow-s);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--active{border-color:rgb(var(--neeto-ui-
|
|
1666
|
+
var css = ".neeto-themes__wrapper{display:flex;width:100%}.neeto-themes__wrapper .neeto-themes-sidebar{background-color:rgb(var(--neeto-ui-white));box-shadow:var(--neeto-ui-shadow-s);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,.neeto-themes-theme-thumbnail--highlight-active{border-color:rgb(var(--neeto-ui-primary-500))!important;outline:2px solid rgb(var(--neeto-ui-primary-500))!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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3RoZW1lcy5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVza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TUwMCkpICFpbXBvcnRhbnQ7XG4gIG91dGxpbmU6IDJweCBzb2xpZCByZ2IodmFyKC0tbmVldG8tdWktcHJpbWFyeS01MDApKSAhaW1wb3J0YW50O1xufVxuXG4ubmVldG8tdGhlbWVzLXRoZW1lLXRodW1ibmFpbC0taGlnaGxpZ2h0LWFjdGl2ZSB7XG4gIGJvcmRlci1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLXByaW1hcnktNTAwKSkgIWltcG9ydGFudDtcbiAgb3V0bGluZTogMnB4IHNvbGlkIHJnYih2YXIoLS1uZWV0by11aS1wcmltYXJ5LTUwMCkpICFpbXBvcnRhbnQ7XG59XG5cbi5uZWV0by10aGVtZXMtdGhlbWUtdGh1bWJuYWlsX19hcHBseS1idG4ge1xuICAtLW5lZXRvLXVpLWJ0bi1wYWRkaW5nLXg6IDEycHg7XG4gIC0tbmVldG8tdWktYnRuLWJvcmRlci1yYWRpdXM6IDEwMHB4O1xufVxuLm5lZXRvLXRoZW1lcy10aGVtZS10aHVtYm5haWxfX2FwcGx5LWJ0bjpkaXNhYmxlZCwgLm5lZXRvLXRoZW1lcy10aGVtZS10aHVtYm5haWxfX2FwcGx5LWJ0bltkaXNhYmxlZF0ge1xuICBvcGFjaXR5OiAxICFpbXBvcnRhbnQ7XG59Il19 */";
|
|
1523
1667
|
n(css,{});
|
|
1524
1668
|
|
|
1525
1669
|
export { index as NeetoThemesBuilder, setTheme, useThemeUtils };
|