@bigbinary/neeto-themes-frontend 3.1.28 → 3.1.29
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/NeetoThemesBuilder.js +60 -8
- package/dist/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/NeetoThemesBuilder.js +60 -8
- package/dist/cjs/NeetoThemesBuilder.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -37,11 +37,12 @@ import LeftAlign from '@bigbinary/neeto-icons/LeftAlign';
|
|
|
37
37
|
import ColorPicker from '@bigbinary/neetoui/ColorPicker';
|
|
38
38
|
import Select from '@bigbinary/neetoui/Select';
|
|
39
39
|
import { Slider } from 'antd';
|
|
40
|
+
import Input from '@bigbinary/neetoui/Input';
|
|
40
41
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
41
42
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
42
43
|
import ImageUploader from '@bigbinary/neeto-image-uploader-frontend/ImageUploader';
|
|
43
44
|
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
44
|
-
import Input from '@bigbinary/neetoui/formik/Input';
|
|
45
|
+
import Input$1 from '@bigbinary/neetoui/formik/Input';
|
|
45
46
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
46
47
|
import Rating from '@bigbinary/neeto-icons/Rating';
|
|
47
48
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
@@ -491,6 +492,15 @@ var buildInitialValues = function buildInitialValues(theme, themePropertiesSchem
|
|
|
491
492
|
order = _ref$order === void 0 ? null : _ref$order,
|
|
492
493
|
dependsOn = _ref.dependsOn;
|
|
493
494
|
switch (kind) {
|
|
495
|
+
case "text_input":
|
|
496
|
+
return _objectSpread$3({
|
|
497
|
+
value: defaultValue || "",
|
|
498
|
+
kind: "text_input",
|
|
499
|
+
key: key,
|
|
500
|
+
dependsOn: dependsOn
|
|
501
|
+
}, order !== null && {
|
|
502
|
+
order: order
|
|
503
|
+
});
|
|
494
504
|
case "color":
|
|
495
505
|
return _objectSpread$3({
|
|
496
506
|
value: defaultValue,
|
|
@@ -867,6 +877,34 @@ var SwitchBlock = function SwitchBlock(_ref) {
|
|
|
867
877
|
});
|
|
868
878
|
};
|
|
869
879
|
|
|
880
|
+
var TextBlock = function TextBlock(_ref) {
|
|
881
|
+
var label = _ref.label,
|
|
882
|
+
name = _ref.name,
|
|
883
|
+
_ref$type = _ref.type,
|
|
884
|
+
type = _ref$type === void 0 ? "text" : _ref$type,
|
|
885
|
+
value = _ref.value,
|
|
886
|
+
onChange = _ref.onChange,
|
|
887
|
+
placeholder = _ref.placeholder;
|
|
888
|
+
return /*#__PURE__*/jsxs("div", {
|
|
889
|
+
className: "flex items-center justify-between",
|
|
890
|
+
"data-cy": "theme-style-".concat(joinHyphenCase(label)),
|
|
891
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
892
|
+
"data-cy": "style-fields-labels",
|
|
893
|
+
style: "body2",
|
|
894
|
+
children: label
|
|
895
|
+
}), /*#__PURE__*/jsx("div", {
|
|
896
|
+
className: "w-40",
|
|
897
|
+
children: /*#__PURE__*/jsx(Input, {
|
|
898
|
+
name: name,
|
|
899
|
+
onChange: onChange,
|
|
900
|
+
placeholder: placeholder,
|
|
901
|
+
type: type,
|
|
902
|
+
value: value
|
|
903
|
+
})
|
|
904
|
+
})]
|
|
905
|
+
});
|
|
906
|
+
};
|
|
907
|
+
|
|
870
908
|
var Properties = function Properties(_ref) {
|
|
871
909
|
var onPropertiesChange = _ref.onPropertiesChange,
|
|
872
910
|
condition = _ref.condition,
|
|
@@ -953,6 +991,20 @@ var Properties = function Properties(_ref) {
|
|
|
953
991
|
var isCurrentPropertyVisible = isPropertyVisible(key, values, themePropertiesSchema);
|
|
954
992
|
if (!isCurrentPropertyVisible) return null;
|
|
955
993
|
switch (kind) {
|
|
994
|
+
case "text_input":
|
|
995
|
+
{
|
|
996
|
+
var index = findIndexBy({
|
|
997
|
+
key: key
|
|
998
|
+
}, values.properties);
|
|
999
|
+
return /*#__PURE__*/jsx(TextBlock, {
|
|
1000
|
+
label: buildLabel(key, kind),
|
|
1001
|
+
name: "properties[".concat(index, "].value"),
|
|
1002
|
+
value: value || "",
|
|
1003
|
+
onChange: function onChange(e) {
|
|
1004
|
+
return setFieldValue("properties[".concat(index, "].value"), e.target.value);
|
|
1005
|
+
}
|
|
1006
|
+
}, key);
|
|
1007
|
+
}
|
|
956
1008
|
case "font_family":
|
|
957
1009
|
return /*#__PURE__*/jsx(FontPickerBlock, {
|
|
958
1010
|
label: buildLabel(key, kind),
|
|
@@ -998,7 +1050,7 @@ var Properties = function Properties(_ref) {
|
|
|
998
1050
|
case "position_selector":
|
|
999
1051
|
{
|
|
1000
1052
|
var _findBy4;
|
|
1001
|
-
var
|
|
1053
|
+
var _index = findIndexBy({
|
|
1002
1054
|
key: key
|
|
1003
1055
|
}, values.properties);
|
|
1004
1056
|
var options = (_findBy4 = findBy({
|
|
@@ -1010,13 +1062,13 @@ var Properties = function Properties(_ref) {
|
|
|
1010
1062
|
placeholder: "left",
|
|
1011
1063
|
value: toLabelAndValue(value),
|
|
1012
1064
|
onChange: function onChange(option) {
|
|
1013
|
-
return setFieldValue("properties[".concat(
|
|
1065
|
+
return setFieldValue("properties[".concat(_index, "].value"), option.value);
|
|
1014
1066
|
}
|
|
1015
1067
|
}, key);
|
|
1016
1068
|
}
|
|
1017
1069
|
case "boolean":
|
|
1018
1070
|
{
|
|
1019
|
-
var
|
|
1071
|
+
var _index2 = findIndexBy({
|
|
1020
1072
|
key: key
|
|
1021
1073
|
}, values.properties);
|
|
1022
1074
|
return /*#__PURE__*/jsx(SwitchBlock, {
|
|
@@ -1024,18 +1076,18 @@ var Properties = function Properties(_ref) {
|
|
|
1024
1076
|
label: buildLabel(key, kind),
|
|
1025
1077
|
name: snakeToCamelCase(key),
|
|
1026
1078
|
onChange: function onChange(e) {
|
|
1027
|
-
return setFieldValue("properties[".concat(
|
|
1079
|
+
return setFieldValue("properties[".concat(_index2, "].value"), String(e.target.checked));
|
|
1028
1080
|
}
|
|
1029
1081
|
}, key);
|
|
1030
1082
|
}
|
|
1031
1083
|
case "alignment_block":
|
|
1032
1084
|
{
|
|
1033
|
-
var
|
|
1085
|
+
var _index3 = findIndexBy({
|
|
1034
1086
|
key: key
|
|
1035
1087
|
}, values.properties);
|
|
1036
1088
|
return /*#__PURE__*/jsx(AlignmentBlock, {
|
|
1037
1089
|
label: buildLabel(key, kind),
|
|
1038
|
-
name: "properties[".concat(
|
|
1090
|
+
name: "properties[".concat(_index3, "].value")
|
|
1039
1091
|
});
|
|
1040
1092
|
}
|
|
1041
1093
|
default:
|
|
@@ -1215,7 +1267,7 @@ var ThemeMeta = function ThemeMeta(_ref) {
|
|
|
1215
1267
|
helpPopoverProps: nameHelpPopoverProps,
|
|
1216
1268
|
name: "name",
|
|
1217
1269
|
title: t("neetoThemes.common.name"),
|
|
1218
|
-
children: /*#__PURE__*/jsx(Input, {
|
|
1270
|
+
children: /*#__PURE__*/jsx(Input$1, {
|
|
1219
1271
|
autoFocus: true,
|
|
1220
1272
|
"data-cy": "theme-name-property",
|
|
1221
1273
|
name: "name"
|