@fonixtree/magic-design 0.0.182 → 0.0.184
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/Video/index.js +64 -15
- package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +1 -1
- package/es/composite-comp/common/components/ProductItem/index.less +1 -1
- package/es/utils/businessUtil.js +4 -4
- package/es/utils/coreUtil.js +1 -1
- package/lib/common/Video/index.js +64 -15
- package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +1 -1
- package/lib/composite-comp/common/components/ProductItem/index.less +1 -1
- package/lib/utils/businessUtil.js +4 -4
- package/lib/utils/coreUtil.js +1 -1
- package/package.json +1 -1
package/es/common/Video/index.js
CHANGED
|
@@ -207,26 +207,75 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
207
207
|
/** 检查youtube依赖包 */
|
|
208
208
|
var checkYoutuVIdeo = function checkYoutuVIdeo() {
|
|
209
209
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
210
|
+
var scriptUrl, ttPolicy, YT, YTConfig;
|
|
210
211
|
return __generator(this, function (_a) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (!!window.YT) return [3
|
|
214
|
-
/*break*/
|
|
215
|
-
, 2];
|
|
216
|
-
return [4
|
|
217
|
-
/*yield*/
|
|
218
|
-
, Promise.all([(0, _commonUtil.importAsync)('https://www.youtube.com/iframe_api', 'js')])];
|
|
212
|
+
if (!window.YT) {
|
|
213
|
+
scriptUrl = 'https:\/\/www.youtube.com\/s\/player\/36754c51\/www-widgetapi.vflset\/www-widgetapi.js';
|
|
219
214
|
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
try {
|
|
216
|
+
ttPolicy = window.trustedTypes.createPolicy('youtube-widget-api', {
|
|
217
|
+
createScriptURL: function createScriptURL(x) {
|
|
218
|
+
return x;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
scriptUrl = ttPolicy.createScriptURL(scriptUrl);
|
|
222
|
+
} catch (e) {}
|
|
223
|
+
|
|
224
|
+
if (!window['YT']) YT = {
|
|
225
|
+
loading: 0,
|
|
226
|
+
loaded: 0
|
|
227
|
+
};
|
|
228
|
+
if (!window['YTConfig']) YTConfig = {
|
|
229
|
+
host: 'https://www.youtube.com'
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
if (!YT.loading) {
|
|
233
|
+
YT.loading = 1;
|
|
234
|
+
|
|
235
|
+
(function () {
|
|
236
|
+
var l = [];
|
|
237
|
+
|
|
238
|
+
YT.ready = function (f) {
|
|
239
|
+
if (YT.loaded) f();else l.push(f);
|
|
240
|
+
};
|
|
222
241
|
|
|
223
|
-
|
|
242
|
+
window.onYTReady = function () {
|
|
243
|
+
YT.loaded = 1;
|
|
224
244
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
245
|
+
for (var i = 0; i < l.length; i++) {
|
|
246
|
+
try {
|
|
247
|
+
l[i]();
|
|
248
|
+
} catch (e$0) {}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
YT.setConfig = function (c) {
|
|
253
|
+
for (var k in c) {
|
|
254
|
+
if (c.hasOwnProperty(k)) YTConfig[k] = c[k];
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
var a = document.createElement('script');
|
|
259
|
+
a.type = 'text/javascript';
|
|
260
|
+
a.id = 'www-widgetapi-script';
|
|
261
|
+
a.src = scriptUrl;
|
|
262
|
+
a.async = true;
|
|
263
|
+
var c = document.currentScript;
|
|
264
|
+
|
|
265
|
+
if (c) {
|
|
266
|
+
var n = c.nonce || c.getAttribute('nonce');
|
|
267
|
+
if (n) a.setAttribute('nonce', n);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
var b = document.getElementsByTagName('script')[0];
|
|
271
|
+
b.parentNode.insertBefore(a, b);
|
|
272
|
+
})();
|
|
273
|
+
}
|
|
229
274
|
}
|
|
275
|
+
|
|
276
|
+
return [2
|
|
277
|
+
/*return*/
|
|
278
|
+
];
|
|
230
279
|
});
|
|
231
280
|
});
|
|
232
281
|
};
|
|
@@ -77,7 +77,7 @@ function (_super) {
|
|
|
77
77
|
var panelProps = _this.props.panelProps;
|
|
78
78
|
var source = [{
|
|
79
79
|
key: '1',
|
|
80
|
-
name: '
|
|
80
|
+
name: 'Overlay',
|
|
81
81
|
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
82
82
|
data: panelProps.overilay,
|
|
83
83
|
needClickArea: false,
|
package/es/utils/businessUtil.js
CHANGED
|
@@ -81,7 +81,7 @@ var parseUrl = function parseUrl(url) {
|
|
|
81
81
|
case _constants.urlType.ANCHOR:
|
|
82
82
|
// document.getElementById(id) && document.getElementById(id).scrollIntoView({ behavior: 'smooth' });
|
|
83
83
|
params = {
|
|
84
|
-
|
|
84
|
+
action: 'ANCHOR',
|
|
85
85
|
data: {
|
|
86
86
|
id: arg1
|
|
87
87
|
}
|
|
@@ -91,9 +91,9 @@ var parseUrl = function parseUrl(url) {
|
|
|
91
91
|
case _constants.urlType.GET_COUPON:
|
|
92
92
|
// 领取优惠券
|
|
93
93
|
params = {
|
|
94
|
-
|
|
94
|
+
action: 'operation',
|
|
95
95
|
params: {
|
|
96
|
-
|
|
96
|
+
type: 'GET_COUPON',
|
|
97
97
|
couponId: arg1
|
|
98
98
|
}
|
|
99
99
|
};
|
|
@@ -102,7 +102,7 @@ var parseUrl = function parseUrl(url) {
|
|
|
102
102
|
case _constants.urlType.VIDEO:
|
|
103
103
|
// 播放视频
|
|
104
104
|
params = {
|
|
105
|
-
|
|
105
|
+
action: 'operation',
|
|
106
106
|
params: {
|
|
107
107
|
type: 'VIDEO',
|
|
108
108
|
data: (0, _commonUtil.ensure)(function () {
|
package/es/utils/coreUtil.js
CHANGED
|
@@ -207,26 +207,75 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
207
207
|
/** 检查youtube依赖包 */
|
|
208
208
|
var checkYoutuVIdeo = function checkYoutuVIdeo() {
|
|
209
209
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
210
|
+
var scriptUrl, ttPolicy, YT, YTConfig;
|
|
210
211
|
return __generator(this, function (_a) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (!!window.YT) return [3
|
|
214
|
-
/*break*/
|
|
215
|
-
, 2];
|
|
216
|
-
return [4
|
|
217
|
-
/*yield*/
|
|
218
|
-
, Promise.all([(0, _commonUtil.importAsync)('https://www.youtube.com/iframe_api', 'js')])];
|
|
212
|
+
if (!window.YT) {
|
|
213
|
+
scriptUrl = 'https:\/\/www.youtube.com\/s\/player\/36754c51\/www-widgetapi.vflset\/www-widgetapi.js';
|
|
219
214
|
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
try {
|
|
216
|
+
ttPolicy = window.trustedTypes.createPolicy('youtube-widget-api', {
|
|
217
|
+
createScriptURL: function createScriptURL(x) {
|
|
218
|
+
return x;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
scriptUrl = ttPolicy.createScriptURL(scriptUrl);
|
|
222
|
+
} catch (e) {}
|
|
223
|
+
|
|
224
|
+
if (!window['YT']) YT = {
|
|
225
|
+
loading: 0,
|
|
226
|
+
loaded: 0
|
|
227
|
+
};
|
|
228
|
+
if (!window['YTConfig']) YTConfig = {
|
|
229
|
+
host: 'https://www.youtube.com'
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
if (!YT.loading) {
|
|
233
|
+
YT.loading = 1;
|
|
234
|
+
|
|
235
|
+
(function () {
|
|
236
|
+
var l = [];
|
|
237
|
+
|
|
238
|
+
YT.ready = function (f) {
|
|
239
|
+
if (YT.loaded) f();else l.push(f);
|
|
240
|
+
};
|
|
222
241
|
|
|
223
|
-
|
|
242
|
+
window.onYTReady = function () {
|
|
243
|
+
YT.loaded = 1;
|
|
224
244
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
245
|
+
for (var i = 0; i < l.length; i++) {
|
|
246
|
+
try {
|
|
247
|
+
l[i]();
|
|
248
|
+
} catch (e$0) {}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
YT.setConfig = function (c) {
|
|
253
|
+
for (var k in c) {
|
|
254
|
+
if (c.hasOwnProperty(k)) YTConfig[k] = c[k];
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
var a = document.createElement('script');
|
|
259
|
+
a.type = 'text/javascript';
|
|
260
|
+
a.id = 'www-widgetapi-script';
|
|
261
|
+
a.src = scriptUrl;
|
|
262
|
+
a.async = true;
|
|
263
|
+
var c = document.currentScript;
|
|
264
|
+
|
|
265
|
+
if (c) {
|
|
266
|
+
var n = c.nonce || c.getAttribute('nonce');
|
|
267
|
+
if (n) a.setAttribute('nonce', n);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
var b = document.getElementsByTagName('script')[0];
|
|
271
|
+
b.parentNode.insertBefore(a, b);
|
|
272
|
+
})();
|
|
273
|
+
}
|
|
229
274
|
}
|
|
275
|
+
|
|
276
|
+
return [2
|
|
277
|
+
/*return*/
|
|
278
|
+
];
|
|
230
279
|
});
|
|
231
280
|
});
|
|
232
281
|
};
|
|
@@ -77,7 +77,7 @@ function (_super) {
|
|
|
77
77
|
var panelProps = _this.props.panelProps;
|
|
78
78
|
var source = [{
|
|
79
79
|
key: '1',
|
|
80
|
-
name: '
|
|
80
|
+
name: 'Overlay',
|
|
81
81
|
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
82
82
|
data: panelProps.overilay,
|
|
83
83
|
needClickArea: false,
|
|
@@ -81,7 +81,7 @@ var parseUrl = function parseUrl(url) {
|
|
|
81
81
|
case _constants.urlType.ANCHOR:
|
|
82
82
|
// document.getElementById(id) && document.getElementById(id).scrollIntoView({ behavior: 'smooth' });
|
|
83
83
|
params = {
|
|
84
|
-
|
|
84
|
+
action: 'ANCHOR',
|
|
85
85
|
data: {
|
|
86
86
|
id: arg1
|
|
87
87
|
}
|
|
@@ -91,9 +91,9 @@ var parseUrl = function parseUrl(url) {
|
|
|
91
91
|
case _constants.urlType.GET_COUPON:
|
|
92
92
|
// 领取优惠券
|
|
93
93
|
params = {
|
|
94
|
-
|
|
94
|
+
action: 'operation',
|
|
95
95
|
params: {
|
|
96
|
-
|
|
96
|
+
type: 'GET_COUPON',
|
|
97
97
|
couponId: arg1
|
|
98
98
|
}
|
|
99
99
|
};
|
|
@@ -102,7 +102,7 @@ var parseUrl = function parseUrl(url) {
|
|
|
102
102
|
case _constants.urlType.VIDEO:
|
|
103
103
|
// 播放视频
|
|
104
104
|
params = {
|
|
105
|
-
|
|
105
|
+
action: 'operation',
|
|
106
106
|
params: {
|
|
107
107
|
type: 'VIDEO',
|
|
108
108
|
data: (0, _commonUtil.ensure)(function () {
|
package/lib/utils/coreUtil.js
CHANGED