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