@fonixtree/magic-design 0.0.170 → 0.0.172
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.
- package/es/common/ColorPicker/index.less +1 -2
- package/es/composite-comp/bol/components/Banner/mobile/index.less +7 -0
- package/es/composite-comp/bol/components/Banner/pc/index.less +7 -0
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +11 -17
- package/es/meta-comp/components/Button/editable.js +9 -0
- package/es/meta-comp/components/Text/index.js +7 -9
- package/es/meta-comp/config-panels/ButtonConfig/index.js +8 -0
- package/es/utils/commonUtil.js +1 -1
- package/es/utils/coreUtil.js +5 -6
- package/lib/common/ColorPicker/index.less +1 -2
- package/lib/composite-comp/bol/components/Banner/mobile/index.less +7 -0
- package/lib/composite-comp/bol/components/Banner/pc/index.less +7 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +11 -17
- package/lib/meta-comp/components/Button/editable.js +9 -0
- package/lib/meta-comp/components/Text/index.js +7 -9
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +8 -0
- package/lib/utils/commonUtil.js +1 -1
- package/lib/utils/coreUtil.js +5 -6
- package/package.json +1 -1
|
@@ -486,23 +486,17 @@ function (_super) {
|
|
|
486
486
|
return _this;
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
RecommendMobile.prototype.componentDidMount = function () {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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) {
|
|
@@ -73,6 +73,13 @@ function (_super) {
|
|
|
73
73
|
|
|
74
74
|
_this.preData = '';
|
|
75
75
|
_this.preDevice = '';
|
|
76
|
+
|
|
77
|
+
_this.triggerButtonConfigRender = function () {
|
|
78
|
+
window.document.dispatchEvent(new Event('button-render', {
|
|
79
|
+
bubbles: false
|
|
80
|
+
}));
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
return _this;
|
|
77
84
|
}
|
|
78
85
|
|
|
@@ -102,6 +109,8 @@ function (_super) {
|
|
|
102
109
|
_this.preData = JSON.stringify(__assign(__assign({}, JSON.parse(_this.preData)), {
|
|
103
110
|
text: text
|
|
104
111
|
}));
|
|
112
|
+
|
|
113
|
+
_this.triggerButtonConfigRender();
|
|
105
114
|
},
|
|
106
115
|
suppressContentEditableWarning: true
|
|
107
116
|
}, data.text);
|
|
@@ -319,7 +319,8 @@ function (_super) {
|
|
|
319
319
|
node.appendChild(closeNode);
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
-
_this.renderText = function (data
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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);
|
|
@@ -101,6 +101,14 @@ function (_super) {
|
|
|
101
101
|
return _this;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
ButtonConfig.prototype.componentDidMount = function () {
|
|
105
|
+
window.document.addEventListener('button-render', this.selfRender);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
ButtonConfig.prototype.componentWillUnmount = function () {
|
|
109
|
+
window.document.removeEventListener('button-render', this.selfRender);
|
|
110
|
+
};
|
|
111
|
+
|
|
104
112
|
ButtonConfig.prototype.render = function () {
|
|
105
113
|
var _this = this;
|
|
106
114
|
|
package/es/utils/commonUtil.js
CHANGED
package/es/utils/coreUtil.js
CHANGED
|
@@ -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
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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) {
|
|
@@ -73,6 +73,13 @@ function (_super) {
|
|
|
73
73
|
|
|
74
74
|
_this.preData = '';
|
|
75
75
|
_this.preDevice = '';
|
|
76
|
+
|
|
77
|
+
_this.triggerButtonConfigRender = function () {
|
|
78
|
+
window.document.dispatchEvent(new Event('button-render', {
|
|
79
|
+
bubbles: false
|
|
80
|
+
}));
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
return _this;
|
|
77
84
|
}
|
|
78
85
|
|
|
@@ -102,6 +109,8 @@ function (_super) {
|
|
|
102
109
|
_this.preData = JSON.stringify(__assign(__assign({}, JSON.parse(_this.preData)), {
|
|
103
110
|
text: text
|
|
104
111
|
}));
|
|
112
|
+
|
|
113
|
+
_this.triggerButtonConfigRender();
|
|
105
114
|
},
|
|
106
115
|
suppressContentEditableWarning: true
|
|
107
116
|
}, data.text);
|
|
@@ -319,7 +319,8 @@ function (_super) {
|
|
|
319
319
|
node.appendChild(closeNode);
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
-
_this.renderText = function (data
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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);
|
|
@@ -101,6 +101,14 @@ function (_super) {
|
|
|
101
101
|
return _this;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
ButtonConfig.prototype.componentDidMount = function () {
|
|
105
|
+
window.document.addEventListener('button-render', this.selfRender);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
ButtonConfig.prototype.componentWillUnmount = function () {
|
|
109
|
+
window.document.removeEventListener('button-render', this.selfRender);
|
|
110
|
+
};
|
|
111
|
+
|
|
104
112
|
ButtonConfig.prototype.render = function () {
|
|
105
113
|
var _this = this;
|
|
106
114
|
|
package/lib/utils/commonUtil.js
CHANGED
package/lib/utils/coreUtil.js
CHANGED
|
@@ -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;
|