@fonixtree/magic-design 0.0.97 → 0.0.99

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 (35) hide show
  1. package/es/common/LinkModal/FilteredProductModal/index.js +21 -18
  2. package/es/composite-comp/bol/components/Banner/mobile/index.js +11 -18
  3. package/es/composite-comp/bol/components/Banner/pc/index.js +10 -10
  4. package/es/composite-comp/bol/components/ImageText/pc/index.less +2 -0
  5. package/es/composite-comp/bol/components/Newsletter/index.js +15 -2
  6. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +14 -1
  7. package/es/composite-comp/dito/components/PcNavigation/pc/index.js +0 -2
  8. package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -1
  9. package/es/composite-comp/dito/config-panels/SearchBarConfig/index.js +2 -1
  10. package/es/core/Designer/PageCompList/index.js +29 -1
  11. package/es/core/Designer/QuickMenuBar/index.js +3 -1
  12. package/es/core/Designer/ViewArea/index.js +3 -4
  13. package/es/core/Designer/ViewArea/index.less +1 -6
  14. package/es/core/Renderer/index.js +5 -3
  15. package/es/decorator/compositeDecorator.js +131 -38
  16. package/es/decorator/metaDecorator.js +1 -1
  17. package/es/mobx/Store.js +4 -1
  18. package/lib/common/LinkModal/FilteredProductModal/index.js +21 -18
  19. package/lib/composite-comp/bol/components/Banner/mobile/index.js +11 -18
  20. package/lib/composite-comp/bol/components/Banner/pc/index.js +10 -10
  21. package/lib/composite-comp/bol/components/ImageText/pc/index.less +2 -0
  22. package/lib/composite-comp/bol/components/Newsletter/index.js +15 -2
  23. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +14 -1
  24. package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +0 -2
  25. package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +2 -1
  26. package/lib/composite-comp/dito/config-panels/SearchBarConfig/index.js +2 -1
  27. package/lib/core/Designer/PageCompList/index.js +29 -1
  28. package/lib/core/Designer/QuickMenuBar/index.js +3 -1
  29. package/lib/core/Designer/ViewArea/index.js +3 -4
  30. package/lib/core/Designer/ViewArea/index.less +1 -6
  31. package/lib/core/Renderer/index.js +5 -3
  32. package/lib/decorator/compositeDecorator.js +131 -38
  33. package/lib/decorator/metaDecorator.js +1 -1
  34. package/lib/mobx/Store.js +4 -1
  35. package/package.json +1 -1
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _mobx = require("../mobx");
13
13
 
14
+ var _constants = require("../constants");
15
+
14
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
17
 
16
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -58,6 +60,17 @@ var __assign = void 0 && (void 0).__assign || function () {
58
60
  };
59
61
 
