@quintype/components 3.3.2-brightcove.2 → 3.3.2-check-sub-error.2
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/dist/cjs/index.js
CHANGED
|
@@ -2357,71 +2357,6 @@ var WithLazy = /*#__PURE__*/function (_React$Component) {
|
|
|
2357
2357
|
return WithLazy;
|
|
2358
2358
|
}(React__default["default"].Component);
|
|
2359
2359
|
|
|
2360
|
-
var loaderPromise$2 = null;
|
|
2361
|
-
|
|
2362
|
-
var loadLibrary$2 = function loadLibrary() {
|
|
2363
|
-
if (!loaderPromise$2) {
|
|
2364
|
-
loaderPromise$2 = Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
2365
|
-
/* webpackChunkName: "qtc-react-brightcove" */
|
|
2366
|
-
'@brightcove/react-player-loader')); }).then(function (Bc) {
|
|
2367
|
-
})["catch"](function (err) {
|
|
2368
|
-
console.log('Failed to load @brightcove/react-player-loader', err);
|
|
2369
|
-
return Promise.reject();
|
|
2370
|
-
});
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
return loaderPromise$2;
|
|
2374
|
-
};
|
|
2375
|
-
|
|
2376
|
-
var CustomElementBrightcove = function CustomElementBrightcove(props) {
|
|
2377
|
-
props.element;
|
|
2378
|
-
props.card;
|
|
2379
|
-
props.story;
|
|
2380
|
-
props.disableAnalytics;
|
|
2381
|
-
var loadIframeOnClick = props.loadIframeOnClick;
|
|
2382
|
-
|
|
2383
|
-
var _useState = React.useState(false),
|
|
2384
|
-
_useState2 = _slicedToArray__default["default"](_useState, 2);
|
|
2385
|
-
_useState2[0];
|
|
2386
|
-
_useState2[1];
|
|
2387
|
-
|
|
2388
|
-
React.useEffect(function () {
|
|
2389
|
-
if (!loadIframeOnClick) {
|
|
2390
|
-
loadLibrary$2();
|
|
2391
|
-
}
|
|
2392
|
-
}, [loadIframeOnClick]); // const triggerQlitics = action => {
|
|
2393
|
-
// return (
|
|
2394
|
-
// <div className='thumbnail-wrapper'>
|
|
2395
|
-
// {!showVideo && (
|
|
2396
|
-
// <>
|
|
2397
|
-
// <button className='youtube-playBtn' onClick={renderVideo} aria-label='Play Video' />
|
|
2398
|
-
// <img
|
|
2399
|
-
// className='youtube-thumbnail'
|
|
2400
|
-
// onClick={renderVideo}
|
|
2401
|
-
// src={`https://i.ytimg.com/vi/${getYouTubeID(this.props.element.url)}/hqdefault.jpg`}
|
|
2402
|
-
// alt='video'
|
|
2403
|
-
// />
|
|
2404
|
-
// </>
|
|
2405
|
-
// )}
|
|
2406
|
-
// {showVideo && isLibraryLoaded && <div className='youtube-iframe-wrapper'>{brightcoveIframe()}</div>}
|
|
2407
|
-
// </div>
|
|
2408
|
-
// )
|
|
2409
|
-
// } else if (!loadIframeOnClick && isLibraryLoaded) {
|
|
2410
|
-
// return brightcoveIframe()
|
|
2411
|
-
// } else return <></>
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
return /*#__PURE__*/React__default["default"].createElement("div", null, "sdfadgs");
|
|
2415
|
-
};
|
|
2416
|
-
|
|
2417
|
-
var StoryElementBrightcove = function StoryElementBrightcove(props) {
|
|
2418
|
-
return /*#__PURE__*/React__default["default"].createElement(WithLazy, {
|
|
2419
|
-
margin: "0px"
|
|
2420
|
-
}, function () {
|
|
2421
|
-
return /*#__PURE__*/React__default["default"].createElement(CustomElementBrightcove, props);
|
|
2422
|
-
});
|
|
2423
|
-
};
|
|
2424
|
-
|
|
2425
2360
|
function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
|
|
2426
2361
|
|
|
2427
2362
|
function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -3305,8 +3240,7 @@ var DEFAULT_TEMPLATES = {
|
|
|
3305
3240
|
polltype: StoryElementPolltype,
|
|
3306
3241
|
table: StoryElementTable,
|
|
3307
3242
|
"also-read": StoryElementAlsoRead,
|
|
3308
|
-
file: StoryElementFile
|
|
3309
|
-
"brightcove-video": StoryElementBrightcove
|
|
3243
|
+
file: StoryElementFile
|
|
3310
3244
|
};
|
|
3311
3245
|
|
|
3312
3246
|
var StoryElementBase = /*#__PURE__*/function (_React$Component2) {
|
|
@@ -4746,17 +4680,18 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
4746
4680
|
user = _yield$awaitHelper.data;
|
|
4747
4681
|
|
|
4748
4682
|
if (!error) {
|
|
4749
|
-
_context.next =
|
|
4683
|
+
_context.next = 13;
|
|
4750
4684
|
break;
|
|
4751
4685
|
}
|
|
4752
4686
|
|
|
4753
|
-
console.warn("User context setting failed
|
|
4687
|
+
console.warn("User context setting failed --> ", error);
|
|
4688
|
+
console.log(" setuser failed");
|
|
4754
4689
|
return _context.abrupt("return", error);
|
|
4755
4690
|
|
|
4756
|
-
case
|
|
4691
|
+
case 13:
|
|
4757
4692
|
return _context.abrupt("return", user);
|
|
4758
4693
|
|
|
4759
|
-
case
|
|
4694
|
+
case 14:
|
|
4760
4695
|
case "end":
|
|
4761
4696
|
return _context.stop();
|
|
4762
4697
|
}
|
|
@@ -5059,18 +4994,33 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
5059
4994
|
callback = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : function () {
|
|
5060
4995
|
return null;
|
|
5061
4996
|
};
|
|
5062
|
-
_context8.
|
|
4997
|
+
_context8.prev = 1;
|
|
4998
|
+
_context8.next = 4;
|
|
5063
4999
|
return fetch("/api/v1/access-token/integrations/".concat(_this.props.accessTypeBkIntegrationId));
|
|
5064
5000
|
|
|
5065
|
-
case
|
|
5001
|
+
case 4:
|
|
5066
5002
|
jwtResponse = _context8.sent;
|
|
5067
|
-
_context8.next =
|
|
5003
|
+
_context8.next = 10;
|
|
5004
|
+
break;
|
|
5005
|
+
|
|
5006
|
+
case 7:
|
|
5007
|
+
_context8.prev = 7;
|
|
5008
|
+
_context8.t0 = _context8["catch"](1);
|
|
5009
|
+
console.log("jet resposne error ", _context8.t0);
|
|
5010
|
+
|
|
5011
|
+
case 10:
|
|
5012
|
+
console.log("jwtresponse", jwtResponse);
|
|
5013
|
+
_context8.next = 13;
|
|
5068
5014
|
return awaitHelper(_this.setUser(_this.props.email, _this.props.phone, jwtResponse.headers.get("x-integration-token"), !!jwtResponse.headers.get("x-integration-token")));
|
|
5069
5015
|
|
|
5070
|
-
case
|
|
5016
|
+
case 13:
|
|
5071
5017
|
_yield$awaitHelper7 = _context8.sent;
|
|
5072
5018
|
error = _yield$awaitHelper7.error;
|
|
5073
5019
|
|
|
5020
|
+
if (error) {
|
|
5021
|
+
console.log("error happened in set user ");
|
|
5022
|
+
}
|
|
5023
|
+
|
|
5074
5024
|
if (!error) {
|
|
5075
5025
|
try {
|
|
5076
5026
|
Promise.all([_this.getSubscription(), _this.getPaymentOptions(), _this.getAssetPlans(), _this.getCampaignSubscription()]).then(function (_ref9) {
|
|
@@ -5096,12 +5046,12 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
5096
5046
|
}
|
|
5097
5047
|
}
|
|
5098
5048
|
|
|
5099
|
-
case
|
|
5049
|
+
case 17:
|
|
5100
5050
|
case "end":
|
|
5101
5051
|
return _context8.stop();
|
|
5102
5052
|
}
|
|
5103
5053
|
}
|
|
5104
|
-
}, _callee8);
|
|
5054
|
+
}, _callee8, null, [[1, 7]]);
|
|
5105
5055
|
})));
|
|
5106
5056
|
|
|
5107
5057
|
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "getSubscriptionForUser", /*#__PURE__*/_asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9() {
|
|
@@ -5153,7 +5103,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
5153
5103
|
_this.loadScript(function () {
|
|
5154
5104
|
// dont try to initialize accessType if integration id is not available
|
|
5155
5105
|
if (accessTypeBkIntegrationId === undefined) {
|
|
5156
|
-
console.
|
|
5106
|
+
console.log("AccessType: Integration Id is undefined");
|
|
5157
5107
|
return false;
|
|
5158
5108
|
}
|
|
5159
5109
|
|
|
@@ -110,17 +110,18 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
110
110
|
user = _yield$awaitHelper.data;
|
|
111
111
|
|
|
112
112
|
if (!error) {
|
|
113
|
-
_context.next =
|
|
113
|
+
_context.next = 13;
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
console.warn("User context setting failed
|
|
117
|
+
console.warn("User context setting failed --> ", error);
|
|
118
|
+
console.log(" setuser failed");
|
|
118
119
|
return _context.abrupt("return", error);
|
|
119
120
|
|
|
120
|
-
case
|
|
121
|
+
case 13:
|
|
121
122
|
return _context.abrupt("return", user);
|
|
122
123
|
|
|
123
|
-
case
|
|
124
|
+
case 14:
|
|
124
125
|
case "end":
|
|
125
126
|
return _context.stop();
|
|
126
127
|
}
|
|
@@ -423,18 +424,33 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
423
424
|
callback = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : function () {
|
|
424
425
|
return null;
|
|
425
426
|
};
|
|
426
|
-
_context8.
|
|
427
|
+
_context8.prev = 1;
|
|
428
|
+
_context8.next = 4;
|
|
427
429
|
return fetch("/api/v1/access-token/integrations/".concat(_this.props.accessTypeBkIntegrationId));
|
|
428
430
|
|
|
429
|
-
case
|
|
431
|
+
case 4:
|
|
430
432
|
jwtResponse = _context8.sent;
|
|
431
|
-
_context8.next =
|
|
433
|
+
_context8.next = 10;
|
|
434
|
+
break;
|
|
435
|
+
|
|
436
|
+
case 7:
|
|
437
|
+
_context8.prev = 7;
|
|
438
|
+
_context8.t0 = _context8["catch"](1);
|
|
439
|
+
console.log("jet resposne error ", _context8.t0);
|
|
440
|
+
|
|
441
|
+
case 10:
|
|
442
|
+
console.log("jwtresponse", jwtResponse);
|
|
443
|
+
_context8.next = 13;
|
|
432
444
|
return awaitHelper(_this.setUser(_this.props.email, _this.props.phone, jwtResponse.headers.get("x-integration-token"), !!jwtResponse.headers.get("x-integration-token")));
|
|
433
445
|
|
|
434
|
-
case
|
|
446
|
+
case 13:
|
|
435
447
|
_yield$awaitHelper7 = _context8.sent;
|
|
436
448
|
error = _yield$awaitHelper7.error;
|
|
437
449
|
|
|
450
|
+
if (error) {
|
|
451
|
+
console.log("error happened in set user ");
|
|
452
|
+
}
|
|
453
|
+
|
|
438
454
|
if (!error) {
|
|
439
455
|
try {
|
|
440
456
|
Promise.all([_this.getSubscription(), _this.getPaymentOptions(), _this.getAssetPlans(), _this.getCampaignSubscription()]).then(function (_ref9) {
|
|
@@ -460,12 +476,12 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
460
476
|
}
|
|
461
477
|
}
|
|
462
478
|
|
|
463
|
-
case
|
|
479
|
+
case 17:
|
|
464
480
|
case "end":
|
|
465
481
|
return _context8.stop();
|
|
466
482
|
}
|
|
467
483
|
}
|
|
468
|
-
}, _callee8);
|
|
484
|
+
}, _callee8, null, [[1, 7]]);
|
|
469
485
|
})));
|
|
470
486
|
|
|
471
487
|
_defineProperty(_assertThisInitialized(_this), "getSubscriptionForUser", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
@@ -517,7 +533,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
517
533
|
_this.loadScript(function () {
|
|
518
534
|
// dont try to initialize accessType if integration id is not available
|
|
519
535
|
if (accessTypeBkIntegrationId === undefined) {
|
|
520
|
-
console.
|
|
536
|
+
console.log("AccessType: Integration Id is undefined");
|
|
521
537
|
return false;
|
|
522
538
|
}
|
|
523
539
|
|
|
@@ -22,7 +22,6 @@ import React from "react";
|
|
|
22
22
|
import { getQliticsSchema } from "../utils";
|
|
23
23
|
import { Link } from "./link";
|
|
24
24
|
import { ResponsiveImage } from "./responsive-image";
|
|
25
|
-
import StoryElementBrightcove from "./story-elements/brightcove";
|
|
26
25
|
import StoryElementDailyMotion from "./story-elements/dailymotion";
|
|
27
26
|
import DailyMotionEmbedScript from "./story-elements/dailymotion-embed-script";
|
|
28
27
|
import JSEmbed from "./story-elements/jsembed";
|
|
@@ -228,8 +227,7 @@ var DEFAULT_TEMPLATES = {
|
|
|
228
227
|
polltype: StoryElementPolltype,
|
|
229
228
|
table: StoryElementTable,
|
|
230
229
|
"also-read": StoryElementAlsoRead,
|
|
231
|
-
file: StoryElementFile
|
|
232
|
-
"brightcove-video": StoryElementBrightcove
|
|
230
|
+
file: StoryElementFile
|
|
233
231
|
};
|
|
234
232
|
|
|
235
233
|
var StoryElementBase = /*#__PURE__*/function (_React$Component2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/components",
|
|
3
|
-
"version": "3.3.2-
|
|
3
|
+
"version": "3.3.2-check-sub-error.2",
|
|
4
4
|
"description": "Components to help build Quintype Node.js apps",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"homepage": "https://github.com/quintype/quintype-node-components#readme",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/runtime": "^7.16.3",
|
|
26
|
-
"@brightcove/react-player-loader": "^1.4.2",
|
|
27
26
|
"classnames": "^2.3.1",
|
|
28
27
|
"empty-web-gif": "^1.0.1",
|
|
29
28
|
"get-video-id": "^3.4.3",
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { bool, func, object } from 'prop-types';
|
|
3
|
-
import React, { useEffect, useState } from 'react';
|
|
4
|
-
import { WithLazy } from '../with-lazy';
|
|
5
|
-
var Brightcove = null;
|
|
6
|
-
var loaderPromise = null;
|
|
7
|
-
|
|
8
|
-
var loadLibrary = function loadLibrary() {
|
|
9
|
-
if (!loaderPromise) {
|
|
10
|
-
loaderPromise = import(
|
|
11
|
-
/* webpackChunkName: "qtc-react-brightcove" */
|
|
12
|
-
'@brightcove/react-player-loader').then(function (Bc) {
|
|
13
|
-
Brightcove = Bc["default"];
|
|
14
|
-
})["catch"](function (err) {
|
|
15
|
-
console.log('Failed to load @brightcove/react-player-loader', err);
|
|
16
|
-
return Promise.reject();
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return loaderPromise;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var isLibraryLoaded = Brightcove !== null;
|
|
24
|
-
|
|
25
|
-
var CustomElementBrightcove = function CustomElementBrightcove(props) {
|
|
26
|
-
var _props$element = props.element,
|
|
27
|
-
element = _props$element === void 0 ? {} : _props$element,
|
|
28
|
-
_props$card = props.card,
|
|
29
|
-
card = _props$card === void 0 ? {} : _props$card,
|
|
30
|
-
_props$story = props.story,
|
|
31
|
-
story = _props$story === void 0 ? {} : _props$story,
|
|
32
|
-
disableAnalytics = props.disableAnalytics,
|
|
33
|
-
loadIframeOnClick = props.loadIframeOnClick;
|
|
34
|
-
|
|
35
|
-
var _useState = useState(false),
|
|
36
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
-
showVideo = _useState2[0],
|
|
38
|
-
handleVideoDisplay = _useState2[1];
|
|
39
|
-
|
|
40
|
-
useEffect(function () {
|
|
41
|
-
if (!loadIframeOnClick) {
|
|
42
|
-
loadLibrary();
|
|
43
|
-
}
|
|
44
|
-
}, [loadIframeOnClick]); // const triggerQlitics = action => {
|
|
45
|
-
// if (disableAnalytics) return false
|
|
46
|
-
// const qliticsData = {
|
|
47
|
-
// ...getQliticsSchema(story, card, element),
|
|
48
|
-
// ...{ 'story-element-action': action }
|
|
49
|
-
// }
|
|
50
|
-
// if (global.qlitics) {
|
|
51
|
-
// global.qlitics('track', 'story-element-action', qliticsData)
|
|
52
|
-
// } else {
|
|
53
|
-
// global.qlitics =
|
|
54
|
-
// global.qlitics ||
|
|
55
|
-
// function () {
|
|
56
|
-
// ;(qlitics.q = qlitics.q || []).push(arguments)
|
|
57
|
-
// }
|
|
58
|
-
// qlitics.qlitics.q.push('track', 'story-element-action', qliticsData)
|
|
59
|
-
// }
|
|
60
|
-
// }
|
|
61
|
-
// onPlayCallback = (event) => {
|
|
62
|
-
// this.triggerQlitics("play");
|
|
63
|
-
// this.props.onPlay === "function" && this.props.onPlay(event);
|
|
64
|
-
// };
|
|
65
|
-
// onPauseCallback = (event) => {
|
|
66
|
-
// this.triggerQlitics("pause");
|
|
67
|
-
// this.props.onPause === "function" && this.props.onPause(event);
|
|
68
|
-
// };
|
|
69
|
-
// onEndCallback = (event) => {
|
|
70
|
-
// this.triggerQlitics("end");
|
|
71
|
-
// this.props.onEnd === "function" && this.props.onEnd(event);
|
|
72
|
-
// };
|
|
73
|
-
// onPlayerReady = (event) => {
|
|
74
|
-
// event.target.setVolume(100);
|
|
75
|
-
// event.target.playVideo();
|
|
76
|
-
// };
|
|
77
|
-
|
|
78
|
-
var brightcoveIframe = function brightcoveIframe() {
|
|
79
|
-
var updatedOpts = {
|
|
80
|
-
aspectRatio: '16:9',
|
|
81
|
-
autoplay: true,
|
|
82
|
-
muted: true,
|
|
83
|
-
responsive: true
|
|
84
|
-
};
|
|
85
|
-
return /*#__PURE__*/React.createElement(Brightcove, {
|
|
86
|
-
accountId: get(element, ['metadata', 'account-id']),
|
|
87
|
-
videoId: get(element, ['metadata', 'video-id']),
|
|
88
|
-
playerId: get(element, ['metadata', 'player-id']),
|
|
89
|
-
opts: updatedOpts // onPlay={ this.onPlayCallback}
|
|
90
|
-
// onPause: this.onPauseCallback,
|
|
91
|
-
// onEnd: this.onEndCallback,
|
|
92
|
-
// onReady: this.onPlayerReady,
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
var renderVideo = function renderVideo() {
|
|
98
|
-
loadLibrary();
|
|
99
|
-
handleVideoDisplay(true);
|
|
100
|
-
}; // if (loadIframeOnClick) {
|
|
101
|
-
// return (
|
|
102
|
-
// <div className='thumbnail-wrapper'>
|
|
103
|
-
// {!showVideo && (
|
|
104
|
-
// <>
|
|
105
|
-
// <button className='youtube-playBtn' onClick={renderVideo} aria-label='Play Video' />
|
|
106
|
-
// <img
|
|
107
|
-
// className='youtube-thumbnail'
|
|
108
|
-
// onClick={renderVideo}
|
|
109
|
-
// src={`https://i.ytimg.com/vi/${getYouTubeID(this.props.element.url)}/hqdefault.jpg`}
|
|
110
|
-
// alt='video'
|
|
111
|
-
// />
|
|
112
|
-
// </>
|
|
113
|
-
// )}
|
|
114
|
-
// {showVideo && isLibraryLoaded && <div className='youtube-iframe-wrapper'>{brightcoveIframe()}</div>}
|
|
115
|
-
// </div>
|
|
116
|
-
// )
|
|
117
|
-
// } else if (!loadIframeOnClick && isLibraryLoaded) {
|
|
118
|
-
// return brightcoveIframe()
|
|
119
|
-
// } else return <></>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return /*#__PURE__*/React.createElement("div", null, "sdfadgs");
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
var StoryElementBrightcove = function StoryElementBrightcove(props) {
|
|
126
|
-
return /*#__PURE__*/React.createElement(WithLazy, {
|
|
127
|
-
margin: "0px"
|
|
128
|
-
}, function () {
|
|
129
|
-
return /*#__PURE__*/React.createElement(CustomElementBrightcove, props);
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export default StoryElementBrightcove;
|