auth0-lock 11.35.0 → 12.0.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.
Files changed (240) hide show
  1. package/.browserslistrc +1 -0
  2. package/.circleci/config.yml +3 -1
  3. package/.shiprc +4 -5
  4. package/CHANGELOG.md +25 -0
  5. package/DEVELOPMENT.md +1 -1
  6. package/README.md +20 -16
  7. package/karma.conf.js +1 -1
  8. package/lib/CSSCore.js +1 -4
  9. package/lib/__tests__/auth_button.js +12 -22
  10. package/lib/__tests__/connection/database/actions.js +48 -49
  11. package/lib/__tests__/connection/database/index.js +22 -28
  12. package/lib/__tests__/connection/database/login_pane.js +24 -47
  13. package/lib/__tests__/connection/database/password_reset_confirmation.js +23 -32
  14. package/lib/__tests__/connection/database/reset_password.js +17 -39
  15. package/lib/__tests__/connection/database/signed_up_confirmation.js +23 -32
  16. package/lib/__tests__/connection/enterprise/actions.js +22 -47
  17. package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
  18. package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
  19. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +32 -75
  20. package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
  21. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +23 -32
  22. package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
  23. package/lib/__tests__/core/actions.js +23 -46
  24. package/lib/__tests__/core/client/index.js +10 -13
  25. package/lib/__tests__/core/index.js +46 -94
  26. package/lib/__tests__/core/remote_data.js +14 -20
  27. package/lib/__tests__/core/signed_in_confirmation.js +23 -32
  28. package/lib/__tests__/core/sso/last_login_screen.js +27 -50
  29. package/lib/__tests__/core/tenant.js +10 -12
  30. package/lib/__tests__/core/web_api/helper.js +6 -14
  31. package/lib/__tests__/core/web_api/p2_api.js +38 -33
  32. package/lib/__tests__/core/web_api.js +37 -33
  33. package/lib/__tests__/engine/classic/login.js +20 -41
  34. package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
  35. package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
  36. package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
  37. package/lib/__tests__/engine/classic.js +13 -6
  38. package/lib/__tests__/engine/passwordless/social_or_email_login_screen.js +7 -28
  39. package/lib/__tests__/engine/passwordless/social_or_phone_number_login_screen.js +7 -28
  40. package/lib/__tests__/engine/passwordless.js +2 -5
  41. package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
  42. package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
  43. package/lib/__tests__/field/captcha.js +39 -51
  44. package/lib/__tests__/field/custom_input.js +23 -47
  45. package/lib/__tests__/field/email.js +2 -3
  46. package/lib/__tests__/field/email_pane.js +25 -48
  47. package/lib/__tests__/field/field.js +9 -13
  48. package/lib/__tests__/field/login_pane.js +30 -34
  49. package/lib/__tests__/field/mfa_code_pane.js +13 -28
  50. package/lib/__tests__/field/option_selection_pane.js +7 -25
  51. package/lib/__tests__/field/password.js +6 -12
  52. package/lib/__tests__/field/password_pane.js +29 -46
  53. package/lib/__tests__/field/phone_number_pane.js +18 -41
  54. package/lib/__tests__/field/social_buttons_pane.js +30 -47
  55. package/lib/__tests__/field/username.js +27 -48
  56. package/lib/__tests__/field/username_pane.js +30 -47
  57. package/lib/__tests__/field/vcode.js +5 -13
  58. package/lib/__tests__/field/vcode_pane.js +20 -44
  59. package/lib/__tests__/i18n.js +28 -53
  60. package/lib/__tests__/quick-auth/actions.js +4 -27
  61. package/lib/__tests__/setup-tests.js +7 -9
  62. package/lib/__tests__/testUtils.js +41 -58
  63. package/lib/__tests__/ui/box/chrome.js +24 -49
  64. package/lib/__tests__/ui/box/confirmation_pane.js +23 -42
  65. package/lib/__tests__/ui/box/container.js +21 -46
  66. package/lib/__tests__/ui/box/global_message.js +60 -37
  67. package/lib/__tests__/ui/input/email_input.js +6 -17
  68. package/lib/__tests__/ui/input/input_wrap.js +6 -19
  69. package/lib/__tests__/ui/input/password/password_strength.js +13 -15
  70. package/lib/__tests__/ui/input/password_input.js +22 -27
  71. package/lib/__tests__/utils/format.js +10 -17
  72. package/lib/__tests__/utils/url_utils.js +2 -5
  73. package/lib/avatar/gravatar_provider.js +13 -28
  74. package/lib/avatar.js +22 -41
  75. package/lib/browser.js +372 -23
  76. package/lib/connection/captcha.js +15 -34
  77. package/lib/connection/database/actions.js +39 -108
  78. package/lib/connection/database/index.js +90 -191
  79. package/lib/connection/database/login_pane.js +107 -147
  80. package/lib/connection/database/login_sign_up_tabs.js +106 -125
  81. package/lib/connection/database/mfa_pane.js +50 -69
  82. package/lib/connection/database/password_reset_confirmation.js +51 -73
  83. package/lib/connection/database/reset_password.js +116 -132
  84. package/lib/connection/database/reset_password_pane.js +45 -56
  85. package/lib/connection/database/sign_up_terms.js +17 -23
  86. package/lib/connection/database/signed_up_confirmation.js +52 -75
  87. package/lib/connection/enterprise/actions.js +23 -52
  88. package/lib/connection/enterprise/hrd_pane.js +60 -76
  89. package/lib/connection/enterprise/hrd_screen.js +60 -75
  90. package/lib/connection/enterprise/kerberos_screen.js +46 -60
  91. package/lib/connection/enterprise/quick_auth_screen.js +46 -64
  92. package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
  93. package/lib/connection/enterprise.js +51 -84
  94. package/lib/connection/passwordless/actions.js +29 -65
  95. package/lib/connection/passwordless/ask_vcode.js +53 -60
  96. package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
  97. package/lib/connection/passwordless/index.js +36 -68
  98. package/lib/connection/social/index.js +12 -15
  99. package/lib/core/actions.js +33 -85
  100. package/lib/core/client/index.js +38 -58
  101. package/lib/core/client/settings.js +12 -20
  102. package/lib/core/error_screen.js +38 -52
  103. package/lib/core/index.js +154 -305
  104. package/lib/core/loading_screen.js +61 -71
  105. package/lib/core/pane_separator.js +10 -10
  106. package/lib/core/remote_data.js +30 -51
  107. package/lib/core/screen.js +85 -79
  108. package/lib/core/signed_in_confirmation.js +51 -73
  109. package/lib/core/sso/data.js +9 -17
  110. package/lib/core/sso/index.js +5 -6
  111. package/lib/core/sso/last_login_screen.js +46 -63
  112. package/lib/core/tenant/index.js +37 -59
  113. package/lib/core/tenant/settings.js +11 -15
  114. package/lib/core/web_api/helper.js +22 -28
  115. package/lib/core/web_api/p2_api.js +162 -171
  116. package/lib/core/web_api.js +106 -94
  117. package/lib/core.js +126 -160
  118. package/lib/engine/classic/login.js +92 -144
  119. package/lib/engine/classic/mfa_login_screen.js +61 -67
  120. package/lib/engine/classic/sign_up_pane.js +89 -123
  121. package/lib/engine/classic/sign_up_screen.js +112 -158
  122. package/lib/engine/classic.js +122 -183
  123. package/lib/engine/passwordless/social_or_email_login_screen.js +80 -116
  124. package/lib/engine/passwordless/social_or_phone_number_login_screen.js +79 -110
  125. package/lib/engine/passwordless.js +75 -104
  126. package/lib/field/actions.js +11 -17
  127. package/lib/field/captcha/captcha_pane.js +83 -103
  128. package/lib/field/captcha/recaptcha.js +140 -145
  129. package/lib/field/captcha.js +7 -10
  130. package/lib/field/custom_input.js +37 -50
  131. package/lib/field/email/email_pane.js +90 -109
  132. package/lib/field/email.js +17 -35
  133. package/lib/field/index.js +50 -87
  134. package/lib/field/mfa-code/mfa_code_pane.js +57 -71
  135. package/lib/field/mfa_code.js +15 -21
  136. package/lib/field/option_selection_pane.js +16 -22
  137. package/lib/field/password/password_pane.js +79 -91
  138. package/lib/field/password.js +8 -14
  139. package/lib/field/phone-number/locations.js +7 -3
  140. package/lib/field/phone-number/phone_number_pane.js +87 -124
  141. package/lib/field/phone_number.js +16 -30
  142. package/lib/field/social/event.js +9 -12
  143. package/lib/field/social/social_buttons_pane.js +93 -121
  144. package/lib/field/username/username_pane.js +105 -123
  145. package/lib/field/username.js +16 -26
  146. package/lib/field/vcode/vcode_pane.js +67 -93
  147. package/lib/field/vcode.js +5 -5
  148. package/lib/i18n/af.js +7 -4
  149. package/lib/i18n/ar.js +7 -4
  150. package/lib/i18n/az.js +7 -4
  151. package/lib/i18n/bg.js +7 -4
  152. package/lib/i18n/ca.js +7 -4
  153. package/lib/i18n/cs.js +7 -4
  154. package/lib/i18n/da.js +7 -4
  155. package/lib/i18n/de.js +7 -3
  156. package/lib/i18n/el.js +7 -4
  157. package/lib/i18n/en.js +9 -4
  158. package/lib/i18n/es.js +7 -3
  159. package/lib/i18n/et.js +7 -4
  160. package/lib/i18n/fa.js +7 -4
  161. package/lib/i18n/fi.js +7 -4
  162. package/lib/i18n/fr.js +7 -4
  163. package/lib/i18n/he.js +7 -4
  164. package/lib/i18n/hr.js +7 -4
  165. package/lib/i18n/hu.js +7 -4
  166. package/lib/i18n/id.js +7 -4
  167. package/lib/i18n/it.js +7 -3
  168. package/lib/i18n/ja.js +7 -4
  169. package/lib/i18n/ko.js +7 -4
  170. package/lib/i18n/lt.js +7 -4
  171. package/lib/i18n/lv.js +7 -4
  172. package/lib/i18n/ms.js +7 -4
  173. package/lib/i18n/nb.js +7 -4
  174. package/lib/i18n/nl.js +7 -4
  175. package/lib/i18n/nn.js +7 -4
  176. package/lib/i18n/no.js +7 -4
  177. package/lib/i18n/pl.js +7 -4
  178. package/lib/i18n/pt-br.js +7 -3
  179. package/lib/i18n/pt.js +7 -4
  180. package/lib/i18n/ro.js +7 -4
  181. package/lib/i18n/ru.js +7 -4
  182. package/lib/i18n/sk.js +7 -4
  183. package/lib/i18n/sl.js +7 -4
  184. package/lib/i18n/sr.js +7 -4
  185. package/lib/i18n/sv.js +7 -4
  186. package/lib/i18n/tr.js +7 -4
  187. package/lib/i18n/ua.js +7 -4
  188. package/lib/i18n/uk.js +7 -4
  189. package/lib/i18n/vi.js +7 -4
  190. package/lib/i18n/zh-tw.js +7 -4
  191. package/lib/i18n/zh.js +7 -4
  192. package/lib/i18n.js +38 -75
  193. package/lib/index.js +14 -17
  194. package/lib/lock.js +29 -32
  195. package/lib/passwordless.js +29 -31
  196. package/lib/quick-auth/actions.js +19 -26
  197. package/lib/quick_auth.js +8 -10
  198. package/lib/sanitizer.js +5 -5
  199. package/lib/store/index.js +22 -42
  200. package/lib/sync.js +21 -42
  201. package/lib/ui/box/button.js +85 -105
  202. package/lib/ui/box/chrome.js +463 -548
  203. package/lib/ui/box/confirmation_pane.js +34 -48
  204. package/lib/ui/box/container.js +305 -339
  205. package/lib/ui/box/global_message.js +51 -60
  206. package/lib/ui/box/header.js +155 -177
  207. package/lib/ui/box/multisize_slide.js +233 -229
  208. package/lib/ui/box/success_pane.js +34 -37
  209. package/lib/ui/box.js +88 -93
  210. package/lib/ui/button/auth_button.js +44 -51
  211. package/lib/ui/input/captcha_input.js +162 -181
  212. package/lib/ui/input/checkbox_input.js +57 -59
  213. package/lib/ui/input/email_input.js +117 -124
  214. package/lib/ui/input/input_wrap.js +65 -80
  215. package/lib/ui/input/location_input.js +130 -150
  216. package/lib/ui/input/mfa_code_input.js +98 -98
  217. package/lib/ui/input/password/password_strength.js +103 -127
  218. package/lib/ui/input/password_input.js +141 -147
  219. package/lib/ui/input/phone_number_input.js +101 -109
  220. package/lib/ui/input/select_input.js +120 -132
  221. package/lib/ui/input/text_input.js +89 -84
  222. package/lib/ui/input/username_input.js +109 -115
  223. package/lib/ui/input/vcode_input.js +110 -118
  224. package/lib/ui/list.js +224 -247
  225. package/lib/ui/pane/quick_auth_pane.js +55 -80
  226. package/lib/utils/atom.js +55 -48
  227. package/lib/utils/cache.js +54 -43
  228. package/lib/utils/cdn_utils.js +17 -31
  229. package/lib/utils/createRef.js +3 -1
  230. package/lib/utils/data_utils.js +10 -16
  231. package/lib/utils/fn_utils.js +5 -4
  232. package/lib/utils/format.js +6 -8
  233. package/lib/utils/id_utils.js +4 -3
  234. package/lib/utils/jsonp_utils.js +20 -17
  235. package/lib/utils/media_utils.js +4 -2
  236. package/lib/utils/preload_utils.js +4 -3
  237. package/lib/utils/string_utils.js +4 -4
  238. package/lib/utils/url_utils.js +4 -3
  239. package/package.json +48 -34
  240. package/webpack.config.js +36 -3
