@quintype/components 3.8.8-only-react-v19.2 → 3.8.8

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