@fonixtree/magic-design 1.0.144 → 1.0.147

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.
Files changed (49) hide show
  1. package/es/common/ProductCardModal/index.js +1 -1
  2. package/es/common/ProductCardModal/index.less +1 -1
  3. package/es/common/Video/index.js +4 -2
  4. package/es/common/VideoPC/background.png +0 -0
  5. package/es/common/VideoPC/closeImg.png +0 -0
  6. package/es/common/VideoPC/components/index.js +100 -0
  7. package/es/common/VideoPC/components/index.less +62 -0
  8. package/es/common/VideoPC/cover.png +0 -0
  9. package/es/common/VideoPC/index.js +750 -0
  10. package/es/common/VideoPC/index.less +79 -0
  11. package/es/common/index.js +8 -0
  12. package/es/composite-comp/dito/components/GroupedCarousel/pc/index.js +0 -1
  13. package/es/composite-comp/dito/components/SearchDITO/defaultJSON.js +2 -1
  14. package/es/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.js +8 -2
  15. package/es/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.less +1 -1
  16. package/es/composite-comp/dito/components/SearchDITO/pc/index.js +1 -2
  17. package/es/composite-comp/dito/components/SearchDITO/pc/index.less +3 -1
  18. package/es/composite-comp/dito/components/SlideImage/defaultJSON.js +3 -2
  19. package/es/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +2 -2
  20. package/es/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +6 -4
  21. package/es/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.js +9 -0
  22. package/es/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +10 -1
  23. package/es/core/Renderer/index.js +0 -1
  24. package/es/utils/coreUtil.js +3 -3
  25. package/lib/common/ProductCardModal/index.js +1 -1
  26. package/lib/common/ProductCardModal/index.less +1 -1
  27. package/lib/common/Video/index.js +4 -2
  28. package/lib/common/VideoPC/background.png +0 -0
  29. package/lib/common/VideoPC/closeImg.png +0 -0
  30. package/lib/common/VideoPC/components/index.js +100 -0
  31. package/lib/common/VideoPC/components/index.less +62 -0
  32. package/lib/common/VideoPC/cover.png +0 -0
  33. package/lib/common/VideoPC/index.js +750 -0
  34. package/lib/common/VideoPC/index.less +79 -0
  35. package/lib/common/index.js +8 -0
  36. package/lib/composite-comp/dito/components/GroupedCarousel/pc/index.js +0 -1
  37. package/lib/composite-comp/dito/components/SearchDITO/defaultJSON.js +2 -1
  38. package/lib/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.js +8 -2
  39. package/lib/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.less +1 -1
  40. package/lib/composite-comp/dito/components/SearchDITO/pc/index.js +1 -2
  41. package/lib/composite-comp/dito/components/SearchDITO/pc/index.less +3 -1
  42. package/lib/composite-comp/dito/components/SlideImage/defaultJSON.js +3 -2
  43. package/lib/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +2 -2
  44. package/lib/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +6 -4
  45. package/lib/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.js +9 -0
  46. package/lib/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +10 -1
  47. package/lib/core/Renderer/index.js +0 -1
  48. package/lib/utils/coreUtil.js +3 -3
  49. package/package.json +1 -1
