@quintype/components 3.8.7-decode-image.2 → 3.8.7-fix-jsembed-element.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
@@ -21,10 +21,10 @@ var _extends = require('@babel/runtime/helpers/extends');
21
21
  var emptyWebGif = require('empty-web-gif');
22
22
  var quintypeJs = require('quintype-js');
23
23
  var reactHelmet = require('react-helmet');
24
- var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
25
24
  var classNames = require('classnames');
26
25
  var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
27
26
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
27
+ var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
28
28
  var getVideoID = require('get-video-id');
29
29
  var getYouTubeID = require('get-youtube-id');
30
30
  var ReactDOM = require('react-dom');
@@ -63,10 +63,10 @@ var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumab
63
63
  var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
64
64
  var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
65
65
  var emptyWebGif__default = /*#__PURE__*/_interopDefaultLegacy(emptyWebGif);
66
- var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
67
66
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
68
67
  var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
69
68
  var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
69
+ var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
70
70
  var getVideoID__default = /*#__PURE__*/_interopDefaultLegacy(getVideoID);
71
71
  var getYouTubeID__default = /*#__PURE__*/_interopDefaultLegacy(getYouTubeID);
72
72
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
@@ -1926,14 +1926,10 @@ function responsiveProps(props) {
1926
1926
  }, props.imgParams));
1927
1927
  }
1928
1928
 
1929
- var resolvePath = function resolvePath(size) {
1930
- return props.shouldDecode ? decodeURIComponent(generatePath(size)) : generatePath(size);
1931
- };
1932
-
1933
1929
  var imageProps = {
1934
- src: resolvePath(props.defaultWidth),
1930
+ src: generatePath(props.defaultWidth),
1935
1931
  srcSet: props.widths ? props.widths.map(function (size) {
1936
- return "".concat(resolvePath(size), " ").concat(size, "w");
1932
+ return "".concat(generatePath(size), " ").concat(size, "w");
1937
1933
  }).join(',') : undefined,
1938
1934
  key: hashString(props.slug),
1939
1935
  sizes: props === null || props === void 0 ? void 0 : props.sizes
@@ -3756,47 +3752,38 @@ var StoryElementBase = /*#__PURE__*/function (_React$Component2) {
3756
3752
  _classCallCheck__default["default"](this, StoryElementBase);
3757
3753
 
3758
3754
  _this2 = _super2.call(this, props);
3759
-
3760
- _defineProperty__default["default"](_assertThisInitialized__default["default"](_this2), "initiateObserver", function () {
3761
- if (_this2.props.disableAnalytics === true) return false;
3762
- var options = {
3763
- root: null,
3764
- rootMargin: "0px",
3765
- threshold: 1.0
3766
- };
3767
- _this2.observer = new IntersectionObserver(_this2.observerCallback, options);
3768
-
3769
- _this2.observer.observe(_this2.storyElementRef);
3770
- });
3771
-
3772
- _defineProperty__default["default"](_assertThisInitialized__default["default"](_this2), "destroyObserver", function () {
3773
- _this2.observer && _this2.observer.disconnect();
3774
- });
3775
-
3776
- _defineProperty__default["default"](_assertThisInitialized__default["default"](_this2), "observerCallback", function (entries) {
3777
- entries.forEach(function (entry) {
3778
- if (entry.isIntersecting) {
3779
- _this2.emitElementQlitics();
3780
- }
3781
- });
3782
- });
3783
-
3784
3755
  _this2.observer = null;
3785
3756
  _this2.storyElementRef = null;
3786
3757
  return _this2;
3787
- }
3758
+ } // componentDidMount() {
3759
+ // this.initiateObserver();
3760
+ // }
3761
+ // componentWillUnmount() {
3762
+ // this.destroyObserver();
3763
+ // }
3764
+ // initiateObserver = () => {
3765
+ // if (this.props.disableAnalytics === true) return false;
3766
+ // const options = {
3767
+ // root: null,
3768
+ // rootMargin: "200px",
3769
+ // threshold: 1.0,
3770
+ // };
3771
+ // this.observer = new IntersectionObserver(this.observerCallback, options);
3772
+ // this.observer.observe(this.storyElementRef);
3773
+ // };
3774
+ // destroyObserver = () => {
3775
+ // this.observer && this.observer.disconnect();
3776
+ // };
3777
+ // observerCallback = (entries) => {
3778
+ // entries.forEach((entry) => {
3779
+ // if (entry.isIntersecting) {
3780
+ // this.emitElementQlitics();
3781
+ // }
3782
+ // });
3783
+ // };
3784
+
3788
3785
 
