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.
- 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 +32 -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
|
@@ -1,78 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = require(
|
|
10
|
-
|
|
11
|
-
var _react2 = _interopRequireDefault(_react);
|
|
12
|
-
|
|
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"));
|
|
13
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
15
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
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); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
16
|
+
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); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
+
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); }; }
|
|
19
|
+
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); }
|
|
20
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
+
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; } }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
+
var GlobalMessage = /*#__PURE__*/function (_React$Component) {
|
|
22
24
|
_inherits(GlobalMessage, _React$Component);
|
|
23
|
-
|
|
25
|
+
var _super = _createSuper(GlobalMessage);
|
|
24
26
|
function GlobalMessage() {
|
|
25
27
|
_classCallCheck(this, GlobalMessage);
|
|
26
|
-
|
|
27
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
28
|
+
return _super.apply(this, arguments);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
_createClass(GlobalMessage, [{
|
|
31
|
+
key: "componentDidMount",
|
|
32
|
+
value: function componentDidMount() {
|
|
33
|
+
var methodIsSupported = this.messageNode && typeof this.messageNode.scrollIntoView === 'function';
|
|
34
|
+
if (methodIsSupported && this.props.scrollIntoView) {
|
|
35
|
+
var boundingRect = this.messageNode.getBoundingClientRect();
|
|
36
|
+
if (boundingRect.top < 0) {
|
|
37
|
+
this.messageNode.scrollIntoView(true);
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var className = 'auth0-global-message auth0-global-message-' + type;
|
|
48
|
-
return _react2.default.createElement(
|
|
49
|
-
'div',
|
|
50
|
-
{
|
|
41
|
+
}, {
|
|
42
|
+
key: "render",
|
|
43
|
+
value: function render() {
|
|
44
|
+
var _this = this;
|
|
45
|
+
var _this$props = this.props,
|
|
46
|
+
message = _this$props.message,
|
|
47
|
+
type = _this$props.type;
|
|
48
|
+
var className = "auth0-global-message auth0-global-message-".concat(type);
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
50
|
className: className,
|
|
52
51
|
ref: function ref(messageNode) {
|
|
53
|
-
|
|
52
|
+
_this.messageNode = messageNode;
|
|
54
53
|
}
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
55
|
+
className: "animated fadeInUp"
|
|
56
|
+
}, message));
|
|
57
|
+
}
|
|
58
|
+
}]);
|
|
64
59
|
return GlobalMessage;
|
|
65
|
-
}(
|
|
66
|
-
|
|
60
|
+
}(_react.default.Component);
|
|
67
61
|
exports.default = GlobalMessage;
|
|
68
|
-
|
|
69
|
-
|
|
70
62
|
GlobalMessage.propTypes = {
|
|
71
|
-
message:
|
|
72
|
-
type:
|
|
73
|
-
scrollIntoView:
|
|
63
|
+
message: _propTypes.default.node.isRequired,
|
|
64
|
+
type: _propTypes.default.oneOf(['error', 'success', 'info']).isRequired,
|
|
65
|
+
scrollIntoView: _propTypes.default.bool
|
|
74
66
|
};
|
|
75
|
-
|
|
76
67
|
GlobalMessage.defaultProps = {
|
|
77
68
|
scrollIntoView: true
|
|
78
69
|
};
|
package/lib/ui/box/header.js
CHANGED
|
@@ -1,159 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = require(
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var _reactDom = require('react-dom');
|
|
14
|
-
|
|
15
|
-
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
16
|
-
|
|
17
|
-
var _button = require('./button');
|
|
18
|
-
|
|
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 _button = require("./button");
|
|
19
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
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); } }
|
|
16
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
19
|
+
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); }
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
|
+
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); }; }
|
|
22
|
+
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); }
|
|
23
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
+
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; } }
|
|
25
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
+
var Header = /*#__PURE__*/function (_React$Component) {
|
|
28
27
|
_inherits(Header, _React$Component);
|
|
29
|
-
|
|
28
|
+
var _super = _createSuper(Header);
|
|
30
29
|
function Header() {
|
|
31
30
|
_classCallCheck(this, Header);
|
|
32
|
-
|
|
33
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
31
|
+
return _super.apply(this, arguments);
|
|
34
32
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
_createClass(Header, [{
|
|
34
|
+
key: "getDOMNode",
|
|
35
|
+
value: function getDOMNode() {
|
|
36
|
+
return _reactDom.default.findDOMNode(this);
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
key: "render",
|
|
40
|
+
value: function render() {
|
|
41
|
+
var _this$props = this.props,
|
|
42
|
+
backHandler = _this$props.backHandler,
|
|
43
|
+
backgroundColor = _this$props.backgroundColor,
|
|
44
|
+
backgroundUrl = _this$props.backgroundUrl,
|
|
45
|
+
logoUrl = _this$props.logoUrl,
|
|
46
|
+
name = _this$props.name,
|
|
47
|
+
title = _this$props.title;
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
className: "auth0-lock-header"
|
|
50
|
+
}, backHandler && /*#__PURE__*/_react.default.createElement(_button.BackButton, {
|
|
51
|
+
onClick: backHandler
|
|
52
|
+
}), /*#__PURE__*/_react.default.createElement(Background, {
|
|
53
|
+
imageUrl: backgroundUrl,
|
|
54
|
+
backgroundColor: backgroundColor,
|
|
55
|
+
grayScale: !!name
|
|
56
|
+
}), /*#__PURE__*/_react.default.createElement(Welcome, {
|
|
57
|
+
title: title,
|
|
58
|
+
name: name,
|
|
59
|
+
imageUrl: name ? undefined : logoUrl
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}]);
|
|
59
63
|
return Header;
|
|
60
|
-
}(
|
|
61
|
-
|
|
64
|
+
}(_react.default.Component);
|
|
62
65
|
exports.default = Header;
|
|
63
|
-
|
|
64
|
-
|
|
65
66
|
Header.propTypes = {
|
|
66
|
-
backgroundUrl:
|
|
67
|
-
logoUrl:
|
|
68
|
-
name:
|
|
67
|
+
backgroundUrl: _propTypes.default.string,
|
|
68
|
+
logoUrl: _propTypes.default.string,
|
|
69
|
+
name: _propTypes.default.string
|
|
69
70
|
};
|
|
70
|
-
|
|
71
|
-
var Welcome = function (_React$Component2) {
|
|
71
|
+
var Welcome = /*#__PURE__*/function (_React$Component2) {
|
|
72
72
|
_inherits(Welcome, _React$Component2);
|
|
73
|
-
|
|
73
|
+
var _super2 = _createSuper(Welcome);
|
|
74
74
|
function Welcome() {
|
|
75
|
-
var
|
|
76
|
-
|
|
75
|
+
var _this;
|
|
77
76
|
_classCallCheck(this, Welcome);
|
|
78
|
-
|
|
79
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
77
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
80
78
|
args[_key] = arguments[_key];
|
|
81
79
|
}
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
_this = _super2.call.apply(_super2, [this].concat(args));
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "onImageLoad", function () {
|
|
84
82
|
return document.querySelector('.auth0-lock').style.fontSize = '1rem';
|
|
85
|
-
}
|
|
83
|
+
});
|
|
84
|
+
return _this;
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
86
|
+
_createClass(Welcome, [{
|
|
87
|
+
key: "render",
|
|
88
|
+
value: function render() {
|
|
89
|
+
var _this$props2 = this.props,
|
|
90
|
+
name = _this$props2.name,
|
|
91
|
+
imageUrl = _this$props2.imageUrl,
|
|
92
|
+
title = _this$props2.title;
|
|
93
|
+
var imgClassName = !!title ? 'auth0-lock-header-logo' : 'auth0-lock-header-logo centered';
|
|
94
|
+
var img = /*#__PURE__*/_react.default.createElement("img", {
|
|
95
|
+
alt: "",
|
|
96
|
+
className: imgClassName,
|
|
97
|
+
src: imageUrl,
|
|
98
|
+
onLoad: this.onImageLoad
|
|
99
|
+
});
|
|
100
|
+
var welcome = title ? /*#__PURE__*/_react.default.createElement(WelcomeMessage, {
|
|
101
|
+
title: title,
|
|
102
|
+
name: name
|
|
103
|
+
}) : null;
|
|
104
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
+
className: "auth0-lock-header-welcome"
|
|
106
|
+
}, imageUrl && img, welcome);
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
110
109
|
return Welcome;
|
|
111
|
-
}(
|
|
112
|
-
|
|
110
|
+
}(_react.default.Component);
|
|
113
111
|
Welcome.propTypes = {
|
|
114
|
-
imageUrl:
|
|
115
|
-
name:
|
|
112
|
+
imageUrl: _propTypes.default.string,
|
|
113
|
+
name: _propTypes.default.string
|
|
116
114
|
};
|
|
117
|
-
|
|
118
|
-
var WelcomeMessage = function (_React$Component3) {
|
|
115
|
+
var WelcomeMessage = /*#__PURE__*/function (_React$Component3) {
|
|
119
116
|
_inherits(WelcomeMessage, _React$Component3);
|
|
120
|
-
|
|
117
|
+
var _super3 = _createSuper(WelcomeMessage);
|
|
121
118
|
function WelcomeMessage() {
|
|
122
119
|
_classCallCheck(this, WelcomeMessage);
|
|
123
|
-
|
|
124
|
-
return _possibleConstructorReturn(this, _React$Component3.apply(this, arguments));
|
|
120
|
+
return _super3.apply(this, arguments);
|
|
125
121
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
122
|
+
_createClass(WelcomeMessage, [{
|
|
123
|
+
key: "render",
|
|
124
|
+
value: function render() {
|
|
125
|
+
var _this$props3 = this.props,
|
|
126
|
+
name = _this$props3.name,
|
|
127
|
+
title = _this$props3.title;
|
|
128
|
+
var className, message;
|
|
129
|
+
if (name) {
|
|
130
|
+
className = 'auth0-lock-firstname';
|
|
131
|
+
message = name;
|
|
132
|
+
} else {
|
|
133
|
+
className = 'auth0-lock-name';
|
|
134
|
+
message = title;
|
|
135
|
+
}
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
137
|
+
className: className,
|
|
138
|
+
title: message
|
|
139
|
+
}, message);
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
return _react2.default.createElement(
|
|
144
|
-
'div',
|
|
145
|
-
{ className: className, title: message },
|
|
146
|
-
message
|
|
147
|
-
);
|
|
148
|
-
};
|
|
149
|
-
|
|
141
|
+
}]);
|
|
150
142
|
return WelcomeMessage;
|
|
151
|
-
}(
|
|
152
|
-
|
|
143
|
+
}(_react.default.Component);
|
|
153
144
|
WelcomeMessage.propTypes = {
|
|
154
|
-
name:
|
|
145
|
+
name: _propTypes.default.string
|
|
155
146
|
};
|
|
156
|
-
|
|
157
147
|
var cssBlurSupport = function () {
|
|
158
148
|
if (typeof window === 'undefined') {
|
|
159
149
|
return;
|
|
@@ -162,64 +152,52 @@ var cssBlurSupport = function () {
|
|
|
162
152
|
// Check stolen from Modernizr, see https://github.com/Modernizr/Modernizr/blob/29eab707f7a2fb261c8a9c538370e97eb1f86e25/feature-detects/css/filters.js
|
|
163
153
|
var isEdge = window.navigator && !!window.navigator.userAgent.match(/Edge/i);
|
|
164
154
|
if (typeof window.document === 'undefined' || isEdge) return false;
|
|
165
|
-
|
|
166
155
|
var el = window.document.createElement('div');
|
|
167
156
|
el.style.cssText = 'filter: blur(2px); -webkit-filter: blur(2px)';
|
|
168
|
-
|
|
169
157
|
return !!el.style.length && (window.document.documentMode === undefined || window.document.documentMode > 9);
|
|
170
158
|
}();
|
|
171
|
-
|
|
172
|
-
var Background = function (_React$Component4) {
|
|
159
|
+
var Background = /*#__PURE__*/function (_React$Component4) {
|
|
173
160
|
_inherits(Background, _React$Component4);
|
|
174
|
-
|
|
161
|
+
var _super4 = _createSuper(Background);
|
|
175
162
|
function Background() {
|
|
176
163
|
_classCallCheck(this, Background);
|
|
177
|
-
|
|
178
|
-
return _possibleConstructorReturn(this, _React$Component4.apply(this, arguments));
|
|
164
|
+
return _super4.apply(this, arguments);
|
|
179
165
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
166
|
+
_createClass(Background, [{
|
|
167
|
+
key: "render",
|
|
168
|
+
value: function render() {
|
|
169
|
+
var _this$props4 = this.props,
|
|
170
|
+
backgroundColor = _this$props4.backgroundColor,
|
|
171
|
+
imageUrl = _this$props4.imageUrl,
|
|
172
|
+
grayScale = _this$props4.grayScale;
|
|
173
|
+
var props = {
|
|
174
|
+
className: 'auth0-lock-header-bg'
|
|
175
|
+
};
|
|
176
|
+
if (cssBlurSupport) {
|
|
177
|
+
props.className += ' auth0-lock-blur-support';
|
|
178
|
+
}
|
|
179
|
+
var blurProps = {
|
|
180
|
+
className: 'auth0-lock-header-bg-blur',
|
|
181
|
+
style: {
|
|
182
|
+
backgroundImage: "url('".concat(imageUrl, "')")
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
if (grayScale) {
|
|
186
|
+
blurProps.className += ' auth0-lock-no-grayscale';
|
|
187
|
+
}
|
|
188
|
+
var solidProps = {
|
|
189
|
+
className: 'auth0-lock-header-bg-solid',
|
|
190
|
+
style: {
|
|
191
|
+
backgroundColor: backgroundColor
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
return /*#__PURE__*/_react.default.createElement("div", props, /*#__PURE__*/_react.default.createElement("div", blurProps), /*#__PURE__*/_react.default.createElement("div", solidProps));
|
|
194
195
|
}
|
|
195
|
-
|
|
196
|
-
var blurProps = {
|
|
197
|
-
className: 'auth0-lock-header-bg-blur',
|
|
198
|
-
style: { backgroundImage: 'url(\'' + imageUrl + '\')' }
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
if (grayScale) {
|
|
202
|
-
blurProps.className += ' auth0-lock-no-grayscale';
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
var solidProps = {
|
|
206
|
-
className: 'auth0-lock-header-bg-solid',
|
|
207
|
-
style: { backgroundColor: backgroundColor }
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
return _react2.default.createElement(
|
|
211
|
-
'div',
|
|
212
|
-
props,
|
|
213
|
-
_react2.default.createElement('div', blurProps),
|
|
214
|
-
_react2.default.createElement('div', solidProps)
|
|
215
|
-
);
|
|
216
|
-
};
|
|
217
|
-
|
|
196
|
+
}]);
|
|
218
197
|
return Background;
|
|
219
|
-
}(
|
|
220
|
-
|
|
198
|
+
}(_react.default.Component);
|
|
221
199
|
Background.propTypes = {
|
|
222
|
-
backgorundColor:
|
|
223
|
-
grayScale:
|
|
224
|
-
imageUrl:
|
|
200
|
+
backgorundColor: _propTypes.default.string,
|
|
201
|
+
grayScale: _propTypes.default.bool,
|
|
202
|
+
imageUrl: _propTypes.default.string
|
|
225
203
|
};
|