@quintype/components 3.6.3 → 3.6.4-image-sizes.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.
package/dist/cjs/index.js
CHANGED
|
@@ -17,9 +17,9 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
17
17
|
var reactDfp = require('react-dfp');
|
|
18
18
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
19
19
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
20
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
20
21
|
var emptyWebGif = require('empty-web-gif');
|
|
21
22
|
var quintypeJs = require('quintype-js');
|
|
22
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
23
23
|
var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
|
|
24
24
|
var classNames = require('classnames');
|
|
25
25
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
@@ -60,8 +60,8 @@ var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
|
|
|
60
60
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
61
61
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
62
62
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
63
|
-
var emptyWebGif__default = /*#__PURE__*/_interopDefaultLegacy(emptyWebGif);
|
|
64
63
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
64
|
+
var emptyWebGif__default = /*#__PURE__*/_interopDefaultLegacy(emptyWebGif);
|
|
65
65
|
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
|
|
66
66
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
67
67
|
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
@@ -1844,20 +1844,78 @@ function hashString(string) {
|
|
|
1844
1844
|
return hash;
|
|
1845
1845
|
}
|
|
1846
1846
|
|
|
1847
|
+
function ownKeys$5(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; }
|
|
1848
|
+
|
|
1849
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1850
|
+
var forceLoadingGumlet = false;
|
|
1851
|
+
|
|
1852
|
+
function loadGumlet() {
|
|
1853
|
+
if (window.GUMLET_CONFIG || window.gumlet || forceLoadingGumlet === true) {
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
if (process.env.NODE_ENV == 'development') {
|
|
1858
|
+
console.warn('Loading Gumlet Dynamically! This is really bad for page speed. Please see https://developers.quintype.com/malibu/tutorial/gumlet-integration');
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
forceLoadingGumlet = true;
|
|
1862
|
+
window.GUMLET_CONFIG = window.GUMLET_CONFIG || {
|
|
1863
|
+
hosts: []
|
|
1864
|
+
};
|
|
1865
|
+
var script = document.createElement('script');
|
|
1866
|
+
script.type = 'text/javascript';
|
|
1867
|
+
script.src = 'https://cdn.gumlet.com/gumlet.js/2.0/gumlet.min.js';
|
|
1868
|
+
document.body.appendChild(script);
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
function GumletImage(props) {
|
|
1872
|
+
var slug = props.slug,
|
|
1873
|
+
metadata = props.metadata,
|
|
1874
|
+
aspectRatio = props.aspectRatio,
|
|
1875
|
+
imageCDN = props.imageCDN,
|
|
1876
|
+
imgParams = props.imgParams,
|
|
1877
|
+
reactTag = props.reactTag,
|
|
1878
|
+
className = props.className,
|
|
1879
|
+
priority = props.priority,
|
|
1880
|
+
sizes = props.sizes;
|
|
1881
|
+
var image = new quintypeJs.FocusedImage(slug, metadata);
|
|
1882
|
+
var imageProps = {
|
|
1883
|
+
src: emptyWebGif__default["default"],
|
|
1884
|
+
'data-src': 'https://' + imageCDN + '/' + image.path(aspectRatio, imgParams),
|
|
1885
|
+
key: hashString(slug),
|
|
1886
|
+
sizes: sizes
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
if (priority) {
|
|
1890
|
+
imageProps.fetchPriority = 'high';
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
var Tag = reactTag || 'img';
|
|
1894
|
+
React.useEffect(loadGumlet);
|
|
1895
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Tag, _extends__default["default"]({}, imageProps, omit__default["default"](props, USED_PARAMS), {
|
|
1896
|
+
className: className ? "qt-image ".concat(className) : 'qt-image'
|
|
1897
|
+
})), /*#__PURE__*/React__default["default"].createElement("noscript", null, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
1898
|
+
src: "https://".concat(imageCDN, "/").concat(image.path(aspectRatio, _objectSpread$5(_objectSpread$5({}, imgParams), {}, {
|
|
1899
|
+
w: 1200
|
|
1900
|
+
}))),
|
|
1901
|
+
alt: props.alt || ''
|
|
1902
|
+
})));
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1847
1905
|
function _createSuper$g(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$g(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
|
|
1848
1906
|
|
|
1849
1907
|
function _isNativeReflectConstruct$g() { 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; } }
|
|
1850
1908
|
|
|
1851
|
-
function ownKeys$
|
|
1909
|
+
function ownKeys$4(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; }
|
|
1852
1910
|
|
|
1853
|
-
function _objectSpread$
|
|
1911
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1854
1912
|
function responsiveProps(props) {
|
|
1855
1913
|
var image = new quintypeJs.FocusedImage(props.slug, props.metadata);
|
|
1856
1914
|
var _props$priority = props.priority,
|
|
1857
1915
|
priority = _props$priority === void 0 ? false : _props$priority;
|
|
1858
1916
|
|
|
1859
1917
|
function generatePath(size) {
|
|
1860
|
-
return
|
|
1918
|
+
return '//' + props.imageCDN + '/' + image.path(props.aspectRatio, Object.assign({
|
|
1861
1919
|
w: size
|
|
1862
1920
|
}, props.imgParams));
|
|
1863
1921
|
}
|
|
@@ -1866,17 +1924,18 @@ function responsiveProps(props) {
|
|
|
1866
1924
|
src: generatePath(props.defaultWidth),
|
|
1867
1925
|
srcSet: props.widths ? props.widths.map(function (size) {
|
|
1868
1926
|
return "".concat(generatePath(size), " ").concat(size, "w");
|
|
1869
|
-
}).join(
|
|
1870
|
-
key: hashString(props.slug)
|
|
1927
|
+
}).join(',') : undefined,
|
|
1928
|
+
key: hashString(props.slug),
|
|
1929
|
+
sizes: props === null || props === void 0 ? void 0 : props.sizes
|
|
1871
1930
|
};
|
|
1872
1931
|
|
|
1873
1932
|
if (priority) {
|
|
1874
|
-
return _objectSpread$
|
|
1875
|
-
fetchPriority:
|
|
1933
|
+
return _objectSpread$4(_objectSpread$4({}, imageProps), {}, {
|
|
1934
|
+
fetchPriority: 'high'
|
|
1876
1935
|
});
|
|
1877
1936
|
}
|
|
1878
1937
|
|
|
1879
|
-
return _objectSpread$
|
|
1938
|
+
return _objectSpread$4({}, imageProps);
|
|
1880
1939
|
}
|
|
1881
1940
|
var ThumborImage = /*#__PURE__*/function (_React$Component) {
|
|
1882
1941
|
_inherits__default["default"](ThumborImage, _React$Component);
|
|
@@ -1920,7 +1979,7 @@ var ThumborImage = /*#__PURE__*/function (_React$Component) {
|
|
|
1920
1979
|
var imageProps = this.state.showImage ? responsiveProps(this.props) : {
|
|
1921
1980
|
src: emptyWebGif__default["default"]
|
|
1922
1981
|
};
|
|
1923
|
-
return /*#__PURE__*/React__default["default"].createElement(this.props.reactTag ||
|
|
1982
|
+
return /*#__PURE__*/React__default["default"].createElement(this.props.reactTag || 'img', Object.assign(imageProps, omit__default["default"](this.props, USED_PARAMS), {
|
|
1924
1983
|
ref: function ref(dom) {
|
|
1925
1984
|
return _this2.dom = dom;
|
|
1926
1985
|
},
|
|
@@ -1954,66 +2013,10 @@ ThumborImage.contextTypes = {
|
|
|
1954
2013
|
lazyLoadEagerPredicate: propTypes.func
|
|
1955
2014
|
};
|
|
1956
2015
|
|
|
1957
|
-
function ownKeys$4(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; }
|
|
1958
|
-
|
|
1959
|
-
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1960
|
-
var forceLoadingGumlet = false;
|
|
1961
|
-
|
|
1962
|
-
function loadGumlet() {
|
|
1963
|
-
if (window.GUMLET_CONFIG || window.gumlet || forceLoadingGumlet === true) {
|
|
1964
|
-
return;
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
if (process.env.NODE_ENV == 'development') {
|
|
1968
|
-
console.warn("Loading Gumlet Dynamically! This is really bad for page speed. Please see https://developers.quintype.com/malibu/tutorial/gumlet-integration");
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
forceLoadingGumlet = true;
|
|
1972
|
-
window.GUMLET_CONFIG = window.GUMLET_CONFIG || {
|
|
1973
|
-
hosts: []
|
|
1974
|
-
};
|
|
1975
|
-
var script = document.createElement('script');
|
|
1976
|
-
script.type = 'text/javascript';
|
|
1977
|
-
script.src = 'https://cdn.gumlet.com/gumlet.js/2.0/gumlet.min.js';
|
|
1978
|
-
document.body.appendChild(script);
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
function GumletImage(props) {
|
|
1982
|
-
var slug = props.slug,
|
|
1983
|
-
metadata = props.metadata,
|
|
1984
|
-
aspectRatio = props.aspectRatio,
|
|
1985
|
-
imageCDN = props.imageCDN,
|
|
1986
|
-
imgParams = props.imgParams,
|
|
1987
|
-
reactTag = props.reactTag,
|
|
1988
|
-
className = props.className,
|
|
1989
|
-
priority = props.priority;
|
|
1990
|
-
var image = new quintypeJs.FocusedImage(slug, metadata);
|
|
1991
|
-
var imageProps = {
|
|
1992
|
-
src: emptyWebGif__default["default"],
|
|
1993
|
-
"data-src": "https://" + imageCDN + "/" + image.path(aspectRatio, imgParams),
|
|
1994
|
-
key: hashString(slug)
|
|
1995
|
-
};
|
|
1996
|
-
|
|
1997
|
-
if (priority) {
|
|
1998
|
-
imageProps.fetchPriority = "high";
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
var Tag = reactTag || "img";
|
|
2002
|
-
React.useEffect(loadGumlet);
|
|
2003
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Tag, _extends__default["default"]({}, imageProps, omit__default["default"](props, USED_PARAMS), {
|
|
2004
|
-
className: className ? "qt-image ".concat(className) : 'qt-image'
|
|
2005
|
-
})), /*#__PURE__*/React__default["default"].createElement("noscript", null, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
2006
|
-
src: "https://".concat(imageCDN, "/").concat(image.path(aspectRatio, _objectSpread$4(_objectSpread$4({}, imgParams), {}, {
|
|
2007
|
-
w: 1200
|
|
2008
|
-
}))),
|
|
2009
|
-
alt: props.alt || ""
|
|
2010
|
-
})));
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
2016
|
function mapStateToProps$6(state) {
|
|
2014
2017
|
return {
|
|
2015
|
-
imageCDN: state.qt.config[
|
|
2016
|
-
imageCDNFormat: state.qt.config[
|
|
2018
|
+
imageCDN: state.qt.config['cdn-image'],
|
|
2019
|
+
imageCDNFormat: state.qt.config['image-cdn-format'] || 'thumbor'
|
|
2017
2020
|
};
|
|
2018
2021
|
}
|
|
2019
2022
|
|
|
@@ -2022,7 +2025,7 @@ function ResponsiveImageBase(props) {
|
|
|
2022
2025
|
global.console && global.console.warn("Image Found without an alt attribute: ".concat(props.slug));
|
|
2023
2026
|
}
|
|
2024
2027
|
|
|
2025
|
-
if (props.imageCDNFormat ===
|
|
2028
|
+
if (props.imageCDNFormat === 'gumlet') {
|
|
2026
2029
|
return /*#__PURE__*/React__default["default"].createElement(GumletImage, props);
|
|
2027
2030
|
}
|
|
2028
2031
|
|
|
@@ -7,9 +7,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import omit from '@babel/runtime/helpers/objectWithoutProperties';
|
|
9
9
|
import emptyWebGif from 'empty-web-gif';
|
|
10
|
-
import { FocusedImage } from
|
|
11
|
-
import React, { useEffect } from
|
|
12
|
-
import { hashString, USED_PARAMS } from
|
|
10
|
+
import { FocusedImage } from 'quintype-js';
|
|
11
|
+
import React, { useEffect } from 'react';
|
|
12
|
+
import { hashString, USED_PARAMS } from './image-utils';
|
|
13
13
|
var forceLoadingGumlet = false;
|
|
14
14
|
|
|
15
15
|
function loadGumlet() {
|
|
@@ -18,7 +18,7 @@ function loadGumlet() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
if (process.env.NODE_ENV == 'development') {
|
|
21
|
-
console.warn(
|
|
21
|
+
console.warn('Loading Gumlet Dynamically! This is really bad for page speed. Please see https://developers.quintype.com/malibu/tutorial/gumlet-integration');
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
forceLoadingGumlet = true;
|
|
@@ -39,19 +39,21 @@ export function GumletImage(props) {
|
|
|
39
39
|
imgParams = props.imgParams,
|
|
40
40
|
reactTag = props.reactTag,
|
|
41
41
|
className = props.className,
|
|
42
|
-
priority = props.priority
|
|
42
|
+
priority = props.priority,
|
|
43
|
+
sizes = props.sizes;
|
|
43
44
|
var image = new FocusedImage(slug, metadata);
|
|
44
45
|
var imageProps = {
|
|
45
46
|
src: emptyWebGif,
|
|
46
|
-
|
|
47
|
-
key: hashString(slug)
|
|
47
|
+
'data-src': 'https://' + imageCDN + '/' + image.path(aspectRatio, imgParams),
|
|
48
|
+
key: hashString(slug),
|
|
49
|
+
sizes: sizes
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
if (priority) {
|
|
51
|
-
imageProps.fetchPriority =
|
|
53
|
+
imageProps.fetchPriority = 'high';
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
var Tag = reactTag ||
|
|
56
|
+
var Tag = reactTag || 'img';
|
|
55
57
|
useEffect(loadGumlet);
|
|
56
58
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tag, _extends({}, imageProps, omit(props, USED_PARAMS), {
|
|
57
59
|
className: className ? "qt-image ".concat(className) : 'qt-image'
|
|
@@ -59,6 +61,6 @@ export function GumletImage(props) {
|
|
|
59
61
|
src: "https://".concat(imageCDN, "/").concat(image.path(aspectRatio, _objectSpread(_objectSpread({}, imgParams), {}, {
|
|
60
62
|
w: 1200
|
|
61
63
|
}))),
|
|
62
|
-
alt: props.alt ||
|
|
64
|
+
alt: props.alt || ''
|
|
63
65
|
})));
|
|
64
66
|
}
|
|
@@ -13,11 +13,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
13
13
|
|
|
14
14
|
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; }
|
|
15
15
|
|
|
16
|
-
import React from "react";
|
|
17
|
-
import emptyWebGif from 'empty-web-gif';
|
|
18
16
|
import omit from '@babel/runtime/helpers/objectWithoutProperties';
|
|
17
|
+
import emptyWebGif from 'empty-web-gif';
|
|
19
18
|
import { func } from 'prop-types';
|
|
20
|
-
import { FocusedImage } from
|
|
19
|
+
import { FocusedImage } from 'quintype-js';
|
|
20
|
+
import React from 'react';
|
|
21
21
|
import { USED_PARAMS, hashString } from './image-utils';
|
|
22
22
|
export function responsiveProps(props) {
|
|
23
23
|
var image = new FocusedImage(props.slug, props.metadata);
|
|
@@ -25,7 +25,7 @@ export function responsiveProps(props) {
|
|
|
25
25
|
priority = _props$priority === void 0 ? false : _props$priority;
|
|
26
26
|
|
|
27
27
|
function generatePath(size) {
|
|
28
|
-
return
|
|
28
|
+
return '//' + props.imageCDN + '/' + image.path(props.aspectRatio, Object.assign({
|
|
29
29
|
w: size
|
|
30
30
|
}, props.imgParams));
|
|
31
31
|
}
|
|
@@ -34,13 +34,14 @@ export function responsiveProps(props) {
|
|
|
34
34
|
src: generatePath(props.defaultWidth),
|
|
35
35
|
srcSet: props.widths ? props.widths.map(function (size) {
|
|
36
36
|
return "".concat(generatePath(size), " ").concat(size, "w");
|
|
37
|
-
}).join(
|
|
38
|
-
key: hashString(props.slug)
|
|
37
|
+
}).join(',') : undefined,
|
|
38
|
+
key: hashString(props.slug),
|
|
39
|
+
sizes: props === null || props === void 0 ? void 0 : props.sizes
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
if (priority) {
|
|
42
43
|
return _objectSpread(_objectSpread({}, imageProps), {}, {
|
|
43
|
-
fetchPriority:
|
|
44
|
+
fetchPriority: 'high'
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -88,7 +89,7 @@ export var ThumborImage = /*#__PURE__*/function (_React$Component) {
|
|
|
88
89
|
var imageProps = this.state.showImage ? responsiveProps(this.props) : {
|
|
89
90
|
src: emptyWebGif
|
|
90
91
|
};
|
|
91
|
-
return /*#__PURE__*/React.createElement(this.props.reactTag ||
|
|
92
|
+
return /*#__PURE__*/React.createElement(this.props.reactTag || 'img', Object.assign(imageProps, omit(this.props, USED_PARAMS), {
|
|
92
93
|
ref: function ref(dom) {
|
|
93
94
|
return _this2.dom = dom;
|
|
94
95
|
},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { arrayOf, number, object, string } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { GumletImage } from './impl/gumlet-image';
|
|
5
|
+
import { ThumborImage } from './impl/thumbor-image';
|
|
6
6
|
|
|
7
7
|
function mapStateToProps(state) {
|
|
8
8
|
return {
|
|
9
|
-
imageCDN: state.qt.config[
|
|
10
|
-
imageCDNFormat: state.qt.config[
|
|
9
|
+
imageCDN: state.qt.config['cdn-image'],
|
|
10
|
+
imageCDNFormat: state.qt.config['image-cdn-format'] || 'thumbor'
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ function ResponsiveImageBase(props) {
|
|
|
16
16
|
global.console && global.console.warn("Image Found without an alt attribute: ".concat(props.slug));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
if (props.imageCDNFormat ===
|
|
19
|
+
if (props.imageCDNFormat === 'gumlet') {
|
|
20
20
|
return /*#__PURE__*/React.createElement(GumletImage, props);
|
|
21
21
|
}
|
|
22
22
|
|