@quintype/components 3.8.8-only-react-v19.4 → 3.8.9-razorpay-log.0
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 +2124 -1156
- package/dist/es/components/access-type.js +823 -574
- package/dist/es/components/adbutler-ad.js +14 -10
- package/dist/es/components/api-client.js +6 -4
- package/dist/es/components/breaking-news-item.js +3 -2
- package/dist/es/components/breaking-news.js +23 -7
- package/dist/es/components/client-side-only.js +19 -6
- package/dist/es/components/collection.js +5 -5
- package/dist/es/components/dfp-ad.js +30 -23
- package/dist/es/components/eager-load-images.js +29 -21
- package/dist/es/components/hamburger-button.js +5 -2
- package/dist/es/components/image-gallery.js +13 -10
- package/dist/es/components/impl/collection-impl.js +10 -3
- package/dist/es/components/impl/gumlet-image.js +19 -10
- package/dist/es/components/impl/image-utils.js +4 -3
- package/dist/es/components/impl/load-more-stories-manager.js +19 -6
- package/dist/es/components/impl/thumbor-image.js +97 -52
- package/dist/es/components/infinite-scroll.js +85 -29
- package/dist/es/components/infinite-story-base.js +24 -7
- package/dist/es/components/lazy-collection.js +8 -8
- package/dist/es/components/lazy-load-images.js +58 -24
- package/dist/es/components/link-base.js +19 -11
- package/dist/es/components/link.js +4 -1
- package/dist/es/components/load-more-collection-stories.js +18 -7
- package/dist/es/components/load-more-stories-base.js +20 -6
- package/dist/es/components/loading-indicator.js +5 -1
- package/dist/es/components/menu-item.js +10 -6
- package/dist/es/components/menu.js +9 -6
- package/dist/es/components/responsive-hero-image.js +3 -1
- package/dist/es/components/responsive-image.js +5 -0
- package/dist/es/components/responsive-source.js +1 -1
- package/dist/es/components/review-rating/review-rating.js +27 -21
- package/dist/es/components/review-rating/star-icon.js +5 -3
- package/dist/es/components/search-box.js +23 -7
- package/dist/es/components/search-page-base.js +18 -7
- package/dist/es/components/social-logins/with-facebook-login.js +20 -10
- package/dist/es/components/social-logins/with-google-login.js +18 -8
- package/dist/es/components/social-logins/with-linkedin-login.js +12 -7
- package/dist/es/components/social-logins/with-social-login.js +21 -7
- package/dist/es/components/social-logins/with-twitter-login.js +7 -7
- package/dist/es/components/social-share.js +24 -8
- package/dist/es/components/story-element.js +88 -43
- package/dist/es/components/story-elements/brightcove.js +94 -54
- package/dist/es/components/story-elements/dailymotion-embed-script.js +39 -13
- package/dist/es/components/story-elements/dailymotion.js +61 -19
- package/dist/es/components/story-elements/jsembed.js +30 -10
- package/dist/es/components/story-elements/jwPlayer.js +24 -9
- package/dist/es/components/story-elements/polltype.js +20 -6
- package/dist/es/components/story-elements/table.js +34 -16
- package/dist/es/components/story-elements/youtube.js +73 -24
- package/dist/es/components/update-on-interval.js +52 -31
- package/dist/es/components/with-client-side-only.js +4 -3
- package/dist/es/components/with-error.js +20 -7
- package/dist/es/components/with-host-url.js +9 -4
- package/dist/es/components/with-lazy.js +21 -7
- package/dist/es/components/with-member.js +33 -14
- package/dist/es/components/with-preview.js +20 -7
- package/dist/es/components/wrap-collection-layout.js +16 -4
- package/dist/es/store/reducers.js +45 -1
- package/dist/es/utils.js +12 -7
- package/package.json +7 -16
|
@@ -1,58 +1,79 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
|
|
8
|
-
function
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
function _isNativeReflectConstruct() { 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; } }
|
|
12
|
+
|
|
9
13
|
import React from "react";
|
|
10
14
|
import { disconnectObserver, initiateNewObserver } from "../../utils";
|
|
11
15
|
import { WithLazy } from "../with-lazy";
|
|
16
|
+
|
|
12
17
|
var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
18
|
+
_inherits(DailyMotion, _React$Component);
|
|
19
|
+
|
|
20
|
+
var _super = /*#__PURE__*/_createSuper(DailyMotion);
|
|
21
|
+
|
|
13
22
|
function DailyMotion(props) {
|
|
14
23
|
var _this;
|
|
24
|
+
|
|
15
25
|
_classCallCheck(this, DailyMotion);
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
|
|
27
|
+
_this = _super.call(this, props);
|
|
28
|
+
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "renderVideo", function () {
|
|
18
30
|
_this.setState({
|
|
19
31
|
showVideo: true
|
|
20
32
|
}, function () {
|
|
21
33
|
_this.addScript();
|
|
22
34
|
});
|
|
23
35
|
});
|
|
24
|
-
|
|
36
|
+
|
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "intersectionCallback", function (entries) {
|
|
25
38
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
26
39
|
var player = _this.state.dmPlayer;
|
|
27
40
|
if (videoInVewPort) player.play();else {
|
|
28
41
|
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
42
|
+
|
|
29
43
|
player.pause();
|
|
30
44
|
}
|
|
31
45
|
});
|
|
32
|
-
|
|
46
|
+
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "startObserver", function () {
|
|
33
48
|
var targetElement = _this.observerRef.current;
|
|
49
|
+
|
|
34
50
|
if (_this.intersectionObserver) {
|
|
35
51
|
_this.intersectionObserver.observe(targetElement);
|
|
36
52
|
} else {
|
|
37
53
|
_this.intersectionObserver = initiateNewObserver(targetElement, _this.intersectionCallback);
|
|
38
54
|
}
|
|
39
55
|
});
|
|
40
|
-
|
|
56
|
+
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "handleVideoPause", function () {
|
|
41
58
|
var isVideoPausedByObserver = _this.videoPausedByObserver.current;
|
|
59
|
+
|
|
42
60
|
if (isVideoPausedByObserver) {
|
|
43
61
|
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
44
62
|
} else {
|
|
45
63
|
disconnectObserver(_this.intersectionObserver);
|
|
46
64
|
}
|
|
47
65
|
});
|
|
48
|
-
|
|
66
|
+
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "addScript", function () {
|
|
49
68
|
var _this$props$element$m = _this.props.element.metadata,
|
|
50
|
-
|
|
51
|
-
|
|
69
|
+
videoId = _this$props$element$m["video-id"],
|
|
70
|
+
playerId = _this$props$element$m["player-id"];
|
|
52
71
|
var script = document.createElement("script");
|
|
53
72
|
script.src = "https://geo.dailymotion.com/player/".concat(playerId, ".js");
|
|
54
73
|
script.dataset.video = videoId;
|
|
74
|
+
|
|
55
75
|
_this.containerRef.current.appendChild(script);
|
|
76
|
+
|
|
56
77
|
script.onload = function () {
|
|
57
78
|
window.dailymotion.createPlayer(_this.containerRef.current.id, {
|
|
58
79
|
video: videoId,
|
|
@@ -66,6 +87,7 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
66
87
|
});
|
|
67
88
|
};
|
|
68
89
|
});
|
|
90
|
+
|
|
69
91
|
_this.containerRef = /*#__PURE__*/React.createRef();
|
|
70
92
|
_this.observerRef = /*#__PURE__*/React.createRef();
|
|
71
93
|
_this.videoPausedByObserver = /*#__PURE__*/React.createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
@@ -76,8 +98,8 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
76
98
|
};
|
|
77
99
|
return _this;
|
|
78
100
|
}
|
|
79
|
-
|
|
80
|
-
|
|
101
|
+
|
|
102
|
+
_createClass(DailyMotion, [{
|
|
81
103
|
key: "componentDidMount",
|
|
82
104
|
value: function componentDidMount() {
|
|
83
105
|
if (!this.props.loadIframeOnClick) {
|
|
@@ -104,6 +126,7 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
104
126
|
key: "render",
|
|
105
127
|
value: function render() {
|
|
106
128
|
var videoId = this.props.element.metadata["video-id"];
|
|
129
|
+
|
|
107
130
|
if (this.props.loadIframeOnClick) {
|
|
108
131
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !this.state.showVideo && /*#__PURE__*/React.createElement("div", {
|
|
109
132
|
className: "thumbnail-wrapper"
|
|
@@ -134,7 +157,10 @@ var DailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
134
157
|
}
|
|
135
158
|
}
|
|
136
159
|
}]);
|
|
160
|
+
|
|
161
|
+
return DailyMotion;
|
|
137
162
|
}(React.Component);
|
|
163
|
+
|
|
138
164
|
export default function DailyMotionEmbedScript(props) {
|
|
139
165
|
return /*#__PURE__*/React.createElement(WithLazy, {
|
|
140
166
|
margin: "0px"
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
|
|
8
|
-
function
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
function _isNativeReflectConstruct() { 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; } }
|
|
12
|
+
|
|
9
13
|
import getVideoID from "get-video-id";
|
|
10
14
|
import { bool, func, object } from "prop-types";
|
|
11
15
|
import React from "react";
|
|
@@ -13,81 +17,110 @@ import { disconnectObserver, initiateNewObserver } from "../../utils";
|
|
|
13
17
|
import { WithLazy } from "../with-lazy";
|
|
14
18
|
var DailyMotion = null;
|
|
15
19
|
var loaderPromise = null;
|
|
20
|
+
|
|
16
21
|
function loadLibrary() {
|
|
17
22
|
if (loaderPromise === null) {
|
|
18
|
-
loaderPromise = import(
|
|
23
|
+
loaderPromise = import(
|
|
24
|
+
/* webpackChunkName: "qtc-react-dailymotion" */
|
|
25
|
+
"react-dailymotion").then(function (DM) {
|
|
19
26
|
DailyMotion = DM["default"];
|
|
20
27
|
})["catch"](function (err) {
|
|
21
28
|
console.log("Failed to load react-dailymotion", err);
|
|
22
29
|
return Promise.reject();
|
|
23
30
|
});
|
|
24
31
|
}
|
|
32
|
+
|
|
25
33
|
return loaderPromise;
|
|
26
34
|
}
|
|
35
|
+
|
|
27
36
|
function isLibraryLoaded() {
|
|
28
37
|
return DailyMotion !== null;
|
|
29
38
|
}
|
|
39
|
+
|
|
30
40
|
var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
41
|
+
_inherits(CustomStoryElementDailyMotion, _React$Component);
|
|
42
|
+
|
|
43
|
+
var _super = /*#__PURE__*/_createSuper(CustomStoryElementDailyMotion);
|
|
44
|
+
|
|
31
45
|
function CustomStoryElementDailyMotion(props) {
|
|
32
46
|
var _this;
|
|
47
|
+
|
|
33
48
|
_classCallCheck(this, CustomStoryElementDailyMotion);
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
|
|
50
|
+
_this = _super.call(this, props);
|
|
51
|
+
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "startObserver", function (targetElement) {
|
|
36
53
|
if (_this.intersectionObserver) {
|
|
37
54
|
_this.intersectionObserver.observe(targetElement);
|
|
38
55
|
} else {
|
|
39
56
|
_this.intersectionObserver = initiateNewObserver(targetElement, _this.intersectionCallback);
|
|
40
57
|
}
|
|
41
58
|
});
|
|
42
|
-
|
|
59
|
+
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "onAdPlayCallback", function (event) {
|
|
43
61
|
var targetElement = event.target;
|
|
44
62
|
_this.videoRef.current = targetElement;
|
|
63
|
+
|
|
45
64
|
_this.startObserver(targetElement);
|
|
46
65
|
});
|
|
47
|
-
|
|
66
|
+
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "onPlayCallback", function (event) {
|
|
48
68
|
_this.props.onPlay === "function" && _this.props.onPlay(event);
|
|
49
69
|
var targetElement = event.target;
|
|
50
70
|
_this.videoRef.current = targetElement;
|
|
71
|
+
|
|
51
72
|
_this.startObserver(targetElement);
|
|
52
73
|
});
|
|
53
|
-
|
|
74
|
+
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "handleVideoPause", function () {
|
|
54
76
|
var videoPausedByObserver = _this.videoPausedByObserver.current;
|
|
77
|
+
|
|
55
78
|
if (videoPausedByObserver) {
|
|
56
79
|
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
57
80
|
} else {
|
|
58
81
|
disconnectObserver(_this.intersectionObserver);
|
|
59
82
|
}
|
|
60
83
|
});
|
|
61
|
-
|
|
84
|
+
|
|
85
|
+
_defineProperty(_assertThisInitialized(_this), "intersectionCallback", function (entries) {
|
|
62
86
|
var player = _this.videoRef.current;
|
|
63
87
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
64
88
|
if (videoInVewPort) player.play();else {
|
|
65
89
|
_this.videoPausedByObserver.current = true; // before the below line fires the pause event we set the videoPausedByObserver Ref to true, this lets the pause events callback to know that the video is not click-paused by the user but paused by the intersection observer
|
|
90
|
+
|
|
66
91
|
player.pause();
|
|
67
92
|
}
|
|
68
93
|
});
|
|
69
|
-
|
|
94
|
+
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "onPauseCallback", function (event) {
|
|
70
96
|
_this.props.onPause === "function" && _this.props.onPause(event);
|
|
97
|
+
|
|
71
98
|
_this.handleVideoPause();
|
|
72
99
|
});
|
|
73
|
-
|
|
100
|
+
|
|
101
|
+
_defineProperty(_assertThisInitialized(_this), "onAdPauseCallback", function () {
|
|
74
102
|
_this.handleVideoPause();
|
|
75
103
|
});
|
|
76
|
-
|
|
104
|
+
|
|
105
|
+
_defineProperty(_assertThisInitialized(_this), "onEndCallback", function (event) {
|
|
77
106
|
_this.props.onEnd === "function" && _this.props.onEnd(event);
|
|
78
107
|
});
|
|
79
|
-
|
|
108
|
+
|
|
109
|
+
_defineProperty(_assertThisInitialized(_this), "triggerIframe", function () {
|
|
80
110
|
_this._isMounted = true;
|
|
81
111
|
loadLibrary().then(function () {
|
|
82
112
|
return _this._isMounted && _this.forceUpdate();
|
|
83
113
|
});
|
|
84
114
|
});
|
|
85
|
-
|
|
115
|
+
|
|
116
|
+
_defineProperty(_assertThisInitialized(_this), "renderVideo", function () {
|
|
86
117
|
_this.triggerIframe();
|
|
118
|
+
|
|
87
119
|
_this.setState({
|
|
88
120
|
showVideo: true
|
|
89
121
|
});
|
|
90
122
|
});
|
|
123
|
+
|
|
91
124
|
_this.state = {
|
|
92
125
|
showVideo: false
|
|
93
126
|
};
|
|
@@ -98,10 +131,11 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
98
131
|
};
|
|
99
132
|
_this.videoRef = /*#__PURE__*/React.createRef();
|
|
100
133
|
_this.videoPausedByObserver = /*#__PURE__*/React.createRef(); // To check if the video is not click paused by user but paused by intersection observer, Its implemented this way because we cannot capture the click-pause event as videos are playing in iframe
|
|
134
|
+
|
|
101
135
|
return _this;
|
|
102
136
|
}
|
|
103
|
-
|
|
104
|
-
|
|
137
|
+
|
|
138
|
+
_createClass(CustomStoryElementDailyMotion, [{
|
|
105
139
|
key: "componentDidMount",
|
|
106
140
|
value: function componentDidMount() {
|
|
107
141
|
if (!this.props.loadIframeOnClick) {
|
|
@@ -118,11 +152,14 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
118
152
|
key: "render",
|
|
119
153
|
value: function render() {
|
|
120
154
|
var _this2 = this;
|
|
155
|
+
|
|
121
156
|
var _getVideoID = getVideoID(this.props.element.metadata["dailymotion-url"]),
|
|
122
|
-
|
|
157
|
+
videoId = _getVideoID.id;
|
|
158
|
+
|
|
123
159
|
var dailymotionIframe = function dailymotionIframe() {
|
|
124
160
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false,
|
|
125
|
-
|
|
161
|
+
autoplay = _ref.autoplay;
|
|
162
|
+
|
|
126
163
|
return /*#__PURE__*/React.createElement(DailyMotion, {
|
|
127
164
|
video: videoId,
|
|
128
165
|
opts: _this2.opts,
|
|
@@ -135,6 +172,7 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
135
172
|
ref: _this2.videoRef
|
|
136
173
|
});
|
|
137
174
|
};
|
|
175
|
+
|
|
138
176
|
if (this.props.loadIframeOnClick) {
|
|
139
177
|
return /*#__PURE__*/React.createElement("div", {
|
|
140
178
|
className: "thumbnail-wrapper"
|
|
@@ -155,7 +193,10 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
|
|
|
155
193
|
} else return /*#__PURE__*/React.createElement("div", null);
|
|
156
194
|
}
|
|
157
195
|
}]);
|
|
196
|
+
|
|
197
|
+
return CustomStoryElementDailyMotion;
|
|
158
198
|
}(React.Component);
|
|
199
|
+
|
|
159
200
|
var StoryElementDailyMotion = function StoryElementDailyMotion(props) {
|
|
160
201
|
return /*#__PURE__*/React.createElement(WithLazy, {
|
|
161
202
|
margin: "0px"
|
|
@@ -163,4 +204,5 @@ var StoryElementDailyMotion = function StoryElementDailyMotion(props) {
|
|
|
163
204
|
return /*#__PURE__*/React.createElement(CustomStoryElementDailyMotion, props);
|
|
164
205
|
});
|
|
165
206
|
};
|
|
207
|
+
|
|
166
208
|
export default StoryElementDailyMotion;
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
function _isNativeReflectConstruct() { 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; } }
|
|
10
|
+
|
|
8
11
|
import { string } from "prop-types";
|
|
9
12
|
import React from "react";
|
|
13
|
+
|
|
10
14
|
function cloneScriptNode(node) {
|
|
11
15
|
var script = document.createElement("script");
|
|
12
16
|
script.text = node.innerHTML;
|
|
17
|
+
|
|
13
18
|
for (var i = node.attributes.length - 1; i >= 0; i--) {
|
|
14
19
|
script.setAttribute(node.attributes[i].name, node.attributes[i].value);
|
|
15
20
|
}
|
|
21
|
+
|
|
16
22
|
return script;
|
|
17
23
|
}
|
|
24
|
+
|
|
18
25
|
function replaceScriptNodes(node) {
|
|
19
26
|
if (node.tagName === "SCRIPT") {
|
|
20
27
|
node.parentNode.replaceChild(cloneScriptNode(node), node);
|
|
@@ -22,21 +29,29 @@ function replaceScriptNodes(node) {
|
|
|
22
29
|
} else {
|
|
23
30
|
var i = 0;
|
|
24
31
|
var children = node.childNodes;
|
|
32
|
+
|
|
25
33
|
while (i < children.length) {
|
|
26
34
|
replaceScriptNodes(children[i++]);
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
}
|
|
38
|
+
|
|
30
39
|
var JSEmbed = /*#__PURE__*/function (_React$Component) {
|
|
40
|
+
_inherits(JSEmbed, _React$Component);
|
|
41
|
+
|
|
42
|
+
var _super = /*#__PURE__*/_createSuper(JSEmbed);
|
|
43
|
+
|
|
31
44
|
function JSEmbed(props) {
|
|
32
45
|
var _this;
|
|
46
|
+
|
|
33
47
|
_classCallCheck(this, JSEmbed);
|
|
34
|
-
|
|
48
|
+
|
|
49
|
+
_this = _super.call(this, props);
|
|
35
50
|
_this.uniqueId = "anagh";
|
|
36
51
|
return _this;
|
|
37
52
|
}
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
|
|
54
|
+
_createClass(JSEmbed, [{
|
|
40
55
|
key: "shouldComponentUpdate",
|
|
41
56
|
value: function shouldComponentUpdate(nextProps) {
|
|
42
57
|
return !(this.props.id === nextProps.id && this.props.embedJS === nextProps.embedJS);
|
|
@@ -56,13 +71,14 @@ var JSEmbed = /*#__PURE__*/function (_React$Component) {
|
|
|
56
71
|
value: function getEmbedJS() {
|
|
57
72
|
var embedJs = this.props.embedJS;
|
|
58
73
|
if (!embedJs) return null;
|
|
74
|
+
|
|
59
75
|
if (global) {
|
|
60
76
|
return decodeURIComponent(escape(global.atob(embedJs)));
|
|
61
77
|
}
|
|
78
|
+
|
|
62
79
|
return Buffer.from(embedJs, "base64").toString("utf-8");
|
|
63
|
-
}
|
|
80
|
+
} // Method to check the innerHTMLEmbedFile is from Facebook or not
|
|
64
81
|
|
|
65
|
-
// Method to check the innerHTMLEmbedFile is from Facebook or not
|
|
66
82
|
}, {
|
|
67
83
|
key: "checkFacebookURL",
|
|
68
84
|
value: function checkFacebookURL(innerHTMLEmbedFile) {
|
|
@@ -72,8 +88,9 @@ var JSEmbed = /*#__PURE__*/function (_React$Component) {
|
|
|
72
88
|
key: "render",
|
|
73
89
|
value: function render() {
|
|
74
90
|
var _this2 = this;
|
|
75
|
-
|
|
76
|
-
// isFacebookFileEmbedded will add a new className for changing the iframe style only for facebook
|
|
91
|
+
|
|
92
|
+
var innerHTMLEmbedFile = this.getEmbedJS(); // isFacebookFileEmbedded will add a new className for changing the iframe style only for facebook
|
|
93
|
+
|
|
77
94
|
var isFacebookFileEmbedded = this.checkFacebookURL(innerHTMLEmbedFile);
|
|
78
95
|
return /*#__PURE__*/React.createElement("div", {
|
|
79
96
|
className: "jsembed-wrapper ".concat(isFacebookFileEmbedded ? 'facebook-jsembed' : ''),
|
|
@@ -86,5 +103,8 @@ var JSEmbed = /*#__PURE__*/function (_React$Component) {
|
|
|
86
103
|
});
|
|
87
104
|
}
|
|
88
105
|
}]);
|
|
106
|
+
|
|
107
|
+
return JSEmbed;
|
|
89
108
|
}(React.Component);
|
|
109
|
+
|
|
90
110
|
export { JSEmbed as default };
|
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
function _isNativeReflectConstruct() { 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; } }
|
|
10
|
+
|
|
8
11
|
import React from 'react';
|
|
12
|
+
|
|
9
13
|
var JWPlayerComponent = /*#__PURE__*/function (_React$Component) {
|
|
14
|
+
_inherits(JWPlayerComponent, _React$Component);
|
|
15
|
+
|
|
16
|
+
var _super = /*#__PURE__*/_createSuper(JWPlayerComponent);
|
|
17
|
+
|
|
10
18
|
function JWPlayerComponent(props) {
|
|
11
19
|
_classCallCheck(this, JWPlayerComponent);
|
|
12
|
-
|
|
20
|
+
|
|
21
|
+
return _super.call(this, props);
|
|
13
22
|
}
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
|
|
24
|
+
_createClass(JWPlayerComponent, [{
|
|
16
25
|
key: "render",
|
|
17
26
|
value: function render() {
|
|
18
27
|
var _ref = this.props || {},
|
|
19
|
-
|
|
28
|
+
element = _ref.element;
|
|
29
|
+
|
|
20
30
|
var _ref2 = element || {},
|
|
21
|
-
|
|
31
|
+
metadata = _ref2.metadata;
|
|
32
|
+
|
|
22
33
|
var _ref3 = metadata || {},
|
|
23
|
-
|
|
34
|
+
playerUrl = _ref3["player-url"];
|
|
35
|
+
|
|
24
36
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
37
|
className: "jw-player-container"
|
|
26
38
|
}, /*#__PURE__*/React.createElement("iframe", {
|
|
@@ -31,5 +43,8 @@ var JWPlayerComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
31
43
|
}));
|
|
32
44
|
}
|
|
33
45
|
}]);
|
|
46
|
+
|
|
47
|
+
return JWPlayerComponent;
|
|
34
48
|
}(React.Component);
|
|
49
|
+
|
|
35
50
|
export default JWPlayerComponent;
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
function _isNativeReflectConstruct() { 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; } }
|
|
10
|
+
|
|
8
11
|
import React from 'react';
|
|
9
12
|
import { connect } from 'react-redux';
|
|
10
13
|
var defaultPolltypeHost = 'https://www.polltype.com';
|
|
14
|
+
|
|
11
15
|
var PolltypeBase = /*#__PURE__*/function (_React$Component) {
|
|
16
|
+
_inherits(PolltypeBase, _React$Component);
|
|
17
|
+
|
|
18
|
+
var _super = /*#__PURE__*/_createSuper(PolltypeBase);
|
|
19
|
+
|
|
12
20
|
function PolltypeBase() {
|
|
13
21
|
_classCallCheck(this, PolltypeBase);
|
|
14
|
-
|
|
22
|
+
|
|
23
|
+
return _super.apply(this, arguments);
|
|
15
24
|
}
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
|
|
26
|
+
_createClass(PolltypeBase, [{
|
|
18
27
|
key: "componentDidMount",
|
|
19
28
|
value: function componentDidMount() {
|
|
20
29
|
this.loadPolltypeJS();
|
|
@@ -23,6 +32,7 @@ var PolltypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
23
32
|
key: "loadPolltypeJS",
|
|
24
33
|
value: function loadPolltypeJS() {
|
|
25
34
|
var source = this.props.polltypeHost.replace(/^https:|^http:/i, '') + '/embed.js';
|
|
35
|
+
|
|
26
36
|
if (!global._polltypeAdded) {
|
|
27
37
|
global._polltypeAdded = true;
|
|
28
38
|
var script = document.createElement('script');
|
|
@@ -39,11 +49,15 @@ var PolltypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
39
49
|
});
|
|
40
50
|
}
|
|
41
51
|
}]);
|
|
52
|
+
|
|
53
|
+
return PolltypeBase;
|
|
42
54
|
}(React.Component);
|
|
55
|
+
|
|
43
56
|
function mapStateToProps(state) {
|
|
44
57
|
return {
|
|
45
58
|
polltypeHost: state.qt.config["polltype-host"] || defaultPolltypeHost
|
|
46
59
|
};
|
|
47
60
|
}
|
|
61
|
+
|
|
48
62
|
var Polltype = /*#__PURE__*/connect(mapStateToProps, {})(PolltypeBase);
|
|
49
63
|
export default Polltype;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
+
|
|
10
|
+
function _isNativeReflectConstruct() { 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; } }
|
|
11
|
+
|
|
9
12
|
import React from "react";
|
|
13
|
+
|
|
10
14
|
function TableHeader(columns) {
|
|
11
15
|
return /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, columns.map(function (col) {
|
|
12
16
|
return /*#__PURE__*/React.createElement("th", null, col);
|
|
13
17
|
})));
|
|
14
18
|
}
|
|
19
|
+
|
|
15
20
|
export function TableView(_ref) {
|
|
16
21
|
var data = _ref.data,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
_ref$columns = _ref.columns,
|
|
23
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
hasHeader = _ref.hasHeader;
|
|
21
26
|
return /*#__PURE__*/React.createElement("table", {
|
|
22
27
|
className: className
|
|
23
28
|
}, hasHeader && TableHeader(columns), /*#__PURE__*/React.createElement("tbody", null, data.map(function (row) {
|
|
@@ -27,21 +32,30 @@ export function TableView(_ref) {
|
|
|
27
32
|
})));
|
|
28
33
|
}
|
|
29
34
|
export var Table = /*#__PURE__*/function (_React$Component) {
|
|
35
|
+
_inherits(Table, _React$Component);
|
|
36
|
+
|
|
37
|
+
var _super = /*#__PURE__*/_createSuper(Table);
|
|
38
|
+
|
|
30
39
|
function Table(props) {
|
|
31
40
|
var _this;
|
|
41
|
+
|
|
32
42
|
_classCallCheck(this, Table);
|
|
33
|
-
|
|
43
|
+
|
|
44
|
+
_this = _super.call(this, props);
|
|
34
45
|
_this.state = {
|
|
35
46
|
tableData: []
|
|
36
47
|
};
|
|
37
48
|
return _this;
|
|
38
49
|
}
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
|
|
51
|
+
_createClass(Table, [{
|
|
41
52
|
key: "parseCSVToJson",
|
|
42
53
|
value: function parseCSVToJson(content) {
|
|
43
54
|
var _this2 = this;
|
|
44
|
-
|
|
55
|
+
|
|
56
|
+
import(
|
|
57
|
+
/* webpackChunkName: "qtc-parsecsv" */
|
|
58
|
+
"papaparse").then(function (_ref2) {
|
|
45
59
|
var parse = _ref2.parse;
|
|
46
60
|
parse(content, {
|
|
47
61
|
header: false,
|
|
@@ -49,8 +63,8 @@ export var Table = /*#__PURE__*/function (_React$Component) {
|
|
|
49
63
|
return _this2._isMounted && _this2.setState({
|
|
50
64
|
tableData: results.data
|
|
51
65
|
});
|
|
52
|
-
}
|
|
53
|
-
|
|
66
|
+
} // with header true, the order of columns in table is not guaranteed by papaparse library, so we will parse including the header as table data and handle it after.
|
|
67
|
+
|
|
54
68
|
});
|
|
55
69
|
});
|
|
56
70
|
}
|
|
@@ -78,10 +92,12 @@ export var Table = /*#__PURE__*/function (_React$Component) {
|
|
|
78
92
|
if (!this.state.tableData.length > 0) {
|
|
79
93
|
return null;
|
|
80
94
|
}
|
|
95
|
+
|
|
81
96
|
var _ref3 = this.props.hasHeader ? [this.state.tableData[0], this.state.tableData.slice(1)] : [[], this.state.tableData],
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
_ref4 = _slicedToArray(_ref3, 2),
|
|
98
|
+
columns = _ref4[0],
|
|
99
|
+
tableData = _ref4[1];
|
|
100
|
+
|
|
85
101
|
var className = "story-element-table-".concat(this.props.id);
|
|
86
102
|
return /*#__PURE__*/React.createElement(this.props.tableComponent || TableView, {
|
|
87
103
|
hasHeader: this.props.hasHeader,
|
|
@@ -93,4 +109,6 @@ export var Table = /*#__PURE__*/function (_React$Component) {
|
|
|
93
109
|
});
|
|
94
110
|
}
|
|
95
111
|
}]);
|
|
112
|
+
|
|
113
|
+
return Table;
|
|
96
114
|
}(React.Component);
|