@fonixtree/magic-design 0.0.178 → 0.0.180

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.
@@ -57,36 +57,34 @@ var textGroupSourceJSON = function textGroupSourceJSON(parentId) {
57
57
  return {
58
58
  id: groupId,
59
59
  parentId: parentId,
60
- content: {
61
- title: __assign(__assign({
62
- parentId: groupId,
63
- id: (0, _uuid.v4)()
64
- }, getDefaultMetaTextJson()), {
65
- text: 'Group Name',
66
- content: {
67
- sizeType: 'Customize font styles',
68
- fontFamily: 'Open Sans',
69
- fontWeight: 600,
70
- fontSize: 22,
71
- pcFontSize: 22,
72
- color: '#232F46'
73
- }
74
- }),
75
- text: __assign(__assign({
76
- parentId: groupId,
77
- id: (0, _uuid.v4)()
78
- }, getDefaultMetaTextJson()), {
79
- text: 'For the text area, you can enter a subtitle or description, the default width is the same as title.',
80
- content: {
81
- sizeType: 'Body 1',
82
- fontFamily: 'Open Sans',
83
- fontWeight: 400,
84
- fontSize: 18,
85
- pcFontSize: 18,
86
- color: '#232F46'
87
- }
88
- })
89
- }
60
+ title: __assign(__assign({
61
+ parentId: groupId,
62
+ id: (0, _uuid.v4)()
63
+ }, getDefaultMetaTextJson()), {
64
+ text: 'Group Name',
65
+ content: {
66
+ sizeType: 'Customize font styles',
67
+ fontFamily: 'Open Sans',
68
+ fontWeight: 600,
69
+ fontSize: 22,
70
+ pcFontSize: 22,
71
+ color: '#232F46'
72
+ }
73
+ }),
74
+ text: __assign(__assign({
75
+ parentId: groupId,
76
+ id: (0, _uuid.v4)()
77
+ }, getDefaultMetaTextJson()), {
78
+ text: 'For the text area, you can enter a subtitle or description, the default width is the same as title.',
79
+ content: {
80
+ sizeType: 'Body 1',
81
+ fontFamily: 'Open Sans',
82
+ fontWeight: 400,
83
+ fontSize: 18,
84
+ pcFontSize: 18,
85
+ color: '#232F46'
86
+ }
87
+ })
90
88
  };
91
89
  };
92
90
 
@@ -103,16 +103,16 @@ function (_super) {
103
103
  style: {
104
104
  textAlign: nodeData.customize.align
105
105
  }
106
- }, group.content.title.open && /*#__PURE__*/_react["default"].createElement("div", {
106
+ }, group.title.open && /*#__PURE__*/_react["default"].createElement("div", {
107
107
  className: "group-title"
108
108
  }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
109
- data: group.content.title,
109
+ data: group.title,
110
110
  mode: mode,
111
111
  outputType: outputType
112
- })), group.content.text.open && /*#__PURE__*/_react["default"].createElement("div", {
112
+ })), group.text.open && /*#__PURE__*/_react["default"].createElement("div", {
113
113
  className: "group-content"
114
114
  }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
115
- data: group.content.text,
115
+ data: group.text,
116
116
  mode: mode,
117
117
  outputType: outputType
118
118
  }))));
@@ -106,7 +106,7 @@ function (_super) {
106
106
  className: "card_wrap"
107
107
  }, /*#__PURE__*/_react["default"].createElement("div", {
108
108
  className: "name"
109
- }, src.content.title.text));
109
+ }, src.title.text));
110
110
  };
111
111
 
112
112
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -76,7 +76,7 @@ function (_super) {
76
76
  name: (0, _locale.i18n)('CONTENT'),
77
77
  value: /*#__PURE__*/_react["default"].createElement(_TextContentConfigContent["default"], {
78
78
  outputType: outputType,
79
- source: panelProps.content
79
+ source: panelProps
80
80
  })
81
81
  }],
82
82
  type: "triangle"
