auth0-lock 11.34.1 → 12.0.0-beta.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 (241) hide show
  1. package/.browserslistrc +1 -0
  2. package/.circleci/config.yml +4 -2
  3. package/.eslintrc.json +5 -5
  4. package/.github/workflows/codeql.yml +41 -0
  5. package/.shiprc +4 -5
  6. package/CHANGELOG.md +32 -0
  7. package/EXAMPLES.md +626 -0
  8. package/README.md +77 -649
  9. package/karma.conf.js +1 -1
  10. package/lib/CSSCore.js +1 -4
  11. package/lib/__tests__/auth_button.js +12 -22
  12. package/lib/__tests__/connection/database/actions.js +48 -49
  13. package/lib/__tests__/connection/database/index.js +22 -28
  14. package/lib/__tests__/connection/database/login_pane.js +20 -41
  15. package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
  16. package/lib/__tests__/connection/database/reset_password.js +17 -39
  17. package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
  18. package/lib/__tests__/connection/enterprise/actions.js +22 -47
  19. package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
  20. package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
  21. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
  22. package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
  23. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
  24. package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
  25. package/lib/__tests__/core/actions.js +23 -46
  26. package/lib/__tests__/core/client/index.js +10 -13
  27. package/lib/__tests__/core/index.js +46 -94
  28. package/lib/__tests__/core/remote_data.js +14 -20
  29. package/lib/__tests__/core/signed_in_confirmation.js +19 -26
  30. package/lib/__tests__/core/sso/last_login_screen.js +27 -50
  31. package/lib/__tests__/core/tenant.js +10 -12
  32. package/lib/__tests__/core/web_api/helper.js +6 -14
  33. package/lib/__tests__/core/web_api/p2_api.js +38 -33
  34. package/lib/__tests__/core/web_api.js +37 -33
  35. package/lib/__tests__/engine/classic/login.js +20 -41
  36. package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
  37. package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
  38. package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
  39. package/lib/__tests__/engine/classic.js +13 -6
  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 +19 -36
  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 +14 -32
  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 -62
  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 +152 -301
  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 +28 -48
  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 +24 -30
  115. package/lib/core/web_api/p2_api.js +156 -165
  116. package/lib/core/web_api.js +101 -90
  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 +71 -106
  124. package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
  125. package/lib/engine/passwordless.js +75 -104
  126. package/lib/field/actions.js +11 -17
  127. package/lib/field/captcha/captcha_pane.js +82 -102
  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 +51 -88
  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/opslevel.yml +6 -0
  240. package/package.json +53 -38
  241. package/webpack.config.js +36 -3
