@bigbinary/neeto-themes-frontend 1.2.1 → 1.2.3
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 +284 -139
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +283 -138
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
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) {
|
|
@@ -588,8 +588,8 @@ var ColorBlock = function ColorBlock(_ref) {
|
|
|
588
588
|
});
|
|
589
589
|
};
|
|
590
590
|
|
|
591
|
-
function ownKeys$
|
|
592
|
-
function _objectSpread$
|
|
591
|
+
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; }
|
|
592
|
+
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; }
|
|
593
593
|
var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
594
594
|
var label = _ref.label,
|
|
595
595
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -615,7 +615,7 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
|
|
|
615
615
|
styles: {
|
|
616
616
|
option: function option(styles, _ref2) {
|
|
617
617
|
var data = _ref2.data;
|
|
618
|
-
return _objectSpread$
|
|
618
|
+
return _objectSpread$3(_objectSpread$3({}, styles), {}, {
|
|
619
619
|
fontFamily: data.value
|
|
620
620
|
});
|
|
621
621
|
}
|
|
@@ -680,8 +680,8 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
680
680
|
};
|
|
681
681
|
|
|
682
682
|
var _excluded = ["label", "name"];
|
|
683
|
-
function ownKeys$
|
|
684
|
-
function _objectSpread$
|
|
683
|
+
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; }
|
|
684
|
+
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; }
|
|
685
685
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
686
686
|
var label = _ref.label,
|
|
687
687
|
name = _ref.name,
|
|
@@ -691,23 +691,22 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
691
691
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
692
692
|
style: "body2",
|
|
693
693
|
children: label
|
|
694
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], _objectSpread$
|
|
694
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], _objectSpread$2({}, _objectSpread$2({
|
|
695
695
|
name: name
|
|
696
696
|
}, switchProps)))]
|
|
697
697
|
});
|
|
698
698
|
};
|
|
699
699
|
|
|
700
|
-
var Properties = function Properties() {
|
|
700
|
+
var Properties = function Properties(_ref) {
|
|
701
|
+
var onPropertiesChange = _ref.onPropertiesChange;
|
|
701
702
|
var _useTranslation = reactI18next.useTranslation(),
|
|
702
703
|
t = _useTranslation.t;
|
|
703
704
|
var _useConfigStore = useConfigStore(function (store) {
|
|
704
705
|
return {
|
|
705
|
-
themePropertiesSchema: store["themePropertiesSchema"]
|
|
706
|
-
onPropertiesChange: store["onPropertiesChange"]
|
|
706
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
707
707
|
};
|
|
708
708
|
}, shallow.shallow),
|
|
709
|
-
themePropertiesSchema = _useConfigStore.themePropertiesSchema
|
|
710
|
-
onPropertiesChange = _useConfigStore.onPropertiesChange;
|
|
709
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
711
710
|
var _useThemeStore = useThemeStore(function (store) {
|
|
712
711
|
return {
|
|
713
712
|
setThemeState: store["setThemeState"]
|
|
@@ -721,9 +720,9 @@ var Properties = function Properties() {
|
|
|
721
720
|
setVariable = _useThemeUtils.setVariable,
|
|
722
721
|
setTheme = _useThemeUtils.setTheme;
|
|
723
722
|
var handleColorChange = function handleColorChange(name) {
|
|
724
|
-
return function (
|
|
725
|
-
var hex =
|
|
726
|
-
rgb =
|
|
723
|
+
return function (_ref2) {
|
|
724
|
+
var hex = _ref2.hex,
|
|
725
|
+
rgb = _ref2.rgb;
|
|
727
726
|
handleChange(name, hex, "".concat(rgb.r, ", ").concat(rgb.g, ", ").concat(rgb.b, ", ").concat(rgb.a));
|
|
728
727
|
};
|
|
729
728
|
};
|
|
@@ -760,27 +759,27 @@ var Properties = function Properties() {
|
|
|
760
759
|
className: "divide-y divide-gray-200",
|
|
761
760
|
children: [neetoCist.filterBy({
|
|
762
761
|
kind: "font_family"
|
|
763
|
-
}, values.properties).map(function (
|
|
764
|
-
var key =
|
|
765
|
-
value =
|
|
766
|
-
kind =
|
|
762
|
+
}, values.properties).map(function (_ref3) {
|
|
763
|
+
var key = _ref3.key,
|
|
764
|
+
value = _ref3.value,
|
|
765
|
+
kind = _ref3.kind;
|
|
767
766
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(FontPickerBlock, {
|
|
768
767
|
label: buildLabel(key, kind),
|
|
769
768
|
options: FONT_OPTIONS,
|
|
770
769
|
value: neetoCist.findBy({
|
|
771
770
|
value: value || null
|
|
772
771
|
}, FONT_OPTIONS),
|
|
773
|
-
onChange: function onChange(
|
|
774
|
-
var value =
|
|
772
|
+
onChange: function onChange(_ref4) {
|
|
773
|
+
var value = _ref4.value;
|
|
775
774
|
handleChange(key, value);
|
|
776
775
|
}
|
|
777
776
|
}, key);
|
|
778
777
|
}), neetoCist.filterBy({
|
|
779
778
|
kind: "color"
|
|
780
|
-
}, values.properties).map(function (
|
|
781
|
-
var key =
|
|
782
|
-
value =
|
|
783
|
-
kind =
|
|
779
|
+
}, values.properties).map(function (_ref5) {
|
|
780
|
+
var key = _ref5.key,
|
|
781
|
+
value = _ref5.value,
|
|
782
|
+
kind = _ref5.kind;
|
|
784
783
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(ColorBlock, {
|
|
785
784
|
color: value,
|
|
786
785
|
label: buildLabel(key, kind),
|
|
@@ -788,10 +787,10 @@ var Properties = function Properties() {
|
|
|
788
787
|
}, key);
|
|
789
788
|
}), neetoCist.filterBy({
|
|
790
789
|
kind: "overlay_opacity"
|
|
791
|
-
}, values.properties).map(function (
|
|
792
|
-
var key =
|
|
793
|
-
value =
|
|
794
|
-
kind =
|
|
790
|
+
}, values.properties).map(function (_ref6) {
|
|
791
|
+
var key = _ref6.key,
|
|
792
|
+
value = _ref6.value,
|
|
793
|
+
kind = _ref6.kind;
|
|
795
794
|
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
796
795
|
label: buildLabel(key, kind),
|
|
797
796
|
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
@@ -804,11 +803,11 @@ var Properties = function Properties() {
|
|
|
804
803
|
}, key);
|
|
805
804
|
}), neetoCist.filterBy({
|
|
806
805
|
kind: "position_selector"
|
|
807
|
-
}, values.properties).map(function (
|
|
806
|
+
}, values.properties).map(function (_ref7) {
|
|
808
807
|
var _findBy;
|
|
809
|
-
var key =
|
|
810
|
-
kind =
|
|
811
|
-
value =
|
|
808
|
+
var key = _ref7.key,
|
|
809
|
+
kind = _ref7.kind,
|
|
810
|
+
value = _ref7.value;
|
|
812
811
|
var index = neetoCist.findIndexBy({
|
|
813
812
|
key: key
|
|
814
813
|
}, values.properties);
|
|
@@ -826,10 +825,10 @@ var Properties = function Properties() {
|
|
|
826
825
|
}, key);
|
|
827
826
|
}), neetoCist.filterBy({
|
|
828
827
|
kind: "boolean"
|
|
829
|
-
}, values.properties).map(function (
|
|
830
|
-
var key =
|
|
831
|
-
kind =
|
|
832
|
-
value =
|
|
828
|
+
}, values.properties).map(function (_ref8) {
|
|
829
|
+
var key = _ref8.key,
|
|
830
|
+
kind = _ref8.kind,
|
|
831
|
+
value = _ref8.value;
|
|
833
832
|
var index = neetoCist.findIndexBy({
|
|
834
833
|
key: key
|
|
835
834
|
}, values.properties);
|
|
@@ -857,20 +856,33 @@ var ThemeMeta = reactUtils.withT(function (_ref) {
|
|
|
857
856
|
});
|
|
858
857
|
});
|
|
859
858
|
|
|
860
|
-
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; }
|
|
861
|
-
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; }
|
|
859
|
+
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; }
|
|
860
|
+
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; }
|
|
862
861
|
var Customize = function Customize(_ref) {
|
|
863
862
|
var themeId = _ref.themeId,
|
|
864
863
|
theme = _ref.theme,
|
|
865
|
-
onCreateTheme = _ref.onCreateTheme
|
|
864
|
+
onCreateTheme = _ref.onCreateTheme,
|
|
865
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
866
|
+
isApplyingTheme = _ref.isApplyingTheme,
|
|
867
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
866
868
|
var _useTranslation = reactI18next.useTranslation(),
|
|
867
869
|
t = _useTranslation.t;
|
|
870
|
+
var _useState = react.useState({}),
|
|
871
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
872
|
+
popoverInstance = _useState2[0],
|
|
873
|
+
setPopoverInstance = _useState2[1];
|
|
868
874
|
var _useConfigStore = useConfigStore(function (store) {
|
|
869
875
|
return {
|
|
870
|
-
themePropertiesSchema: store["themePropertiesSchema"]
|
|
876
|
+
themePropertiesSchema: store["themePropertiesSchema"],
|
|
877
|
+
entityType: store["entityType"]
|
|
871
878
|
};
|
|
872
879
|
}, shallow.shallow),
|
|
873
|
-
themePropertiesSchema = _useConfigStore.themePropertiesSchema
|
|
880
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema,
|
|
881
|
+
entityType = _useConfigStore.entityType;
|
|
882
|
+
var _useThemeUtils = useThemeUtils(),
|
|
883
|
+
currentTheme = _useThemeUtils.currentTheme;
|
|
884
|
+
var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
|
|
885
|
+
var submitBtnRef = react.useRef(null);
|
|
874
886
|
var _useCreateTheme = useCreateTheme(),
|
|
875
887
|
createTheme = _useCreateTheme.mutate,
|
|
876
888
|
isCreating = _useCreateTheme.isLoading;
|
|
@@ -881,7 +893,7 @@ var Customize = function Customize(_ref) {
|
|
|
881
893
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
882
894
|
var resetForm = _ref2.resetForm;
|
|
883
895
|
var imageData = buildImageData(values, themePropertiesSchema);
|
|
884
|
-
var themeToSave = _objectSpread({
|
|
896
|
+
var themeToSave = _objectSpread$1({
|
|
885
897
|
propertiesAttributes: values.properties,
|
|
886
898
|
name: values.name
|
|
887
899
|
}, imageData);
|
|
@@ -889,6 +901,9 @@ var Customize = function Customize(_ref) {
|
|
|
889
901
|
return createTheme(themeToSave, {
|
|
890
902
|
onSuccess: function onSuccess(_ref3) {
|
|
891
903
|
var theme = _ref3.theme;
|
|
904
|
+
resetForm({
|
|
905
|
+
values: values
|
|
906
|
+
});
|
|
892
907
|
onCreateTheme(theme);
|
|
893
908
|
}
|
|
894
909
|
});
|
|
@@ -913,7 +928,9 @@ var Customize = function Customize(_ref) {
|
|
|
913
928
|
className: "neeto-themes-sidebar__scroll",
|
|
914
929
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
915
930
|
className: "flex flex-col gap-6 p-4",
|
|
916
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {}), /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
931
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {}), /*#__PURE__*/jsxRuntime.jsx(Properties, {
|
|
932
|
+
onPropertiesChange: onPropertiesChange
|
|
933
|
+
}), neetoCist.filterBy({
|
|
917
934
|
kind: "image"
|
|
918
935
|
}, themePropertiesSchema).map(function (_ref5) {
|
|
919
936
|
var key = _ref5.key;
|
|
@@ -934,14 +951,127 @@ var Customize = function Customize(_ref) {
|
|
|
934
951
|
disabled: !dirty && (theme === null || theme === void 0 ? void 0 : theme.id) || isSubmitting,
|
|
935
952
|
label: t("neetoThemes.buttons.save"),
|
|
936
953
|
loading: isSubmitting,
|
|
954
|
+
ref: submitBtnRef,
|
|
937
955
|
type: "submit"
|
|
938
956
|
})]
|
|
957
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Popover__default["default"], {
|
|
958
|
+
appendTo: function appendTo() {
|
|
959
|
+
return document.body;
|
|
960
|
+
},
|
|
961
|
+
disabled: isEditingCurrentlyAppliedTheme,
|
|
962
|
+
position: "top",
|
|
963
|
+
reference: submitBtnRef,
|
|
964
|
+
trigger: "click",
|
|
965
|
+
content: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
966
|
+
className: "flex flex-col items-start gap-2",
|
|
967
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
968
|
+
className: "absolute right-1 top-1 z-0",
|
|
969
|
+
icon: neetoIcons.Close,
|
|
970
|
+
size: "small",
|
|
971
|
+
style: "text",
|
|
972
|
+
onClick: function onClick() {
|
|
973
|
+
var _popoverInstance$hide;
|
|
974
|
+
return popoverInstance === null || popoverInstance === void 0 || (_popoverInstance$hide = popoverInstance.hide) === null || _popoverInstance$hide === void 0 ? void 0 : _popoverInstance$hide.call(popoverInstance);
|
|
975
|
+
}
|
|
976
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
977
|
+
className: "w-72 pr-5",
|
|
978
|
+
style: "body2",
|
|
979
|
+
weight: "normal",
|
|
980
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
981
|
+
components: {
|
|
982
|
+
bold: /*#__PURE__*/jsxRuntime.jsx("strong", {})
|
|
983
|
+
},
|
|
984
|
+
i18nKey: "neetoThemes.build.leftSideBar.themes.notAppliedYet",
|
|
985
|
+
values: {
|
|
986
|
+
entityType: entityType
|
|
987
|
+
}
|
|
988
|
+
})
|
|
989
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
990
|
+
disabled: isApplyingTheme,
|
|
991
|
+
label: t("neetoThemes.buttons.applyThisTheme"),
|
|
992
|
+
loading: isApplyingTheme,
|
|
993
|
+
onClick: function onClick() {
|
|
994
|
+
return onApplyTheme(theme);
|
|
995
|
+
}
|
|
996
|
+
})]
|
|
997
|
+
}),
|
|
998
|
+
onMount: setPopoverInstance
|
|
939
999
|
})]
|
|
940
1000
|
});
|
|
941
1001
|
}
|
|
942
1002
|
});
|
|
943
1003
|
};
|
|
944
1004
|
|
|
1005
|
+
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; }
|
|
1006
|
+
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; }
|
|
1007
|
+
var Check = function Check(props) {
|
|
1008
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread(_objectSpread({
|
|
1009
|
+
fill: "none",
|
|
1010
|
+
height: "24",
|
|
1011
|
+
viewBox: "0 0 24 24",
|
|
1012
|
+
width: "24",
|
|
1013
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1014
|
+
}, props), {}, {
|
|
1015
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
1016
|
+
filter: "url(#filter0_d_9519_161)",
|
|
1017
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
1018
|
+
fill: "#4558F9",
|
|
1019
|
+
height: "20",
|
|
1020
|
+
rx: "10",
|
|
1021
|
+
width: "20",
|
|
1022
|
+
x: "2",
|
|
1023
|
+
y: "2"
|
|
1024
|
+
}), /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
1025
|
+
height: "20",
|
|
1026
|
+
rx: "10",
|
|
1027
|
+
stroke: "#fff",
|
|
1028
|
+
strokeWidth: "1.5",
|
|
1029
|
+
width: "20",
|
|
1030
|
+
x: "2",
|
|
1031
|
+
y: "2"
|
|
1032
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
1033
|
+
d: "M16.375 9.5l-5.95 6.25-2.8-2.941",
|
|
1034
|
+
stroke: "#fff",
|
|
1035
|
+
strokeLinecap: "round",
|
|
1036
|
+
strokeLinejoin: "round",
|
|
1037
|
+
strokeWidth: "1.25"
|
|
1038
|
+
})]
|
|
1039
|
+
}), /*#__PURE__*/jsxRuntime.jsx("defs", {
|
|
1040
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("filter", {
|
|
1041
|
+
colorInterpolationFilters: "sRGB",
|
|
1042
|
+
filterUnits: "userSpaceOnUse",
|
|
1043
|
+
height: "23.5",
|
|
1044
|
+
id: "filter0_d_9519_161",
|
|
1045
|
+
width: "23.5",
|
|
1046
|
+
x: "0.25",
|
|
1047
|
+
y: "0.25",
|
|
1048
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("feFlood", {
|
|
1049
|
+
floodOpacity: "0",
|
|
1050
|
+
result: "BackgroundImageFix"
|
|
1051
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feColorMatrix", {
|
|
1052
|
+
"in": "SourceAlpha",
|
|
1053
|
+
result: "hardAlpha",
|
|
1054
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1055
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feOffset", {}), /*#__PURE__*/jsxRuntime.jsx("feGaussianBlur", {
|
|
1056
|
+
stdDeviation: "0.5"
|
|
1057
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feComposite", {
|
|
1058
|
+
in2: "hardAlpha",
|
|
1059
|
+
operator: "out"
|
|
1060
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feColorMatrix", {
|
|
1061
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0"
|
|
1062
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feBlend", {
|
|
1063
|
+
in2: "BackgroundImageFix",
|
|
1064
|
+
result: "effect1_dropShadow_9519_161"
|
|
1065
|
+
}), /*#__PURE__*/jsxRuntime.jsx("feBlend", {
|
|
1066
|
+
"in": "SourceGraphic",
|
|
1067
|
+
in2: "effect1_dropShadow_9519_161",
|
|
1068
|
+
result: "shape"
|
|
1069
|
+
})]
|
|
1070
|
+
})
|
|
1071
|
+
})]
|
|
1072
|
+
}));
|
|
1073
|
+
};
|
|
1074
|
+
|
|
945
1075
|
var Thumbnail = function Thumbnail(_ref) {
|
|
946
1076
|
var _theme$snakeToCamelCa, _findBy, _findBy2;
|
|
947
1077
|
var active = _ref.active,
|
|
@@ -1028,35 +1158,17 @@ var Card = function Card(_ref) {
|
|
|
1028
1158
|
onSetPreviewTheme = _ref.onSetPreviewTheme,
|
|
1029
1159
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
1030
1160
|
onEditTheme = _ref.onEditTheme,
|
|
1031
|
-
applyTheme = _ref.applyTheme,
|
|
1032
1161
|
theme = _ref.theme,
|
|
1033
1162
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
1034
1163
|
onCloneTheme = _ref.onCloneTheme,
|
|
1035
1164
|
isHighLightedTheme = _ref.isHighLightedTheme,
|
|
1036
|
-
|
|
1165
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
1037
1166
|
Thumbnail$1 = _ref.thumbnail;
|
|
1038
1167
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1039
1168
|
t = _useTranslation.t;
|
|
1040
1169
|
var id = theme.id,
|
|
1041
1170
|
name = theme.name,
|
|
1042
1171
|
appliedCount = theme.appliedCount;
|
|
1043
|
-
var _useConfigStore = useConfigStore(function (store) {
|
|
1044
|
-
return {
|
|
1045
|
-
entityId: store["entityId"],
|
|
1046
|
-
entityType: store["entityType"]
|
|
1047
|
-
};
|
|
1048
|
-
}, shallow.shallow),
|
|
1049
|
-
entityId = _useConfigStore.entityId,
|
|
1050
|
-
entityType = _useConfigStore.entityType;
|
|
1051
|
-
var handleApplyThemeClick = function handleApplyThemeClick() {
|
|
1052
|
-
if (isApplyingTheme) return;
|
|
1053
|
-
setThemeBeingApplied(theme);
|
|
1054
|
-
applyTheme({
|
|
1055
|
-
themeId: theme.id,
|
|
1056
|
-
entityId: entityId,
|
|
1057
|
-
entityType: entityType
|
|
1058
|
-
});
|
|
1059
|
-
};
|
|
1060
1172
|
var handleCloneTheme = function handleCloneTheme() {
|
|
1061
1173
|
return onCloneTheme(theme);
|
|
1062
1174
|
};
|
|
@@ -1066,55 +1178,73 @@ var Card = function Card(_ref) {
|
|
|
1066
1178
|
var handleDeleteTheme = function handleDeleteTheme() {
|
|
1067
1179
|
return onDeleteTheme(id, name, appliedCount);
|
|
1068
1180
|
};
|
|
1069
|
-
return /*#__PURE__*/jsxRuntime.
|
|
1181
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1070
1182
|
className: "group space-y-2 pt-0.5",
|
|
1071
1183
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
1072
1184
|
id: theme.id,
|
|
1073
|
-
children:
|
|
1185
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1186
|
+
className: classnames__default["default"]("neeto-themes-theme-thumbnail neeto-ui-rounded-lg cursor-pointer border transition-all duration-300 ease-in-out", {
|
|
1187
|
+
"neeto-ui-border-gray-200": !active,
|
|
1188
|
+
"neeto-themes-theme-thumbnail--active": active,
|
|
1189
|
+
"neeto-themes-theme-thumbnail--preview-active": isPreviewing,
|
|
1190
|
+
"neeto-themes-theme-thumbnail--highlight-active": isHighLightedTheme
|
|
1191
|
+
}),
|
|
1074
1192
|
onClick: function onClick() {
|
|
1075
1193
|
return onSetPreviewTheme(theme);
|
|
1076
1194
|
},
|
|
1077
|
-
children:
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1195
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1196
|
+
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",
|
|
1197
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1198
|
+
className: "absolute right-0 top-0 p-3",
|
|
1199
|
+
children: active ? /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
1200
|
+
className: "flex-shrink-0",
|
|
1201
|
+
"data-cy": "active-theme-label"
|
|
1202
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1203
|
+
className: classnames__default["default"]({
|
|
1204
|
+
hidden: !isPreviewing,
|
|
1205
|
+
"group-hover:block": true
|
|
1206
|
+
}),
|
|
1207
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
1208
|
+
className: "neeto-themes-theme-thumbnail__apply-btn flex-shrink-0",
|
|
1209
|
+
"data-cy": "apply-theme-button",
|
|
1210
|
+
disabled: isApplyingTheme,
|
|
1211
|
+
label: t("neetoThemes.common.apply"),
|
|
1212
|
+
loading: isApplyingTheme,
|
|
1213
|
+
size: "small",
|
|
1214
|
+
style: "tertiary",
|
|
1215
|
+
onClick: function onClick() {
|
|
1216
|
+
return onApplyTheme(theme);
|
|
1217
|
+
}
|
|
1218
|
+
})
|
|
1219
|
+
})
|
|
1220
|
+
}), Thumbnail$1 ? /*#__PURE__*/jsxRuntime.jsx(Thumbnail$1, {
|
|
1221
|
+
active: active,
|
|
1222
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
1223
|
+
isPreviewing: isPreviewing,
|
|
1224
|
+
theme: theme
|
|
1225
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Thumbnail, {
|
|
1226
|
+
active: active,
|
|
1227
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
1228
|
+
isPreviewing: isPreviewing,
|
|
1229
|
+
theme: theme
|
|
1230
|
+
})]
|
|
1096
1231
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1097
|
-
className: "flex items-
|
|
1098
|
-
children: [
|
|
1099
|
-
className: "flex-
|
|
1100
|
-
"data-cy": "
|
|
1101
|
-
|
|
1102
|
-
style: "
|
|
1103
|
-
|
|
1104
|
-
className: "flex-shrink-0",
|
|
1105
|
-
"data-cy": "apply-theme-button",
|
|
1106
|
-
disabled: isApplyingTheme,
|
|
1107
|
-
label: t("neetoThemes.common.apply"),
|
|
1108
|
-
loading: isApplyingTheme,
|
|
1109
|
-
size: "small",
|
|
1110
|
-
style: "link",
|
|
1111
|
-
onClick: handleApplyThemeClick
|
|
1232
|
+
className: "flex items-start justify-between gap-1 p-3",
|
|
1233
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
1234
|
+
className: "line-clamp-2 min-w-0 flex-grow break-words pt-1",
|
|
1235
|
+
"data-cy": "theme-name",
|
|
1236
|
+
lineHeight: "snug",
|
|
1237
|
+
style: "body2",
|
|
1238
|
+
children: name
|
|
1112
1239
|
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
1113
1240
|
dropdownButtonProps: {
|
|
1114
1241
|
size: "small"
|
|
1115
1242
|
},
|
|
1116
1243
|
dropdownProps: {
|
|
1117
|
-
strategy: "fixed"
|
|
1244
|
+
strategy: "fixed",
|
|
1245
|
+
onClick: function onClick(e) {
|
|
1246
|
+
return e.stopPropagation();
|
|
1247
|
+
}
|
|
1118
1248
|
},
|
|
1119
1249
|
menuItems: [{
|
|
1120
1250
|
key: "edit",
|
|
@@ -1138,7 +1268,7 @@ var Card = function Card(_ref) {
|
|
|
1138
1268
|
}]
|
|
1139
1269
|
})]
|
|
1140
1270
|
})]
|
|
1141
|
-
})
|
|
1271
|
+
})
|
|
1142
1272
|
});
|
|
1143
1273
|
};
|
|
1144
1274
|
var Card$1 = /*#__PURE__*/react.memo(Card);
|
|
@@ -1151,12 +1281,14 @@ var Themes = function Themes(_ref) {
|
|
|
1151
1281
|
defaultThemes = _ref$defaultThemes === void 0 ? [] : _ref$defaultThemes,
|
|
1152
1282
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
1153
1283
|
themeToHighlight = _ref.themeToHighlight,
|
|
1154
|
-
highlightTheme = _ref.highlightTheme,
|
|
1155
1284
|
didScrollActiveThemeIntoView = _ref.didScrollActiveThemeIntoView,
|
|
1156
1285
|
isLoading = _ref.isLoading,
|
|
1157
1286
|
currentTheme = _ref.currentTheme,
|
|
1158
1287
|
isCurrentThemeLoading = _ref.isCurrentThemeLoading,
|
|
1159
|
-
thumbnail = _ref.thumbnail
|
|
1288
|
+
thumbnail = _ref.thumbnail,
|
|
1289
|
+
themeBeingApplied = _ref.themeBeingApplied,
|
|
1290
|
+
onApplyTheme = _ref.onApplyTheme,
|
|
1291
|
+
isApplyingTheme = _ref.isApplyingTheme;
|
|
1160
1292
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1161
1293
|
t = _useTranslation.t;
|
|
1162
1294
|
var _useThemeUtils = useThemeUtils(),
|
|
@@ -1173,24 +1305,8 @@ var Themes = function Themes(_ref) {
|
|
|
1173
1305
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1174
1306
|
searchQuery = _useState2[0],
|
|
1175
1307
|
setSearchQuery = _useState2[1];
|
|
1176
|
-
var _useState3 = react.useState({}),
|
|
1177
|
-
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
1178
|
-
themeBeingApplied = _useState4[0],
|
|
1179
|
-
setThemeBeingApplied = _useState4[1];
|
|
1180
1308
|
var _useCloneTheme = useCloneTheme(),
|
|
1181
1309
|
cloneTheme = _useCloneTheme.mutate;
|
|
1182
|
-
var _useApplyTheme = useApplyTheme({
|
|
1183
|
-
onSuccess: function onSuccess(_ref2) {
|
|
1184
|
-
var theme = _ref2.theme;
|
|
1185
|
-
setTheme(theme);
|
|
1186
|
-
setThemeState({
|
|
1187
|
-
previewingTheme: theme
|
|
1188
|
-
});
|
|
1189
|
-
setThemeBeingApplied({});
|
|
1190
|
-
}
|
|
1191
|
-
}),
|
|
1192
|
-
applyTheme = _useApplyTheme.mutate,
|
|
1193
|
-
isApplyingTheme = _useApplyTheme.isLoading;
|
|
1194
1310
|
react.useEffect(function () {
|
|
1195
1311
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
1196
1312
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -1213,9 +1329,9 @@ var Themes = function Themes(_ref) {
|
|
|
1213
1329
|
var isSearchFieldVisible = (themes === null || themes === void 0 ? void 0 : themes.length) + (defaultThemes === null || defaultThemes === void 0 ? void 0 : defaultThemes.length) > 10;
|
|
1214
1330
|
var handleCloneTheme = function handleCloneTheme(data) {
|
|
1215
1331
|
cloneTheme(data.id, {
|
|
1216
|
-
onSuccess: function onSuccess(
|
|
1217
|
-
var clonedTheme =
|
|
1218
|
-
|
|
1332
|
+
onSuccess: function onSuccess(_ref2) {
|
|
1333
|
+
var clonedTheme = _ref2.theme;
|
|
1334
|
+
onEditTheme(clonedTheme);
|
|
1219
1335
|
}
|
|
1220
1336
|
});
|
|
1221
1337
|
};
|
|
@@ -1250,8 +1366,7 @@ var Themes = function Themes(_ref) {
|
|
|
1250
1366
|
className: "flex flex-col gap-4 px-4 pb-10 lg:px-5 xl:px-6",
|
|
1251
1367
|
children: filteredDefaultThemes.map(function (theme) {
|
|
1252
1368
|
return /*#__PURE__*/react.createElement(Card$1, {
|
|
1253
|
-
|
|
1254
|
-
setThemeBeingApplied: setThemeBeingApplied,
|
|
1369
|
+
onApplyTheme: onApplyTheme,
|
|
1255
1370
|
theme: theme,
|
|
1256
1371
|
thumbnail: thumbnail,
|
|
1257
1372
|
active: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id,
|
|
@@ -1278,10 +1393,9 @@ var Themes = function Themes(_ref) {
|
|
|
1278
1393
|
var isActive = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id;
|
|
1279
1394
|
var isPreviewing = (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id;
|
|
1280
1395
|
return /*#__PURE__*/react.createElement(Card$1, {
|
|
1281
|
-
applyTheme: applyTheme,
|
|
1282
1396
|
isPreviewing: isPreviewing,
|
|
1397
|
+
onApplyTheme: onApplyTheme,
|
|
1283
1398
|
onEditTheme: onEditTheme,
|
|
1284
|
-
setThemeBeingApplied: setThemeBeingApplied,
|
|
1285
1399
|
theme: theme,
|
|
1286
1400
|
thumbnail: thumbnail,
|
|
1287
1401
|
active: isActive,
|
|
@@ -1361,7 +1475,8 @@ var TitleBar = function TitleBar(_ref) {
|
|
|
1361
1475
|
var MemoizedAlert = /*#__PURE__*/react.memo(Alert__default["default"]);
|
|
1362
1476
|
var Sidebar = function Sidebar(_ref) {
|
|
1363
1477
|
var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3;
|
|
1364
|
-
var thumbnail = _ref.thumbnail
|
|
1478
|
+
var thumbnail = _ref.thumbnail,
|
|
1479
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
1365
1480
|
var _useState = react.useState(DESIGN_SCREENS.THEMES),
|
|
1366
1481
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1367
1482
|
currentScreen = _useState2[0],
|
|
@@ -1374,6 +1489,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1374
1489
|
_useState6 = _slicedToArray__default["default"](_useState5, 2),
|
|
1375
1490
|
themeToHighlight = _useState6[0],
|
|
1376
1491
|
setThemeToHighlight = _useState6[1];
|
|
1492
|
+
var _useState7 = react.useState({}),
|
|
1493
|
+
_useState8 = _slicedToArray__default["default"](_useState7, 2),
|
|
1494
|
+
themeBeingApplied = _useState8[0],
|
|
1495
|
+
setThemeBeingApplied = _useState8[1];
|
|
1377
1496
|
var _useConfigStore = useConfigStore(function (store) {
|
|
1378
1497
|
return {
|
|
1379
1498
|
entityType: store["entityType"],
|
|
@@ -1412,12 +1531,34 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1412
1531
|
var _useDeleteTheme = useDeleteTheme(),
|
|
1413
1532
|
deleteTheme = _useDeleteTheme.mutate,
|
|
1414
1533
|
isDeleting = _useDeleteTheme.isLoading;
|
|
1534
|
+
var _useApplyTheme = useApplyTheme({
|
|
1535
|
+
onSuccess: function onSuccess(_ref2) {
|
|
1536
|
+
var theme = _ref2.theme;
|
|
1537
|
+
setTheme(theme);
|
|
1538
|
+
setThemeState({
|
|
1539
|
+
previewingTheme: theme
|
|
1540
|
+
});
|
|
1541
|
+
setThemeBeingApplied({});
|
|
1542
|
+
setCurrentScreen(DESIGN_SCREENS.THEMES);
|
|
1543
|
+
}
|
|
1544
|
+
}),
|
|
1545
|
+
applyTheme = _useApplyTheme.mutate,
|
|
1546
|
+
isApplyingTheme = _useApplyTheme.isLoading;
|
|
1415
1547
|
var themeToDelete = react.useRef(null);
|
|
1416
1548
|
var themeToEdit = react.useRef(null);
|
|
1417
1549
|
var handleEditTheme = function handleEditTheme(theme) {
|
|
1418
1550
|
themeToEdit.current = theme;
|
|
1419
1551
|
setCurrentScreen(DESIGN_SCREENS.Customize);
|
|
1420
1552
|
};
|
|
1553
|
+
var onApplyTheme = function onApplyTheme(theme) {
|
|
1554
|
+
if (isApplyingTheme) return;
|
|
1555
|
+
setThemeBeingApplied(theme);
|
|
1556
|
+
applyTheme({
|
|
1557
|
+
themeId: theme.id,
|
|
1558
|
+
entityId: entityId,
|
|
1559
|
+
entityType: entityType
|
|
1560
|
+
});
|
|
1561
|
+
};
|
|
1421
1562
|
var handleBackPress = function handleBackPress() {
|
|
1422
1563
|
setTheme(currentTheme);
|
|
1423
1564
|
setThemeState({
|
|
@@ -1436,13 +1577,11 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1436
1577
|
setThemeToHighlight(themeToHighlight.id);
|
|
1437
1578
|
};
|
|
1438
1579
|
var onCreateTheme = function onCreateTheme(createdTheme) {
|
|
1439
|
-
|
|
1580
|
+
themeToEdit.current = createdTheme;
|
|
1440
1581
|
setTheme(createdTheme);
|
|
1441
1582
|
setThemeState({
|
|
1442
1583
|
previewingTheme: createdTheme
|
|
1443
1584
|
});
|
|
1444
|
-
highlightTheme(createdTheme);
|
|
1445
|
-
themeToEdit.current = null;
|
|
1446
1585
|
};
|
|
1447
1586
|
var handleDelete = function handleDelete(themeId, name, appliedCount) {
|
|
1448
1587
|
setIsDeleteAlertOpen(true);
|
|
@@ -1491,7 +1630,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1491
1630
|
defaultThemes: defaultThemes,
|
|
1492
1631
|
didScrollActiveThemeIntoView: didScrollActiveThemeIntoView,
|
|
1493
1632
|
highlightTheme: highlightTheme,
|
|
1633
|
+
isApplyingTheme: isApplyingTheme,
|
|
1494
1634
|
isCurrentThemeLoading: isCurrentThemeLoading,
|
|
1635
|
+
onApplyTheme: onApplyTheme,
|
|
1636
|
+
themeBeingApplied: themeBeingApplied,
|
|
1495
1637
|
themeToHighlight: themeToHighlight,
|
|
1496
1638
|
themes: themes,
|
|
1497
1639
|
thumbnail: thumbnail,
|
|
@@ -1499,7 +1641,10 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
1499
1641
|
onDeleteTheme: handleDelete,
|
|
1500
1642
|
onEditTheme: handleEditTheme
|
|
1501
1643
|
}) : /*#__PURE__*/jsxRuntime.jsx(Customize, {
|
|
1644
|
+
isApplyingTheme: isApplyingTheme,
|
|
1645
|
+
onApplyTheme: onApplyTheme,
|
|
1502
1646
|
onCreateTheme: onCreateTheme,
|
|
1647
|
+
onPropertiesChange: onPropertiesChange,
|
|
1503
1648
|
theme: themeToEdit.current,
|
|
1504
1649
|
themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
|
|
1505
1650
|
}), /*#__PURE__*/jsxRuntime.jsx(MemoizedAlert, {
|
|
@@ -1538,13 +1683,13 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
|
1538
1683
|
react.useEffect(function () {
|
|
1539
1684
|
setConfigState({
|
|
1540
1685
|
entityType: entityType,
|
|
1541
|
-
entityId: entityId
|
|
1542
|
-
onPropertiesChange: onPropertiesChange
|
|
1686
|
+
entityId: entityId
|
|
1543
1687
|
});
|
|
1544
1688
|
}, []);
|
|
1545
1689
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1546
1690
|
className: "neeto-themes__wrapper",
|
|
1547
1691
|
children: [/*#__PURE__*/jsxRuntime.jsx(Sidebar, {
|
|
1692
|
+
onPropertiesChange: onPropertiesChange,
|
|
1548
1693
|
thumbnail: thumbnail
|
|
1549
1694
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1550
1695
|
className: "neeto-themes-preview__wrapper",
|
|
@@ -1559,7 +1704,7 @@ var index = reactUtils.withTitle(NeetoThemesBuilder, i18next.t("neetoThemes.comm
|
|
|
1559
1704
|
|
|
1560
1705
|
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}}
|
|
1561
1706
|
|
|
1562
|
-
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-
|
|
1707
|
+
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3RoZW1lcy5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1QkFFRSxZQUFBLENBREEsVUNFRixDRENFLDZDQUdFLDJDQUFBLENBQ0EsbUNBQUEsQ0FGQSx5QkFBQSxDQURBLFdDSUosQ0RBSSwwQkFMRiw2Q0FNSSxXQ0dKLENBQ0YsQ0RGSSwwQkFSRiw2Q0FTSSxXQ0tKLENBQ0YsQ0RISSwyRUFFRSxrQkFBQSxDQURBLGdCQ01OLENERkksMkVBQ0UsMEJBQUEsQ0FDQSxlQ0lOLENERFEsNElBQ0UsWUNHVixDREdFLHNEQUdFLFdBQUEsQ0FEQSx5QkFBQSxDQURBLGlCQ0NKLENES0EsOENBQ0Usb0RBQUEsQ0FDQSx5RENGRixDRFVBLHNGQUNFLHVEQUFBLENBQ0EsNERDRkYsQ0RLQSx5Q0FDRSw2QkFBQSxDQUNBLGtDQ0ZGLENER0UscUdBRUUsbUJDRkoiLCJzb3VyY2VzQ29udGVudCI6WyIubmVldG8tdGhlbWVzX193cmFwcGVyIHtcbiAgd2lkdGg6IDEwMCU7XG4gIGRpc3BsYXk6IGZsZXg7XG5cbiAgLm5lZXRvLXRoZW1lcy1zaWRlYmFyIHtcbiAgICB3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