@fonixtree/magic-design 0.0.124 → 0.0.126
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/GroupList/index.js +2 -2
- package/es/common/ImageModal/index.js +1 -1
- package/es/common/ImgArea/components/Crop.js +5 -2
- package/es/common/ImgArea/components/MultiCrops.js +24 -17
- package/es/common/LinkModal/CustomTable/index.js +2 -1
- package/es/common/LinkModal/SelectVideoModal/index.js +183 -0
- package/es/common/LinkModal/SelectVideoModal/index.less +0 -0
- package/es/common/LinkModal/index.js +191 -14
- package/es/common/Video/components/index.js +92 -0
- package/es/common/Video/components/index.less +62 -0
- package/es/common/Video/index.js +35 -11
- package/es/common/Video/index.less +3 -2
- package/es/composite-comp/bol/components/Button/defaultJSON.js +12 -2
- package/es/composite-comp/bol/components/Carousel/mobile/index.less +8 -5
- package/es/composite-comp/bol/components/Carousel/pc/index.less +9 -4
- package/es/composite-comp/bol/components/Video/components/ShareBtn/index.less +1 -0
- package/es/composite-comp/bol/components/Video/components/VideoTag/index.js +7 -3
- package/es/composite-comp/bol/components/Video/components/VideoTag/index.less +10 -4
- package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +5 -0
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.js +8 -1
- package/es/composite-comp/bol/config-panels/VideoConfig/VideoConfigGroup/index.js +9 -0
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +3 -3
- package/es/composite-comp/dito/components/Recommend/pc/index.js +1 -1
- package/es/composite-comp/dito/components/Recommend/pc/index.less +4 -4
- package/es/composite-comp/dito/components/SearchBar/pc/index.less +4 -0
- package/es/core/Designer/index.js +1 -0
- package/es/core/Renderer/index.js +5 -2
- package/es/decorator/compositeDecorator.js +7 -6
- package/es/meta-comp/components/Image/index.js +1 -0
- package/es/utils/commonUtil.js +76 -4
- package/lib/common/GroupList/index.js +2 -2
- package/lib/common/ImageModal/index.js +1 -1
- package/lib/common/ImgArea/components/Crop.js +5 -2
- package/lib/common/ImgArea/components/MultiCrops.js +24 -17
- package/lib/common/LinkModal/CustomTable/index.js +2 -1
- package/lib/common/LinkModal/SelectVideoModal/index.js +183 -0
- package/lib/common/LinkModal/SelectVideoModal/index.less +0 -0
- package/lib/common/LinkModal/index.js +191 -14
- package/lib/common/Video/components/index.js +92 -0
- package/lib/common/Video/components/index.less +62 -0
- package/lib/common/Video/index.js +35 -11
- package/lib/common/Video/index.less +3 -2
- package/lib/composite-comp/bol/components/Button/defaultJSON.js +12 -2
- package/lib/composite-comp/bol/components/Carousel/mobile/index.less +8 -5
- package/lib/composite-comp/bol/components/Carousel/pc/index.less +9 -4
- package/lib/composite-comp/bol/components/Video/components/ShareBtn/index.less +1 -0
- package/lib/composite-comp/bol/components/Video/components/VideoTag/index.js +7 -3
- package/lib/composite-comp/bol/components/Video/components/VideoTag/index.less +10 -4
- package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +5 -0
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.js +8 -1
- package/lib/composite-comp/bol/config-panels/VideoConfig/VideoConfigGroup/index.js +9 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +3 -3
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +1 -1
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +4 -4
- package/lib/composite-comp/dito/components/SearchBar/pc/index.less +4 -0
- package/lib/core/Designer/index.js +1 -0
- package/lib/core/Renderer/index.js +5 -2
- package/lib/decorator/compositeDecorator.js +7 -6
- package/lib/meta-comp/components/Image/index.js +1 -0
- package/lib/utils/commonUtil.js +76 -4
- package/package.json +1 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.player-hidden {
|
|
2
|
+
display: none !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rate-components {
|
|
6
|
+
float: right;
|
|
7
|
+
color: #fff;
|
|
8
|
+
height: 35px;
|
|
9
|
+
position: relative;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
margin-top: 5px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.current-rate {
|
|
15
|
+
display: flex;
|
|
16
|
+
height: 100%;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
width: 70px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.rate-list {
|
|
24
|
+
position: absolute;
|
|
25
|
+
bottom: 46px;
|
|
26
|
+
display: none;
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: 0;
|
|
29
|
+
list-style: none;
|
|
30
|
+
|
|
31
|
+
li {
|
|
32
|
+
text-align: center;
|
|
33
|
+
width: 70px;
|
|
34
|
+
line-height: 30px;
|
|
35
|
+
background-color: rgba(0, 0, 0, .6);
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
|
|
38
|
+
&.current {
|
|
39
|
+
color: #00c1de;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&+li {
|
|
43
|
+
border-top: 1px solid rgba(78, 78, 78, 0.3);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: rgba(0, 0, 0, .5);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media(max-width: 768px) {
|
|
55
|
+
.current-rate {
|
|
56
|
+
width: 40px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.rate-list li {
|
|
60
|
+
width: 43px;
|
|
61
|
+
}
|
|
62
|
+
}
|
package/es/common/Video/index.js
CHANGED
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _components = _interopRequireDefault(require("./components"));
|
|
11
|
+
|
|
10
12
|
var _commonUtil = require("../../utils/commonUtil");
|
|
11
13
|
|
|
12
14
|
require("./index.less");
|
|
@@ -234,6 +236,11 @@ var createVideo = function createVideo(domId, opts) {
|
|
|
234
236
|
align: 'tl',
|
|
235
237
|
x: 15,
|
|
236
238
|
y: 12
|
|
239
|
+
}, {
|
|
240
|
+
name: 'timeDisplay',
|
|
241
|
+
align: 'tl',
|
|
242
|
+
x: 10,
|
|
243
|
+
y: 7
|
|
237
244
|
}, {
|
|
238
245
|
name: 'volume',
|
|
239
246
|
align: 'tr',
|
|
@@ -271,7 +278,10 @@ var createVideo = function createVideo(domId, opts) {
|
|
|
271
278
|
controlBarVisibility: 'hover',
|
|
272
279
|
useH5Prism: true,
|
|
273
280
|
skinLayout: skinLayout
|
|
274
|
-
}, _defineProperty(_window$Aliplayer, "autoplay", opts.autoplay), _defineProperty(_window$Aliplayer, "rePlay", opts.loop), _window$Aliplayer
|
|
281
|
+
}, _defineProperty(_window$Aliplayer, "autoplay", opts.autoplay), _defineProperty(_window$Aliplayer, "rePlay", opts.loop), _defineProperty(_window$Aliplayer, "components", [{
|
|
282
|
+
name: 'RateComponent',
|
|
283
|
+
type: _components["default"]
|
|
284
|
+
}]), _window$Aliplayer), function (player) {
|
|
275
285
|
if (!opts.videoSound) {
|
|
276
286
|
player.setVolume(0);
|
|
277
287
|
}
|
|
@@ -331,6 +341,8 @@ function (_super) {
|
|
|
331
341
|
return __awaiter(_this, void 0, void 0, function () {
|
|
332
342
|
var _a;
|
|
333
343
|
|
|
344
|
+
var _this = this;
|
|
345
|
+
|
|
334
346
|
return __generator(this, function (_b) {
|
|
335
347
|
switch (_b.label) {
|
|
336
348
|
case 0:
|
|
@@ -347,6 +359,9 @@ function (_super) {
|
|
|
347
359
|
_b.label = 2;
|
|
348
360
|
|
|
349
361
|
case 2:
|
|
362
|
+
if (!this.props.opts.source) return [3
|
|
363
|
+
/*break*/
|
|
364
|
+
, 4];
|
|
350
365
|
_a = this;
|
|
351
366
|
return [4
|
|
352
367
|
/*yield*/
|
|
@@ -354,6 +369,14 @@ function (_super) {
|
|
|
354
369
|
|
|
355
370
|
case 3:
|
|
356
371
|
_a.player = _b.sent();
|
|
372
|
+
this.player.on('pause', function () {
|
|
373
|
+
if (!_this.props.opts.loop) {
|
|
374
|
+
_this.props.onPause();
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
_b.label = 4;
|
|
378
|
+
|
|
379
|
+
case 4:
|
|
357
380
|
return [2
|
|
358
381
|
/*return*/
|
|
359
382
|
];
|
|
@@ -363,13 +386,12 @@ function (_super) {
|
|
|
363
386
|
};
|
|
364
387
|
|
|
365
388
|
_this.fullPlay = function (type) {
|
|
366
|
-
if (type == 'h5') {
|
|
367
|
-
|
|
368
|
-
}
|
|
389
|
+
// if (type == 'h5') {
|
|
390
|
+
// this.player.fullscreenService.requestFullScreen();
|
|
391
|
+
// }
|
|
392
|
+
// if (type == 'pc') {
|
|
393
|
+
_this.createVideoModal(_this.props.videoId); // }
|
|
369
394
|
|
|
370
|
-
if (type == 'pc') {
|
|
371
|
-
_this.createVideoModal(_this.props.videoId);
|
|
372
|
-
}
|
|
373
395
|
};
|
|
374
396
|
|
|
375
397
|
return _this;
|
|
@@ -380,12 +402,14 @@ function (_super) {
|
|
|
380
402
|
};
|
|
381
403
|
|
|
382
404
|
AComponent.prototype.render = function () {
|
|
383
|
-
var
|
|
384
|
-
|
|
405
|
+
var _a = this.props,
|
|
406
|
+
videoId = _a.videoId,
|
|
407
|
+
opts = _a.opts;
|
|
408
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
385
409
|
className: "video-container"
|
|
386
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
410
|
+
}, opts.source ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
387
411
|
id: 'video' + videoId
|
|
388
|
-
}))
|
|
412
|
+
}) : null);
|
|
389
413
|
};
|
|
390
414
|
|
|
391
415
|
AComponent.defaultProps = {
|
|
@@ -40,8 +40,18 @@ var buttonGroupSourceJSON = function buttonGroupSourceJSON() {
|
|
|
40
40
|
layout: 'right'
|
|
41
41
|
},
|
|
42
42
|
spacing: {
|
|
43
|
-
pc: {
|
|
44
|
-
|
|
43
|
+
pc: {
|
|
44
|
+
paddingTop: 10,
|
|
45
|
+
paddingBottom: 10,
|
|
46
|
+
paddingLeft: 26,
|
|
47
|
+
paddingRight: 26
|
|
48
|
+
},
|
|
49
|
+
mobile: {
|
|
50
|
+
paddingTop: 10,
|
|
51
|
+
paddingBottom: 10,
|
|
52
|
+
paddingLeft: 26,
|
|
53
|
+
paddingRight: 26
|
|
54
|
+
}
|
|
45
55
|
},
|
|
46
56
|
text: 'Button',
|
|
47
57
|
hover: null
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
line-height: 1;
|
|
14
14
|
|
|
15
15
|
.slick-list {
|
|
16
|
-
padding-top: 100px;
|
|
17
|
-
margin-top: -100px;
|
|
18
|
-
padding-bottom: 100px;
|
|
19
|
-
margin-bottom: -100px;
|
|
20
|
-
|
|
21
16
|
margin-left: -11px;
|
|
22
17
|
margin-right: -11px;
|
|
18
|
+
padding: 0;
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
padding-top: 100px;
|
|
22
|
+
margin-top: -100px;
|
|
23
|
+
padding-bottom: 100px;
|
|
24
|
+
margin-bottom: -100px;
|
|
25
|
+
}
|
|
23
26
|
|
|
24
27
|
.slick-track {
|
|
25
28
|
display: flex;
|
|
@@ -23,10 +23,15 @@
|
|
|
23
23
|
line-height: 1;
|
|
24
24
|
|
|
25
25
|
.slick-list {
|
|
26
|
-
padding
|
|
27
|
-
margin
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
padding-top: 100px;
|
|
31
|
+
margin-top: -100px;
|
|
32
|
+
padding-bottom: 100px;
|
|
33
|
+
margin-bottom: -100px;
|
|
34
|
+
}
|
|
30
35
|
|
|
31
36
|
.slick-track {
|
|
32
37
|
display: flex;
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
10
12
|
var _components = require("../../../../../../meta-comp/components");
|
|
11
13
|
|
|
12
14
|
var _playCircle = _interopRequireDefault(require("../../imgs/play-circle.png"));
|
|
@@ -100,9 +102,11 @@ function (_super) {
|
|
|
100
102
|
className: "title-text"
|
|
101
103
|
}, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
102
104
|
data: data.title
|
|
103
|
-
})),
|
|
104
|
-
className: "text-text
|
|
105
|
-
|
|
105
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
106
|
+
className: (0, _classnames["default"])('text-text', {
|
|
107
|
+
position: !data.text.open
|
|
108
|
+
})
|
|
109
|
+
}, data.text.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
106
110
|
data: data.text
|
|
107
111
|
}), !noShare && /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
108
112
|
data: share
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
display: flex;
|
|
34
34
|
flex-direction: column;
|
|
35
35
|
padding: 0 16px;
|
|
36
|
+
width: 100%;
|
|
36
37
|
|
|
37
38
|
.tag-wrap {
|
|
38
39
|
display: flex;
|
|
@@ -58,17 +59,22 @@
|
|
|
58
59
|
display: flex;
|
|
59
60
|
flex-direction: column;
|
|
60
61
|
|
|
61
|
-
.text-text{
|
|
62
|
+
.text-text {
|
|
62
63
|
display: flex;
|
|
63
64
|
align-items: center;
|
|
65
|
+
width: 100%;
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
&.position {
|
|
68
|
+
position: absolute;
|
|
69
|
+
right: 10px;
|
|
70
|
+
top: -40px;
|
|
71
|
+
}
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
.left-wrap{
|
|
71
|
-
&+.right-wrap{
|
|
76
|
+
.left-wrap {
|
|
77
|
+
&+.right-wrap {
|
|
72
78
|
padding-left: 0;
|
|
73
79
|
}
|
|
74
80
|
}
|
|
@@ -130,6 +130,11 @@ function (_super) {
|
|
|
130
130
|
_this.setState({});
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
|
+
onPause: function onPause() {
|
|
134
|
+
_this.videoRefMap[group.id].playing = false;
|
|
135
|
+
|
|
136
|
+
_this.setState({});
|
|
137
|
+
},
|
|
133
138
|
opts: __assign(__assign({}, group.video), {
|
|
134
139
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
135
140
|
source: group.video.sourceUrl
|
|
@@ -13,6 +13,8 @@ var _playCircle = _interopRequireDefault(require("../../imgs/play-circle.png"));
|
|
|
13
13
|
|
|
14
14
|
var _commonUtil = require("../../../../../../utils/commonUtil");
|
|
15
15
|
|
|
16
|
+
var _coreUtil = require("../../../../../../utils/coreUtil");
|
|
17
|
+
|
|
16
18
|
require("./index.less");
|
|
17
19
|
|
|
18
20
|
var _VideoTag = _interopRequireDefault(require("../../components/VideoTag"));
|
|
@@ -163,8 +165,13 @@ function (_super) {
|
|
|
163
165
|
_this.setState({});
|
|
164
166
|
}
|
|
165
167
|
},
|
|
168
|
+
onPause: function onPause() {
|
|
169
|
+
_this.videoRefMap[group.id].playing = false;
|
|
170
|
+
|
|
171
|
+
_this.setState({});
|
|
172
|
+
},
|
|
166
173
|
opts: __assign(__assign({}, group.video), {
|
|
167
|
-
cover: getVideoCover(group),
|
|
174
|
+
cover: (0, _coreUtil.getVideoCover)(group),
|
|
168
175
|
source: group.video.sourceUrl
|
|
169
176
|
}),
|
|
170
177
|
videoId: group.id
|
|
@@ -95,6 +95,14 @@ function (_super) {
|
|
|
95
95
|
_this.setState({});
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
+
_this.renderCard = function (src, index) {
|
|
99
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
100
|
+
className: "card_wrap"
|
|
101
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
+
className: "name"
|
|
103
|
+
}, "Video", index + 1));
|
|
104
|
+
};
|
|
105
|
+
|
|
98
106
|
return _this;
|
|
99
107
|
}
|
|
100
108
|
|
|
@@ -106,6 +114,7 @@ function (_super) {
|
|
|
106
114
|
className: "node_list"
|
|
107
115
|
}, /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
|
|
108
116
|
onClickItem: this.onClickItem,
|
|
117
|
+
renderCard: this.renderCard,
|
|
109
118
|
reRender: this.reRender,
|
|
110
119
|
source: source
|
|
111
120
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
display: flex;
|
|
27
27
|
align-items: center;
|
|
28
28
|
text-align: center;
|
|
29
|
-
padding: 0
|
|
29
|
+
padding: 0 16px;
|
|
30
30
|
width: fit-content;
|
|
31
31
|
height: 100%;
|
|
32
32
|
justify-content: center;
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
flex-direction: column;
|
|
35
35
|
|
|
36
36
|
img {
|
|
37
|
-
height:
|
|
38
|
-
width:
|
|
37
|
+
height: 20px;
|
|
38
|
+
width: 20px;
|
|
39
39
|
margin-bottom: 2px;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -648,7 +648,7 @@ function (_super) {
|
|
|
648
648
|
scrollToRightDisabled = _a.scrollToRightDisabled,
|
|
649
649
|
contentWidth = _a.contentWidth;
|
|
650
650
|
var products = this.state["products" + tabIndex] || [];
|
|
651
|
-
var isDivide =
|
|
651
|
+
var isDivide = false;
|
|
652
652
|
var layout = panelProps.customize.layout.pcLayout;
|
|
653
653
|
|
|
654
654
|
var _seeAll = (0, _commonUtil.ensure)(function () {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
display: flex;
|
|
27
27
|
align-items: center;
|
|
28
28
|
text-align: center;
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
padding: 0 24px;
|
|
30
|
+
width: fit-content;
|
|
31
31
|
height: 100%;
|
|
32
32
|
justify-content: center;
|
|
33
33
|
white-space: nowrap;
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
cursor: pointer;
|
|
36
36
|
|
|
37
37
|
img {
|
|
38
|
-
height:
|
|
39
|
-
width:
|
|
38
|
+
height: 24px;
|
|
39
|
+
width: 24px;
|
|
40
40
|
margin-bottom: 2px;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
.search-input-wrap {
|
|
18
18
|
border: 1px solid #2F54EB;
|
|
19
19
|
border-radius: 6px;
|
|
20
|
+
overflow: hidden;
|
|
20
21
|
height: 40px;
|
|
21
22
|
display: flex;
|
|
22
23
|
flex: 1;
|
|
24
|
+
|
|
23
25
|
.search-input {
|
|
24
26
|
border: none;
|
|
25
27
|
height: 38px;
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
font-weight: 400;
|
|
30
32
|
font-size: 14px;
|
|
31
33
|
}
|
|
34
|
+
|
|
32
35
|
.search-icon {
|
|
33
36
|
cursor: pointer;
|
|
34
37
|
height: 100%;
|
|
@@ -52,6 +55,7 @@
|
|
|
52
55
|
align-items: center;
|
|
53
56
|
cursor: pointer;
|
|
54
57
|
border: 1px solid #2F54EB;
|
|
58
|
+
|
|
55
59
|
.shopping-txt {
|
|
56
60
|
margin-left: 6px;
|
|
57
61
|
}
|
|
@@ -108,6 +108,7 @@ window.magicDesign = {
|
|
|
108
108
|
|
|
109
109
|
var setDesignConfig = function setDesignConfig(data) {
|
|
110
110
|
window.magicDesign = __assign(__assign(__assign({}, window.magicDesign), data), {
|
|
111
|
+
compWidth: Number(data.compWidth),
|
|
111
112
|
compSpacing: Number(data.compSpacing),
|
|
112
113
|
MBaseUrl: data.MBaseUrl || ''
|
|
113
114
|
});
|
|
@@ -58,8 +58,10 @@ var setDesignConfig = function setDesignConfig(props) {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
var Renderer = function Renderer(props) {
|
|
61
|
-
var pageData = props.pageData;
|
|
61
|
+
var pageData = props.pageData; // console.log('pageData: ', pageData);
|
|
62
|
+
|
|
62
63
|
setDesignConfig(props);
|
|
64
|
+
window.magicDesignPageData = pageData;
|
|
63
65
|
var pageBackground = window.magicDesign.pageBackground; // 根据楼层展示设备进行过滤
|
|
64
66
|
|
|
65
67
|
var filterCompFloor = function filterCompFloor() {
|
|
@@ -88,7 +90,8 @@ var Renderer = function Renderer(props) {
|
|
|
88
90
|
className: "render_wrap",
|
|
89
91
|
magic_design: "",
|
|
90
92
|
style: {
|
|
91
|
-
background: pageBackground
|
|
93
|
+
background: pageBackground,
|
|
94
|
+
overflow: 'aotu'
|
|
92
95
|
}
|
|
93
96
|
}, filterCompFloor().map(function (nodeData) {
|
|
94
97
|
var Clazz = _componentTypes.componentMap[nodeData.type];
|
|
@@ -115,7 +115,7 @@ function compositeDecorator(WrappedComponent) {
|
|
|
115
115
|
var wrapStyle = {
|
|
116
116
|
border: 'none',
|
|
117
117
|
position: 'relative',
|
|
118
|
-
zIndex: '
|
|
118
|
+
zIndex: '0',
|
|
119
119
|
margin: '0 auto'
|
|
120
120
|
}; // 复合组件内边距
|
|
121
121
|
|
|
@@ -179,15 +179,16 @@ function compositeDecorator(WrappedComponent) {
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
_this.getWrapStyle = function () {
|
|
182
|
-
var mode = window.magicDesign.mode;
|
|
183
|
-
|
|
182
|
+
var mode = window.magicDesign.mode; // const { nodeData } = this.props;
|
|
183
|
+
|
|
184
184
|
var style = {
|
|
185
185
|
position: 'relative',
|
|
186
186
|
zIndex: '1'
|
|
187
|
-
};
|
|
188
|
-
|
|
187
|
+
}; // const { clickedFloor } = this.state;
|
|
188
|
+
// banner 和 recommend 在选中状态需要加padding,让选中的外边框展示出来
|
|
189
|
+
// if (mode === 'designer' && clickedFloor === nodeData.id && ['BANNER', 'RECOMMEND'].includes(nodeData.type)) {
|
|
189
190
|
|
|
190
|
-
if (mode === 'designer'
|
|
191
|
+
if (mode === 'designer') {
|
|
191
192
|
style.padding = '2px';
|
|
192
193
|
}
|
|
193
194
|
|
|
@@ -90,6 +90,7 @@ function (_super) {
|
|
|
90
90
|
if (data.hover.open && data.hover.backgroundType === 'enlarge' && (hoverState || hoverImgSrc)) {
|
|
91
91
|
// return { transform: `scale(${data.hover.magnification})` };
|
|
92
92
|
obj.transform = "scale(" + data.hover.magnification + ")";
|
|
93
|
+
obj.zIndex = '1';
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
if (maxHeight) {
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -11,7 +11,10 @@ exports.convertImageUrl = convertImageUrl;
|
|
|
11
11
|
exports.copy2ClipBoard = copy2ClipBoard;
|
|
12
12
|
exports.dragSource = void 0;
|
|
13
13
|
exports.ensure = ensure;
|
|
14
|
-
exports.
|
|
14
|
+
exports.getColorRgba = void 0;
|
|
15
|
+
exports.getPageDataMap = getPageDataMap;
|
|
16
|
+
exports.navigateTo = exports.importAsync = exports.getUrlParams = void 0;
|
|
17
|
+
exports.pushGA = pushGA;
|
|
15
18
|
exports.shareFacebook = shareFacebook;
|
|
16
19
|
exports.shareLinkedin = shareLinkedin;
|
|
17
20
|
exports.shareTwitter = shareTwitter;
|
|
@@ -23,6 +26,22 @@ var _qs = _interopRequireDefault(require("qs"));
|
|
|
23
26
|
|
|
24
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
28
|
|
|
29
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
30
|
+
__assign = Object.assign || function (t) {
|
|
31
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
32
|
+
s = arguments[i];
|
|
33
|
+
|
|
34
|
+
for (var p in s) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return t;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return __assign.apply(this, arguments);
|
|
43
|
+
};
|
|
44
|
+
|
|
26
45
|
/**
|
|
27
46
|
* 安全获取数据
|
|
28
47
|
* @param {function} func 获取函数
|
|
@@ -311,9 +330,9 @@ function asyncDataURLtoImage(dataUrl) {
|
|
|
311
330
|
});
|
|
312
331
|
}
|
|
313
332
|
|
|
314
|
-
var importAsync = function importAsync(fileUrl) {
|
|
333
|
+
var importAsync = function importAsync(fileUrl, type) {
|
|
315
334
|
return new Promise(function (resolve, reject) {
|
|
316
|
-
if (
|
|
335
|
+
if (/\.js/.test(fileUrl) || type == 'js') {
|
|
317
336
|
var domNode = document.createElement('script');
|
|
318
337
|
domNode.src = fileUrl;
|
|
319
338
|
domNode.addEventListener('load', resolve);
|
|
@@ -321,7 +340,7 @@ var importAsync = function importAsync(fileUrl) {
|
|
|
321
340
|
document.body.appendChild(domNode);
|
|
322
341
|
}
|
|
323
342
|
|
|
324
|
-
if (
|
|
343
|
+
if (/\.css/.test(fileUrl) || type == 'css') {
|
|
325
344
|
var domNode = document.createElement('link');
|
|
326
345
|
domNode.rel = 'stylesheet';
|
|
327
346
|
domNode.type = 'text/css';
|
|
@@ -391,4 +410,57 @@ function copy2ClipBoard(text) {
|
|
|
391
410
|
document.getElementById('cp_hgz_input').select();
|
|
392
411
|
document.execCommand('copy');
|
|
393
412
|
document.getElementById('cp_hgz_input').remove();
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function getPageDataMap() {
|
|
416
|
+
var elelmentMap = {};
|
|
417
|
+
window.magicDesignPageData.childNodes.forEach(function (item) {
|
|
418
|
+
Object.keys(item).forEach(function (key) {
|
|
419
|
+
var obj = item[key];
|
|
420
|
+
|
|
421
|
+
if (key === 'groupSource') {
|
|
422
|
+
obj.forEach(function (group) {
|
|
423
|
+
Object.keys(group).forEach(function (groupKey) {
|
|
424
|
+
var groupObj = group[groupKey];
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
} else {
|
|
428
|
+
if (obj.id) {
|
|
429
|
+
elelmentMap[obj.id] = {
|
|
430
|
+
tempName: '设计器',
|
|
431
|
+
pageId: window.magicDesignPageData.id,
|
|
432
|
+
moduleName: obj.type,
|
|
433
|
+
moduleId: obj.id,
|
|
434
|
+
groupName: '组名称',
|
|
435
|
+
groupId: '组id',
|
|
436
|
+
elementName: '元素名称',
|
|
437
|
+
elementId: '元素id'
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
/** GA上报 */
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
function pushGA(data) {
|
|
448
|
+
// setInterval(() => {
|
|
449
|
+
var random = ~~(Math.random() * 10);
|
|
450
|
+
window.gtag('event', 'designer_click', __assign({
|
|
451
|
+
pageName: '页面名称' + random,
|
|
452
|
+
moduleName: '模块名称' + random,
|
|
453
|
+
moduleId: '模块id' + random,
|
|
454
|
+
groupName: '组名称' + random,
|
|
455
|
+
groupId: '组id' + random,
|
|
456
|
+
elementName: '元素名称' + random,
|
|
457
|
+
elementId: '元素id' + random,
|
|
458
|
+
pageId: '页面id' + random,
|
|
459
|
+
pageId_moduleId: 'pageId_moduleId' + random,
|
|
460
|
+
pageId_moduleId_groupId: 'pageId_moduleId_groupId' + random,
|
|
461
|
+
pageId_moduleId_groupId_elementId: 'pageId_moduleId_groupId_elementId' + random,
|
|
462
|
+
pageName_moduleName: 'pageName_moduleName' + random,
|
|
463
|
+
pageName_moduleName_groupName: 'pageName_moduleName_groupName' + random,
|
|
464
|
+
pageName_moduleName_groupName_elementNam: 'pageName_moduleName_groupName_elementNam' + random
|
|
465
|
+
}, data)); // }, 1000);
|
|
394
466
|
}
|
|
@@ -148,7 +148,7 @@ function (_super) {
|
|
|
148
148
|
var dragId = this.state.dragId;
|
|
149
149
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
150
150
|
className: "group_list"
|
|
151
|
-
}, source.length > 0 && source.map(function (src) {
|
|
151
|
+
}, source.length > 0 && source.map(function (src, index) {
|
|
152
152
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
153
153
|
key: "card" + src.id,
|
|
154
154
|
className: "group_item",
|
|
@@ -176,7 +176,7 @@ function (_super) {
|
|
|
176
176
|
type: "icon-drag"
|
|
177
177
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
178
178
|
className: "middle_info ml8"
|
|
179
|
-
}, renderCard(src) || 'image name')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
179
|
+
}, renderCard(src, index) || 'image name')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
180
180
|
className: "right"
|
|
181
181
|
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
182
182
|
className: "icon_copy",
|
|
@@ -462,7 +462,7 @@ function ImageModal(_a) {
|
|
|
462
462
|
};
|
|
463
463
|
|
|
464
464
|
var onUpload = function onUpload(data) {
|
|
465
|
-
return fetch(
|
|
465
|
+
return fetch(window.magicDesign.MBaseUrl + "/upload/contents", {
|
|
466
466
|
method: 'POST',
|
|
467
467
|
body: data,
|
|
468
468
|
headers: headers
|