@quintype/components 2.31.4-lazy-iframe.10 → 2.31.4-lazy-load.2

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
@@ -2360,15 +2360,15 @@ function isLibraryLoaded() {
2360
2360
  return DailyMotion !== null;
2361
2361
  }
2362
2362
 
2363
- var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
2364
- _inherits(StoryElementDailyMotion, _React$Component);
2363
+ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
2364
+ _inherits(CustomStoryElementDailyMotion, _React$Component);
2365
2365
 
2366
- var _super = /*#__PURE__*/_createSuper$e(StoryElementDailyMotion);
2366
+ var _super = /*#__PURE__*/_createSuper$e(CustomStoryElementDailyMotion);
2367
2367
 
2368
- function StoryElementDailyMotion(props) {
2368
+ function CustomStoryElementDailyMotion(props) {
2369
2369
  var _this;
2370
2370
 
2371
- _classCallCheck(this, StoryElementDailyMotion);
2371
+ _classCallCheck(this, CustomStoryElementDailyMotion);
2372
2372
 
2373
2373
  _this = _super.call(this, props);
2374
2374
 
@@ -2415,7 +2415,7 @@ var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
2415
2415
  return _this;
2416
2416
  }
2417
2417
 
2418
- _createClass(StoryElementDailyMotion, [{
2418
+ _createClass(CustomStoryElementDailyMotion, [{
2419
2419
  key: "componentDidMount",
2420
2420
  value: function componentDidMount() {
2421
2421
  if (!this.props.loadIframeOnClick) {
@@ -2458,13 +2458,9 @@ var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
2458
2458
  onClick: this.renderVideo,
2459
2459
  src: "https://www.dailymotion.com/thumbnail/video/".concat(videoId),
2460
2460
  alt: "daily-motion-video"
2461
- })), this.state.showVideo && isLibraryLoaded() && /*#__PURE__*/React__default.createElement(WithLazy, {
2462
- margin: "0px"
2463
- }, function () {
2464
- return /*#__PURE__*/React__default.createElement("div", {
2465
- className: "dailymotion-iframe-wrapper"
2466
- }, dailymotionIframe());
2467
- }));
2461
+ })), this.state.showVideo && isLibraryLoaded() && /*#__PURE__*/React__default.createElement("div", {
2462
+ className: "dailymotion-iframe-wrapper"
2463
+ }, dailymotionIframe()));
2468
2464
  } else if (!this.props.loadIframeOnClick && isLibraryLoaded()) {
2469
2465
  return /*#__PURE__*/React__default.createElement(DailyMotion, {
2470
2466
  video: videoId,
@@ -2477,9 +2473,17 @@ var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
2477
2473
  }
2478
2474
  }]);
2479
2475
 
2480
- return StoryElementDailyMotion;
2476
+ return CustomStoryElementDailyMotion;
2481
2477
  }(React__default.Component);
2482
2478
 
2479
+ var StoryElementDailyMotion = function StoryElementDailyMotion(props) {
2480
+ return /*#__PURE__*/React__default.createElement(WithLazy, {
2481
+ margin: "0px"
2482
+ }, function () {
2483
+ return /*#__PURE__*/React__default.createElement(CustomStoryElementDailyMotion, props);
2484
+ });
2485
+ };
2486
+
2483
2487
  function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); 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); }; }
2484
2488
 
2485
2489
  function _isNativeReflectConstruct$f() { 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; } }
@@ -2509,22 +2513,22 @@ function replaceScriptNodes(node) {
2509
2513
  }
2510
2514
  }
2511
2515
 
