@quintype/components 3.0.3-test-react18.1 → 3.0.3-url-decode.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.
Files changed (58) hide show
  1. package/dist/cjs/index.js +1047 -334
  2. package/dist/es/components/access-type.js +229 -51
  3. package/dist/es/components/adbutler-ad.js +14 -10
  4. package/dist/es/components/api-client.js +6 -4
  5. package/dist/es/components/breaking-news-item.js +3 -2
  6. package/dist/es/components/breaking-news.js +15 -1
  7. package/dist/es/components/client-side-only.js +26 -14
  8. package/dist/es/components/collection.js +5 -5
  9. package/dist/es/components/dfp-ad.js +30 -23
  10. package/dist/es/components/eager-load-images.js +9 -1
  11. package/dist/es/components/hamburger-button.js +5 -2
  12. package/dist/es/components/image-gallery.js +13 -10
  13. package/dist/es/components/impl/collection-impl.js +8 -2
  14. package/dist/es/components/impl/gumlet-image.js +15 -8
  15. package/dist/es/components/impl/image-utils.js +3 -3
  16. package/dist/es/components/impl/load-more-stories-manager.js +11 -0
  17. package/dist/es/components/impl/thumbor-image.js +15 -0
  18. package/dist/es/components/infinite-scroll.js +51 -3
  19. package/dist/es/components/infinite-story-base.js +16 -1
  20. package/dist/es/components/lazy-collection.js +8 -8
  21. package/dist/es/components/lazy-load-images.js +66 -36
  22. package/dist/es/components/link-base.js +19 -11
  23. package/dist/es/components/link.js +4 -1
  24. package/dist/es/components/load-more-collection-stories.js +10 -1
  25. package/dist/es/components/load-more-stories-base.js +12 -0
  26. package/dist/es/components/loading-indicator.js +5 -1
  27. package/dist/es/components/menu-item.js +10 -6
  28. package/dist/es/components/menu.js +9 -6
  29. package/dist/es/components/responsive-hero-image.js +3 -1
  30. package/dist/es/components/responsive-image.js +5 -0
  31. package/dist/es/components/responsive-source.js +1 -1
  32. package/dist/es/components/review-rating/review-rating.js +27 -21
  33. package/dist/es/components/review-rating/star-icon.js +5 -3
  34. package/dist/es/components/search-box.js +15 -1
  35. package/dist/es/components/search-page-base.js +10 -1
  36. package/dist/es/components/social-logins/with-facebook-login.js +20 -10
  37. package/dist/es/components/social-logins/with-google-login.js +18 -8
  38. package/dist/es/components/social-logins/with-linkedin-login.js +12 -7
  39. package/dist/es/components/social-logins/with-social-login.js +13 -1
  40. package/dist/es/components/social-logins/with-twitter-login.js +7 -7
  41. package/dist/es/components/social-share.js +15 -1
  42. package/dist/es/components/story-element.js +66 -27
  43. package/dist/es/components/story-elements/dailymotion.js +30 -2
  44. package/dist/es/components/story-elements/jsembed.js +19 -2
  45. package/dist/es/components/story-elements/polltype.js +12 -0
  46. package/dist/es/components/story-elements/table.js +20 -4
  47. package/dist/es/components/story-elements/youtube.js +45 -9
  48. package/dist/es/components/update-on-interval.js +18 -1
  49. package/dist/es/components/with-client-side-only.js +4 -3
  50. package/dist/es/components/with-error.js +12 -1
  51. package/dist/es/components/with-host-url.js +9 -4
  52. package/dist/es/components/with-lazy.js +13 -1
  53. package/dist/es/components/with-member.js +23 -7
  54. package/dist/es/components/with-preview.js +12 -1
  55. package/dist/es/components/wrap-collection-layout.js +16 -4
  56. package/dist/es/store/reducers.js +45 -1
  57. package/dist/es/utils.js +12 -7
  58. package/package.json +6 -9
@@ -5,60 +5,81 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+
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
+
9
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
+
10
13
  import getVideoID from "get-video-id";