@@ -0,0 +1,79 @@
1
+ .video-container {
2
+ position: relative;
3
+ height: 100%;
4
+ background-image: linear-gradient(0, rgba(0, 0, 0, .2), rgba(0, 0, 0, .1), rgba(0, 0, 0, .2));
5
+ &:empty {
6
+ height: 400px;
7
+ }
8
+
9
+ .video-cover-img {
10
+ position: absolute;
11
+ top: 0;
12
+ right: 0;
13
+ left: 0;
14
+ bottom: 0;
15
+ object-fit: cover;
16
+ width: 100%;
17
+ height: 100%;
18
+ z-index: 0;
19
+ }
20
+
21
+ .prism-player .prism-cover {
22
+ z-index: 0;
23
+ }
24
+ .prism-player video{
25
+ position:relative !important;
26
+ left: 0 !important;
27
+ top: 0 !important;
28
+ transform: none !important;
29
+ display: block !important;
30
+ }
31
+
32
+ .video-wrap {
33
+ width: 100%;
34
+ height: 100%;
35
+ }
36
+ }
37
+
38
+ .pc-video-modal-wrap {
39
+ position: fixed;
40
+ top: 0;
41
+ left: 0;
42
+ right: 0;
43
+ bottom: 0;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ z-index: 999;
48
+
49
+ .video-shadow-wrap {
50
+ position: fixed;
51
+ top: 0;
52
+ left: 0;
53
+ right: 0;
54
+ bottom: 0;
55
+ z-index: 1000;
56
+ opacity: .4;
57
+ background-color: #000;
58
+ }
59
+
60
+ .content-wrap {
61
+ width: 1100px;
62
+ max-width: 90%;
63
+ height: 600px;
64
+ // padding: 10px;
65
+ background: rgb(255 255 255);
66
+ border-radius: 5px;
67
+ z-index: 1001;
68
+ position: relative;
69
+
70
+ .close-img-wrap {
71
+ position: absolute;
72
+ right: 14px;
73
+ top: 14px;
74
+ width: 20px;
75
+ height: 20px;
76
+ cursor: pointer;
77
+ }
78
+ }
79
+ }
@@ -159,6 +159,12 @@ Object.defineProperty(exports, "Video", {
159
159
  return _Video["default"];
160
160
  }
161
161
  });
