@fonixtree/magic-design 0.0.186 → 0.0.187

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.
@@ -23,6 +23,8 @@ var _locale = require("../../../../../locale");
23
23
 
24
24
  var _decorator = require("../../../../../decorator");
25
25
 
26
+ var _defaultImg = _interopRequireDefault(require("../../../../../common/GroupList/defaultImg.png"));
27
+
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
29
 
28
30
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
@@ -95,10 +97,31 @@ function (_super) {
95
97
  _this.setState({});
96
98
  };
97
99
 
100
+ _this.renderCard = function (src) {
101
+ var name = '';
102
+
103
+ if ((0, _coreUtil.isPc)()) {
104
+ name = src.image.content.pcImgSrc ? src.image.content.pcName : (0, _locale.i18n)('BANNER_GROUP_NAME');
105
+ } else {
106
+ name = src.image.content.h5ImgSrc ? src.image.content.h5Name : (0, _locale.i18n)('BANNER_GROUP_NAME');
107
+ }
108
+
109
+ return /*#__PURE__*/_react["default"].createElement("div", {
110
+ className: "card_wrap"
111
+ }, /*#__PURE__*/_react["default"].createElement("img", {
112
+ alt: "",
113
+ src: ((0, _coreUtil.isPc)() ? src.image.content.pcImgSrc : src.image.content.h5ImgSrc) || _defaultImg["default"]
114
+ }), /*#__PURE__*/_react["default"].createElement("div", {
115
+ className: "name"
116
+ }, name));
117
+ };
118
+
98
119
  return _this;
99
120
  }
100
121
 