@@ -1,594 +1,509 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6
-
7
- var _propTypes = require('prop-types');
8
-
9
- var _propTypes2 = _interopRequireDefault(_propTypes);
10
-
11
- var _react = require('react');
12
-
13
- var _react2 = _interopRequireDefault(_react);
14
-
15
- var _reactDom = require('react-dom');
16
-
17
- var _reactDom2 = _interopRequireDefault(_reactDom);
18
-
19
- var _dompurify = require('dompurify');
20
-
21
- var _reactTransitionGroup = require('react-transition-group');
22
-
23
- var _multisize_slide = require('./multisize_slide');
24
-
25
- var _multisize_slide2 = _interopRequireDefault(_multisize_slide);
26
-
27
- var _global_message = require('./global_message');
28
-
29
- var _global_message2 = _interopRequireDefault(_global_message);
30
-
31
- var _index = require('../../core/index');
32
-
33
- var l = _interopRequireWildcard(_index);
34
-
35
- var _header = require('./header');
36
-
37
- var _header2 = _interopRequireDefault(_header);
38
-
39
- var _classnames = require('classnames');
40
-
41
- var _classnames2 = _interopRequireDefault(_classnames);
42
-
43
- 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; } }
44
-
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 _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _reactDom = _interopRequireDefault(require("react-dom"));
11
+ var _dompurify = require("dompurify");
12
+ var _reactTransitionGroup = require("react-transition-group");
13
+ var _multisize_slide = _interopRequireDefault(require("./multisize_slide"));
14
+ var _global_message = _interopRequireDefault(require("./global_message"));
15
+ var l = _interopRequireWildcard(require("../../core/index"));
16
+ var _header = _interopRequireDefault(require("./header"));
17
+ var _classnames = _interopRequireDefault(require("classnames"));
18
+ 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); }
19
+ 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; }
45
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
46
-
21
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
47
22
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
48
-
49
- 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; }
50
-
51
- 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; }
52
-
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); }
53
34
  var SubmitSvg = function SubmitSvg() {
54
- return _react2.default.createElement(
55
- 'svg',
56
- {
57
- 'aria-hidden': 'true',
58
- focusable: 'false',
59
- width: '43px',
60
- height: '42px',
61
- viewBox: '0 0 43 42',
62
- version: '1.1',
63
- xmlns: 'http://www.w3.org/2000/svg',
64
- xmlnsXlink: 'http://www.w3.org/1999/xlink'
65
- },
66
- _react2.default.createElement(
67
- 'g',
68
- { id: 'Page-1', stroke: 'none', strokeWidth: '1', fill: 'none', fillRule: 'evenodd' },
69
- _react2.default.createElement(
70
- 'g',
71
- { id: 'Lock', transform: 'translate(-280.000000, -3592.000000)' },
72
- _react2.default.createElement(
73
- 'g',
74
- { id: 'SMS', transform: 'translate(153.000000, 3207.000000)' },
75
- _react2.default.createElement(
76
- 'g',
77
- { id: 'Group' },
78
- _react2.default.createElement(
79
- 'g',
80
- { id: 'Login', transform: 'translate(0.000000, 369.000000)' },
81
- _react2.default.createElement(
82
- 'g',
83
- { id: 'Btn' },
84
- _react2.default.createElement(
85
- 'g',
86
- { id: 'Oval-302-+-Shape', transform: 'translate(128.000000, 17.000000)' },
87
- _react2.default.createElement('circle', {
88
- id: 'Oval-302',
89
- stroke: '#FFFFFF',
90
- strokeWidth: '2',
91
- cx: '20.5',
92
- cy: '20',
93
- r: '20'
94
- }),
95
- _react2.default.createElement('path', {
96
- d: 'M17.8,15.4 L19.2,14 L25.2,20 L19.2,26 L17.8,24.6 L22.4,20 L17.8,15.4 Z',
97
- id: 'Shape',
98
- fill: '#FFFFFF'
99
- })
100
- )
101
- )
102
- )
103
- )
104
- )
105
- )
106
- )
107
- );
35
+ return /*#__PURE__*/_react.default.createElement("svg", {
36
+ "aria-hidden": "true",
37
+ focusable: "false",
38
+ width: "43px",
39
+ height: "42px",
40
+ viewBox: "0 0 43 42",
41
+ version: "1.1",
42
+ xmlns: "http://www.w3.org/2000/svg",
43
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
44
+ }, /*#__PURE__*/_react.default.createElement("g", {
45
+ id: "Page-1",
46
+ stroke: "none",
47
+ strokeWidth: "1",
48
+ fill: "none",
49
+ fillRule: "evenodd"
50
+ }, /*#__PURE__*/_react.default.createElement("g", {
51
+ id: "Lock",
52
+ transform: "translate(-280.000000, -3592.000000)"
53
+ }, /*#__PURE__*/_react.default.createElement("g", {
54
+ id: "SMS",
55
+ transform: "translate(153.000000, 3207.000000)"
56
+ }, /*#__PURE__*/_react.default.createElement("g", {
57
+ id: "Group"
58
+ }, /*#__PURE__*/_react.default.createElement("g", {
59
+ id: "Login",
60
+ transform: "translate(0.000000, 369.000000)"
61
+ }, /*#__PURE__*/_react.default.createElement("g", {
62
+ id: "Btn"
63
+ }, /*#__PURE__*/_react.default.createElement("g", {
64
+ id: "Oval-302-+-Shape",
65
+ transform: "translate(128.000000, 17.000000)"
66
+ }, /*#__PURE__*/_react.default.createElement("circle", {
67
+ id: "Oval-302",
68
+ stroke: "#FFFFFF",
69
+ strokeWidth: "2",
70
+ cx: "20.5",
71
+ cy: "20",
72
+ r: "20"
73
+ }), /*#__PURE__*/_react.default.createElement("path", {
74
+ d: "M17.8,15.4 L19.2,14 L25.2,20 L19.2,26 L17.8,24.6 L22.4,20 L17.8,15.4 Z",
75
+ id: "Shape",
76
+ fill: "#FFFFFF"
77
+ })))))))));
108
78
  };
109
79
  var SubmitTextSvg = function SubmitTextSvg() {
110
- return _react2.default.createElement(
111
- 'svg',
112
- {
113
- 'aria-hidden': 'true',
114
- focusable: 'false',
115
- className: 'icon-text',
116
- width: '8px',
117
- height: '12px',
118
- viewBox: '0 0 8 12',
119
- version: '1.1',
120
- xmlns: 'http://www.w3.org/2000/svg'
121
- },
122
- _react2.default.createElement(
123
- 'g',
124
- { id: 'Symbols', stroke: 'none', strokeWidth: '1', fill: 'none', fillRule: 'evenodd' },
125
- _react2.default.createElement(
126
- 'g',
127
- { id: 'Web/Submit/Active', transform: 'translate(-148.000000, -32.000000)', fill: '#FFFFFF' },
128
- _react2.default.createElement('polygon', {
129
- id: 'Shape',
130
- points: '148 33.4 149.4 32 155.4 38 149.4 44 148 42.6 152.6 38'
131
- })
132
- )
133
- )
134
- );
80
+ return /*#__PURE__*/_react.default.createElement("svg", {
81
+ "aria-hidden": "true",
82
+ focusable: "false",
83
+ className: "icon-text",
84
+ width: "8px",
85
+ height: "12px",
86
+ viewBox: "0 0 8 12",
87
+ version: "1.1",
88
+ xmlns: "http://www.w3.org/2000/svg"
89
+ }, /*#__PURE__*/_react.default.createElement("g", {
90
+ id: "Symbols",
91
+ stroke: "none",
92
+ strokeWidth: "1",
93
+ fill: "none",
94
+ fillRule: "evenodd"
95
+ }, /*#__PURE__*/_react.default.createElement("g", {
96
+ id: "Web/Submit/Active",
97
+ transform: "translate(-148.000000, -32.000000)",
98
+ fill: "#FFFFFF"
99
+ }, /*#__PURE__*/_react.default.createElement("polygon", {
100
+ id: "Shape",
101
+ points: "148 33.4 149.4 32 155.4 38 149.4 44 148 42.6 152.6 38"
102
+ }))));
135
103
  };
