@fonixtree/magic-design 0.1.68 → 0.1.70
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/es/composite-comp/bol/components/Banner/index.js +14 -42
- package/es/core/Designer/index.js +10 -4
- package/es/locale/en/en.json +2 -0
- package/es/locale/es/es.json +2 -0
- package/es/locale/id/id.json +2 -0
- package/es/meta-comp/config-panels/TextConfig/index.js +5 -1
- package/es/utils/commonUtil.js +43 -4
- package/lib/composite-comp/bol/components/Banner/index.js +14 -42
- package/lib/core/Designer/index.js +10 -4
- package/lib/locale/en/en.json +2 -0
- package/lib/locale/es/es.json +2 -0
- package/lib/locale/id/id.json +2 -0
- package/lib/meta-comp/config-panels/TextConfig/index.js +5 -1
- package/lib/utils/commonUtil.js +43 -4
- package/package.json +1 -1
|
@@ -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);
|
package/es/locale/en/en.json
CHANGED
package/es/locale/es/es.json
CHANGED
package/es/locale/id/id.json
CHANGED
|
@@ -241,8 +241,12 @@ function (_super) {
|
|
|
241
241
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
242
242
|
value: 400
|
|
243
243
|
}, (0, _locale.i18n)('REGULAR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
244
|
+
value: 500
|
|
245
|
+
}, (0, _locale.i18n)('MEDIUM')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
244
246
|
value: 600
|
|
245
|
-
}, (0, _locale.i18n)('
|
|
247
|
+
}, (0, _locale.i18n)('SEMIBOLD')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
248
|
+
value: 700
|
|
249
|
+
}, (0, _locale.i18n)('BOLD')))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
246
250
|
title: (0, _locale.i18n)('FONT_SIZE')
|
|
247
251
|
}, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
|
|
248
252
|
onChange: function onChange(_a) {
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -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
|
-
//
|
|
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);
|
package/lib/locale/en/en.json
CHANGED
package/lib/locale/es/es.json
CHANGED
package/lib/locale/id/id.json
CHANGED
|
@@ -241,8 +241,12 @@ function (_super) {
|
|
|
241
241
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
242
242
|
value: 400
|
|
243
243
|
}, (0, _locale.i18n)('REGULAR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
244
|
+
value: 500
|
|
245
|
+
}, (0, _locale.i18n)('MEDIUM')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
244
246
|
value: 600
|
|
245
|
-
}, (0, _locale.i18n)('
|
|
247
|
+
}, (0, _locale.i18n)('SEMIBOLD')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
248
|
+
value: 700
|
|
249
|
+
}, (0, _locale.i18n)('BOLD')))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
246
250
|
title: (0, _locale.i18n)('FONT_SIZE')
|
|
247
251
|
}, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
|
|
248
252
|
onChange: function onChange(_a) {
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -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
|
-
//
|
|
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
|
}
|