@fonixtree/magic-design 0.1.63 → 0.1.65

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.
@@ -71,15 +71,17 @@ function (_super) {
71
71
  }
72
72
 
73
73
  Video.prototype.componentWillMount = function () {
74
- // 兼容新开发的功能: video新增播放按钮 的设置
74
+ console.log('--video WillMount'); // 兼容新开发的功能: video新增播放按钮 的设置
75
+
75
76
  var nodeData = this.props.nodeData;
76
77
 
77
78
  if (nodeData.groupSource && nodeData.groupSource.length > 0) {
78
79
  nodeData.groupSource.forEach(function (group) {
79
80
  if (!group.playIcon) {
81
+ console.log('--video add group.playIcon ');
80
82
  group.playIcon = {
81
83
  open: true,
82
- parentId: nodeData.id,
84
+ parentId: group.id,
83
85
  id: (0, _uuid.v4)(),
84
86
  type: 'PLAY',
85
87
  size: 48,
@@ -615,6 +615,7 @@ function (_super) {
615
615
  config = props.config,
616
616
  outputType = props.outputType,
617
617
  locale = props.locale;
618
+ (0, _commonUtil.compatibleNewPageData)(pageData);
618
619
  var MPageData = pageData.childNodes || [];
619
620
  _this.configRef = /*#__PURE__*/_react["default"].createRef(); // this.viewAreaRef = React.createRef();
620
621
 
@@ -7,6 +7,7 @@ exports.addZero = exports.addUrlQuery = void 0;
7
7
  exports.asyncDataURLtoImage = asyncDataURLtoImage;
8
8
  exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
9
9
  exports.commonFetch = commonFetch;
10
+ exports.compatibleNewPageData = void 0;
10
11
  exports.convertImageUrl = convertImageUrl;
11
12
  exports.convertToRem = void 0;
12
13
  exports.copy2ClipBoard = copy2ClipBoard;
@@ -28,6 +29,8 @@ var _axios = _interopRequireDefault(require("axios"));
28
29
 
29
30
  var _lodash = require("lodash");
30
31
 
32
+ var _uuid = require("uuid");
33
+
31
34
  var _qs = _interopRequireDefault(require("qs"));
32
35
 
33
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -767,5 +770,36 @@ var pxToRem = function pxToRem(styleObj) {
767
770
 
768
771
  return remObj;
769
772
  };
773
+ /**
774
+ * 处理新老数据兼容问题
775
+ * @param pageData 大JSON
776
+ */
777
+
778
+
779
+ exports.pxToRem = pxToRem;
780
+
781
+ var compatibleNewPageData = function compatibleNewPageData(pageData) {
782
+ pageData.childNodes.forEach(function (child) {
783
+ // 兼容新开发的功能: video新增播放按钮 的设置
784
+ if (child.type === 'VIDEO') {
785
+ console.log('--compatibleNewPageData -- video ');
786
+ child.groupSource.forEach(function (group) {
787
+ if (!group.playIcon) {
788
+ console.log('--compatibleNewPageData -- video add group.playIcon ');
789
+ group.playIcon = {
790
+ open: true,
791
+ parentId: group.id,
792
+ id: (0, _uuid.v4)(),
793
+ type: 'PLAY',
794
+ size: 48,
795
+ pcSize: 60,
796
+ iconType: 'light-playicon-01',
797
+ iconColor: 'Light'
798
+ };
799
+ }
800
+ });
801
+ }
802
+ });
803
+ };
770
804
 
771
- exports.pxToRem = pxToRem;
805
+ exports.compatibleNewPageData = compatibleNewPageData;
@@ -71,15 +71,17 @@ function (_super) {
71
71
  }
72
72
 
73
73
  Video.prototype.componentWillMount = function () {
74
- // 兼容新开发的功能: video新增播放按钮 的设置
74
+ console.log('--video WillMount'); // 兼容新开发的功能: video新增播放按钮 的设置
75
+
75
76
  var nodeData = this.props.nodeData;
76
77
 
77
78
  if (nodeData.groupSource && nodeData.groupSource.length > 0) {
78
79
  nodeData.groupSource.forEach(function (group) {
79
80
  if (!group.playIcon) {
81
+ console.log('--video add group.playIcon ');
80
82
  group.playIcon = {
81
83
  open: true,
82
- parentId: nodeData.id,
84
+ parentId: group.id,
83
85
  id: (0, _uuid.v4)(),
84
86
  type: 'PLAY',
85
87
  size: 48,
@@ -615,6 +615,7 @@ function (_super) {
615
615
  config = props.config,
616
616
  outputType = props.outputType,
617
617
  locale = props.locale;
618
+ (0, _commonUtil.compatibleNewPageData)(pageData);
618
619
  var MPageData = pageData.childNodes || [];
619
620
  _this.configRef = /*#__PURE__*/_react["default"].createRef(); // this.viewAreaRef = React.createRef();
620
621
 
@@ -7,6 +7,7 @@ exports.addZero = exports.addUrlQuery = void 0;
7
7
  exports.asyncDataURLtoImage = asyncDataURLtoImage;
8
8
  exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
9
9
  exports.commonFetch = commonFetch;
10
+ exports.compatibleNewPageData = void 0;
10
11
  exports.convertImageUrl = convertImageUrl;
11
12
  exports.convertToRem = void 0;
12
13
  exports.copy2ClipBoard = copy2ClipBoard;
@@ -28,6 +29,8 @@ var _axios = _interopRequireDefault(require("axios"));
28
29
 
29
30
  var _lodash = require("lodash");
30
31
 
32
+ var _uuid = require("uuid");
33
+
31
34
  var _qs = _interopRequireDefault(require("qs"));
32
35
 
33
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -767,5 +770,36 @@ var pxToRem = function pxToRem(styleObj) {
767
770
 
768
771
  return remObj;
769
772
  };
773
+ /**
774
+ * 处理新老数据兼容问题
775
+ * @param pageData 大JSON
776
+ */
777
+
778
+
779
+ exports.pxToRem = pxToRem;
780
+
781
+ var compatibleNewPageData = function compatibleNewPageData(pageData) {
782
+ pageData.childNodes.forEach(function (child) {
783
+ // 兼容新开发的功能: video新增播放按钮 的设置
784
+ if (child.type === 'VIDEO') {
785
+ console.log('--compatibleNewPageData -- video ');
786
+ child.groupSource.forEach(function (group) {
787
+ if (!group.playIcon) {
788
+ console.log('--compatibleNewPageData -- video add group.playIcon ');
789
+ group.playIcon = {
790
+ open: true,
791
+ parentId: group.id,
792
+ id: (0, _uuid.v4)(),
793
+ type: 'PLAY',
794
+ size: 48,
795
+ pcSize: 60,
796
+ iconType: 'light-playicon-01',
797
+ iconColor: 'Light'
798
+ };
799
+ }
800
+ });
801
+ }
802
+ });
803
+ };
770
804
 
771
- exports.pxToRem = pxToRem;
805
+ exports.compatibleNewPageData = compatibleNewPageData;
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.63",
4
+ "version": "0.1.65",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",