162
+ Object.defineProperty(exports, "VideoPC", {
163
+ enumerable: true,
164
+ get: function get() {
165
+ return _VideoPC["default"];
166
+ }
167
+ });
162
168
  Object.defineProperty(exports, "VideoUpload", {
163
169
  enumerable: true,
164
170
  get: function get() {
@@ -202,6 +208,8 @@ var _SystemNotification = _interopRequireDefault(require("./SystemNotification")
202
208
 
203
209
  var _Video = _interopRequireDefault(require("./Video"));
204
210
 
211
+ var _VideoPC = _interopRequireDefault(require("./VideoPC"));
212
+
205
213
  var _SwiperBan = _interopRequireDefault(require("./SwiperBan"));
206
214
 
207
215
  var _InputNumber = _interopRequireDefault(require("./InputNumber"));
@@ -62,7 +62,6 @@ function (_super) {
62
62
  var nextIndex = groupSource.findIndex(function (item) {
63
63
  return item.id === _mobx.store.clickedGroup;
64
64
  });
65
- console.log('nextIndex', nextIndex);
66
65
 
67
66
  if (nextIndex != -1 && nextIndex != _this.state.tabIndex) {
68
67
  _this.carouselImgRef.current.goTo(nextIndex);
@@ -71,7 +71,8 @@ var groupSourceJSON = function groupSourceJSON(parentId, type) {
71
71
  pcSize: 60,
72
72
  iconType: 'light-playicon-01',
73
73
  iconColor: 'Light'
74
- }
74
+ },
75
+ clickUrl: ''
75
76
  };
76
77
  }
77
78
  };
@@ -104,8 +104,11 @@ function (_super) {
104
104
 
105
105
  var data = this.props.data;
106
106
  return /*#__PURE__*/_react["default"].createElement("div", {
107
- className: "video-item-wrap"
108
- }, /*#__PURE__*/_react["default"].createElement(_common.Video, {
107
+ className: "video-item-wrap",
108
+ style: {
109
+ cursor: data.clickUrl ? 'pointer' : 'auto'
110
+ }
111
+ }, /*#__PURE__*/_react["default"].createElement(_common.VideoPC, {
109
112
  ref: function ref(el) {
110
113
  if (!_this.videoRefMap[data.id]) {
111
114
  _this.videoRefMap[data.id] = {
@@ -116,6 +119,9 @@ function (_super) {
116
119
  _this.setState({});
117
120
  }
118
121
  },
122
+ onClick: function onClick() {
123
+ (0, _coreUtil.clickUrl)(data.clickUrl);
124
+ },
119
125
  onEnd: function onEnd() {
120
126
  _this.videoRefMap[data.id].playing = false;
121
127
 
@@ -1,5 +1,5 @@
1
1
  .video-item-wrap {
2
- height: 700px;
2
+ // height: 700px;
3
3
  position: relative;
4
4
  margin-bottom: 10px;
5
5
 
@@ -589,7 +589,7 @@ function (_super) {
589
589
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
590
590
  color: (_h = (_g = data.content.icon) === null || _g === void 0 ? void 0 : _g.color) === null || _h === void 0 ? void 0 : _h.pc,
591
591
  onClick: function onClick() {
592
- return (0, _coreUtil.clickUrl)('/search-page');
592
+ return (0, _coreUtil.clickUrl)('/search-page?from=home');
593
593
  },
594
594
  size: 24,
595
595
  type: "icon-search-short"
@@ -656,7 +656,6 @@ function (_super) {
656
656
  }, m.image && m.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
657
657
  className: "bgImg",
658
658
  data: m.image,
659
- imgCover: true,
660
659
  isBackground: true
661
660
  }), m.video && i === carouseIndex && /*#__PURE__*/_react["default"].createElement(_VideoItem["default"], {
662
661
  data: m
@@ -174,8 +174,10 @@
174
174
  }
175
175
 
176
176
  .carousel-img {
177
+ min-height: 400px;
178
+
177
179
  .bgImg {
178
- height: 700px;
180
+ // height: 700px;
179
181
  }
180
182
  }
181
183
 
@@ -58,7 +58,7 @@ var groupSourceJSON = function groupSourceJSON(parentId) {
58
58
  fontWeight: 600,
59
59
  pcFontSize: 22,
60
60
  color: '#232F46',
61
- textAlign: 'center'
61
+ textAlign: 'left'
62
62
  },
63
63
  underline: {
64
64
  open: false,
@@ -66,7 +66,8 @@ var groupSourceJSON = function groupSourceJSON(parentId) {
66
66
  textDecorationStyle: 'solid'
67
67
  },
68
68
  vertical: {}
69
- }
69
+ },
70
+ clickUrl: ''
70
71
  };
71
72
  };
72
73
 
@@ -79,7 +79,7 @@ function (_super) {
79
79
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", _extends({
80
80
  className: (0, _classnames["default"])('slide-image-card-item-wrap'),
81
81
  onClick: function onClick() {
82
- return (0, _coreUtil.clickUrl)(data.groupName.content.clickUrl || {});
82
+ return (0, _coreUtil.clickUrl)(data.clickUrl || '');
83
83
  }
84
84
  }, rest), /*#__PURE__*/_react["default"].createElement(_VideoItem["default"], {
85
85
  data: data
@@ -87,7 +87,7 @@ function (_super) {
87
87
  className: "img-text",
88
88
  data: data.groupName,
89
89
  style: {
90
- pointerEvents: 'none'
90
+ pointerEvents: (0, _coreUtil.isDesignMode)() ? 'unset' : 'none'
91
91
  }
92
92
  })));
93
93
  };
@@ -59,10 +59,12 @@ function ParallaxScroll(_a) {
59
59
  var translateThird = (0, _framerMotion.useTransform)(scrollYProgress, [0, 1], [0, colThreeScrollY]);
60
60
  (0, _react.useEffect)(function () {
61
61
  setTimeout(function () {
62
+ var _a, _b, _c;
63
+
62
64
  if (!(0, _coreUtil.isDesignMode)()) {
63
- var colOneHeight = colOneRef.current.offsetHeight;
64
- var colTwoHeight = colTwoRef.current.offsetHeight;
65
- var colThreeHeight = colThreeRef.current.offsetHeight;
65
+ var colOneHeight = (_a = colOneRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight;
66
+ var colTwoHeight = (_b = colTwoRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight;
67
+ var colThreeHeight = (_c = colThreeRef.current) === null || _c === void 0 ? void 0 : _c.offsetHeight;
66
68
  var colHeights = [colOneHeight, colTwoHeight, colThreeHeight];
67
69
  var space = Math.max.apply(Math, colHeights) - Math.min.apply(Math, colHeights) - 20;
68
70
  var minHeightIndex = colHeights.indexOf(Math.min.apply(Math, colHeights));
@@ -81,7 +83,7 @@ function ParallaxScroll(_a) {
81
83
  setColThreeScrollY(space);
82
84
  }
83
85
  }
84
- }, 1000);
86
+ }, 1500);
85
87
  }, [scrollYProgress]);
86
88
  return /*#__PURE__*/_react["default"].createElement("div", {
87
89
  className: "m-parallax-scroll"
@@ -202,6 +202,15 @@ function (_super) {
202
202
  },
203
203
  showNow: false,
204
204
  value: (0, _moment["default"])(panelProps.video.startAt / 60 + ":" + panelProps.video.startAt % 60, 'mm:ss')
205
+ })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
206
+ title: "URL"
207
+ }, /*#__PURE__*/_react["default"].createElement(_common.UrlPicker, {
208
+ onChange: function onChange(v) {
209
+ panelProps.clickUrl = v;
210
+
211
+ _this.reRender();
212
+ },
213
+ value: panelProps.clickUrl
205
214
  })), /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
206
215
  headerSize: "middle",
207
216
  onRefresh: function onRefresh() {
@@ -182,7 +182,16 @@ function (_super) {
182
182
  _this.reRender();
183
183
  },
184
184
  value: panelProps.video.sourceUrl
185
- }), /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
185
+ }), /*#__PURE__*/_react["default"].createElement(_common.Field, {
186
+ title: "URL"
187
+ }, /*#__PURE__*/_react["default"].createElement(_common.UrlPicker, {
188
+ onChange: function onChange(v) {
189
+ panelProps.clickUrl = v;
190
+
191
+ _this.reRender();
192
+ },
193
+ value: panelProps.clickUrl
194
+ })), /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
186
195
  headerSize: "middle",
187
196
  onRefresh: function onRefresh() {
188
197
  return (0, _coreUtil.renderPreview)();
@@ -46,7 +46,6 @@ var setDesignConfig = function setDesignConfig(props) {
46
46
  device = props.device,
47
47
  isPreview = props.isPreview,
48
48
  projectCode = props.projectCode;
49
- console.log('window.magicDesign', props);
50
49
  window.magicDesign = __assign(__assign({
51
50
  pageBackground: '#f2f2f2',
52
51
  mode: 'renderer',
@@ -313,6 +313,7 @@ var createProdCardModal = function createProdCardModal(ids) {
313
313
  return __generator(this, function (_b) {
314
314
  switch (_b.label) {
315
315
  case 0:
316
+ console.log('ids', ids);
316
317
  if (ids.length === 0) return [2
317
318
  /*return*/
318
319
  ];
@@ -371,14 +372,13 @@ var clickUrl = function clickUrl(url, state) {
371
372
  params = _c === void 0 ? {} : _c;
372
373
  console.log('params...', params); // PC商品卡片弹窗
373
374
 
374
- if (params.type === _constants.urlTypeMap.CARD_PRODUCT_LIST) {
375
+ if (params.type === 'CARD_PRODUCT_LIST') {
375
376
  createProdCardModal(params.offerIds);
376
377
  return;
377
378
  }
378
-
379
- return;
380
379
  /** 锚点跳转 */
381
380
 
381
+
382
382
  if (params.type === 'ANCHOR') {
383
383
  ensure(function () {
384
384
  var nodeId = isPc() ? params.data.pcNodeId : params.data.mobileNodeId;
@@ -139,7 +139,7 @@ function ProductCardModal(_a) {
139
139
  }
140
140
  }, /*#__PURE__*/_react["default"].createElement("div", {
141
141
  dangerouslySetInnerHTML: {
142
- __html: (0, _commonUtil.xssDecode)(item.goodsIntroduce)
142
+ __html: (0, _commonUtil.xssDecode)(item.goodsIntroduce || '')
143
143
  }
144
144
  })), index === active && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
145
145
  className: "closIcon",
@@ -14,7 +14,7 @@
14
14
 
15
15
  .content {
16
16
  position: relative;
17
- width: 60%;
17
+ width: 50%;
18
18
 
19
19
  .card {
20
20
  transform-origin: bottom;
@@ -728,9 +728,11 @@ function (_super) {
728
728
  var _a = this.props,
729
729
  videoId = _a.videoId,
730
730
  opts = _a.opts,
731
- play = _a.play;
731
+ play = _a.play,
732
+ onClick = _a.onClick;
732
733
  return /*#__PURE__*/_react["default"].createElement("div", {
733
- className: "video-container"
734
+ className: "video-container",
735
+ onClick: onClick
734
736
  }, opts.source ? /*#__PURE__*/_react["default"].createElement("div", {
735
737
  className: "video-wrap",
736
738
  id: 'video' + videoId
Binary file
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ require("./index.less");
9
+
10
+ function parseDom(html) {
11
+ var ele = document.createElement('div');
12
+ ele.innerHTML = html;
13
+ return ele.childNodes[0];
14
+ }
15
+
16
+ var rateHtml = "<div class=\"rate-components\">\n <div class=\"current-rate\">1.0x</div>\n <ul class=\"rate-list\">\n <li data-rate=\"2.0\">2.0x</li>\n <li data-rate=\"1.5\">1.5x</li>\n <li data-rate=\"1.0\" class=\"current\">1.0x</li>\n <li data-rate=\"0.5\">0.5x</li>\n </ul>\n</div>";
17
+ /**
18
+ * 倍速播放组件
19
+ */
20
+
21
+ var RateComponent =
22
+ /** @class */
23
+ function () {
24
+ /**
25
+ * @constructor 倍速播放组件构造函数
26
+ */
27
+ function RateComponent() {
28
+ this.html = parseDom(rateHtml);
29
+ }
30
+
31
+ RateComponent.prototype.createEl = function (el) {
32
+ var eleControlbar = el.querySelector('.prism-controlbar');
33
+ eleControlbar.appendChild(this.html);
34
+ };
35
+
36
+ RateComponent.prototype.ready = function (player) {
37
+ var currentRateEle = this.html.querySelector('.current-rate');
38
+ var rateListEle = this.html.querySelector('.rate-list');
39
+ var timeId = null;
40
+ var currentEle = rateListEle.querySelector('.current');
41
+
42
+ if (currentEle) {
43
+ currentEle.className = '';
44
+ }
45
+
46
+ rateListEle.querySelector("[data-rate=\"" + player._speed + "\"]").className = 'current';
47
+ currentRateEle.innerText = player._speed + 'x'; // 隐藏设置里面的倍速播放
48
+
49
+ var settingRate = document.querySelector('.prism-setting-item.prism-setting-speed');
50
+
51
+ if (settingRate) {
52
+ settingRate.classList.add('player-hidden');
53
+ }
54
+
55
+ currentRateEle.onclick = function () {
56
+ rateListEle.style.display = 'block';
57
+ };
58
+
59
+ currentRateEle.onmouseleave = function () {
60
+ timeId = setTimeout(function () {
61
+ rateListEle.style.display = 'none';
62
+ }, 100);
63
+ };
64
+
65
+ rateListEle.onmouseenter = function () {
66
+ clearTimeout(timeId);
67
+ };
68
+
69
+ rateListEle.onmouseleave = function () {
70
+ rateListEle.style.display = 'none';
71
+ };
72
+
73
+ rateListEle.onclick = function (_a) {
74
+ var target = _a.target;
75
+ var rate = target.dataset.rate;
76
+
77
+ if (rate) {
78
+ player.setSpeed(rate);
79
+
80
+ if (target.className !== 'current') {
81
+ var currentEle_1 = rateListEle.querySelector('.current');
82
+
83
+ if (currentEle_1) {
84
+ currentEle_1.className = '';
85
+ }
86
+
87
+ target.className = 'current';
88
+ }
89
+
90
+ rateListEle.style.display = 'none';
91
+ currentRateEle.innerText = rate + 'x';
92
+ }
93
+ };
94
+ };
95
+
96
+ return RateComponent;
97
+ }();
98
+
99
+ var _default = RateComponent;
100
+ exports["default"] = _default;
@@ -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
+ }
Binary file