101
122
  AComponent.prototype.render = function () {
123
+ var _this = this;
124
+
102
125
  var source = this.props.source;
103
126
  return /*#__PURE__*/_react["default"].createElement("div", {
104
127
  className: "banner_group"
@@ -108,6 +131,9 @@ function (_super) {
108
131
  className: "notice"
109
132
  }, notice) : /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
110
133
  onClickItem: this.onClickItem,
134
+ renderCard: function renderCard(v) {
135
+ return _this.renderCard(v);
136
+ },
111
137
  reRender: this.reRender,
112
138
  source: source
113
139
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -21,6 +21,8 @@ var _locale = require("../../../../../locale");
21
21
 
22
22
  var _decorator = require("../../../../../decorator");
23
23
 
24
+ var _defaultImg = _interopRequireDefault(require("../../../../../common/GroupList/defaultImg.png"));
25
+
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
27
 
26
28
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
@@ -95,10 +97,23 @@ function (_super) {
95
97
  _this.setState({});
96
98
  };
97
99
 
100
+ _this.renderCard = function (src) {
101
+ return /*#__PURE__*/_react["default"].createElement("div", {
102
+ className: "card_wrap"
103
+ }, /*#__PURE__*/_react["default"].createElement("img", {
104
+ alt: "",
105
+ src: ((0, _coreUtil.isPc)() ? src.image.content.pcImgSrc : src.image.content.h5ImgSrc) || _defaultImg["default"]
106
+ }), /*#__PURE__*/_react["default"].createElement("div", {
107
+ className: "name"
108
+ }, src.title.open ? src.title.text : (0, _locale.i18n)('IMAGE_AND_TEXT_NAME')));
109
+ };
110
+
98
111
  return _this;
99
112
  }
100
113
 
101
114
  ImageTextConfigGroup.prototype.render = function () {
115
+ var _this = this;
116
+
102
117
  var source = this.props.source;
103
118
  return /*#__PURE__*/_react["default"].createElement("div", {
104
119
  className: "banner_group"
@@ -108,6 +123,9 @@ function (_super) {
108
123
  className: "notice"
109
124
  }, notice) : /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
110
125
  onClickItem: this.onClickItem,
126
+ renderCard: function renderCard(v) {
127
+ return _this.renderCard(v);
128
+ },
111
129
  reRender: this.reRender,
112
130
  source: source
113
131
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -7,12 +7,6 @@ exports.getDefaultJSON = void 0;
7
7
 
8
8
  var _uuid = require("uuid");
9
9
 
10
- var _xtLogo = _interopRequireDefault(require("./imgs/xt-logo.png"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
- // import { ButtonMetaType } from '../../../meta-comp/config-panels/ButtonConfig';
15
- // import { TextMetaType } from '../../../meta-comp/config-panels/TextConfig';
16
10
  var getDefaultJSON = function getDefaultJSON() {
17
11
  return {
18
12
  id: (0, _uuid.v4)(),
@@ -25,8 +19,8 @@ var getDefaultJSON = function getDefaultJSON() {
25
19
  content: {
26
20
  h5Name: 'name2',
27
21
  pcName: 'name2',
28
- h5ImgSrc: _xtLogo["default"],
29
- pcImgSrc: _xtLogo["default"],
22
+ h5ImgSrc: '',
23
+ pcImgSrc: '',
30
24
  clickUrl: ''
31
25
  },
32
26
  hover: {
@@ -219,7 +219,7 @@ function (_super) {
219
219
  };
220
220
 
221
221
  _this.getSecondConfigName = function () {
222
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
222
+ var _a, _b, _c, _d;
223
223
 
224
224
  var selectedNode = _this.state.selectedNode;
225
225
 
@@ -244,16 +244,20 @@ function (_super) {
244
244
  case 'IMAGE_GALLERY':
245
245
  case 'WALLET':
246
246
  case 'BANNER':
247
- groupName = (_a = panelProps.title) === null || _a === void 0 ? void 0 : _a.text;
248
-
249
- if (!groupName) {
250
- groupName = (0, _coreUtil.isPc)() ? (_c = (_b = panelProps.image) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.pcName : (_e = (_d = panelProps.image) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.h5Name;
247
+ groupName = ''; // if (!groupName) {
248
+ // groupName = isPc() ? panelProps.image?.content?.pcName : panelProps.image?.content?.h5Name;
249
+ // }
250
+
251
+ if ((0, _coreUtil.isPc)()) {
252
+ groupName = panelProps.image.content.pcImgSrc ? panelProps.image.content.pcName : (0, _locale.i18n)('BANNER_GROUP_NAME');
253
+ } else {
254
+ groupName = panelProps.image.content.h5ImgSrc ? panelProps.image.content.h5Name : (0, _locale.i18n)('BANNER_GROUP_NAME');
251
255
  }
252
256
 
253
257
  break;
254
258
 
255
259
  case 'CAROUSEL':
256
- groupName = (0, _coreUtil.isPc)() ? (_g = (_f = panelProps.image) === null || _f === void 0 ? void 0 : _f.content) === null || _g === void 0 ? void 0 : _g.pcName : (_j = (_h = panelProps.image) === null || _h === void 0 ? void 0 : _h.content) === null || _j === void 0 ? void 0 : _j.h5Name;
260
+ groupName = (0, _coreUtil.isPc)() ? (_b = (_a = panelProps.image) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.pcName : (_d = (_c = panelProps.image) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.h5Name;
257
261
  break;
258
262
 
259
263
  case 'MOBILE_NAVIGATION':
@@ -262,7 +266,7 @@ function (_super) {
262
266
  break;
263
267
 
264
268
  case 'IMAGE_TEXT':
265
- groupName = panelProps.title.text;
269
+ groupName = panelProps.title.open ? panelProps.title.text : (0, _locale.i18n)('IMAGE_AND_TEXT_NAME');
266
270
  break;
267
271
 
268
272
  case 'TEXT':
@@ -1,4 +1,6 @@
1
1
  {
2
+ "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
+ "BANNER_GROUP_NAME": "Banner Group Name",
2
4
  "VIDEO": "Video",
3
5
  "BACK": "Back",
4
6
  "VIDEO_HEIGHT": "Video Height",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
+ "BANNER_GROUP_NAME": "Banner Group Name",
2
4
  "VIDEO": "Video",
3
5
  "BACK": "Back",
4
6
  "VIDEO_HEIGHT": "Video Height",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
+ "BANNER_GROUP_NAME": "Banner Group Name",
2
4
  "VIDEO": "Video",
3
5
  "BACK": "Back",
4
6
  "VIDEO_HEIGHT": "Video Height",
@@ -23,6 +23,8 @@ var _locale = require("../../../../../locale");
23
23
 
24
24
  var _decorator = require("../../../../../decorator");
25
25
 
26
+ var _defaultImg = _interopRequireDefault(require("../../../../../common/GroupList/defaultImg.png"));
27
+
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
29
 
28
30
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
@@ -95,10 +97,31 @@ function (_super) {
95
97
  _this.setState({});
96
98
  };
97
99
 
100
+ _this.renderCard = function (src) {
101
+ var name = '';
102
+
103
+ if ((0, _coreUtil.isPc)()) {
104
+ name = src.image.content.pcImgSrc ? src.image.content.pcName : (0, _locale.i18n)('BANNER_GROUP_NAME');
105
+ } else {
106
+ name = src.image.content.h5ImgSrc ? src.image.content.h5Name : (0, _locale.i18n)('BANNER_GROUP_NAME');
107
+ }
108
+
109
+ return /*#__PURE__*/_react["default"].createElement("div", {
110
+ className: "card_wrap"
111
+ }, /*#__PURE__*/_react["default"].createElement("img", {
112
+ alt: "",
113
+ src: ((0, _coreUtil.isPc)() ? src.image.content.pcImgSrc : src.image.content.h5ImgSrc) || _defaultImg["default"]
114
+ }), /*#__PURE__*/_react["default"].createElement("div", {
115
+ className: "name"
116
+ }, name));
117
+ };
118
+
98
119
  return _this;
99
120
  }
100
121
 
101
122
  AComponent.prototype.render = function () {
123
+ var _this = this;
124
+
102
125
  var source = this.props.source;
103
126
  return /*#__PURE__*/_react["default"].createElement("div", {
104
127
  className: "banner_group"
@@ -108,6 +131,9 @@ function (_super) {
108
131
  className: "notice"
109
132
  }, notice) : /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
110
133
  onClickItem: this.onClickItem,
134
+ renderCard: function renderCard(v) {
135
+ return _this.renderCard(v);
136
+ },
111
137
  reRender: this.reRender,
112
138
  source: source
113
139
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -21,6 +21,8 @@ var _locale = require("../../../../../locale");
21
21
 
22
22
  var _decorator = require("../../../../../decorator");
23
23
 
24
+ var _defaultImg = _interopRequireDefault(require("../../../../../common/GroupList/defaultImg.png"));
25
+
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
27
 
26
28
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
@@ -95,10 +97,23 @@ function (_super) {
95
97
  _this.setState({});
96
98
  };
97
99
 
100
+ _this.renderCard = function (src) {
101
+ return /*#__PURE__*/_react["default"].createElement("div", {
102
+ className: "card_wrap"
103
+ }, /*#__PURE__*/_react["default"].createElement("img", {
104
+ alt: "",
105
+ src: ((0, _coreUtil.isPc)() ? src.image.content.pcImgSrc : src.image.content.h5ImgSrc) || _defaultImg["default"]
106
+ }), /*#__PURE__*/_react["default"].createElement("div", {
107
+ className: "name"
108
+ }, src.title.open ? src.title.text : (0, _locale.i18n)('IMAGE_AND_TEXT_NAME')));
109
+ };
110
+
98
111
  return _this;
99
112
  }
100
113
 
101
114
  ImageTextConfigGroup.prototype.render = function () {
115
+ var _this = this;
116
+
102
117
  var source = this.props.source;
103
118
  return /*#__PURE__*/_react["default"].createElement("div", {
104
119
  className: "banner_group"
@@ -108,6 +123,9 @@ function (_super) {
108
123
  className: "notice"
109
124
  }, notice) : /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
110
125
  onClickItem: this.onClickItem,
126
+ renderCard: function renderCard(v) {
127
+ return _this.renderCard(v);
128
+ },
111
129
  reRender: this.reRender,
112
130
  source: source
113
131
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -7,12 +7,6 @@ exports.getDefaultJSON = void 0;
7
7
 
8
8
  var _uuid = require("uuid");
9
9
 
10
- var _xtLogo = _interopRequireDefault(require("./imgs/xt-logo.png"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
- // import { ButtonMetaType } from '../../../meta-comp/config-panels/ButtonConfig';
15
- // import { TextMetaType } from '../../../meta-comp/config-panels/TextConfig';
16
10
  var getDefaultJSON = function getDefaultJSON() {
17
11
  return {
18
12
  id: (0, _uuid.v4)(),
@@ -25,8 +19,8 @@ var getDefaultJSON = function getDefaultJSON() {
25
19
  content: {
26
20
  h5Name: 'name2',
27
21
  pcName: 'name2',
28
- h5ImgSrc: _xtLogo["default"],
29
- pcImgSrc: _xtLogo["default"],
22
+ h5ImgSrc: '',
23
+ pcImgSrc: '',
30
24
  clickUrl: ''
31
25
  },
32
26
  hover: {
@@ -219,7 +219,7 @@ function (_super) {
219
219
  };
220
220
 
221
221
  _this.getSecondConfigName = function () {
222
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
222
+ var _a, _b, _c, _d;
223
223
 
224
224
  var selectedNode = _this.state.selectedNode;
225
225
 
@@ -244,16 +244,20 @@ function (_super) {
244
244
  case 'IMAGE_GALLERY':
245
245
  case 'WALLET':
246
246
  case 'BANNER':
247
- groupName = (_a = panelProps.title) === null || _a === void 0 ? void 0 : _a.text;
248
-
249
- if (!groupName) {
250
- groupName = (0, _coreUtil.isPc)() ? (_c = (_b = panelProps.image) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.pcName : (_e = (_d = panelProps.image) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.h5Name;
247
+ groupName = ''; // if (!groupName) {
248
+ // groupName = isPc() ? panelProps.image?.content?.pcName : panelProps.image?.content?.h5Name;
249
+ // }
250
+
251
+ if ((0, _coreUtil.isPc)()) {
252
+ groupName = panelProps.image.content.pcImgSrc ? panelProps.image.content.pcName : (0, _locale.i18n)('BANNER_GROUP_NAME');
253
+ } else {
254
+ groupName = panelProps.image.content.h5ImgSrc ? panelProps.image.content.h5Name : (0, _locale.i18n)('BANNER_GROUP_NAME');
251
255
  }
252
256
 
253
257
  break;
254
258
 
255
259
  case 'CAROUSEL':
256
- groupName = (0, _coreUtil.isPc)() ? (_g = (_f = panelProps.image) === null || _f === void 0 ? void 0 : _f.content) === null || _g === void 0 ? void 0 : _g.pcName : (_j = (_h = panelProps.image) === null || _h === void 0 ? void 0 : _h.content) === null || _j === void 0 ? void 0 : _j.h5Name;
260
+ groupName = (0, _coreUtil.isPc)() ? (_b = (_a = panelProps.image) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.pcName : (_d = (_c = panelProps.image) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.h5Name;
257
261
  break;
258
262
 
259
263
  case 'MOBILE_NAVIGATION':
@@ -262,7 +266,7 @@ function (_super) {
262
266
  break;
263
267
 
264
268
  case 'IMAGE_TEXT':
265
- groupName = panelProps.title.text;
269
+ groupName = panelProps.title.open ? panelProps.title.text : (0, _locale.i18n)('IMAGE_AND_TEXT_NAME');
266
270
  break;
267
271
 
268
272
  case 'TEXT':
@@ -1,4 +1,6 @@
1
1
  {
2
+ "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
+ "BANNER_GROUP_NAME": "Banner Group Name",
2
4
  "VIDEO": "Video",
3
5
  "BACK": "Back",
4
6
  "VIDEO_HEIGHT": "Video Height",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
+ "BANNER_GROUP_NAME": "Banner Group Name",
2
4
  "VIDEO": "Video",
3
5
  "BACK": "Back",
4
6
  "VIDEO_HEIGHT": "Video Height",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
+ "BANNER_GROUP_NAME": "Banner Group Name",
2
4
  "VIDEO": "Video",
3
5
  "BACK": "Back",
4
6
  "VIDEO_HEIGHT": "Video Height",
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.186",
4
+ "version": "0.0.187",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",