@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
|
@@ -2,6 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import get from "lodash/get";
|
|
3
3
|
import { object, string } from "prop-types";
|
|
4
4
|
import React from "react";
|
|
5
|
+
|
|
5
6
|
function getSize(sizeMap) {
|
|
6
7
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
7
8
|
var screenWidth = canUseDOM && get(window, ["screen", "width"], 440);
|
|
@@ -10,7 +11,6 @@ function getSize(sizeMap) {
|
|
|
10
11
|
if (screenWidth < 992) return sizeMap["tablet"];
|
|
11
12
|
return sizeMap["desktop"];
|
|
12
13
|
}
|
|
13
|
-
|
|
14
14
|
/**
|
|
15
15
|
* This component can be used to get ads from `Adbutler` ad service provider based on the `adtype` you want to show
|
|
16
16
|
*
|
|
@@ -44,21 +44,25 @@ function getSize(sizeMap) {
|
|
|
44
44
|
* @component
|
|
45
45
|
* @category Ads
|
|
46
46
|
*/
|
|
47
|
+
|
|
48
|
+
|
|
47
49
|
export function AdbutlerAd(_ref) {
|
|
48
50
|
var adtype = _ref.adtype,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
adbutlerConfig = _ref.adbutlerConfig,
|
|
52
|
+
sizes = _ref.sizes;
|
|
51
53
|
var _adbutlerConfig$publi = adbutlerConfig.publisherId,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
publisherId = _adbutlerConfig$publi === void 0 ? "" : _adbutlerConfig$publi,
|
|
55
|
+
_adbutlerConfig$adtyp = adbutlerConfig[adtype],
|
|
56
|
+
zoneId = _adbutlerConfig$adtyp === void 0 ? "" : _adbutlerConfig$adtyp;
|
|
55
57
|
var sizeMap = sizes[adtype];
|
|
56
58
|
var size = getSize(sizeMap);
|
|
59
|
+
|
|
57
60
|
var _size = _slicedToArray(size, 2),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
_size$ = _size[0],
|
|
62
|
+
width = _size$ === void 0 ? 0 : _size$,
|
|
63
|
+
_size$2 = _size[1],
|
|
64
|
+
height = _size$2 === void 0 ? 0 : _size$2;
|
|
65
|
+
|
|
62
66
|
var src = "https://servedbyadbutler.com/adserve/;ID=".concat(publisherId, ";size=").concat(width, "x").concat(height, ";setID=").concat(zoneId, ";type=iframe;click=CLICK_MACRO_PLACEHOLDER");
|
|
63
67
|
var hasSize = size.length;
|
|
64
68
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -4,15 +4,17 @@ var apiClient = /*#__PURE__*/wretch().options({
|
|
|
4
4
|
});
|
|
5
5
|
export function getRequest(url, params) {
|
|
6
6
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
_ref$mountAt = _ref.mountAt,
|
|
8
|
+
mountAt = _ref$mountAt === void 0 ? global.qtMountAt || "" : _ref$mountAt;
|
|
9
|
+
|
|
9
10
|
var client = apiClient.url("".concat(mountAt).concat(url));
|
|
10
11
|
if (params) client = client.query(params);
|
|
11
12
|
return client.get();
|
|
12
13
|
}
|
|
13
14
|
export function postRequest(url, body) {
|
|
14
15
|
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
_ref2$mountAt = _ref2.mountAt,
|
|
17
|
+
mountAt = _ref2$mountAt === void 0 ? global.qtMountAt || "" : _ref2$mountAt;
|
|
18
|
+
|
|
17
19
|
return apiClient.url("".concat(mountAt).concat(url)).post(body);
|
|
18
20
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Link } from "./link";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import get from "lodash/get";
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* This component can be used to render a BreakingNewsItem.
|
|
7
6
|
*
|
|
@@ -15,10 +14,12 @@ import get from "lodash/get";
|
|
|
15
14
|
* @component
|
|
16
15
|
* @category Header
|
|
17
16
|
*/
|
|
17
|
+
|
|
18
18
|
export function BreakingNewsItem(_ref) {
|
|
19
19
|
var item = _ref.item,
|
|
20
|
-
|
|
20
|
+
className = _ref.className;
|
|
21
21
|
var linkedStorySlug = get(item, ['metadata', 'linked-story-slug']);
|
|
22
|
+
|
|
22
23
|
if (linkedStorySlug) {
|
|
23
24
|
return /*#__PURE__*/React.createElement(Link, {
|
|
24
25
|
className: className,
|
|
@@ -1,21 +1,30 @@
|
|
|
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";
|
|
9
12
|
import { connect } from "react-redux";
|
|
10
13
|
import { BREAKING_NEWS_UPDATED } from '../store/actions';
|
|
11
14
|
import { getRequest } from './api-client';
|
|
15
|
+
|
|
12
16
|
var BreakingNewsBase = /*#__PURE__*/function (_React$Component) {
|
|
17
|
+
_inherits(BreakingNewsBase, _React$Component);
|
|
18
|
+
|
|
19
|
+
var _super = /*#__PURE__*/_createSuper(BreakingNewsBase);
|
|
20
|
+
|
|
13
21
|
function BreakingNewsBase() {
|
|
14
22
|
_classCallCheck(this, BreakingNewsBase);
|
|
15
|
-
|
|
23
|
+
|
|
24
|
+
return _super.apply(this, arguments);
|
|
16
25
|
}
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
|
|
27
|
+
_createClass(BreakingNewsBase, [{
|
|
19
28
|
key: "render",
|
|
20
29
|
value: function render() {
|
|
21
30
|
return /*#__PURE__*/React.createElement(this.props.view, this.props);
|
|
@@ -24,6 +33,7 @@ var BreakingNewsBase = /*#__PURE__*/function (_React$Component) {
|
|
|
24
33
|
key: "updateBreakingNews",
|
|
25
34
|
value: function updateBreakingNews() {
|
|
26
35
|
var _this = this;
|
|
36
|
+
|
|
27
37
|
getRequest('/api/v1/breaking-news').json(function (response) {
|
|
28
38
|
return _this.props.breakingNewsUpdated(response.stories);
|
|
29
39
|
});
|
|
@@ -32,6 +42,7 @@ var BreakingNewsBase = /*#__PURE__*/function (_React$Component) {
|
|
|
32
42
|
key: "componentDidMount",
|
|
33
43
|
value: function componentDidMount() {
|
|
34
44
|
var _this2 = this;
|
|
45
|
+
|
|
35
46
|
this.interval = global.setInterval(function () {
|
|
36
47
|
return _this2.updateBreakingNews();
|
|
37
48
|
}, this.props.updateInterval || 60000);
|
|
@@ -43,7 +54,10 @@ var BreakingNewsBase = /*#__PURE__*/function (_React$Component) {
|
|
|
43
54
|
global.clearInterval(this.interval);
|
|
44
55
|
}
|
|
45
56
|
}]);
|
|
57
|
+
|
|
58
|
+
return BreakingNewsBase;
|
|
46
59
|
}(React.Component);
|
|
60
|
+
|
|
47
61
|
function mapStateToProps(state) {
|
|
48
62
|
return {
|
|
49
63
|
config: state.qt.config || {},
|
|
@@ -51,6 +65,7 @@ function mapStateToProps(state) {
|
|
|
51
65
|
breakingNewsLoaded: state.breakingNewsLoaded || false
|
|
52
66
|
};
|
|
53
67
|
}
|
|
68
|
+
|
|
54
69
|
function mapDispatchToProps(dispatch) {
|
|
55
70
|
return {
|
|
56
71
|
breakingNewsUpdated: function breakingNewsUpdated(stories) {
|
|
@@ -61,7 +76,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
61
76
|
}
|
|
62
77
|
};
|
|
63
78
|
}
|
|
64
|
-
|
|
65
79
|
/**
|
|
66
80
|
* This component will automatically fetch breaking news every 30 seconds, and render the provided view.
|
|
67
81
|
*
|
|
@@ -76,4 +90,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
76
90
|
* @component
|
|
77
91
|
* @category Header
|
|
78
92
|
*/
|
|
93
|
+
|
|
94
|
+
|
|
79
95
|
export var BreakingNews = /*#__PURE__*/connect(mapStateToProps, mapDispatchToProps)(BreakingNewsBase);
|
|
@@ -1,20 +1,29 @@
|
|
|
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";
|
|
9
12
|
import { connect } from "react-redux";
|
|
10
13
|
import { mapStateToProps, mapDispatchToProps } from './impl/client-side-only-impl';
|
|
14
|
+
|
|
11
15
|
var ClientSideOnlyBase = /*#__PURE__*/function (_React$Component) {
|
|
16
|
+
_inherits(ClientSideOnlyBase, _React$Component);
|
|
17
|
+
|
|
18
|
+
var _super = /*#__PURE__*/_createSuper(ClientSideOnlyBase);
|
|
19
|
+
|
|
12
20
|
function ClientSideOnlyBase() {
|
|
13
21
|
_classCallCheck(this, ClientSideOnlyBase);
|
|
14
|
-
|
|
22
|
+
|
|
23
|
+
return _super.apply(this, arguments);
|
|
15
24
|
}
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
|
|
26
|
+
_createClass(ClientSideOnlyBase, [{
|
|
18
27
|
key: "render",
|
|
19
28
|
value: function render() {
|
|
20
29
|
if (this.props.clientSideRendered) {
|
|
@@ -28,6 +37,8 @@ var ClientSideOnlyBase = /*#__PURE__*/function (_React$Component) {
|
|
|
28
37
|
}
|
|
29
38
|
}
|
|
30
39
|
}]);
|
|
40
|
+
|
|
41
|
+
return ClientSideOnlyBase;
|
|
31
42
|
}(React.Component);
|
|
32
43
|
/**
|
|
33
44
|
* This component will be loaded by client, and bypassed when doing server side rendering.
|
|
@@ -43,4 +54,6 @@ var ClientSideOnlyBase = /*#__PURE__*/function (_React$Component) {
|
|
|
43
54
|
* @component
|
|
44
55
|
* @category Other
|
|
45
56
|
*/
|
|
57
|
+
|
|
58
|
+
|
|
46
59
|
export var ClientSideOnly = /*#__PURE__*/connect(mapStateToProps, mapDispatchToProps)(ClientSideOnlyBase);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { string, object, func } from 'prop-types';
|
|
3
3
|
import { StoryNotImplemented, CollectionNotImplemented, renderCollectionItem } from './impl/collection-impl';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* This component can be used to render a [collection](https://developers.quintype.com/malibu/terminology#collections).
|
|
7
6
|
*
|
|
@@ -51,12 +50,13 @@ import { StoryNotImplemented, CollectionNotImplemented, renderCollectionItem } f
|
|
|
51
50
|
* @component
|
|
52
51
|
* @category Collection Page
|
|
53
52
|
*/
|
|
53
|
+
|
|
54
54
|
export var Collection = function Collection(_ref) {
|
|
55
55
|
var className = _ref.className,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
collection = _ref.collection,
|
|
57
|
+
collectionTemplates = _ref.collectionTemplates,
|
|
58
|
+
storyTemplates = _ref.storyTemplates,
|
|
59
|
+
interstitial = _ref.interstitial;
|
|
60
60
|
var children = collection.items.map(function (collectionItem, index) {
|
|
61
61
|
return renderCollectionItem(collectionItem, index, collectionTemplates, storyTemplates);
|
|
62
62
|
}).reduce(function (arr, v, i) {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
4
7
|
import React from "react";
|
|
5
8
|
import { AdSlot, DFPManager, DFPSlotsProvider } from "react-dfp";
|
|
6
9
|
import { connect } from "react-redux";
|
|
7
10
|
import { withError } from "./with-error";
|
|
8
|
-
|
|
9
11
|
/**
|
|
10
12
|
* This is a function which can be used to manage ad units in a single place. A component must be created, and used with the `adtype` parameter. These ads are lazy-loaded and single-request mode is disabled by default which can be overwritten as follows.
|
|
11
13
|
*
|
|
@@ -47,20 +49,21 @@ import { withError } from "./with-error";
|
|
|
47
49
|
* @category Ads
|
|
48
50
|
* @returns {Component} A component that can
|
|
49
51
|
*/
|
|
52
|
+
|
|
50
53
|
export function createDfpAdComponent(_ref) {
|
|
51
54
|
var defaultNetworkID = _ref.defaultNetworkID,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
_ref$config = _ref.config,
|
|
56
|
+
config = _ref$config === void 0 ? {} : _ref$config,
|
|
57
|
+
slotId = _ref.slotId,
|
|
58
|
+
targeting = _ref.targeting,
|
|
59
|
+
_ref$collapseEmptyDiv = _ref.collapseEmptyDivs,
|
|
60
|
+
collapseEmptyDivs = _ref$collapseEmptyDiv === void 0 ? true : _ref$collapseEmptyDiv,
|
|
61
|
+
_ref$lazyLoad = _ref.lazyLoad,
|
|
62
|
+
lazyLoad = _ref$lazyLoad === void 0 ? true : _ref$lazyLoad,
|
|
63
|
+
_ref$singleRequest = _ref.singleRequest,
|
|
64
|
+
singleRequest = _ref$singleRequest === void 0 ? false : _ref$singleRequest,
|
|
65
|
+
_ref$deferAdsBy = _ref.deferAdsBy,
|
|
66
|
+
deferAdsBy = _ref$deferAdsBy === void 0 ? 0 : _ref$deferAdsBy;
|
|
64
67
|
return connect(function (state, ownProps) {
|
|
65
68
|
return {
|
|
66
69
|
targetingArguments: targeting(state, ownProps),
|
|
@@ -76,20 +79,23 @@ export function createDfpAdComponent(_ref) {
|
|
|
76
79
|
return {};
|
|
77
80
|
})(withError(DfpAdBase));
|
|
78
81
|
}
|
|
82
|
+
|
|
79
83
|
function DfpAdBase(_ref2) {
|
|
80
84
|
var defaultNetworkID = _ref2.defaultNetworkID,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
config = _ref2.config,
|
|
86
|
+
slotId = _ref2.slotId,
|
|
87
|
+
collapseEmptyDivs = _ref2.collapseEmptyDivs,
|
|
88
|
+
targetingArguments = _ref2.targetingArguments,
|
|
89
|
+
adtype = _ref2.adtype,
|
|
90
|
+
lazyLoad = _ref2.lazyLoad,
|
|
91
|
+
singleRequest = _ref2.singleRequest,
|
|
92
|
+
deferAdsBy = _ref2.deferAdsBy;
|
|
89
93
|
var adConfig = config[adtype] || {};
|
|
94
|
+
|
|
90
95
|
var adProps = _objectSpread({
|
|
91
96
|
slotId: slotId
|
|
92
97
|
}, adConfig);
|
|
98
|
+
|
|
93
99
|
return /*#__PURE__*/React.createElement(DFPSlotsProvider, {
|
|
94
100
|
dfpNetworkId: defaultNetworkID,
|
|
95
101
|
collapseEmptyDivs: collapseEmptyDivs,
|
|
@@ -100,6 +106,7 @@ function DfpAdBase(_ref2) {
|
|
|
100
106
|
deferAdsBy: deferAdsBy
|
|
101
107
|
}, /*#__PURE__*/React.createElement(AdSlot, adProps));
|
|
102
108
|
}
|
|
109
|
+
|
|
103
110
|
export function refreshDfpAds(adSlots) {
|
|
104
111
|
DFPManager.refresh(adSlots);
|
|
105
112
|
}
|
|
@@ -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 React from "react";
|
|
9
12
|
import { func } from 'prop-types';
|
|
10
|
-
|
|
11
13
|
/**
|
|
12
14
|
* This component can be used along with {@link LazyLoadImages}. Children of `EagerLoadImages` are forced to be eager, if they match the given predicate
|
|
13
15
|
*
|
|
@@ -15,13 +17,19 @@ import { func } from 'prop-types';
|
|
|
15
17
|
* @component
|
|
16
18
|
* @category Images
|
|
17
19
|
*/
|
|
20
|
+
|
|
18
21
|
export var EagerLoadImages = /*#__PURE__*/function (_React$Component) {
|
|
22
|
+
_inherits(EagerLoadImages, _React$Component);
|
|
23
|
+
|
|
24
|
+
var _super = /*#__PURE__*/_createSuper(EagerLoadImages);
|
|
25
|
+
|
|
19
26
|
function EagerLoadImages() {
|
|
20
27
|
_classCallCheck(this, EagerLoadImages);
|
|
21
|
-
|
|
28
|
+
|
|
29
|
+
return _super.apply(this, arguments);
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
|
|
32
|
+
_createClass(EagerLoadImages, [{
|
|
25
33
|
key: "getChildContext",
|
|
26
34
|
value: function getChildContext() {
|
|
27
35
|
return {
|
|
@@ -36,6 +44,8 @@ export var EagerLoadImages = /*#__PURE__*/function (_React$Component) {
|
|
|
36
44
|
return this.props.children;
|
|
37
45
|
}
|
|
38
46
|
}]);
|
|
47
|
+
|
|
48
|
+
return EagerLoadImages;
|
|
39
49
|
}(React.Component);
|
|
40
50
|
EagerLoadImages.childContextTypes = {
|
|
41
51
|
lazyLoadEagerPredicate: func
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { connect } from 'react-redux';
|
|
3
3
|
import { HAMBURGER_CLICKED } from "../store/actions";
|
|
4
|
+
|
|
4
5
|
function HamburgerButtonBase(_ref) {
|
|
5
6
|
var onClick = _ref.onClick,
|
|
6
|
-
|
|
7
|
+
children = _ref.children;
|
|
7
8
|
return /*#__PURE__*/React.createElement("a", {
|
|
8
9
|
href: "/",
|
|
9
10
|
onClick: onClick
|
|
10
11
|
}, children);
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
function mapDispatchToProps(dispatch) {
|
|
13
15
|
return {
|
|
14
16
|
onClick: function onClick(e) {
|
|
@@ -20,7 +22,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
20
22
|
}
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
|
-
|
|
24
25
|
/**
|
|
25
26
|
* This component can be used to trigger an action openening the Hamburger menu. The state can be accessed via state.hamburgerOpened
|
|
26
27
|
*
|
|
@@ -34,6 +35,8 @@ function mapDispatchToProps(dispatch) {
|
|
|
34
35
|
* @component
|
|
35
36
|
* @category Header
|
|
36
37
|
*/
|
|
38
|
+
|
|
39
|
+
|
|
37
40
|
export var HamburgerButton = /*#__PURE__*/connect(function (state) {
|
|
38
41
|
return {};
|
|
39
42
|
}, mapDispatchToProps)(HamburgerButtonBase);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
4
7
|
import React from "react";
|
|
5
8
|
import { ResponsiveImage } from "./responsive-image";
|
|
6
|
-
|
|
7
9
|
/**
|
|
8
10
|
* This component can be used for adding image gallery on the story page.
|
|
9
11
|
*
|
|
@@ -16,15 +18,16 @@ import { ResponsiveImage } from "./responsive-image";
|
|
|
16
18
|
* @category Story Page
|
|
17
19
|
* @component
|
|
18
20
|
*/
|
|
21
|
+
|
|
19
22
|
export function ImageGalleryElement(_ref) {
|
|
20
23
|
var className = _ref.className,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
imageAspectRatio = _ref.imageAspectRatio,
|
|
25
|
+
defaultWidth = _ref.defaultWidth,
|
|
26
|
+
element = _ref.element,
|
|
27
|
+
widths = _ref.widths,
|
|
28
|
+
story = _ref.story,
|
|
29
|
+
onClickHandler = _ref.onClickHandler,
|
|
30
|
+
imgParams = _ref.imgParams;
|
|
28
31
|
element = element || {};
|
|
29
32
|
var images = element["story-elements"].map(function (image, index) {
|
|
30
33
|
return /*#__PURE__*/React.createElement("figure", {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
4
7
|
import React from 'react';
|
|
5
8
|
import { getAssociatedTemplate } from "../../utils";
|
|
6
9
|
export function StoryNotImplemented() {
|
|
@@ -15,14 +18,17 @@ export function CollectionNotImplemented() {
|
|
|
15
18
|
}
|
|
16
19
|
export function renderCollectionItem(collectionItem, index, collectionTemplates, storyTemplates) {
|
|
17
20
|
var otherProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
21
|
+
|
|
18
22
|
switch (collectionItem.type) {
|
|
19
23
|
case "collection":
|
|
20
24
|
return /*#__PURE__*/React.createElement(collectionTemplates(getAssociatedTemplate(collectionItem), index), _objectSpread({
|
|
21
25
|
key: "".concat(index, "-").concat(collectionItem.id),
|
|
22
26
|
index: index,
|
|
23
27
|
collection: collectionItem,
|
|
24
|
-
metadata: collectionItem["associated-metadata"] || {}
|
|
28
|
+
metadata: collectionItem["associated-metadata"] || {},
|
|
29
|
+
collectionIndex: collectionItem === null || collectionItem === void 0 ? void 0 : collectionItem["collectionIndex"]
|
|
25
30
|
}, otherProps));
|
|
31
|
+
|
|
26
32
|
case "story":
|
|
27
33
|
return /*#__PURE__*/React.createElement(storyTemplates(index), _objectSpread({
|
|
28
34
|
key: "".concat(index, "-").concat(collectionItem.id),
|
|
@@ -30,6 +36,7 @@ export function renderCollectionItem(collectionItem, index, collectionTemplates,
|
|
|
30
36
|
story: collectionItem.story,
|
|
31
37
|
metadata: collectionItem["associated-metadata"] || {}
|
|
32
38
|
}, otherProps));
|
|
39
|
+
|
|
33
40
|
default:
|
|
34
41
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
42
|
"data-comment": "".concat(collectionItem.type, " not implemented")
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
|
|
4
|
-
function
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
5
8
|
import omit from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
9
|
import emptyWebGif from 'empty-web-gif';
|
|
7
10
|
import { FocusedImage } from 'quintype-js';
|
|
@@ -9,13 +12,16 @@ import React, { useEffect } from 'react';
|
|
|
9
12
|
import { Helmet } from 'react-helmet';
|
|
10
13
|
import { hashString, USED_PARAMS } from './image-utils';
|
|
11
14
|
var forceLoadingGumlet = false;
|
|
15
|
+
|
|
12
16
|
function loadGumlet() {
|
|
13
17
|
if (window.GUMLET_CONFIG || window.gumlet || forceLoadingGumlet === true) {
|
|
14
18
|
return;
|
|
15
19
|
}
|
|
20
|
+
|
|
16
21
|
if (process.env.NODE_ENV == 'development') {
|
|
17
22
|
console.warn('Loading Gumlet Dynamically! This is really bad for page speed. Please see https://developers.quintype.com/malibu/tutorial/gumlet-integration');
|
|
18
23
|
}
|
|
24
|
+
|
|
19
25
|
forceLoadingGumlet = true;
|
|
20
26
|
window.GUMLET_CONFIG = window.GUMLET_CONFIG || {
|
|
21
27
|
hosts: []
|
|
@@ -25,16 +31,17 @@ function loadGumlet() {
|
|
|
25
31
|
script.src = 'https://cdn.gumlet.com/gumlet.js/2.0/gumlet.min.js';
|
|
26
32
|
document.body.appendChild(script);
|
|
27
33
|
}
|
|
34
|
+
|
|
28
35
|
export function GumletImage(props) {
|
|
29
36
|
var slug = props.slug,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
metadata = props.metadata,
|
|
38
|
+
aspectRatio = props.aspectRatio,
|
|
39
|
+
imageCDN = props.imageCDN,
|
|
40
|
+
imgParams = props.imgParams,
|
|
41
|
+
reactTag = props.reactTag,
|
|
42
|
+
className = props.className,
|
|
43
|
+
priority = props.priority,
|
|
44
|
+
sizes = props.sizes;
|
|
38
45
|
var image = new FocusedImage(slug, metadata);
|
|
39
46
|
var imageProps = {
|
|
40
47
|
src: emptyWebGif,
|
|
@@ -42,9 +49,11 @@ export function GumletImage(props) {
|
|
|
42
49
|
key: hashString(slug),
|
|
43
50
|
sizes: sizes
|
|
44
51
|
};
|
|
52
|
+
|
|
45
53
|
if (priority) {
|
|
46
54
|
imageProps.fetchPriority = 'high';
|
|
47
55
|
}
|
|
56
|
+
|
|
48
57
|
var Tag = reactTag || 'img';
|
|
49
58
|
useEffect(loadGumlet);
|
|
50
59
|
return /*#__PURE__*/React.createElement(React.Fragment, null, priority && /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("link", {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export var USED_PARAMS = ["imageCDN", "defaultWidth", "widths", "imgParams", "slug", "metadata", "aspectRatio", "reactTag", "eager", "imageCDNFormat"];
|
|
1
|
+
export var USED_PARAMS = ["imageCDN", "defaultWidth", "widths", "imgParams", "slug", "metadata", "aspectRatio", "reactTag", "eager", "imageCDNFormat"]; // Add the following CSS somewhere: img.qt-image { width: 100%; object-fit: cover; }
|
|
2
2
|
|
|
3
|
-
// Add the following CSS somewhere: img.qt-image { width: 100%; object-fit: cover; }
|
|
4
3
|
export function hashString(string) {
|
|
5
4
|
if (!string) return 0;
|
|
6
5
|
var hash = 0,
|
|
7
|
-
|
|
6
|
+
i;
|
|
7
|
+
|
|
8
8
|
for (i = 0; i < string.length; i++) {
|
|
9
9
|
hash = (hash << 5) - hash + string.charCodeAt(i);
|
|
10
10
|
hash |= 0; // Convert to 32bit integer
|
|
11
11
|
}
|
|
12
|
+
|
|
12
13
|
return hash;
|
|
13
14
|
}
|