@@ -1,136 +1,102 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _react = require('react');
6
-
7
- var _react2 = _interopRequireDefault(_react);
8
-
9
- var _email_pane = require('../../field/email/email_pane');
10
-
11
- var _email_pane2 = _interopRequireDefault(_email_pane);
12
-
13
- var _password_pane = require('../../field/password/password_pane');
14
-
15
- var _password_pane2 = _interopRequireDefault(_password_pane);
16
-
17
- var _username_pane = require('../../field/username/username_pane');
18
-
19
- var _username_pane2 = _interopRequireDefault(_username_pane);
20
-
21
- var _custom_input = require('../../field/custom_input');
22
-
23
- var _custom_input2 = _interopRequireDefault(_custom_input);
24
-
25
- var _index = require('../../connection/database/index');
26
-
27
- var _captcha_pane = require('../../field/captcha/captcha_pane');
28
-
29
- var _captcha_pane2 = _interopRequireDefault(_captcha_pane);
30
-
31
- var _index2 = require('../../core/index');
32
-
33
- var l = _interopRequireWildcard(_index2);
34
-
35
- var _captcha = require('../../connection/captcha');
36
-
37
- var _enterprise = require('../../connection/enterprise');
38
-
39
- var _classic = require('../classic');
40
-
41
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
42
-
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _email_pane = _interopRequireDefault(require("../../field/email/email_pane"));
10
+ var _password_pane = _interopRequireDefault(require("../../field/password/password_pane"));
11
+ var _username_pane = _interopRequireDefault(require("../../field/username/username_pane"));
12
+ var _custom_input = _interopRequireDefault(require("../../field/custom_input"));
13
+ var _index = require("../../connection/database/index");
14
+ var _captcha_pane = _interopRequireDefault(require("../../field/captcha/captcha_pane"));
15
+ var l = _interopRequireWildcard(require("../../core/index"));
16
+ var _captcha = require("../../connection/captcha");
17
+ var _enterprise = require("../../connection/enterprise");
18
+ var _classic = require("../classic");
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
43
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
44
-
45
22
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
46
-
47
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
48
-
49
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
50
-
51
- var SignUpPane = function (_React$Component) {
23
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
26
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
27
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+ 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); }; }
30
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
31
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
32
+ 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; } }
33
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
34
+ var SignUpPane = /*#__PURE__*/function (_React$Component) {
52
35
  _inherits(SignUpPane, _React$Component);
53
-
36
+ var _super = _createSuper(SignUpPane);
54
37
  function SignUpPane() {
55
38
  _classCallCheck(this, SignUpPane);
56
-
57
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
39
+ return _super.apply(this, arguments);
58
40
  }
59
-
60
- SignUpPane.prototype.render = function render() {
61
- var _props = this.props,
62
- emailInputPlaceholder = _props.emailInputPlaceholder,
63
- instructions = _props.instructions,
64
- i18n = _props.i18n,
65
- model = _props.model,
66
- onlyEmail = _props.onlyEmail,
67
- passwordInputPlaceholder = _props.passwordInputPlaceholder,
68
- passwordStrengthMessages = _props.passwordStrengthMessages,
69
- usernameInputPlaceholder = _props.usernameInputPlaceholder;
70
-
71
-
72
- var headerText = instructions || null;
73
- var header = headerText && _react2.default.createElement(
74
- 'p',
75
- null,
76
- headerText
77
- );
78
- var sso = (0, _classic.isSSOEnabled)(model);
79
-
80
- var usernamePane = !onlyEmail && (0, _index.databaseConnectionRequiresUsername)(model) && !(0, _index.signUpHideUsernameField)(model) ? _react2.default.createElement(_username_pane2.default, {
81
- i18n: i18n,
82
- lock: model,
83
- placeholder: usernameInputPlaceholder,
84
- validateFormat: true,
85
- strictValidation: (0, _index.signUpFieldsStrictValidation)(model)
86
- }) : null;
87
-
88
- var fields = !onlyEmail && (0, _index.additionalSignUpFields)(model).map(function (x) {
89
- return _react2.default.createElement(_custom_input2.default, {
90
- iconUrl: x.get('icon'),
91
- key: x.get('name'),
92
- model: model,
93
- name: x.get('name'),
94
- ariaLabel: x.get('ariaLabel'),
95
- options: x.get('options'),
96
- placeholder: x.get('placeholder'),
97
- placeholderHTML: x.get('placeholderHTML'),
98
- type: x.get('type'),
99
- validator: x.get('validator'),
100
- value: x.get('value')
41
+ _createClass(SignUpPane, [{
42
+ key: "render",
43
+ value: function render() {
44
+ var _this$props = this.props,
45
+ emailInputPlaceholder = _this$props.emailInputPlaceholder,
46
+ instructions = _this$props.instructions,
47
+ i18n = _this$props.i18n,
48
+ model = _this$props.model,
49
+ onlyEmail = _this$props.onlyEmail,
50
+ passwordInputPlaceholder = _this$props.passwordInputPlaceholder,
51
+ passwordStrengthMessages = _this$props.passwordStrengthMessages,
52
+ usernameInputPlaceholder = _this$props.usernameInputPlaceholder;
53
+ var headerText = instructions || null;
54
+ var header = headerText && /*#__PURE__*/_react.default.createElement("p", null, headerText);
55
+ var sso = (0, _classic.isSSOEnabled)(model);
56
+ var usernamePane = !onlyEmail && (0, _index.databaseConnectionRequiresUsername)(model) && !(0, _index.signUpHideUsernameField)(model) ? /*#__PURE__*/_react.default.createElement(_username_pane.default, {
57
+ i18n: i18n,
58
+ lock: model,
59
+ placeholder: usernameInputPlaceholder,
60
+ validateFormat: true,
61
+ strictValidation: (0, _index.signUpFieldsStrictValidation)(model)
62
+ }) : null;
63
+ var fields = !onlyEmail && (0, _index.additionalSignUpFields)(model).map(function (x) {
64
+ return /*#__PURE__*/_react.default.createElement(_custom_input.default, {
65
+ iconUrl: x.get('icon'),
66
+ key: x.get('name'),
67
+ model: model,
68
+ name: x.get('name'),
69
+ ariaLabel: x.get('ariaLabel'),
70
+ options: x.get('options'),
71
+ placeholder: x.get('placeholder'),
72
+ placeholderHTML: x.get('placeholderHTML'),
73
+ type: x.get('type'),
74
+ validator: x.get('validator'),
75
+ value: x.get('value')
76
+ });
101
77
  });
102
- });
103
-
104
- var captchaPane = l.captcha(model) && l.captcha(model).get('required') && ((0, _enterprise.isHRDDomain)(model, (0, _index.databaseUsernameValue)(model)) || !sso) ? _react2.default.createElement(_captcha_pane2.default, { i18n: i18n, lock: model, onReload: function onReload() {
105
- return (0, _captcha.swapCaptcha)(l.id(model), false, false);
106
- } }) : null;
107
-
108
- var passwordPane = !onlyEmail && _react2.default.createElement(_password_pane2.default, {
109
- i18n: i18n,
110
- lock: model,
111
- placeholder: passwordInputPlaceholder,
112
- policy: (0, _index.passwordStrengthPolicy)(model),
113
- strengthMessages: passwordStrengthMessages
114
- });
115
-
116
- return _react2.default.createElement(
117
- 'div',
118
- null,
119
- header,
120
- _react2.default.createElement(_email_pane2.default, {
78
+ var captchaPane = l.captcha(model) && l.captcha(model).get('required') && ((0, _enterprise.isHRDDomain)(model, (0, _index.databaseUsernameValue)(model)) || !sso) ? /*#__PURE__*/_react.default.createElement(_captcha_pane.default, {
79
+ i18n: i18n,
80
+ lock: model,
81
+ onReload: function onReload() {
82
+ return (0, _captcha.swapCaptcha)(l.id(model), false, false);
83
+ }
84
+ }) : null;
85
+ var passwordPane = !onlyEmail && /*#__PURE__*/_react.default.createElement(_password_pane.default, {
86
+ i18n: i18n,
87
+ lock: model,
88
+ placeholder: passwordInputPlaceholder,
89
+ policy: (0, _index.passwordStrengthPolicy)(model),
90
+ strengthMessages: passwordStrengthMessages
91
+ });
92
+ return /*#__PURE__*/_react.default.createElement("div", null, header, /*#__PURE__*/_react.default.createElement(_email_pane.default, {
121
93
  i18n: i18n,
122
94
  lock: model,
123
95
  placeholder: emailInputPlaceholder,
124
96
  strictValidation: (0, _index.signUpFieldsStrictValidation)(model)
125
- }),
126
- usernamePane,
127
- passwordPane,
128
- fields,
129
- captchaPane
130
- );
131
- };
132
-
97
+ }), usernamePane, passwordPane, fields, captchaPane);
98
+ }
99
+ }]);
133
100
  return SignUpPane;
134
- }(_react2.default.Component);
135
-
101
+ }(_react.default.Component);
136
102
  exports.default = SignUpPane;
@@ -1,101 +1,64 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _react = require('react');
6
-
7
- var _react2 = _interopRequireDefault(_react);
8
-
9
- var _screen = require('../../core/screen');
10
-
11
- var _screen2 = _interopRequireDefault(_screen);
12
-
13
- var _index = require('../../connection/database/index');
14
-
15
- var _actions = require('../../connection/database/actions');
16
-
17
- var _classic = require('../classic');
18
-
19
- var _signed_in_confirmation = require('../../core/signed_in_confirmation');
20
-
21
- var _signed_up_confirmation = require('../../connection/database/signed_up_confirmation');
22
-
23
- var _index2 = require('../../field/index');
24
-
25
- var _actions2 = require('../../connection/enterprise/actions');
26
-
27
- var _enterprise = require('../../connection/enterprise');
28
-
29
- var _index3 = require('../../core/index');
30
-
31
- var l = _interopRequireWildcard(_index3);
32
-
33
- var _i18n = require('../../i18n');
34
-
35
- var i18n = _interopRequireWildcard(_i18n);
36
-
37
- var _sign_up_pane = require('./sign_up_pane');
38
-
39
- var _sign_up_pane2 = _interopRequireDefault(_sign_up_pane);
40
-
41
- var _pane_separator = require('../../core/pane_separator');
42
-
43
- var _pane_separator2 = _interopRequireDefault(_pane_separator);
44
-
45
- var _sign_up_terms = require('../../connection/database/sign_up_terms');
46
-
47
- var _sign_up_terms2 = _interopRequireDefault(_sign_up_terms);
48
-
49
- var _social_buttons_pane = require('../../field/social/social_buttons_pane');
50
-
51
- var _social_buttons_pane2 = _interopRequireDefault(_social_buttons_pane);
52
-
53
- var _login_sign_up_tabs = require('../../connection/database/login_sign_up_tabs');
54
-
55
- var _login_sign_up_tabs2 = _interopRequireDefault(_login_sign_up_tabs);
56
-
57
- var _single_sign_on_notice = require('../../connection/enterprise/single_sign_on_notice');
58
-
59
- var _single_sign_on_notice2 = _interopRequireDefault(_single_sign_on_notice);
60
-
61
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
62
-
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _screen = _interopRequireDefault(require("../../core/screen"));
10
+ var _index = require("../../connection/database/index");
11
+ var _actions = require("../../connection/database/actions");
12
+ var _classic = require("../classic");
13
+ var _signed_in_confirmation = require("../../core/signed_in_confirmation");
14
+ var _signed_up_confirmation = require("../../connection/database/signed_up_confirmation");
15
+ var _index2 = require("../../field/index");
16
+ var _actions2 = require("../../connection/enterprise/actions");
17
+ var _enterprise = require("../../connection/enterprise");
18
+ var l = _interopRequireWildcard(require("../../core/index"));
19
+ var i18n = _interopRequireWildcard(require("../../i18n"));
20
+ var _sign_up_pane = _interopRequireDefault(require("./sign_up_pane"));
21
+ var _pane_separator = _interopRequireDefault(require("../../core/pane_separator"));
22
+ var _sign_up_terms = _interopRequireDefault(require("../../connection/database/sign_up_terms"));
23
+ var _social_buttons_pane = _interopRequireDefault(require("../../field/social/social_buttons_pane"));
24
+ var _login_sign_up_tabs = _interopRequireDefault(require("../../connection/database/login_sign_up_tabs"));
25
+ var _single_sign_on_notice = _interopRequireDefault(require("../../connection/enterprise/single_sign_on_notice"));
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
63
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
64
-
65
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
66
-
67
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
68
-
69
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
70
-
30
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
31
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
32
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
33
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
34
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
35
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
36
+ 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); }; }
37
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
38
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
+ 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; } }
40
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
71
41
  var Component = function Component(_ref) {
72
42
  var i18n = _ref.i18n,
73
- model = _ref.model;
74
-
75
- var sso = (0, _classic.isSSOEnabled)(model, { emailFirst: true }) && (0, _index.hasScreen)(model, 'login');
76
- var ssoNotice = sso && _react2.default.createElement(
77
- _single_sign_on_notice2.default,
78
- null,
79
- i18n.str('ssoEnabled')
80
- );
81
-
82
- var tabs = !sso && (0, _index.hasScreen)(model, 'login') && _react2.default.createElement(_login_sign_up_tabs2.default, {
83
- key: 'loginsignup',
43
+ model = _ref.model;
44
+ var sso = (0, _classic.isSSOEnabled)(model, {
45
+ emailFirst: true
46
+ }) && (0, _index.hasScreen)(model, 'login');
47
+ var ssoNotice = sso && /*#__PURE__*/_react.default.createElement(_single_sign_on_notice.default, null, i18n.str('ssoEnabled'));
48
+ var tabs = !sso && (0, _index.hasScreen)(model, 'login') && /*#__PURE__*/_react.default.createElement(_login_sign_up_tabs.default, {
49
+ key: "loginsignup",
84
50
  lock: model,
85
51
  loginLabel: i18n.str('loginLabel'),
86
52
  signUpLabel: i18n.str('signUpLabel')
87
53
  });
88
-
89
- var social = l.hasSomeConnections(model, 'social') && _react2.default.createElement(_social_buttons_pane2.default, {
54
+ var social = l.hasSomeConnections(model, 'social') && /*#__PURE__*/_react.default.createElement(_social_buttons_pane.default, {
90
55
  instructions: i18n.html('socialSignUpInstructions'),
91
56
  labelFn: i18n.str,
92
57
  lock: model,
93
58
  signUp: true
94
59
  });
95
-
96
60
  var signUpInstructionsKey = social ? 'databaseAlternativeSignUpInstructions' : 'databaseSignUpInstructions';
97
-
98
- var db = (l.hasSomeConnections(model, 'database') || l.hasSomeConnections(model, 'enterprise')) && _react2.default.createElement(_sign_up_pane2.default, {
61
+ var db = (l.hasSomeConnections(model, 'database') || l.hasSomeConnections(model, 'enterprise')) && /*#__PURE__*/_react.default.createElement(_sign_up_pane.default, {
99
62
  emailInputPlaceholder: i18n.str('emailInputPlaceholder'),
100
63
  i18n: i18n,
101
64
  instructions: i18n.html(signUpInstructionsKey),
@@ -105,88 +68,79 @@ var Component = function Component(_ref) {
105
68
  passwordStrengthMessages: i18n.group('passwordStrength'),
106
69
  usernameInputPlaceholder: i18n.str('usernameInputPlaceholder')
107
70
  });
108
-
109
- var separator = social && db && _react2.default.createElement(_pane_separator2.default, null);
110
-
111
- return _react2.default.createElement(
112
- 'div',
113
- null,
114
- ssoNotice,
115
- tabs,
116
- _react2.default.createElement(
117
- 'div',
118
- null,
119
- social,
120
- separator,
121
- db
122
- )
123
- );
71
+ var separator = social && db && /*#__PURE__*/_react.default.createElement(_pane_separator.default, null);
72
+ return /*#__PURE__*/_react.default.createElement("div", null, ssoNotice, tabs, /*#__PURE__*/_react.default.createElement("div", null, social, separator, db));
124
73
  };
125
-
126
- var SignUp = function (_Screen) {
74
+ var SignUp = /*#__PURE__*/function (_Screen) {
127
75
  _inherits(SignUp, _Screen);
128
-
76
+ var _super = _createSuper(SignUp);
129
77
  function SignUp() {
130
78
  _classCallCheck(this, SignUp);
131
-
132
- return _possibleConstructorReturn(this, _Screen.call(this, 'main.signUp'));
79
+ return _super.call(this, 'main.signUp');
133
80
  }
134
-
135
- SignUp.prototype.submitButtonLabel = function submitButtonLabel(m) {
136
- return i18n.str(m, ['signUpSubmitLabel']);
137
- };
138
-
139
- SignUp.prototype.submitHandler = function submitHandler(m) {
140
- if ((0, _classic.hasOnlyClassicConnections)(m, 'social')) return null;
141
- var username = (0, _index.databaseUsernameValue)(m, { emailFirst: true });
142
- if ((0, _enterprise.isHRDDomain)(m, username)) {
143
- return function (id) {
144
- return (0, _actions2.startHRD)(id, username);
145
- };
81
+ _createClass(SignUp, [{
82
+ key: "submitButtonLabel",
83
+ value: function submitButtonLabel(m) {
84
+ return i18n.str(m, ['signUpSubmitLabel']);
146
85
  }
147
- if ((0, _classic.isSSOEnabled)(m, { emailFirst: true })) return _actions2.logIn;
148
- return _actions.signUp;
149
- };
150
-
151
- SignUp.prototype.isSubmitDisabled = function isSubmitDisabled(m) {
152
- return !(0, _index.termsAccepted)(m);
153
- };
154
-
155
- SignUp.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(lock) {
156
- return (0, _signed_up_confirmation.renderSignedUpConfirmation)(lock) || (0, _signed_in_confirmation.renderSignedInConfirmation)(lock) || (0, _index2.renderOptionSelection)(lock);
157
- };
158
-
159
- SignUp.prototype.renderTabs = function renderTabs() {
160
- return true;
161
- };
162
-
163
- SignUp.prototype.getScreenTitle = function getScreenTitle(m) {
164
- // signupTitle is inconsistent with the rest of the codebase
165
- // but, since changing this would be a breaking change, we'll
166
- // still support it until the next major version
167
- return i18n.str(m, 'signUpTitle') || i18n.str(m, 'signupTitle');
168
- };
169
-
170
- SignUp.prototype.renderTerms = function renderTerms(m, terms) {
171
- var checkHandler = (0, _index.mustAcceptTerms)(m) ? function () {
172
- return (0, _actions.toggleTermsAcceptance)(l.id(m));
173
- } : undefined;
174
- return terms && (0, _index.showTerms)(m) ? _react2.default.createElement(
175
- _sign_up_terms2.default,
176
- {
86
+ }, {
87
+ key: "submitHandler",
88
+ value: function submitHandler(m) {
89
+ if ((0, _classic.hasOnlyClassicConnections)(m, 'social')) return null;
90
+ var username = (0, _index.databaseUsernameValue)(m, {
91
+ emailFirst: true
92
+ });
93
+ if ((0, _enterprise.isHRDDomain)(m, username)) {
94
+ return function (id) {
95
+ return (0, _actions2.startHRD)(id, username);
96
+ };
97
+ }
98
+ if ((0, _classic.isSSOEnabled)(m, {
99
+ emailFirst: true
100
+ })) return _actions2.logIn;
101
+ return _actions.signUp;
102
+ }
103
+ }, {
104
+ key: "isSubmitDisabled",
105
+ value: function isSubmitDisabled(m) {
106
+ return !(0, _index.termsAccepted)(m);
107
+ }
108
+ }, {
109
+ key: "renderAuxiliaryPane",
110
+ value: function renderAuxiliaryPane(lock) {
111
+ return (0, _signed_up_confirmation.renderSignedUpConfirmation)(lock) || (0, _signed_in_confirmation.renderSignedInConfirmation)(lock) || (0, _index2.renderOptionSelection)(lock);
112
+ }
113
+ }, {
114
+ key: "renderTabs",
115
+ value: function renderTabs() {
116
+ return true;
117
+ }
118
+ }, {
119
+ key: "getScreenTitle",
120
+ value: function getScreenTitle(m) {
121
+ // signupTitle is inconsistent with the rest of the codebase
122
+ // but, since changing this would be a breaking change, we'll
123
+ // still support it until the next major version
124
+ return i18n.str(m, 'signUpTitle') || i18n.str(m, 'signupTitle');
125
+ }
126
+ }, {
127
+ key: "renderTerms",
128
+ value: function renderTerms(m, terms) {
129
+ var checkHandler = (0, _index.mustAcceptTerms)(m) ? function () {
130
+ return (0, _actions.toggleTermsAcceptance)(l.id(m));
131
+ } : undefined;
132
+ return terms && (0, _index.showTerms)(m) ? /*#__PURE__*/_react.default.createElement(_sign_up_terms.default, {
177
133
  showCheckbox: (0, _index.mustAcceptTerms)(m),
178
134
  checkHandler: checkHandler,
179
135
  checked: (0, _index.termsAccepted)(m)
180
- },
181
- terms
182
- ) : null;
183
- };
184
-
185
- SignUp.prototype.render = function render() {
186
- return Component;
187
- };
188
-
136
+ }, terms) : null;
137
+ }
138
+ }, {
139
+ key: "render",
140
+ value: function render() {
141
+ return Component;
142
+ }
143
+ }]);
189
144
  return SignUp;
190
- }(_screen2.default);
191
-
145
+ }(_screen.default);
192
146
  exports.default = SignUp;