136
-
137
- var SubmitButton = function (_React$Component) {
104
+ var SubmitButton = /*#__PURE__*/function (_React$Component) {
138
105
  _inherits(SubmitButton, _React$Component);
139
-
106
+ var _super = _createSuper(SubmitButton);
140
107
  function SubmitButton() {
141
108
  _classCallCheck(this, SubmitButton);
142
-
143
- return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
109
+ return _super.apply(this, arguments);
144
110
  }
145
-
146
- SubmitButton.prototype.handleSubmit = function handleSubmit() {
147
- var _props = this.props,
148
- label = _props.label,
149
- screenName = _props.screenName,
150
- contentProps = _props.contentProps;
151
- var model = contentProps.model;
152
-
153
- if (screenName === 'main.signUp') {
154
- l.emitEvent(model, 'signup submit');
155
- } else if (screenName === 'main.login') {
156
- l.emitEvent(model, 'signin submit');
157
- } else if (screenName === 'forgotPassword') {
158
- l.emitEvent(model, 'forgot_password submit');
159
- } else if (screenName === 'socialOrEmail') {
160
- l.emitEvent(model, 'socialOrEmail submit');
161
- } else if (screenName === 'socialOrPhoneNumber') {
162
- l.emitEvent(model, 'socialOrPhoneNumber submit');
163
- } else if (screenName === 'vcode') {}
164
-
165
- if (this.props.onSubmit) {
166
- this.props.onSubmit(label, screenName);
111
+ _createClass(SubmitButton, [{
112
+ key: "handleSubmit",
113
+ value: function handleSubmit() {
114
+ var _this$props = this.props,
115
+ label = _this$props.label,
116
+ screenName = _this$props.screenName,
117
+ contentProps = _this$props.contentProps;
118
+ var model = contentProps.model;
119
+ if (screenName === 'main.signUp') {
120
+ l.emitEvent(model, 'signup submit');
121
+ } else if (screenName === 'main.login') {
122
+ l.emitEvent(model, 'signin submit');
123
+ } else if (screenName === 'forgotPassword') {
124
+ l.emitEvent(model, 'forgot_password submit');
125
+ } else if (screenName === 'socialOrEmail') {
126
+ l.emitEvent(model, 'socialOrEmail submit');
127
+ } else if (screenName === 'socialOrPhoneNumber') {
128
+ l.emitEvent(model, 'socialOrPhoneNumber submit');
129
+ } else if (screenName === 'vcode') {}
130
+ if (this.props.onSubmit) {
131
+ this.props.onSubmit(label, screenName);
132
+ }
167
133
  }
168
- };
169
-
170
- SubmitButton.prototype.focus = function focus() {
171
- _reactDom2.default.findDOMNode(this).focus();
172
- };
173
-
174
- SubmitButton.prototype.render = function render() {
175
- var _props2 = this.props,
176
- color = _props2.color,
177
- disabled = _props2.disabled,
178
- label = _props2.label,
179
- display = _props2.display,
180
- contentProps = _props2.contentProps;
181
- var model = contentProps.model;
182
-
183
-
184
- var content = label ? _react2.default.createElement(
185
- 'span',
186
- { className: 'auth0-label-submit' },
187
- label,
188
- _react2.default.createElement(SubmitTextSvg, null)
189
- ) : _react2.default.createElement(SubmitSvg, null);
190
-
191
- return _react2.default.createElement(
192
- 'button',
193
- {
194
- id: l.id(model) + '-submit',
195
- className: 'auth0-lock-submit',
134
+ }, {
135
+ key: "focus",
136
+ value: function focus() {
137
+ _reactDom.default.findDOMNode(this).focus();
138
+ }
139
+ }, {
140
+ key: "render",
141
+ value: function render() {
142
+ var _this$props2 = this.props,
143
+ color = _this$props2.color,
144
+ disabled = _this$props2.disabled,
145
+ label = _this$props2.label,
146
+ display = _this$props2.display,
147
+ contentProps = _this$props2.contentProps;
148
+ var model = contentProps.model;
149
+ var content = label ? /*#__PURE__*/_react.default.createElement("span", {
150
+ className: "auth0-label-submit"
151
+ }, label, /*#__PURE__*/_react.default.createElement(SubmitTextSvg, null)) : /*#__PURE__*/_react.default.createElement(SubmitSvg, null);
152
+ return /*#__PURE__*/_react.default.createElement("button", {
153
+ id: "".concat(l.id(model), "-submit"),
154
+ className: "auth0-lock-submit",
196
155
  disabled: disabled,
197
- style: { backgroundColor: color, display: display },
156
+ style: {
157
+ backgroundColor: color,
158
+ display: display
159
+ },
198
160
  onClick: this.handleSubmit.bind(this),
199
- name: 'submit',
200
- type: 'submit',
201
- 'aria-label': label ? label : 'Submit'
202
- },
203
- _react2.default.createElement(
204
- 'div',
205
- { className: 'auth0-loading-container' },
206
- _react2.default.createElement('div', { className: 'auth0-loading' })
207
- ),
208
- content
209
- );
210
- };
211
-
161
+ name: "submit",
162
+ type: "submit",
163
+ "aria-label": label ? label : 'Submit'
164
+ }, /*#__PURE__*/_react.default.createElement("div", {
165
+ className: "auth0-loading-container"
166
+ }, /*#__PURE__*/_react.default.createElement("div", {
167
+ className: "auth0-loading"
168
+ })), content);
169
+ }
170
+ }]);
212
171
  return SubmitButton;
213
- }(_react2.default.Component);
214
-
172
+ }(_react.default.Component);
215
173
  SubmitButton.propTypes = {
216
- color: _propTypes2.default.string.isRequired,
217
- disabled: _propTypes2.default.bool,
218
- display: _propTypes2.default.string,
219
- label: _propTypes2.default.string,
220
- screenName: _propTypes2.default.string,
221
- onSubmit: _propTypes2.default.func,
222
- contentProps: _propTypes2.default.object
174
+ color: _propTypes.default.string.isRequired,
175
+ disabled: _propTypes.default.bool,
176
+ display: _propTypes.default.string,
177
+ label: _propTypes.default.string,
178
+ screenName: _propTypes.default.string,
179
+ onSubmit: _propTypes.default.func,
180
+ contentProps: _propTypes.default.object
223
181
  };
224
-
225
182
  var MESSAGE_ANIMATION_DURATION = 250;
226
183
  var AUXILIARY_ANIMATION_DURATION = 350;
227
-
228
- var Chrome = function (_React$Component2) {
184
+ var Chrome = /*#__PURE__*/function (_React$Component2) {
229
185
  _inherits(Chrome, _React$Component2);
230
-
186
+ var _super2 = _createSuper(Chrome);
231
187
  function Chrome(props) {
188
+ var _this;
232
189
  _classCallCheck(this, Chrome);
233
-
234
- var _this2 = _possibleConstructorReturn(this, _React$Component2.call(this, props));
235
-
236
- _this2.state = { moving: false, reverse: false, headerHeight: 0 };
237
- return _this2;
190
+ _this = _super2.call(this, props);
191
+ _this.state = {
192
+ moving: false,
193
+ reverse: false,
194
+ headerHeight: 0
195
+ };
196
+ return _this;
238
197
  }
239
198
 
240
199
  // eslint-disable-next-line react/no-deprecated
241
-
242
-
243
- Chrome.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
244
- var _this3 = this;
245
-
246
- var _props3 = this.props,
247
- auxiliaryPane = _props3.auxiliaryPane,
248
- showSubmitButton = _props3.showSubmitButton;
249
- var delayingShowSubmitButton = this.state.delayingShowSubmitButton;
250
-
251
-
252
- if (!showSubmitButton && nextProps.showSubmitButton && !delayingShowSubmitButton) {
253
- this.setState({ delayingShowSubmitButton: true });
254
- }
255
-
256
- if (!auxiliaryPane && nextProps.auxiliaryPane) {
257
- this.auxiliaryPaneTriggerInput = window.document.activeElement;
258
- this.setState({ moving: true });
259
- }
260
-
261
- if (auxiliaryPane && !nextProps.auxiliaryPane) {
262
- // TODO clear timeout
263
- setTimeout(function () {
264
- return _this3.setState({ moving: false });
265
- }, AUXILIARY_ANIMATION_DURATION + 50);
266
- }
267
- };
268
-
269
- Chrome.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
270
- var _this4 = this;
271
-
272
- var _props4 = this.props,
273
- autofocus = _props4.autofocus,
274
- auxiliaryPane = _props4.auxiliaryPane,
275
- error = _props4.error,
276
- screenName = _props4.screenName;
277
-
278
-
279
- if (!autofocus) return;
280
-
281
- if (auxiliaryPane && !prevProps.auxiliaryPane) {
282
- var input = this.findAutofocusInput(this.refs.auxiliary);
283
-
284
- if (input) {
285
- // TODO clear timeout
286
- setTimeout(function () {
287
- return input.focus();
288
- }, AUXILIARY_ANIMATION_DURATION);
200
+ _createClass(Chrome, [{
201
+ key: "UNSAFE_componentWillReceiveProps",
202
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
203
+ var _this2 = this;
204
+ var _this$props3 = this.props,
205
+ auxiliaryPane = _this$props3.auxiliaryPane,
206
+ showSubmitButton = _this$props3.showSubmitButton;
207
+ var delayingShowSubmitButton = this.state.delayingShowSubmitButton;
208
+ if (!showSubmitButton && nextProps.showSubmitButton && !delayingShowSubmitButton) {
209
+ this.setState({
210
+ delayingShowSubmitButton: true
211
+ });
289
212
  }
290
-
291
- return;
292
- }
293
-
294
- if (!auxiliaryPane && prevProps.auxiliaryPane) {
295
- if (this.auxiliaryPaneTriggerInput) {
213
+ if (!auxiliaryPane && nextProps.auxiliaryPane) {
214
+ this.auxiliaryPaneTriggerInput = window.document.activeElement;
215
+ this.setState({
216
+ moving: true
217
+ });
218
+ }
219
+ if (auxiliaryPane && !nextProps.auxiliaryPane) {
296
220
  // TODO clear timeout
297
221
  setTimeout(function () {
298
- return _this4.auxiliaryPaneTriggerInput.focus();
299
- }, AUXILIARY_ANIMATION_DURATION);
222
+ return _this2.setState({
223
+ moving: false
224
+ });
225
+ }, AUXILIARY_ANIMATION_DURATION + 50);
300
226
  }
301
-
302
- return;
303
227
  }
304
-
305
- if (screenName !== prevProps.screenName) {
306
- var _input = this.findAutofocusInput();
307
-
308
- if (_input) {
309
- if (this.mainScreenName(prevProps.screenName) !== this.mainScreenName()) {
310
- this.inputToFocus = _input;
311
- } else {
228
+ }, {
229
+ key: "componentDidUpdate",
230
+ value: function componentDidUpdate(prevProps) {
231
+ var _this3 = this;
232
+ var _this$props4 = this.props,
233
+ autofocus = _this$props4.autofocus,
234
+ auxiliaryPane = _this$props4.auxiliaryPane,
235
+ error = _this$props4.error,
236
+ screenName = _this$props4.screenName;
237
+ if (!autofocus) return;
238
+ if (auxiliaryPane && !prevProps.auxiliaryPane) {
239
+ var input = this.findAutofocusInput(this.refs.auxiliary);
240
+ if (input) {
241
+ // TODO clear timeout
242
+ setTimeout(function () {
243
+ return input.focus();
244
+ }, AUXILIARY_ANIMATION_DURATION);
245
+ }
246
+ return;
247
+ }
248
+ if (!auxiliaryPane && prevProps.auxiliaryPane) {
249
+ if (this.auxiliaryPaneTriggerInput) {
312
250
  // TODO clear timeout
313
251
  setTimeout(function () {
314
- return _input.focus();
315
- }, 17);
252
+ return _this3.auxiliaryPaneTriggerInput.focus();
253
+ }, AUXILIARY_ANIMATION_DURATION);
254
+ }
255
+ return;
256
+ }
257
+ if (screenName !== prevProps.screenName) {
258
+ var _input = this.findAutofocusInput();
259
+ if (_input) {
260
+ if (this.mainScreenName(prevProps.screenName) !== this.mainScreenName()) {
261
+ this.inputToFocus = _input;
262
+ } else {
263
+ // TODO clear timeout
264
+ setTimeout(function () {
265
+ return _input.focus();
266
+ }, 17);
267
+ }
316
268
  }
317
269
  }
318
270
  }
319
- };
320
-
321
- Chrome.prototype.onWillSlide = function onWillSlide() {
322
- this.setState({ moving: true });
323
- this.sliding = true;
324
- };
325
-
326
- Chrome.prototype.onDidSlide = function onDidSlide() {
327
- this.sliding = false;
328
- this.setState({ reverse: false });
329
- };
330
-
331
- Chrome.prototype.onDidAppear = function onDidAppear() {
332
- this.setState({ moving: false });
333
-
334
- if (this.state.delayingShowSubmitButton) {
335
- this.setState({ delayingShowSubmitButton: false });
271
+ }, {
272
+ key: "onWillSlide",
273
+ value: function onWillSlide() {
274
+ this.setState({
275
+ moving: true
276
+ });
277
+ this.sliding = true;
336
278
  }
337
-
338
- if (this.inputToFocus) {
339
- this.inputToFocus.focus();
340
- delete this.inputToFocus;
279
+ }, {
280
+ key: "onDidSlide",
281
+ value: function onDidSlide() {
282
+ this.sliding = false;
283
+ this.setState({
284
+ reverse: false
285
+ });
341
286
  }
342
- };
343
-
344
- Chrome.prototype.mainScreenName = function mainScreenName(str) {
345
- return (str || this.props.screenName || '').split('.')[0];
346
- };
347
-
348
- Chrome.prototype.findAutofocusInput = function findAutofocusInput(ref) {
349
- return _reactDom2.default.findDOMNode(ref || this.refs.screen).querySelector('input');
350
- };
351
-
352
- Chrome.prototype.focusError = function focusError() {
353
- var node = _reactDom2.default.findDOMNode(this.refs.screen);
354
- // TODO: make the error input selector configurable via props.
355
- var error = node.querySelector('.auth0-lock-error input');
356
-
357
- if (error) {
358
- error.focus();
287
+ }, {
288
+ key: "onDidAppear",
289
+ value: function onDidAppear() {
290
+ this.setState({
291
+ moving: false
292
+ });
293
+ if (this.state.delayingShowSubmitButton) {
294
+ this.setState({
295
+ delayingShowSubmitButton: false
296
+ });
297
+ }
298
+ if (this.inputToFocus) {
299
+ this.inputToFocus.focus();
300
+ delete this.inputToFocus;
301
+ }
359
302
  }
360
- };
361
-
362
- Chrome.prototype.render = function render() {
363
- var _this5 = this;
364
-
365
- var _props5 = this.props,
366
- avatar = _props5.avatar,
367
- auxiliaryPane = _props5.auxiliaryPane,
368
- backHandler = _props5.backHandler,
369
- contentComponent = _props5.contentComponent,
370
- contentProps = _props5.contentProps,
371
- disableSubmitButton = _props5.disableSubmitButton,
372
- error = _props5.error,
373
- info = _props5.info,
374
- isSubmitting = _props5.isSubmitting,
375
- logo = _props5.logo,
376
- primaryColor = _props5.primaryColor,
377
- screenName = _props5.screenName,
378
- showSubmitButton = _props5.showSubmitButton,
379
- submitButtonLabel = _props5.submitButtonLabel,
380
- success = _props5.success,
381
- terms = _props5.terms,
382
- title = _props5.title,
383
- classNames = _props5.classNames,
384
- scrollGlobalMessagesIntoView = _props5.scrollGlobalMessagesIntoView;
385
- var model = contentProps.model;
386
- var _state = this.state,
387
- delayingShowSubmitButton = _state.delayingShowSubmitButton,
388
- moving = _state.moving,
389
- reverse = _state.reverse;
390
-
391
-
392
- var backgroundUrl = void 0,
393
- name = void 0;
394
- if (avatar) {
395
- backgroundUrl = avatar;
396
- name = title;
397
- } else {
398
- backgroundUrl = logo;
399
- name = '';
303
+ }, {
304
+ key: "mainScreenName",
305
+ value: function mainScreenName(str) {
306
+ return (str || this.props.screenName || '').split('.')[0];
400
307
  }
401
-
402
- var shouldShowSubmitButton = showSubmitButton && !delayingShowSubmitButton;
403
-
404
- function wrapGlobalMessage(message) {
405
- return typeof message === 'string' ? // dangerouslySetInnerHTML input is sanitized using dompurify
406
- // eslint-disable-next-line react/no-danger
407
- _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: (0, _dompurify.sanitize)(message) } }) : message;
308
+ }, {
309
+ key: "findAutofocusInput",
310
+ value: function findAutofocusInput(ref) {
311
+ return _reactDom.default.findDOMNode(ref || this.refs.screen).querySelector('input');
408
312
  }
409
-
410
- var globalError = error ? _react2.default.createElement(_global_message2.default, {
411
- key: 'global-error',
412
- message: wrapGlobalMessage(error),
413
- type: 'error',
414
- scrollIntoView: scrollGlobalMessagesIntoView
415
- }) : null;
416
- var globalSuccess = success ? _react2.default.createElement(_global_message2.default, {
417
- key: 'global-success',
418
- message: wrapGlobalMessage(success),
419
- type: 'success',
420
- scrollIntoView: scrollGlobalMessagesIntoView
421
- }) : null;
422
- var globalInfo = info ? _react2.default.createElement(_global_message2.default, {
423
- key: 'global-info',
424
- message: wrapGlobalMessage(info),
425
- type: 'info',
426
- scrollIntoView: scrollGlobalMessagesIntoView
427
- }) : null;
428
-
429
- var Content = contentComponent;
430
- var isQuiet = !moving && !delayingShowSubmitButton;
431
-
432
- var className = (0, _classnames2.default)('auth0-lock-cred-pane', {
433
- 'auth0-lock-quiet': isQuiet,
434
- 'auth0-lock-moving': !isQuiet
435
- });
436
-
437
- var internalWrapperClass = (0, _classnames2.default)('auth0-lock-cred-pane-internal-wrapper', {
438
- 'auto-height': l.ui.forceAutoHeight(model)
439
- });
440
-
441
- return _react2.default.createElement(
442
- 'div',
443
- { className: className },
444
- _react2.default.createElement(
445
- 'div',
446
- { className: internalWrapperClass },
447
- _react2.default.createElement(
448
- 'div',
449
- { className: 'auth0-lock-content-wrapper' },
450
- _react2.default.createElement(_header2.default, {
451
- title: title,
452
- name: name,
453
- backHandler: backHandler && this.handleBack.bind(this),
454
- backgroundUrl: backgroundUrl,
455
- backgroundColor: primaryColor,
456
- logoUrl: logo
457
- }),
458
- _react2.default.createElement(
459
- 'div',
460
- {
461
- className: 'auth0-lock-content-body-wrapper',
462
- style: { marginTop: this.state.headerHeight }
463
- },
464
- _react2.default.createElement(
465
- _reactTransitionGroup.TransitionGroup,
466
- null,
467
- _react2.default.createElement(
468
- _reactTransitionGroup.CSSTransition,
469
- { classNames: 'global-message', timeout: MESSAGE_ANIMATION_DURATION },
470
- _react2.default.createElement(
471
- 'div',
472
- null,
473
- globalSuccess,
474
- globalError,
475
- globalInfo
476
- )
477
- )
478
- ),
479
- _react2.default.createElement(
480
- 'div',
481
- { style: { position: 'relative' }, ref: 'screen' },
482
- _react2.default.createElement(
483
- _multisize_slide2.default,
484
- {
485
- delay: 550,
486
- onDidAppear: this.onDidAppear.bind(this),
487
- onDidSlide: this.onDidSlide.bind(this),
488
- onWillSlide: this.onWillSlide.bind(this),
489
- transitionName: classNames,
490
- reverse: reverse
491
- },
492
- _react2.default.createElement(
493
- 'div',
494
- { key: this.mainScreenName(), className: 'auth0-lock-view-content' },
495
- _react2.default.createElement(
496
- 'div',
497
- { style: { position: 'relative' } },
498
- _react2.default.createElement(
499
- 'div',
500
- { className: 'auth0-lock-body-content' },
501
- _react2.default.createElement(
502
- 'div',
503
- { className: 'auth0-lock-content' },
504
- _react2.default.createElement(
505
- 'div',
506
- { className: 'auth0-lock-form' },
507
- _react2.default.createElement(Content, _extends({ focusSubmit: this.focusSubmit.bind(this) }, contentProps))
508
- )
509
- ),
510
- terms && _react2.default.createElement(
511
- 'small',
512
- { className: 'auth0-lock-terms' },
513
- terms
514
- )
515
- )
516
- )
517
- )
518
- )
519
- )
520
- )
521
- ),
522
- _react2.default.createElement(SubmitButton, {
523
- color: primaryColor,
524
- disabled: disableSubmitButton,
525
- screenName: screenName,
526
- contentProps: contentProps,
527
- label: submitButtonLabel,
528
- ref: function ref(el) {
529
- return _this5.submitButton = el;
530
- },
531
- display: shouldShowSubmitButton ? 'block' : 'none'
532
- }),
533
- auxiliaryPane && _react2.default.createElement(
534
- _reactTransitionGroup.TransitionGroup,
535
- null,
536
- _react2.default.createElement(
537
- _reactTransitionGroup.CSSTransition,
538
- {
539
- ref: 'auxiliary',
540
- classNames: 'slide',
541
- timeout: AUXILIARY_ANIMATION_DURATION
542
- },
543
- auxiliaryPane
544
- )
545
- )
546
- )
547
- );
548
- };
549
-
550
- Chrome.prototype.focusSubmit = function focusSubmit() {
551
- this.submitButton.focus();
552
- };
553
-
554
- Chrome.prototype.handleBack = function handleBack() {
555
- if (this.sliding) return;
556
-
557
- var backHandler = this.props.backHandler;
558
-
559
- this.setState({ reverse: true });
560
- backHandler();
561
- };
562
-
313
+ }, {
314
+ key: "focusError",
315
+ value: function focusError() {
316
+ var node = _reactDom.default.findDOMNode(this.refs.screen);
317
+ // TODO: make the error input selector configurable via props.
318
+ var error = node.querySelector('.auth0-lock-error input');
319
+ if (error) {
320
+ error.focus();
321
+ }
322
+ }
323
+ }, {
324
+ key: "render",
325
+ value: function render() {
326
+ var _this4 = this;
327
+ var _this$props5 = this.props,
328
+ avatar = _this$props5.avatar,
329
+ auxiliaryPane = _this$props5.auxiliaryPane,
330
+ backHandler = _this$props5.backHandler,
331
+ contentComponent = _this$props5.contentComponent,
332
+ contentProps = _this$props5.contentProps,
333
+ disableSubmitButton = _this$props5.disableSubmitButton,
334
+ error = _this$props5.error,
335
+ info = _this$props5.info,
336
+ isSubmitting = _this$props5.isSubmitting,
337
+ logo = _this$props5.logo,
338
+ primaryColor = _this$props5.primaryColor,
339
+ screenName = _this$props5.screenName,
340
+ showSubmitButton = _this$props5.showSubmitButton,
341
+ submitButtonLabel = _this$props5.submitButtonLabel,
342
+ success = _this$props5.success,
343
+ terms = _this$props5.terms,
344
+ title = _this$props5.title,
345
+ classNames = _this$props5.classNames,
346
+ scrollGlobalMessagesIntoView = _this$props5.scrollGlobalMessagesIntoView;
347
+ var model = contentProps.model;
348
+ var _this$state = this.state,
349
+ delayingShowSubmitButton = _this$state.delayingShowSubmitButton,
350
+ moving = _this$state.moving,
351
+ reverse = _this$state.reverse;
352
+ var backgroundUrl, name;
353
+ if (avatar) {
354
+ backgroundUrl = avatar;
355
+ name = title;
356
+ } else {
357
+ backgroundUrl = logo;
358
+ name = '';
359
+ }
360
+ var shouldShowSubmitButton = showSubmitButton && !delayingShowSubmitButton;
361
+ function wrapGlobalMessage(message) {
362
+ return typeof message === 'string' ?
363
+ /*#__PURE__*/
364
+ // dangerouslySetInnerHTML input is sanitized using dompurify
365
+ // eslint-disable-next-line react/no-danger
366
+ _react.default.createElement('span', {
367
+ dangerouslySetInnerHTML: {
368
+ __html: (0, _dompurify.sanitize)(message)
369
+ }
370
+ }) : message;
371
+ }
372
+ var globalError = error ? /*#__PURE__*/_react.default.createElement(_global_message.default, {
373
+ key: "global-error",
374
+ message: wrapGlobalMessage(error),
375
+ type: "error",
376
+ scrollIntoView: scrollGlobalMessagesIntoView
377
+ }) : null;
378
+ var globalSuccess = success ? /*#__PURE__*/_react.default.createElement(_global_message.default, {
379
+ key: "global-success",
380
+ message: wrapGlobalMessage(success),
381
+ type: "success",
382
+ scrollIntoView: scrollGlobalMessagesIntoView
383
+ }) : null;
384
+ var globalInfo = info ? /*#__PURE__*/_react.default.createElement(_global_message.default, {
385
+ key: "global-info",
386
+ message: wrapGlobalMessage(info),
387
+ type: "info",
388
+ scrollIntoView: scrollGlobalMessagesIntoView
389
+ }) : null;
390
+ var Content = contentComponent;
391
+ var isQuiet = !moving && !delayingShowSubmitButton;
392
+ var className = (0, _classnames.default)('auth0-lock-cred-pane', {
393
+ 'auth0-lock-quiet': isQuiet,
394
+ 'auth0-lock-moving': !isQuiet
395
+ });
396
+ var internalWrapperClass = (0, _classnames.default)('auth0-lock-cred-pane-internal-wrapper', {
397
+ 'auto-height': l.ui.forceAutoHeight(model)
398
+ });
399
+ return /*#__PURE__*/_react.default.createElement("div", {
400
+ className: className
401
+ }, /*#__PURE__*/_react.default.createElement("div", {
402
+ className: internalWrapperClass
403
+ }, /*#__PURE__*/_react.default.createElement("div", {
404
+ className: "auth0-lock-content-wrapper"
405
+ }, /*#__PURE__*/_react.default.createElement(_header.default, {
406
+ title: title,
407
+ name: name,
408
+ backHandler: backHandler && this.handleBack.bind(this),
409
+ backgroundUrl: backgroundUrl,
410
+ backgroundColor: primaryColor,
411
+ logoUrl: logo
412
+ }), /*#__PURE__*/_react.default.createElement("div", {
413
+ className: "auth0-lock-content-body-wrapper",
414
+ style: {
415
+ marginTop: this.state.headerHeight
416
+ }
417
+ }, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
418
+ classNames: "global-message",
419
+ timeout: MESSAGE_ANIMATION_DURATION
420
+ }, /*#__PURE__*/_react.default.createElement("div", null, globalSuccess, globalError, globalInfo))), /*#__PURE__*/_react.default.createElement("div", {
421
+ style: {
422
+ position: 'relative'
423
+ },
424
+ ref: "screen"
425
+ }, /*#__PURE__*/_react.default.createElement(_multisize_slide.default, {
426
+ delay: 550,
427
+ onDidAppear: this.onDidAppear.bind(this),
428
+ onDidSlide: this.onDidSlide.bind(this),
429
+ onWillSlide: this.onWillSlide.bind(this),
430
+ transitionName: classNames,
431
+ reverse: reverse
432
+ }, /*#__PURE__*/_react.default.createElement("div", {
433
+ key: this.mainScreenName(),
434
+ className: "auth0-lock-view-content"
435
+ }, /*#__PURE__*/_react.default.createElement("div", {
436
+ style: {
437
+ position: 'relative'
438
+ }
439
+ }, /*#__PURE__*/_react.default.createElement("div", {
440
+ className: "auth0-lock-body-content"
441
+ }, /*#__PURE__*/_react.default.createElement("div", {
442
+ className: "auth0-lock-content"
443
+ }, /*#__PURE__*/_react.default.createElement("div", {
444
+ className: "auth0-lock-form"
445
+ }, /*#__PURE__*/_react.default.createElement(Content, _extends({
446
+ focusSubmit: this.focusSubmit.bind(this)
447
+ }, contentProps)))), terms && /*#__PURE__*/_react.default.createElement("small", {
448
+ className: "auth0-lock-terms"
449
+ }, terms)))))))), /*#__PURE__*/_react.default.createElement(SubmitButton, {
450
+ color: primaryColor,
451
+ disabled: disableSubmitButton,
452
+ screenName: screenName,
453
+ contentProps: contentProps,
454
+ label: submitButtonLabel,
455
+ ref: function ref(el) {
456
+ return _this4.submitButton = el;
457
+ },
458
+ display: shouldShowSubmitButton ? 'block' : 'none'
459
+ }), auxiliaryPane && /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
460
+ ref: "auxiliary",
461
+ classNames: "slide",
462
+ timeout: AUXILIARY_ANIMATION_DURATION
463
+ }, auxiliaryPane))));
464
+ }
465
+ }, {
466
+ key: "focusSubmit",
467
+ value: function focusSubmit() {
468
+ this.submitButton.focus();
469
+ }
470
+ }, {
471
+ key: "handleBack",
472
+ value: function handleBack() {
473
+ if (this.sliding) return;
474
+ var backHandler = this.props.backHandler;
475
+ this.setState({
476
+ reverse: true
477
+ });
478
+ backHandler();
479
+ }
480
+ }]);
563
481
  return Chrome;
