@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,19 +1,13 @@
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 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
-
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
-
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
-
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
11
  import getYouTubeID from 'get-youtube-id';
18
12
  import { bool, func, object } from 'prop-types';
19
13
  import React from 'react';
@@ -21,26 +15,20 @@ import { disconnectObserver, getQliticsSchema, initiateNewObserver } from '../..
21
15
  import { WithLazy } from '../with-lazy';
22
16
  var YouTube = null;
23
17
  var loaderPromise = null;
24
-
25
18
  function loadLibrary() {
26
19
  if (loaderPromise === null) {
27
- loaderPromise = import(
28
- /* webpackChunkName: "qtc-react-youtube" */
29
- 'react-youtube').then(function (YT) {
20
+ loaderPromise = import(/* webpackChunkName: "qtc-react-youtube" */'react-youtube').then(function (YT) {
30
21
  YouTube = YT["default"];
31
22
  })["catch"](function (err) {
32
23
  console.log('Failed to load react-youtube', err);
33
24
  return Promise.reject();
34
25
  });
35
26
  }
36
-
37
27
  return loaderPromise;
38
28
  }
39
-
40
29
  function isLibraryLoaded() {
41
30
  return YouTube !== null;
42
31
  }
43
-
44
32
  function getYoutubeButton(onClick) {
45
33
  return /*#__PURE__*/React.createElement("button", {
46
34
  onClick: onClick,
@@ -60,118 +48,88 @@ function getYoutubeButton(onClick) {
60
48
  fill: "white"
61
49
  })));
62
50
  }
63
-
64
51
  var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
65
- _inherits(CustomStoryElementYoutube, _React$Component);
66
-
67
- var _super = /*#__PURE__*/_createSuper(CustomStoryElementYoutube);
68
-
69
52
  function CustomStoryElementYoutube(props) {
70
53
  var _this;
71
-
72
54
  _classCallCheck(this, CustomStoryElementYoutube);
73
-
74
- _this = _super.call(this, props);
75
-
76
- _defineProperty(_assertThisInitialized(_this), "initiateObserver", function (targetElement) {
55
+ _this = _callSuper(this, CustomStoryElementYoutube, [props]);
56
+ _defineProperty(_this, "initiateObserver", function (targetElement) {
77
57
  _this.removeObserverIfExists();
78
-
79
58
  _this.intersectionObserver = new IntersectionObserver(_this.intersectionCallback, {
80
59
  threshold: 0.75
81
60
  });
82
-
83
61
  _this.intersectionObserver.observe(targetElement);
84
62
  });
85
-
86
- _defineProperty(_assertThisInitialized(_this), "triggerQlitics", function (action) {
63
+ _defineProperty(_this, "triggerQlitics", function (action) {
87
64
  if (_this.props.disableAnalytics === true) return false;
88
65
  var _this$props = _this.props,
89
- _this$props$story = _this$props.story,
90
- story = _this$props$story === void 0 ? {} : _this$props$story,
91
- _this$props$card = _this$props.card,
92
- card = _this$props$card === void 0 ? {} : _this$props$card,
93
- _this$props$element = _this$props.element,
94
- element = _this$props$element === void 0 ? {} : _this$props$element;
95
-
66
+ _this$props$story = _this$props.story,
67
+ story = _this$props$story === void 0 ? {} : _this$props$story,
68
+ _this$props$card = _this$props.card,
69
+ card = _this$props$card === void 0 ? {} : _this$props$card,
70
+ _this$props$element = _this$props.element,
71
+ element = _this$props$element === void 0 ? {} : _this$props$element;
96
72
  var qliticsData = _objectSpread(_objectSpread({}, getQliticsSchema(story, card, element)), {
97
73
  'story-element-action': action
98
74
  });
99
-
100
75
  if (global.qlitics) {
101
76
  global.qlitics('track', 'story-element-action', qliticsData);
102
77
  } else {
103
78
  global.qlitics = global.qlitics || function () {
104
79
  (qlitics.q = qlitics.q || []).push(arguments);
105
80
  };
106
-
107
81
  qlitics.qlitics.q.push('track', 'story-element-action', qliticsData);
108
82
  }
109
83
  });
110
-
111
- _defineProperty(_assertThisInitialized(_this), "onPlayCallback", function (event) {
84
+ _defineProperty(_this, "onPlayCallback", function (event) {
112
85
  _this.triggerQlitics('play');
113
-
114
86
  _this.props.onPlay === 'function' && _this.props.onPlay(event);
115
87
  _this.videoRef.current = event.target;
116
-
117
88
  var targetElement = _this.videoRef.current.getIframe();
118
-
119
89
  if (_this.intersectionObserver) {
120
90
  _this.intersectionObserver.observe(targetElement);
121
91
  } else {
122
92
  _this.intersectionObserver = initiateNewObserver(targetElement, _this.intersectionCallback);
123
93
  }
124
94
  });
125
-
126
- _defineProperty(_assertThisInitialized(_this), "intersectionCallback", function (entries) {
95
+ _defineProperty(_this, "intersectionCallback", function (entries) {
127
96
  var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
128
97
  var player = _this.videoRef.current;
129
98
  if (videoInVewPort) player.playVideo();else {
130
99
  _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
131
-
132
100
  player.pauseVideo();
133
101
  }
134
102
  });
135
-
136
- _defineProperty(_assertThisInitialized(_this), "onPauseCallback", function (event) {
103
+ _defineProperty(_this, "onPauseCallback", function (event) {
137
104
  _this.triggerQlitics('pause');
138
-
139
105
  _this.props.onPause === 'function' && _this.props.onPause(event);
140
106
  var videoPausedByObserver = _this.videoPausedByObserver.current;
141
-
142
107
  if (videoPausedByObserver) {
143
108
  _this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
144
109
  } else {
145
110
  disconnectObserver(_this.intersectionObserver);
146
111
  }
147
112
  });
148
-
149
- _defineProperty(_assertThisInitialized(_this), "onEndCallback", function (event) {
113
+ _defineProperty(_this, "onEndCallback", function (event) {
150
114
  _this.triggerQlitics('end');
151
-
152
115
  _this.props.onEnd === 'function' && _this.props.onEnd(event);
153
116
  });
154
-
155
- _defineProperty(_assertThisInitialized(_this), "triggerIframe", function () {
117
+ _defineProperty(_this, "triggerIframe", function () {
156
118
  _this._isMounted = true;
157
119
  loadLibrary().then(function () {
158
120
  return _this._isMounted && _this.forceUpdate();
159
121
  });
160
122
  });
161
-
162
- _defineProperty(_assertThisInitialized(_this), "onPlayerReady", function (event) {
123
+ _defineProperty(_this, "onPlayerReady", function (event) {
163
124
  event.target.setVolume(100);
164
125
  event.target.playVideo();
165
126
  });
166
-
167
- _defineProperty(_assertThisInitialized(_this), "renderVideo", function () {
127
+ _defineProperty(_this, "renderVideo", function () {
168
128
  _this.triggerIframe();
169
-
170
129
  _this.setState({
171
130
  showVideo: true
172
131
  });
173
132
  });
174
-
175
133
  _this.state = {
176
134
  showVideo: false
177
135
  };
@@ -182,11 +140,10 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
182
140
  };
183
141
  _this.videoRef = /*#__PURE__*/React.createRef();
184
142
  _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
185
-
186
143
  return _this;
187
144
  }
188
-
189
- _createClass(CustomStoryElementYoutube, [{
145
+ _inherits(CustomStoryElementYoutube, _React$Component);
146
+ return _createClass(CustomStoryElementYoutube, [{
190
147
  key: "componentDidMount",
191
148
  value: function componentDidMount() {
192
149
  if (!this.props.loadIframeOnClick) {
@@ -203,7 +160,6 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
203
160
  key: "render",
204
161
  value: function render() {
205
162
  var _this2 = this;
206
-
207
163
  var youtubeIframe = function youtubeIframe() {
208
164
  return /*#__PURE__*/React.createElement(YouTube, {
209
165
  videoId: getYouTubeID(_this2.props.element.url),
@@ -215,7 +171,6 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
215
171
  ref: _this2.videoRef
216
172
  });
217
173
  };
218
-
219
174
  if (this.props.loadIframeOnClick) {
220
175
  return /*#__PURE__*/React.createElement("div", {
221
176
  className: "thumbnail-wrapper"
@@ -232,10 +187,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
232
187
  } else return /*#__PURE__*/React.createElement("div", null);
233
188
  }
234
189
  }]);
235
-
236
- return CustomStoryElementYoutube;
237
190
  }(React.Component);
238
-
239
191
  var StoryElementYoutube = function StoryElementYoutube(props) {
240
192
  return /*#__PURE__*/React.createElement(WithLazy, {
241
193
  margin: "0px"
@@ -243,5 +195,4 @@ var StoryElementYoutube = function StoryElementYoutube(props) {
243
195
  return /*#__PURE__*/React.createElement(CustomStoryElementYoutube, props);
244
196
  });
245
197
  };
246
-
247
198
  export default StoryElementYoutube;
@@ -1,17 +1,15 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
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";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
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
-
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
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,26 +37,19 @@ import React from 'react';
39
37
  * @hideconstructor
40
38
  * @category Other
41
39
  */
42
-
43
40
  export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
44
- _inherits(UpdateOnInterval, _React$Component);
45
-
46
- var _super = /*#__PURE__*/_createSuper(UpdateOnInterval);
47
-
48
41
  function UpdateOnInterval(props) {
49
42
  var _this;
50
-
51
43
  _classCallCheck(this, UpdateOnInterval);
52
-
53
- _this = _super.call(this, props);
44
+ _this = _callSuper(this, UpdateOnInterval, [props]);
54
45
  _this.fetchIntervalIndex = -1;
55
46
  _this.state = {
56
47
  data: _this.props.initData
57
48
  };
58
49
  return _this;
59
50
  }
60
-
61
- _createClass(UpdateOnInterval, [{
51
+ _inherits(UpdateOnInterval, _React$Component);
52
+ return _createClass(UpdateOnInterval, [{
62
53
  key: "componentDidMount",
63
54
  value: function componentDidMount() {
64
55
  this.registerInterval();
@@ -72,7 +63,6 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
72
63
  key: "registerInterval",
73
64
  value: function registerInterval() {
74
65
  var _this2 = this;
75
-
76
66
  this.fetchIntervalIndex = setInterval(function () {
77
67
  return _this2.setData();
78
68
  }, this.props.interval);
@@ -85,46 +75,37 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
85
75
  }, {
86
76
  key: "setData",
87
77
  value: function () {
88
- var _setData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
89
- var data;
90
- return _regeneratorRuntime.wrap(function _callee$(_context) {
91
- while (1) {
92
- switch (_context.prev = _context.next) {
93
- case 0:
94
- if (!(typeof this.props.dataLoader === 'function')) {
95
- _context.next = 6;
96
- break;
97
- }
98
-
99
- _context.next = 3;
100
- return this.props.dataLoader();
101
-
102
- case 3:
103
- _context.t0 = _context.sent;
104
- _context.next = 7;
78
+ var _setData = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
79
+ var data, _t;
80
+ return _regeneratorRuntime.wrap(function (_context) {
81
+ while (1) switch (_context.prev = _context.next) {
82
+ case 0:
83
+ if (!(typeof this.props.dataLoader === 'function')) {
84
+ _context.next = 2;
105
85
  break;
106
-
107
- case 6:
108
- _context.t0 = {};
109
-
110
- case 7:
111
- data = _context.t0;
112
- this.setState({
113
- data: data
114
- });
115
-
116
- case 9:
117
- case "end":
118
- return _context.stop();
119
- }
86
+ }
87
+ _context.next = 1;
88
+ return this.props.dataLoader();
89
+ case 1:
90
+ _t = _context.sent;
91
+ _context.next = 3;
92
+ break;
93
+ case 2:
94
+ _t = {};
95
+ case 3:
96
+ data = _t;
97
+ this.setState({
98
+ data: data
99
+ });
100
+ case 4:
101
+ case "end":
102
+ return _context.stop();
120
103
  }
121
104
  }, _callee, this);
122
105
  }));
123
-
124
106
  function setData() {
125
107
  return _setData.apply(this, arguments);
126
108
  }
127
-
128
109
  return setData;
129
110
  }()
130
111
  }, {
@@ -137,8 +118,6 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
137
118
  });
138
119
  }
139
120
  }]);
140
-
141
- return UpdateOnInterval;
142
121
  }(React.Component);
143
122
  UpdateOnInterval.defaultProps = {
144
123
  interval: 30000,
@@ -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
  });
@@ -1,20 +1,17 @@
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
  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,28 +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
- _inherits(WithError, _React$Component);
44
-
45
- var _super = _createSuper(WithError);
46
-
47
38
  function WithError(props) {
48
39
  var _this;
49
-
50
40
  _classCallCheck(this, WithError);
51
-
52
- _this = _super.call(this, props);
41
+ _this = _callSuper(this, WithError, [props]);
53
42
  _this.state = {
54
43
  errored: false
55
44
  };
56
45
  return _this;
57
46
  }
58
-
59
- _createClass(WithError, [{
47
+ _inherits(WithError, _React$Component);
48
+ return _createClass(WithError, [{
60
49
  key: "componentDidCatch",
61
50
  value: function componentDidCatch(e) {
62
51
  console && e && console.log("Caught Exception: ".concat(e.message || e));
@@ -83,7 +72,5 @@ export function withError(clazz) {
83
72
  }
84
73
  }
85
74
  }]);
86
-
87
- return WithError;
88
75
  }(React.Component);
89
76
  }
@@ -1,34 +1,31 @@
1
1
  import { func, string } from "prop-types";
2
2
  import { connect } from "react-redux";
3
-
4
3
  function WithHostUrlBase(_ref) {
5
4
  var children = _ref.children,
6
- primaryHostUrl = _ref.primaryHostUrl,
7
- currentHostUrl = _ref.currentHostUrl;
5
+ primaryHostUrl = _ref.primaryHostUrl,
6
+ currentHostUrl = _ref.currentHostUrl;
8
7
  return children({
9
8
  primaryHostUrl: primaryHostUrl,
10
9
  currentHostUrl: currentHostUrl
11
10
  });
12
11
  }
13
-
14
12
  WithHostUrlBase.propTypes = {
15
13
  children: func.isRequired,
16
14
  primaryHostUrl: string,
17
15
  currentHostUrl: string
18
16
  };
19
-
20
17
  function mapStateToProps(_ref2) {
21
18
  var _ref2$qt = _ref2.qt,
22
- qt = _ref2$qt === void 0 ? {} : _ref2$qt;
19
+ qt = _ref2$qt === void 0 ? {} : _ref2$qt;
23
20
  return {
24
21
  primaryHostUrl: qt.primaryHostUrl,
25
22
  currentHostUrl: qt.currentHostUrl
26
23
  };
27
24
  }
28
-
29
25
  function mapDispatchToProps(dispatch) {
30
26
  return {};
31
27
  }
28
+
32
29
  /**
33
30
  * This component can be used to get access to the `currentHostUrl` and `primaryHostUrl`, as configured within the editor.
34
31
  *
@@ -46,6 +43,4 @@ function mapDispatchToProps(dispatch) {
46
43
  * @component
47
44
  * @category Other
48
45
  */
49
-
50
-
51
46
  export var WithHostUrl = /*#__PURE__*/connect(mapStateToProps, mapDispatchToProps)(WithHostUrlBase);
@@ -1,15 +1,13 @@
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 { func, number, string } from 'prop-types';
12
9
  import React from 'react';
10
+
13
11
  /**
14
12
  * This component can be used to load some DOM just before it scrolls into the screen. Currently, it does not support unloading. The `margin` prop is passed to `IntersectionObserver`.
15
13
  *
@@ -25,26 +23,19 @@ import React from 'react';
25
23
  * @hideconstructor
26
24
  * @category Other
27
25
  */
28
-
29
26
  export var WithLazy = /*#__PURE__*/function (_React$Component) {
30
- _inherits(WithLazy, _React$Component);
31
-
32
- var _super = /*#__PURE__*/_createSuper(WithLazy);
33
-
34
27
  function WithLazy(props) {
35
28
  var _this;
36
-
37
29
  _classCallCheck(this, WithLazy);
38
-
39
- _this = _super.call(this, props);
30
+ _this = _callSuper(this, WithLazy, [props]);
40
31
  _this.state = {
41
32
  loaded: false
42
33
  };
43
34
  _this.observerRef = /*#__PURE__*/React.createRef();
44
35
  return _this;
45
36
  }
46
-
47
- _createClass(WithLazy, [{
37
+ _inherits(WithLazy, _React$Component);
38
+ return _createClass(WithLazy, [{
48
39
  key: "render",
49
40
  value: function render() {
50
41
  if (this.state.loaded) {
@@ -62,7 +53,6 @@ export var WithLazy = /*#__PURE__*/function (_React$Component) {
62
53
  key: "componentDidMount",
63
54
  value: function componentDidMount() {
64
55
  var _this2 = this;
65
-
66
56
  this.observer = new global.IntersectionObserver(function (entries, observer) {
67
57
  return _this2.observerCallback(entries, observer);
68
58
  }, {
@@ -79,18 +69,14 @@ export var WithLazy = /*#__PURE__*/function (_React$Component) {
79
69
  key: "observerCallback",
80
70
  value: function observerCallback(entries, observer) {
81
71
  var _this3 = this;
82
-
83
72
  entries.forEach(function (entry) {
84
73
  if (entry.isIntersecting || entry.isIntersecting === undefined) {
85
74
  _this3.setState({
86
75
  loaded: true
87
76
  });
88
-
89
77
  observer.disconnect();
90
78
  }
91
79
  });
92
80
  }
93
81
  }]);
94
-
95
- return WithLazy;
96
82
  }(React.Component);