@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.cjs.js
CHANGED
|
@@ -20,11 +20,13 @@ var axios = require('axios');
|
|
|
20
20
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
21
21
|
var ramda = require('ramda');
|
|
22
22
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
23
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
23
24
|
var Button = require('@bigbinary/neetoui/Button');
|
|
25
|
+
var Popover = require('@bigbinary/neetoui/Popover');
|
|
26
|
+
var Typography = require('@bigbinary/neetoui/Typography');
|
|
24
27
|
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
25
28
|
var yup = require('yup');
|
|
26
29
|
var formik = require('formik');
|
|
27
|
-
var Typography = require('@bigbinary/neetoui/Typography');
|
|
28
30
|
var jsxRuntime = require('react/jsx-runtime');
|
|
29
31
|
var neetoImageUploaderFrontend = require('@bigbinary/neeto-image-uploader-frontend');
|
|
30
32
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
@@ -34,10 +36,8 @@ var antd = require('antd');
|
|
|
34
36
|
var Switch = require('@bigbinary/neetoui/Switch');
|
|
35
37
|
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
36
38
|
var Search = require('@bigbinary/neeto-molecules/Search');
|
|
37
|
-
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
38
|
-
var Tag = require('@bigbinary/neetoui/Tag');
|
|
39
39
|
var classnames = require('classnames');
|
|
40
|
-
var
|
|
40
|
+
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
41
41
|
|
|
42
42
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
43
43
|
|
|
@@ -66,17 +66,17 @@ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
|
66
66
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
67
67
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
68
68
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
69
|
+
var Popover__default = /*#__PURE__*/_interopDefaultLegacy(Popover);
|
|
70
|
+
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
69
71
|
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
70
72
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
71
|
-
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
72
73
|
var ColorPicker__default = /*#__PURE__*/_interopDefaultLegacy(ColorPicker);
|
|
73
74
|
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
74
75
|
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
75
76
|
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
76
77
|
var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
|
|
77
|
-
var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
78
|
-
var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
|
|
79
78
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
79
|
+
var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
80
80
|
|
|
81
81
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
82
82
|
var useConfigStore = zustand.create(reactUtils.withImmutableActions(function (set) {
|
|
@@ -283,21 +283,20 @@ var useThemeUtils = function useThemeUtils() {
|
|
|
283
283
|
currentTheme = _useThemeStore.currentTheme;
|
|
284
284
|
var _useListSchema = useListSchema(),
|
|
285
285
|
isFetchingSchema = _useListSchema.isLoading,
|
|
286
|
-
data = _useListSchema.data
|
|
287
|
-
status = _useListSchema.status;
|
|
286
|
+
data = _useListSchema.data;
|
|
288
287
|
var _ref = data || {},
|
|
289
288
|
_ref$schema = _ref.schema,
|
|
290
289
|
themePropertiesSchema = _ref$schema === void 0 ? [] : _ref$schema,
|
|
291
290
|
_ref$variableNamesMap = _ref.variableNamesMap,
|
|
292
291
|
variableNamesMap = _ref$variableNamesMap === void 0 ? {} : _ref$variableNamesMap;
|
|
293
292
|
react.useEffect(function () {
|
|
294
|
-
if (
|
|
293
|
+
if (data) {
|
|
295
294
|
setConfigState({
|
|
296
295
|
themePropertiesSchema: data === null || data === void 0 ? void 0 : data.schema,
|
|
297
296
|
variableNamesMap: data === null || data === void 0 ? void 0 : data.variableNamesMap
|
|
298
297
|
});
|
|
299
298
|
}
|
|
300
|
-
}, [data
|
|
299
|
+
}, [data]);
|
|
301
300
|
react.useEffect(function () {
|
|
302
301
|
return setConfigState({
|
|
303
302
|
isFetchingSchema: isFetchingSchema
|
|
@@ -591,8 +590,8 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
591
590
|
});
|
|
592
591
|
};
|
|
593
592
|
|
|
594
|
-
function ownKeys$
|
|
595
|
-
function _objectSpread$
|
|
593
|
+
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; }
|
|
594
|
+
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__default["default"](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; }
|
|
596
595
|
var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
597
596
|
var label = _ref.label,
|
|
598
597
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -618,7 +617,7 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
618
617
|
styles: {
|
|
619
618
|
option: function option(styles, _ref2) {
|
|
620
619
|
var data = _ref2.data;
|
|
621
|
-
return _objectSpread$
|
|
620
|
+
return _objectSpread$3(_objectSpread$3({}, styles), {}, {
|
|
622
621
|
fontFamily: data.value
|
|
623
622
|
});
|
|
624
623
|
}
|
|
@@ -683,8 +682,8 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
683
682
|
};
|
|
684
683
|
|
|
685
684
|
var _excluded = ["label", "name"];
|
|
686
|
-
function ownKeys$
|
|
687
|
-
function _objectSpread$
|
|
685
|
+
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; }
|
|
686
|
+
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__default["default"](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; }
|
|
688
687
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
689
688
|
var label = _ref.label,
|
|
690
689
|
name = _ref.name,
|
|
@@ -694,23 +693,22 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
694
693
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
695
694
|
style: "body2",
|
|
696
695
|
children: label
|
|
697
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], _objectSpread$
|
|
696
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], _objectSpread$2({}, _objectSpread$2({
|
|
698
697
|
name: name
|
|
699
698
|
}, switchProps)))]
|
|
700
699
|
});
|
|
701
700
|
};
|
|
702
701
|
|
|
703
|
-
var Properties = function Properties() {
|
|
702
|
+
var Properties = function Properties(_ref) {
|
|
703
|
+
var onPropertiesChange = _ref.onPropertiesChange;
|
|
704
704
|
var _useTranslation = reactI18next.useTranslation(),
|
|
705
705
|
t = _useTranslation.t;
|
|
706
706
|
var _useConfigStore = useConfigStore(function (store) {
|
|
707
707
|
return {
|
|
708
|
-
themePropertiesSchema: store["themePropertiesSchema"]
|
|
709
|
-
onPropertiesChange: store["onPropertiesChange"]
|
|
708
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
710
709
|
};
|
|
711
710
|
}, shallow.shallow),
|
|
712
|
-
themePropertiesSchema = _useConfigStore.themePropertiesSchema
|
|
713
|
-
onPropertiesChange = _useConfigStore.onPropertiesChange;
|
|
711
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
714
712
|
var _useThemeStore = useThemeStore(function (store) {
|
|
715
713
|
return {
|
|
716
714
|
setThemeState: store["setThemeState"]
|
|
@@ -724,9 +722,9 @@ var Properties = function Properties() {
|
|
|
724
722
|
setVariable = _useThemeUtils.setVariable,
|
|
725
723
|
setTheme = _useThemeUtils.setTheme;
|
|
726
724
|
var handleColorChange = function handleColorChange(name) {
|
|
727
|
-
return function (
|
|
728
|
-
var hex =
|
|
729
|
-
rgb =
|
|
725
|
+
return function (_ref2) {
|
|
726
|
+
var hex = _ref2.hex,
|
|
727
|
+
rgb = _ref2.rgb;
|
|
730
728
|
handleChange(name, hex, "".concat(rgb.r, ", ").concat(rgb.g, ", ").concat(rgb.b, ", ").concat(rgb.a));
|
|
731
729
|
};
|
|
732
730
|
};
|
|
@@ -763,27 +761,27 @@ var Properties = function Properties() {
|
|
|
763
761
|
className: "divide-y divide-gray-200",
|
|
764
762
|
children: [neetoCist.filterBy({
|
|
765
763
|
kind: "font_family"
|
|
766
|
-
}, values.properties).map(function (
|
|
767
|
-
var key =
|
|
768
|
-
value =
|
|
769
|
-
kind =
|
|
764
|
+
}, values.properties).map(function (_ref3) {
|
|
765
|
+
var key = _ref3.key,
|
|
766
|
+
value = _ref3.value,
|
|
767
|
+
kind = _ref3.kind;
|
|
770
768
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(FontPickerBlock, {
|
|
771
769
|
label: buildLabel(key, kind),
|
|
772
770
|
options: FONT_OPTIONS,
|
|
773
771
|
value: neetoCist.findBy({
|
|
774
772
|
value: value || null
|
|
775
773
|
}, FONT_OPTIONS),
|
|
776
|
-
onChange: function onChange(
|
|
777
|
-
var value =
|
|
774
|
+
onChange: function onChange(_ref4) {
|
|
775
|
+
var value = _ref4.value;
|
|
778
776
|
handleChange(key, value);
|
|
779
777
|
}
|
|
780
778
|
}, key);
|
|
781
779
|
}), neetoCist.filterBy({
|
|
782
780
|
kind: "color"
|
|
783
|
-
}, values.properties).map(function (
|
|
784
|
-
var key =
|
|
785
|
-
value =
|
|
786
|
-
kind =
|
|
781
|
+
}, values.properties).map(function (_ref5) {
|
|
782
|
+
var key = _ref5.key,
|
|
783
|
+
value = _ref5.value,
|
|
784
|
+
kind = _ref5.kind;
|
|
787
785
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(ColorBlock, {
|
|
788
786
|
color: value,
|
|
789
787
|
label: buildLabel(key, kind),
|
|
@@ -791,10 +789,10 @@ var Properties = function Properties() {
|
|
|
791
789
|
}, key);
|
|
792
790
|
}), neetoCist.filterBy({
|
|
793
791
|
kind: "overlay_opacity"
|
|
794
|
-
}, values.properties).map(function (
|
|
795
|
-
var key =
|
|
796
|
-
value =
|
|
797
|
-
kind =
|
|
792
|
+
}, values.properties).map(function (_ref6) {
|
|
793
|
+
var key = _ref6.key,
|
|
794
|
+
value = _ref6.value,
|
|
795
|
+
kind = _ref6.kind;
|
|
798
796
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
799
797
|
label: buildLabel(key, kind),
|
|
800
798
|
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
@@ -807,11 +805,11 @@ var Properties = function Properties() {
|
|
|
807
805
|
}, key);
|
|
808
806
|
}), neetoCist.filterBy({
|
|
809
807
|
kind: "position_selector"
|
|
810
|
-
}, values.properties).map(function (
|
|
808
|
+
}, values.properties).map(function (_ref7) {
|
|
811
809
|
var _findBy;
|
|
812
|
-
var key =
|
|
813
|
-
kind =
|
|
814
|
-
value =
|
|
810
|
+
var key = _ref7.key,
|
|
811
|
+
kind = _ref7.kind,
|
|
812
|
+
value = _ref7.value;
|
|
815
813
|
var index = neetoCist.findIndexBy({
|
|
816
814
|
key: key
|
|
817
815
|
}, values.properties);
|
|
@@ -829,10 +827,10 @@ var Properties = function Properties() {
|
|
|
829
827
|
}, key);
|
|
830
828
|
}), neetoCist.filterBy({
|
|
831
829
|
kind: "boolean"
|
|
832
|
-
}, values.properties).map(function (
|
|
833
|
-
var key =
|
|
834
|
-
kind =
|
|
835
|
-
value =
|
|
830
|
+
}, values.properties).map(function (_ref8) {
|
|
831
|
+
var key = _ref8.key,
|
|
832
|
+
kind = _ref8.kind,
|
|
833
|
+
value = _ref8.value;
|
|
836
834
|
var index = neetoCist.findIndexBy({
|
|
837
835
|
key: key
|
|
838
836
|
}, values.properties);
|
|
@@ -860,20 +858,33 @@ var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
|
860
858
|
});
|
|
861
859
|
});
|
|
862
860
|
|
|
863
|
-
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; }
|
|
864
|
-
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__default["default"](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; }
|
|
861
|
+
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; }
|
|
862
|
+
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__default["default"](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; }
|
|
865
863
|
var Customize = function Customize(_ref) {
|
|
866
864
|
var themeId = _ref.themeId,
|
|
867
865
|
theme = _ref.theme,
|
|
868
|
-
onCreateTheme = _ref.onCreateTheme
|
|
866
|
+
onCreateTheme = _ref.onCreateTheme,
|
|
867
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
868
|
+
isApplyingTheme = _ref.isApplyingTheme,
|
|
869
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
869
870
|
var _useTranslation = reactI18next.useTranslation(),
|
|
870
871
|
t = _useTranslation.t;
|
|
872
|
+
var _useState = react.useState({}),
|
|
873
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
874
|
+
popoverInstance = _useState2[0],
|
|
875
|
+
setPopoverInstance = _useState2[1];
|
|
871
876
|
var _useConfigStore = useConfigStore(function (store) {
|
|
872
877
|
return {
|
|
873
|
-
themePropertiesSchema: store["themePropertiesSchema"]
|
|
878
|
+
themePropertiesSchema: store["themePropertiesSchema"],
|
|
879
|
+
entityType: store["entityType"]
|
|
874
880
|
};
|
|
875
881
|
}, shallow.shallow),
|
|
876
|
-
themePropertiesSchema = _useConfigStore.themePropertiesSchema
|
|
882
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema,
|
|
883
|
+
entityType = _useConfigStore.entityType;
|
|
884
|
+
var _useThemeUtils = useThemeUtils(),
|
|
885
|
+
currentTheme = _useThemeUtils.currentTheme;
|
|
886
|
+
var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
|
|
887
|
+
var submitBtnRef = react.useRef(null);
|
|
877
888
|
var _useCreateTheme = useCreateTheme(),
|
|
878
889
|
createTheme = _useCreateTheme.mutate,
|
|
879
890
|
isCreating = _useCreateTheme.isPending;
|
|
@@ -884,7 +895,7 @@ var Customize = function Customize(_ref) {
|
|
|
884
895
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
885
896
|
var resetForm = _ref2.resetForm;
|
|
886
897
|
var imageData = buildImageData(values, themePropertiesSchema);
|
|
887
|
-
var themeToSave = _objectSpread({
|
|
898
|
+
var themeToSave = _objectSpread$1({
|
|
888
899
|
propertiesAttributes: values.properties,
|
|
889
900
|
name: values.name
|
|
890
901
|
}, imageData);
|
|
@@ -892,6 +903,9 @@ var Customize = function Customize(_ref) {
|
|
|
892
903
|
return createTheme(themeToSave, {
|
|
893
904
|
onSuccess: function onSuccess(_ref3) {
|
|
894
905
|
var theme = _ref3.theme;
|
|
906
|
+
resetForm({
|
|
907
|
+
values: values
|
|
908
|
+
});
|
|
895
909
|
onCreateTheme(theme);
|
|
896
910
|
}
|
|
897
911
|
});
|
|
@@ -916,7 +930,9 @@ var Customize = function Customize(_ref) {
|
|
|
916
930
|
className: "neeto-themes-sidebar__scroll",
|
|
917
931
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
918
932
|
className: "flex flex-col gap-6 p-4",
|
|
919
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {}), /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
933
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {}), /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
934
|
+
onPropertiesChange: onPropertiesChange
|
|
935
|
+
}), neetoCist.filterBy({
|
|
920
936
|
kind: "image"
|
|
921
937
|
}, themePropertiesSchema).map(function (_ref5) {
|
|
922
938
|
var key = _ref5.key;
|
|
@@ -937,14 +953,127 @@ var Customize = function Customize(_ref) {
|
|
|
937
953
|
disabled: !dirty && (theme === null || theme === void 0 ? void 0 : theme.id) || isSubmitting,
|
|
938
954
|
label: t("neetoThemes.buttons.save"),
|
|
939
955
|
loading: isSubmitting,
|
|
956
|
+
ref: submitBtnRef,
|
|
940
957
|
type: "submit"
|
|
941
958
|
})]
|
|
959
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Popover__default["default"], {
|
|
960
|
+
appendTo: function appendTo() {
|
|
961
|
+
return document.body;
|
|
962
|
+
},
|
|
963
|
+
disabled: isEditingCurrentlyAppliedTheme,
|
|
964
|
+
position: "top",
|
|
965
|
+
reference: submitBtnRef,
|
|
966
|
+
trigger: "click",
|
|
967
|
+
content: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
968
|
+
className: "flex flex-col items-start gap-2",
|
|
969
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
970
|
+
className: "absolute right-1 top-1 z-0",
|
|
971
|
+
icon: neetoIcons.Close,
|
|
972
|
+
size: "small",
|
|
973
|
+
style: "text",
|
|
974
|
+
onClick: function onClick() {
|
|
975
|
+
var _popoverInstance$hide;
|
|
976
|
+
return popoverInstance === null || popoverInstance === void 0 || (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
977
|
+
}
|
|
978
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
979
|
+
className: "w-72 pr-5",
|
|
980
|
+
style: "body2",
|
|
981
|
+
weight: "normal",
|
|
982
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
983
|
+
components: {
|
|
984
|
+
bold: /*#__PURE__*/jsxRuntime.jsx("strong", {})
|
|
985
|
+
},
|
|
986
|
+
i18nKey: "neetoThemes.build.leftSideBar.themes.notAppliedYet",
|
|
987
|
+
values: {
|
|
988
|
+
entityType: entityType
|
|
989
|
+
}
|
|
990
|
+
})
|
|
991
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
992
|
+
disabled: isApplyingTheme,
|
|
993
|
+
label: t("neetoThemes.buttons.applyThisTheme"),
|
|
994
|
+
loading: isApplyingTheme,
|
|
995
|
+
onClick: function onClick() {
|
|
996
|
+
return onApplyTheme(theme);
|
|
997
|
+
}
|
|
998
|
+
})]
|
|
999
|
+
}),
|
|
1000
|
+
onMount: setPopoverInstance
|
|
942
1001
|
})]
|
|
943
1002
|
});
|
|
944
1003
|
}
|
|
945
1004
|
});
|
|
946
1005
|
};
|
|
947
1006
|
|
|
1007
|
+
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; }
|
|
1008
|
+
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__default["default"](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; }
|
|
1009
|
+
var Check = function Check(props) {
|
|
1010
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread(_objectSpread({
|
|
1011
|
+
fill: "none",
|
|
1012
|
+
height: "24",
|
|
1013
|
+
viewBox: "0 0 24 24",
|
|
1014
|
+
width: "24",
|
|
1015
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1016
|
+
}, props), {}, {
|
|
1017
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
1018
|
+
filter: "url(#filter0_d_9519_161)",
|
|
1019
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
1020
|
+
fill: "#4558F9",
|
|
1021
|
+
height: "20",
|
|
1022
|
+
rx: "10",
|
|
1023
|
+
width: "20",
|
|
1024
|
+
x: "2",
|
|
1025
|
+
y: "2"
|
|
1026
|
+
}), /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
1027
|
+
height: "20",
|
|
1028
|
+
rx: "10",
|
|
1029
|
+
stroke: "#fff",
|
|
1030
|
+
strokeWidth: "1.5",
|
|
1031
|
+
width: "20",
|
|
1032
|
+
x: "2",
|
|
1033
|
+
y: "2"
|
|
1034
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
1035
|
+
d: "M16.375 9.5l-5.95 6.25-2.8-2.941",
|
|
1036
|
+
stroke: "#fff",
|
|
1037
|
+
strokeLinecap: "round",
|
|
1038
|
+
strokeLinejoin: "round",
|
|
1039
|
+
strokeWidth: "1.25"
|
|
1040
|
+
})]
|
|
1041
|
+
}), /*#__PURE__*/jsxRuntime.jsx("defs", {
|
|
1042
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("filter", {
|
|
1043
|
+
colorInterpolationFilters: "sRGB",
|
|
1044
|
+
filterUnits: "userSpaceOnUse",
|
|
1045
|
+
height: "23.5",
|
|
1046
|
+
id: "filter0_d_9519_161",
|
|
1047
|
+
width: "23.5",
|
|
1048
|
+
x: "0.25",
|
|
1049
|
+
y: "0.25",
|
|
1050
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("feFlood", {
|
|
1051
|
+
floodOpacity: "0",
|
|
1052
|
+
result: "BackgroundImageFix"
|
|
1053
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feColorMatrix", {
|
|
1054
|
+
"in": "SourceAlpha",
|
|
1055
|
+
result: "hardAlpha",
|
|
1056
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1057
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feOffset", {}), /*#__PURE__*/jsxRuntime.jsx("feGaussianBlur", {
|
|
1058
|
+
stdDeviation: "0.5"
|
|
1059
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feComposite", {
|
|
1060
|
+
in2: "hardAlpha",
|
|
1061
|
+
operator: "out"
|
|
1062
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feColorMatrix", {
|
|
1063
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0"
|
|
1064
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feBlend", {
|
|
1065
|
+
in2: "BackgroundImageFix",
|
|
1066
|
+
result: "effect1_dropShadow_9519_161"
|
|
1067
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feBlend", {
|
|
1068
|
+
"in": "SourceGraphic",
|
|
1069
|
+
in2: "effect1_dropShadow_9519_161",
|
|
1070
|
+
result: "shape"
|
|
1071
|
+
})]
|
|
1072
|
+
})
|
|
1073
|
+
})]
|
|
1074
|
+
}));
|
|
1075
|
+
};
|
|
1076
|
+
|
|
948
1077
|
var Thumbnail = function Thumbnail(_ref) {
|
|
949
1078
|
var _theme$snakeToCamelCa, _findBy, _findBy2;
|
|
950
1079
|
var active = _ref.active,
|
|
@@ -1031,35 +1160,17 @@ var Card = function Card(_ref) {
|
|
|
1031
1160
|
onSetPreviewTheme = _ref.onSetPreviewTheme,
|
|
1032
1161
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
1033
1162
|
onEditTheme = _ref.onEditTheme,
|
|
1034
|
-
applyTheme = _ref.applyTheme,
|
|
1035
1163
|
theme = _ref.theme,
|
|
1036
1164
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
1037
1165
|
onCloneTheme = _ref.onCloneTheme,
|
|
1038
1166
|
isHighLightedTheme = _ref.isHighLightedTheme,
|
|
1039
|
-
|
|
1167
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
1040
1168
|
Thumbnail$1 = _ref.thumbnail;
|
|
1041
1169
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1042
1170
|
t = _useTranslation.t;
|
|
1043
1171
|
var id = theme.id,
|
|
1044
1172
|
name = theme.name,
|
|
1045
1173
|
appliedCount = theme.appliedCount;
|
|
1046
|
-
var _useConfigStore = useConfigStore(function (store) {
|
|
1047
|
-
return {
|
|
1048
|
-
entityId: store["entityId"],
|
|
1049
|
-
entityType: store["entityType"]
|
|
1050
|
-
};
|
|
1051
|
-
}, shallow.shallow),
|
|
1052
|
-
entityId = _useConfigStore.entityId,
|
|
1053
|
-
entityType = _useConfigStore.entityType;
|
|
1054
|
-
var handleApplyThemeClick = function handleApplyThemeClick() {
|
|
1055
|
-
if (isApplyingTheme) return;
|
|
1056
|
-
setThemeBeingApplied(theme);
|
|
1057
|
-
applyTheme({
|
|
1058
|
-
themeId: theme.id,
|
|
1059
|
-
entityId: entityId,
|
|
1060
|
-
entityType: entityType
|
|
1061
|
-
});
|
|
1062
|
-
};
|
|
1063
1174
|
var handleCloneTheme = function handleCloneTheme() {
|
|
1064
1175
|
return onCloneTheme(theme);
|
|
1065
1176
|
};
|
|
@@ -1069,55 +1180,73 @@ var Card = function Card(_ref) {
|
|
|
1069
1180
|
var handleDeleteTheme = function handleDeleteTheme() {
|
|
1070
1181
|
return onDeleteTheme(id, name, appliedCount);
|
|
1071
1182
|
};
|
|
1072
|
-
return /*#__PURE__*/jsxRuntime.
|
|
1183
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1073
1184
|
className: "group space-y-2 pt-0.5",
|
|
1074
1185
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
1075
1186
|
id: theme.id,
|
|
1076
|
-
children:
|
|
1187
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1188
|
+
className: classnames__default["default"]("neeto-themes-theme-thumbnail neeto-ui-rounded-lg cursor-pointer border transition-all duration-300 ease-in-out", {
|
|
1189
|
+
"neeto-ui-border-gray-200": !active,
|
|
1190
|
+
"neeto-themes-theme-thumbnail--active": active,
|
|
1191
|
+
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
1192
|
+
"neeto-themes-theme-thumbnail--highlight-active": isHighLightedTheme
|
|
1193
|
+
}),
|
|
1077
1194
|
onClick: function onClick() {
|
|
1078
1195
|
return onSetPreviewTheme(theme);
|
|
1079
1196
|
},
|
|
1080
|
-
children:
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1197
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1198
|
+
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",
|
|
1199
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1200
|
+
className: "absolute right-0 top-0 p-3",
|
|
1201
|
+
children: active ? /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
1202
|
+
className: "flex-shrink-0",
|
|
1203
|
+
"data-cy": "active-theme-label"
|
|
1204
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1205
|
+
className: classnames__default["default"]({
|
|
1206
|
+
hidden: !isPreviewing,
|
|
1207
|
+
"group-hover:block": true
|
|
1208
|
+
}),
|
|
1209
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
1210
|
+
className: "neeto-themes-theme-thumbnail__apply-btn flex-shrink-0",
|
|
1211
|
+
"data-cy": "apply-theme-button",
|
|
1212
|
+
disabled: isApplyingTheme,
|
|
1213
|
+
label: t("neetoThemes.common.apply"),
|
|
1214
|
+
loading: isApplyingTheme,
|
|
1215
|
+
size: "small",
|
|
1216
|
+
style: "tertiary",
|
|
1217
|
+
onClick: function onClick() {
|
|
1218
|
+
return onApplyTheme(theme);
|
|
1219
|
+
}
|
|
1220
|
+
})
|
|
1221
|
+
})
|
|
1222
|
+
}), Thumbnail$1 ? /*#__PURE__*/jsxRuntime.jsx(Thumbnail$1, {
|
|
1223
|
+
active: active,
|
|
1224
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
1225
|
+
isPreviewing: isPreviewing,
|
|
1226
|
+
theme: theme
|
|
1227
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Thumbnail, {
|
|
1228
|
+
active: active,
|
|
1229
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
1230
|
+
isPreviewing: isPreviewing,
|
|
1231
|
+
theme: theme
|
|
1232
|
+
})]
|
|
1099
1233
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1100
|
-
className: "flex items-
|
|
1101
|
-
children: [
|
|
1102
|
-
className: "flex-
|
|
1103
|
-
"data-cy": "
|
|
1104
|
-
|
|
1105
|
-
style: "
|
|
1106
|
-
|
|
1107
|
-
className: "flex-shrink-0",
|
|
1108
|
-
"data-cy": "apply-theme-button",
|
|
1109
|
-
disabled: isApplyingTheme,
|
|
1110
|
-
label: t("neetoThemes.common.apply"),
|
|
1111
|
-
loading: isApplyingTheme,
|
|
1112
|
-
size: "small",
|
|
1113
|
-
style: "link",
|
|
1114
|
-
onClick: handleApplyThemeClick
|
|
1234
|
+
className: "flex items-start justify-between gap-1 p-3",
|
|
1235
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
1236
|
+
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
1237
|
+
"data-cy": "theme-name",
|
|
1238
|
+
lineHeight: "snug",
|
|
1239
|
+
style: "body2",
|
|
1240
|
+
children: name
|
|
1115
1241
|
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
1116
1242
|
dropdownButtonProps: {
|
|
1117
1243
|
size: "small"
|
|
1118
1244
|
},
|
|
1119
1245
|
dropdownProps: {
|
|
1120
|
-
strategy: "fixed"
|
|
1246
|
+
strategy: "fixed",
|
|
1247
|
+
onClick: function onClick(e) {
|
|
1248
|
+
return e.stopPropagation();
|
|
1249
|
+
}
|
|
1121
1250
|
},
|
|
1122
1251
|
menuItems: [{
|
|
1123
1252
|
key: "edit",
|
|
@@ -1141,7 +1270,7 @@ var Card = function Card(_ref) {
|
|
|
1141
1270
|
}]
|
|
1142
1271
|
})]
|
|
1143
1272
|
})]
|
|
1144
|
-
})
|
|
1273
|
+
})
|
|
1145
1274
|
});
|
|
1146
1275
|
};
|
|
1147
1276
|
var Card$1 = /*#__PURE__*/react.memo(Card);
|
|
@@ -1154,12 +1283,14 @@ var Themes = function Themes(_ref) {
|
|
|
1154
1283
|
defaultThemes = _ref$defaultThemes === void 0 ? [] : _ref$defaultThemes,
|
|
1155
1284
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
1156
1285
|
themeToHighlight = _ref.themeToHighlight,
|
|
1157
|
-
highlightTheme = _ref.highlightTheme,
|
|
1158
1286
|
didScrollActiveThemeIntoView = _ref.didScrollActiveThemeIntoView,
|
|
1159
1287
|
isLoading = _ref.isLoading,
|
|
1160
1288
|
currentTheme = _ref.currentTheme,
|
|
1161
1289
|
isCurrentThemeLoading = _ref.isCurrentThemeLoading,
|
|
1162
|
-
thumbnail = _ref.thumbnail
|
|
1290
|
+
thumbnail = _ref.thumbnail,
|
|
1291
|
+
themeBeingApplied = _ref.themeBeingApplied,
|
|
1292
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
1293
|
+
isApplyingTheme = _ref.isApplyingTheme;
|
|
1163
1294
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1164
1295
|
t = _useTranslation.t;
|
|
1165
1296
|
var _useThemeUtils = useThemeUtils(),
|
|
@@ -1176,24 +1307,8 @@ var Themes = function Themes(_ref) {
|
|
|
1176
1307
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1177
1308
|
searchQuery = _useState2[0],
|
|
1178
1309
|
setSearchQuery = _useState2[1];
|
|
1179
|
-
var _useState3 = react.useState({}),
|
|
1180
|
-
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
1181
|
-
themeBeingApplied = _useState4[0],
|
|
1182
|
-
setThemeBeingApplied = _useState4[1];
|
|
1183
1310
|
var _useCloneTheme = useCloneTheme(),
|
|
1184
1311
|
cloneTheme = _useCloneTheme.mutate;
|
|
1185
|
-
var _useApplyTheme = useApplyTheme({
|
|
1186
|
-
onSuccess: function onSuccess(_ref2) {
|
|
1187
|
-
var theme = _ref2.theme;
|
|
1188
|
-
setTheme(theme);
|
|
1189
|
-
setThemeState({
|
|
1190
|
-
previewingTheme: theme
|
|
1191
|
-
});
|
|
1192
|
-
setThemeBeingApplied({});
|
|
1193
|
-
}
|
|
1194
|
-
}),
|
|
1195
|
-
applyTheme = _useApplyTheme.mutate,
|
|
1196
|
-
isApplyingTheme = _useApplyTheme.isPending;
|
|
1197
1312
|
react.useEffect(function () {
|
|
1198
1313
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
1199
1314
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -1216,9 +1331,9 @@ var Themes = function Themes(_ref) {
|
|
|
1216
1331
|
var isSearchFieldVisible = (themes === null || themes === void 0 ? void 0 : themes.length) + (defaultThemes === null || defaultThemes === void 0 ? void 0 : defaultThemes.length) > 10;
|
|
1217
1332
|
var handleCloneTheme = function handleCloneTheme(data) {
|
|
1218
1333
|
cloneTheme(data.id, {
|
|
1219
|
-
onSuccess: function onSuccess(
|
|
1220
|
-
var clonedTheme =
|
|
1221
|
-
|
|
1334
|
+
onSuccess: function onSuccess(_ref2) {
|
|
1335
|
+
var clonedTheme = _ref2.theme;
|
|
1336
|
+
onEditTheme(clonedTheme);
|
|
1222
1337
|
}
|
|
1223
1338
|
});
|
|
1224
1339
|
};
|
|
@@ -1253,8 +1368,7 @@ var Themes = function Themes(_ref) {
|
|
|
1253
1368
|
className: "flex flex-col gap-4 px-4 pb-10 lg:px-5 xl:px-6",
|
|
1254
1369
|
children: filteredDefaultThemes.map(function (theme) {
|
|
1255
1370
|
return /*#__PURE__*/react.createElement(Card$1, {
|
|
1256
|
-
|
|
1257
|
-
setThemeBeingApplied: setThemeBeingApplied,
|
|
1371
|
+
onApplyTheme: onApplyTheme,
|
|
1258
1372
|
theme: theme,
|
|
1259
1373
|
thumbnail: thumbnail,
|
|
1260
1374
|
active: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id,
|
|
@@ -1281,10 +1395,9 @@ var Themes = function Themes(_ref) {
|
|
|
1281
1395
|
var isActive = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id;
|
|
1282
1396
|
var isPreviewing = (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id;
|
|
1283
1397
|
return /*#__PURE__*/react.createElement(Card$1, {
|
|
1284
|
-
applyTheme: applyTheme,
|
|
1285
1398
|
isPreviewing: isPreviewing,
|
|
1399
|
+
onApplyTheme: onApplyTheme,
|
|
1286
1400
|
onEditTheme: onEditTheme,
|
|
1287
|
-
setThemeBeingApplied: setThemeBeingApplied,
|
|
1288
1401
|
theme: theme,
|
|
1289
1402
|
thumbnail: thumbnail,
|
|
1290
1403
|
active: isActive,
|
|
@@ -1364,7 +1477,8 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1364
1477
|
var MemoizedAlert = /*#__PURE__*/react.memo(Alert__default["default"]);
|
|
1365
1478
|
var Sidebar = function Sidebar(_ref) {
|
|
1366
1479
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3;
|
|
1367
|
-
var thumbnail = _ref.thumbnail
|
|
1480
|
+
var thumbnail = _ref.thumbnail,
|
|
1481
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
1368
1482
|
var _useState = react.useState(DESIGN_SCREENS.THEMES),
|
|
1369
1483
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1370
1484
|
currentScreen = _useState2[0],
|
|
@@ -1377,6 +1491,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1377
1491
|
_useState6 = _slicedToArray__default["default"](_useState5, 2),
|
|
1378
1492
|
themeToHighlight = _useState6[0],
|
|
1379
1493
|
setThemeToHighlight = _useState6[1];
|
|
1494
|
+
var _useState7 = react.useState({}),
|
|
1495
|
+
_useState8 = _slicedToArray__default["default"](_useState7, 2),
|
|
1496
|
+
themeBeingApplied = _useState8[0],
|
|
1497
|
+
setThemeBeingApplied = _useState8[1];
|
|
1380
1498
|
var _useConfigStore = useConfigStore(function (store) {
|
|
1381
1499
|
return {
|
|
1382
1500
|
entityType: store["entityType"],
|
|
@@ -1415,12 +1533,34 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1415
1533
|
var _useDeleteTheme = useDeleteTheme(),
|
|
1416
1534
|
deleteTheme = _useDeleteTheme.mutate,
|
|
1417
1535
|
isDeleting = _useDeleteTheme.isPending;
|
|
1536
|
+
var _useApplyTheme = useApplyTheme({
|
|
1537
|
+
onSuccess: function onSuccess(_ref2) {
|
|
1538
|
+
var theme = _ref2.theme;
|
|
1539
|
+
setTheme(theme);
|
|
1540
|
+
setThemeState({
|
|
1541
|
+
previewingTheme: theme
|
|
1542
|
+
});
|
|
1543
|
+
setThemeBeingApplied({});
|
|
1544
|
+
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1545
|
+
}
|
|
1546
|
+
}),
|
|
1547
|
+
applyTheme = _useApplyTheme.mutate,
|
|
1548
|
+
isApplyingTheme = _useApplyTheme.isLoading;
|
|
1418
1549
|
var themeToDelete = react.useRef(null);
|
|
1419
1550
|
var themeToEdit = react.useRef(null);
|
|
1420
1551
|
var handleEditTheme = function handleEditTheme(theme) {
|
|
1421
1552
|
themeToEdit.current = theme;
|
|
1422
1553
|
setCurrentScreen(DESIGN_SCREENS.Customize);
|
|
1423
1554
|
};
|
|
1555
|
+
var onApplyTheme = function onApplyTheme(theme) {
|
|
1556
|
+
if (isApplyingTheme) return;
|
|
1557
|
+
setThemeBeingApplied(theme);
|
|
1558
|
+
applyTheme({
|
|
1559
|
+
themeId: theme.id,
|
|
1560
|
+
entityId: entityId,
|
|
1561
|
+
entityType: entityType
|
|
1562
|
+
});
|
|
1563
|
+
};
|
|
1424
1564
|
var handleBackPress = function handleBackPress() {
|
|
1425
1565
|
setTheme(currentTheme);
|
|
1426
1566
|
setThemeState({
|
|
@@ -1439,13 +1579,11 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1439
1579
|
setThemeToHighlight(themeToHighlight.id);
|
|
1440
1580
|
};
|
|
1441
1581
|
var onCreateTheme = function onCreateTheme(createdTheme) {
|
|
1442
|
-
|
|
1582
|
+
themeToEdit.current = createdTheme;
|
|
1443
1583
|
setTheme(createdTheme);
|
|
1444
1584
|
setThemeState({
|
|
1445
1585
|
previewingTheme: createdTheme
|
|
1446
1586
|
});
|
|
1447
|
-
highlightTheme(createdTheme);
|
|
1448
|
-
themeToEdit.current = null;
|
|
1449
1587
|
};
|
|
1450
1588
|
var handleDelete = function handleDelete(themeId, name, appliedCount) {
|
|
1451
1589
|
setIsDeleteAlertOpen(true);
|
|
@@ -1494,7 +1632,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1494
1632
|
defaultThemes: defaultThemes,
|
|
1495
1633
|
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
1496
1634
|
highlightTheme: highlightTheme,
|
|
1635
|
+
isApplyingTheme: isApplyingTheme,
|
|
1497
1636
|
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
1637
|
+
onApplyTheme: onApplyTheme,
|
|
1638
|
+
themeBeingApplied: themeBeingApplied,
|
|
1498
1639
|
themeToHighlight: themeToHighlight,
|
|
1499
1640
|
themes: themes,
|
|
1500
1641
|
thumbnail: thumbnail,
|
|
@@ -1502,7 +1643,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1502
1643
|
onDeleteTheme: handleDelete,
|
|
1503
1644
|
onEditTheme: handleEditTheme
|
|
1504
1645
|
}) : /*#__PURE__*/jsxRuntime.jsx(Customize, {
|
|
1646
|
+
isApplyingTheme: isApplyingTheme,
|
|
1647
|
+
onApplyTheme: onApplyTheme,
|
|
1505
1648
|
onCreateTheme: onCreateTheme,
|
|
1649
|
+
onPropertiesChange: onPropertiesChange,
|
|
1506
1650
|
theme: themeToEdit.current,
|
|
1507
1651
|
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
|
|
1508
1652
|
}), /*#__PURE__*/jsxRuntime.jsx(MemoizedAlert, {
|
|
@@ -1541,13 +1685,13 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1541
1685
|
react.useEffect(function () {
|
|
1542
1686
|
setConfigState({
|
|
1543
1687
|
entityType: entityType,
|
|
1544
|
-
entityId: entityId
|
|
1545
|
-
onPropertiesChange: onPropertiesChange
|
|
1688
|
+
entityId: entityId
|
|
1546
1689
|
});
|
|
1547
1690
|
}, []);
|
|
1548
1691
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1549
1692
|
className: "neeto-themes__wrapper",
|
|
1550
1693
|
children: [/*#__PURE__*/jsxRuntime.jsx(Sidebar, {
|
|
1694
|
+
onPropertiesChange: onPropertiesChange,
|
|
1551
1695
|
thumbnail: thumbnail
|
|
1552
1696
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1553
1697
|
className: "neeto-themes-preview__wrapper",
|
|
@@ -1562,7 +1706,7 @@ var index = reactUtils.withTitle(NeetoThemesBuilder, i18next.t("neetoThemes.comm
|
|
|
1562
1706
|
|
|
1563
1707
|
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}}
|
|
1564
1708
|
|
|
1565
|
-
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-
|
|
1709
|
+
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3RoZW1lcy5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3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