564
- }(_react2.default.Component);
565
-
482
+ }(_react.default.Component);
566
483
  exports.default = Chrome;
567
-
568
-
569
484
  Chrome.propTypes = {
570
- autofocus: _propTypes2.default.bool.isRequired,
571
- avatar: _propTypes2.default.string,
572
- auxiliaryPane: _propTypes2.default.element,
573
- backHandler: _propTypes2.default.func,
574
- contentComponent: _propTypes2.default.func.isRequired, // TODO: it also can be a class component
575
- contentProps: _propTypes2.default.object.isRequired,
576
- disableSubmitButton: _propTypes2.default.bool.isRequired,
577
- error: _propTypes2.default.node,
578
- info: _propTypes2.default.node,
579
- isSubmitting: _propTypes2.default.bool.isRequired,
580
- logo: _propTypes2.default.string.isRequired,
581
- primaryColor: _propTypes2.default.string.isRequired,
582
- screenName: _propTypes2.default.string.isRequired,
583
- showSubmitButton: _propTypes2.default.bool.isRequired,
584
- submitButtonLabel: _propTypes2.default.string,
585
- success: _propTypes2.default.node,
586
- terms: _propTypes2.default.element,
587
- title: _propTypes2.default.string,
588
- classNames: _propTypes2.default.string.isRequired,
589
- scrollGlobalMessagesIntoView: _propTypes2.default.bool
485
+ autofocus: _propTypes.default.bool.isRequired,
486
+ avatar: _propTypes.default.string,
487
+ auxiliaryPane: _propTypes.default.element,
488
+ backHandler: _propTypes.default.func,
489
+ contentComponent: _propTypes.default.func.isRequired,
490
+ // TODO: it also can be a class component
491
+ contentProps: _propTypes.default.object.isRequired,
492
+ disableSubmitButton: _propTypes.default.bool.isRequired,
493
+ error: _propTypes.default.node,
494
+ info: _propTypes.default.node,
495
+ isSubmitting: _propTypes.default.bool.isRequired,
496
+ logo: _propTypes.default.string.isRequired,
497
+ primaryColor: _propTypes.default.string.isRequired,
498
+ screenName: _propTypes.default.string.isRequired,
499
+ showSubmitButton: _propTypes.default.bool.isRequired,
500
+ submitButtonLabel: _propTypes.default.string,
501
+ success: _propTypes.default.node,
502
+ terms: _propTypes.default.element,
503
+ title: _propTypes.default.string,
504
+ classNames: _propTypes.default.string.isRequired,
505
+ scrollGlobalMessagesIntoView: _propTypes.default.bool
590
506
  };
591
-
592
507
  Chrome.defaultProps = {
593
508
  autofocus: false,
594
509
  disableSubmitButton: false,