@fonixtree/magic-design 2.0.8 → 2.0.9

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.
Files changed (25) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/common/ImagePicker/index.js +4 -2
  3. package/es/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +182 -2
  4. package/es/composite-comp/bol/second-config-panels/ImageGallerySecondConfig/index.js +114 -2
  5. package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +113 -2
  6. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +54 -2
  7. package/es/composite-comp/dito/second-config-panels/MobileNavigationSecondConfig/index.js +68 -1
  8. package/es/core/Designer/ConfigPanel/index.js +2 -1
  9. package/es/locale/en/en.json +1 -0
  10. package/es/locale/es/es.json +1 -0
  11. package/es/locale/id/id.json +1 -0
  12. package/es/meta-comp/config-panels/ImageConfig/index.js +3 -1
  13. package/lib/assets/fonts/.DS_Store +0 -0
  14. package/lib/common/ImagePicker/index.js +4 -2
  15. package/lib/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +182 -2
  16. package/lib/composite-comp/bol/second-config-panels/ImageGallerySecondConfig/index.js +114 -2
  17. package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +113 -2
  18. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +54 -2
  19. package/lib/composite-comp/dito/second-config-panels/MobileNavigationSecondConfig/index.js +68 -1
  20. package/lib/core/Designer/ConfigPanel/index.js +2 -1
  21. package/lib/locale/en/en.json +1 -0
  22. package/lib/locale/es/es.json +1 -0
  23. package/lib/locale/id/id.json +1 -0
  24. package/lib/meta-comp/config-panels/ImageConfig/index.js +3 -1
  25. package/package.json +1 -1
