@quintype/components 3.8.7 → 3.8.8-only-react-v19.1

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