11
14
  import { bool, func, object } from "prop-types";
12
15
  import React from "react";
13
16
  import { WithLazy } from "../with-lazy";
14
17
  var DailyMotion = null;
15
18
  var loaderPromise = null;
19
+
16
20
  function loadLibrary() {
17
21
  if (loaderPromise === null) {
18
- loaderPromise = import( /* webpackChunkName: "qtc-react-dailymotion" */"react-dailymotion").then(function (DM) {
22
+ loaderPromise = import(
23
+ /* webpackChunkName: "qtc-react-dailymotion" */
24
+ "react-dailymotion").then(function (DM) {
19
25
  DailyMotion = DM["default"];
20
26
  })["catch"](function (err) {
21
27
  console.log("Failed to load react-dailymotion", err);
22
28
  return Promise.reject();
23
29
  });
24
30
  }
31
+
25
32
  return loaderPromise;
26
33
  }
34
+
27
35
  function isLibraryLoaded() {
28
36
  return DailyMotion !== null;
29
37
  }
38
+
30
39
  var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
31
40
  _inherits(CustomStoryElementDailyMotion, _React$Component);
41
+
32
42
  var _super = /*#__PURE__*/_createSuper(CustomStoryElementDailyMotion);
43
+
33
44
  function CustomStoryElementDailyMotion(props) {
34
45
  var _this;
46
+
35
47
  _classCallCheck(this, CustomStoryElementDailyMotion);
48
+
36
49
  _this = _super.call(this, props);
50
+
37
51
  _defineProperty(_assertThisInitialized(_this), "onPlayCallback", function (event) {
38
52
  _this.props.onPlay === "function" && _this.props.onPlay(event);
39
53
  });
54
+
40
55
  _defineProperty(_assertThisInitialized(_this), "onPauseCallback", function (event) {
41
56
  _this.props.onPause === "function" && _this.props.onPause(event);
42
57
  });
58
+
43
59
  _defineProperty(_assertThisInitialized(_this), "onEndCallback", function (event) {
44
60
  _this.props.onEnd === "function" && _this.props.onEnd(event);
45
61
  });
62
+
46
63
  _defineProperty(_assertThisInitialized(_this), "triggerIframe", function () {
47
64
  _this._isMounted = true;
48
65
  loadLibrary().then(function () {
49
66
  return _this._isMounted && _this.forceUpdate();
50
67
  });
51
68
  });
69
+
52
70
  _defineProperty(_assertThisInitialized(_this), "onPlayerReady", function (event) {
53
71
  event.target.setVolume(100);
54
72
  event.target.playVideo();
55
73
  });
74
+
56
75
  _defineProperty(_assertThisInitialized(_this), "renderVideo", function () {
57
76
  _this.triggerIframe();
77
+
58
78
  _this.setState({
59
79
  showVideo: true
60
80
  });
61
81
  });
82
+
62
83
  _this.state = {
63
84
  showVideo: false
64
85
  };
@@ -69,6 +90,7 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
69
90
  };
70
91
  return _this;
71
92
  }
93
+
72
94
  _createClass(CustomStoryElementDailyMotion, [{
73
95
  key: "componentDidMount",
74
96
  value: function componentDidMount() {
@@ -85,8 +107,10 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
85
107
  key: "render",
86
108
  value: function render() {
87
109
  var _this2 = this;
110
+
88
111
  var _getVideoID = getVideoID(this.props.element.metadata["dailymotion-url"]),
89
- videoId = _getVideoID.id;
112
+ videoId = _getVideoID.id;
113
+
90
114
  var dailymotionIframe = function dailymotionIframe() {
91
115
  return /*#__PURE__*/React.createElement(DailyMotion, {
92
116
  video: videoId,
@@ -97,6 +121,7 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
97
121
  autoplay: true
98
122
  });
99
123
  };
124
+
100
125
  if (this.props.loadIframeOnClick) {
101
126
  return /*#__PURE__*/React.createElement("div", {
102
127
  className: "thumbnail-wrapper"
@@ -123,8 +148,10 @@ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
123
148
  } else return /*#__PURE__*/React.createElement("div", null);
124
149
  }
125
150
  }]);
151
+
126
152
  return CustomStoryElementDailyMotion;
127
153
  }(React.Component);
154
+
128
155
  var StoryElementDailyMotion = function StoryElementDailyMotion(props) {
129
156
  return /*#__PURE__*/React.createElement(WithLazy, {
130
157
  margin: "0px"
@@ -132,4 +159,5 @@ var StoryElementDailyMotion = function StoryElementDailyMotion(props) {
132
159
  return /*#__PURE__*/React.createElement(CustomStoryElementDailyMotion, props);
133
160
  });
134
161
  };
162
+
135
163
  export default StoryElementDailyMotion;
@@ -3,19 +3,26 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
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
+
7
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 atob from "atob";
9
12
  import { string } from "prop-types";
10
13
  import React from "react";
14
+
11
15
  function cloneScriptNode(node) {
12
16
  var script = document.createElement("script");
13
17
  script.text = node.innerHTML;
18
+
14
19
  for (var i = node.attributes.length - 1; i >= 0; i--) {
15
20
  script.setAttribute(node.attributes[i].name, node.attributes[i].value);
16
21
  }
22
+
17
23
  return script;
18
24
  }
25
+
19
26
  function replaceScriptNodes(node) {
20
27
  if (node.tagName === "SCRIPT") {
21
28
  node.parentNode.replaceChild(cloneScriptNode(node), node);
@@ -23,21 +30,28 @@ function replaceScriptNodes(node) {
23
30
  } else {
24
31
  var i = 0;
25
32
  var children = node.childNodes;
33
+
26
34
  while (i < children.length) {
27
35
  replaceScriptNodes(children[i++]);
28
36
  }
29
37
  }
30
38
  }
39
+
31
40
  var JSEmbed = /*#__PURE__*/function (_React$Component) {
32
41
  _inherits(JSEmbed, _React$Component);
42
+
33
43
  var _super = /*#__PURE__*/_createSuper(JSEmbed);
44
+
34
45
  function JSEmbed(props) {
35
46
  var _this;
47
+
36
48
  _classCallCheck(this, JSEmbed);
49
+
37
50
  _this = _super.call(this, props);
38
51
  _this.uniqueId = "anagh";
39
52
  return _this;
40
53
  }
54
+
41
55
  _createClass(JSEmbed, [{
42
56
  key: "shouldComponentUpdate",
43
57
  value: function shouldComponentUpdate(nextProps) {
@@ -56,13 +70,14 @@ var JSEmbed = /*#__PURE__*/function (_React$Component) {
56
70
  }, {
57
71
  key: "getEmbedJS",
58
72
  value: function getEmbedJS() {
59
- var embedjs = this.props.embedJS;
60
- return embedjs != null ? atob(embedjs) : null;
73
+ var embedJs = this.props.embedJS;
74
+ return embedJs != null ? Buffer.from(embedJs, 'base64').toString('utf-8') : null;
61
75
  }
62
76
  }, {
63
77
  key: "render",
64
78
  value: function render() {
65
79
  var _this2 = this;
80
+
66
81
  return /*#__PURE__*/React.createElement("div", {
67
82
  ref: function ref(jsembed) {
68
83
  _this2.JSEmbed = jsembed;
@@ -73,6 +88,8 @@ var JSEmbed = /*#__PURE__*/function (_React$Component) {
73
88
  });
74
89
  }
75
90
  }]);
91
+
76
92
  return JSEmbed;
77
93
  }(React.Component);
94
+
78
95
  export { JSEmbed as default };
@@ -3,18 +3,26 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
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
+
7
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) {
12
16
  _inherits(PolltypeBase, _React$Component);
17
+
13
18
  var _super = /*#__PURE__*/_createSuper(PolltypeBase);
19
+
14
20
  function PolltypeBase() {
15
21
  _classCallCheck(this, PolltypeBase);
22
+
16
23
  return _super.apply(this, arguments);
17
24
  }
25
+
18
26
  _createClass(PolltypeBase, [{
19
27
  key: "componentDidMount",
20
28
  value: function componentDidMount() {
@@ -24,6 +32,7 @@ var PolltypeBase = /*#__PURE__*/function (_React$Component) {
24
32
  key: "loadPolltypeJS",
25
33
  value: function loadPolltypeJS() {
26
34
  var source = this.props.polltypeHost.replace(/^https:|^http:/i, '') + '/embed.js';
35
+
27
36
  if (!global._polltypeAdded) {
28
37
  global._polltypeAdded = true;
29
38
  var script = document.createElement('script');
@@ -40,12 +49,15 @@ var PolltypeBase = /*#__PURE__*/function (_React$Component) {
40
49
  });
41
50
  }
42
51
  }]);
52
+
43
53
  return PolltypeBase;
44
54
  }(React.Component);
55
+
45
56
  function mapStateToProps(state) {
46
57
  return {
47
58
  polltypeHost: state.qt.config["polltype-host"] || defaultPolltypeHost
48
59
  };
49
60
  }
61
+
50
62
  var Polltype = /*#__PURE__*/connect(mapStateToProps, {})(PolltypeBase);
51
63
  export default Polltype;
@@ -3,19 +3,24 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
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
+
7
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
  function TableHeader(columns) {
10
14
  return /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, columns.map(function (col) {
11
15
  return /*#__PURE__*/React.createElement("th", null, col.Header);
12
16
  })));
13
17
  }
18
+
14
19
  export function TableView(_ref) {
15
20
  var data = _ref.data,
16
- columns = _ref.columns,
17
- className = _ref.className,
18
- hasHeader = _ref.hasHeader;
21
+ columns = _ref.columns,
22
+ className = _ref.className,
23
+ hasHeader = _ref.hasHeader;
19
24
  return /*#__PURE__*/React.createElement("table", {
20
25
  className: className
21
26
  }, hasHeader && TableHeader(columns), /*#__PURE__*/React.createElement("tbody", null, data.map(function (row) {
@@ -26,21 +31,29 @@ export function TableView(_ref) {
26
31
  }
27
32
  export var Table = /*#__PURE__*/function (_React$Component) {
28
33
  _inherits(Table, _React$Component);
34
+
29
35
  var _super = /*#__PURE__*/_createSuper(Table);
36
+
30
37
  function Table(props) {
31
38
  var _this;
39
+
32
40
  _classCallCheck(this, Table);
41
+
33
42
  _this = _super.call(this, props);
34
43
  _this.state = {
35
44
  tableData: []
36
45
  };
37
46
  return _this;
38
47
  }
48
+
39
49
  _createClass(Table, [{
40
50
  key: "parseCSVToJson",
41
51
  value: function parseCSVToJson(content) {
42
52
  var _this2 = this;
43
- import( /* webpackChunkName: "qtc-parsecsv" */"papaparse").then(function (_ref2) {
53
+
54
+ import(
55
+ /* webpackChunkName: "qtc-parsecsv" */
56
+ "papaparse").then(function (_ref2) {
44
57
  var parse = _ref2.parse;
45
58
  parse(content, {
46
59
  header: _this2.props.hasHeader,
@@ -74,9 +87,11 @@ export var Table = /*#__PURE__*/function (_React$Component) {
74
87
  key: "render",
75
88
  value: function render() {
76
89
  var _this3 = this;
90
+
77
91
  if (!this.state.tableData.length > 0) {
78
92
  return null;
79
93
  }
94
+
80
95
  var columns = Object.keys(this.state.tableData[0]).map(function (header) {
81
96
  return {
82
97
  Header: header,
@@ -97,5 +112,6 @@ export var Table = /*#__PURE__*/function (_React$Component) {
97
112
  });
98
113
  }
99
114
  }]);
115
+
100
116
  return Table;
101
117
  }(React.Component);
@@ -5,10 +5,15 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
10
+
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12
+
10
13
  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); }; }
14
+
11
15
  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; } }
16
+
12
17
  import getYouTubeID from "get-youtube-id";
13
18
  import { bool, func, object } from "prop-types";
14
19
  import React from "react";
@@ -16,76 +21,101 @@ import { getQliticsSchema } from "../../utils";
16
21
  import { WithLazy } from "../with-lazy";
17
22
  var YouTube = null;
18
23
  var loaderPromise = null;
24
+
19
25
  function loadLibrary() {
20
26
  if (loaderPromise === null) {
21
- loaderPromise = import( /* webpackChunkName: "qtc-react-youtube" */"react-youtube").then(function (YT) {
27
+ loaderPromise = import(
28
+ /* webpackChunkName: "qtc-react-youtube" */
29
+ "react-youtube").then(function (YT) {
22
30
  YouTube = YT["default"];
23
31
  })["catch"](function (err) {
24
32
  console.log("Failed to load react-youtube", err);
25
33
  return Promise.reject();
26
34
  });
27
35
  }
36
+
28
37
  return loaderPromise;
29
38
  }
39
+
30
40
  function isLibraryLoaded() {
31
41
  return YouTube !== null;
32
42
  }
43
+
33
44
  var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
34
45
  _inherits(CustomStoryElementYoutube, _React$Component);
46
+
35
47
  var _super = /*#__PURE__*/_createSuper(CustomStoryElementYoutube);
48
+
36
49
  function CustomStoryElementYoutube(props) {
37
50
  var _this;
51
+
38
52
  _classCallCheck(this, CustomStoryElementYoutube);
53
+
39
54
  _this = _super.call(this, props);
55
+
40
56
  _defineProperty(_assertThisInitialized(_this), "triggerQlitics", function (action) {
41
57
  if (_this.props.disableAnalytics === true) return false;
42
58
  var _this$props = _this.props,
43
- _this$props$story = _this$props.story,
44
- story = _this$props$story === void 0 ? {} : _this$props$story,
45
- _this$props$card = _this$props.card,
46
- card = _this$props$card === void 0 ? {} : _this$props$card,
47
- _this$props$element = _this$props.element,
48
- element = _this$props$element === void 0 ? {} : _this$props$element;
59
+ _this$props$story = _this$props.story,
60
+ story = _this$props$story === void 0 ? {} : _this$props$story,
61
+ _this$props$card = _this$props.card,
62
+ card = _this$props$card === void 0 ? {} : _this$props$card,
63
+ _this$props$element = _this$props.element,
64
+ element = _this$props$element === void 0 ? {} : _this$props$element;
65
+
49
66
  var qliticsData = _objectSpread(_objectSpread({}, getQliticsSchema(story, card, element)), {
50
67
  "story-element-action": action
51
68
  });
69
+
52
70
  if (global.qlitics) {
53
71
  global.qlitics("track", "story-element-action", qliticsData);
54
72
  } else {
55
73
  global.qlitics = global.qlitics || function () {
56
74
  (qlitics.q = qlitics.q || []).push(arguments);
57
75
  };
76
+
58
77
  qlitics.qlitics.q.push("track", "story-element-action", qliticsData);
59
78
  }
60
79
  });
80
+
61
81
  _defineProperty(_assertThisInitialized(_this), "onPlayCallback", function (event) {
62
82
  _this.triggerQlitics("play");
83
+
63
84
  _this.props.onPlay === "function" && _this.props.onPlay(event);
64
85
  });
86
+
65
87
  _defineProperty(_assertThisInitialized(_this), "onPauseCallback", function (event) {
66
88
  _this.triggerQlitics("pause");
89
+
67
90
  _this.props.onPause === "function" && _this.props.onPause(event);
68
91
  });
92
+
69
93
  _defineProperty(_assertThisInitialized(_this), "onEndCallback", function (event) {
70
94
  _this.triggerQlitics("end");
95
+
71
96
  _this.props.onEnd === "function" && _this.props.onEnd(event);
72
97
  });
98
+
73
99
  _defineProperty(_assertThisInitialized(_this), "triggerIframe", function () {
74
100
  _this._isMounted = true;
75
101
  loadLibrary().then(function () {
76
102
  return _this._isMounted && _this.forceUpdate();
77
103
  });
78
104
  });
105
+
79
106
  _defineProperty(_assertThisInitialized(_this), "onPlayerReady", function (event) {
80
107
  event.target.setVolume(100);
81
108
  event.target.playVideo();
82
109
  });
110
+
83
111
  _defineProperty(_assertThisInitialized(_this), "renderVideo", function () {
84
112
  _this.triggerIframe();
113
+
85
114
  _this.setState({
86
115
  showVideo: true
87
116
  });
88
117
  });
118
+
89
119
  _this.state = {
90
120
  showVideo: false
91
121
  };
@@ -96,6 +126,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
96
126
  };
97
127
  return _this;
98
128
  }
129
+
99
130
  _createClass(CustomStoryElementYoutube, [{
100
131
  key: "componentDidMount",
101
132
  value: function componentDidMount() {
@@ -112,6 +143,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
112
143
  key: "render",
113
144
  value: function render() {
114
145
  var _this2 = this;
146
+
115
147
  var youtubeIframe = function youtubeIframe() {
116
148
  return /*#__PURE__*/React.createElement(YouTube, {
117
149
  videoId: getYouTubeID(_this2.props.element.url),
@@ -122,6 +154,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
122
154
  onReady: _this2.onPlayerReady
123
155
  });
124
156
  };
157
+
125
158
  if (this.props.loadIframeOnClick) {
126
159
  return /*#__PURE__*/React.createElement("div", {
127
160
  className: "thumbnail-wrapper"
@@ -148,8 +181,10 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
148
181
  } else return /*#__PURE__*/React.createElement("div", null);
149
182
  }
150
183
  }]);
184
+
151
185
  return CustomStoryElementYoutube;
152
186
  }(React.Component);
187
+
153
188
  var StoryElementYoutube = function StoryElementYoutube(props) {
154
189
  return /*#__PURE__*/React.createElement(WithLazy, {
155
190
  margin: "0px"
@@ -157,4 +192,5 @@ var StoryElementYoutube = function StoryElementYoutube(props) {
157
192
  return /*#__PURE__*/React.createElement(CustomStoryElementYoutube, props);
158
193
  });
159
194
  };
195
+
160
196
  export default StoryElementYoutube;
@@ -5,11 +5,13 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
+
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
+
9
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
+
10
13
  import { any, func, number } from 'prop-types';
11
14
  import React from 'react';
12
-
13
15
  /**
14
16
  * This render props component willupdate it's children via props while executing data loaders sent as props to the component.
15
17
  *
@@ -37,12 +39,17 @@ import React from 'react';
37
39
  * @hideconstructor
38
40
  * @category Other
39
41
  */
42
+
40
43
  export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
41
44
  _inherits(UpdateOnInterval, _React$Component);
45
+
42
46
  var _super = /*#__PURE__*/_createSuper(UpdateOnInterval);
47
+
43
48
  function UpdateOnInterval(props) {
44
49
  var _this;
50
+
45
51
  _classCallCheck(this, UpdateOnInterval);
52
+
46
53
  _this = _super.call(this, props);
47
54
  _this.fetchIntervalIndex = -1;
48
55
  _this.state = {
@@ -50,6 +57,7 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
50
57
  };
51
58
  return _this;
52
59
  }
60
+
53
61
  _createClass(UpdateOnInterval, [{
54
62
  key: "componentDidMount",
55
63
  value: function componentDidMount() {
@@ -64,6 +72,7 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
64
72
  key: "registerInterval",
65
73
  value: function registerInterval() {
66
74
  var _this2 = this;
75
+
67
76
  this.fetchIntervalIndex = setInterval(function () {
68
77
  return _this2.setData();
69
78
  }, this.props.interval);
@@ -86,19 +95,24 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
86
95
  _context.next = 6;
87
96
  break;
88
97
  }
98
+
89
99
  _context.next = 3;
90
100
  return this.props.dataLoader();
101
+
91
102
  case 3:
92
103
  _context.t0 = _context.sent;
93
104
  _context.next = 7;
94
105
  break;
106
+
95
107
  case 6:
96
108
  _context.t0 = {};
109
+
97
110
  case 7:
98
111
  data = _context.t0;
99
112
  this.setState({
100
113
  data: data
101
114
  });
115
+
102
116
  case 9:
103
117
  case "end":
104
118
  return _context.stop();
@@ -106,9 +120,11 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
106
120
  }
107
121
  }, _callee, this);
108
122
  }));
123
+
109
124
  function setData() {
110
125
  return _setData.apply(this, arguments);
111
126
  }
127
+
112
128
  return setData;
113
129
  }()
114
130
  }, {
@@ -121,6 +137,7 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
121
137
  });
122
138
  }
123
139
  }]);
140
+
124
141
  return UpdateOnInterval;
125
142
  }(React.Component);
126
143
  UpdateOnInterval.defaultProps = {
@@ -1,6 +1,5 @@
1
1
  import { connect } from "react-redux";
2
2
  import { mapStateToProps, mapDispatchToProps } from './impl/client-side-only-impl';
3
-
4
3
  /**
5
4
  * This component calls the render prop with `clientSideRendered` = true if the client side is completely loaded, and false during SSR and initial bootup.
6
5
  *
@@ -16,11 +15,13 @@ import { mapStateToProps, mapDispatchToProps } from './impl/client-side-only-imp
16
15
  * @component
17
16
  * @category Other
18
17
  */
18
+
19
19
  export var WithClientSideOnly = /*#__PURE__*/connect(mapStateToProps, mapDispatchToProps)(WithClientSideOnlyBase);
20
+
20
21
  function WithClientSideOnlyBase(_ref) {
21
22
  var _ref$clientSideRender = _ref.clientSideRendered,
22
- clientSideRendered = _ref$clientSideRender === void 0 ? false : _ref$clientSideRender,
23
- children = _ref.children;
23
+ clientSideRendered = _ref$clientSideRender === void 0 ? false : _ref$clientSideRender,
24
+ children = _ref.children;
24
25
  return children({
25
26
  clientSideRendered: clientSideRendered
26
27
  });
@@ -3,15 +3,18 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
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
+
7
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
  function defaultErrorFn(props) {
10
14
  return /*#__PURE__*/React.createElement("span", {
11
15
  className: "qt-error"
12
16
  });
13
17
  }
14
-
15
18
  /**
16
19
  * This function can be used to generate a wrapper component that implements `componentDidCatch()`.
17
20
  *
@@ -32,20 +35,27 @@ function defaultErrorFn(props) {
32
35
  * @category Other
33
36
  * @returns {Component} A component with errors caught
34
37
  */
38
+
39
+
35
40
  export function withError(clazz) {
36
41
  var errorFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultErrorFn;
37
42
  return /*#__PURE__*/function (_React$Component) {
38
43
  _inherits(WithError, _React$Component);
44
+
39
45
  var _super = _createSuper(WithError);
46
+
40
47
  function WithError(props) {
41
48
  var _this;
49
+
42
50
  _classCallCheck(this, WithError);
51
+
43
52
  _this = _super.call(this, props);
44
53
  _this.state = {
45
54
  errored: false
46
55
  };
47
56
  return _this;
48
57
  }
58
+
49
59
  _createClass(WithError, [{
50
60
  key: "componentDidCatch",
51
61
  value: function componentDidCatch(e) {
@@ -73,6 +83,7 @@ export function withError(clazz) {
73
83
  }
74
84
  }
75
85
  }]);
86
+
76
87
  return WithError;
77
88
  }(React.Component);
78
89
  }