Binary file
@@ -104,7 +104,9 @@ function (_super) {
104
104
 
105
105
  _this.getImagePick = function () {
106
106
  var visible = _this.state.visible;
107
- var value = _this.props.value;
107
+ var _a = _this.props,
108
+ value = _a.value,
109
+ recommendImgSize = _a.recommendImgSize;
108
110
  return /*#__PURE__*/_react["default"].createElement("div", {
109
111
  className: "m-image-picker"
110
112
  }, value ? /*#__PURE__*/_react["default"].createElement("div", {
@@ -149,7 +151,7 @@ function (_super) {
149
151
  className: "no-img"
150
152
  }, /*#__PURE__*/_react["default"].createElement("div", {
151
153
  className: "hint-txt"
152
- }, (0, _locale.i18n)('LOOKS_LIKE_YOU_DO_NOT_HAVE_ANY_IMAGES_IN_YOUR_GALLERY__CHOOSE_IMAGES_TO_FEATURE_ON_THIS_PAGE_')), /*#__PURE__*/_react["default"].createElement("div", {
154
+ }, (0, _locale.i18n)('LOOKS_LIKE_YOU_DO_NOT_HAVE_ANY_IMAGES_IN_YOUR_GALLERY__CHOOSE_IMAGES_TO_FEATURE_ON_THIS_PAGE_'), recommendImgSize && recommendImgSize.width && /*#__PURE__*/_react["default"].createElement("span", null, (0, _locale.i18n)('RECOMMENDED_SIZE'), ": ", recommendImgSize.width, "*", recommendImgSize.height)), /*#__PURE__*/_react["default"].createElement("div", {
153
155
  className: "pick-btn",
154
156
  onClick: function onClick() {
155
157
  _this.setState({
@@ -74,11 +74,188 @@ function (_super) {
74
74
  var _this = _super !== null && _super.apply(this, arguments) || this;
75
75
 
76
76
  _this.state = {};
77
+
78
+ _this.getImageRecommendSize = function (customize) {
79
+ var obj = null;
80
+
81
+ if ((0, _coreUtil.isPc)()) {
82
+ if ((customize === null || customize === void 0 ? void 0 : customize.layout) == 'layout3') {
83
+ switch (customize === null || customize === void 0 ? void 0 : customize.pcRowNum) {
84
+ case 6:
85
+ obj = {
86
+ width: 149,
87
+ height: 120
88
+ };
89
+ break;
90
+
91
+ case 5:
92
+ obj = {
93
+ width: 183,
94
+ height: 147
95
+ };
96
+ break;
97
+
98
+ case 4:
99
+ obj = {
100
+ width: 233,
101
+ height: 188
102
+ };
103
+ break;
104
+
105
+ case 3:
106
+ obj = {
107
+ width: 315,
108
+ height: 256
109
+ };
110
+ break;
111
+
112
+ case 2:
113
+ obj = {
114
+ width: 478,
115
+ height: 393
116
+ };
117
+ break;
118
+
119
+ case 1:
120
+ obj = {
121
+ width: 960,
122
+ height: 680
123
+ };
124
+ break;
125
+ }
126
+ } else {
127
+ switch (customize === null || customize === void 0 ? void 0 : customize.pcRowNum) {
128
+ case 6:
129
+ obj = {
130
+ width: 159,
131
+ height: 120
132
+ };
133
+ break;
134
+
135
+ case 5:
136
+ obj = {
137
+ width: 195,
138
+ height: 147
139
+ };
140
+ break;
141
+
142
+ case 4:
143
+ obj = {
144
+ width: 251,
145
+ height: 188
146
+ };
147
+ break;
148
+
149
+ case 3:
150
+ obj = {
151
+ width: 341,
152
+ height: 256
153
+ };
154
+ break;
155
+
156
+ case 2:
157
+ obj = {
158
+ width: 524,
159
+ height: 393
160
+ };
161
+ break;
162
+
163
+ case 1:
164
+ obj = {
165
+ width: 1072,
166
+ height: 680
167
+ };
168
+ break;
169
+ }
170
+ }
171
+ } else {
172
+ if ((customize === null || customize === void 0 ? void 0 : customize.layout) == 'layout3') {
173
+ switch (customize === null || customize === void 0 ? void 0 : customize.rowNum) {
174
+ case 5:
175
+ obj = {
176
+ width: 64,
177
+ height: 50
178
+ };
179
+ break;
180
+
181
+ case 4:
182
+ obj = {
183
+ width: 77,
184
+ height: 66
185
+ };
186
+ break;
187
+
188
+ case 3:
189
+ obj = {
190
+ width: 105,
191
+ height: 87
192
+ };
193
+ break;
194
+
195
+ case 2:
196
+ obj = {
197
+ width: 160,
198
+ height: 137
199
+ };
200
+ break;
201
+
202
+ case 1:
203
+ obj = {
204
+ width: 327,
205
+ height: 282
206
+ };
207
+ break;
208
+ }
209
+ } else {
210
+ switch (customize === null || customize === void 0 ? void 0 : customize.rowNum) {
211
+ case 5:
212
+ obj = {
213
+ width: 66,
214
+ height: 50
215
+ };
216
+ break;
217
+
218
+ case 4:
219
+ obj = {
220
+ width: 85,
221
+ height: 66
222
+ };
223
+ break;
224
+
225
+ case 3:
226
+ obj = {
227
+ width: 117,
228
+ height: 87
229
+ };
230
+ break;
231
+
232
+ case 2:
233
+ obj = {
234
+ width: 182,
235
+ height: 137
236
+ };
237
+ break;
238
+
239
+ case 1:
240
+ obj = {
241
+ width: 375,
242
+ height: 282
243
+ };
244
+ break;
245
+ }
246
+ }
247
+ }
248
+
249
+ return obj;
250
+ };
251
+
77
252
  return _this;
78
253
  }
79
254
 
80
255
  CarouselSecondConfig.prototype.render = function () {
81
- var panelProps = this.props.panelProps;
256
+ var _a = this.props,
257
+ panelProps = _a.panelProps,
258
+ parentNode = _a.parentNode;
82
259
  var textSource = [{
83
260
  key: '2',
84
261
  name: (0, _locale.i18n)('TITLE'),
@@ -118,6 +295,8 @@ function (_super) {
118
295
 
119
296
  var _textSource = _mobx.store.CarouselStore[panelProps.compId] === 'layout2' ? textSource : [];
120
297
 
298
+ var size = this.getImageRecommendSize(parentNode.customize);
299
+
121
300
  var getConfig = function getConfig() {
122
301
  return /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
123
302
  headerSize: "middle",
@@ -128,7 +307,8 @@ function (_super) {
128
307
  key: '1',
129
308
  name: (0, _locale.i18n)('IMAGE'),
130
309
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
131
- data: panelProps.image
310
+ data: panelProps.image,
311
+ recommendImgSize: size
132
312
  }),
133
313
  metaOption: panelProps.image,
134
314
  toggleType: 'switch'
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _ImageConfig = _interopRequireDefault(require("../../../../meta-comp/config-panels/ImageConfig"));
11
11
 
12
+ var _coreUtil = require("../../../../utils/coreUtil");
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
15
 
14
16
  var __extends = void 0 && (void 0).__extends || function () {
@@ -46,18 +48,128 @@ function (_super) {
46
48
  var _this = _super !== null && _super.apply(this, arguments) || this;
47
49
 
48
50
  _this.state = {};
51
+
52
+ _this.getImageRecommendSize = function (customize) {
53
+ var _a, _b;
54
+
55
+ var obj = null;
56
+
57
+ if ((0, _coreUtil.isPc)()) {
58
+ switch ((_a = customize === null || customize === void 0 ? void 0 : customize.layout) === null || _a === void 0 ? void 0 : _a.pcLayout) {
59
+ case 'layout1':
60
+ obj = {
61
+ width: 1440,
62
+ height: 912
63
+ };
64
+ break;
65
+
66
+ case 'layout2':
67
+ {
68
+ switch (customize === null || customize === void 0 ? void 0 : customize.pcRowNum) {
69
+ case 6:
70
+ obj = {
71
+ width: 220,
72
+ height: 166
73
+ };
74
+ break;
75
+
76
+ case 5:
77
+ obj = {
78
+ width: 268,
79
+ height: 202
80
+ };
81
+ break;
82
+
83
+ case 4:
84
+ obj = {
85
+ width: 342,
86
+ height: 256
87
+ };
88
+ break;
89
+
90
+ case 3:
91
+ obj = {
92
+ width: 464,
93
+ height: 348
94
+ };
95
+ break;
96
+
97
+ case 2:
98
+ obj = {
99
+ width: 708,
100
+ height: 531
101
+ };
102
+ break;
103
+ }
104
+
105
+ break;
106
+ }
107
+ }
108
+ } else {
109
+ switch ((_b = customize === null || customize === void 0 ? void 0 : customize.layout) === null || _b === void 0 ? void 0 : _b.h5Layout) {
110
+ case 'layout1':
111
+ obj = {
112
+ width: 375,
113
+ height: 282
114
+ };
115
+ break;
116
+
117
+ case 'layout2':
118
+ {
119
+ switch (customize === null || customize === void 0 ? void 0 : customize.rowNum) {
120
+ case 5:
121
+ obj = {
122
+ width: 69,
123
+ height: 50
124
+ };
125
+ break;
126
+
127
+ case 4:
128
+ obj = {
129
+ width: 85,
130
+ height: 66
131
+ };
132
+ break;
133
+
134
+ case 3:
135
+ obj = {
136
+ width: 117,
137
+ height: 87
138
+ };
139
+ break;
140
+
141
+ case 2:
142
+ obj = {
143
+ width: 182,
144
+ height: 137
145
+ };
146
+ break;
147
+ }
148
+
149
+ break;
150
+ }
151
+ }
152
+ }
153
+
154
+ return obj;
155
+ };
156
+
49
157
  return _this;
50
158
  }
51
159
 
52
160
  ImageGallerySecondConfig.prototype.render = function () {
53
- var panelProps = this.props.panelProps;
161
+ var _a = this.props,
162
+ panelProps = _a.panelProps,
163
+ parentNode = _a.parentNode;
164
+ var size = this.getImageRecommendSize(parentNode.customize);
54
165
  return /*#__PURE__*/_react["default"].createElement("div", {
55
166
  className: "image_gallery_second_conf_wrap",
56
167
  style: {
57
168
  marginTop: '20px'
58
169
  }
59
170
  }, /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
60
- data: panelProps.image
171
+ data: panelProps.image,
172
+ recommendImgSize: size
61
173
  }));
62
174
  };
63
175
 
@@ -81,13 +81,123 @@ function (_super) {
81
81
 
82
82
  _this.state = {};
83
83
 
84
+ _this.getImageRecommendSize = function (customize) {
85
+ var _a, _b, _c;
86
+
87
+ var obj = null;
88
+
89
+ if ((0, _coreUtil.isPc)()) {
90
+ if (((_a = customize === null || customize === void 0 ? void 0 : customize.layout) === null || _a === void 0 ? void 0 : _a.pcLayout) == 'normal' || ((_b = customize === null || customize === void 0 ? void 0 : customize.layout) === null || _b === void 0 ? void 0 : _b.pcLayout) == 'center') {
91
+ switch (customize === null || customize === void 0 ? void 0 : customize.pcRowNum) {
92
+ case 5:
93
+ obj = {
94
+ width: 119,
95
+ height: 90
96
+ };
97
+ break;
98
+
99
+ case 4:
100
+ obj = {
101
+ width: 150,
102
+ height: 112
103
+ };
104
+ break;
105
+
106
+ case 3:
107
+ obj = {
108
+ width: 205,
109
+ height: 154
110
+ };
111
+ break;
112
+
113
+ case 2:
114
+ obj = {
115
+ width: 314,
116
+ height: 236
117
+ };
118
+ break;
119
+
120
+ case 1:
121
+ obj = {
122
+ width: 640,
123
+ height: 480
124
+ };
125
+ break;
126
+ }
127
+ } else {
128
+ obj = {
129
+ width: 65,
130
+ height: 65
131
+ };
132
+ }
133
+ } else {
134
+ switch ((_c = customize === null || customize === void 0 ? void 0 : customize.layout) === null || _c === void 0 ? void 0 : _c.h5Layout) {
135
+ case 'normal2':
136
+ obj = {
137
+ width: 190,
138
+ height: 142
139
+ };
140
+ break;
141
+
142
+ case 'normal3':
143
+ {
144
+ switch (customize === null || customize === void 0 ? void 0 : customize.rowNum) {
145
+ case 4:
146
+ obj = {
147
+ width: 61,
148
+ height: 61
149
+ };
150
+ break;
151
+
152
+ case 3:
153
+ obj = {
154
+ width: 91,
155
+ height: 91
156
+ };
157
+ break;
158
+
159
+ case 2:
160
+ obj = {
161
+ width: 150,
162
+ height: 150
163
+ };
164
+ break;
165
+
166
+ case 1:
167
+ obj = {
168
+ width: 327,
169
+ height: 327
170
+ };
171
+ break;
172
+ }
173
+
174
+ break;
175
+ }
176
+
177
+ default:
178
+ obj = {
179
+ width: 38,
180
+ height: 38
181
+ };
182
+ break;
183
+ }
184
+ }
185
+
186
+ return obj;
187
+ };
188
+
84
189
  _this.getContentPanel = function (data, needHover) {
190
+ var parentNode = _this.props.parentNode;
191
+
192
+ var size = _this.getImageRecommendSize(parentNode.customize);
193
+
85
194
  var source = [{
86
195
  key: 'imageTextSecondContent1',
87
196
  name: (0, _locale.i18n)('IMAGE'),
88
197
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
89
198
  data: data.image,
90
- needHover: needHover
199
+ needHover: needHover,
200
+ recommendImgSize: size
91
201
  }),
92
202
  metaOption: data.image
93
203
  }, {
@@ -182,7 +292,8 @@ function (_super) {
182
292
  };
183
293
 
184
294
  ImageTextSecondConfig.defaultProps = {
185
- panelProps: {}
295
+ panelProps: {},
296
+ parentNode: {}
186
297
  };
187
298
  return ImageTextSecondConfig;
188
299
  }(_react["default"].Component);
@@ -75,8 +75,59 @@ function (_super) {
75
75
  _this.setState({});
76
76
  };
77
77
 
78
+ _this.getImageRecommendSize = function (customize) {
79
+ var _a;
80
+
81
+ var obj = null;
82
+ console.log(customize);
83
+
84
+ if ((0, _coreUtil.isPc)()) {
85
+ switch ((_a = customize === null || customize === void 0 ? void 0 : customize.layout) === null || _a === void 0 ? void 0 : _a.pcLayout) {
86
+ case 'layout1':
87
+ obj = {
88
+ width: 1280,
89
+ height: 600
90
+ };
91
+ break;
92
+
93
+ case 'layout2':
94
+ obj = {
95
+ width: 640,
96
+ height: 600
97
+ };
98
+ break;
99
+
100
+ case 'layout3':
101
+ obj = {
102
+ width: 410,
103
+ height: 300
104
+ };
105
+ break;
106
+
107
+ default:
108
+ obj = {
109
+ width: 440,
110
+ height: 272
111
+ };
112
+ break;
113
+ }
114
+ } else {
115
+ obj = {
116
+ width: 343,
117
+ height: 212
118
+ };
119
+ }
120
+
121
+ return obj;
122
+ };
123
+
78
124
  _this.getContentPanel = function () {
79
- var panelProps = _this.props.panelProps;
125
+ var _a = _this.props,
126
+ panelProps = _a.panelProps,
127
+ parentNode = _a.parentNode;
128
+
129
+ var size = _this.getImageRecommendSize(parentNode.customize);
130
+
80
131
  var source = [{
81
132
  key: '1',
82
133
  name: 'Overlay',
@@ -84,7 +135,8 @@ function (_super) {
84
135
  data: panelProps.overilay,
85
136
  needClickArea: false,
86
137
  needHover: false,
87
- needURL: false
138
+ needURL: false,
139
+ recommendImgSize: size
88
140
  }),
89
141
  metaOption: panelProps.overilay
90
142
  }, {
@@ -55,13 +55,80 @@ function (_super) {
55
55
 
56
56
  _this.state = {};
57
57
 
58
+ _this.getImageRecommendSize = function (customize) {
59
+ var obj = null;
60
+
61
+ switch (customize === null || customize === void 0 ? void 0 : customize.layout) {
62
+ case 'newline':
63
+ switch (customize === null || customize === void 0 ? void 0 : customize.rowNum) {
64
+ case 5:
65
+ obj = {
66
+ width: 48,
67
+ height: 48
68
+ };
69
+ break;
70
+
71
+ case 4:
72
+ obj = {
73
+ width: 52,
74
+ height: 52
75
+ };
76
+ break;
77
+
78
+ case 3:
79
+ obj = {
80
+ width: 82,
81
+ height: 82
82
+ };
83
+ break;
84
+ }
85
+
86
+ break;
87
+
88
+ case 'tile':
89
+ {
90
+ switch (customize === null || customize === void 0 ? void 0 : customize.rowNum) {
91
+ case 5:
92
+ obj = {
93
+ width: 44,
94
+ height: 44
95
+ };
96
+ break;
97
+
98
+ case 4:
99
+ obj = {
100
+ width: 52,
101
+ height: 52
102
+ };
103
+ break;
104
+
105
+ case 3:
106
+ obj = {
107
+ width: 78,
108
+ height: 78
109
+ };
110
+ break;
111
+ }
112
+
113
+ break;
114
+ }
115
+ }
116
+
117
+ return obj;
118
+ };
119
+
58
120
  _this.getContentPanel = function (data, needHover) {
121
+ var parentNode = _this.props.parentNode;
122
+
123
+ var size = _this.getImageRecommendSize(parentNode.customize);
124
+
59
125
  var source = [{
60
126
  key: 'mobileNavSecondContent1',
61
127
  name: (0, _locale.i18n)('IMAGE'),
62
128
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
63
129
  data: data.image,
64
- needHover: needHover
130
+ needHover: needHover,
131
+ recommendImgSize: size
65
132
  }),
66
133
  metaOption: data.image
67
134
  }, {
@@ -285,7 +285,8 @@ function (_super) {
285
285
  if (panelProps) {
286
286
  var instance = Clazz ? /*#__PURE__*/_react["default"].createElement(Clazz, {
287
287
  panelProps: panelProps,
288
- outputType: outputType
288
+ outputType: outputType,
289
+ parentNode: selectedNode
289
290
  }) : null;
290
291
  return instance;
291
292
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "RECOMMENDED_SIZE": "Recommended Size",
2
3
  "BOLD": "Bold",
3
4
  "SEMIBOLD": "Semibold",
4
5
  "DARK": "Dark",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "RECOMMENDED_SIZE": "Recommended Size",
2
3
  "BOLD": "Bold",
3
4
  "SEMIBOLD": "Semibold",
4
5
  "DARK": "Dark",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "RECOMMENDED_SIZE": "Recommended Size",
2
3
  "BOLD": "Bold",
3
4
  "SEMIBOLD": "Semibold",
4
5
  "DARK": "Dark",
@@ -319,7 +319,8 @@ function (_super) {
319
319
  data = _a.data,
320
320
  needHover = _a.needHover,
321
321
  needClickArea = _a.needClickArea,
322
- needURL = _a.needURL;
322
+ needURL = _a.needURL,
323
+ recommendImgSize = _a.recommendImgSize;
323
324
  var selectImg = this.getSelectedImg(data);
324
325
 
325
326
  var ContentSetting = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
@@ -330,6 +331,7 @@ function (_super) {
330
331
  onChange: function onChange(v, way) {
331
332
  _this.getImg(v, way);
332
333
  },
334
+ recommendImgSize: recommendImgSize,
333
335
  value: selectImg
334
336
  }), needClickArea && selectImg && /*#__PURE__*/_react["default"].createElement(_HotAreaConfig["default"], {
335
337
  imgUrl: selectImg,