@quintype/components 3.6.0 → 3.6.1-image-sizes.0

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
@@ -1861,7 +1861,8 @@ function responsiveProps(props) {
1861
1861
  srcSet: props.widths ? props.widths.map(function (size) {
1862
1862
  return "".concat(generatePath(size), " ").concat(size, "w");
1863
1863
  }).join(",") : undefined,
1864
- key: hashString(props.slug)
1864
+ key: hashString(props.slug),
1865
+ sizes: props === null || props === void 0 ? void 0 : props.sizes
1865
1866
  };
1866
1867
  }
1867
1868
  var ThumborImage = /*#__PURE__*/function (_React$Component) {
@@ -1910,7 +1911,7 @@ var ThumborImage = /*#__PURE__*/function (_React$Component) {
1910
1911
  ref: function ref(dom) {
1911
1912
  return _this2.dom = dom;
1912
1913
  },
1913
- className: this.props.className ? "qt-image ".concat(this.props.className) : 'qt-image'
1914
+ className: this.props.className ? "qt-image ".concat(this.props.className) : "qt-image"
1914
1915
  }));
1915
1916
  }
1916
1917
  }, {
@@ -1950,7 +1951,7 @@ function loadGumlet() {
1950
1951
  return;
1951
1952
  }
1952
1953
 
1953
- if (process.env.NODE_ENV == 'development') {
1954
+ if (process.env.NODE_ENV == "development") {
1954
1955
  console.warn("Loading Gumlet Dynamically! This is really bad for page speed. Please see https://developers.quintype.com/malibu/tutorial/gumlet-integration");
1955
1956
  }
1956
1957
 
@@ -1958,9 +1959,9 @@ function loadGumlet() {
1958
1959
  window.GUMLET_CONFIG = window.GUMLET_CONFIG || {
1959
1960
  hosts: []
1960
1961
  };
1961
- var script = document.createElement('script');
1962
- script.type = 'text/javascript';
1963
- script.src = 'https://cdn.gumlet.com/gumlet.js/2.0/gumlet.min.js';
1962
+ var script = document.createElement("script");
1963
+ script.type = "text/javascript";
1964
+ script.src = "https://cdn.gumlet.com/gumlet.js/2.0/gumlet.min.js";
1964
1965
  document.body.appendChild(script);
1965
1966
  }
1966
1967
 
@@ -1976,12 +1977,13 @@ function GumletImage(props) {
1976
1977
  var imageProps = {
1977
1978
  src: emptyWebGif__default["default"],
1978
1979
  "data-src": "https://" + imageCDN + "/" + image.path(aspectRatio, imgParams),
1979
- key: hashString(slug)
1980
+ key: hashString(slug),
1981
+ sizes: props === null || props === void 0 ? void 0 : props.sizes
1980
1982
  };
1981
1983
  var Tag = reactTag || "img";
1982
1984
  React.useEffect(loadGumlet);
1983
1985
  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), {
1984
- className: className ? "qt-image ".concat(className) : 'qt-image'
1986
+ className: className ? "qt-image ".concat(className) : "qt-image"
1985
1987
  })), /*#__PURE__*/React__default["default"].createElement("noscript", null, /*#__PURE__*/React__default["default"].createElement("img", {
1986
1988
  src: "https://".concat(imageCDN, "/").concat(image.path(aspectRatio, _objectSpread$4(_objectSpread$4({}, imgParams), {}, {
1987
1989
  w: 1200
@@ -5,11 +5,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
 
6
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
7
 
8
- import React, { useEffect } from "react";
9
- import emptyWebGif from 'empty-web-gif';
8
+ import omit from "@babel/runtime/helpers/objectWithoutProperties";
9
+ import emptyWebGif from "empty-web-gif";
10
10
  import { FocusedImage } from "quintype-js";
11
+ import React, { useEffect } from "react";
11
12
  import { hashString, USED_PARAMS } from "./image-utils";
12
- import omit from '@babel/runtime/helpers/objectWithoutProperties';
13
13
  var forceLoadingGumlet = false;
14
14
 
15
15
  function loadGumlet() {
@@ -17,7 +17,7 @@ function loadGumlet() {
17
17
  return;
18
18
  }
19
19
 
20
- if (process.env.NODE_ENV == 'development') {
20
+ if (process.env.NODE_ENV == "development") {
21
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
 
@@ -25,9 +25,9 @@ function loadGumlet() {
25
25
  window.GUMLET_CONFIG = window.GUMLET_CONFIG || {
26
26
  hosts: []
27
27
  };
28
- var script = document.createElement('script');
29
- script.type = 'text/javascript';
30
- script.src = 'https://cdn.gumlet.com/gumlet.js/2.0/gumlet.min.js';
28
+ var script = document.createElement("script");
29
+ script.type = "text/javascript";
30
+ script.src = "https://cdn.gumlet.com/gumlet.js/2.0/gumlet.min.js";
31
31
  document.body.appendChild(script);
32
32
  }
33
33
 
@@ -43,12 +43,13 @@ export function GumletImage(props) {
43
43
  var imageProps = {
44
44
  src: emptyWebGif,
45
45
  "data-src": "https://" + imageCDN + "/" + image.path(aspectRatio, imgParams),
46
- key: hashString(slug)
46
+ key: hashString(slug),
47
+ sizes: props === null || props === void 0 ? void 0 : props.sizes
47
48
  };
48
49
  var Tag = reactTag || "img";
49
50
  useEffect(loadGumlet);
50
51
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tag, _extends({}, imageProps, omit(props, USED_PARAMS), {
51
- className: className ? "qt-image ".concat(className) : 'qt-image'
52
+ className: className ? "qt-image ".concat(className) : "qt-image"
52
53
  })), /*#__PURE__*/React.createElement("noscript", null, /*#__PURE__*/React.createElement("img", {
53
54
  src: "https://".concat(imageCDN, "/").concat(image.path(aspectRatio, _objectSpread(_objectSpread({}, imgParams), {}, {
54
55
  w: 1200
@@ -8,12 +8,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
8
8
 
9
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
10
 
11
- import React from "react";
12
- import emptyWebGif from 'empty-web-gif';
13
- import omit from '@babel/runtime/helpers/objectWithoutProperties';
14
- import { func } from 'prop-types';
11
+ import omit from "@babel/runtime/helpers/objectWithoutProperties";
12
+ import emptyWebGif from "empty-web-gif";
13
+ import { func } from "prop-types";
15
14
  import { FocusedImage } from "quintype-js";
16
- import { USED_PARAMS, hashString } from './image-utils';
15
+ import React from "react";
16
+ import { USED_PARAMS, hashString } from "./image-utils";
17
17
  export function responsiveProps(props) {
18
18
  var image = new FocusedImage(props.slug, props.metadata);
19
19
 
@@ -28,7 +28,8 @@ export function responsiveProps(props) {
28
28
  srcSet: props.widths ? props.widths.map(function (size) {
29
29
  return "".concat(generatePath(size), " ").concat(size, "w");
30
30
  }).join(",") : undefined,
31
- key: hashString(props.slug)
31
+ key: hashString(props.slug),
32
+ sizes: props === null || props === void 0 ? void 0 : props.sizes
32
33
  };
33
34
  }
34
35
  export var ThumborImage = /*#__PURE__*/function (_React$Component) {
@@ -77,7 +78,7 @@ export var ThumborImage = /*#__PURE__*/function (_React$Component) {
77
78
  ref: function ref(dom) {
78
79
  return _this2.dom = dom;
79
80
  },
80
- className: this.props.className ? "qt-image ".concat(this.props.className) : 'qt-image'
81
+ className: this.props.className ? "qt-image ".concat(this.props.className) : "qt-image"
81
82
  }));
82
83
  }
83
84
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "3.6.0",
3
+ "version": "3.6.1-image-sizes.0",
4
4
  "description": "Components to help build Quintype Node.js apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",