@quintype/components 3.8.8-only-react-v19.2 → 3.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +2041 -1091
- package/dist/es/components/access-type.js +822 -574
- package/dist/es/components/adbutler-ad.js +14 -10
- package/dist/es/components/api-client.js +6 -4
- package/dist/es/components/breaking-news-item.js +3 -2
- package/dist/es/components/breaking-news.js +23 -7
- package/dist/es/components/client-side-only.js +19 -6
- package/dist/es/components/collection.js +5 -5
- package/dist/es/components/dfp-ad.js +30 -23
- package/dist/es/components/eager-load-images.js +17 -7
- package/dist/es/components/hamburger-button.js +5 -2
- package/dist/es/components/image-gallery.js +13 -10
- package/dist/es/components/impl/collection-impl.js +10 -3
- package/dist/es/components/impl/gumlet-image.js +19 -10
- package/dist/es/components/impl/image-utils.js +4 -3
- package/dist/es/components/impl/load-more-stories-manager.js +19 -6
- package/dist/es/components/impl/thumbor-image.js +32 -10
- package/dist/es/components/infinite-scroll.js +85 -29
- package/dist/es/components/infinite-story-base.js +24 -7
- package/dist/es/components/lazy-collection.js +8 -8
- package/dist/es/components/lazy-load-images.js +43 -10
- package/dist/es/components/link-base.js +19 -11
- package/dist/es/components/link.js +4 -1
- package/dist/es/components/load-more-collection-stories.js +18 -7
- package/dist/es/components/load-more-stories-base.js +20 -6
- package/dist/es/components/loading-indicator.js +5 -1
- package/dist/es/components/menu-item.js +10 -6
- package/dist/es/components/menu.js +9 -6
- package/dist/es/components/responsive-hero-image.js +3 -1
- package/dist/es/components/responsive-image.js +5 -0
- package/dist/es/components/responsive-source.js +1 -1
- package/dist/es/components/review-rating/review-rating.js +27 -21
- package/dist/es/components/review-rating/star-icon.js +5 -3
- package/dist/es/components/search-box.js +23 -7
- package/dist/es/components/search-page-base.js +18 -7
- package/dist/es/components/social-logins/with-facebook-login.js +20 -10
- package/dist/es/components/social-logins/with-google-login.js +18 -8
- package/dist/es/components/social-logins/with-linkedin-login.js +12 -7
- package/dist/es/components/social-logins/with-social-login.js +21 -7
- package/dist/es/components/social-logins/with-twitter-login.js +7 -7
- package/dist/es/components/social-share.js +24 -8
- package/dist/es/components/story-element.js +88 -43
- package/dist/es/components/story-elements/brightcove.js +94 -54
- package/dist/es/components/story-elements/dailymotion-embed-script.js +39 -13
- package/dist/es/components/story-elements/dailymotion.js +61 -19
- package/dist/es/components/story-elements/jsembed.js +30 -10
- package/dist/es/components/story-elements/jwPlayer.js +24 -9
- package/dist/es/components/story-elements/polltype.js +20 -6
- package/dist/es/components/story-elements/table.js +34 -16
- package/dist/es/components/story-elements/youtube.js +73 -24
- package/dist/es/components/update-on-interval.js +52 -31
- package/dist/es/components/with-client-side-only.js +4 -3
- package/dist/es/components/with-error.js +20 -7
- package/dist/es/components/with-host-url.js +9 -4
- package/dist/es/components/with-lazy.js +21 -7
- package/dist/es/components/with-member.js +33 -14
- package/dist/es/components/with-preview.js +20 -7
- package/dist/es/components/wrap-collection-layout.js +16 -4
- package/dist/es/store/reducers.js +45 -1
- package/dist/es/utils.js +12 -7
- package/package.json +7 -16
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function
|
|
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
|
+
|
|
11
17
|
import getYouTubeID from 'get-youtube-id';
|
|
12
18
|
import { bool, func, object } from 'prop-types';
|
|
13
19
|
import React from 'react';
|
|
@@ -15,20 +21,26 @@ import { disconnectObserver, getQliticsSchema, initiateNewObserver } from '../..
|
|
|
15
21
|
import { WithLazy } from '../with-lazy';
|
|
16
22
|
var YouTube = null;
|
|
17
23
|
var loaderPromise = null;
|
|
24
|
+
|
|
18
25
|
function loadLibrary() {
|
|
19
26
|
if (loaderPromise === null) {
|
|
20
|
-
loaderPromise = import(
|
|
27
|
+
loaderPromise = import(
|
|
28
|
+
/* webpackChunkName: "qtc-react-youtube" */
|
|
29
|
+
'react-youtube').then(function (YT) {
|
|
21
30
|
YouTube = YT["default"];
|
|
22
31
|
})["catch"](function (err) {
|
|
23
32
|
console.log('Failed to load react-youtube', err);
|
|
24
33
|
return Promise.reject();
|
|
25
34
|
});
|
|
26
35
|
}
|
|
36
|
+
|
|
27
37
|
return loaderPromise;
|
|
28
38
|
}
|
|
39
|
+
|
|
29
40
|
function isLibraryLoaded() {
|
|
30
41
|
return YouTube !== null;
|
|
31
42
|
}
|
|
43
|
+
|
|
32
44
|
function getYoutubeButton(onClick) {
|
|
33
45
|
return /*#__PURE__*/React.createElement("button", {
|
|
34
46
|
onClick: onClick,
|
|
@@ -48,88 +60,118 @@ function getYoutubeButton(onClick) {
|
|
|
48
60
|
fill: "white"
|
|
49
61
|
})));
|
|
50
62
|
}
|
|
63
|
+
|
|
51
64
|
var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
65
|
+
_inherits(CustomStoryElementYoutube, _React$Component);
|
|
66
|
+
|
|
67
|
+
var _super = /*#__PURE__*/_createSuper(CustomStoryElementYoutube);
|
|
68
|
+
|
|
52
69
|
function CustomStoryElementYoutube(props) {
|
|
53
70
|
var _this;
|
|
71
|
+
|
|
54
72
|
_classCallCheck(this, CustomStoryElementYoutube);
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
|
|
74
|
+
_this = _super.call(this, props);
|
|
75
|
+
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "initiateObserver", function (targetElement) {
|
|
57
77
|
_this.removeObserverIfExists();
|
|
78
|
+
|
|
58
79
|
_this.intersectionObserver = new IntersectionObserver(_this.intersectionCallback, {
|
|
59
80
|
threshold: 0.75
|
|
60
81
|
});
|
|
82
|
+
|
|
61
83
|
_this.intersectionObserver.observe(targetElement);
|
|
62
84
|
});
|
|
63
|
-
|
|
85
|
+
|
|
86
|
+
_defineProperty(_assertThisInitialized(_this), "triggerQlitics", function (action) {
|
|
64
87
|
if (_this.props.disableAnalytics === true) return false;
|
|
65
88
|
var _this$props = _this.props,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
+
|
|
72
96
|
var qliticsData = _objectSpread(_objectSpread({}, getQliticsSchema(story, card, element)), {
|
|
73
97
|
'story-element-action': action
|
|
74
98
|
});
|
|
99
|
+
|
|
75
100
|
if (global.qlitics) {
|
|
76
101
|
global.qlitics('track', 'story-element-action', qliticsData);
|
|
77
102
|
} else {
|
|
78
103
|
global.qlitics = global.qlitics || function () {
|
|
79
104
|
(qlitics.q = qlitics.q || []).push(arguments);
|
|
80
105
|
};
|
|
106
|
+
|
|
81
107
|
qlitics.qlitics.q.push('track', 'story-element-action', qliticsData);
|
|
82
108
|
}
|
|
83
109
|
});
|
|
84
|
-
|
|
110
|
+
|
|
111
|
+
_defineProperty(_assertThisInitialized(_this), "onPlayCallback", function (event) {
|
|
85
112
|
_this.triggerQlitics('play');
|
|
113
|
+
|
|
86
114
|
_this.props.onPlay === 'function' && _this.props.onPlay(event);
|
|
87
115
|
_this.videoRef.current = event.target;
|
|
116
|
+
|
|
88
117
|
var targetElement = _this.videoRef.current.getIframe();
|
|
118
|
+
|
|
89
119
|
if (_this.intersectionObserver) {
|
|
90
120
|
_this.intersectionObserver.observe(targetElement);
|
|
91
121
|
} else {
|
|
92
122
|
_this.intersectionObserver = initiateNewObserver(targetElement, _this.intersectionCallback);
|
|
93
123
|
}
|
|
94
124
|
});
|
|
95
|
-
|
|
125
|
+
|
|
126
|
+
_defineProperty(_assertThisInitialized(_this), "intersectionCallback", function (entries) {
|
|
96
127
|
var videoInVewPort = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;
|
|
97
128
|
var player = _this.videoRef.current;
|
|
98
129
|
if (videoInVewPort) player.playVideo();else {
|
|
99
130
|
_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
|
+
|
|
100
132
|
player.pauseVideo();
|
|
101
133
|
}
|
|
102
134
|
});
|
|
103
|
-
|
|
135
|
+
|
|
136
|
+
_defineProperty(_assertThisInitialized(_this), "onPauseCallback", function (event) {
|
|
104
137
|
_this.triggerQlitics('pause');
|
|
138
|
+
|
|
105
139
|
_this.props.onPause === 'function' && _this.props.onPause(event);
|
|
106
140
|
var videoPausedByObserver = _this.videoPausedByObserver.current;
|
|
141
|
+
|
|
107
142
|
if (videoPausedByObserver) {
|
|
108
143
|
_this.videoPausedByObserver.current = false; // This is a clean up to set videoPausedByObserver back to false
|
|
109
144
|
} else {
|
|
110
145
|
disconnectObserver(_this.intersectionObserver);
|
|
111
146
|
}
|
|
112
147
|
});
|
|
113
|
-
|
|
148
|
+
|
|
149
|
+
_defineProperty(_assertThisInitialized(_this), "onEndCallback", function (event) {
|
|
114
150
|
_this.triggerQlitics('end');
|
|
151
|
+
|
|
115
152
|
_this.props.onEnd === 'function' && _this.props.onEnd(event);
|
|
116
153
|
});
|
|
117
|
-
|
|
154
|
+
|
|
155
|
+
_defineProperty(_assertThisInitialized(_this), "triggerIframe", function () {
|
|
118
156
|
_this._isMounted = true;
|
|
119
157
|
loadLibrary().then(function () {
|
|
120
158
|
return _this._isMounted && _this.forceUpdate();
|
|
121
159
|
});
|
|
122
160
|
});
|
|
123
|
-
|
|
161
|
+
|
|
162
|
+
_defineProperty(_assertThisInitialized(_this), "onPlayerReady", function (event) {
|
|
124
163
|
event.target.setVolume(100);
|
|
125
164
|
event.target.playVideo();
|
|
126
165
|
});
|
|
127
|
-
|
|
166
|
+
|
|
167
|
+
_defineProperty(_assertThisInitialized(_this), "renderVideo", function () {
|
|
128
168
|
_this.triggerIframe();
|
|
169
|
+
|
|
129
170
|
_this.setState({
|
|
130
171
|
showVideo: true
|
|
131
172
|
});
|
|
132
173
|
});
|
|
174
|
+
|
|
133
175
|
_this.state = {
|
|
134
176
|
showVideo: false
|
|
135
177
|
};
|
|
@@ -140,10 +182,11 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
140
182
|
};
|
|
141
183
|
_this.videoRef = /*#__PURE__*/React.createRef();
|
|
142
184
|
_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
|
+
|
|
143
186
|
return _this;
|
|
144
187
|
}
|
|
145
|
-
|
|
146
|
-
|
|
188
|
+
|
|
189
|
+
_createClass(CustomStoryElementYoutube, [{
|
|
147
190
|
key: "componentDidMount",
|
|
148
191
|
value: function componentDidMount() {
|
|
149
192
|
if (!this.props.loadIframeOnClick) {
|
|
@@ -160,6 +203,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
160
203
|
key: "render",
|
|
161
204
|
value: function render() {
|
|
162
205
|
var _this2 = this;
|
|
206
|
+
|
|
163
207
|
var youtubeIframe = function youtubeIframe() {
|
|
164
208
|
return /*#__PURE__*/React.createElement(YouTube, {
|
|
165
209
|
videoId: getYouTubeID(_this2.props.element.url),
|
|
@@ -171,6 +215,7 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
171
215
|
ref: _this2.videoRef
|
|
172
216
|
});
|
|
173
217
|
};
|
|
218
|
+
|
|
174
219
|
if (this.props.loadIframeOnClick) {
|
|
175
220
|
return /*#__PURE__*/React.createElement("div", {
|
|
176
221
|
className: "thumbnail-wrapper"
|
|
@@ -187,7 +232,10 @@ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
|
|
|
187
232
|
} else return /*#__PURE__*/React.createElement("div", null);
|
|
188
233
|
}
|
|
189
234
|
}]);
|
|
235
|
+
|
|
236
|
+
return CustomStoryElementYoutube;
|
|
190
237
|
}(React.Component);
|
|
238
|
+
|
|
191
239
|
var StoryElementYoutube = function StoryElementYoutube(props) {
|
|
192
240
|
return /*#__PURE__*/React.createElement(WithLazy, {
|
|
193
241
|
margin: "0px"
|
|
@@ -195,4 +243,5 @@ var StoryElementYoutube = function StoryElementYoutube(props) {
|
|
|
195
243
|
return /*#__PURE__*/React.createElement(CustomStoryElementYoutube, props);
|
|
196
244
|
});
|
|
197
245
|
};
|
|
246
|
+
|
|
198
247
|
export default StoryElementYoutube;
|
|
@@ -1,15 +1,17 @@
|
|
|
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";
|
|
4
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
6
|
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
|
|
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
|
+
|
|
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,19 +39,26 @@ import React from 'react';
|
|
|
37
39
|
* @hideconstructor
|
|
38
40
|
* @category Other
|
|
39
41
|
*/
|
|
42
|
+
|
|
40
43
|
export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
|
|
44
|
+
_inherits(UpdateOnInterval, _React$Component);
|
|
45
|
+
|
|
46
|
+
var _super = /*#__PURE__*/_createSuper(UpdateOnInterval);
|
|
47
|
+
|
|
41
48
|
function UpdateOnInterval(props) {
|
|
42
49
|
var _this;
|
|
50
|
+
|
|
43
51
|
_classCallCheck(this, UpdateOnInterval);
|
|
44
|
-
|
|
52
|
+
|
|
53
|
+
_this = _super.call(this, props);
|
|
45
54
|
_this.fetchIntervalIndex = -1;
|
|
46
55
|
_this.state = {
|
|
47
56
|
data: _this.props.initData
|
|
48
57
|
};
|
|
49
58
|
return _this;
|
|
50
59
|
}
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
|
|
61
|
+
_createClass(UpdateOnInterval, [{
|
|
53
62
|
key: "componentDidMount",
|
|
54
63
|
value: function componentDidMount() {
|
|
55
64
|
this.registerInterval();
|
|
@@ -63,6 +72,7 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
|
|
|
63
72
|
key: "registerInterval",
|
|
64
73
|
value: function registerInterval() {
|
|
65
74
|
var _this2 = this;
|
|
75
|
+
|
|
66
76
|
this.fetchIntervalIndex = setInterval(function () {
|
|
67
77
|
return _this2.setData();
|
|
68
78
|
}, this.props.interval);
|
|
@@ -75,37 +85,46 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
|
|
|
75
85
|
}, {
|
|
76
86
|
key: "setData",
|
|
77
87
|
value: function () {
|
|
78
|
-
var _setData = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
79
|
-
var data
|
|
80
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
81
|
-
while (1)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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;
|
|
85
105
|
break;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
case 4:
|
|
101
|
-
case "end":
|
|
102
|
-
return _context.stop();
|
|
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
|
+
}
|
|
103
120
|
}
|
|
104
121
|
}, _callee, this);
|
|
105
122
|
}));
|
|
123
|
+
|
|
106
124
|
function setData() {
|
|
107
125
|
return _setData.apply(this, arguments);
|
|
108
126
|
}
|
|
127
|
+
|
|
109
128
|
return setData;
|
|
110
129
|
}()
|
|
111
130
|
}, {
|
|
@@ -118,6 +137,8 @@ export var UpdateOnInterval = /*#__PURE__*/function (_React$Component) {
|
|
|
118
137
|
});
|
|
119
138
|
}
|
|
120
139
|
}]);
|
|
140
|
+
|
|
141
|
+
return UpdateOnInterval;
|
|
121
142
|
}(React.Component);
|
|
122
143
|
UpdateOnInterval.defaultProps = {
|
|
123
144
|
interval: 30000,
|
|
@@ -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
|
-
|
|
23
|
-
|
|
23
|
+
clientSideRendered = _ref$clientSideRender === void 0 ? false : _ref$clientSideRender,
|
|
24
|
+
children = _ref.children;
|
|
24
25
|
return children({
|
|
25
26
|
clientSideRendered: clientSideRendered
|
|
26
27
|
});
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
+
|
|
8
11
|
import React from 'react';
|
|
12
|
+
|
|
9
13
|
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,28 @@ 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) {
|
|
43
|
+
_inherits(WithError, _React$Component);
|
|
44
|
+
|
|
45
|
+
var _super = _createSuper(WithError);
|
|
46
|
+
|
|
38
47
|
function WithError(props) {
|
|
39
48
|
var _this;
|
|
49
|
+
|
|
40
50
|
_classCallCheck(this, WithError);
|
|
41
|
-
|
|
51
|
+
|
|
52
|
+
_this = _super.call(this, props);
|
|
42
53
|
_this.state = {
|
|
43
54
|
errored: false
|
|
44
55
|
};
|
|
45
56
|
return _this;
|
|
46
57
|
}
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
|
|
59
|
+
_createClass(WithError, [{
|
|
49
60
|
key: "componentDidCatch",
|
|
50
61
|
value: function componentDidCatch(e) {
|
|
51
62
|
console && e && console.log("Caught Exception: ".concat(e.message || e));
|
|
@@ -72,5 +83,7 @@ export function withError(clazz) {
|
|
|
72
83
|
}
|
|
73
84
|
}
|
|
74
85
|
}]);
|
|
86
|
+
|
|
87
|
+
return WithError;
|
|
75
88
|
}(React.Component);
|
|
76
89
|
}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { func, string } from "prop-types";
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
|
+
|
|
3
4
|
function WithHostUrlBase(_ref) {
|
|
4
5
|
var children = _ref.children,
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
primaryHostUrl = _ref.primaryHostUrl,
|
|
7
|
+
currentHostUrl = _ref.currentHostUrl;
|
|
7
8
|
return children({
|
|
8
9
|
primaryHostUrl: primaryHostUrl,
|
|
9
10
|
currentHostUrl: currentHostUrl
|
|
10
11
|
});
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
WithHostUrlBase.propTypes = {
|
|
13
15
|
children: func.isRequired,
|
|
14
16
|
primaryHostUrl: string,
|
|
15
17
|
currentHostUrl: string
|
|
16
18
|
};
|
|
19
|
+
|
|
17
20
|
function mapStateToProps(_ref2) {
|
|
18
21
|
var _ref2$qt = _ref2.qt,
|
|
19
|
-
|
|
22
|
+
qt = _ref2$qt === void 0 ? {} : _ref2$qt;
|
|
20
23
|
return {
|
|
21
24
|
primaryHostUrl: qt.primaryHostUrl,
|
|
22
25
|
currentHostUrl: qt.currentHostUrl
|
|
23
26
|
};
|
|
24
27
|
}
|
|
28
|
+
|
|
25
29
|
function mapDispatchToProps(dispatch) {
|
|
26
30
|
return {};
|
|
27
31
|
}
|
|
28
|
-
|
|
29
32
|
/**
|
|
30
33
|
* This component can be used to get access to the `currentHostUrl` and `primaryHostUrl`, as configured within the editor.
|
|
31
34
|
*
|
|
@@ -43,4 +46,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
43
46
|
* @component
|
|
44
47
|
* @category Other
|
|
45
48
|
*/
|
|
49
|
+
|
|
50
|
+
|
|
46
51
|
export var WithHostUrl = /*#__PURE__*/connect(mapStateToProps, mapDispatchToProps)(WithHostUrlBase);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
+
|
|
8
11
|
import { func, number, string } from 'prop-types';
|
|
9
12
|
import React from 'react';
|
|
10
|
-
|
|
11
13
|
/**
|
|
12
14
|
* 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`.
|
|
13
15
|
*
|
|
@@ -23,19 +25,26 @@ import React from 'react';
|
|
|
23
25
|
* @hideconstructor
|
|
24
26
|
* @category Other
|
|
25
27
|
*/
|
|
28
|
+
|
|
26
29
|
export var WithLazy = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
_inherits(WithLazy, _React$Component);
|
|
31
|
+
|
|
32
|
+
var _super = /*#__PURE__*/_createSuper(WithLazy);
|
|
33
|
+
|
|
27
34
|
function WithLazy(props) {
|
|
28
35
|
var _this;
|
|
36
|
+
|
|
29
37
|
_classCallCheck(this, WithLazy);
|
|
30
|
-
|
|
38
|
+
|
|
39
|
+
_this = _super.call(this, props);
|
|
31
40
|
_this.state = {
|
|
32
41
|
loaded: false
|
|
33
42
|
};
|
|
34
43
|
_this.observerRef = /*#__PURE__*/React.createRef();
|
|
35
44
|
return _this;
|
|
36
45
|
}
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
|
|
47
|
+
_createClass(WithLazy, [{
|
|
39
48
|
key: "render",
|
|
40
49
|
value: function render() {
|
|
41
50
|
if (this.state.loaded) {
|
|
@@ -53,6 +62,7 @@ export var WithLazy = /*#__PURE__*/function (_React$Component) {
|
|
|
53
62
|
key: "componentDidMount",
|
|
54
63
|
value: function componentDidMount() {
|
|
55
64
|
var _this2 = this;
|
|
65
|
+
|
|
56
66
|
this.observer = new global.IntersectionObserver(function (entries, observer) {
|
|
57
67
|
return _this2.observerCallback(entries, observer);
|
|
58
68
|
}, {
|
|
@@ -69,14 +79,18 @@ export var WithLazy = /*#__PURE__*/function (_React$Component) {
|
|
|
69
79
|
key: "observerCallback",
|
|
70
80
|
value: function observerCallback(entries, observer) {
|
|
71
81
|
var _this3 = this;
|
|
82
|
+
|
|
72
83
|
entries.forEach(function (entry) {
|
|
73
84
|
if (entry.isIntersecting || entry.isIntersecting === undefined) {
|
|
74
85
|
_this3.setState({
|
|
75
86
|
loaded: true
|
|
76
87
|
});
|
|
88
|
+
|
|
77
89
|
observer.disconnect();
|
|
78
90
|
}
|
|
79
91
|
});
|
|
80
92
|
}
|
|
81
93
|
}]);
|
|
94
|
+
|
|
95
|
+
return WithLazy;
|
|
82
96
|
}(React.Component);
|