@fonixtree/magic-design 0.1.68 → 0.1.69

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.
@@ -49,22 +49,6 @@ var __extends = void 0 && (void 0).__extends || function () {
49
49
  };
50
50
  }();
51
51
 
52
- var __assign = void 0 && (void 0).__assign || function () {
53
- __assign = Object.assign || function (t) {
54
- for (var s, i = 1, n = arguments.length; i < n; i++) {
55
- s = arguments[i];
56
-
57
- for (var p in s) {
58
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
59
- }
60
- }
61
-
62
- return t;
63
- };
64
-
65
- return __assign.apply(this, arguments);
66
- };
67
-
68
52
  var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
69
53
  var c = arguments.length,
70
54
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
@@ -82,33 +66,21 @@ function (_super) {
82
66
 
83
67
  function Banner() {
84
68
  return _super !== null && _super.apply(this, arguments) || this;
85
- }
69
+ } // componentWillMount() {
70
+ // // 兼容新功能: 轮播的 dots 点 区分pc 移动
71
+ // const { nodeData } = this.props;
72
+ // if (!nodeData.setting.dots.color.pc || !nodeData.setting.dots.hoverColor.pc || !nodeData.setting.dots.size.pc) {
73
+ // nodeData.setting.dots = { ...nodeData.setting.dots,
74
+ // ...{
75
+ // color: { pc: '#fff', mobile: '#fff' },
76
+ // hoverColor: { pc: '#fff', mobile: '#fff' },
77
+ // size: { pc: 16, mobile: 8 },
78
+ // hoverSize: { pc: 16, mobile: 8 },
79
+ // },
80
+ // };
81
+ // }
82
+ // }
86
83
 
87
- Banner.prototype.componentWillMount = function () {
88
- // 兼容新功能: 轮播的 dots 点 区分pc 移动
89
- var nodeData = this.props.nodeData;
90
-
91
- if (!nodeData.setting.dots.color.pc || !nodeData.setting.dots.hoverColor.pc || !nodeData.setting.dots.size.pc) {
92
- nodeData.setting.dots = __assign(__assign({}, nodeData.setting.dots), {
93
- color: {
94
- pc: '#fff',
95
- mobile: '#fff'
96
- },
97
- hoverColor: {
98
- pc: '#fff',
99
- mobile: '#fff'
100
- },
101
- size: {
102
- pc: 16,
103
- mobile: 8
104
- },
105
- hoverSize: {
106
- pc: 16,
107
- mobile: 8
108
- }
109
- });
110
- }
111
- };
112
84
 
