auth0-lock 12.0.1 → 12.1.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.
@@ -12,7 +12,7 @@ var l = _interopRequireWildcard(require("../../core/index"));
12
12
  var _index2 = require("../../store/index");
13
13
  var captchaField = _interopRequireWildcard(require("../captcha"));
14
14
  var _index3 = require("../index");
15
- var _recaptcha = require("./recaptcha");
15
+ var _third_party_captcha = require("./third_party_captcha");
16
16
  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); }
17
17
  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; }
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -27,7 +27,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
27
27
  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); }
28
28
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
29
  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; } }
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
30
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /* eslint-disable no-nested-ternary */
31
31
  var CaptchaPane = /*#__PURE__*/function (_React$Component) {
32
32
  _inherits(CaptchaPane, _React$Component);
33
33
  var _super = _createSuper(CaptchaPane);
@@ -48,14 +48,14 @@ var CaptchaPane = /*#__PURE__*/function (_React$Component) {
48
48
  var value = (0, _index3.getFieldValue)(lock, 'captcha');
49
49
  var isValid = !(0, _index3.isFieldVisiblyInvalid)(lock, 'captcha');
50
50
  var provider = captcha.get('provider');
51
- if ((0, _recaptcha.isRecaptcha)(provider)) {
51
+ if ((0, _third_party_captcha.isThirdPartyCaptcha)(provider)) {
52
52
  function handleChange(value) {
53
53
  (0, _index2.swap)(_index2.updateEntity, 'lock', lockId, captchaField.set, value);
54
54
  }
55
55
  function reset() {
56
56
  handleChange();
57
57
  }
58
- return /*#__PURE__*/_react.default.createElement(_recaptcha.ReCAPTCHA, {
58
+ return /*#__PURE__*/_react.default.createElement(_third_party_captcha.ThirdPartyCaptcha, {
59
59
  provider: provider,
60
60
  sitekey: captcha.get('siteKey'),
61
61
  onChange: handleChange,
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.isRecaptcha = exports.ReCAPTCHA = void 0;
7
+ exports.isThirdPartyCaptcha = exports.ThirdPartyCaptcha = void 0;
8
8
  var _createRef = require("../../utils/createRef");
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -24,16 +24,22 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
24
24
  var noop = function noop() {};
25
25
  var RECAPTCHA_V2_PROVIDER = 'recaptcha_v2';
26
26
  var RECAPTCHA_ENTERPRISE_PROVIDER = 'recaptcha_enterprise';
27
- var isRecaptcha = function isRecaptcha(provider) {
28
- return provider === RECAPTCHA_ENTERPRISE_PROVIDER || provider === RECAPTCHA_V2_PROVIDER;
27
+ var HCAPTCHA_PROVIDER = 'hcaptcha';
28
+ var FRIENDLY_CAPTCHA_PROVIDER = 'friendly_captcha';
29
+ var isThirdPartyCaptcha = function isThirdPartyCaptcha(provider) {
30
+ return provider === RECAPTCHA_ENTERPRISE_PROVIDER || provider === RECAPTCHA_V2_PROVIDER || provider === HCAPTCHA_PROVIDER || provider === FRIENDLY_CAPTCHA_PROVIDER;
29
31
  };
30
- exports.isRecaptcha = isRecaptcha;
31
- var getRecaptchaProvider = function getRecaptchaProvider(provider) {
32
+ exports.isThirdPartyCaptcha = isThirdPartyCaptcha;
33
+ var getCaptchaProvider = function getCaptchaProvider(provider) {
32
34
  switch (provider) {
33
35
  case RECAPTCHA_V2_PROVIDER:
34
36
  return window.grecaptcha;
35
37
  case RECAPTCHA_ENTERPRISE_PROVIDER:
36
38
  return window.grecaptcha.enterprise;
39
+ case HCAPTCHA_PROVIDER:
40
+ return window.hcaptcha;
41
+ case FRIENDLY_CAPTCHA_PROVIDER:
42
+ return window.friendlyChallenge;
37
43
  }
38
44
  };
39
45
  var scriptForProvider = function scriptForProvider(provider, lang, callback) {
@@ -42,14 +48,30 @@ var scriptForProvider = function scriptForProvider(provider, lang, callback) {
42
48
  return "https://www.recaptcha.net/recaptcha/api.js?hl=".concat(lang, "&onload=").concat(callback);
43
49
  case RECAPTCHA_ENTERPRISE_PROVIDER:
44
50
  return "https://www.recaptcha.net/recaptcha/enterprise.js?render=explicit&hl=".concat(lang, "&onload=").concat(callback);
51
+ case HCAPTCHA_PROVIDER:
52
+ return "https://js.hcaptcha.com/1/api.js?hl=".concat(lang, "&onload=").concat(callback);
53
+ case FRIENDLY_CAPTCHA_PROVIDER:
54
+ return 'https://cdn.jsdelivr.net/npm/friendly-challenge@0.9.12/widget.min.js';
45
55
  }
46
56
  };
47
- var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
48
- _inherits(ReCAPTCHA, _React$Component);
49
- var _super = _createSuper(ReCAPTCHA);
50
- function ReCAPTCHA(props) {
57
+ var providerDomPrefix = function providerDomPrefix(provider) {
58
+ switch (provider) {
59
+ case RECAPTCHA_V2_PROVIDER:
60
+ return 'recaptcha';
61
+ case RECAPTCHA_ENTERPRISE_PROVIDER:
62
+ return 'recaptcha';
63
+ case HCAPTCHA_PROVIDER:
64
+ return 'hcaptcha';
65
+ case FRIENDLY_CAPTCHA_PROVIDER:
66
+ return 'friendly-captcha';
67
+ }
68
+ };
69
+ var ThirdPartyCaptcha = /*#__PURE__*/function (_React$Component) {
70
+ _inherits(ThirdPartyCaptcha, _React$Component);
71
+ var _super = _createSuper(ThirdPartyCaptcha);
72
+ function ThirdPartyCaptcha(props) {
51
73
  var _this;
52
- _classCallCheck(this, ReCAPTCHA);
74
+ _classCallCheck(this, ThirdPartyCaptcha);
53
75
  _this = _super.call(this, props);
54
76
  _this.state = {};
55
77
  //this version of react doesn't have React.createRef
@@ -81,7 +103,7 @@ var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
81
103
  };
82
104
  return _this;
83
105
  }
84
- _createClass(ReCAPTCHA, [{
106
+ _createClass(ThirdPartyCaptcha, [{
85
107
  key: "componentWillUnmount",
86
108
  value: function componentWillUnmount() {
87
109
  if (!this.scriptNode) {
@@ -93,28 +115,43 @@ var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
93
115
  key: "componentDidMount",
94
116
  value: function componentDidMount() {
95
117
  var _this2 = this;
96
- ReCAPTCHA.loadScript(this.props, document.body, function (err, scriptNode) {
118
+ ThirdPartyCaptcha.loadScript(this.props, document.body, function (err, scriptNode) {
97
119
  _this2.scriptNode = scriptNode;
98
- var provider = getRecaptchaProvider(_this2.props.provider);
99
-
100
- // if this is enterprise then we change this to window.grecaptcha.enterprise.render
101
- _this2.widgetId = provider.render(_this2.ref.current, {
102
- callback: _this2.changeHandler,
103
- 'expired-callback': _this2.expiredHandler,
104
- 'error-callback': _this2.erroredHandler,
105
- sitekey: _this2.props.sitekey
106
- });
120
+ var provider = getCaptchaProvider(_this2.props.provider);
121
+ if (_this2.props.provider === FRIENDLY_CAPTCHA_PROVIDER) {
122
+ _this2.widgetInstance = new provider.WidgetInstance(_this2.ref.current, {
123
+ sitekey: _this2.props.sitekey,
124
+ language: _this2.props.hl,
125
+ doneCallback: _this2.changeHandler,
126
+ errorCallback: _this2.erroredHandler
127
+ });
128
+ } else {
129
+ // if this is enterprise then we change this to window.grecaptcha.enterprise.render
130
+ _this2.widgetId = provider.render(_this2.ref.current, {
131
+ callback: _this2.changeHandler,
132
+ 'expired-callback': _this2.expiredHandler,
133
+ 'error-callback': _this2.erroredHandler,
134
+ sitekey: _this2.props.sitekey
135
+ });
136
+ }
107
137
  });
108
138
  }
109
139
  }, {
110
140
  key: "reset",
111
141
  value: function reset() {
112
- var provider = getRecaptchaProvider(this.props.provider);
113
- provider.reset(this.widgetId);
142
+ var provider = getCaptchaProvider(this.props.provider);
143
+ if (this.props.provider === FRIENDLY_CAPTCHA_PROVIDER) {
144
+ if (this.widgetInstance) {
145
+ this.widgetInstance.reset();
146
+ }
147
+ } else {
148
+ provider.reset(this.widgetId);
149
+ }
114
150
  }
115
151
  }, {
116
152
  key: "render",
117
153
  value: function render() {
154
+ var _this3 = this;
118
155
  /*
119
156
  This is an override for the following conflicting css-rule:
120
157
  @media screen and (max-width: 480px)
@@ -123,7 +160,7 @@ var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
123
160
  }
124
161
  */
125
162
  var fixInterval = setInterval(function () {
126
- var iframes = Array.from(document.querySelectorAll("iframe[src*=\"recaptcha\"]"));
163
+ var iframes = Array.from(document.querySelectorAll("iframe[src*=\"".concat(providerDomPrefix(_this3.props.provider), "\"]")));
127
164
  var containers = iframes.map(function (iframe) {
128
165
  return iframe.parentNode.parentNode;
129
166
  }).filter(function (container) {
@@ -138,9 +175,9 @@ var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
138
175
  clearInterval(fixInterval);
139
176
  }, 300);
140
177
  return /*#__PURE__*/_react.default.createElement("div", {
141
- className: this.props.isValid ? 'auth0-lock-recaptcha-block' : 'auth0-lock-recaptcha-block auth0-lock-recaptcha-block-error'
178
+ className: this.props.isValid ? "auth0-lock-".concat(providerDomPrefix(this.props.provider), "-block") : "auth0-lock-".concat(providerDomPrefix(this.props.provider), "-block auth0-lock-").concat(providerDomPrefix(this.props.provider), "-block-error")
142
179
  }, /*#__PURE__*/_react.default.createElement("div", {
143
- className: "auth0-lock-recaptchav2",
180
+ className: "auth0-lock-".concat(providerDomPrefix(this.props.provider) === 'recaptcha' ? 'recaptchav2' : providerDomPrefix(this.props.provider)),
144
181
  ref: this.ref
145
182
  }));
146
183
  }
@@ -156,7 +193,7 @@ var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
156
193
  value: function loadScript(props) {
157
194
  var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.body;
158
195
  var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
159
- var callbackName = "recatpchaCallback_".concat(Math.floor(Math.random() * 1000001));
196
+ var callbackName = "".concat(providerDomPrefix(props.provider), "Callback_").concat(Math.floor(Math.random() * 1000001));
160
197
  var scriptUrl = scriptForProvider(props.provider, props.hl, callbackName);
161
198
  var script = document.createElement('script');
162
199
  window[callbackName] = function () {
@@ -165,6 +202,10 @@ var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
165
202
  };
166
203
  script.src = scriptUrl;
167
204
  script.async = true;
205
+ script.defer = true;
206
+ if (props.provider === FRIENDLY_CAPTCHA_PROVIDER) {
207
+ script.onload = window[callbackName];
208
+ }
168
209
  element.appendChild(script);
169
210
  }
170
211
  }, {
@@ -179,11 +220,11 @@ var ReCAPTCHA = /*#__PURE__*/function (_React$Component) {
179
220
  }
180
221
  }
181
222
  }]);
182
- return ReCAPTCHA;
183
- }(_react.default.Component);
184
- exports.ReCAPTCHA = ReCAPTCHA;
185
- ReCAPTCHA.displayName = 'ReCAPTCHA';
186
- ReCAPTCHA.propTypes = {
223
+ return ThirdPartyCaptcha;
224
+ }(_react.default.Component); // TO DO: Confirm this change will not introduce unintended behavior for customers
225
+ exports.ThirdPartyCaptcha = ThirdPartyCaptcha;
226
+ ThirdPartyCaptcha.displayName = 'ThirdPartyCaptcha';
227
+ ThirdPartyCaptcha.propTypes = {
187
228
  provider: _propTypes.default.string.isRequired,
188
229
  sitekey: _propTypes.default.string.isRequired,
189
230
  onChange: _propTypes.default.func,
@@ -193,7 +234,7 @@ ReCAPTCHA.propTypes = {
193
234
  value: _propTypes.default.string,
194
235
  isValid: _propTypes.default.bool
195
236
  };
196
- ReCAPTCHA.defaultProps = {
237
+ ThirdPartyCaptcha.defaultProps = {
197
238
  onChange: noop,
198
239
  onExpired: noop,
199
240
  onErrored: noop
@@ -28,7 +28,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
28
28
  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); }
29
29
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
30
  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; } }
31
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
31
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // import LocationInput from '../../ui/input/location_input';
32
32
  var IconSvg = /*#__PURE__*/_react.default.createElement("svg", {
33
33
  focusable: "false",
34
34
  width: "14px",
package/lib/i18n.js CHANGED
@@ -91,7 +91,7 @@ function assertLanguage(m, language, base) {
91
91
  function syncLang(m, language, _cb) {
92
92
  (0, _cdn_utils.load)({
93
93
  method: 'registerLanguageDictionary',
94
- url: "".concat(l.languageBaseUrl(m), "/js/lock/").concat("12.0.1", "/").concat(language, ".js"),
94
+ url: "".concat(l.languageBaseUrl(m), "/js/lock/").concat("12.1.0", "/").concat(language, ".js"),
95
95
  check: function check(str) {
96
96
  return str && str === language;
97
97
  },
package/lib/lock.js CHANGED
@@ -39,7 +39,7 @@ var Auth0Lock = /*#__PURE__*/function (_Core) {
39
39
  return _createClass(Auth0Lock);
40
40
  }(_core.default); // telemetry
41
41
  exports.default = Auth0Lock;
42
- Auth0Lock.version = "12.0.1";
42
+ Auth0Lock.version = "12.1.0";
43
43
 
44
44
  // TODO: should we have different telemetry for classic/passwordless?
45
45
  // TODO: should we set telemetry info before each request?
@@ -39,4 +39,4 @@ var Auth0LockPasswordless = /*#__PURE__*/function (_Core) {
39
39
  return _createClass(Auth0LockPasswordless);
40
40
  }(_core.default);
41
41
  exports.default = Auth0LockPasswordless;
42
- Auth0LockPasswordless.version = "12.0.1";
42
+ Auth0LockPasswordless.version = "12.1.0";
@@ -78,6 +78,9 @@ var Welcome = /*#__PURE__*/function (_React$Component2) {
78
78
  args[_key] = arguments[_key];
79
79
  }
80
80
  _this = _super2.call.apply(_super2, [this].concat(args));
81
+ // Cause a reflow when the image is loaded to fix an issue with the Lock content sometimes
82
+ // not rendering in a popup on first load.
83
+ // https://github.com/auth0/lock/issues/1942
81
84
  _defineProperty(_assertThisInitialized(_this), "onImageLoad", function () {
82
85
  return document.querySelector('.auth0-lock').style.fontSize = '1rem';
83
86
  });
@@ -135,7 +138,9 @@ var WelcomeMessage = /*#__PURE__*/function (_React$Component3) {
135
138
  }
136
139
  return /*#__PURE__*/_react.default.createElement("div", {
137
140
  className: className,
138
- title: message
141
+ title: message,
142
+ role: "heading",
143
+ "aria-level": "1"
139
144
  }, message);
140
145
  }
141
146
  }]);
package/lib/ui/box.js CHANGED
@@ -72,7 +72,7 @@ var Renderer = /*#__PURE__*/function () {
72
72
  key: "remove",
73
73
  value: function remove(containerId) {
74
74
  var _this2 = this;
75
- if (this.modals[containerId]) {
75
+ if (this.modals[containerId] && this.modals[containerId].component) {
76
76
  this.modals[containerId].component.hide();
77
77
  setTimeout(function () {
78
78
  return _this2.unmount(containerId);
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
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
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -9,14 +8,13 @@ var _react = _interopRequireDefault(require("react"));
9
8
  var _input_wrap = _interopRequireDefault(require("./input_wrap"));
10
9
  var _excluded = ["lockId", "image", "value", "placeholder", "onReload", "invalidHint", "isValid"];
11
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ 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); }
12
12
  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); }
13
13
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
14
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
15
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
16
  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); } }
17
17
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
- 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); }
20
18
  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); }
21
19
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
20
  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); }; }
@@ -24,6 +22,9 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
24
22
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
25
23
  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; } }
26
24
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
25
+ 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; }
26
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
27
+ 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
28
  var InputIconSvg = /*#__PURE__*/_react.default.createElement("svg", {
28
29
  className: "auth0-lock-icon auth0-lock-icon-box",
29
30
  width: "21",
@@ -54,7 +55,6 @@ var RefreshIconSvg = function RefreshIconSvg() {
54
55
  fill: "black"
55
56
  }), /*#__PURE__*/_react.default.createElement("mask", {
56
57
  id: "mask0",
57
- "mask-type": "alpha",
58
58
  maskUnits: "userSpaceOnUse",
59
59
  x: "1",
60
60
  y: "1",
@@ -76,6 +76,27 @@ var CaptchaInput = /*#__PURE__*/function (_React$Component) {
76
76
  var _this;
77
77
  _classCallCheck(this, CaptchaInput);
78
78
  _this = _super.call(this, props);
79
+ _defineProperty(_assertThisInitialized(_this), "handleOnChange", function (e) {
80
+ if (_this.props.onChange) {
81
+ _this.props.onChange(e);
82
+ }
83
+ });
84
+ _defineProperty(_assertThisInitialized(_this), "handleReload", function (e) {
85
+ if (_this.props.onReload) {
86
+ e.preventDefault();
87
+ _this.props.onReload(e);
88
+ }
89
+ });
90
+ _defineProperty(_assertThisInitialized(_this), "handleFocus", function () {
91
+ _this.setState({
92
+ focused: true
93
+ });
94
+ });
95
+ _defineProperty(_assertThisInitialized(_this), "handleBlur", function () {
96
+ _this.setState({
97
+ focused: false
98
+ });
99
+ });
79
100
  _this.state = {};
80
101
  return _this;
81
102
  }
@@ -112,7 +133,7 @@ var CaptchaInput = /*#__PURE__*/function (_React$Component) {
112
133
  }
113
134
  }), /*#__PURE__*/_react.default.createElement("button", {
114
135
  type: "button",
115
- onClick: this.handleReload.bind(this),
136
+ onClick: this.handleReload,
116
137
  className: "auth0-lock-captcha-refresh"
117
138
  }, /*#__PURE__*/_react.default.createElement(RefreshIconSvg, null))), /*#__PURE__*/_react.default.createElement(_input_wrap.default, {
118
139
  focused: focused,
@@ -132,44 +153,15 @@ var CaptchaInput = /*#__PURE__*/function (_React$Component) {
132
153
  autoCapitalize: "off",
133
154
  autoCorrect: "off",
134
155
  spellCheck: "false",
135
- onChange: this.handleOnChange.bind(this),
136
- onFocus: this.handleFocus.bind(this),
137
- onBlur: this.handleBlur.bind(this),
156
+ onChange: this.handleOnChange,
157
+ onFocus: this.handleFocus,
158
+ onBlur: this.handleBlur,
138
159
  "aria-label": "Email",
139
160
  "aria-invalid": !isValid,
140
161
  "aria-describedby": !isValid && invalidHint ? "auth0-lock-error-msg-email" : undefined,
141
162
  value: value
142
163
  }, props))));
143
164
  }
144
- }, {
145
- key: "handleOnChange",
146
- value: function handleOnChange(e) {
147
- if (this.props.onChange) {
148
- this.props.onChange(e);
149
- }
150
- }
151
- }, {
152
- key: "handleReload",
153
- value: function handleReload(e) {
154
- if (this.props.onReload) {
155
- e.preventDefault();
156
- this.props.onReload(e);
157
- }
158
- }
159
- }, {
160
- key: "handleFocus",
161
- value: function handleFocus() {
162
- this.setState({
163
- focused: true
164
- });
165
- }
166
- }, {
167
- key: "handleBlur",
168
- value: function handleBlur() {
169
- this.setState({
170
- focused: false
171
- });
172
- }
173
165
  }]);
174
166
  return CaptchaInput;
175
167
  }(_react.default.Component);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0-lock",
3
- "version": "12.0.1",
3
+ "version": "12.1.0",
4
4
  "description": "Auth0 Lock",
5
5
  "author": "Auth0 <support@auth0.com> (http://auth0.com)",
6
6
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  "@babel/plugin-syntax-import-meta": "^7.0.0",
61
61
  "@babel/preset-env": "^7.0.0",
62
62
  "@babel/preset-react": "^7.0.0",
63
- "@cfaester/enzyme-adapter-react-18": "^0.6.0",
63
+ "@cfaester/enzyme-adapter-react-18": "^0.7.0",
64
64
  "@google-cloud/translate": "^6.0.2",
65
65
  "babel-eslint": "^9.0.0",
66
66
  "babel-jest": "^29.3.1",
@@ -70,7 +70,6 @@
70
70
  "babel-plugin-version-inline": "^1.0.0",
71
71
  "babelify": "^10.0.0",
72
72
  "browserify": "^17.0.0",
73
- "bump-version": "^0.5.0",
74
73
  "chalk": "^4.1.2",
75
74
  "core-js": "^3.26.1",
76
75
  "cross-env": "^7.0.3",
@@ -82,6 +81,7 @@
82
81
  "eslint-config-prettier": "^8.3.0",
83
82
  "eslint-plugin-react": "^7.4.0",
84
83
  "esm": "^3.2.25",
84
+ "events": "^3.3.0",
85
85
  "expect.js": "^0.3.1",
86
86
  "flat": "^5.0.2",
87
87
  "glob": "^7.1.7",
@@ -113,9 +113,8 @@
113
113
  "react-test-renderer": "^18.2.0",
114
114
  "sinon": "^1.15.4",
115
115
  "stylus": "^0.59.0",
116
- "stylus-loader": "^2.3.1",
116
+ "stylus-loader": "^3.0.2",
117
117
  "tmp": "^0.2.1",
118
- "uglify-js": "^2.7.4",
119
118
  "unminified-webpack-plugin": "^3.0.0",
120
119
  "unreleased": "^0.1.0",
121
120
  "watchify": "^4.0.0",
@@ -124,7 +123,7 @@
124
123
  "webpack-dev-server": "^4.11.1"
125
124
  },
