@fonixtree/magic-design 2.0.89 → 2.0.90

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.
@@ -234,7 +234,7 @@ var LinkModal = function LinkModal(props) {
234
234
 
235
235
  var getLinkTypes = function getLinkTypes() {
236
236
  return __awaiter(void 0, void 0, void 0, function () {
237
- var types, type;
237
+ var types, type_1;
238
238
  return __generator(this, function (_a) {
239
239
  switch (_a.label) {
240
240
  case 0:
@@ -248,12 +248,15 @@ var LinkModal = function LinkModal(props) {
248
248
  types = _a.sent();
249
249
 
250
250
  if (onlySpecificCode) {
251
- type = types.filter(function (item) {
252
- return item.linkTypeCode === onlySpecificCode;
251
+ type_1 = [];
252
+ onlySpecificCode.forEach(function (code) {
253
+ type_1.push(types.find(function (item) {
254
+ return item.linkTypeCode === code;
255
+ }));
253
256
  });
254
257
 
255
- if (type.length > 0) {
256
- types = type;
258
+ if (type_1.length > 0) {
259
+ types = type_1;
257
260
  }
258
261
  }
259
262
 
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needHover: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needClickArea: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -55,11 +55,14 @@ function shouldUpdate() {
55
55
  descriptor.value = function (nextProps, nextState) {
56
56
  var nowPropsJson = JSON.stringify(nextProps);
57
57
  var nowStateJson = JSON.stringify(nextState);
58
+ var nowDevice = window.magicDesign.device;
58
59
  var should1 = nowPropsJson != this.preProps;
59
60
  var should2 = nowStateJson != this.preState;
61
+ var should3 = nowDevice != this.preDevice;
60
62
  this.preProps = nowPropsJson;
61
63
  this.preState = nowStateJson;
62
- var result = should1 || should2;
64
+ this.preDevice = nowDevice;
65
+ var result = should1 || should2 || should3;
63
66
  return result && fn.apply(this, {
64
67
  nextProps: nextProps
65
68
  });
@@ -234,7 +234,7 @@ var LinkModal = function LinkModal(props) {
234
234
 
235
235
  var getLinkTypes = function getLinkTypes() {
236
236
  return __awaiter(void 0, void 0, void 0, function () {
237
- var types, type;
237
+ var types, type_1;
238
238
  return __generator(this, function (_a) {
239
239
  switch (_a.label) {
240
240
  case 0:
@@ -248,12 +248,15 @@ var LinkModal = function LinkModal(props) {
248
248
  types = _a.sent();
249
249
 
250
250
  if (onlySpecificCode) {
251
- type = types.filter(function (item) {
252
- return item.linkTypeCode === onlySpecificCode;
251
+ type_1 = [];
252
+ onlySpecificCode.forEach(function (code) {
253
+ type_1.push(types.find(function (item) {
254
+ return item.linkTypeCode === code;
255
+ }));
253
256
  });
254
257
 
255
- if (type.length > 0) {
256
- types = type;
258
+ if (type_1.length > 0) {
259
+ types = type_1;
257
260
  }
258
261
  }
259
262
 
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needHover: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -71,7 +71,7 @@ function (_super) {
71
71
  value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
72
72
  data: panelProps.image,
73
73
  needClickArea: false,
74
- onlySpecificCode: "FunctionPage"
74
+ onlySpecificCode: ['CustomizedPage', 'FunctionPage']
75
75
  }),
76
76
  metaOption: panelProps.image
77
77
  }];
@@ -55,11 +55,14 @@ function shouldUpdate() {
55
55
  descriptor.value = function (nextProps, nextState) {
56
56
  var nowPropsJson = JSON.stringify(nextProps);
57
57
  var nowStateJson = JSON.stringify(nextState);
58
+ var nowDevice = window.magicDesign.device;
58
59
  var should1 = nowPropsJson != this.preProps;
59
60
  var should2 = nowStateJson != this.preState;
61
+ var should3 = nowDevice != this.preDevice;
60
62
  this.preProps = nowPropsJson;
61
63
  this.preState = nowStateJson;
62
- var result = should1 || should2;
64
+ this.preDevice = nowDevice;
65
+ var result = should1 || should2 || should3;
63
66
  return result && fn.apply(this, {
64
67
  nextProps: nextProps
65
68
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.89",
4
+ "version": "2.0.90",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",