@fonixtree/magic-design 0.0.170 → 0.0.171

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.
@@ -486,23 +486,17 @@ function (_super) {
486
486
  return _this;
487
487
  }
488
488
 
489
- RecommendMobile.prototype.componentDidMount = function () {
490
- var _this = this;
491
-
492
- var panelProps = this.props.panelProps;
493
- var source = [];
494
- panelProps.groupSource.map(function (m) {
495
- var show = m.image.open || m.groupName.open;
496
- if (show) source.push(m);
497
- });
498
- this.setState({
499
- groupSource: source
500
- }, function () {
501
- _this.initTab(0);
502
-
503
- _this.getProductList(0);
504
- });
505
- this.listenWidth();
489
+ RecommendMobile.prototype.componentDidMount = function () {// const { panelProps } = this.props;
490
+ // const source = [];
491
+ // panelProps.groupSource.map(m => {
492
+ // const show = m.image.open || m.groupName.open;
493
+ // if (show) source.push(m);
494
+ // });
495
+ // this.setState({ groupSource: source }, () => {
496
+ // this.initTab(0);
497
+ // this.getProductList(0);
498
+ // });
499
+ // this.listenWidth();
506
500
  };
507
501
 
508
502
  RecommendMobile.prototype.componentWillReceiveProps = function (nextProps) {
@@ -319,7 +319,8 @@ function (_super) {
319
319
  node.appendChild(closeNode);
320
320
  };
321
321
 
322
- _this.renderText = function (data, mode) {
322
+ _this.renderText = function (data) {
323
+ var mode = window.magicDesign.mode;
323
324
  var outputType = _this.props.outputType || window.magicDesign.outputType;
324
325
  if (!_this.textRef.current) return;
325
326
 
@@ -437,14 +438,14 @@ function (_super) {
437
438
  Text.prototype.componentDidMount = function () {
438
439
  var _this = this;
439
440
 
440
- this.renderText(this.props.data, this.props.mode);
441
+ this.renderText(this.props.data);
441
442
  initSelectionEvent();
442
443
  appendSelectionTarget({
443
444
  target: this.textRef.current,
444
445
  data: this.props.data,
445
446
  selectionRefMap: this.selectionRefMap,
446
447
  refresh: function refresh() {
447
- _this.renderText(_this.props.data, _this.props.mode);
448
+ _this.renderText(_this.props.data);
448
449
  }
449
450
  });
450
451
  };
@@ -456,7 +457,7 @@ function (_super) {
456
457
  var result = should1 || should2 || should3;
457
458
 
458
459
  if (result) {
459
- this.renderText(nextProps.data, this.props.mode);
460
+ this.renderText(nextProps.data);
460
461
  }
461
462
 
462
463
  return result;
@@ -473,8 +474,8 @@ function (_super) {
473
474
  data = _a.data,
474
475
  className = _a.className,
475
476
  readonly = _a.readonly,
476
- onTextInput = _a.onTextInput,
477
- mode = _a.mode;
477
+ onTextInput = _a.onTextInput;
478
+ var mode = window.magicDesign.mode;
478
479
  var style = contentStyle(data.content);
479
480
 
480
481
  if (data.underline) {
@@ -498,8 +499,6 @@ function (_super) {
498
499
  // textDecorationColor: data?.underline.textDecorationColor,
499
500
  // textDecorationStyle: data?.underline.textDecorationStyle,
500
501
  // };
501
- // mode == 'designer' && !readonly
502
- // console.log('!readonly: ', mode, readonly);
503
502
 
504
503
 
505
504
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -534,7 +533,6 @@ function (_super) {
534
533
 
535
534
  Text.defaultProps = {
536
535
  readonly: false,
537
- mode: 'designer',
538
536
  onTextInput: function onTextInput() {}
539
537
  };
540
538
  Text = __decorate([_decorator.metaDecorator], Text);
@@ -284,7 +284,7 @@ var navigateTo = function navigateTo(url) {
284
284
  if (url.startsWith('/')) {
285
285
  window.magicDesign.history.push(url);
286
286
  } else {
287
- window.location.href = link;
287
+ window.location.href = url;
288
288
  }
289
289
  };
290
290
 
@@ -289,16 +289,15 @@ var getCoupon = function getCoupon(couponId) {
289
289
  var clickUrl = function clickUrl(url) {
290
290
  console.log('clickUrl...', url);
291
291
 
292
+ if (window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
293
+ return;
294
+ }
295
+
292
296
  var _a = (0, _businessUtil.parseUrl)(url),
293
297
  link = _a.link,
294
298
  data = _a.data;
295
299
 
296
- var params = data.params;
297
-
298
- if (window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
299
- return;
300
- } // 如果是video 放开return
301
-
300
+ var params = data.params; // 如果是video 放开return
302
301
 
303
302
  if (params.type !== 'VIDEO' && window.magicDesign.readOnly) {
304
303
  return;
@@ -486,23 +486,17 @@ function (_super) {
486
486
  return _this;
487
487
  }
488
488
 
489
- RecommendMobile.prototype.componentDidMount = function () {
490
- var _this = this;
491
-
492
- var panelProps = this.props.panelProps;
493
- var source = [];
494
- panelProps.groupSource.map(function (m) {
495
- var show = m.image.open || m.groupName.open;
496
- if (show) source.push(m);
497
- });
498
- this.setState({
499
- groupSource: source
500
- }, function () {
501
- _this.initTab(0);
502
-
503
- _this.getProductList(0);
504
- });
505
- this.listenWidth();
489
+ RecommendMobile.prototype.componentDidMount = function () {// const { panelProps } = this.props;
490
+ // const source = [];
491
+ // panelProps.groupSource.map(m => {
492
+ // const show = m.image.open || m.groupName.open;
493
+ // if (show) source.push(m);
494
+ // });
495
+ // this.setState({ groupSource: source }, () => {
496
+ // this.initTab(0);
497
+ // this.getProductList(0);
498
+ // });
499
+ // this.listenWidth();
506
500
  };
507
501
 
508
502
  RecommendMobile.prototype.componentWillReceiveProps = function (nextProps) {
@@ -319,7 +319,8 @@ function (_super) {
319
319
  node.appendChild(closeNode);
320
320
  };
321
321
 
322
- _this.renderText = function (data, mode) {
322
+ _this.renderText = function (data) {
323
+ var mode = window.magicDesign.mode;
323
324
  var outputType = _this.props.outputType || window.magicDesign.outputType;
324
325
  if (!_this.textRef.current) return;
325
326
 
@@ -437,14 +438,14 @@ function (_super) {
437
438
  Text.prototype.componentDidMount = function () {
438
439
  var _this = this;
439
440
 
440
- this.renderText(this.props.data, this.props.mode);
441
+ this.renderText(this.props.data);
441
442
  initSelectionEvent();
442
443
  appendSelectionTarget({
443
444
  target: this.textRef.current,
444
445
  data: this.props.data,
445
446
  selectionRefMap: this.selectionRefMap,
446
447
  refresh: function refresh() {
447
- _this.renderText(_this.props.data, _this.props.mode);
448
+ _this.renderText(_this.props.data);
448
449
  }
449
450
  });
450
451
  };
@@ -456,7 +457,7 @@ function (_super) {
456
457
  var result = should1 || should2 || should3;
457
458
 
458
459
  if (result) {
459
- this.renderText(nextProps.data, this.props.mode);
460
+ this.renderText(nextProps.data);
460
461
  }
461
462
 
462
463
  return result;
@@ -473,8 +474,8 @@ function (_super) {
473
474
  data = _a.data,
474
475
  className = _a.className,
475
476
  readonly = _a.readonly,
476
- onTextInput = _a.onTextInput,
477
- mode = _a.mode;
477
+ onTextInput = _a.onTextInput;
478
+ var mode = window.magicDesign.mode;
478
479
  var style = contentStyle(data.content);
479
480
 
480
481
  if (data.underline) {
@@ -498,8 +499,6 @@ function (_super) {
498
499
  // textDecorationColor: data?.underline.textDecorationColor,
499
500
  // textDecorationStyle: data?.underline.textDecorationStyle,
500
501
  // };
501
- // mode == 'designer' && !readonly
502
- // console.log('!readonly: ', mode, readonly);
503
502
 
504
503
 
505
504
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -534,7 +533,6 @@ function (_super) {
534
533
 
535
534
  Text.defaultProps = {
536
535
  readonly: false,
537
- mode: 'designer',
538
536
  onTextInput: function onTextInput() {}
539
537
  };
540
538
  Text = __decorate([_decorator.metaDecorator], Text);
@@ -284,7 +284,7 @@ var navigateTo = function navigateTo(url) {
284
284
  if (url.startsWith('/')) {
285
285
  window.magicDesign.history.push(url);
286
286
  } else {
287
- window.location.href = link;
287
+ window.location.href = url;
288
288
  }
289
289
  };
290
290
 
@@ -289,16 +289,15 @@ var getCoupon = function getCoupon(couponId) {
289
289
  var clickUrl = function clickUrl(url) {
290
290
  console.log('clickUrl...', url);
291
291
 
292
+ if (window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
293
+ return;
294
+ }
295
+
292
296
  var _a = (0, _businessUtil.parseUrl)(url),
293
297
  link = _a.link,
294
298
  data = _a.data;
295
299
 
296
- var params = data.params;
297
-
298
- if (window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
299
- return;
300
- } // 如果是video 放开return
301
-
300
+ var params = data.params; // 如果是video 放开return
302
301
 
303
302
  if (params.type !== 'VIDEO' && window.magicDesign.readOnly) {
304
303
  return;
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.170",
4
+ "version": "0.0.171",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",