@bigbinary/neeto-themes-frontend 1.1.23 → 1.1.25
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/dist/index.cjs.js +162 -152
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +165 -155
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +3 -2
package/dist/index.cjs.js
CHANGED
|
@@ -78,11 +78,11 @@ var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
|
|
|
78
78
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
79
79
|
var useConfigStore = zustand.create(reactUtils.withImmutableActions(function (set) {
|
|
80
80
|
return {
|
|
81
|
-
|
|
81
|
+
themePropertiesSchema: [],
|
|
82
82
|
entityType: "",
|
|
83
83
|
entityId: "",
|
|
84
84
|
variableNamesMap: {},
|
|
85
|
-
|
|
85
|
+
isFetchingSchema: true,
|
|
86
86
|
setConfigState: set
|
|
87
87
|
};
|
|
88
88
|
}));
|
|
@@ -522,22 +522,16 @@ var WHITE = "255, 255, 255";
|
|
|
522
522
|
var BLACK = "0, 0, 0";
|
|
523
523
|
|
|
524
524
|
var show$1 = function show(entityId) {
|
|
525
|
-
return axios__default["default"].get("".concat(BASE_URL, "/api/v1/
|
|
526
|
-
};
|
|
527
|
-
var create$2 = function create(payload) {
|
|
528
|
-
return axios__default["default"].post("".concat(BASE_URL, "/api/v1/theme/entities"), {
|
|
529
|
-
entity: payload
|
|
530
|
-
});
|
|
525
|
+
return axios__default["default"].get("".concat(BASE_URL, "/api/v1/entities/").concat(entityId));
|
|
531
526
|
};
|
|
532
527
|
var entitiesApi = {
|
|
533
|
-
show: show$1
|
|
534
|
-
create: create$2
|
|
528
|
+
show: show$1
|
|
535
529
|
};
|
|
536
530
|
|
|
537
531
|
var QUERY_KEYS$1 = {
|
|
538
532
|
THEMES_LIST: "themes-list",
|
|
539
533
|
THEME_DETAILS: "theme-details",
|
|
540
|
-
|
|
534
|
+
SCHEMA_DETAILS: "schema-details"
|
|
541
535
|
};
|
|
542
536
|
|
|
543
537
|
var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
@@ -547,14 +541,37 @@ var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
|
547
541
|
enabled: !!entityId
|
|
548
542
|
});
|
|
549
543
|
};
|
|
550
|
-
var useCreateThemeEntity = function useCreateThemeEntity(_ref) {
|
|
551
|
-
var onSuccess = _ref.onSuccess;
|
|
552
|
-
return reactUtils.useMutationWithInvalidation(entitiesApi.create, {
|
|
553
|
-
keysToInvalidate: [QUERY_KEYS$1.THEMES_LIST, QUERY_KEYS$1.THEME_ENTITY_DETAILS],
|
|
554
|
-
onSuccess: onSuccess
|
|
555
|
-
});
|
|
556
|
-
};
|
|
557
544
|
|
|
545
|
+
function _objectWithoutPropertiesLoose$6(source, excluded) {
|
|
546
|
+
if (source == null) return {};
|
|
547
|
+
var target = {};
|
|
548
|
+
var sourceKeys = Object.keys(source);
|
|
549
|
+
var key, i;
|
|
550
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
551
|
+
key = sourceKeys[i];
|
|
552
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
553
|
+
target[key] = source[key];
|
|
554
|
+
}
|
|
555
|
+
return target;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
function _objectWithoutProperties$6(source, excluded) {
|
|
559
|
+
if (source == null) return {};
|
|
560
|
+
var target = _objectWithoutPropertiesLoose$6(source, excluded);
|
|
561
|
+
var key, i;
|
|
562
|
+
if (Object.getOwnPropertySymbols) {
|
|
563
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
564
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
565
|
+
key = sourceSymbolKeys[i];
|
|
566
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
567
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
568
|
+
target[key] = source[key];
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return target;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
var _excluded$9 = ["themeId"];
|
|
558
575
|
var list$1 = function list() {
|
|
559
576
|
return axios__default["default"].get("".concat(BASE_URL, "/api/v1/themes"));
|
|
560
577
|
};
|
|
@@ -579,13 +596,21 @@ var destroy = function destroy(id) {
|
|
|
579
596
|
var clone = function clone(id) {
|
|
580
597
|
return axios__default["default"].post("".concat(BASE_URL, "/api/v1/themes/").concat(id, "/clone"));
|
|
581
598
|
};
|
|
599
|
+
var apply = function apply(_ref2) {
|
|
600
|
+
var themeId = _ref2.themeId,
|
|
601
|
+
payload = _objectWithoutProperties$6(_ref2, _excluded$9);
|
|
602
|
+
return axios__default["default"].post("".concat(BASE_URL, "/api/v1/themes/").concat(themeId, "/apply"), {
|
|
603
|
+
entity: payload
|
|
604
|
+
});
|
|
605
|
+
};
|
|
582
606
|
var themesApi = {
|
|
583
607
|
list: list$1,
|
|
584
608
|
show: show,
|
|
585
609
|
create: create$1,
|
|
586
610
|
update: update$1,
|
|
587
611
|
destroy: destroy,
|
|
588
|
-
clone: clone
|
|
612
|
+
clone: clone,
|
|
613
|
+
apply: apply
|
|
589
614
|
};
|
|
590
615
|
|
|
591
616
|
var useListThemes = function useListThemes() {
|
|
@@ -616,6 +641,13 @@ var useCloneTheme = function useCloneTheme() {
|
|
|
616
641
|
keysToInvalidate: [QUERY_KEYS$1.THEMES_LIST]
|
|
617
642
|
});
|
|
618
643
|
};
|
|
644
|
+
var useApplyTheme = function useApplyTheme(_ref) {
|
|
645
|
+
var onSuccess = _ref.onSuccess;
|
|
646
|
+
return reactUtils.useMutationWithInvalidation(themesApi.apply, {
|
|
647
|
+
keysToInvalidate: [QUERY_KEYS$1.THEMES_LIST, QUERY_KEYS$1.THEME_ENTITY_DETAILS],
|
|
648
|
+
onSuccess: onSuccess
|
|
649
|
+
});
|
|
650
|
+
};
|
|
619
651
|
|
|
620
652
|
var root = document.querySelector(":root");
|
|
621
653
|
var setVariable = function setVariable(name, value, variableNamesMap) {
|
|
@@ -648,15 +680,15 @@ var setTheme = function setTheme(theme, variableNamesMap, themeConfig) {
|
|
|
648
680
|
};
|
|
649
681
|
|
|
650
682
|
var list = function list() {
|
|
651
|
-
return axios__default["default"].get("".concat(BASE_URL, "/api/v1/
|
|
683
|
+
return axios__default["default"].get("".concat(BASE_URL, "/api/v1/schema"));
|
|
652
684
|
};
|
|
653
|
-
var
|
|
685
|
+
var schemasApi = {
|
|
654
686
|
list: list
|
|
655
687
|
};
|
|
656
688
|
|
|
657
|
-
var
|
|
689
|
+
var useListSchema = function useListSchema(_ref) {
|
|
658
690
|
var onSuccess = _ref.onSuccess;
|
|
659
|
-
return reactQuery.useQuery(QUERY_KEYS$1.
|
|
691
|
+
return reactQuery.useQuery(QUERY_KEYS$1.SCHEMA_DETAILS, schemasApi.list, {
|
|
660
692
|
onSuccess: onSuccess
|
|
661
693
|
});
|
|
662
694
|
};
|
|
@@ -671,42 +703,42 @@ var useThemeUtils = function useThemeUtils() {
|
|
|
671
703
|
}, shallow.shallow),
|
|
672
704
|
previewingTheme = _useThemeStore.previewingTheme,
|
|
673
705
|
currentTheme = _useThemeStore.currentTheme;
|
|
674
|
-
var
|
|
706
|
+
var _useListSchema = useListSchema({
|
|
675
707
|
onSuccess: function onSuccess(_ref) {
|
|
676
|
-
var _ref$
|
|
677
|
-
|
|
708
|
+
var _ref$schema = _ref.schema,
|
|
709
|
+
themePropertiesSchema = _ref$schema === void 0 ? [] : _ref$schema,
|
|
678
710
|
_ref$variableNamesMap = _ref.variableNamesMap,
|
|
679
711
|
variableNamesMap = _ref$variableNamesMap === void 0 ? {} : _ref$variableNamesMap;
|
|
680
712
|
return setConfigState({
|
|
681
|
-
|
|
713
|
+
themePropertiesSchema: themePropertiesSchema,
|
|
682
714
|
variableNamesMap: variableNamesMap
|
|
683
715
|
});
|
|
684
716
|
}
|
|
685
717
|
}),
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
variableNamesMap =
|
|
718
|
+
isFetchingSchema = _useListSchema.isLoading,
|
|
719
|
+
_useListSchema$data = _useListSchema.data,
|
|
720
|
+
_useListSchema$data2 = _useListSchema$data === void 0 ? {} : _useListSchema$data,
|
|
721
|
+
_useListSchema$data2$ = _useListSchema$data2.schema,
|
|
722
|
+
themePropertiesSchema = _useListSchema$data2$ === void 0 ? [] : _useListSchema$data2$,
|
|
723
|
+
_useListSchema$data2$2 = _useListSchema$data2.variableNamesMap,
|
|
724
|
+
variableNamesMap = _useListSchema$data2$2 === void 0 ? {} : _useListSchema$data2$2;
|
|
693
725
|
React.useEffect(function () {
|
|
694
726
|
return setConfigState({
|
|
695
|
-
|
|
727
|
+
isFetchingSchema: isFetchingSchema
|
|
696
728
|
});
|
|
697
|
-
}, [
|
|
729
|
+
}, [isFetchingSchema]);
|
|
698
730
|
var setVariable$1 = function setVariable$1(name, value) {
|
|
699
731
|
return setVariable(name, value, variableNamesMap);
|
|
700
732
|
};
|
|
701
733
|
var setTheme$1 = function setTheme$1(theme) {
|
|
702
|
-
return setTheme(theme, variableNamesMap,
|
|
734
|
+
return setTheme(theme, variableNamesMap, themePropertiesSchema);
|
|
703
735
|
};
|
|
704
736
|
return {
|
|
705
737
|
setTheme: setTheme$1,
|
|
706
738
|
setVariable: setVariable$1,
|
|
707
739
|
previewingTheme: previewingTheme,
|
|
708
740
|
currentTheme: currentTheme,
|
|
709
|
-
|
|
741
|
+
isFetchingSchema: isFetchingSchema
|
|
710
742
|
};
|
|
711
743
|
};
|
|
712
744
|
|
|
@@ -827,11 +859,11 @@ var OVERLAY_OPACITY_SLIDER_MARKS = {
|
|
|
827
859
|
};
|
|
828
860
|
var HUNDRED = 100;
|
|
829
861
|
|
|
830
|
-
var buildInitialValues = function buildInitialValues(theme,
|
|
862
|
+
var buildInitialValues = function buildInitialValues(theme, themePropertiesSchema) {
|
|
831
863
|
if (neetoCist.isPresent(theme)) return theme;
|
|
832
864
|
return {
|
|
833
865
|
name: i18next.t("neetoThemes.build.leftSideBar.themes.createTheme.newThemeName"),
|
|
834
|
-
properties:
|
|
866
|
+
properties: themePropertiesSchema.map(function (_ref) {
|
|
835
867
|
var key = _ref.key,
|
|
836
868
|
kind = _ref.kind,
|
|
837
869
|
defaultValue = _ref.defaultValue;
|
|
@@ -878,27 +910,27 @@ var buildInitialValues = function buildInitialValues(theme, themeConfig) {
|
|
|
878
910
|
}).filter(neetoCist.isNot(null))
|
|
879
911
|
};
|
|
880
912
|
};
|
|
881
|
-
var buildImageData = function buildImageData(values,
|
|
913
|
+
var buildImageData = function buildImageData(values, themePropertiesSchema) {
|
|
882
914
|
return neetoCist.filterBy({
|
|
883
915
|
kind: "image"
|
|
884
|
-
},
|
|
916
|
+
}, themePropertiesSchema).reduce(function (acc, item) {
|
|
885
917
|
var _values$snakeToCamelC;
|
|
886
918
|
var signedId = (_values$snakeToCamelC = values[neetoCist.snakeToCamelCase(item.key)]) === null || _values$snakeToCamelC === void 0 ? void 0 : _values$snakeToCamelC.signedId;
|
|
887
919
|
acc[item.key] = signedId;
|
|
888
920
|
return acc;
|
|
889
921
|
}, {});
|
|
890
922
|
};
|
|
891
|
-
var isPropertyVisible = function isPropertyVisible(key, formikValues,
|
|
923
|
+
var isPropertyVisible = function isPropertyVisible(key, formikValues, themePropertiesSchema) {
|
|
892
924
|
var _findBy;
|
|
893
925
|
var property = neetoCist.findBy({
|
|
894
926
|
key: key
|
|
895
|
-
},
|
|
927
|
+
}, themePropertiesSchema);
|
|
896
928
|
if (neetoCist.isNotPresent(property)) return false;
|
|
897
929
|
var conditionalKey = property === null || property === void 0 ? void 0 : property.dependsOn;
|
|
898
930
|
if (neetoCist.isNotPresent(conditionalKey)) return true;
|
|
899
931
|
var dependentProperty = neetoCist.findBy({
|
|
900
932
|
key: conditionalKey
|
|
901
|
-
},
|
|
933
|
+
}, themePropertiesSchema);
|
|
902
934
|
if (dependentProperty.kind === "image") {
|
|
903
935
|
var _formikValues$snakeTo;
|
|
904
936
|
return neetoCist.isPresent((_formikValues$snakeTo = formikValues[neetoCist.snakeToCamelCase(conditionalKey)]) === null || _formikValues$snakeTo === void 0 ? void 0 : _formikValues$snakeTo.url);
|
|
@@ -2833,9 +2865,9 @@ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
2833
2865
|
|
|
2834
2866
|
function _defineProperty$1$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2835
2867
|
|
|
2836
|
-
function _objectWithoutProperties$1$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$
|
|
2868
|
+
function _objectWithoutProperties$1$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$5(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2837
2869
|
|
|
2838
|
-
function _objectWithoutPropertiesLoose$
|
|
2870
|
+
function _objectWithoutPropertiesLoose$5(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2839
2871
|
/**
|
|
2840
2872
|
* Convenience wrapper component for the `useDropzone` hook
|
|
2841
2873
|
*
|
|
@@ -6226,7 +6258,7 @@ var _reactInfiniteScroller2 = _interopRequireDefault(_reactInfiniteScroller);
|
|
|
6226
6258
|
|
|
6227
6259
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6228
6260
|
|
|
6229
|
-
function _objectWithoutProperties$
|
|
6261
|
+
function _objectWithoutProperties$5(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
6230
6262
|
|
|
6231
6263
|
function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6232
6264
|
|
|
@@ -6330,7 +6362,7 @@ var MasonryInfiniteScroller = (_temp2 = _class = function (_Component) {
|
|
|
6330
6362
|
_props.packed;
|
|
6331
6363
|
_props.position;
|
|
6332
6364
|
_props.sizes;
|
|
6333
|
-
var props = _objectWithoutProperties$
|
|
6365
|
+
var props = _objectWithoutProperties$5(_props, ['children', 'className', 'style', 'pack', 'packed', 'position', 'sizes']);
|
|
6334
6366
|
|
|
6335
6367
|
return _react2.default.createElement(
|
|
6336
6368
|
_reactInfiniteScroller2.default,
|
|
@@ -13909,7 +13941,7 @@ function supportRef$3(nodeOrComponent) {
|
|
|
13909
13941
|
}
|
|
13910
13942
|
/* eslint-enable */
|
|
13911
13943
|
|
|
13912
|
-
function _objectWithoutPropertiesLoose$
|
|
13944
|
+
function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
13913
13945
|
if (source == null) return {};
|
|
13914
13946
|
var target = {};
|
|
13915
13947
|
var sourceKeys = Object.keys(source);
|
|
@@ -13922,9 +13954,9 @@ function _objectWithoutPropertiesLoose$5(source, excluded) {
|
|
|
13922
13954
|
return target;
|
|
13923
13955
|
}
|
|
13924
13956
|
|
|
13925
|
-
function _objectWithoutProperties$
|
|
13957
|
+
function _objectWithoutProperties$4(source, excluded) {
|
|
13926
13958
|
if (source == null) return {};
|
|
13927
|
-
var target = _objectWithoutPropertiesLoose$
|
|
13959
|
+
var target = _objectWithoutPropertiesLoose$4(source, excluded);
|
|
13928
13960
|
var key, i;
|
|
13929
13961
|
if (Object.getOwnPropertySymbols) {
|
|
13930
13962
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -13942,7 +13974,7 @@ var _excluded$7 = ["children"];
|
|
|
13942
13974
|
var Context$1 = /*#__PURE__*/React__namespace.createContext({});
|
|
13943
13975
|
function MotionProvider(_ref) {
|
|
13944
13976
|
var children = _ref.children,
|
|
13945
|
-
props = _objectWithoutProperties$
|
|
13977
|
+
props = _objectWithoutProperties$4(_ref, _excluded$7);
|
|
13946
13978
|
return /*#__PURE__*/React__namespace.createElement(Context$1.Provider, {
|
|
13947
13979
|
value: props
|
|
13948
13980
|
}, children);
|
|
@@ -14755,7 +14787,7 @@ function genCSSMotionList$1(transitionSupport) {
|
|
|
14755
14787
|
children = _this$props.children,
|
|
14756
14788
|
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
14757
14789
|
onAllRemoved = _this$props.onAllRemoved,
|
|
14758
|
-
restProps = _objectWithoutProperties$
|
|
14790
|
+
restProps = _objectWithoutProperties$4(_this$props, _excluded$6);
|
|
14759
14791
|
var Component = component || React__namespace.Fragment;
|
|
14760
14792
|
var motionProps = {};
|
|
14761
14793
|
MOTION_PROP_NAMES$1.forEach(function (prop) {
|
|
@@ -14765,7 +14797,7 @@ function genCSSMotionList$1(transitionSupport) {
|
|
|
14765
14797
|
delete restProps.keys;
|
|
14766
14798
|
return /*#__PURE__*/React__namespace.createElement(Component, restProps, keyEntities.map(function (_ref2, index) {
|
|
14767
14799
|
var status = _ref2.status,
|
|
14768
|
-
eventProps = _objectWithoutProperties$
|
|
14800
|
+
eventProps = _objectWithoutProperties$4(_ref2, _excluded2$1);
|
|
14769
14801
|
var visible = status === STATUS_ADD$1 || status === STATUS_KEEP$1;
|
|
14770
14802
|
return /*#__PURE__*/React__namespace.createElement(CSSMotion, _extends$6({}, motionProps, {
|
|
14771
14803
|
key: eventProps.key,
|
|
@@ -16553,7 +16585,7 @@ function supportRef$1(nodeOrComponent) {
|
|
|
16553
16585
|
}
|
|
16554
16586
|
/* eslint-enable */
|
|
16555
16587
|
|
|
16556
|
-
function _objectWithoutPropertiesLoose$
|
|
16588
|
+
function _objectWithoutPropertiesLoose$3(source, excluded) {
|
|
16557
16589
|
if (source == null) return {};
|
|
16558
16590
|
var target = {};
|
|
16559
16591
|
var sourceKeys = Object.keys(source);
|
|
@@ -16566,9 +16598,9 @@ function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
|
16566
16598
|
return target;
|
|
16567
16599
|
}
|
|
16568
16600
|
|
|
16569
|
-
function _objectWithoutProperties$
|
|
16601
|
+
function _objectWithoutProperties$3(source, excluded) {
|
|
16570
16602
|
if (source == null) return {};
|
|
16571
|
-
var target = _objectWithoutPropertiesLoose$
|
|
16603
|
+
var target = _objectWithoutPropertiesLoose$3(source, excluded);
|
|
16572
16604
|
var key, i;
|
|
16573
16605
|
if (Object.getOwnPropertySymbols) {
|
|
16574
16606
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -17504,7 +17536,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
17504
17536
|
children = _this$props.children,
|
|
17505
17537
|
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
17506
17538
|
onAllRemoved = _this$props.onAllRemoved,
|
|
17507
|
-
restProps = _objectWithoutProperties$
|
|
17539
|
+
restProps = _objectWithoutProperties$3(_this$props, _excluded$5);
|
|
17508
17540
|
var Component = component || React__namespace.Fragment;
|
|
17509
17541
|
var motionProps = {};
|
|
17510
17542
|
MOTION_PROP_NAMES.forEach(function (prop) {
|
|
@@ -17514,7 +17546,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
17514
17546
|
delete restProps.keys;
|
|
17515
17547
|
return /*#__PURE__*/React__namespace.createElement(Component, restProps, keyEntities.map(function (_ref2) {
|
|
17516
17548
|
var status = _ref2.status,
|
|
17517
|
-
eventProps = _objectWithoutProperties$
|
|
17549
|
+
eventProps = _objectWithoutProperties$3(_ref2, _excluded2);
|
|
17518
17550
|
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
|
17519
17551
|
return /*#__PURE__*/React__namespace.createElement(CSSMotion$1, _extends$4({}, motionProps, {
|
|
17520
17552
|
key: eventProps.key,
|
|
@@ -18038,7 +18070,7 @@ function _slicedToArray$2(arr, i) {
|
|
|
18038
18070
|
return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$2();
|
|
18039
18071
|
}
|
|
18040
18072
|
|
|
18041
|
-
function _objectWithoutPropertiesLoose$
|
|
18073
|
+
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
18042
18074
|
if (source == null) return {};
|
|
18043
18075
|
var target = {};
|
|
18044
18076
|
var sourceKeys = Object.keys(source);
|
|
@@ -18051,9 +18083,9 @@ function _objectWithoutPropertiesLoose$3(source, excluded) {
|
|
|
18051
18083
|
return target;
|
|
18052
18084
|
}
|
|
18053
18085
|
|
|
18054
|
-
function _objectWithoutProperties$
|
|
18086
|
+
function _objectWithoutProperties$2(source, excluded) {
|
|
18055
18087
|
if (source == null) return {};
|
|
18056
|
-
var target = _objectWithoutPropertiesLoose$
|
|
18088
|
+
var target = _objectWithoutPropertiesLoose$2(source, excluded);
|
|
18057
18089
|
var key, i;
|
|
18058
18090
|
if (Object.getOwnPropertySymbols) {
|
|
18059
18091
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -20027,7 +20059,7 @@ function generateTrigger() {
|
|
|
20027
20059
|
maskAnimation = props.maskAnimation,
|
|
20028
20060
|
className = props.className,
|
|
20029
20061
|
getTriggerDOMNode = props.getTriggerDOMNode,
|
|
20030
|
-
restProps = _objectWithoutProperties$
|
|
20062
|
+
restProps = _objectWithoutProperties$2(props, _excluded$4);
|
|
20031
20063
|
var mergedAutoDestroy = autoDestroy || destroyPopupOnHide || false;
|
|
20032
20064
|
|
|
20033
20065
|
// =========================== Mobile ===========================
|
|
@@ -20574,7 +20606,7 @@ function _objectSpread2$1(target) {
|
|
|
20574
20606
|
return target;
|
|
20575
20607
|
}
|
|
20576
20608
|
|
|
20577
|
-
function _objectWithoutPropertiesLoose$
|
|
20609
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
20578
20610
|
if (source == null) return {};
|
|
20579
20611
|
var target = {};
|
|
20580
20612
|
var sourceKeys = Object.keys(source);
|
|
@@ -20587,9 +20619,9 @@ function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
|
20587
20619
|
return target;
|
|
20588
20620
|
}
|
|
20589
20621
|
|
|
20590
|
-
function _objectWithoutProperties$
|
|
20622
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
20591
20623
|
if (source == null) return {};
|
|
20592
|
-
var target = _objectWithoutPropertiesLoose$
|
|
20624
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
20593
20625
|
var key, i;
|
|
20594
20626
|
if (Object.getOwnPropertySymbols) {
|
|
20595
20627
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -20719,7 +20751,7 @@ var Tooltip$2 = function Tooltip(props, ref) {
|
|
|
20719
20751
|
id = props.id,
|
|
20720
20752
|
_props$showArrow = props.showArrow,
|
|
20721
20753
|
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
|
20722
|
-
restProps = _objectWithoutProperties$
|
|
20754
|
+
restProps = _objectWithoutProperties$1(props, _excluded$3);
|
|
20723
20755
|
var triggerRef = React.useRef(null);
|
|
20724
20756
|
React.useImperativeHandle(ref, function () {
|
|
20725
20757
|
return triggerRef.current;
|
|
@@ -21643,7 +21675,7 @@ function _extends() {
|
|
|
21643
21675
|
return _extends.apply(this, arguments);
|
|
21644
21676
|
}
|
|
21645
21677
|
|
|
21646
|
-
function _objectWithoutPropertiesLoose
|
|
21678
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
21647
21679
|
if (source == null) return {};
|
|
21648
21680
|
var target = {};
|
|
21649
21681
|
var sourceKeys = Object.keys(source);
|
|
@@ -21656,9 +21688,9 @@ function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
|
21656
21688
|
return target;
|
|
21657
21689
|
}
|
|
21658
21690
|
|
|
21659
|
-
function _objectWithoutProperties
|
|
21691
|
+
function _objectWithoutProperties(source, excluded) {
|
|
21660
21692
|
if (source == null) return {};
|
|
21661
|
-
var target = _objectWithoutPropertiesLoose
|
|
21693
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
21662
21694
|
var key, i;
|
|
21663
21695
|
if (Object.getOwnPropertySymbols) {
|
|
21664
21696
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -21715,7 +21747,7 @@ var Handle = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
|
21715
21747
|
render = props.render,
|
|
21716
21748
|
dragging = props.dragging,
|
|
21717
21749
|
onOffsetChange = props.onOffsetChange,
|
|
21718
|
-
restProps = _objectWithoutProperties
|
|
21750
|
+
restProps = _objectWithoutProperties(props, _excluded$2);
|
|
21719
21751
|
var _React$useContext = React__namespace.useContext(SliderContext),
|
|
21720
21752
|
min = _React$useContext.min,
|
|
21721
21753
|
max = _React$useContext.max,
|
|
@@ -21825,7 +21857,7 @@ var Handles = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
|
21825
21857
|
values = props.values,
|
|
21826
21858
|
handleRender = props.handleRender,
|
|
21827
21859
|
draggingIndex = props.draggingIndex,
|
|
21828
|
-
restProps = _objectWithoutProperties
|
|
21860
|
+
restProps = _objectWithoutProperties(props, _excluded$1);
|
|
21829
21861
|
var handlesRef = React__namespace.useRef({});
|
|
21830
21862
|
React__namespace.useImperativeHandle(ref, function () {
|
|
21831
21863
|
return {
|
|
@@ -23368,42 +23400,13 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
23368
23400
|
});
|
|
23369
23401
|
};
|
|
23370
23402
|
|
|
23371
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
23372
|
-
if (source == null) return {};
|
|
23373
|
-
var target = {};
|
|
23374
|
-
var sourceKeys = Object.keys(source);
|
|
23375
|
-
var key, i;
|
|
23376
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
23377
|
-
key = sourceKeys[i];
|
|
23378
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
23379
|
-
target[key] = source[key];
|
|
23380
|
-
}
|
|
23381
|
-
return target;
|
|
23382
|
-
}
|
|
23383
|
-
|
|
23384
|
-
function _objectWithoutProperties(source, excluded) {
|
|
23385
|
-
if (source == null) return {};
|
|
23386
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
23387
|
-
var key, i;
|
|
23388
|
-
if (Object.getOwnPropertySymbols) {
|
|
23389
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
23390
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
23391
|
-
key = sourceSymbolKeys[i];
|
|
23392
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
23393
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
23394
|
-
target[key] = source[key];
|
|
23395
|
-
}
|
|
23396
|
-
}
|
|
23397
|
-
return target;
|
|
23398
|
-
}
|
|
23399
|
-
|
|
23400
23403
|
var _excluded = ["label", "name"];
|
|
23401
23404
|
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; }
|
|
23402
23405
|
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$9(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; }
|
|
23403
23406
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
23404
23407
|
var label = _ref.label,
|
|
23405
23408
|
name = _ref.name,
|
|
23406
|
-
switchProps = _objectWithoutProperties(_ref, _excluded);
|
|
23409
|
+
switchProps = _objectWithoutProperties$6(_ref, _excluded);
|
|
23407
23410
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
23408
23411
|
className: "flex items-center justify-between py-3 first:pt-0 last:pb-0",
|
|
23409
23412
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
@@ -23420,10 +23423,12 @@ var Properties = function Properties() {
|
|
|
23420
23423
|
t = _useTranslation.t;
|
|
23421
23424
|
var _useConfigStore = useConfigStore(function (store) {
|
|
23422
23425
|
return {
|
|
23423
|
-
|
|
23426
|
+
themePropertiesSchema: store["themePropertiesSchema"],
|
|
23427
|
+
onPropertiesChange: store["onPropertiesChange"]
|
|
23424
23428
|
};
|
|
23425
23429
|
}, shallow.shallow),
|
|
23426
|
-
|
|
23430
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema,
|
|
23431
|
+
onPropertiesChange = _useConfigStore.onPropertiesChange;
|
|
23427
23432
|
var _useThemeStore = useThemeStore(function (store) {
|
|
23428
23433
|
return {
|
|
23429
23434
|
setThemeState: store["setThemeState"]
|
|
@@ -23464,6 +23469,7 @@ var Properties = function Properties() {
|
|
|
23464
23469
|
}
|
|
23465
23470
|
};
|
|
23466
23471
|
React.useEffect(function () {
|
|
23472
|
+
onPropertiesChange === null || onPropertiesChange === void 0 || onPropertiesChange(values, setFieldValue);
|
|
23467
23473
|
setTheme(values);
|
|
23468
23474
|
setThemeState({
|
|
23469
23475
|
previewingTheme: values
|
|
@@ -23479,7 +23485,7 @@ var Properties = function Properties() {
|
|
|
23479
23485
|
var key = _ref2.key,
|
|
23480
23486
|
value = _ref2.value,
|
|
23481
23487
|
kind = _ref2.kind;
|
|
23482
|
-
return isPropertyVisible(key, values,
|
|
23488
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(FontPickerBlock, {
|
|
23483
23489
|
label: buildLabel(key, kind),
|
|
23484
23490
|
options: FONT_OPTIONS,
|
|
23485
23491
|
value: neetoCist.findBy({
|
|
@@ -23498,7 +23504,7 @@ var Properties = function Properties() {
|
|
|
23498
23504
|
var key = _ref4.key,
|
|
23499
23505
|
value = _ref4.value,
|
|
23500
23506
|
kind = _ref4.kind;
|
|
23501
|
-
return isPropertyVisible(key, values,
|
|
23507
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(ColorBlock, {
|
|
23502
23508
|
color: value,
|
|
23503
23509
|
label: buildLabel(key, kind),
|
|
23504
23510
|
onChange: handleColorChange(key)
|
|
@@ -23509,7 +23515,7 @@ var Properties = function Properties() {
|
|
|
23509
23515
|
var key = _ref5.key,
|
|
23510
23516
|
value = _ref5.value,
|
|
23511
23517
|
kind = _ref5.kind;
|
|
23512
|
-
return isPropertyVisible(key, values,
|
|
23518
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(SliderBlock, {
|
|
23513
23519
|
label: buildLabel(key, kind),
|
|
23514
23520
|
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
23515
23521
|
max: HUNDRED,
|
|
@@ -23531,8 +23537,8 @@ var Properties = function Properties() {
|
|
|
23531
23537
|
}, values.properties);
|
|
23532
23538
|
var options = (_findBy = neetoCist.findBy({
|
|
23533
23539
|
key: key
|
|
23534
|
-
},
|
|
23535
|
-
return isPropertyVisible(key, values,
|
|
23540
|
+
}, themePropertiesSchema)) === null || _findBy === void 0 || (_findBy = _findBy.options) === null || _findBy === void 0 ? void 0 : _findBy.map(neetoCist.toLabelAndValue);
|
|
23541
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(SelectBlock, {
|
|
23536
23542
|
label: buildLabel(key, kind),
|
|
23537
23543
|
options: options || POSITION_OPTIONS,
|
|
23538
23544
|
placeholder: "left",
|
|
@@ -23550,7 +23556,7 @@ var Properties = function Properties() {
|
|
|
23550
23556
|
var index = neetoCist.findIndexBy({
|
|
23551
23557
|
key: key
|
|
23552
23558
|
}, values.properties);
|
|
23553
|
-
return isPropertyVisible(key, values,
|
|
23559
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsxRuntime.jsx(SwitchBlock, {
|
|
23554
23560
|
checked: value !== "false",
|
|
23555
23561
|
label: buildLabel(key, kind),
|
|
23556
23562
|
onChange: function onChange(e) {
|
|
@@ -23584,10 +23590,10 @@ var Customize = function Customize(_ref) {
|
|
|
23584
23590
|
t = _useTranslation.t;
|
|
23585
23591
|
var _useConfigStore = useConfigStore(function (store) {
|
|
23586
23592
|
return {
|
|
23587
|
-
|
|
23593
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
23588
23594
|
};
|
|
23589
23595
|
}, shallow.shallow),
|
|
23590
|
-
|
|
23596
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
23591
23597
|
var _useCreateTheme = useCreateTheme(),
|
|
23592
23598
|
createTheme = _useCreateTheme.mutate,
|
|
23593
23599
|
isCreating = _useCreateTheme.isLoading;
|
|
@@ -23597,7 +23603,7 @@ var Customize = function Customize(_ref) {
|
|
|
23597
23603
|
var isSubmitting = isCreating || isUpdating;
|
|
23598
23604
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
23599
23605
|
var resetForm = _ref2.resetForm;
|
|
23600
|
-
var imageData = buildImageData(values,
|
|
23606
|
+
var imageData = buildImageData(values, themePropertiesSchema);
|
|
23601
23607
|
var themeToSave = _objectSpread({
|
|
23602
23608
|
propertiesAttributes: values.properties,
|
|
23603
23609
|
name: values.name
|
|
@@ -23620,7 +23626,7 @@ var Customize = function Customize(_ref) {
|
|
|
23620
23626
|
};
|
|
23621
23627
|
return /*#__PURE__*/jsxRuntime.jsx(Form__default["default"], {
|
|
23622
23628
|
formikProps: {
|
|
23623
|
-
initialValues: buildInitialValues(theme,
|
|
23629
|
+
initialValues: buildInitialValues(theme, themePropertiesSchema),
|
|
23624
23630
|
validationSchema: THEME_VALIDATION_SCHEMA,
|
|
23625
23631
|
onSubmit: onSubmit
|
|
23626
23632
|
},
|
|
@@ -23632,7 +23638,7 @@ var Customize = function Customize(_ref) {
|
|
|
23632
23638
|
className: "flex flex-col gap-6 p-4",
|
|
23633
23639
|
children: [/*#__PURE__*/jsxRuntime.jsx(ThemeMeta, {}), /*#__PURE__*/jsxRuntime.jsx(Properties, {}), neetoCist.filterBy({
|
|
23634
23640
|
kind: "image"
|
|
23635
|
-
},
|
|
23641
|
+
}, themePropertiesSchema).map(function (_ref5) {
|
|
23636
23642
|
var key = _ref5.key;
|
|
23637
23643
|
return /*#__PURE__*/jsxRuntime.jsx(Images, {
|
|
23638
23644
|
attribute: key
|
|
@@ -23667,14 +23673,14 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
23667
23673
|
theme = _ref.theme;
|
|
23668
23674
|
var _useConfigStore = useConfigStore(function (store) {
|
|
23669
23675
|
return {
|
|
23670
|
-
|
|
23676
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
23671
23677
|
};
|
|
23672
23678
|
}, shallow.shallow),
|
|
23673
|
-
_useConfigStore$theme = _useConfigStore.
|
|
23674
|
-
|
|
23675
|
-
var
|
|
23676
|
-
colorObject1 =
|
|
23677
|
-
colorObject2 =
|
|
23679
|
+
_useConfigStore$theme = _useConfigStore.themePropertiesSchema,
|
|
23680
|
+
themePropertiesSchema = _useConfigStore$theme === void 0 ? [] : _useConfigStore$theme;
|
|
23681
|
+
var _themePropertiesSchem = _slicedToArray$9(themePropertiesSchema, 2),
|
|
23682
|
+
colorObject1 = _themePropertiesSchem[0],
|
|
23683
|
+
colorObject2 = _themePropertiesSchem[1];
|
|
23678
23684
|
var primaryLabel = neetoCist.humanize(colorObject1 === null || colorObject1 === void 0 ? void 0 : colorObject1.key);
|
|
23679
23685
|
var secondaryLabel = neetoCist.humanize(colorObject2 === null || colorObject2 === void 0 ? void 0 : colorObject2.key);
|
|
23680
23686
|
var primaryColor = neetoCist.findBy({
|
|
@@ -23685,11 +23691,11 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
23685
23691
|
}, theme.properties).value;
|
|
23686
23692
|
var backgroundImageUrl = (_theme$snakeToCamelCa = theme[neetoCist.snakeToCamelCase(neetoCist.findBy({
|
|
23687
23693
|
useAsCardBackground: true
|
|
23688
|
-
},
|
|
23694
|
+
}, themePropertiesSchema).key)]) === null || _theme$snakeToCamelCa === void 0 ? void 0 : _theme$snakeToCamelCa.url;
|
|
23689
23695
|
var buttonBackgroundColor = (_findBy = neetoCist.findBy({
|
|
23690
23696
|
key: (_findBy2 = neetoCist.findBy({
|
|
23691
23697
|
useAsCardButtonBackground: true
|
|
23692
|
-
},
|
|
23698
|
+
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.key
|
|
23693
23699
|
}, theme.properties)) === null || _findBy === void 0 ? void 0 : _findBy.value;
|
|
23694
23700
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
23695
23701
|
className: classNames__default["default"]("neeto-themes-theme-thumbnail neeto-ui-rounded-lg border transition-all duration-300 ease-in-out", {
|
|
@@ -23745,7 +23751,7 @@ var Card = function Card(_ref) {
|
|
|
23745
23751
|
onSetPreviewTheme = _ref.onSetPreviewTheme,
|
|
23746
23752
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
23747
23753
|
onEditTheme = _ref.onEditTheme,
|
|
23748
|
-
|
|
23754
|
+
applyTheme = _ref.applyTheme,
|
|
23749
23755
|
theme = _ref.theme,
|
|
23750
23756
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
23751
23757
|
onCloneTheme = _ref.onCloneTheme,
|
|
@@ -23768,7 +23774,7 @@ var Card = function Card(_ref) {
|
|
|
23768
23774
|
var handleApplyThemeClick = function handleApplyThemeClick() {
|
|
23769
23775
|
if (isApplyingTheme) return;
|
|
23770
23776
|
setThemeBeingApplied(theme);
|
|
23771
|
-
|
|
23777
|
+
applyTheme({
|
|
23772
23778
|
themeId: theme.id,
|
|
23773
23779
|
entityId: entityId,
|
|
23774
23780
|
entityType: entityType
|
|
@@ -23787,19 +23793,21 @@ var Card = function Card(_ref) {
|
|
|
23787
23793
|
className: "group space-y-2 pt-0.5",
|
|
23788
23794
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
23789
23795
|
id: theme.id,
|
|
23790
|
-
|
|
23791
|
-
|
|
23792
|
-
|
|
23793
|
-
|
|
23794
|
-
|
|
23795
|
-
|
|
23796
|
-
|
|
23797
|
-
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
|
|
23801
|
-
|
|
23802
|
-
|
|
23796
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
23797
|
+
onClick: function onClick() {
|
|
23798
|
+
return onSetPreviewTheme(theme);
|
|
23799
|
+
},
|
|
23800
|
+
children: Thumbnail$1 ? /*#__PURE__*/jsxRuntime.jsx(Thumbnail$1, {
|
|
23801
|
+
active: active,
|
|
23802
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
23803
|
+
isPreviewing: isPreviewing,
|
|
23804
|
+
theme: theme
|
|
23805
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Thumbnail, {
|
|
23806
|
+
active: active,
|
|
23807
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
23808
|
+
isPreviewing: isPreviewing,
|
|
23809
|
+
theme: theme
|
|
23810
|
+
})
|
|
23803
23811
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
23804
23812
|
className: "flex items-start justify-between gap-1",
|
|
23805
23813
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
@@ -23894,7 +23902,7 @@ var Themes = function Themes(_ref) {
|
|
|
23894
23902
|
setThemeBeingApplied = _useState4[1];
|
|
23895
23903
|
var _useCloneTheme = useCloneTheme(),
|
|
23896
23904
|
cloneTheme = _useCloneTheme.mutate;
|
|
23897
|
-
var
|
|
23905
|
+
var _useApplyTheme = useApplyTheme({
|
|
23898
23906
|
onSuccess: function onSuccess(_ref2) {
|
|
23899
23907
|
var theme = _ref2.theme;
|
|
23900
23908
|
setTheme(theme);
|
|
@@ -23904,8 +23912,8 @@ var Themes = function Themes(_ref) {
|
|
|
23904
23912
|
setThemeBeingApplied({});
|
|
23905
23913
|
}
|
|
23906
23914
|
}),
|
|
23907
|
-
|
|
23908
|
-
isApplyingTheme =
|
|
23915
|
+
applyTheme = _useApplyTheme.mutate,
|
|
23916
|
+
isApplyingTheme = _useApplyTheme.isLoading;
|
|
23909
23917
|
React.useEffect(function () {
|
|
23910
23918
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
23911
23919
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -23965,7 +23973,7 @@ var Themes = function Themes(_ref) {
|
|
|
23965
23973
|
className: "flex flex-col gap-4 px-4 pb-10 lg:px-5 xl:px-6",
|
|
23966
23974
|
children: filteredDefaultThemes.map(function (theme) {
|
|
23967
23975
|
return /*#__PURE__*/React.createElement(Card$1, {
|
|
23968
|
-
|
|
23976
|
+
applyTheme: applyTheme,
|
|
23969
23977
|
setThemeBeingApplied: setThemeBeingApplied,
|
|
23970
23978
|
theme: theme,
|
|
23971
23979
|
thumbnail: thumbnail,
|
|
@@ -23993,8 +24001,8 @@ var Themes = function Themes(_ref) {
|
|
|
23993
24001
|
var isActive = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id;
|
|
23994
24002
|
var isPreviewing = (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id;
|
|
23995
24003
|
return /*#__PURE__*/React.createElement(Card$1, {
|
|
24004
|
+
applyTheme: applyTheme,
|
|
23996
24005
|
isPreviewing: isPreviewing,
|
|
23997
|
-
onApplyTheme: onApplyTheme,
|
|
23998
24006
|
onEditTheme: onEditTheme,
|
|
23999
24007
|
setThemeBeingApplied: setThemeBeingApplied,
|
|
24000
24008
|
theme: theme,
|
|
@@ -24093,12 +24101,12 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
24093
24101
|
return {
|
|
24094
24102
|
entityType: store["entityType"],
|
|
24095
24103
|
entityId: store["entityId"],
|
|
24096
|
-
|
|
24104
|
+
isFetchingSchema: store["isFetchingSchema"]
|
|
24097
24105
|
};
|
|
24098
24106
|
}, shallow.shallow),
|
|
24099
24107
|
entityType = _useConfigStore.entityType,
|
|
24100
24108
|
entityId = _useConfigStore.entityId,
|
|
24101
|
-
|
|
24109
|
+
isFetchingSchema = _useConfigStore.isFetchingSchema;
|
|
24102
24110
|
var _useThemeStore = useThemeStore(function (store) {
|
|
24103
24111
|
return {
|
|
24104
24112
|
setThemeState: store["setThemeState"]
|
|
@@ -24210,7 +24218,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
24210
24218
|
themeToHighlight: themeToHighlight,
|
|
24211
24219
|
themes: themes,
|
|
24212
24220
|
thumbnail: thumbnail,
|
|
24213
|
-
isLoading: isLoading ||
|
|
24221
|
+
isLoading: isLoading || isFetchingSchema,
|
|
24214
24222
|
onDeleteTheme: handleDelete,
|
|
24215
24223
|
onEditTheme: handleEditTheme
|
|
24216
24224
|
}) : /*#__PURE__*/jsxRuntime.jsx(Customize, {
|
|
@@ -24232,11 +24240,12 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
24232
24240
|
});
|
|
24233
24241
|
};
|
|
24234
24242
|
|
|
24235
|
-
var
|
|
24243
|
+
var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
24236
24244
|
var children = _ref.children,
|
|
24237
24245
|
entityType = _ref.entityType,
|
|
24238
24246
|
entityId = _ref.entityId,
|
|
24239
|
-
thumbnail = _ref.thumbnail
|
|
24247
|
+
thumbnail = _ref.thumbnail,
|
|
24248
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
24240
24249
|
var _useThemeStore = useThemeStore(function (store) {
|
|
24241
24250
|
return {
|
|
24242
24251
|
isCurrentThemeLoading: store["isCurrentThemeLoading"]
|
|
@@ -24252,7 +24261,8 @@ var NeetoThemes = function NeetoThemes(_ref) {
|
|
|
24252
24261
|
React.useEffect(function () {
|
|
24253
24262
|
setConfigState({
|
|
24254
24263
|
entityType: entityType,
|
|
24255
|
-
entityId: entityId
|
|
24264
|
+
entityId: entityId,
|
|
24265
|
+
onPropertiesChange: onPropertiesChange
|
|
24256
24266
|
});
|
|
24257
24267
|
}, []);
|
|
24258
24268
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -24268,14 +24278,14 @@ var NeetoThemes = function NeetoThemes(_ref) {
|
|
|
24268
24278
|
})]
|
|
24269
24279
|
});
|
|
24270
24280
|
};
|
|
24271
|
-
var index = reactUtils.withTitle(
|
|
24281
|
+
var index = reactUtils.withTitle(NeetoThemesBuilder, i18next.t("neetoThemes.common.design"));
|
|
24272
24282
|
|
|
24273
24283
|
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}}
|
|
24274
24284
|
|
|
24275
24285
|
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-primary-500))!important;box-shadow:0 0 0 1px rgb(var(--neeto-ui-primary-500))!important}.neeto-themes-theme-thumbnail--preview-active{border-color:rgb(var(--neeto-ui-gray-700));box-shadow:0 0 0 1px rgb(var(--neeto-ui-gray-700))}.neeto-themes-theme-thumbnail--highlight-active{border-color:rgb(var(--neeto-ui-success-500));box-shadow:0 0 0 1px rgb(var(--neeto-ui-success-500));transition:border-color box-shadow .1s .1s}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3RoZW1lcy5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1QkFFRSxZQUFBLENBREEsVUNFRixDRENFLDZDQUdFLDJDQUFBLENBQ0EsbUNBQUEsQ0FGQSx5QkFBQSxDQURBLFdDSUosQ0RBSSwwQkFMRiw2Q0FNSSxXQ0dKLENBQ0YsQ0RGSSwwQkFSRiw2Q0FTSSxXQ0tKLENBQ0YsQ0RISSwyRUFFRSxrQkFBQSxDQURBLGdCQ01OLENERkksMkVBQ0UsMEJBQUEsQ0F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NvZGUge1xuICBkaXNwbGF5OiBub25lO1xufVxuLm5lZXRvLXRoZW1lc19fd3JhcHBlciAubmVldG8tdGhlbWVzLXByZXZpZXdfX3dyYXBwZXIge1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIGhlaWdodDogY2FsYygxMDB2aCAtIDY0cHgpO1xuICBmbGV4LWdyb3c6IDE7XG59XG5cbi5uZWV0by10aGVtZXMtdGhlbWUtdGh1bWJuYWlsLS1hY3RpdmUge1xuICBib3JkZXItY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1wcmltYXJ5LTUwMCkpICFpbXBvcnRhbnQ7XG4gIGJveC1zaGFkb3c6IDBweCAwcHggMHB4IDFweCByZ2IodmFyKC0tbmVldG8tdWktcHJpbWFyeS01MDApKSAhaW1wb3J0YW50O1xufVxuXG4ubmVldG8tdGhlbWVzLXRoZW1lLXRodW1ibmFpbC0tcHJldmlldy1hY3RpdmUge1xuICBib3JkZXItY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTcwMCkpO1xuICBib3gtc2hhZG93OiAwcHggMHB4IDBweCAxcHggcmdiKHZhcigtLW5lZXRvLXVpLWdyYXktNzAwKSk7XG59XG5cbi5uZWV0by10aGVtZXMtdGhlbWUtdGh1bWJuYWlsLS1oaWdobGlnaHQtYWN0aXZlIHtcbiAgdHJhbnNpdGlvbjogYm9yZGVyLWNvbG9yIDEwMG1zIGJveC1zaGFkb3cgMTAwbXM7XG4gIGJvcmRlci1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLXN1Y2Nlc3MtNTAwKSk7XG4gIGJveC1zaGFkb3c6IDBweCAwcHggMHB4IDFweCByZ2IodmFyKC0tbmVldG8tdWktc3VjY2Vzcy01MDApKTtcbn0iXX0= */";
|
|
24276
24286
|
n(css,{});
|
|
24277
24287
|
|
|
24278
|
-
exports.
|
|
24288
|
+
exports.NeetoThemesBuilder = index;
|
|
24279
24289
|
exports.setTheme = setTheme;
|
|
24280
24290
|
exports.useThemeUtils = useThemeUtils;
|
|
24281
24291
|
//# sourceMappingURL=index.cjs.js.map
|