@quintype/components 3.8.7 → 3.8.8-only-react-v19.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.
Files changed (61) hide show
  1. package/dist/cjs/index.js +1090 -2039
  2. package/dist/es/components/access-type.js +574 -822
  3. package/dist/es/components/adbutler-ad.js +10 -14
  4. package/dist/es/components/api-client.js +4 -6
  5. package/dist/es/components/breaking-news-item.js +2 -3
  6. package/dist/es/components/breaking-news.js +7 -23
  7. package/dist/es/components/client-side-only.js +6 -19
  8. package/dist/es/components/collection.js +5 -5
  9. package/dist/es/components/dfp-ad.js +23 -30
  10. package/dist/es/components/eager-load-images.js +7 -17
  11. package/dist/es/components/hamburger-button.js +2 -5
  12. package/dist/es/components/image-gallery.js +10 -13
  13. package/dist/es/components/impl/collection-impl.js +2 -8
  14. package/dist/es/components/impl/gumlet-image.js +10 -19
  15. package/dist/es/components/impl/image-utils.js +3 -4
  16. package/dist/es/components/impl/load-more-stories-manager.js +6 -19
  17. package/dist/es/components/impl/thumbor-image.js +10 -32
  18. package/dist/es/components/infinite-scroll.js +29 -85
  19. package/dist/es/components/infinite-story-base.js +7 -24
  20. package/dist/es/components/lazy-collection.js +8 -8
  21. package/dist/es/components/lazy-load-images.js +10 -43
  22. package/dist/es/components/link-base.js +11 -19
  23. package/dist/es/components/link.js +1 -4
  24. package/dist/es/components/load-more-collection-stories.js +7 -18
  25. package/dist/es/components/load-more-stories-base.js +6 -20
  26. package/dist/es/components/loading-indicator.js +1 -5
  27. package/dist/es/components/menu-item.js +6 -10
  28. package/dist/es/components/menu.js +6 -9
  29. package/dist/es/components/responsive-hero-image.js +1 -3
  30. package/dist/es/components/responsive-image.js +0 -5
  31. package/dist/es/components/responsive-source.js +1 -1
  32. package/dist/es/components/review-rating/review-rating.js +21 -27
  33. package/dist/es/components/review-rating/star-icon.js +3 -5
  34. package/dist/es/components/search-box.js +7 -23
  35. package/dist/es/components/search-page-base.js +7 -18
  36. package/dist/es/components/social-logins/with-facebook-login.js +10 -20
  37. package/dist/es/components/social-logins/with-google-login.js +8 -18
  38. package/dist/es/components/social-logins/with-linkedin-login.js +7 -12
  39. package/dist/es/components/social-logins/with-social-login.js +7 -21
  40. package/dist/es/components/social-logins/with-twitter-login.js +7 -7
  41. package/dist/es/components/social-share.js +8 -24
  42. package/dist/es/components/story-element.js +43 -88
  43. package/dist/es/components/story-elements/brightcove.js +54 -94
  44. package/dist/es/components/story-elements/dailymotion-embed-script.js +13 -39
  45. package/dist/es/components/story-elements/dailymotion.js +19 -61
  46. package/dist/es/components/story-elements/jsembed.js +10 -30
  47. package/dist/es/components/story-elements/jwPlayer.js +9 -24
  48. package/dist/es/components/story-elements/polltype.js +6 -20
  49. package/dist/es/components/story-elements/table.js +16 -34
  50. package/dist/es/components/story-elements/youtube.js +24 -73
  51. package/dist/es/components/update-on-interval.js +31 -52
  52. package/dist/es/components/with-client-side-only.js +3 -4
  53. package/dist/es/components/with-error.js +7 -20
  54. package/dist/es/components/with-host-url.js +4 -9
  55. package/dist/es/components/with-lazy.js +7 -21
  56. package/dist/es/components/with-member.js +14 -33
  57. package/dist/es/components/with-preview.js +7 -20
  58. package/dist/es/components/wrap-collection-layout.js +4 -16
  59. package/dist/es/store/reducers.js +1 -45
  60. package/dist/es/utils.js +7 -12
  61. package/package.json +9 -6
@@ -1,10 +1,9 @@
1
1
  import React from "react";
