@fonixtree/magic-design 0.0.151 → 0.0.153

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.
@@ -25,20 +25,21 @@ function CommonModal(_a) {
25
25
  cancelText = _a.cancelText,
26
26
  confirmLoading = _a.confirmLoading;
27
27
  var modalCommonProps = {
28
- title: "Modal",
28
+ title: 'Modal',
29
29
  visible: visible,
30
30
  width: _const.size.NORMAL,
31
31
  wrapClassName: 'modal-container',
32
32
  centered: true,
33
33
  maskClosable: false,
34
34
  destroyOnClose: true,
35
- okText: okText || "Confirm",
36
- cancelText: cancelText || "Cancel"
35
+ okText: okText || 'Confirm',
36
+ cancelText: cancelText || 'Cancel'
37
37
  };
38
+ console.log('CommonModal render');
38
39
  return /*#__PURE__*/_react["default"].createElement(_antd.Modal, _extends({}, modalCommonProps, modalOpts, {
39
- onOk: onOk,
40
+ confirmLoading: confirmLoading,
40
41
  onCancel: onCancel,
41
- confirmLoading: confirmLoading
42
+ onOk: onOk
42
43
  }), children);
43
44
  }
44
45
 
@@ -439,7 +439,7 @@ function ImageModal(_a) {
439
439
 
440
440
  return [4
441
441
  /*yield*/
442
- , (0, _commonUtil.commonFetch)(window.magicDesign.MBaseUrl + "/pages/platforminfo")];
442
+ , (0, _commonUtil.commonFetch)(window.magicDesign.MBaseUrl + "/operation/v1/pages/platforminfo")];
443
443
 
444
444
  case 1:
445
445
  wapUrl_1 = _a.sent().wapUrl;
