@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.js
CHANGED
|
@@ -4,7 +4,7 @@ import React__default, { useEffect, forwardRef, useImperativeHandle, Fragment, u
|
|
|
4
4
|
import i18next, { t as t$6 } from 'i18next';
|
|
5
5
|
import { withImmutableActions, useMutationWithInvalidation, useDebounce, useFuncDebounce, withT, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
6
6
|
import Spinner$1 from '@bigbinary/neetoui/Spinner';
|
|
7
|
-
import { create as create$
|
|
7
|
+
import { create as create$2 } from 'zustand';
|
|
8
8
|
import { isNotPresent, snakeToCamelCase, filterBy, isPresent, isNot, findBy, noop as noop$3, keysToCamelCase, findIndexBy, toLabelAndValue, humanize, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
9
9
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
10
10
|
import { useTranslation, Trans } from 'react-i18next';
|
|
@@ -33,19 +33,19 @@ import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
|
33
33
|
import Tag from '@bigbinary/neetoui/Tag';
|
|
34
34
|
|
|
35
35
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
36
|
-
var useConfigStore = create$
|
|
36
|
+
var useConfigStore = create$2(withImmutableActions(function (set) {
|
|
37
37
|
return {
|
|
38
|
-
|
|
38
|
+
themePropertiesSchema: [],
|
|
39
39
|
entityType: "",
|
|
40
40
|
entityId: "",
|
|
41
41
|
variableNamesMap: {},
|
|
42
|
-
|
|
42
|
+
isFetchingSchema: true,
|
|
43
43
|
setConfigState: set
|
|
44
44
|
};
|
|
45
45
|
}));
|
|
46
46
|
|
|
47
47
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
48
|
-
var useThemeStore = create$
|
|
48
|
+
var useThemeStore = create$2(withImmutableActions(function (set) {
|
|
49
49
|
return {
|
|
50
50
|
currentTheme: {},
|
|
51
51
|
isCurrentThemeLoading: true,
|
|
@@ -479,22 +479,16 @@ var WHITE = "255, 255, 255";
|
|
|
479
479
|
var BLACK = "0, 0, 0";
|
|
480
480
|
|
|
481
481
|
var show$1 = function show(entityId) {
|
|
482
|
-
return axios.get("".concat(BASE_URL, "/api/v1/
|
|
483
|
-
};
|
|
484
|
-
var create$2 = function create(payload) {
|
|
485
|
-
return axios.post("".concat(BASE_URL, "/api/v1/theme/entities"), {
|
|
486
|
-
entity: payload
|
|
487
|
-
});
|
|
482
|
+
return axios.get("".concat(BASE_URL, "/api/v1/entities/").concat(entityId));
|
|
488
483
|
};
|
|
489
484
|
var entitiesApi = {
|
|
490
|
-
show: show$1
|
|
491
|
-
create: create$2
|
|
485
|
+
show: show$1
|
|
492
486
|
};
|
|
493
487
|
|
|
494
488
|
var QUERY_KEYS$1 = {
|
|
495
489
|
THEMES_LIST: "themes-list",
|
|
496
490
|
THEME_DETAILS: "theme-details",
|
|
497
|
-
|
|
491
|
+
SCHEMA_DETAILS: "schema-details"
|
|
498
492
|
};
|
|
499
493
|
|
|
500
494
|
var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
@@ -504,14 +498,37 @@ var useShowThemeEntity = function useShowThemeEntity(entityId) {
|
|
|
504
498
|
enabled: !!entityId
|
|
505
499
|
});
|
|
506
500
|
};
|
|
507
|
-
var useCreateThemeEntity = function useCreateThemeEntity(_ref) {
|
|
508
|
-
var onSuccess = _ref.onSuccess;
|
|
509
|
-
return useMutationWithInvalidation(entitiesApi.create, {
|
|
510
|
-
keysToInvalidate: [QUERY_KEYS$1.THEMES_LIST, QUERY_KEYS$1.THEME_ENTITY_DETAILS],
|
|
511
|
-
onSuccess: onSuccess
|
|
512
|
-
});
|
|
513
|
-
};
|
|
514
501
|
|
|
502
|
+
function _objectWithoutPropertiesLoose$6(source, excluded) {
|
|
503
|
+
if (source == null) return {};
|
|
504
|
+
var target = {};
|
|
505
|
+
var sourceKeys = Object.keys(source);
|
|
506
|
+
var key, i;
|
|
507
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
508
|
+
key = sourceKeys[i];
|
|
509
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
510
|
+
target[key] = source[key];
|
|
511
|
+
}
|
|
512
|
+
return target;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function _objectWithoutProperties$6(source, excluded) {
|
|
516
|
+
if (source == null) return {};
|
|
517
|
+
var target = _objectWithoutPropertiesLoose$6(source, excluded);
|
|
518
|
+
var key, i;
|
|
519
|
+
if (Object.getOwnPropertySymbols) {
|
|
520
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
521
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
522
|
+
key = sourceSymbolKeys[i];
|
|
523
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
524
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
525
|
+
target[key] = source[key];
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return target;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
var _excluded$9 = ["themeId"];
|
|
515
532
|
var list$1 = function list() {
|
|
516
533
|
return axios.get("".concat(BASE_URL, "/api/v1/themes"));
|
|
517
534
|
};
|
|
@@ -536,13 +553,21 @@ var destroy = function destroy(id) {
|
|
|
536
553
|
var clone = function clone(id) {
|
|
537
554
|
return axios.post("".concat(BASE_URL, "/api/v1/themes/").concat(id, "/clone"));
|
|
538
555
|
};
|
|
556
|
+
var apply = function apply(_ref2) {
|
|
557
|
+
var themeId = _ref2.themeId,
|
|
558
|
+
payload = _objectWithoutProperties$6(_ref2, _excluded$9);
|
|
559
|
+
return axios.post("".concat(BASE_URL, "/api/v1/themes/").concat(themeId, "/apply"), {
|
|
560
|
+
entity: payload
|
|
561
|
+
});
|
|
562
|
+
};
|
|
539
563
|
var themesApi = {
|
|
540
564
|
list: list$1,
|
|
541
565
|
show: show,
|
|
542
566
|
create: create$1,
|
|
543
567
|
update: update$1,
|
|
544
568
|
destroy: destroy,
|
|
545
|
-
clone: clone
|
|
569
|
+
clone: clone,
|
|
570
|
+
apply: apply
|
|
546
571
|
};
|
|
547
572
|
|
|
548
573
|
var useListThemes = function useListThemes() {
|
|
@@ -573,6 +598,13 @@ var useCloneTheme = function useCloneTheme() {
|
|
|
573
598
|
keysToInvalidate: [QUERY_KEYS$1.THEMES_LIST]
|
|
574
599
|
});
|
|
575
600
|
};
|
|
601
|
+
var useApplyTheme = function useApplyTheme(_ref) {
|
|
602
|
+
var onSuccess = _ref.onSuccess;
|
|
603
|
+
return useMutationWithInvalidation(themesApi.apply, {
|
|
604
|
+
keysToInvalidate: [QUERY_KEYS$1.THEMES_LIST, QUERY_KEYS$1.THEME_ENTITY_DETAILS],
|
|
605
|
+
onSuccess: onSuccess
|
|
606
|
+
});
|
|
607
|
+
};
|
|
576
608
|
|
|
577
609
|
var root = document.querySelector(":root");
|
|
578
610
|
var setVariable = function setVariable(name, value, variableNamesMap) {
|
|
@@ -605,15 +637,15 @@ var setTheme = function setTheme(theme, variableNamesMap, themeConfig) {
|
|
|
605
637
|
};
|
|
606
638
|
|
|
607
639
|
var list = function list() {
|
|
608
|
-
return axios.get("".concat(BASE_URL, "/api/v1/
|
|
640
|
+
return axios.get("".concat(BASE_URL, "/api/v1/schema"));
|
|
609
641
|
};
|
|
610
|
-
var
|
|
642
|
+
var schemasApi = {
|
|
611
643
|
list: list
|
|
612
644
|
};
|
|
613
645
|
|
|
614
|
-
var
|
|
646
|
+
var useListSchema = function useListSchema(_ref) {
|
|
615
647
|
var onSuccess = _ref.onSuccess;
|
|
616
|
-
return useQuery(QUERY_KEYS$1.
|
|
648
|
+
return useQuery(QUERY_KEYS$1.SCHEMA_DETAILS, schemasApi.list, {
|
|
617
649
|
onSuccess: onSuccess
|
|
618
650
|
});
|
|
619
651
|
};
|
|
@@ -628,42 +660,42 @@ var useThemeUtils = function useThemeUtils() {
|
|
|
628
660
|
}, shallow),
|
|
629
661
|
previewingTheme = _useThemeStore.previewingTheme,
|
|
630
662
|
currentTheme = _useThemeStore.currentTheme;
|
|
631
|
-
var
|
|
663
|
+
var _useListSchema = useListSchema({
|
|
632
664
|
onSuccess: function onSuccess(_ref) {
|
|
633
|
-
var _ref$
|
|
634
|
-
|
|
665
|
+
var _ref$schema = _ref.schema,
|
|
666
|
+
themePropertiesSchema = _ref$schema === void 0 ? [] : _ref$schema,
|
|
635
667
|
_ref$variableNamesMap = _ref.variableNamesMap,
|
|
636
668
|
variableNamesMap = _ref$variableNamesMap === void 0 ? {} : _ref$variableNamesMap;
|
|
637
669
|
return setConfigState({
|
|
638
|
-
|
|
670
|
+
themePropertiesSchema: themePropertiesSchema,
|
|
639
671
|
variableNamesMap: variableNamesMap
|
|
640
672
|
});
|
|
641
673
|
}
|
|
642
674
|
}),
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
variableNamesMap =
|
|
675
|
+
isFetchingSchema = _useListSchema.isLoading,
|
|
676
|
+
_useListSchema$data = _useListSchema.data,
|
|
677
|
+
_useListSchema$data2 = _useListSchema$data === void 0 ? {} : _useListSchema$data,
|
|
678
|
+
_useListSchema$data2$ = _useListSchema$data2.schema,
|
|
679
|
+
themePropertiesSchema = _useListSchema$data2$ === void 0 ? [] : _useListSchema$data2$,
|
|
680
|
+
_useListSchema$data2$2 = _useListSchema$data2.variableNamesMap,
|
|
681
|
+
variableNamesMap = _useListSchema$data2$2 === void 0 ? {} : _useListSchema$data2$2;
|
|
650
682
|
useEffect(function () {
|
|
651
683
|
return setConfigState({
|
|
652
|
-
|
|
684
|
+
isFetchingSchema: isFetchingSchema
|
|
653
685
|
});
|
|
654
|
-
}, [
|
|
686
|
+
}, [isFetchingSchema]);
|
|
655
687
|
var setVariable$1 = function setVariable$1(name, value) {
|
|
656
688
|
return setVariable(name, value, variableNamesMap);
|
|
657
689
|
};
|
|
658
690
|
var setTheme$1 = function setTheme$1(theme) {
|
|
659
|
-
return setTheme(theme, variableNamesMap,
|
|
691
|
+
return setTheme(theme, variableNamesMap, themePropertiesSchema);
|
|
660
692
|
};
|
|
661
693
|
return {
|
|
662
694
|
setTheme: setTheme$1,
|
|
663
695
|
setVariable: setVariable$1,
|
|
664
696
|
previewingTheme: previewingTheme,
|
|
665
697
|
currentTheme: currentTheme,
|
|
666
|
-
|
|
698
|
+
isFetchingSchema: isFetchingSchema
|
|
667
699
|
};
|
|
668
700
|
};
|
|
669
701
|
|
|
@@ -784,11 +816,11 @@ var OVERLAY_OPACITY_SLIDER_MARKS = {
|
|
|
784
816
|
};
|
|
785
817
|
var HUNDRED = 100;
|
|
786
818
|
|
|
787
|
-
var buildInitialValues = function buildInitialValues(theme,
|
|
819
|
+
var buildInitialValues = function buildInitialValues(theme, themePropertiesSchema) {
|
|
788
820
|
if (isPresent(theme)) return theme;
|
|
789
821
|
return {
|
|
790
822
|
name: t$6("neetoThemes.build.leftSideBar.themes.createTheme.newThemeName"),
|
|
791
|
-
properties:
|
|
823
|
+
properties: themePropertiesSchema.map(function (_ref) {
|
|
792
824
|
var key = _ref.key,
|
|
793
825
|
kind = _ref.kind,
|
|
794
826
|
defaultValue = _ref.defaultValue;
|
|
@@ -835,27 +867,27 @@ var buildInitialValues = function buildInitialValues(theme, themeConfig) {
|
|
|
835
867
|
}).filter(isNot(null))
|
|
836
868
|
};
|
|
837
869
|
};
|
|
838
|
-
var buildImageData = function buildImageData(values,
|
|
870
|
+
var buildImageData = function buildImageData(values, themePropertiesSchema) {
|
|
839
871
|
return filterBy({
|
|
840
872
|
kind: "image"
|
|
841
|
-
},
|
|
873
|
+
}, themePropertiesSchema).reduce(function (acc, item) {
|
|
842
874
|
var _values$snakeToCamelC;
|
|
843
875
|
var signedId = (_values$snakeToCamelC = values[snakeToCamelCase(item.key)]) === null || _values$snakeToCamelC === void 0 ? void 0 : _values$snakeToCamelC.signedId;
|
|
844
876
|
acc[item.key] = signedId;
|
|
845
877
|
return acc;
|
|
846
878
|
}, {});
|
|
847
879
|
};
|
|
848
|
-
var isPropertyVisible = function isPropertyVisible(key, formikValues,
|
|
880
|
+
var isPropertyVisible = function isPropertyVisible(key, formikValues, themePropertiesSchema) {
|
|
849
881
|
var _findBy;
|
|
850
882
|
var property = findBy({
|
|
851
883
|
key: key
|
|
852
|
-
},
|
|
884
|
+
}, themePropertiesSchema);
|
|
853
885
|
if (isNotPresent(property)) return false;
|
|
854
886
|
var conditionalKey = property === null || property === void 0 ? void 0 : property.dependsOn;
|
|
855
887
|
if (isNotPresent(conditionalKey)) return true;
|
|
856
888
|
var dependentProperty = findBy({
|
|
857
889
|
key: conditionalKey
|
|
858
|
-
},
|
|
890
|
+
}, themePropertiesSchema);
|
|
859
891
|
if (dependentProperty.kind === "image") {
|
|
860
892
|
var _formikValues$snakeTo;
|
|
861
893
|
return isPresent((_formikValues$snakeTo = formikValues[snakeToCamelCase(conditionalKey)]) === null || _formikValues$snakeTo === void 0 ? void 0 : _formikValues$snakeTo.url);
|
|
@@ -2790,9 +2822,9 @@ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
2790
2822
|
|
|
2791
2823
|
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; }
|
|
2792
2824
|
|
|
2793
|
-
function _objectWithoutProperties$1$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$
|
|
2825
|
+
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; }
|
|
2794
2826
|
|
|
2795
|
-
function _objectWithoutPropertiesLoose$
|
|
2827
|
+
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; }
|
|
2796
2828
|
/**
|
|
2797
2829
|
* Convenience wrapper component for the `useDropzone` hook
|
|
2798
2830
|
*
|
|
@@ -6183,7 +6215,7 @@ var _reactInfiniteScroller2 = _interopRequireDefault(_reactInfiniteScroller);
|
|
|
6183
6215
|
|
|
6184
6216
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
6185
6217
|
|
|
6186
|
-
function _objectWithoutProperties$
|
|
6218
|
+
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; }
|
|
6187
6219
|
|
|
6188
6220
|
function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6189
6221
|
|
|
@@ -6287,7 +6319,7 @@ var MasonryInfiniteScroller = (_temp2 = _class = function (_Component) {
|
|
|
6287
6319
|
_props.packed;
|
|
6288
6320
|
_props.position;
|
|
6289
6321
|
_props.sizes;
|
|
6290
|
-
var props = _objectWithoutProperties$
|
|
6322
|
+
var props = _objectWithoutProperties$5(_props, ['children', 'className', 'style', 'pack', 'packed', 'position', 'sizes']);
|
|
6291
6323
|
|
|
6292
6324
|
return _react2.default.createElement(
|
|
6293
6325
|
_reactInfiniteScroller2.default,
|
|
@@ -13866,7 +13898,7 @@ function supportRef$3(nodeOrComponent) {
|
|
|
13866
13898
|
}
|
|
13867
13899
|
/* eslint-enable */
|
|
13868
13900
|
|
|
13869
|
-
function _objectWithoutPropertiesLoose$
|
|
13901
|
+
function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
13870
13902
|
if (source == null) return {};
|
|
13871
13903
|
var target = {};
|
|
13872
13904
|
var sourceKeys = Object.keys(source);
|
|
@@ -13879,9 +13911,9 @@ function _objectWithoutPropertiesLoose$5(source, excluded) {
|
|
|
13879
13911
|
return target;
|
|
13880
13912
|
}
|
|
13881
13913
|
|
|
13882
|
-
function _objectWithoutProperties$
|
|
13914
|
+
function _objectWithoutProperties$4(source, excluded) {
|
|
13883
13915
|
if (source == null) return {};
|
|
13884
|
-
var target = _objectWithoutPropertiesLoose$
|
|
13916
|
+
var target = _objectWithoutPropertiesLoose$4(source, excluded);
|
|
13885
13917
|
var key, i;
|
|
13886
13918
|
if (Object.getOwnPropertySymbols) {
|
|
13887
13919
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -13899,7 +13931,7 @@ var _excluded$7 = ["children"];
|
|
|
13899
13931
|
var Context$1 = /*#__PURE__*/React.createContext({});
|
|
13900
13932
|
function MotionProvider(_ref) {
|
|
13901
13933
|
var children = _ref.children,
|
|
13902
|
-
props = _objectWithoutProperties$
|
|
13934
|
+
props = _objectWithoutProperties$4(_ref, _excluded$7);
|
|
13903
13935
|
return /*#__PURE__*/React.createElement(Context$1.Provider, {
|
|
13904
13936
|
value: props
|
|
13905
13937
|
}, children);
|
|
@@ -14712,7 +14744,7 @@ function genCSSMotionList$1(transitionSupport) {
|
|
|
14712
14744
|
children = _this$props.children,
|
|
14713
14745
|
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
14714
14746
|
onAllRemoved = _this$props.onAllRemoved,
|
|
14715
|
-
restProps = _objectWithoutProperties$
|
|
14747
|
+
restProps = _objectWithoutProperties$4(_this$props, _excluded$6);
|
|
14716
14748
|
var Component = component || React.Fragment;
|
|
14717
14749
|
var motionProps = {};
|
|
14718
14750
|
MOTION_PROP_NAMES$1.forEach(function (prop) {
|
|
@@ -14722,7 +14754,7 @@ function genCSSMotionList$1(transitionSupport) {
|
|
|
14722
14754
|
delete restProps.keys;
|
|
14723
14755
|
return /*#__PURE__*/React.createElement(Component, restProps, keyEntities.map(function (_ref2, index) {
|
|
14724
14756
|
var status = _ref2.status,
|
|
14725
|
-
eventProps = _objectWithoutProperties$
|
|
14757
|
+
eventProps = _objectWithoutProperties$4(_ref2, _excluded2$1);
|
|
14726
14758
|
var visible = status === STATUS_ADD$1 || status === STATUS_KEEP$1;
|
|
14727
14759
|
return /*#__PURE__*/React.createElement(CSSMotion, _extends$6({}, motionProps, {
|
|
14728
14760
|
key: eventProps.key,
|
|
@@ -16510,7 +16542,7 @@ function supportRef$1(nodeOrComponent) {
|
|
|
16510
16542
|
}
|
|
16511
16543
|
/* eslint-enable */
|
|
16512
16544
|
|
|
16513
|
-
function _objectWithoutPropertiesLoose$
|
|
16545
|
+
function _objectWithoutPropertiesLoose$3(source, excluded) {
|
|
16514
16546
|
if (source == null) return {};
|
|
16515
16547
|
var target = {};
|
|
16516
16548
|
var sourceKeys = Object.keys(source);
|
|
@@ -16523,9 +16555,9 @@ function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
|
16523
16555
|
return target;
|
|
16524
16556
|
}
|
|
16525
16557
|
|
|
16526
|
-
function _objectWithoutProperties$
|
|
16558
|
+
function _objectWithoutProperties$3(source, excluded) {
|
|
16527
16559
|
if (source == null) return {};
|
|
16528
|
-
var target = _objectWithoutPropertiesLoose$
|
|
16560
|
+
var target = _objectWithoutPropertiesLoose$3(source, excluded);
|
|
16529
16561
|
var key, i;
|
|
16530
16562
|
if (Object.getOwnPropertySymbols) {
|
|
16531
16563
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -17461,7 +17493,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
17461
17493
|
children = _this$props.children,
|
|
17462
17494
|
_onVisibleChanged = _this$props.onVisibleChanged,
|
|
17463
17495
|
onAllRemoved = _this$props.onAllRemoved,
|
|
17464
|
-
restProps = _objectWithoutProperties$
|
|
17496
|
+
restProps = _objectWithoutProperties$3(_this$props, _excluded$5);
|
|
17465
17497
|
var Component = component || React.Fragment;
|
|
17466
17498
|
var motionProps = {};
|
|
17467
17499
|
MOTION_PROP_NAMES.forEach(function (prop) {
|
|
@@ -17471,7 +17503,7 @@ function genCSSMotionList(transitionSupport) {
|
|
|
17471
17503
|
delete restProps.keys;
|
|
17472
17504
|
return /*#__PURE__*/React.createElement(Component, restProps, keyEntities.map(function (_ref2) {
|
|
17473
17505
|
var status = _ref2.status,
|
|
17474
|
-
eventProps = _objectWithoutProperties$
|
|
17506
|
+
eventProps = _objectWithoutProperties$3(_ref2, _excluded2);
|
|
17475
17507
|
var visible = status === STATUS_ADD || status === STATUS_KEEP;
|
|
17476
17508
|
return /*#__PURE__*/React.createElement(CSSMotion$1, _extends$4({}, motionProps, {
|
|
17477
17509
|
key: eventProps.key,
|
|
@@ -17995,7 +18027,7 @@ function _slicedToArray$2(arr, i) {
|
|
|
17995
18027
|
return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$2();
|
|
17996
18028
|
}
|
|
17997
18029
|
|
|
17998
|
-
function _objectWithoutPropertiesLoose$
|
|
18030
|
+
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
17999
18031
|
if (source == null) return {};
|
|
18000
18032
|
var target = {};
|
|
18001
18033
|
var sourceKeys = Object.keys(source);
|
|
@@ -18008,9 +18040,9 @@ function _objectWithoutPropertiesLoose$3(source, excluded) {
|
|
|
18008
18040
|
return target;
|
|
18009
18041
|
}
|
|
18010
18042
|
|
|
18011
|
-
function _objectWithoutProperties$
|
|
18043
|
+
function _objectWithoutProperties$2(source, excluded) {
|
|
18012
18044
|
if (source == null) return {};
|
|
18013
|
-
var target = _objectWithoutPropertiesLoose$
|
|
18045
|
+
var target = _objectWithoutPropertiesLoose$2(source, excluded);
|
|
18014
18046
|
var key, i;
|
|
18015
18047
|
if (Object.getOwnPropertySymbols) {
|
|
18016
18048
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -19984,7 +20016,7 @@ function generateTrigger() {
|
|
|
19984
20016
|
maskAnimation = props.maskAnimation,
|
|
19985
20017
|
className = props.className,
|
|
19986
20018
|
getTriggerDOMNode = props.getTriggerDOMNode,
|
|
19987
|
-
restProps = _objectWithoutProperties$
|
|
20019
|
+
restProps = _objectWithoutProperties$2(props, _excluded$4);
|
|
19988
20020
|
var mergedAutoDestroy = autoDestroy || destroyPopupOnHide || false;
|
|
19989
20021
|
|
|
19990
20022
|
// =========================== Mobile ===========================
|
|
@@ -20531,7 +20563,7 @@ function _objectSpread2$1(target) {
|
|
|
20531
20563
|
return target;
|
|
20532
20564
|
}
|
|
20533
20565
|
|
|
20534
|
-
function _objectWithoutPropertiesLoose$
|
|
20566
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
20535
20567
|
if (source == null) return {};
|
|
20536
20568
|
var target = {};
|
|
20537
20569
|
var sourceKeys = Object.keys(source);
|
|
@@ -20544,9 +20576,9 @@ function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
|
20544
20576
|
return target;
|
|
20545
20577
|
}
|
|
20546
20578
|
|
|
20547
|
-
function _objectWithoutProperties$
|
|
20579
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
20548
20580
|
if (source == null) return {};
|
|
20549
|
-
var target = _objectWithoutPropertiesLoose$
|
|
20581
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
20550
20582
|
var key, i;
|
|
20551
20583
|
if (Object.getOwnPropertySymbols) {
|
|
20552
20584
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -20676,7 +20708,7 @@ var Tooltip$2 = function Tooltip(props, ref) {
|
|
|
20676
20708
|
id = props.id,
|
|
20677
20709
|
_props$showArrow = props.showArrow,
|
|
20678
20710
|
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
|
20679
|
-
restProps = _objectWithoutProperties$
|
|
20711
|
+
restProps = _objectWithoutProperties$1(props, _excluded$3);
|
|
20680
20712
|
var triggerRef = useRef(null);
|
|
20681
20713
|
useImperativeHandle(ref, function () {
|
|
20682
20714
|
return triggerRef.current;
|
|
@@ -21600,7 +21632,7 @@ function _extends() {
|
|
|
21600
21632
|
return _extends.apply(this, arguments);
|
|
21601
21633
|
}
|
|
21602
21634
|
|
|
21603
|
-
function _objectWithoutPropertiesLoose
|
|
21635
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
21604
21636
|
if (source == null) return {};
|
|
21605
21637
|
var target = {};
|
|
21606
21638
|
var sourceKeys = Object.keys(source);
|
|
@@ -21613,9 +21645,9 @@ function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
|
21613
21645
|
return target;
|
|
21614
21646
|
}
|
|
21615
21647
|
|
|
21616
|
-
function _objectWithoutProperties
|
|
21648
|
+
function _objectWithoutProperties(source, excluded) {
|
|
21617
21649
|
if (source == null) return {};
|
|
21618
|
-
var target = _objectWithoutPropertiesLoose
|
|
21650
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
21619
21651
|
var key, i;
|
|
21620
21652
|
if (Object.getOwnPropertySymbols) {
|
|
21621
21653
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -21672,7 +21704,7 @@ var Handle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
21672
21704
|
render = props.render,
|
|
21673
21705
|
dragging = props.dragging,
|
|
21674
21706
|
onOffsetChange = props.onOffsetChange,
|
|
21675
|
-
restProps = _objectWithoutProperties
|
|
21707
|
+
restProps = _objectWithoutProperties(props, _excluded$2);
|
|
21676
21708
|
var _React$useContext = React.useContext(SliderContext),
|
|
21677
21709
|
min = _React$useContext.min,
|
|
21678
21710
|
max = _React$useContext.max,
|
|
@@ -21782,7 +21814,7 @@ var Handles = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
21782
21814
|
values = props.values,
|
|
21783
21815
|
handleRender = props.handleRender,
|
|
21784
21816
|
draggingIndex = props.draggingIndex,
|
|
21785
|
-
restProps = _objectWithoutProperties
|
|
21817
|
+
restProps = _objectWithoutProperties(props, _excluded$1);
|
|
21786
21818
|
var handlesRef = React.useRef({});
|
|
21787
21819
|
React.useImperativeHandle(ref, function () {
|
|
21788
21820
|
return {
|
|
@@ -23325,42 +23357,13 @@ var SliderBlock = function SliderBlock(_ref) {
|
|
|
23325
23357
|
});
|
|
23326
23358
|
};
|
|
23327
23359
|
|
|
23328
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
23329
|
-
if (source == null) return {};
|
|
23330
|
-
var target = {};
|
|
23331
|
-
var sourceKeys = Object.keys(source);
|
|
23332
|
-
var key, i;
|
|
23333
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
23334
|
-
key = sourceKeys[i];
|
|
23335
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
23336
|
-
target[key] = source[key];
|
|
23337
|
-
}
|
|
23338
|
-
return target;
|
|
23339
|
-
}
|
|
23340
|
-
|
|
23341
|
-
function _objectWithoutProperties(source, excluded) {
|
|
23342
|
-
if (source == null) return {};
|
|
23343
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
23344
|
-
var key, i;
|
|
23345
|
-
if (Object.getOwnPropertySymbols) {
|
|
23346
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
23347
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
23348
|
-
key = sourceSymbolKeys[i];
|
|
23349
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
23350
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
23351
|
-
target[key] = source[key];
|
|
23352
|
-
}
|
|
23353
|
-
}
|
|
23354
|
-
return target;
|
|
23355
|
-
}
|
|
23356
|
-
|
|
23357
23360
|
var _excluded = ["label", "name"];
|
|
23358
23361
|
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; }
|
|
23359
23362
|
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; }
|
|
23360
23363
|
var SwitchBlock = function SwitchBlock(_ref) {
|
|
23361
23364
|
var label = _ref.label,
|
|
23362
23365
|
name = _ref.name,
|
|
23363
|
-
switchProps = _objectWithoutProperties(_ref, _excluded);
|
|
23366
|
+
switchProps = _objectWithoutProperties$6(_ref, _excluded);
|
|
23364
23367
|
return /*#__PURE__*/jsxs("div", {
|
|
23365
23368
|
className: "flex items-center justify-between py-3 first:pt-0 last:pb-0",
|
|
23366
23369
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
@@ -23377,10 +23380,12 @@ var Properties = function Properties() {
|
|
|
23377
23380
|
t = _useTranslation.t;
|
|
23378
23381
|
var _useConfigStore = useConfigStore(function (store) {
|
|
23379
23382
|
return {
|
|
23380
|
-
|
|
23383
|
+
themePropertiesSchema: store["themePropertiesSchema"],
|
|
23384
|
+
onPropertiesChange: store["onPropertiesChange"]
|
|
23381
23385
|
};
|
|
23382
23386
|
}, shallow),
|
|
23383
|
-
|
|
23387
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema,
|
|
23388
|
+
onPropertiesChange = _useConfigStore.onPropertiesChange;
|
|
23384
23389
|
var _useThemeStore = useThemeStore(function (store) {
|
|
23385
23390
|
return {
|
|
23386
23391
|
setThemeState: store["setThemeState"]
|
|
@@ -23421,6 +23426,7 @@ var Properties = function Properties() {
|
|
|
23421
23426
|
}
|
|
23422
23427
|
};
|
|
23423
23428
|
useEffect(function () {
|
|
23429
|
+
onPropertiesChange === null || onPropertiesChange === void 0 || onPropertiesChange(values, setFieldValue);
|
|
23424
23430
|
setTheme(values);
|
|
23425
23431
|
setThemeState({
|
|
23426
23432
|
previewingTheme: values
|
|
@@ -23436,7 +23442,7 @@ var Properties = function Properties() {
|
|
|
23436
23442
|
var key = _ref2.key,
|
|
23437
23443
|
value = _ref2.value,
|
|
23438
23444
|
kind = _ref2.kind;
|
|
23439
|
-
return isPropertyVisible(key, values,
|
|
23445
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(FontPickerBlock, {
|
|
23440
23446
|
label: buildLabel(key, kind),
|
|
23441
23447
|
options: FONT_OPTIONS,
|
|
23442
23448
|
value: findBy({
|
|
@@ -23455,7 +23461,7 @@ var Properties = function Properties() {
|
|
|
23455
23461
|
var key = _ref4.key,
|
|
23456
23462
|
value = _ref4.value,
|
|
23457
23463
|
kind = _ref4.kind;
|
|
23458
|
-
return isPropertyVisible(key, values,
|
|
23464
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(ColorBlock, {
|
|
23459
23465
|
color: value,
|
|
23460
23466
|
label: buildLabel(key, kind),
|
|
23461
23467
|
onChange: handleColorChange(key)
|
|
@@ -23466,7 +23472,7 @@ var Properties = function Properties() {
|
|
|
23466
23472
|
var key = _ref5.key,
|
|
23467
23473
|
value = _ref5.value,
|
|
23468
23474
|
kind = _ref5.kind;
|
|
23469
|
-
return isPropertyVisible(key, values,
|
|
23475
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(SliderBlock, {
|
|
23470
23476
|
label: buildLabel(key, kind),
|
|
23471
23477
|
marks: OVERLAY_OPACITY_SLIDER_MARKS,
|
|
23472
23478
|
max: HUNDRED,
|
|
@@ -23488,8 +23494,8 @@ var Properties = function Properties() {
|
|
|
23488
23494
|
}, values.properties);
|
|
23489
23495
|
var options = (_findBy = findBy({
|
|
23490
23496
|
key: key
|
|
23491
|
-
},
|
|
23492
|
-
return isPropertyVisible(key, values,
|
|
23497
|
+
}, themePropertiesSchema)) === null || _findBy === void 0 || (_findBy = _findBy.options) === null || _findBy === void 0 ? void 0 : _findBy.map(toLabelAndValue);
|
|
23498
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(SelectBlock, {
|
|
23493
23499
|
label: buildLabel(key, kind),
|
|
23494
23500
|
options: options || POSITION_OPTIONS,
|
|
23495
23501
|
placeholder: "left",
|
|
@@ -23507,7 +23513,7 @@ var Properties = function Properties() {
|
|
|
23507
23513
|
var index = findIndexBy({
|
|
23508
23514
|
key: key
|
|
23509
23515
|
}, values.properties);
|
|
23510
|
-
return isPropertyVisible(key, values,
|
|
23516
|
+
return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(SwitchBlock, {
|
|
23511
23517
|
checked: value !== "false",
|
|
23512
23518
|
label: buildLabel(key, kind),
|
|
23513
23519
|
onChange: function onChange(e) {
|
|
@@ -23541,10 +23547,10 @@ var Customize = function Customize(_ref) {
|
|
|
23541
23547
|
t = _useTranslation.t;
|
|
23542
23548
|
var _useConfigStore = useConfigStore(function (store) {
|
|
23543
23549
|
return {
|
|
23544
|
-
|
|
23550
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
23545
23551
|
};
|
|
23546
23552
|
}, shallow),
|
|
23547
|
-
|
|
23553
|
+
themePropertiesSchema = _useConfigStore.themePropertiesSchema;
|
|
23548
23554
|
var _useCreateTheme = useCreateTheme(),
|
|
23549
23555
|
createTheme = _useCreateTheme.mutate,
|
|
23550
23556
|
isCreating = _useCreateTheme.isLoading;
|
|
@@ -23554,7 +23560,7 @@ var Customize = function Customize(_ref) {
|
|
|
23554
23560
|
var isSubmitting = isCreating || isUpdating;
|
|
23555
23561
|
var onSubmit = function onSubmit(values, _ref2) {
|
|
23556
23562
|
var resetForm = _ref2.resetForm;
|
|
23557
|
-
var imageData = buildImageData(values,
|
|
23563
|
+
var imageData = buildImageData(values, themePropertiesSchema);
|
|
23558
23564
|
var themeToSave = _objectSpread({
|
|
23559
23565
|
propertiesAttributes: values.properties,
|
|
23560
23566
|
name: values.name
|
|
@@ -23577,7 +23583,7 @@ var Customize = function Customize(_ref) {
|
|
|
23577
23583
|
};
|
|
23578
23584
|
return /*#__PURE__*/jsx(Form, {
|
|
23579
23585
|
formikProps: {
|
|
23580
|
-
initialValues: buildInitialValues(theme,
|
|
23586
|
+
initialValues: buildInitialValues(theme, themePropertiesSchema),
|
|
23581
23587
|
validationSchema: THEME_VALIDATION_SCHEMA,
|
|
23582
23588
|
onSubmit: onSubmit
|
|
23583
23589
|
},
|
|
@@ -23589,7 +23595,7 @@ var Customize = function Customize(_ref) {
|
|
|
23589
23595
|
className: "flex flex-col gap-6 p-4",
|
|
23590
23596
|
children: [/*#__PURE__*/jsx(ThemeMeta, {}), /*#__PURE__*/jsx(Properties, {}), filterBy({
|
|
23591
23597
|
kind: "image"
|
|
23592
|
-
},
|
|
23598
|
+
}, themePropertiesSchema).map(function (_ref5) {
|
|
23593
23599
|
var key = _ref5.key;
|
|
23594
23600
|
return /*#__PURE__*/jsx(Images, {
|
|
23595
23601
|
attribute: key
|
|
@@ -23624,14 +23630,14 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
23624
23630
|
theme = _ref.theme;
|
|
23625
23631
|
var _useConfigStore = useConfigStore(function (store) {
|
|
23626
23632
|
return {
|
|
23627
|
-
|
|
23633
|
+
themePropertiesSchema: store["themePropertiesSchema"]
|
|
23628
23634
|
};
|
|
23629
23635
|
}, shallow),
|
|
23630
|
-
_useConfigStore$theme = _useConfigStore.
|
|
23631
|
-
|
|
23632
|
-
var
|
|
23633
|
-
colorObject1 =
|
|
23634
|
-
colorObject2 =
|
|
23636
|
+
_useConfigStore$theme = _useConfigStore.themePropertiesSchema,
|
|
23637
|
+
themePropertiesSchema = _useConfigStore$theme === void 0 ? [] : _useConfigStore$theme;
|
|
23638
|
+
var _themePropertiesSchem = _slicedToArray$9(themePropertiesSchema, 2),
|
|
23639
|
+
colorObject1 = _themePropertiesSchem[0],
|
|
23640
|
+
colorObject2 = _themePropertiesSchem[1];
|
|
23635
23641
|
var primaryLabel = humanize(colorObject1 === null || colorObject1 === void 0 ? void 0 : colorObject1.key);
|
|
23636
23642
|
var secondaryLabel = humanize(colorObject2 === null || colorObject2 === void 0 ? void 0 : colorObject2.key);
|
|
23637
23643
|
var primaryColor = findBy({
|
|
@@ -23642,11 +23648,11 @@ var Thumbnail = function Thumbnail(_ref) {
|
|
|
23642
23648
|
}, theme.properties).value;
|
|
23643
23649
|
var backgroundImageUrl = (_theme$snakeToCamelCa = theme[snakeToCamelCase(findBy({
|
|
23644
23650
|
useAsCardBackground: true
|
|
23645
|
-
},
|
|
23651
|
+
}, themePropertiesSchema).key)]) === null || _theme$snakeToCamelCa === void 0 ? void 0 : _theme$snakeToCamelCa.url;
|
|
23646
23652
|
var buttonBackgroundColor = (_findBy = findBy({
|
|
23647
23653
|
key: (_findBy2 = findBy({
|
|
23648
23654
|
useAsCardButtonBackground: true
|
|
23649
|
-
},
|
|
23655
|
+
}, themePropertiesSchema)) === null || _findBy2 === void 0 ? void 0 : _findBy2.key
|
|
23650
23656
|
}, theme.properties)) === null || _findBy === void 0 ? void 0 : _findBy.value;
|
|
23651
23657
|
return /*#__PURE__*/jsx("div", {
|
|
23652
23658
|
className: classNames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg border transition-all duration-300 ease-in-out", {
|
|
@@ -23702,7 +23708,7 @@ var Card = function Card(_ref) {
|
|
|
23702
23708
|
onSetPreviewTheme = _ref.onSetPreviewTheme,
|
|
23703
23709
|
onDeleteTheme = _ref.onDeleteTheme,
|
|
23704
23710
|
onEditTheme = _ref.onEditTheme,
|
|
23705
|
-
|
|
23711
|
+
applyTheme = _ref.applyTheme,
|
|
23706
23712
|
theme = _ref.theme,
|
|
23707
23713
|
isApplyingTheme = _ref.isApplyingTheme,
|
|
23708
23714
|
onCloneTheme = _ref.onCloneTheme,
|
|
@@ -23725,7 +23731,7 @@ var Card = function Card(_ref) {
|
|
|
23725
23731
|
var handleApplyThemeClick = function handleApplyThemeClick() {
|
|
23726
23732
|
if (isApplyingTheme) return;
|
|
23727
23733
|
setThemeBeingApplied(theme);
|
|
23728
|
-
|
|
23734
|
+
applyTheme({
|
|
23729
23735
|
themeId: theme.id,
|
|
23730
23736
|
entityId: entityId,
|
|
23731
23737
|
entityType: entityType
|
|
@@ -23744,19 +23750,21 @@ var Card = function Card(_ref) {
|
|
|
23744
23750
|
className: "group space-y-2 pt-0.5",
|
|
23745
23751
|
"data-cy": active ? "active-theme-card" : "theme-card",
|
|
23746
23752
|
id: theme.id,
|
|
23747
|
-
|
|
23748
|
-
|
|
23749
|
-
|
|
23750
|
-
|
|
23751
|
-
|
|
23752
|
-
|
|
23753
|
-
|
|
23754
|
-
|
|
23755
|
-
|
|
23756
|
-
|
|
23757
|
-
|
|
23758
|
-
|
|
23759
|
-
|
|
23753
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
23754
|
+
onClick: function onClick() {
|
|
23755
|
+
return onSetPreviewTheme(theme);
|
|
23756
|
+
},
|
|
23757
|
+
children: Thumbnail$1 ? /*#__PURE__*/jsx(Thumbnail$1, {
|
|
23758
|
+
active: active,
|
|
23759
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
23760
|
+
isPreviewing: isPreviewing,
|
|
23761
|
+
theme: theme
|
|
23762
|
+
}) : /*#__PURE__*/jsx(Thumbnail, {
|
|
23763
|
+
active: active,
|
|
23764
|
+
isHighLightedTheme: isHighLightedTheme,
|
|
23765
|
+
isPreviewing: isPreviewing,
|
|
23766
|
+
theme: theme
|
|
23767
|
+
})
|
|
23760
23768
|
}), /*#__PURE__*/jsxs("div", {
|
|
23761
23769
|
className: "flex items-start justify-between gap-1",
|
|
23762
23770
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
@@ -23851,7 +23859,7 @@ var Themes = function Themes(_ref) {
|
|
|
23851
23859
|
setThemeBeingApplied = _useState4[1];
|
|
23852
23860
|
var _useCloneTheme = useCloneTheme(),
|
|
23853
23861
|
cloneTheme = _useCloneTheme.mutate;
|
|
23854
|
-
var
|
|
23862
|
+
var _useApplyTheme = useApplyTheme({
|
|
23855
23863
|
onSuccess: function onSuccess(_ref2) {
|
|
23856
23864
|
var theme = _ref2.theme;
|
|
23857
23865
|
setTheme(theme);
|
|
@@ -23861,8 +23869,8 @@ var Themes = function Themes(_ref) {
|
|
|
23861
23869
|
setThemeBeingApplied({});
|
|
23862
23870
|
}
|
|
23863
23871
|
}),
|
|
23864
|
-
|
|
23865
|
-
isApplyingTheme =
|
|
23872
|
+
applyTheme = _useApplyTheme.mutate,
|
|
23873
|
+
isApplyingTheme = _useApplyTheme.isLoading;
|
|
23866
23874
|
useEffect(function () {
|
|
23867
23875
|
if (didScrollActiveThemeIntoView.current || !(currentTheme !== null && currentTheme !== void 0 && currentTheme.id)) return;
|
|
23868
23876
|
didScrollActiveThemeIntoView.current = true;
|
|
@@ -23922,7 +23930,7 @@ var Themes = function Themes(_ref) {
|
|
|
23922
23930
|
className: "flex flex-col gap-4 px-4 pb-10 lg:px-5 xl:px-6",
|
|
23923
23931
|
children: filteredDefaultThemes.map(function (theme) {
|
|
23924
23932
|
return /*#__PURE__*/createElement(Card$1, {
|
|
23925
|
-
|
|
23933
|
+
applyTheme: applyTheme,
|
|
23926
23934
|
setThemeBeingApplied: setThemeBeingApplied,
|
|
23927
23935
|
theme: theme,
|
|
23928
23936
|
thumbnail: thumbnail,
|
|
@@ -23950,8 +23958,8 @@ var Themes = function Themes(_ref) {
|
|
|
23950
23958
|
var isActive = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id;
|
|
23951
23959
|
var isPreviewing = (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id;
|
|
23952
23960
|
return /*#__PURE__*/createElement(Card$1, {
|
|
23961
|
+
applyTheme: applyTheme,
|
|
23953
23962
|
isPreviewing: isPreviewing,
|
|
23954
|
-
onApplyTheme: onApplyTheme,
|
|
23955
23963
|
onEditTheme: onEditTheme,
|
|
23956
23964
|
setThemeBeingApplied: setThemeBeingApplied,
|
|
23957
23965
|
theme: theme,
|
|
@@ -24050,12 +24058,12 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
24050
24058
|
return {
|
|
24051
24059
|
entityType: store["entityType"],
|
|
24052
24060
|
entityId: store["entityId"],
|
|
24053
|
-
|
|
24061
|
+
isFetchingSchema: store["isFetchingSchema"]
|
|
24054
24062
|
};
|
|
24055
24063
|
}, shallow),
|
|
24056
24064
|
entityType = _useConfigStore.entityType,
|
|
24057
24065
|
entityId = _useConfigStore.entityId,
|
|
24058
|
-
|
|
24066
|
+
isFetchingSchema = _useConfigStore.isFetchingSchema;
|
|
24059
24067
|
var _useThemeStore = useThemeStore(function (store) {
|
|
24060
24068
|
return {
|
|
24061
24069
|
setThemeState: store["setThemeState"]
|
|
@@ -24167,7 +24175,7 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
24167
24175
|
themeToHighlight: themeToHighlight,
|
|
24168
24176
|
themes: themes,
|
|
24169
24177
|
thumbnail: thumbnail,
|
|
24170
|
-
isLoading: isLoading ||
|
|
24178
|
+
isLoading: isLoading || isFetchingSchema,
|
|
24171
24179
|
onDeleteTheme: handleDelete,
|
|
24172
24180
|
onEditTheme: handleEditTheme
|
|
24173
24181
|
}) : /*#__PURE__*/jsx(Customize, {
|
|
@@ -24189,11 +24197,12 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
24189
24197
|
});
|
|
24190
24198
|
};
|
|
24191
24199
|
|
|
24192
|
-
var
|
|
24200
|
+
var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
|
|
24193
24201
|
var children = _ref.children,
|
|
24194
24202
|
entityType = _ref.entityType,
|
|
24195
24203
|
entityId = _ref.entityId,
|
|
24196
|
-
thumbnail = _ref.thumbnail
|
|
24204
|
+
thumbnail = _ref.thumbnail,
|
|
24205
|
+
onPropertiesChange = _ref.onPropertiesChange;
|
|
24197
24206
|
var _useThemeStore = useThemeStore(function (store) {
|
|
24198
24207
|
return {
|
|
24199
24208
|
isCurrentThemeLoading: store["isCurrentThemeLoading"]
|
|
@@ -24209,7 +24218,8 @@ var NeetoThemes = function NeetoThemes(_ref) {
|
|
|
24209
24218
|
useEffect(function () {
|
|
24210
24219
|
setConfigState({
|
|
24211
24220
|
entityType: entityType,
|
|
24212
|
-
entityId: entityId
|
|
24221
|
+
entityId: entityId,
|
|
24222
|
+
onPropertiesChange: onPropertiesChange
|
|
24213
24223
|
});
|
|
24214
24224
|
}, []);
|
|
24215
24225
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -24225,12 +24235,12 @@ var NeetoThemes = function NeetoThemes(_ref) {
|
|
|
24225
24235
|
})]
|
|
24226
24236
|
});
|
|
24227
24237
|
};
|
|
24228
|
-
var index = withTitle(
|
|
24238
|
+
var index = withTitle(NeetoThemesBuilder, t$6("neetoThemes.common.design"));
|
|
24229
24239
|
|
|
24230
24240
|
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}}
|
|
24231
24241
|
|
|
24232
24242
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3RoZW1lcy5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1QkFFRSxZQUFBLENBREEsVUNFRixDRENFLDZDQUdFLDJDQUFBLENBQ0EsbUNBQUEs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IodmFyKC0tbmVldG8tdWktc3VjY2Vzcy01MDApKTtcbn0iXX0= */";
|
|
24233
24243
|
n(css,{});
|
|
24234
24244
|
|
|
24235
|
-
export { index as
|
|
24245
|
+
export { index as NeetoThemesBuilder, setTheme, useThemeUtils };
|
|
24236
24246
|
//# sourceMappingURL=index.js.map
|