113
85
  Banner.prototype.render = function () {
114
86
  var nodeData = this.props.nodeData; // console.log('---banner', nodeData);
@@ -643,12 +643,19 @@ function (_super) {
643
643
  }
644
644
 
645
645
  Designer.prototype.componentDidMount = function () {
646
- var _this = this; // 复合组件点击事件
646
+ var _this = this;
647
+
648
+ var _a; // 复合组件点击事件
647
649
 
648
650
 
649
651
  window.document.addEventListener('component-click', this.componentClick); // 复合组件重新渲染事件
650
652
 
651
- window.document.addEventListener('render-view', this.reRenderViewArea);
653
+ window.document.addEventListener('render-view', this.reRenderViewArea); // 兼容 旧组件新增 新功能的问题(本地)
654
+
655
+ if ((_a = this.props.pageData) === null || _a === void 0 ? void 0 : _a.childNodes) {
656
+ (0, _commonUtil.compatibleNewPageData)(this.props.pageData);
657
+ }
658
+
652
659
  this.destory = (0, _mobx.autorun)(function () {
653
660
  var stateObj = {
654
661
  imgGenVisible: _mobx.store.imgGenVisible
@@ -665,8 +672,7 @@ function (_super) {
665
672
  Designer.prototype.componentWillReceiveProps = function (nextProps) {
666
673
  var pageData = nextProps.pageData,
667
674
  config = nextProps.config;
668
- var MPageData = pageData.childNodes || [];
669
- console.log('componentWillReceiveProps-- pageData', pageData);
675
+ var MPageData = pageData.childNodes || []; // 兼容 旧组件新增 新功能的问题(线上)
670
676
 
671
677
  if (pageData === null || pageData === void 0 ? void 0 : pageData.childNodes) {
672
678
  (0, _commonUtil.compatibleNewPageData)(pageData);
@@ -35,6 +35,22 @@ var _qs = _interopRequireDefault(require("qs"));
35
35
 
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
37
 
38
+ var __assign = void 0 && (void 0).__assign || function () {
39
+ __assign = Object.assign || function (t) {
40
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
41
+ s = arguments[i];
42
+
43
+ for (var p in s) {
44
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
45
+ }
46
+ }
47
+
48
+ return t;
49
+ };
50
+
51
+ return __assign.apply(this, arguments);
52
+ };
53
+
38
54
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
39
55
  function adopt(value) {
40
56
  return value instanceof P ? value : new P(function (resolve) {
@@ -781,9 +797,33 @@ exports.pxToRem = pxToRem;
781
797
  var compatibleNewPageData = function compatibleNewPageData(pageData) {
782
798
  if (pageData.childNodes && pageData.childNodes.length > 0) {
783
799
  pageData.childNodes.forEach(function (child) {
784
- // 兼容新开发的功能: video新增播放按钮 的设置
800
+ // 兼容新功能:banner 轮播的 dots 点 区分pc 移动
801
+ if (child.type === 'BANNER') {
802
+ if (!child.setting.dots.color.pc || !child.setting.dots.hoverColor.pc || !child.setting.dots.size.pc) {
803
+ child.setting.dots = __assign(__assign({}, child.setting.dots), {
804
+ color: {
805
+ pc: '#fff',
806
+ mobile: '#fff'
807
+ },
808
+ hoverColor: {
809
+ pc: '#fff',
810
+ mobile: '#fff'
811
+ },
812
+ size: {
813
+ pc: 16,
814
+ mobile: 8
815
+ },
816
+ hoverSize: {
817
+ pc: 16,
818
+ mobile: 8
819
+ }
820
+ });
821
+ }
822
+ } // 兼容新开发的功能: video新增播放按钮 的设置
823
+
824
+
785
825
  if (child.type === 'VIDEO') {
786
- console.log('--compatibleNewPageData -- video ');
826
+ // console.log('--compatibleNewPageData -- video ');
787
827
  child.groupSource.forEach(function (group) {
788
828
  if (!group.playIcon) {
789
829
  group.playIcon = {
@@ -797,8 +837,7 @@ var compatibleNewPageData = function compatibleNewPageData(pageData) {
797
837
  iconColor: 'Light'
798
838
  };
799
839
  }
800
- });
801
- console.log('--compatibleNewPageData -- video add group.playIcon ', child.groupSource);
840
+ }); // console.log('--compatibleNewPageData -- video add group.playIcon ', child.groupSource);
802
841
  }
803
842
  });
804
843
  }
@@ -49,22 +49,6 @@ var __extends = void 0 && (void 0).__extends || function () {
49
49
  };
50
50
  }();
51
51
 
52
- var __assign = void 0 && (void 0).__assign || function () {
53
- __assign = Object.assign || function (t) {
54
- for (var s, i = 1, n = arguments.length; i < n; i++) {
55
- s = arguments[i];
56
-
57
- for (var p in s) {
58
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
59
- }
60
- }
61
-
62
- return t;
63
- };
64
-
65
- return __assign.apply(this, arguments);
66
- };
67
-
68
52
  var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
69
53
  var c = arguments.length,
70
54
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
@@ -82,33 +66,21 @@ function (_super) {
82
66
 
83
67
  function Banner() {
84
68
  return _super !== null && _super.apply(this, arguments) || this;
85
- }
69
+ } // componentWillMount() {
70
+ // // 兼容新功能: 轮播的 dots 点 区分pc 移动
71
+ // const { nodeData } = this.props;
72
+ // if (!nodeData.setting.dots.color.pc || !nodeData.setting.dots.hoverColor.pc || !nodeData.setting.dots.size.pc) {
73
+ // nodeData.setting.dots = { ...nodeData.setting.dots,
74
+ // ...{
75
+ // color: { pc: '#fff', mobile: '#fff' },
76
+ // hoverColor: { pc: '#fff', mobile: '#fff' },
77
+ // size: { pc: 16, mobile: 8 },
78
+ // hoverSize: { pc: 16, mobile: 8 },
79
+ // },
80
+ // };
81
+ // }
82
+ // }
86
83
 
87
- Banner.prototype.componentWillMount = function () {
88
- // 兼容新功能: 轮播的 dots 点 区分pc 移动
89
- var nodeData = this.props.nodeData;
90
-
91
- if (!nodeData.setting.dots.color.pc || !nodeData.setting.dots.hoverColor.pc || !nodeData.setting.dots.size.pc) {
92
- nodeData.setting.dots = __assign(__assign({}, nodeData.setting.dots), {
93
- color: {
94
- pc: '#fff',
95
- mobile: '#fff'
96
- },
97
- hoverColor: {
98
- pc: '#fff',
99
- mobile: '#fff'
100
- },
101
- size: {
102
- pc: 16,
103
- mobile: 8
104
- },
105
- hoverSize: {
106
- pc: 16,
107
- mobile: 8
108
- }
109
- });
110
- }
111
- };
112
84
 
113
85
  Banner.prototype.render = function () {
114
86
  var nodeData = this.props.nodeData; // console.log('---banner', nodeData);
@@ -643,12 +643,19 @@ function (_super) {
643
643
  }
644
644
 
645
645
  Designer.prototype.componentDidMount = function () {
646
- var _this = this; // 复合组件点击事件
646
+ var _this = this;
647
+
648
+ var _a; // 复合组件点击事件
647
649
 
648
650
 
649
651
  window.document.addEventListener('component-click', this.componentClick); // 复合组件重新渲染事件
650
652
 
651
- window.document.addEventListener('render-view', this.reRenderViewArea);
653
+ window.document.addEventListener('render-view', this.reRenderViewArea); // 兼容 旧组件新增 新功能的问题(本地)
654
+
655
+ if ((_a = this.props.pageData) === null || _a === void 0 ? void 0 : _a.childNodes) {
656
+ (0, _commonUtil.compatibleNewPageData)(this.props.pageData);
657
+ }
658
+
652
659
  this.destory = (0, _mobx.autorun)(function () {
653
660
  var stateObj = {
654
661
  imgGenVisible: _mobx.store.imgGenVisible
@@ -665,8 +672,7 @@ function (_super) {
665
672
  Designer.prototype.componentWillReceiveProps = function (nextProps) {
666
673
  var pageData = nextProps.pageData,
667
674
  config = nextProps.config;
668
- var MPageData = pageData.childNodes || [];
669
- console.log('componentWillReceiveProps-- pageData', pageData);
675
+ var MPageData = pageData.childNodes || []; // 兼容 旧组件新增 新功能的问题(线上)
670
676
 
671
677
  if (pageData === null || pageData === void 0 ? void 0 : pageData.childNodes) {
672
678
  (0, _commonUtil.compatibleNewPageData)(pageData);
@@ -35,6 +35,22 @@ var _qs = _interopRequireDefault(require("qs"));
35
35
 
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
37
 
38
+ var __assign = void 0 && (void 0).__assign || function () {
39
+ __assign = Object.assign || function (t) {
40
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
41
+ s = arguments[i];
42
+
43
+ for (var p in s) {
44
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
45
+ }
46
+ }
47
+
48
+ return t;
49
+ };
50
+
51
+ return __assign.apply(this, arguments);
52
+ };
53
+
38
54
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
39
55
  function adopt(value) {
40
56
  return value instanceof P ? value : new P(function (resolve) {
@@ -781,9 +797,33 @@ exports.pxToRem = pxToRem;
781
797
  var compatibleNewPageData = function compatibleNewPageData(pageData) {
782
798
  if (pageData.childNodes && pageData.childNodes.length > 0) {
783
799
  pageData.childNodes.forEach(function (child) {
784
- // 兼容新开发的功能: video新增播放按钮 的设置
800
+ // 兼容新功能:banner 轮播的 dots 点 区分pc 移动
801
+ if (child.type === 'BANNER') {
802
+ if (!child.setting.dots.color.pc || !child.setting.dots.hoverColor.pc || !child.setting.dots.size.pc) {
803
+ child.setting.dots = __assign(__assign({}, child.setting.dots), {
804
+ color: {
805
+ pc: '#fff',
806
+ mobile: '#fff'
807
+ },
808
+ hoverColor: {
809
+ pc: '#fff',
810
+ mobile: '#fff'
811
+ },
812
+ size: {
813
+ pc: 16,
814
+ mobile: 8
815
+ },
816
+ hoverSize: {
817
+ pc: 16,
818
+ mobile: 8
819
+ }
820
+ });
821
+ }
822
+ } // 兼容新开发的功能: video新增播放按钮 的设置
823
+
824
+
785
825
  if (child.type === 'VIDEO') {
786
- console.log('--compatibleNewPageData -- video ');
826
+ // console.log('--compatibleNewPageData -- video ');
787
827
  child.groupSource.forEach(function (group) {
788
828
  if (!group.playIcon) {
789
829
  group.playIcon = {
@@ -797,8 +837,7 @@ var compatibleNewPageData = function compatibleNewPageData(pageData) {
797
837
  iconColor: 'Light'
798
838
  };
799
839
  }
800
- });
801
- console.log('--compatibleNewPageData -- video add group.playIcon ', child.groupSource);
840
+ }); // console.log('--compatibleNewPageData -- video add group.playIcon ', child.groupSource);
802
841
  }
803
842
  });
804
843
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.1.68",
4
+ "version": "0.1.69",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",