3789
3786
  _createClass__default["default"](StoryElementBase, [{
3790
- key: "componentDidMount",
3791
- value: function componentDidMount() {
3792
- this.initiateObserver();
3793
- }
3794
- }, {
3795
- key: "componentWillUnmount",
3796
- value: function componentWillUnmount() {
3797
- this.destroyObserver();
3798
- }
3799
- }, {
3800
3787
  key: "template",
3801
3788
  value: function template() {
3802
3789
  var storyElement = this.props.element;
@@ -31,14 +31,10 @@ export function responsiveProps(props) {
31
31
  }, props.imgParams));
32
32
  }
33
33
 
34
- var resolvePath = function resolvePath(size) {
35
- return props.shouldDecode ? decodeURIComponent(generatePath(size)) : generatePath(size);
36
- };
37
-
38
34
  var imageProps = {
39
- src: resolvePath(props.defaultWidth),
35
+ src: generatePath(props.defaultWidth),
40
36
  srcSet: props.widths ? props.widths.map(function (size) {
41
- return "".concat(resolvePath(size), " ").concat(size, "w");
37
+ return "".concat(generatePath(size), " ").concat(size, "w");
42
38
  }).join(',') : undefined,
43
39
  key: hashString(props.slug),
44
40
  sizes: props === null || props === void 0 ? void 0 : props.sizes
@@ -1,6 +1,5 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
3
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
4
  import _createClass from "@babel/runtime/helpers/createClass";
6
5
  import _inherits from "@babel/runtime/helpers/inherits";
@@ -245,47 +244,38 @@ var StoryElementBase = /*#__PURE__*/function (_React$Component2) {
245
244
  _classCallCheck(this, StoryElementBase);
246
245
 
247
246
  _this2 = _super2.call(this, props);
248
-
249
- _defineProperty(_assertThisInitialized(_this2), "initiateObserver", function () {
250
- if (_this2.props.disableAnalytics === true) return false;
251
- var options = {
252
- root: null,
253
- rootMargin: "0px",
254
- threshold: 1.0
255
- };
256
- _this2.observer = new IntersectionObserver(_this2.observerCallback, options);
257
-
258
- _this2.observer.observe(_this2.storyElementRef);
259
- });
260
-
261
- _defineProperty(_assertThisInitialized(_this2), "destroyObserver", function () {
262
- _this2.observer && _this2.observer.disconnect();
263
- });
264
-
265
- _defineProperty(_assertThisInitialized(_this2), "observerCallback", function (entries) {
266
- entries.forEach(function (entry) {
267
- if (entry.isIntersecting) {
268
- _this2.emitElementQlitics();
269
- }
270
- });
271
- });
272
-
273
247
  _this2.observer = null;
274
248
  _this2.storyElementRef = null;
275
249
  return _this2;
276
- }
250
+ } // componentDidMount() {
251
+ // this.initiateObserver();
252
+ // }
253
+ // componentWillUnmount() {
254
+ // this.destroyObserver();
255
+ // }
256
+ // initiateObserver = () => {
257
+ // if (this.props.disableAnalytics === true) return false;
258
+ // const options = {
259
+ // root: null,
260
+ // rootMargin: "200px",
261
+ // threshold: 1.0,
262
+ // };
263
+ // this.observer = new IntersectionObserver(this.observerCallback, options);
264
+ // this.observer.observe(this.storyElementRef);
265
+ // };
266
+ // destroyObserver = () => {
267
+ // this.observer && this.observer.disconnect();
268
+ // };
269
+ // observerCallback = (entries) => {
270
+ // entries.forEach((entry) => {
271
+ // if (entry.isIntersecting) {
272
+ // this.emitElementQlitics();
273
+ // }
274
+ // });
275
+ // };
276
+
277
277
 
278
278
  _createClass(StoryElementBase, [{
279
- key: "componentDidMount",
280
- value: function componentDidMount() {
281
- this.initiateObserver();
282
- }
283
- }, {
284
- key: "componentWillUnmount",
285
- value: function componentWillUnmount() {
286
- this.destroyObserver();
287
- }
288
- }, {
289
279
  key: "template",
290
280
  value: function template() {
291
281
  var storyElement = this.props.element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "3.8.7-decode-image.2",
3
+ "version": "3.8.7-fix-jsembed-element.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",