126
125
  "dependencies": {
127
- "auth0-js": "^9.20.0",
126
+ "auth0-js": "^9.22.0",
128
127
  "auth0-password-policies": "^1.0.2",
129
128
  "blueimp-md5": "^2.19.0",
130
129
  "classnames": "^2.3.2",
@@ -1,57 +0,0 @@
1
- ---
2
- name: Report a bug
3
- about: Have you found a bug or issue? Create a bug report for this SDK
4
- title: ''
5
- labels: bug report
6
- assignees: ''
7
- ---
8
-
9
- <!--
10
- **Please do not report security vulnerabilities here**. The Responsible Disclosure Program (https://auth0.com/whitehat) details the procedure for disclosing security issues.
11
-
12
- Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community (https://community.auth0.com/) or Auth0 Support (https://support.auth0.com/). Finally, to avoid duplicates, please search existing Issues before submitting one here.
13
-
14
- By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct (https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).
15
- -->
16
-
17
- :warning: **Note:** We are no longer supporting requests for new features. Only requests for bug fixes or security patches will be considered.
18
-
19
- ### Describe the problem
20
-
21
- <!--
22
- > Provide a clear and concise description of the issue
23
- -->
24
-
25
- ### What was the expected behavior?
26
-
27
- <!--
28
- > Tell us about the behavior you expected to see
29
- -->
30
-
31
- ### Reproduction
32
- <!--
33
- > Detail the steps taken to reproduce this error, and whether this issue can be reproduced consistently or if it is intermittent.
34
- > **Note**: If clear, reproducable steps or the smallest sample app demonstrating misbehavior cannot be provided, we may not be able to follow up on this bug report.
35
-
36
- > Where possible, please include:
37
- >
38
- > - The smallest possible sample app that reproduces the undesirable behavior
39
- > - Log files (redact/remove sensitive information)
40
- > - Application settings (redact/remove sensitive information)
41
- > - Screenshots
42
- -->
43
-
44
- - Step 1..
45
- - Step 2..
46
- - ...
47
-
48
- ### Environment
49
-
50
- <!--
51
- > Please provide the following:
52
- -->
53
-
54
- - **Version of this library used:**
55
- - **Which framework are you using, if applicable:**
56
- - **Other modules/plugins/libraries that might be involved:**
57
- - **Any other relevant information you think would be useful:**