@@ -189,7 +189,7 @@ var LinkModal = function LinkModal(props) {
189
189
  linkUrl = _a[0],
190
190
  setLinkUrl = _a[1];
191
191
 
192
- var _b = (0, _react.useState)('Category'),
192
+ var _b = (0, _react.useState)(''),
193
193
  selected = _b[0],
194
194
  setSelected = _b[1]; // const list = ['Category', 'Customized Page', 'Product Details Page', 'Filtered Products', 'Function Page', 'Coupons', 'Bundle Campaign', 'Video'];
195
195
 
@@ -58,7 +58,7 @@ var getDefaultJSON = function getDefaultJSON() {
58
58
  pc: {
59
59
  paddingTop: 20,
60
60
  paddingBottom: 30,
61
- marginBottom: 0,
61
+ marginBottom: window.magicDesign.compSpacing * 1.5,
62
62
  fillUp: false
63
63
  },
64
64
  mobile: {
@@ -66,7 +66,7 @@ var getDefaultJSON = function getDefaultJSON() {
66
66
  paddingBottom: 8,
67
67
  paddingLeft: 15,
68
68
  paddingRight: 15,
69
- marginBottom: 0
69
+ marginBottom: window.magicDesign.compSpacing
70
70
  }
71
71
  },
72
72
  customize: {
@@ -100,7 +100,7 @@ function (_super) {
100
100
  return /*#__PURE__*/_react["default"].createElement("div", {
101
101
  className: (0, _classnames["default"])('list_panel')
102
102
  }, /*#__PURE__*/_react["default"].createElement("header", {
103
- className: "header"
103
+ className: "header-designer"
104
104
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
105
105
  icon: "icon-close",
106
106
  onClick: this.onClose,
@@ -9,7 +9,7 @@
9
9
  transition: all .3s ease;
10
10
  z-index: 200;
11
11
 
12
- .header {
12
+ .header-designer {
13
13
  height: 80px;
14
14
  display: flex;
15
15
  padding: 16px 24px;
@@ -58,8 +58,9 @@ function (_super) {
58
58
  _this.setState({
59
59
  renderProps: renderProps
60
60
  }, function () {
61
+ document.querySelector('#render-html-wrap > div').style = 'max-width:800px';
61
62
  var html = document.querySelector('#render-html-wrap').innerHTML;
62
- resolve(html.replace(/url\("((\S|\s)*)"\)/g, 'url($1)'));
63
+ resolve(html.replace(/url\("((\S|\s)*)"\)/g, 'url($1)'));
63
64
 
64
65
  _this.setState({
65
66
  renderProps: null
@@ -279,6 +279,7 @@ function (_super) {
279
279
  var _this = _super.call(this, props) || this;
280
280
 
281
281
  _this.renderHtmlRef = /*#__PURE__*/_react["default"].createRef();
282
+ _this.ready = false;
282
283
 
283
284
  _this.closeCompList = function () {
284
285
  if (_this.compListRef.current.open) {
@@ -623,6 +624,10 @@ function (_super) {
623
624
  setDesignConfig(__assign(__assign({}, config), {
624
625
  outputType: outputType
625
626
  }));
627
+ _this.ready = true;
628
+
629
+ _this.setState({});
630
+
626
631
  return _this;
627
632
  }
628
633
 
@@ -680,6 +685,7 @@ function (_super) {
680
685
  Designer.prototype.render = function () {
681
686
  var _this = this;
682
687
 
688
+ if (!this.ready) return null;
683
689
  var _a = this.state,
684
690
  MPageData = _a.MPageData,
685
691
  device = _a.device,
@@ -92,7 +92,7 @@ var Renderer = function Renderer(props) {
92
92
  magic_design: "",
93
93
  style: {
94
94
  background: pageBackground,
95
- overflow: 'aotu'
95
+ overflow: 'auto'
96
96
  }
97
97
  }, filterCompFloor().map(function (nodeData) {
98
98
  var Clazz = _componentTypes.componentMap[nodeData.type];
@@ -25,20 +25,21 @@ function CommonModal(_a) {
25
25
  cancelText = _a.cancelText,
26
26
  confirmLoading = _a.confirmLoading;
27
27
  var modalCommonProps = {
28
- title: "Modal",
28
+ title: 'Modal',
29
29
  visible: visible,
30
30
  width: _const.size.NORMAL,
31
31
  wrapClassName: 'modal-container',
32
32
  centered: true,
33
33
  maskClosable: false,
34
34
  destroyOnClose: true,
35
- okText: okText || "Confirm",
36
- cancelText: cancelText || "Cancel"
35
+ okText: okText || 'Confirm',
36
+ cancelText: cancelText || 'Cancel'
37
37
  };
38
+ console.log('CommonModal render');
38
39
  return /*#__PURE__*/_react["default"].createElement(_antd.Modal, _extends({}, modalCommonProps, modalOpts, {
39
- onOk: onOk,
40
+ confirmLoading: confirmLoading,
40
41
  onCancel: onCancel,
41
- confirmLoading: confirmLoading
42
+ onOk: onOk
42
43
  }), children);
43
44
  }
44
45
 
@@ -439,7 +439,7 @@ function ImageModal(_a) {
439
439
 
440
440
  return [4
441
441
  /*yield*/
442
- , (0, _commonUtil.commonFetch)(window.magicDesign.MBaseUrl + "/pages/platforminfo")];
442
+ , (0, _commonUtil.commonFetch)(window.magicDesign.MBaseUrl + "/operation/v1/pages/platforminfo")];
443
443
 
444
444
  case 1:
445
445
  wapUrl_1 = _a.sent().wapUrl;
@@ -189,7 +189,7 @@ var LinkModal = function LinkModal(props) {
189
189
  linkUrl = _a[0],
190
190
  setLinkUrl = _a[1];
191
191
 
192
- var _b = (0, _react.useState)('Category'),
192
+ var _b = (0, _react.useState)(''),
193
193
  selected = _b[0],
194
194
  setSelected = _b[1]; // const list = ['Category', 'Customized Page', 'Product Details Page', 'Filtered Products', 'Function Page', 'Coupons', 'Bundle Campaign', 'Video'];
195
195
 
@@ -58,7 +58,7 @@ var getDefaultJSON = function getDefaultJSON() {
58
58
  pc: {
59
59
  paddingTop: 20,
60
60
  paddingBottom: 30,
61
- marginBottom: 0,
61
+ marginBottom: window.magicDesign.compSpacing * 1.5,
62
62
  fillUp: false
63
63
  },
64
64
  mobile: {
@@ -66,7 +66,7 @@ var getDefaultJSON = function getDefaultJSON() {
66
66
  paddingBottom: 8,
67
67
  paddingLeft: 15,
68
68
  paddingRight: 15,
69
- marginBottom: 0
69
+ marginBottom: window.magicDesign.compSpacing
70
70
  }
71
71
  },
72
72
  customize: {
@@ -100,7 +100,7 @@ function (_super) {
100
100
  return /*#__PURE__*/_react["default"].createElement("div", {
101
101
  className: (0, _classnames["default"])('list_panel')
102
102
  }, /*#__PURE__*/_react["default"].createElement("header", {
103
- className: "header"
103
+ className: "header-designer"
104
104
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
105
105
  icon: "icon-close",
106
106
  onClick: this.onClose,
@@ -9,7 +9,7 @@
9
9
  transition: all .3s ease;
10
10
  z-index: 200;
11
11
 
12
- .header {
12
+ .header-designer {
13
13
  height: 80px;
14
14
  display: flex;
15
15
  padding: 16px 24px;
@@ -58,8 +58,9 @@ function (_super) {
58
58
  _this.setState({
59
59
  renderProps: renderProps
60
60
  }, function () {
61
+ document.querySelector('#render-html-wrap > div').style = 'max-width:800px';
61
62
  var html = document.querySelector('#render-html-wrap').innerHTML;
62
- resolve(html.replace(/url\("((\S|\s)*)"\)/g, 'url($1)'));
63
+ resolve(html.replace(/url\("((\S|\s)*)"\)/g, 'url($1)'));
63
64
 
64
65
  _this.setState({
65
66
  renderProps: null
@@ -279,6 +279,7 @@ function (_super) {
279
279
  var _this = _super.call(this, props) || this;
280
280
 
281
281
  _this.renderHtmlRef = /*#__PURE__*/_react["default"].createRef();
282
+ _this.ready = false;
282
283
 
283
284
  _this.closeCompList = function () {
284
285
  if (_this.compListRef.current.open) {
@@ -623,6 +624,10 @@ function (_super) {
623
624
  setDesignConfig(__assign(__assign({}, config), {
624
625
  outputType: outputType
625
626
  }));
627
+ _this.ready = true;
628
+
629
+ _this.setState({});
630
+
626
631
  return _this;
627
632
  }
628
633
 
@@ -680,6 +685,7 @@ function (_super) {
680
685
  Designer.prototype.render = function () {
681
686
  var _this = this;
682
687
 
688
+ if (!this.ready) return null;
683
689
  var _a = this.state,
684
690
  MPageData = _a.MPageData,
685
691
  device = _a.device,
@@ -92,7 +92,7 @@ var Renderer = function Renderer(props) {
92
92
  magic_design: "",
93
93
  style: {
94
94
  background: pageBackground,
95
- overflow: 'aotu'
95
+ overflow: 'auto'
96
96
  }
97
97
  }, filterCompFloor().map(function (nodeData) {
98
98
  var Clazz = _componentTypes.componentMap[nodeData.type];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.0.151",
4
+ "version": "0.0.153",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
@@ -35,8 +35,7 @@
35
35
  "react-slick": "^0.29.0",
36
36
  "replace": "^1.2.1",
37
37
  "shortid": "^2.2.16",
38
- "slick-carousel": "^1.8.1",
39
- "styled-components": "^5.3.9"
38
+ "slick-carousel": "^1.8.1"
40
39
  },
41
40
  "peerDependencies": {
42
41
  "react": ">=16.11.0",