auth0-lock 11.34.2 → 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.
- package/.browserslistrc +1 -0
- package/.circleci/config.yml +4 -2
- package/.eslintrc.json +5 -5
- package/.github/workflows/codeql.yml +41 -0
- package/.shiprc +4 -5
- package/CHANGELOG.md +26 -0
- package/EXAMPLES.md +626 -0
- package/README.md +77 -649
- package/karma.conf.js +1 -1
- package/lib/CSSCore.js +1 -4
- package/lib/__tests__/auth_button.js +12 -22
- package/lib/__tests__/connection/database/actions.js +48 -49
- package/lib/__tests__/connection/database/index.js +22 -28
- package/lib/__tests__/connection/database/login_pane.js +20 -41
- package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
- package/lib/__tests__/connection/enterprise/actions.js +22 -47
- package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
- package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
- package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
- package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
- package/lib/__tests__/core/actions.js +23 -46
- package/lib/__tests__/core/client/index.js +10 -13
- package/lib/__tests__/core/index.js +46 -94
- package/lib/__tests__/core/remote_data.js +14 -20
- package/lib/__tests__/core/signed_in_confirmation.js +19 -26
- package/lib/__tests__/core/sso/last_login_screen.js +27 -50
- package/lib/__tests__/core/tenant.js +10 -12
- package/lib/__tests__/core/web_api/helper.js +6 -14
- package/lib/__tests__/core/web_api/p2_api.js +38 -33
- package/lib/__tests__/core/web_api.js +37 -33
- package/lib/__tests__/engine/classic/login.js +20 -41
- package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
- package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
- package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
- package/lib/__tests__/engine/classic.js +13 -6
- package/lib/__tests__/engine/passwordless.js +2 -5
- package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
- package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
- package/lib/__tests__/field/captcha.js +39 -51
- package/lib/__tests__/field/custom_input.js +23 -47
- package/lib/__tests__/field/email.js +2 -3
- package/lib/__tests__/field/email_pane.js +25 -48
- package/lib/__tests__/field/field.js +9 -13
- package/lib/__tests__/field/login_pane.js +30 -34
- package/lib/__tests__/field/mfa_code_pane.js +13 -28
- package/lib/__tests__/field/option_selection_pane.js +7 -25
- package/lib/__tests__/field/password.js +6 -12
- package/lib/__tests__/field/password_pane.js +29 -46
- package/lib/__tests__/field/phone_number_pane.js +18 -41
- package/lib/__tests__/field/social_buttons_pane.js +30 -47
- package/lib/__tests__/field/username.js +27 -48
- package/lib/__tests__/field/username_pane.js +30 -47
- package/lib/__tests__/field/vcode.js +5 -13
- package/lib/__tests__/field/vcode_pane.js +20 -44
- package/lib/__tests__/i18n.js +28 -53
- package/lib/__tests__/quick-auth/actions.js +4 -27
- package/lib/__tests__/setup-tests.js +7 -9
- package/lib/__tests__/testUtils.js +41 -58
- package/lib/__tests__/ui/box/chrome.js +24 -49
- package/lib/__tests__/ui/box/confirmation_pane.js +19 -36
- package/lib/__tests__/ui/box/container.js +21 -46
- package/lib/__tests__/ui/box/global_message.js +60 -37
- package/lib/__tests__/ui/input/email_input.js +6 -17
- package/lib/__tests__/ui/input/input_wrap.js +6 -19
- package/lib/__tests__/ui/input/password/password_strength.js +13 -15
- package/lib/__tests__/ui/input/password_input.js +22 -27
- package/lib/__tests__/utils/format.js +10 -17
- package/lib/__tests__/utils/url_utils.js +2 -5
- package/lib/avatar/gravatar_provider.js +13 -28
- package/lib/avatar.js +22 -41
- package/lib/browser.js +372 -23
- package/lib/connection/captcha.js +14 -32
- package/lib/connection/database/actions.js +39 -108
- package/lib/connection/database/index.js +90 -191
- package/lib/connection/database/login_pane.js +107 -147
- package/lib/connection/database/login_sign_up_tabs.js +106 -125
- package/lib/connection/database/mfa_pane.js +50 -69
- package/lib/connection/database/password_reset_confirmation.js +51 -73
- package/lib/connection/database/reset_password.js +116 -132
- package/lib/connection/database/reset_password_pane.js +45 -56
- package/lib/connection/database/sign_up_terms.js +17 -23
- package/lib/connection/database/signed_up_confirmation.js +52 -75
- package/lib/connection/enterprise/actions.js +23 -52
- package/lib/connection/enterprise/hrd_pane.js +60 -76
- package/lib/connection/enterprise/hrd_screen.js +60 -75
- package/lib/connection/enterprise/kerberos_screen.js +46 -60
- package/lib/connection/enterprise/quick_auth_screen.js +46 -64
- package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
- package/lib/connection/enterprise.js +51 -84
- package/lib/connection/passwordless/actions.js +29 -62
- package/lib/connection/passwordless/ask_vcode.js +53 -60
- package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
- package/lib/connection/passwordless/index.js +36 -68
- package/lib/connection/social/index.js +12 -15
- package/lib/core/actions.js +33 -85
- package/lib/core/client/index.js +38 -58
- package/lib/core/client/settings.js +12 -20
- package/lib/core/error_screen.js +38 -52
- package/lib/core/index.js +152 -301
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +28 -48
- package/lib/core/screen.js +85 -79
- package/lib/core/signed_in_confirmation.js +51 -73
- package/lib/core/sso/data.js +9 -17
- package/lib/core/sso/index.js +5 -6
- package/lib/core/sso/last_login_screen.js +46 -63
- package/lib/core/tenant/index.js +37 -59
- package/lib/core/tenant/settings.js +11 -15
- package/lib/core/web_api/helper.js +24 -30
- package/lib/core/web_api/p2_api.js +156 -165
- package/lib/core/web_api.js +101 -90
- package/lib/core.js +126 -160
- package/lib/engine/classic/login.js +92 -144
- package/lib/engine/classic/mfa_login_screen.js +61 -67
- package/lib/engine/classic/sign_up_pane.js +89 -123
- package/lib/engine/classic/sign_up_screen.js +112 -158
- package/lib/engine/classic.js +122 -183
- package/lib/engine/passwordless/social_or_email_login_screen.js +71 -106
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +82 -102
- package/lib/field/captcha/recaptcha.js +140 -145
- package/lib/field/captcha.js +7 -10
- package/lib/field/custom_input.js +37 -50
- package/lib/field/email/email_pane.js +90 -109
- package/lib/field/email.js +17 -35
- package/lib/field/index.js +51 -88
- package/lib/field/mfa-code/mfa_code_pane.js +57 -71
- package/lib/field/mfa_code.js +15 -21
- package/lib/field/option_selection_pane.js +16 -22
- package/lib/field/password/password_pane.js +79 -91
- package/lib/field/password.js +8 -14
- package/lib/field/phone-number/locations.js +7 -3
- package/lib/field/phone-number/phone_number_pane.js +87 -124
- package/lib/field/phone_number.js +16 -30
- package/lib/field/social/event.js +9 -12
- package/lib/field/social/social_buttons_pane.js +93 -121
- package/lib/field/username/username_pane.js +105 -123
- package/lib/field/username.js +16 -26
- package/lib/field/vcode/vcode_pane.js +67 -93
- package/lib/field/vcode.js +5 -5
- package/lib/i18n/af.js +7 -4
- package/lib/i18n/ar.js +7 -4
- package/lib/i18n/az.js +7 -4
- package/lib/i18n/bg.js +7 -4
- package/lib/i18n/ca.js +7 -4
- package/lib/i18n/cs.js +7 -4
- package/lib/i18n/da.js +7 -4
- package/lib/i18n/de.js +7 -3
- package/lib/i18n/el.js +7 -4
- package/lib/i18n/en.js +9 -4
- package/lib/i18n/es.js +7 -3
- package/lib/i18n/et.js +7 -4
- package/lib/i18n/fa.js +7 -4
- package/lib/i18n/fi.js +7 -4
- package/lib/i18n/fr.js +7 -4
- package/lib/i18n/he.js +7 -4
- package/lib/i18n/hr.js +7 -4
- package/lib/i18n/hu.js +7 -4
- package/lib/i18n/id.js +7 -4
- package/lib/i18n/it.js +7 -3
- package/lib/i18n/ja.js +7 -4
- package/lib/i18n/ko.js +7 -4
- package/lib/i18n/lt.js +7 -4
- package/lib/i18n/lv.js +7 -4
- package/lib/i18n/ms.js +7 -4
- package/lib/i18n/nb.js +7 -4
- package/lib/i18n/nl.js +7 -4
- package/lib/i18n/nn.js +7 -4
- package/lib/i18n/no.js +7 -4
- package/lib/i18n/pl.js +7 -4
- package/lib/i18n/pt-br.js +7 -3
- package/lib/i18n/pt.js +7 -4
- package/lib/i18n/ro.js +7 -4
- package/lib/i18n/ru.js +7 -4
- package/lib/i18n/sk.js +7 -4
- package/lib/i18n/sl.js +7 -4
- package/lib/i18n/sr.js +7 -4
- package/lib/i18n/sv.js +7 -4
- package/lib/i18n/tr.js +7 -4
- package/lib/i18n/ua.js +7 -4
- package/lib/i18n/uk.js +7 -4
- package/lib/i18n/vi.js +7 -4
- package/lib/i18n/zh-tw.js +7 -4
- package/lib/i18n/zh.js +7 -4
- package/lib/i18n.js +38 -75
- package/lib/index.js +14 -17
- package/lib/lock.js +29 -32
- package/lib/passwordless.js +29 -31
- package/lib/quick-auth/actions.js +19 -26
- package/lib/quick_auth.js +8 -10
- package/lib/sanitizer.js +5 -5
- package/lib/store/index.js +22 -42
- package/lib/sync.js +21 -42
- package/lib/ui/box/button.js +85 -105
- package/lib/ui/box/chrome.js +463 -548
- package/lib/ui/box/confirmation_pane.js +34 -48
- package/lib/ui/box/container.js +305 -339
- package/lib/ui/box/global_message.js +51 -60
- package/lib/ui/box/header.js +155 -177
- package/lib/ui/box/multisize_slide.js +233 -229
- package/lib/ui/box/success_pane.js +34 -37
- package/lib/ui/box.js +88 -93
- package/lib/ui/button/auth_button.js +44 -51
- package/lib/ui/input/captcha_input.js +162 -181
- package/lib/ui/input/checkbox_input.js +57 -59
- package/lib/ui/input/email_input.js +117 -124
- package/lib/ui/input/input_wrap.js +65 -80
- package/lib/ui/input/location_input.js +130 -150
- package/lib/ui/input/mfa_code_input.js +98 -98
- package/lib/ui/input/password/password_strength.js +103 -127
- package/lib/ui/input/password_input.js +141 -147
- package/lib/ui/input/phone_number_input.js +101 -109
- package/lib/ui/input/select_input.js +120 -132
- package/lib/ui/input/text_input.js +89 -84
- package/lib/ui/input/username_input.js +109 -115
- package/lib/ui/input/vcode_input.js +110 -118
- package/lib/ui/list.js +224 -247
- package/lib/ui/pane/quick_auth_pane.js +55 -80
- package/lib/utils/atom.js +55 -48
- package/lib/utils/cache.js +54 -43
- package/lib/utils/cdn_utils.js +17 -31
- package/lib/utils/createRef.js +3 -1
- package/lib/utils/data_utils.js +10 -16
- package/lib/utils/fn_utils.js +5 -4
- package/lib/utils/format.js +6 -8
- package/lib/utils/id_utils.js +4 -3
- package/lib/utils/jsonp_utils.js +20 -17
- package/lib/utils/media_utils.js +4 -2
- package/lib/utils/preload_utils.js +4 -3
- package/lib/utils/string_utils.js +4 -4
- package/lib/utils/url_utils.js +4 -3
- package/opslevel.yml +6 -0
- package/package.json +53 -38
- package/webpack.config.js +36 -3
package/lib/ui/box/chrome.js
CHANGED
|
@@ -1,594 +1,509 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
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
|
|
50
|
-
|
|
51
|
-
function
|
|
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
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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: {
|
|
156
|
+
style: {
|
|
157
|
+
backgroundColor: color,
|
|
158
|
+
display: display
|
|
159
|
+
},
|
|
198
160
|
onClick: this.handleSubmit.bind(this),
|
|
199
|
-
name:
|
|
200
|
-
type:
|
|
201
|
-
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
}(
|
|
214
|
-
|
|
172
|
+
}(_react.default.Component);
|
|
215
173
|
SubmitButton.propTypes = {
|
|
216
|
-
color:
|
|
217
|
-
disabled:
|
|
218
|
-
display:
|
|
219
|
-
label:
|
|
220
|
-
screenName:
|
|
221
|
-
onSubmit:
|
|
222
|
-
contentProps:
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
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
|
|
299
|
-
|
|
222
|
+
return _this2.setState({
|
|
223
|
+
moving: false
|
|
224
|
+
});
|
|
225
|
+
}, AUXILIARY_ANIMATION_DURATION + 50);
|
|
300
226
|
}
|
|
301
|
-
|
|
302
|
-
return;
|
|
303
227
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
|
315
|
-
},
|
|
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
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
|
|
339
|
-
|
|
340
|
-
|
|
279
|
+
}, {
|
|
280
|
+
key: "onDidSlide",
|
|
281
|
+
value: function onDidSlide() {
|
|
282
|
+
this.sliding = false;
|
|
283
|
+
this.setState({
|
|
284
|
+
reverse: false
|
|
285
|
+
});
|
|
341
286
|
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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
|
-
|
|
363
|
-
|
|
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
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
-
}(
|
|
565
|
-
|
|
482
|
+
}(_react.default.Component);
|
|
566
483
|
exports.default = Chrome;
|
|
567
|
-
|
|
568
|
-
|
|
569
484
|
Chrome.propTypes = {
|
|
570
|
-
autofocus:
|
|
571
|
-
avatar:
|
|
572
|
-
auxiliaryPane:
|
|
573
|
-
backHandler:
|
|
574
|
-
contentComponent:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
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,
|