60
62
  function compositeDecorator(WrappedComponent) {
63
+ var floorNameStyle = {
64
+ backgroundColor: '#2F54EB',
65
+ height: '18px',
66
+ color: '#FFF',
67
+ fontSize: '10px',
68
+ padding: '0 5px',
69
+ display: 'flex',
70
+ alignItems: 'center',
71
+ width: 'fit-content'
72
+ };
73
+
61
74
  var Wrapper =
62
75
  /** @class */
63
76
  function (_super) {
@@ -67,7 +80,8 @@ function compositeDecorator(WrappedComponent) {
67
80
  var _this = _super !== null && _super.apply(this, arguments) || this;
68
81
 
69
82
  _this.state = {
70
- clickedFloor: ''
83
+ clickedFloor: '',
84
+ hoveredFloor: ''
71
85
  }; // 复合组件点击事件
72
86
 
73
87
  _this.onCompositeCompClick = function (event) {
@@ -89,48 +103,115 @@ function compositeDecorator(WrappedComponent) {
89
103
  window.document.dispatchEvent(evt);
90
104
  };
91
105
 
92
- _this.getStyle = function () {
106
+ _this.getCompositeStyle = function () {
107
+ var _a;
108
+
93
109
  var nodeData = _this.props.nodeData;
94
- var wrapStyle = {
95
- border: 'none'
96
- };
97
- var _a = window.magicDesign,
98
- device = _a.device,
99
- mode = _a.mode;
100
110
  var spacing = nodeData.spacing,
101
- background = nodeData.background; // 处理复合组件的选中状态
111
+ background = nodeData.background;
112
+ var _b = window.magicDesign,
113
+ device = _b.device,
114
+ compWidth = _b.compWidth;
115
+ var wrapStyle = {
116
+ border: 'none',
117
+ position: 'relative',
118
+ zIndex: '1',
119
+ margin: '0 auto'
120
+ }; // 复合组件内边距
121
+
122
+ if (spacing && spacing[device]) {
123
+ wrapStyle = __assign(__assign({}, wrapStyle), spacing[device]);
124
+ } // 复合组件背景
125
+
126
+
127
+ if (background) {
128
+ if (background.bgType === 'color') {
129
+ wrapStyle.backgroundColor = background.color;
130
+ wrapStyle.opacity = background.opacity ? background.opacity : 1;
131
+ } else {
132
+ wrapStyle.backgroundImage = "url(" + background.image + ")";
133
+ wrapStyle.backgroundPosition = '0px 0px';
134
+ wrapStyle.backgroundSize = 'auto 100%';
135
+ wrapStyle.backgroundRepeat = 'no-repeat';
136
+ }
137
+ } // 复合组件宽度
138
+ // 此处特殊处理一些占满整屏的组件: spacing.pc.fillUp = true时,沾满全屏
139
+
140
+
141
+ if (device === _constants.deviceTypeMap.PC && compWidth && !((_a = spacing.pc) === null || _a === void 0 ? void 0 : _a.fillUp)) {
142
+ wrapStyle.width = compWidth;
143
+ }
144
+
145
+ return wrapStyle;
146
+ };
147
+
148
+ _this.getMaskStyle = function () {
149
+ var nodeData = _this.props.nodeData;
150
+ var mode = window.magicDesign.mode;
151
+ var _a = _this.state,
152
+ hoveredFloor = _a.hoveredFloor,
153
+ clickedFloor = _a.clickedFloor; // 选中状态
154
+
155
+ var maskStyle = {
156
+ border: '2px solid #2F54EB',
157
+ position: 'absolute',
158
+ inset: '0px',
159
+ zIndex: '0',
160
+ opacity: '0'
161
+ }; // 处理复合组件的hover状态
102
162
 
103
163
  if (mode === 'designer') {
104
- // style.border = '1px solid transparent';
105
- wrapStyle.border = 'none';
164
+ if (clickedFloor !== hoveredFloor && hoveredFloor === nodeData.id) {
165
+ maskStyle.backgroundColor = 'rgba(47, 84, 235, 0.08)';
166
+ maskStyle.opacity = '100%';
167
+ maskStyle.zIndex = '3';
168
+ } // 处理复合组件的选中状态
106
169
 
107
- if (nodeData.id === _this.state.clickedFloor) {
108
- wrapStyle.border = '1px dashed red';
109
- }
110
- } // banner的padding和background单独处理
111
-
112
-
113
- if (nodeData.type != 'BANNER') {
114
- // 边距
115
- if (spacing && spacing[device]) {
116
- wrapStyle = __assign(__assign({}, wrapStyle), spacing[device]);
117
- } // 背景
118
-
119
-
120
- if (background) {
121
- if (background.bgType === 'color') {
122
- wrapStyle.backgroundColor = background.color;
123
- wrapStyle.opacity = background.opacity ? background.opacity : 1;
124
- } else {
125
- wrapStyle.backgroundImage = "url(" + background.image + ")";
126
- wrapStyle.backgroundPosition = '0px 0px';
127
- wrapStyle.backgroundSize = 'auto 100%';
128
- wrapStyle.backgroundRepeat = 'no-repeat';
129
- }
170
+
171
+ if (clickedFloor === nodeData.id) {
172
+ maskStyle.backgroundColor = 'transparent';
173
+ maskStyle.opacity = '100%';
174
+ maskStyle.zIndex = '0';
130
175
  }
131
176
  }
132
177
 
133
- return wrapStyle;
178
+ return maskStyle;
179
+ };
180
+
181
+ _this.getWrapStyle = function () {
182
+ var mode = window.magicDesign.mode;
183
+ var nodeData = _this.props.nodeData;
184
+ var style = {
185
+ position: 'relative',
186
+ zIndex: '1'
187
+ };
188
+ var clickedFloor = _this.state.clickedFloor; // banner 和 recommend 在选中状态需要加padding,让选中的外边框展示出来
189
+
190
+ if (mode === 'designer' && clickedFloor === nodeData.id && ['BANNER', 'RECOMMEND'].includes(nodeData.type)) {
191
+ style.padding = '2px';
192
+ }
193
+
194
+ return style;
195
+ };
196
+
197
+ _this.onMouseEnter = function () {
198
+ if (window.magicDesign.mode === 'renderer') {
199
+ return;
200
+ }
201
+
202
+ _mobx.store.setState({
203
+ hoveredFloor: _this.props.nodeData.id
204
+ });
205
+ };
206
+
207
+ _this.onMouseLeave = function () {
208
+ if (window.magicDesign.mode === 'renderer') {
209
+ return;
210
+ }
211
+
212
+ _mobx.store.setState({
213
+ hoveredFloor: ''
214
+ });
134
215
  };
135
216
 
136
217
  return _this;
@@ -141,7 +222,8 @@ function compositeDecorator(WrappedComponent) {
141
222
 
142
223
  this.distroy = (0, _mobx.autorun)(function () {
143
224
  _this.setState({
144
- clickedFloor: _mobx.store.clickedFloor
225
+ clickedFloor: _mobx.store.clickedFloor,
226
+ hoveredFloor: _mobx.store.hoveredFloor
145
227
  });
146
228
  });
147
229
  };
@@ -151,11 +233,22 @@ function compositeDecorator(WrappedComponent) {
151
233
  };
152
234
 
153
235
  Wrapper.prototype.render = function () {
236
+ var nodeData = this.props.nodeData;
237
+ var clickedFloor = this.state.clickedFloor;
154
238
  return /*#__PURE__*/_react["default"].createElement("div", {
155
239
  className: "composite_wrap",
156
240
  onClick: this.onCompositeCompClick,
157
- style: this.getStyle()
158
- }, /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props));
241
+ onMouseEnter: this.onMouseEnter,
242
+ onMouseLeave: this.onMouseLeave,
243
+ style: this.getCompositeStyle()
244
+ }, /*#__PURE__*/_react["default"].createElement("div", {
245
+ className: "composite_mask",
246
+ style: this.getMaskStyle()
247
+ }, clickedFloor !== nodeData.id && /*#__PURE__*/_react["default"].createElement("span", {
248
+ style: floorNameStyle
249
+ }, _constants.compInfoMap[nodeData.type].name)), /*#__PURE__*/_react["default"].createElement("div", {
250
+ style: this.getWrapStyle()
251
+ }, /*#__PURE__*/_react["default"].createElement(WrappedComponent, this.props)));
159
252
  };
160
253
 
161
254
  Wrapper.getDefaultJSON = WrappedComponent.getDefaultJSON;
@@ -182,7 +182,7 @@ function metaDecorator(WrappedComponent) {
182
182
 
183
183
  if (rest.data.type === 'TEXT') {
184
184
  var width = window.magicDesign.device === 'pc' ? rest.data.content.pcWidth : rest.data.content.width;
185
- newStyle.width = (width || 100) + "%";
185
+ newStyle.width = (Math.min(width, 100) || 100) + "%";
186
186
  }
187
187
 
188
188
  return newStyle;
package/es/mobx/Store.js CHANGED
@@ -14,7 +14,7 @@ var _storeUtil = require("../utils/storeUtil");
14
14
  var debug = require('debug')('worker:mobx');
15
15
 
16
16
  var CACHE_KEY = 'STORE';
17
- var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'textSelection', 'MPageData'];
17
+ var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'hoveredFloor', 'textSelection', 'MPageData'];
18
18
 
19
19
  var Store =
20
20
  /** @class */
@@ -30,6 +30,8 @@ function () {
30
30
 
31
31
  this.clickedFloor = ''; // 点击的楼层Id
32
32
 
33
+ this.hoveredFloor = ''; // hover的复合组件Id
34
+
33
35
  this.textSelection = null; // 文本元组件选中区域
34
36
 
35
37
  this.MPageData = []; // 楼层数据
@@ -43,6 +45,7 @@ function () {
43
45
  clickedMeta: _mobx.observable,
44
46
  clickedGroup: _mobx.observable,
45
47
  clickedFloor: _mobx.observable,
48
+ hoveredFloor: _mobx.observable,
46
49
  CarouselStore: _mobx.observable,
47
50
  setState: _mobx.action.bound
48
51
  });
@@ -217,7 +217,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
217
217
  storeName = _g[0],
218
218
  setStoreName = _g[1];
219
219
 
220
- var _h = (0, _react.useState)([]),
220
+ var _h = (0, _react.useState)(''),
221
221
  storeId = _h[0],
222
222
  setStoreId = _h[1];
223
223
 
@@ -293,27 +293,29 @@ var FilteredProductModal = function FilteredProductModal(props) {
293
293
 
294
294
  var columns = [{
295
295
  title: 'Image',
296
- dataIndex: 'productImageUrl',
297
- key: 'productImageUrl',
298
- render: function render(productImageUrl) {
296
+ dataIndex: 'imgUrl',
297
+ key: 'imgUrl',
298
+ width: 100,
299
+ render: function render(imgUrl, record) {
299
300
  return /*#__PURE__*/_react["default"].createElement("div", {
300
301
  className: "prodImage",
301
302
  style: {
302
- backgroundImage: "url(" + productImageUrl + ")"
303
+ backgroundImage: "url(\"" + (0, _commonUtil.convertImageUrl)(record.productImg || record.imgUrlContent || record.productImgContent) + "\")"
303
304
  }
304
305
  });
305
306
  }
306
307
  }, {
307
- title: 'Product Name',
308
- dataIndex: 'productName',
309
- key: 'productName',
308
+ title: 'Offer Name',
309
+ dataIndex: 'offerName',
310
+ key: 'offerName',
310
311
  ellipsis: true
311
- }, {
312
- title: 'SKU',
313
- dataIndex: 'attrValues',
314
- key: 'attrValues',
315
- ellipsis: true
316
- }, {
312
+ }, // {
313
+ // title: 'SKU',
314
+ // dataIndex: 'attrValues',
315
+ // key: 'attrValues',
316
+ // ellipsis: true,
317
+ // },
318
+ {
317
319
  title: 'Price',
318
320
  dataIndex: 'salesPrice',
319
321
  key: 'salesPrice',
@@ -453,8 +455,8 @@ var FilteredProductModal = function FilteredProductModal(props) {
453
455
  return v.key;
454
456
  }).join(','),
455
457
  labelIds: labelId.key,
456
- // q: productName,
457
- productName: productName,
458
+ q: productName,
459
+ // productName,
458
460
  storeId: storeId,
459
461
  minPrice: minimum * precision || '',
460
462
  maxPrice: maximum * precision || '',
@@ -466,10 +468,11 @@ var FilteredProductModal = function FilteredProductModal(props) {
466
468
  };
467
469
  return [4
468
470
  /*yield*/
469
- , (0, _commonUtil.commonFetch)(window.magicDesign.MBaseUrl + "/products", params, 'GET')];
471
+ , (0, _commonUtil.commonFetch)(window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
470
472
 
471
473
  case 1:
472
- res = _a.sent();
474
+ res = _a.sent(); // const res = await commonFetch(`${window.magicDesign.MBaseUrl}/products`, params, 'GET');
475
+
473
476
  setLoading(false);
474
477
  paginationParams.total = res.total;
475
478
 
@@ -19,8 +19,6 @@ var _coreUtil = require("../../../../../utils/coreUtil");
19
19
 
20
20
  var _AlignSelector = require("../../../../../common/AlignSelector");
21
21
 
22
- var _commonUtil = require("../../../../../utils/commonUtil");
23
-
24
22
  var _components = require("../../../../../meta-comp/components");
25
23
 
26
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -90,18 +88,18 @@ function (_super) {
90
88
  if (nextIndex != -1 && nextIndex != _this.state.carouseIndex) {
91
89
  _this.carouselRef.current.goTo(nextIndex);
92
90
  }
93
- };
91
+ }; // padding用统一设置
94
92
 
95
- _this.getPaddingAndBackground = function (item) {
96
- var spacing = _this.props.data.spacing; // const { spacing, background } = data;
97
93
 
98
- var device = window.magicDesign.device;
94
+ _this.getBackgroundStyle = function (item) {
95
+ // const { data: { spacing } } = this.props;
96
+ // const { spacing, background } = data;
97
+ // const { device } = window.magicDesign;
99
98
  var wrapStyle = {}; // 边距
100
-
101
- if (spacing && spacing[device]) {
102
- wrapStyle = __assign(__assign({}, wrapStyle), spacing[device]);
103
- } // 背景
104
-
99
+ // if (spacing && spacing[device]) {
100
+ // wrapStyle = { ...wrapStyle, ...spacing[device] };
101
+ // }
102
+ // 背景
105
103
 
106
104
  if (item.background) {
107
105
  if (item.background.bgType === 'color') {
@@ -171,12 +169,7 @@ function (_super) {
171
169
  }
172
170
 
173
171
  return /*#__PURE__*/_react["default"].createElement("div", {
174
- className: "m-banner-mobile",
175
- style: {
176
- marginBottom: (0, _commonUtil.ensure)(function () {
177
- return data.spacing.mobile.marginBottom;
178
- }, 0)
179
- }
172
+ className: "m-banner-mobile"
180
173
  }, /*#__PURE__*/_react["default"].createElement(_antd.Carousel, {
181
174
  ref: this.carouselRef,
182
175
  afterChange: function afterChange(n) {
@@ -191,7 +184,7 @@ function (_super) {
191
184
  return /*#__PURE__*/_react["default"].createElement("div", {
192
185
  key: item.id
193
186
  }, /*#__PURE__*/_react["default"].createElement("div", {
194
- style: _this.getPaddingAndBackground(item)
187
+ style: _this.getBackgroundStyle(item)
195
188
  }, /*#__PURE__*/_react["default"].createElement("div", {
196
189
  className: "carouselItem",
197
190
  onMouseEnter: _this.mouseEnterWrap,
@@ -132,18 +132,18 @@ function (_super) {
132
132
  if ((_b = data.setting.navigation) === null || _b === void 0 ? void 0 : _b.size) {
133
133
  e.target.style.fontSize = data.setting.navigation.size;
134
134
  }
135
- };
135
+ }; // padding用统一设置
136
136
 
137
- _this.getPaddingAndBackground = function (item) {
138
- var spacing = _this.props.data.spacing; // const { spacing, background } = data;
139
137
 
140
- var device = window.magicDesign.device;
138
+ _this.getBackgroundStyle = function (item) {
139
+ // const { data: { spacing } } = this.props;
140
+ // const { spacing, background } = data;
141
+ // const { device } = window.magicDesign;
141
142
  var wrapStyle = {}; // 边距
142
-
143
- if (spacing && spacing[device]) {
144
- wrapStyle = __assign(__assign({}, wrapStyle), spacing[device]);
145
- } // 背景
146
-
143
+ // if (spacing && spacing[device]) {
144
+ // wrapStyle = { ...wrapStyle, ...spacing[device] };
145
+ // }
146
+ // 背景
147
147
 
148
148
  if (item.background) {
149
149
  if (item.background.bgType === 'color') {
@@ -229,7 +229,7 @@ function (_super) {
229
229
  return /*#__PURE__*/_react["default"].createElement("div", {
230
230
  key: item.id
231
231
  }, /*#__PURE__*/_react["default"].createElement("div", {
232
- style: _this.getPaddingAndBackground(item)
232
+ style: _this.getBackgroundStyle(item)
233
233
  }, /*#__PURE__*/_react["default"].createElement("div", {
234
234
  className: "carouselItem",
235
235
  onMouseEnter: _this.mouseEnterWrap,
@@ -45,9 +45,11 @@
45
45
  width: fit-content;
46
46
  display: flex;
47
47
  .card-first-btn {
48
+ cursor: pointer;
48
49
  margin-right: 12px;
49
50
  }
50
51
  .card-second-btn {
52
+ cursor: pointer;
51
53
  margin-top: 0;
52
54
  }
53
55
  }
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -17,6 +15,8 @@ var _components = require("../../../../meta-comp/components");
17
15
 
18
16
  var _Text = require("../../../../meta-comp/components/Text");
19
17
 
18
+ var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
19
+
20
20
  require("./index.less");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -25,6 +25,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
 
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
28
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
29
+
28
30
  var __extends = void 0 && (void 0).__extends || function () {
29
31
  var _extendStatics = function extendStatics(d, b) {
30
32
  _extendStatics = Object.setPrototypeOf || {
@@ -67,6 +69,16 @@ var __assign = void 0 && (void 0).__assign || function () {
67
69
  return __assign.apply(this, arguments);
68
70
  };
69
71
 
72
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
73
+ var c = arguments.length,
74
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
75
+ d;
76
+ if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
77
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
78
+ }
79
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
80
+ };
81
+
70
82
  var Newsletter =
71
83
  /** @class */
72
84
  function (_super) {
@@ -115,6 +127,7 @@ function (_super) {
115
127
 
116
128
  Newsletter.type = 'NEWSLETTER';
117
129
  Newsletter.getDefaultJSON = _defaultJSON.getDefaultJSON;
130
+ Newsletter = __decorate([_compositeDecorator["default"]], Newsletter);
118
131
  return Newsletter;
119
132
  }(_react.Component);
120
133
 
@@ -63,7 +63,8 @@ function (_super) {
63
63
  var _a = this.props,
64
64
  data = _a.data,
65
65
  configCompSpace = _a.configCompSpace,
66
- configWidth = _a.configWidth;
66
+ configWidth = _a.configWidth,
67
+ fillUpWidth = _a.fillUpWidth;
67
68
  var obj = data[window.magicDesign.device] || {};
68
69
  return /*#__PURE__*/_react["default"].createElement("div", {
69
70
  className: "spacing-config-container"
@@ -80,6 +81,17 @@ function (_super) {
80
81
  value: {
81
82
  count: obj.contentWidth
82
83
  }
84
+ })), fillUpWidth && window.magicDesign.device === 'pc' && /*#__PURE__*/_react["default"].createElement(_common.Field, {
85
+ layout: "horizontal",
86
+ title: "Fill the page"
87
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Checkbox, {
88
+ checked: obj.fillUp,
89
+ onChange: function onChange(e) {
90
+ console.log('ddd fill up', e.target.checked);
91
+ obj.fillUp = e.target.checked;
92
+
93
+ _this.selfRender();
94
+ }
83
95
  })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
84
96
  title: (0, _locale.i18n)('PADDING')
85
97
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -147,6 +159,7 @@ function (_super) {
147
159
  SpacingConfig.defaultProps = {
148
160
  configCompSpace: true,
149
161
  configWidth: false,
162
+ fillUpWidth: false,
150
163
  data: {
151
164
  pc: {
152
165
  paddingTop: 0,
@@ -336,8 +336,6 @@ function (_super) {
336
336
  };
337
337
 
338
338
  _this.getListArr = function (pre, arr, index) {
339
- console.log('---getListArr', pre, arr);
340
-
341
339
  if (arr) {
342
340
  pre[index] = arr.map(function (item) {
343
341
  return __assign(__assign({}, item), {
@@ -58,7 +58,8 @@ var getDefaultJSON = function getDefaultJSON() {
58
58
  pc: {
59
59
  paddingTop: 20,
60
60
  paddingBottom: 30,
61
- marginBottom: 0
61
+ marginBottom: 0,
62
+ fillUp: false
62
63
  },
63
64
  mobile: {
64
65
  paddingTop: 8,
@@ -74,7 +74,8 @@ function (_super) {
74
74
  name: (0, _locale.i18n)('SPACING'),
75
75
  value: /*#__PURE__*/_react["default"].createElement(_SpacingConfig["default"], {
76
76
  configCompSpace: true,
77
- data: data.spacing
77
+ data: data.spacing,
78
+ fillUpWidth: true
78
79
  })
79
80
  }, {
80
81
  key: 'searchBar2',
@@ -73,6 +73,10 @@ function PageCompList(_a) {
73
73
  clickedFloor = _d[0],
74
74
  setClickedFloor = _d[1];
75
75
 
76
+ var _e = (0, _react.useState)(''),
77
+ hoveredFloor = _e[0],
78
+ setHoveredFloor = _e[1];
79
+
76
80
  var ref = (0, _react.useRef)();
77
81
  (0, _react.useEffect)(function () {
78
82
  setComponents(pageData || []);
@@ -80,6 +84,7 @@ function PageCompList(_a) {
80
84
  (0, _react.useEffect)(function () {
81
85
  var distroy = (0, _mobx.autorun)(function () {
82
86
  setClickedFloor(_mobx.store.clickedFloor);
87
+ setHoveredFloor(_mobx.store.hoveredFloor);
83
88
  });
84
89
  return distroy;
85
90
  }, []);
@@ -104,6 +109,7 @@ function PageCompList(_a) {
104
109
  };
105
110
 
106
111
  var onDragEnter = function onDragEnter(e) {
112
+ console.log('drag enter');
107
113
  var hoverNodeId = e.currentTarget.dataset.nodeid;
108
114
 
109
115
  if (dragId === hoverNodeId) {
@@ -196,8 +202,28 @@ function PageCompList(_a) {
196
202
  value: "4"
197
203
  }, (0, _locale.i18n)('DELETE')));
198
204
 
205
+ var onMouseEnter = function onMouseEnter() {
206
+ if (window.magicDesign.mode === 'renderer') {
207
+ return;
208
+ }
209
+
210
+ _mobx.store.setState({
211
+ hoveredFloor: comp.id
212
+ });
213
+ };
214
+
215
+ var onMouseLeave = function onMouseLeave() {
216
+ if (window.magicDesign.mode === 'renderer') {
217
+ return;
218
+ }
219
+
220
+ _mobx.store.setState({
221
+ hoveredFloor: ''
222
+ });
223
+ };
224
+
199
225
  var dragging = dragId === String(comp.id);
200
- var active = clickedFloor === String(comp.id);
226
+ var active = [hoveredFloor, clickedFloor].includes(comp.id);
201
227
  return /*#__PURE__*/_react["default"].createElement("div", {
202
228
  key: "card" + comp.id,
203
229
  className: (0, _classnames["default"])('card-wrap', {
@@ -212,6 +238,8 @@ function PageCompList(_a) {
212
238
  e.preventDefault();
213
239
  },
214
240
  onDragStart: onDragStart,
241
+ onMouseEnter: onMouseEnter,
242
+ onMouseLeave: onMouseLeave,
215
243
  style: {
216
244
  opacity: dragging ? '0.4' : '1'
217
245
  }
@@ -88,7 +88,9 @@ function (_super) {
88
88
 
89
89
  if (code === _constants.quickMenuCode.SAVE || code === _constants.quickMenuCode.PUBLISH) {
90
90
  _mobx.store.setState({
91
- clickedFloor: ''
91
+ clickedFloor: '',
92
+ clickedGroup: '',
93
+ clickedMeta: ''
92
94
  });
93
95
  }
94
96
 
@@ -146,6 +146,7 @@ function (_super) {
146
146
  renderHeader = _a.renderHeader,
147
147
  pageData = _a.pageData,
148
148
  appointmentDate = _a.appointmentDate;
149
+ var pageBackground = window.magicDesign.pageBackground;
149
150
  return /*#__PURE__*/_react["default"].createElement("div", {
150
151
  className: (0, _classnames["default"])('design-area-wrap', {
151
152
  'phone-edit': this.isPhoneEdit()
@@ -162,10 +163,8 @@ function (_super) {
162
163
  }, /*#__PURE__*/_react["default"].createElement("div", {
163
164
  className: "device_border",
164
165
  style: {
165
- background: window.magicDesign.pageBackground
166
+ background: pageBackground
166
167
  }
167
- }, /*#__PURE__*/_react["default"].createElement("div", {
168
- className: "device_content"
169
168
  }, this.filterCompFloor(pageData).map(function (nodeData) {
170
169
  var Clazz = _componentTypes.componentMap[nodeData.type];
171
170
 
@@ -181,7 +180,7 @@ function (_super) {
181
180
  key: nodeData.id,
182
181
  id: "view" + nodeData.id
183
182
  }, /*#__PURE__*/_react["default"].createElement(Clazz, __assign({}, newInstanceProps), null));
184
- })))));
183
+ }))));
185
184
  };
186
185
 
187
186
  return ViewArea;