2512
- var JSEmbed = /*#__PURE__*/function (_React$Component) {
2513
- _inherits(JSEmbed, _React$Component);
2516
+ var CustomJSEmbed = /*#__PURE__*/function (_React$Component) {
2517
+ _inherits(CustomJSEmbed, _React$Component);
2514
2518
 
2515
- var _super = /*#__PURE__*/_createSuper$f(JSEmbed);
2519
+ var _super = /*#__PURE__*/_createSuper$f(CustomJSEmbed);
2516
2520
 
2517
- function JSEmbed(props) {
2521
+ function CustomJSEmbed(props) {
2518
2522
  var _this;
2519
2523
 
2520
- _classCallCheck(this, JSEmbed);
2524
+ _classCallCheck(this, CustomJSEmbed);
2521
2525
 
2522
2526
  _this = _super.call(this, props);
2523
2527
  _this.uniqueId = "anagh";
2524
2528
  return _this;
2525
2529
  }
2526
2530
 
2527
- _createClass(JSEmbed, [{
2531
+ _createClass(CustomJSEmbed, [{
2528
2532
  key: "shouldComponentUpdate",
2529
2533
  value: function shouldComponentUpdate(nextProps) {
2530
2534
  return !(this.props.id === nextProps.id && this.props.embedJS === nextProps.embedJS);
@@ -2550,22 +2554,18 @@ var JSEmbed = /*#__PURE__*/function (_React$Component) {
2550
2554
  value: function render() {
2551
2555
  var _this2 = this;
2552
2556
 
2553
- return /*#__PURE__*/React__default.createElement(WithLazy, {
2554
- margin: "0px"
2555
- }, function () {
2556
- return /*#__PURE__*/React__default.createElement("div", {
2557
- ref: function ref(jsembed) {
2558
- _this2.JSEmbed = jsembed;
2559
- },
2560
- dangerouslySetInnerHTML: {
2561
- __html: _this2.getEmbedJS()
2562
- }
2563
- });
2557
+ return /*#__PURE__*/React__default.createElement("div", {
2558
+ ref: function ref(jsembed) {
2559
+ _this2.JSEmbed = jsembed;
2560
+ },
2561
+ dangerouslySetInnerHTML: {
2562
+ __html: this.getEmbedJS()
2563
+ }
2564
2564
  });
2565
2565
  }
2566
2566
  }]);
2567
2567
 
2568
- return JSEmbed;
2568
+ return CustomJSEmbed;
2569
2569
  }(React__default.Component);
2570
2570
 
2571
2571
  function _createSuper$g(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$g(); 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); }; }
@@ -2761,15 +2761,15 @@ function isLibraryLoaded$1() {
2761
2761
  return YouTube !== null;
2762
2762
  }
2763
2763
 
2764
- var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
2765
- _inherits(StoryElementYoutube, _React$Component);
2764
+ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
2765
+ _inherits(CustomStoryElementYoutube, _React$Component);
2766
2766
 
2767
- var _super = /*#__PURE__*/_createSuper$i(StoryElementYoutube);
2767
+ var _super = /*#__PURE__*/_createSuper$i(CustomStoryElementYoutube);
2768
2768
 
2769
- function StoryElementYoutube(props) {
2769
+ function CustomStoryElementYoutube(props) {
2770
2770
  var _this;
2771
2771
 
2772
- _classCallCheck(this, StoryElementYoutube);
2772
+ _classCallCheck(this, CustomStoryElementYoutube);
2773
2773
 
2774
2774
  _this = _super.call(this, props);
2775
2775
 
@@ -2847,7 +2847,7 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
2847
2847
  return _this;
2848
2848
  }
2849
2849
 
2850
- _createClass(StoryElementYoutube, [{
2850
+ _createClass(CustomStoryElementYoutube, [{
2851
2851
  key: "componentDidMount",
2852
2852
  value: function componentDidMount() {
2853
2853
  if (!this.props.loadIframeOnClick) {
@@ -2878,7 +2878,7 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
2878
2878
  if (this.props.loadIframeOnClick) {
2879
2879
  return /*#__PURE__*/React__default.createElement("div", {
2880
2880
  className: "thumbnail-wrapper"
2881
- }, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("button", {
2881
+ }, /*#__PURE__*/React__default.createElement("button", {
2882
2882
  className: "youtube-playBtn",
2883
2883
  onClick: this.renderVideo,
2884
2884
  "aria-label": "Play Video"
@@ -2887,13 +2887,9 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
2887
2887
  onClick: this.renderVideo,
2888
2888
  src: "https://img.youtube.com/vi/".concat(getYouTubeID(this.props.element.url), "/sddefault.jpg"),
2889
2889
  alt: "video"
2890
- })), this.state.showVideo && isLibraryLoaded$1() && /*#__PURE__*/React__default.createElement(WithLazy, {
2891
- margin: "0px"
2892
- }, function () {
2893
- return /*#__PURE__*/React__default.createElement("div", {
2894
- className: "youtube-iframe-wrapper"
2895
- }, youtubeIframe());
2896
- }));
2890
+ }), this.state.showVideo && isLibraryLoaded$1() && /*#__PURE__*/React__default.createElement("div", {
2891
+ className: "youtube-iframe-wrapper"
2892
+ }, youtubeIframe()));
2897
2893
  } else if (!this.props.loadIframeOnClick && isLibraryLoaded$1()) {
2898
2894
  return /*#__PURE__*/React__default.createElement(YouTube, {
2899
2895
  videoId: getYouTubeID(this.props.element.url),
@@ -2906,9 +2902,17 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
2906
2902
  }
2907
2903
  }]);
2908
2904
 
2909
- return StoryElementYoutube;
2905
+ return CustomStoryElementYoutube;
2910
2906
  }(React__default.Component);
2911
2907
 
2908
+ var StoryElementYoutube = function StoryElementYoutube(props) {
2909
+ return /*#__PURE__*/React__default.createElement(WithLazy, {
2910
+ margin: "0px"
2911
+ }, function () {
2912
+ return /*#__PURE__*/React__default.createElement(CustomStoryElementYoutube, props);
2913
+ });
2914
+ };
2915
+
2912
2916
  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; }
2913
2917
 
2914
2918
  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(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; }
@@ -3067,12 +3071,10 @@ function StoryElementSoundCloud(_ref5) {
3067
3071
  }
3068
3072
 
3069
3073
  function StoryElementJsembed(_ref6) {
3070
- var element = _ref6.element,
3071
- loadEmbed = _ref6.loadEmbed;
3072
- return /*#__PURE__*/React__default.createElement(JSEmbed, {
3074
+ var element = _ref6.element;
3075
+ return /*#__PURE__*/React__default.createElement(CustomJSEmbed, {
3073
3076
  embedJS: element["embed-js"],
3074
- id: element["id"],
3075
- loadEmbed: loadEmbed
3077
+ id: element["id"]
3076
3078
  });
3077
3079
  }
3078
3080
 
@@ -177,12 +177,10 @@ function StoryElementSoundCloud(_ref5) {
177
177
  }
178
178
 
179
179
  function StoryElementJsembed(_ref6) {
180
- var element = _ref6.element,
181
- loadEmbed = _ref6.loadEmbed;
180
+ var element = _ref6.element;
182
181
  return /*#__PURE__*/React.createElement(JSEmbed, {
183
182
  embedJS: element["embed-js"],
184
- id: element["id"],
185
- loadEmbed: loadEmbed
183
+ id: element["id"]
186
184
  });
187
185
  }
188
186
 
@@ -36,15 +36,15 @@ function isLibraryLoaded() {
36
36
  return DailyMotion !== null;
37
37
  }
38
38
 
39
- var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
40
- _inherits(StoryElementDailyMotion, _React$Component);
39
+ var CustomStoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
40
+ _inherits(CustomStoryElementDailyMotion, _React$Component);
41
41
 
42
- var _super = /*#__PURE__*/_createSuper(StoryElementDailyMotion);
42
+ var _super = /*#__PURE__*/_createSuper(CustomStoryElementDailyMotion);
43
43
 
44
- function StoryElementDailyMotion(props) {
44
+ function CustomStoryElementDailyMotion(props) {
45
45
  var _this;
46
46
 
47
- _classCallCheck(this, StoryElementDailyMotion);
47
+ _classCallCheck(this, CustomStoryElementDailyMotion);
48
48
 
49
49
  _this = _super.call(this, props);
50
50
 
@@ -91,7 +91,7 @@ var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
91
91
  return _this;
92
92
  }
93
93
 
94
- _createClass(StoryElementDailyMotion, [{
94
+ _createClass(CustomStoryElementDailyMotion, [{
95
95
  key: "componentDidMount",
96
96
  value: function componentDidMount() {
97
97
  if (!this.props.loadIframeOnClick) {
@@ -134,13 +134,9 @@ var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
134
134
  onClick: this.renderVideo,
135
135
  src: "https://www.dailymotion.com/thumbnail/video/".concat(videoId),
136
136
  alt: "daily-motion-video"
137
- })), this.state.showVideo && isLibraryLoaded() && /*#__PURE__*/React.createElement(WithLazy, {
138
- margin: "0px"
139
- }, function () {
140
- return /*#__PURE__*/React.createElement("div", {
141
- className: "dailymotion-iframe-wrapper"
142
- }, dailymotionIframe());
143
- }));
137
+ })), this.state.showVideo && isLibraryLoaded() && /*#__PURE__*/React.createElement("div", {
138
+ className: "dailymotion-iframe-wrapper"
139
+ }, dailymotionIframe()));
144
140
  } else if (!this.props.loadIframeOnClick && isLibraryLoaded()) {
145
141
  return /*#__PURE__*/React.createElement(DailyMotion, {
146
142
  video: videoId,
@@ -153,7 +149,15 @@ var StoryElementDailyMotion = /*#__PURE__*/function (_React$Component) {
153
149
  }
154
150
  }]);
155
151
 
156
- return StoryElementDailyMotion;
152
+ return CustomStoryElementDailyMotion;
157
153
  }(React.Component);
158
154
 
159
- export { StoryElementDailyMotion as default };
155
+ var StoryElementDailyMotion = function StoryElementDailyMotion(props) {
156
+ return /*#__PURE__*/React.createElement(WithLazy, {
157
+ margin: "0px"
158
+ }, function () {
159
+ return /*#__PURE__*/React.createElement(CustomStoryElementDailyMotion, props);
160
+ });
161
+ };
162
+
163
+ export default StoryElementDailyMotion;
@@ -9,8 +9,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
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
11
  import atob from "atob";
12
+ import { PropTypes } from "prop-types";
12
13
  import React from "react";
13
- import { WithLazy } from "../with-lazy";
14
14
 
15
15
  function cloneScriptNode(node) {
16
16
  var script = document.createElement("script");
@@ -37,22 +37,22 @@ function replaceScriptNodes(node) {
37
37
  }
38
38
  }
39
39
 
40
- var JSEmbed = /*#__PURE__*/function (_React$Component) {
41
- _inherits(JSEmbed, _React$Component);
40
+ var CustomJSEmbed = /*#__PURE__*/function (_React$Component) {
41
+ _inherits(CustomJSEmbed, _React$Component);
42
42
 
43
- var _super = /*#__PURE__*/_createSuper(JSEmbed);
43
+ var _super = /*#__PURE__*/_createSuper(CustomJSEmbed);
44
44
 
45
- function JSEmbed(props) {
45
+ function CustomJSEmbed(props) {
46
46
  var _this;
47
47
 
48
- _classCallCheck(this, JSEmbed);
48
+ _classCallCheck(this, CustomJSEmbed);
49
49
 
50
50
  _this = _super.call(this, props);
51
51
  _this.uniqueId = "anagh";
52
52
  return _this;
53
53
  }
54
54
 
55
- _createClass(JSEmbed, [{
55
+ _createClass(CustomJSEmbed, [{
56
56
  key: "shouldComponentUpdate",
57
57
  value: function shouldComponentUpdate(nextProps) {
58
58
  return !(this.props.id === nextProps.id && this.props.embedJS === nextProps.embedJS);
@@ -78,22 +78,18 @@ var JSEmbed = /*#__PURE__*/function (_React$Component) {
78
78
  value: function render() {
79
79
  var _this2 = this;
80
80
 
81
- return /*#__PURE__*/React.createElement(WithLazy, {
82
- margin: "0px"
83
- }, function () {
84
- return /*#__PURE__*/React.createElement("div", {
85
- ref: function ref(jsembed) {
86
- _this2.JSEmbed = jsembed;
87
- },
88
- dangerouslySetInnerHTML: {
89
- __html: _this2.getEmbedJS()
90
- }
91
- });
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ ref: function ref(jsembed) {
83
+ _this2.JSEmbed = jsembed;
84
+ },
85
+ dangerouslySetInnerHTML: {
86
+ __html: this.getEmbedJS()
87
+ }
92
88
  });
93
89
  }
94
90
  }]);
95
91
 
96
- return JSEmbed;
92
+ return CustomJSEmbed;
97
93
  }(React.Component);
98
94
 
99
- export { JSEmbed as default };
95
+ export { CustomJSEmbed as default };
@@ -41,15 +41,15 @@ function isLibraryLoaded() {
41
41
  return YouTube !== null;
42
42
  }
43
43
 
44
- var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
45
- _inherits(StoryElementYoutube, _React$Component);
44
+ var CustomStoryElementYoutube = /*#__PURE__*/function (_React$Component) {
45
+ _inherits(CustomStoryElementYoutube, _React$Component);
46
46
 
47
- var _super = /*#__PURE__*/_createSuper(StoryElementYoutube);
47
+ var _super = /*#__PURE__*/_createSuper(CustomStoryElementYoutube);
48
48
 
49
- function StoryElementYoutube(props) {
49
+ function CustomStoryElementYoutube(props) {
50
50
  var _this;
51
51
 
52
- _classCallCheck(this, StoryElementYoutube);
52
+ _classCallCheck(this, CustomStoryElementYoutube);
53
53
 
54
54
  _this = _super.call(this, props);
55
55
 
@@ -127,7 +127,7 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
127
127
  return _this;
128
128
  }
129
129
 
130
- _createClass(StoryElementYoutube, [{
130
+ _createClass(CustomStoryElementYoutube, [{
131
131
  key: "componentDidMount",
132
132
  value: function componentDidMount() {
133
133
  if (!this.props.loadIframeOnClick) {
@@ -158,7 +158,7 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
158
158
  if (this.props.loadIframeOnClick) {
159
159
  return /*#__PURE__*/React.createElement("div", {
160
160
  className: "thumbnail-wrapper"
161
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
161
+ }, /*#__PURE__*/React.createElement("button", {
162
162
  className: "youtube-playBtn",
163
163
  onClick: this.renderVideo,
164
164
  "aria-label": "Play Video"
@@ -167,13 +167,9 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
167
167
  onClick: this.renderVideo,
168
168
  src: "https://img.youtube.com/vi/".concat(getYouTubeID(this.props.element.url), "/sddefault.jpg"),
169
169
  alt: "video"
170
- })), this.state.showVideo && isLibraryLoaded() && /*#__PURE__*/React.createElement(WithLazy, {
171
- margin: "0px"
172
- }, function () {
173
- return /*#__PURE__*/React.createElement("div", {
174
- className: "youtube-iframe-wrapper"
175
- }, youtubeIframe());
176
- }));
170
+ }), this.state.showVideo && isLibraryLoaded() && /*#__PURE__*/React.createElement("div", {
171
+ className: "youtube-iframe-wrapper"
172
+ }, youtubeIframe()));
177
173
  } else if (!this.props.loadIframeOnClick && isLibraryLoaded()) {
178
174
  return /*#__PURE__*/React.createElement(YouTube, {
179
175
  videoId: getYouTubeID(this.props.element.url),
@@ -186,7 +182,15 @@ var StoryElementYoutube = /*#__PURE__*/function (_React$Component) {
186
182
  }
187
183
  }]);
188
184
 
189
- return StoryElementYoutube;
185
+ return CustomStoryElementYoutube;
190
186
  }(React.Component);
191
187
 
192
- export { StoryElementYoutube as default };
188
+ var StoryElementYoutube = function StoryElementYoutube(props) {
189
+ return /*#__PURE__*/React.createElement(WithLazy, {
190
+ margin: "0px"
191
+ }, function () {
192
+ return /*#__PURE__*/React.createElement(CustomStoryElementYoutube, props);
193
+ });
194
+ };
195
+
196
+ export default StoryElementYoutube;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "2.31.4-lazy-iframe.10",
3
+ "version": "2.31.4-lazy-load.2",
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",