@@ -266,7 +266,7 @@ function (_super) {
266
266
  break;
267
267
 
268
268
  case 'TEXT':
269
- groupName = panelProps.content.title.text;
269
+ groupName = panelProps.title.text;
270
270
  break;
271
271
 
272
272
  case 'RECOMMEND':
@@ -78,6 +78,7 @@ function (_super) {
78
78
  return /*#__PURE__*/_react["default"].createElement("div", {
79
79
  id: "render-html-wrap"
80
80
  }, /*#__PURE__*/_react["default"].createElement(_Renderer["default"], _extends({}, renderProps, {
81
+ noSetWindow: true,
81
82
  outputType: "html"
82
83
  })));
83
84
  };
@@ -59,9 +59,13 @@ var setDesignConfig = function setDesignConfig(props) {
59
59
 
60
60
  var Renderer = function Renderer(props) {
61
61
  var pageData = props.pageData,
62
- outputType = props.outputType; // console.log('pageData: ', pageData);
62
+ outputType = props.outputType,
63
+ noSetWindow = props.noSetWindow; // console.log('pageData: ', pageData);
64
+
65
+ if (!noSetWindow) {
66
+ setDesignConfig(props);
67
+ }
63
68
 
64
- setDesignConfig(props);
65
69
  window.magicDesignPageData = pageData;
66
70
  var pageBackground = window.magicDesign.pageBackground; // 根据楼层展示设备进行过滤
67
71
 
@@ -367,7 +367,7 @@ var copyNode = function copyNode(value, parentId) {
367
367
  if (name === 'parentId') {
368
368
  newNode.parentId = parentId;
369
369
  } else {
370
- newNode[name] = copyNode(value[name], newNode.id);
370
+ newNode[name] = copyNode(value[name], newNode.id || parentId);
371
371
  }
372
372
  });
373
373
  return newNode;
@@ -57,36 +57,34 @@ var textGroupSourceJSON = function textGroupSourceJSON(parentId) {
57
57
  return {
58
58
  id: groupId,
59
59
  parentId: parentId,
60
- content: {
61
- title: __assign(__assign({
62
- parentId: groupId,
63
- id: (0, _uuid.v4)()
64
- }, getDefaultMetaTextJson()), {
65
- text: 'Group Name',
66
- content: {
67
- sizeType: 'Customize font styles',
68
- fontFamily: 'Open Sans',
69
- fontWeight: 600,
70
- fontSize: 22,
71
- pcFontSize: 22,
72
- color: '#232F46'
73
- }
74
- }),
75
- text: __assign(__assign({
76
- parentId: groupId,
77
- id: (0, _uuid.v4)()
78
- }, getDefaultMetaTextJson()), {
79
- text: 'For the text area, you can enter a subtitle or description, the default width is the same as title.',
80
- content: {
81
- sizeType: 'Body 1',
82
- fontFamily: 'Open Sans',
83
- fontWeight: 400,
84
- fontSize: 18,
85
- pcFontSize: 18,
86
- color: '#232F46'
87
- }
88
- })
89
- }
60
+ title: __assign(__assign({
61
+ parentId: groupId,
62
+ id: (0, _uuid.v4)()
63
+ }, getDefaultMetaTextJson()), {
64
+ text: 'Group Name',
65
+ content: {
66
+ sizeType: 'Customize font styles',
67
+ fontFamily: 'Open Sans',
68
+ fontWeight: 600,
69
+ fontSize: 22,
70
+ pcFontSize: 22,
71
+ color: '#232F46'
72
+ }
73
+ }),
74
+ text: __assign(__assign({
75
+ parentId: groupId,
76
+ id: (0, _uuid.v4)()
77
+ }, getDefaultMetaTextJson()), {
78
+ text: 'For the text area, you can enter a subtitle or description, the default width is the same as title.',
79
+ content: {
80
+ sizeType: 'Body 1',
81
+ fontFamily: 'Open Sans',
82
+ fontWeight: 400,
83
+ fontSize: 18,
84
+ pcFontSize: 18,
85
+ color: '#232F46'
86
+ }
87
+ })
90
88
  };
91
89
  };
92
90
 
@@ -103,16 +103,16 @@ function (_super) {
103
103
  style: {
104
104
  textAlign: nodeData.customize.align
105
105
  }
106
- }, group.content.title.open && /*#__PURE__*/_react["default"].createElement("div", {
106
+ }, group.title.open && /*#__PURE__*/_react["default"].createElement("div", {
107
107
  className: "group-title"
108
108
  }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
109
- data: group.content.title,
109
+ data: group.title,
110
110
  mode: mode,
111
111
  outputType: outputType
112
- })), group.content.text.open && /*#__PURE__*/_react["default"].createElement("div", {
112
+ })), group.text.open && /*#__PURE__*/_react["default"].createElement("div", {
113
113
  className: "group-content"
114
114
  }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
115
- data: group.content.text,
115
+ data: group.text,
116
116
  mode: mode,
117
117
  outputType: outputType
118
118
  }))));
@@ -106,7 +106,7 @@ function (_super) {
106
106
  className: "card_wrap"
107
107
  }, /*#__PURE__*/_react["default"].createElement("div", {
108
108
  className: "name"
109
- }, src.content.title.text));
109
+ }, src.title.text));
110
110
  };
111
111
 
112
112
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -76,7 +76,7 @@ function (_super) {
76
76
  name: (0, _locale.i18n)('CONTENT'),
77
77
  value: /*#__PURE__*/_react["default"].createElement(_TextContentConfigContent["default"], {
78
78
  outputType: outputType,
79
- source: panelProps.content
79
+ source: panelProps
80
80
  })
81
81
  }],
82
82
  type: "triangle"
@@ -266,7 +266,7 @@ function (_super) {
266
266
  break;
267
267
 
268
268
  case 'TEXT':
269
- groupName = panelProps.content.title.text;
269
+ groupName = panelProps.title.text;
270
270
  break;
271
271
 
272
272
  case 'RECOMMEND':
@@ -78,6 +78,7 @@ function (_super) {
78
78
  return /*#__PURE__*/_react["default"].createElement("div", {
79
79
  id: "render-html-wrap"
80
80
  }, /*#__PURE__*/_react["default"].createElement(_Renderer["default"], _extends({}, renderProps, {
81
+ noSetWindow: true,
81
82
  outputType: "html"
82
83
  })));
83
84
  };
@@ -59,9 +59,13 @@ var setDesignConfig = function setDesignConfig(props) {
59
59
 
60
60
  var Renderer = function Renderer(props) {
61
61
  var pageData = props.pageData,
62
- outputType = props.outputType; // console.log('pageData: ', pageData);
62
+ outputType = props.outputType,
63
+ noSetWindow = props.noSetWindow; // console.log('pageData: ', pageData);
64
+
65
+ if (!noSetWindow) {
66
+ setDesignConfig(props);
67
+ }
63
68
 
64
- setDesignConfig(props);
65
69
  window.magicDesignPageData = pageData;
66
70
  var pageBackground = window.magicDesign.pageBackground; // 根据楼层展示设备进行过滤
67
71
 
@@ -367,7 +367,7 @@ var copyNode = function copyNode(value, parentId) {
367
367
  if (name === 'parentId') {
368
368
  newNode.parentId = parentId;
369
369
  } else {
370
- newNode[name] = copyNode(value[name], newNode.id);
370
+ newNode[name] = copyNode(value[name], newNode.id || parentId);
371
371
  }
372
372
  });
373
373
  return newNode;
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.178",
4
+ "version": "0.0.180",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",