2
-
3
2
  var StarIcon = function StarIcon(_ref) {
4
3
  var size = _ref.size,
5
- foregroundColor = _ref.foregroundColor,
6
- backgroundColor = _ref.backgroundColor,
7
- className = _ref.className;
4
+ foregroundColor = _ref.foregroundColor,
5
+ backgroundColor = _ref.backgroundColor,
6
+ className = _ref.className;
8
7
  return /*#__PURE__*/React.createElement("svg", {
9
8
  className: className,
10
9
  width: size,
@@ -22,5 +21,4 @@ var StarIcon = function StarIcon(_ref) {
22
21
  fill: foregroundColor
23
22
  })));
24
23
  };
25
-
26
24
  export { StarIcon };
@@ -1,35 +1,25 @@
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";
4
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
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
-
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
8
  import { any, element, func, string } from 'prop-types';
12
9
  import React from 'react';
13
10
  import { connect } from "react-redux";
14
-
15
11
  var SearchBoxBase = /*#__PURE__*/function (_React$Component) {
16
- _inherits(SearchBoxBase, _React$Component);
17
-
18
- var _super = /*#__PURE__*/_createSuper(SearchBoxBase);
19
-
20
12
  function SearchBoxBase(props) {
21
13
  var _this;
22
-
23
14
  _classCallCheck(this, SearchBoxBase);
24
-
25
- _this = _super.call(this, props);
15
+ _this = _callSuper(this, SearchBoxBase, [props]);
26
16
  _this.state = {
27
17
  query: _this.props.initValue || ""
28
18
  };
29
19
  return _this;
30
20
  }
31
-
32
- _createClass(SearchBoxBase, [{
21
+ _inherits(SearchBoxBase, _React$Component);
22
+ return _createClass(SearchBoxBase, [{
33
23
  key: "componentDidMount",
34
24
  value: function componentDidMount() {
35
25
  this.focus();
@@ -55,7 +45,6 @@ var SearchBoxBase = /*#__PURE__*/function (_React$Component) {
55
45
  key: "render",
56
46
  value: function render() {
57
47
  var _this2 = this;
58
-
59
48
  var Render = this.props.template || this.defaultTemplate;
60
49
  return /*#__PURE__*/React.createElement("form", {
61
50
  role: "search",
@@ -92,14 +81,10 @@ var SearchBoxBase = /*#__PURE__*/function (_React$Component) {
92
81
  return children;
93
82
  }
94
83
  }]);
95
-
96
- return SearchBoxBase;
97
84
  }(React.Component);
98
-
99
85
  var mapStateToProps = function mapStateToProps(state) {
100
86
  return {};
101
87
  };
102
-
103
88
  var mapDispatchToProps = function mapDispatchToProps(dispatch) {
104
89
  return {
105
90
  navigateTo: function navigateTo(url) {
@@ -107,6 +92,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
107
92
  }
108
93
  };
109
94
  };
95
+
110
96
  /**
111
97
  * This component provides a form with a search text box. On submit, the user is redirected to the search page via AJAX.
112
98
  *
@@ -121,6 +107,4 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
121
107
  * @component
122
108
  * @category Header
123
109
  */
124
-
125
-
126
110
  export var SearchBox = /*#__PURE__*/connect(mapStateToProps, mapDispatchToProps)(SearchBoxBase);
@@ -1,17 +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";
4
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
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
-
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
8
  import React from 'react';
12
9
  import get from "lodash/get";
13
10
  import { getRequest } from './api-client';
14
11
  import { LoadMoreStoriesManager } from './impl/load-more-stories-manager';
12
+
15
13
  /**
16
14
  * This component is to handle search functionality and also handles load more.
17
15
  *
@@ -31,19 +29,13 @@ import { LoadMoreStoriesManager } from './impl/load-more-stories-manager';
31
29
  * @deprecated
32
30
  * @category Other
33
31
  */
34
-
35
32
  export var SearchPageBase = /*#__PURE__*/function (_React$Component) {
36
- _inherits(SearchPageBase, _React$Component);
37
-
38
- var _super = /*#__PURE__*/_createSuper(SearchPageBase);
39
-
40
33
  function SearchPageBase() {
41
34
  _classCallCheck(this, SearchPageBase);
42
-
43
- return _super.apply(this, arguments);
35
+ return _callSuper(this, SearchPageBase, arguments);
44
36
  }
45
-
46
- _createClass(SearchPageBase, [{
37
+ _inherits(SearchPageBase, _React$Component);
38
+ return _createClass(SearchPageBase, [{
47
39
  key: "search",
48
40
  value: function search(pageNumber) {
49
41
  return getRequest("/api/v1/search", Object.assign(this.props.params, {
@@ -57,7 +49,6 @@ export var SearchPageBase = /*#__PURE__*/function (_React$Component) {
57
49
  key: "render",
58
50
  value: function render() {
59
51
  var _this = this;
60
-
61
52
  return /*#__PURE__*/React.createElement(LoadMoreStoriesManager, Object.assign({}, this.props.data, {
62
53
  template: this.props.template,
63
54
  loadStories: function loadStories(pageNumber) {
@@ -66,6 +57,4 @@ export var SearchPageBase = /*#__PURE__*/function (_React$Component) {
66
57
  }));
67
58
  }
68
59
  }]);
69
-
70
- return SearchPageBase;
71
60
  }(React.Component);
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import { WithSocialLogin } from './with-social-login';
3
+
3
4
  /**
4
5
  * @see {@link WithSocialLogin}
5
6
  * @component
6
7
  * @category Login
7
8
  */
8
-
9
9
  export function WithFacebookLogin(_ref) {
10
10
  var appId = _ref.appId,
11
- children = _ref.children,
12
- scope = _ref.scope,
13
- emailMandatory = _ref.emailMandatory,
14
- redirectUrl = _ref.redirectUrl,
15
- sso = _ref.sso,
16
- isBridgekeeperLogin = _ref.isBridgekeeperLogin;
11
+ children = _ref.children,
12
+ scope = _ref.scope,
13
+ emailMandatory = _ref.emailMandatory,
14
+ redirectUrl = _ref.redirectUrl,
15
+ sso = _ref.sso,
16
+ isBridgekeeperLogin = _ref.isBridgekeeperLogin;
17
17
  return /*#__PURE__*/React.createElement(WithSocialLogin, {
18
18
  provider: 'facebook',
19
19
  initialize: function initialize() {
@@ -31,12 +31,10 @@ export function WithFacebookLogin(_ref) {
31
31
  isBridgekeeperLogin: isBridgekeeperLogin
32
32
  });
33
33
  }
34
-
35
34
  function loadFacebookSDK(appId) {
36
35
  if (global.FB) {
37
36
  return;
38
37
  }
39
-
40
38
  global.fbAsyncInit = global.fbAsyncInit || function () {
41
39
  global.FB.init({
42
40
  appId: appId,
@@ -44,22 +42,18 @@ function loadFacebookSDK(appId) {
44
42
  version: 'v3.1'
45
43
  });
46
44
  };
47
-
48
45
  (function (d, s, id) {
49
46
  var js,
50
- fjs = d.getElementsByTagName(s)[0];
51
-
47
+ fjs = d.getElementsByTagName(s)[0];
52
48
  if (d.getElementById(id)) {
53
49
  return;
54
50
  }
55
-
56
51
  js = d.createElement(s);
57
52
  js.id = id;
58
53
  js.src = "https://connect.facebook.net/en_US/sdk.js";
59
54
  fjs.parentNode.insertBefore(js, fjs);
60
55
  })(document, 'script', 'facebook-jssdk');
61
56
  }
62
-
63
57
  function fbLogin(params) {
64
58
  return new Promise(function (resolve, reject) {
65
59
  return global.FB.login(function (response) {
@@ -69,7 +63,6 @@ function fbLogin(params) {
69
63
  }, params);
70
64
  });
71
65
  }
72
-
73
66
  function fbVerifyEmailExists(token) {
74
67
  return new Promise(function (resolve, reject) {
75
68
  return global.FB.api('/me', {
@@ -79,16 +72,13 @@ function fbVerifyEmailExists(token) {
79
72
  });
80
73
  });
81
74
  }
82
-
83
75
  function loginWithFacebook() {
84
76
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
85
- scope = _ref2.scope,
86
- emailMandatory = _ref2.emailMandatory;
87
-
77
+ scope = _ref2.scope,
78
+ emailMandatory = _ref2.emailMandatory;
88
79
  if (!global.FB) {
89
80
  return Promise.reject('NOT_LOADED');
90
81
  }
91
-
92
82
  return fbLogin({
93
83
  scope: scope
94
84
  }).then(function (token) {
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import { WithSocialLogin } from './with-social-login';
3
+
3
4
  /**
4
5
  * @see {@link WithSocialLogin}
5
6
  * @component
6
7
  * @category Login
7
8
  */
8
-
9
9
  export function WithGoogleLogin(_ref) {
10
10
  var clientId = _ref.clientId,
11
- children = _ref.children,
12
- scope = _ref.scope,
13
- emailMandatory = _ref.emailMandatory,
14
- redirectUrl = _ref.redirectUrl,
15
- sso = _ref.sso,
16
- isBridgekeeperLogin = _ref.isBridgekeeperLogin;
11
+ children = _ref.children,
12
+ scope = _ref.scope,
13
+ emailMandatory = _ref.emailMandatory,
14
+ redirectUrl = _ref.redirectUrl,
15
+ sso = _ref.sso,
16
+ isBridgekeeperLogin = _ref.isBridgekeeperLogin;
17
17
  return /*#__PURE__*/React.createElement(WithSocialLogin, {
18
18
  provider: 'google',
19
19
  initialize: function initialize() {
@@ -30,7 +30,6 @@ export function WithGoogleLogin(_ref) {
30
30
  isBridgekeeperLogin: isBridgekeeperLogin
31
31
  });
32
32
  }
33
-
34
33
  var onScriptLoaded = function onScriptLoaded(clientId, scope) {
35
34
  global.gapi.load('client:auth2', function () {
36
35
  return global.gapi.client.init({
@@ -39,21 +38,16 @@ var onScriptLoaded = function onScriptLoaded(clientId, scope) {
39
38
  });
40
39
  });
41
40
  };
42
-
43
41
  var loginWithGoogle = function loginWithGoogle() {
44
42
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
45
- emailMandatory = _ref2.emailMandatory;
46
-
43
+ emailMandatory = _ref2.emailMandatory;
47
44
  if (!global.gapi || !global.gapi.client) {
48
45
  return Promise.reject("NOT_LOADED");
49
46
  }
50
-
51
47
  var GoogleAuth = global.gapi.auth2.getAuthInstance();
52
-
53
48
  if (!GoogleAuth) {
54
49
  return Promise.reject("NOT_LOADED");
55
50
  }
56
-
57
51
  return GoogleAuth.signIn().then(function (response) {
58
52
  return emailMandatory && !response.getBasicProfile().getEmail() ? Promise.reject('NO_EMAIL') : {
59
53
  'access-token': response.getAuthResponse().access_token
@@ -62,20 +56,16 @@ var loginWithGoogle = function loginWithGoogle() {
62
56
  return Promise.reject('NOT_GRANTED');
63
57
  });
64
58
  };
65
-
66
59
  var loadGoogleSDK = function loadGoogleSDK(clientId, scope) {
67
60
  if (global.gapi) {
68
61
  return;
69
62
  }
70
-
71
63
  var script = document.createElement('script');
72
64
  script.src = 'https://apis.google.com/js/api.js';
73
65
  script.async = true;
74
66
  script.defer = true;
75
-
76
67
  script.onload = function () {
77
68
  return onScriptLoaded(clientId, scope);
78
69
  };
79
-
80
70
  document.getElementsByTagName('body')[0].appendChild(script);
81
71
  };
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import { WithSocialLogin } from './with-social-login';
3
+
3
4
  /**
4
5
  * @see {@link WithSocialLogin}
5
6
  * @component
6
7
  * @category Login
7
8
  */
8
-
9
9
  export function WithLinkedInLogin(_ref) {
10
10
  var clientKey = _ref.clientKey,
11
- children = _ref.children,
12
- scope = _ref.scope,
13
- emailMandatory = _ref.emailMandatory,
14
- redirectUrl = _ref.redirectUrl,
15
- sso = _ref.sso,
16
- isBridgekeeperLogin = _ref.isBridgekeeperLogin;
11
+ children = _ref.children,
12
+ scope = _ref.scope,
13
+ emailMandatory = _ref.emailMandatory,
14
+ redirectUrl = _ref.redirectUrl,
15
+ sso = _ref.sso,
16
+ isBridgekeeperLogin = _ref.isBridgekeeperLogin;
17
17
  return /*#__PURE__*/React.createElement(WithSocialLogin, {
18
18
  provider: 'linkedin',
19
19
  initialize: function initialize() {
@@ -30,12 +30,10 @@ export function WithLinkedInLogin(_ref) {
30
30
  isBridgekeeperLogin: isBridgekeeperLogin
31
31
  });
32
32
  }
33
-
34
33
  var loadLinkedInSdk = function loadLinkedInSdk(clientKey, scope) {
35
34
  if (global.IN) {
36
35
  return;
37
36
  }
38
-
39
37
  var script = document.createElement('script');
40
38
  script.src = '//platform.linkedin.com/in.js';
41
39
  script.type = 'text/javascript';
@@ -44,14 +42,11 @@ var loadLinkedInSdk = function loadLinkedInSdk(clientKey, scope) {
44
42
  script.innerHTML = "\n api_key: ".concat(clientKey, "\n");
45
43
  document.getElementsByTagName('body')[0].appendChild(script);
46
44
  };
47
-
48
45
  var loginWithLinkedIn = function loginWithLinkedIn(_ref2) {
49
46
  var emailMandatory = _ref2.emailMandatory;
50
-
51
47
  if (!global.IN || !global.IN.User) {
52
48
  return Promise.reject("NOT_LOADED");
53
49
  }
54
-
55
50
  return new Promise(function (resolve, reject) {
56
51
  global.IN.User.authorize(function (e) {
57
52
  if (global.IN.User.isAuthorized()) {
@@ -1,16 +1,14 @@
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";
4
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
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
-
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
8
  import { bool, func, string } from 'prop-types';
12
9
  import React from 'react';
13
10
  import { postRequest } from '../api-client';
11
+
14
12
  /**
15
13
  * This is an abstract render props component for logging in with social accounts. The component adds two items to scope: `serverSideLoginPath` for redirecting to server side, and `login` for doing a client side login. Calling `login()` returns a promise which can be used to handle success and failure cases.
16
14
  *
@@ -58,26 +56,19 @@ import { postRequest } from '../api-client';
58
56
  * @hideconstructor
59
57
  * @category Login
60
58
  */
61
-
62
59
  export var WithSocialLogin = /*#__PURE__*/function (_React$Component) {
63
- _inherits(WithSocialLogin, _React$Component);
64
-
65
- var _super = /*#__PURE__*/_createSuper(WithSocialLogin);
66
-
67
60
  function WithSocialLogin(props) {
68
61
  var _this;
69
-
70
62
  _classCallCheck(this, WithSocialLogin);
71
-
72
- _this = _super.call(this, props);
63
+ _this = _callSuper(this, WithSocialLogin, [props]);
73
64
  _this.bridgekeeperServerLoginPath = "/api/auth/v1/login?auth-provider=".concat(_this.props.provider, "&redirect-url=").concat(_this.props.redirectUrl ? _this.props.redirectUrl : global.location && global.location.origin);
74
65
  _this.defaultServerLoginPath = "/login?auth-provider=".concat(_this.props.provider, "&remote-host=").concat(global.location && global.location.origin);
75
66
  _this.serverLoginPath = _this.props.isBridgekeeperLogin ? _this.bridgekeeperServerLoginPath : _this.defaultServerLoginPath;
76
67
  _this.serverSideSSOLoginPath = "/login?auth-provider=".concat(_this.props.provider, "&redirect-url=").concat(_this.props.sso && _this.props.redirectUrl ? _this.props.redirectUrl : global.location && global.location.origin);
77
68
  return _this;
78
69
  }
79
-
80
- _createClass(WithSocialLogin, [{
70
+ _inherits(WithSocialLogin, _React$Component);
71
+ return _createClass(WithSocialLogin, [{
81
72
  key: "componentDidMount",
82
73
  value: function componentDidMount() {
83
74
  this.props.initialize();
@@ -86,7 +77,6 @@ export var WithSocialLogin = /*#__PURE__*/function (_React$Component) {
86
77
  key: "render",
87
78
  value: function render() {
88
79
  var _this2 = this;
89
-
90
80
  return this.props.children({
91
81
  login: function login(props) {
92
82
  return _this2.props.socialLogin.call(_this2, props).then(function (token) {
@@ -97,10 +87,7 @@ export var WithSocialLogin = /*#__PURE__*/function (_React$Component) {
97
87
  });
98
88
  }
99
89
  }]);
100
-
101
- return WithSocialLogin;
102
90
  }(React.Component);
103
-
104
91
  function createSession(provider, token) {
105
92
  return postRequest("/api/login/".concat(provider), {
106
93
  token: token,
@@ -109,7 +96,6 @@ function createSession(provider, token) {
109
96
  return r;
110
97
  });
111
98
  }
112
-
113
99
  WithSocialLogin.defaultProps = {
114
100
  initialize: function initialize() {},
115
101
  // function is rebound in WithSocialLogin
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import { WithSocialLogin } from './with-social-login';
3
+
3
4
  /**
4
5
  * @see {@link WithSocialLogin}
5
6
  * @component
6
7
  * @category Login
7
8
  */
8
-
9
9
  export function WithTwitterLogin(_ref) {
10
10
  var clientId = _ref.clientId,
11
- children = _ref.children,
12
- scope = _ref.scope,
13
- emailMandatory = _ref.emailMandatory,
14
- redirectUrl = _ref.redirectUrl,
15
- sso = _ref.sso,
16
- isBridgekeeperLogin = _ref.isBridgekeeperLogin;
11
+ children = _ref.children,
12
+ scope = _ref.scope,
13
+ emailMandatory = _ref.emailMandatory,
14
+ redirectUrl = _ref.redirectUrl,
15
+ sso = _ref.sso,
16
+ isBridgekeeperLogin = _ref.isBridgekeeperLogin;
17
17
  return /*#__PURE__*/React.createElement(WithSocialLogin, {
18
18
  provider: 'twitter',
19
19
  children: children,
@@ -1,22 +1,17 @@
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";
4
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
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
-
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
8
  import React from 'react';
12
9
  import { connect } from 'react-redux';
13
10
  import { withError } from './with-error';
14
-
15
11
  function getNativeShareHandler(canNativeShare, title, fullUrl) {
16
12
  if (!canNativeShare) {
17
13
  return null;
18
14
  }
19
-
20
15
  return function handleShare() {
21
16
  window.navigator.share({
22
17
  title: title,
@@ -24,25 +19,18 @@ function getNativeShareHandler(canNativeShare, title, fullUrl) {
24
19
  })["catch"](console.error);
25
20
  };
26
21
  }
27
-
28
22
  var SocialShareBase = /*#__PURE__*/function (_React$Component) {
29
- _inherits(SocialShareBase, _React$Component);
30
-
31
- var _super = /*#__PURE__*/_createSuper(SocialShareBase);
32
-
33
23
  function SocialShareBase(props) {
34
24
  var _this;
35
-
36
25
  _classCallCheck(this, SocialShareBase);
37
-
38
- _this = _super.call(this, props);
26
+ _this = _callSuper(this, SocialShareBase, [props]);
39
27
  _this.state = {
40
28
  canNativeShare: false
41
29
  };
42
30
  return _this;
43
31
  }
44
-
45
- _createClass(SocialShareBase, [{
32
+ _inherits(SocialShareBase, _React$Component);
33
+ return _createClass(SocialShareBase, [{
46
34
  key: "componentDidMount",
47
35
  value: function componentDidMount() {
48
36
  this.setState({
@@ -66,15 +54,13 @@ var SocialShareBase = /*#__PURE__*/function (_React$Component) {
66
54
  }, this.props));
67
55
  }
68
56
  }]);
69
-
70
- return SocialShareBase;
71
57
  }(React.Component);
72
-
73
58
  function mapStateToProps(state) {
74
59
  return {
75
60
  publisherUrl: state.qt.config['sketches-host']
76
61
  };
77
62
  }
63
+
78
64
  /**
79
65
  * This component renders social share component to front end app.
80
66
  *
@@ -112,6 +98,4 @@ function mapStateToProps(state) {
112
98
  * @component
113
99
  * @category Story Page
114
100
  */
115
-
116
-
117
- export var SocialShare = /*#__PURE__*/connect(mapStateToProps, {})( /*#__PURE__*/withError(SocialShareBase));
101
+ export var SocialShare = /*#__PURE__*/connect(mapStateToProps, {})(/*#__PURE__*/withError(SocialShareBase));