auth0-lock 14.2.1 → 14.2.2

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.
@@ -51,6 +51,7 @@ var UsernameInput = exports.default = /*#__PURE__*/function (_React$Component) {
51
51
  _classCallCheck(this, UsernameInput);
52
52
  _this = _callSuper(this, UsernameInput, [props]);
53
53
  _this.state = {};
54
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
54
55
  return _this;
55
56
  }
56
57
  _inherits(UsernameInput, _React$Component);
@@ -83,7 +84,7 @@ var UsernameInput = exports.default = /*#__PURE__*/function (_React$Component) {
83
84
  name: "username",
84
85
  icon: IconSvg
85
86
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
86
- ref: "input",
87
+ ref: this.inputRef,
87
88
  type: "text",
88
89
  name: "username",
89
90
  className: "auth0-lock-input",
@@ -57,6 +57,7 @@ var VcodeInput = exports.default = /*#__PURE__*/function (_React$Component) {
57
57
  _classCallCheck(this, VcodeInput);
58
58
  _this = _callSuper(this, VcodeInput, [props]);
59
59
  _this.state = {};
60
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
60
61
  return _this;
61
62
  }
62
63
  _inherits(VcodeInput, _React$Component);
@@ -69,7 +70,7 @@ var VcodeInput = exports.default = /*#__PURE__*/function (_React$Component) {
69
70
  // the input to be visible. Use a more robust solution (Placeholder should
70
71
  // notify it children when they are being shown).
71
72
  setTimeout(function () {
72
- return _this2.refs.input && _this2.refs.input.focus();
73
+ return _this2.inputRef.current && _this2.inputRef.current.focus();
73
74
  }, 1200);
74
75
  }
75
76
  }
@@ -88,7 +89,7 @@ var VcodeInput = exports.default = /*#__PURE__*/function (_React$Component) {
88
89
  icon: IconSvg
89
90
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
90
91
  id: "".concat(lockId, "-vcode"),
91
- ref: "input",
92
+ ref: this.inputRef,
92
93
  type: "tel",
93
94
  name: "vcode",
94
95
  className: "auth0-lock-input auth0-lock-input-code",
package/lib/ui/list.js CHANGED
@@ -136,24 +136,28 @@ var FiltrableList = exports.default = /*#__PURE__*/function (_React$Component) {
136
136
  }]);
137
137
  }(_react.default.Component);
138
138
  var List = /*#__PURE__*/function (_React$Component2) {
139
- function List() {
139
+ function List(props) {
140
+ var _this3;
140
141
  _classCallCheck(this, List);
141
- return _callSuper(this, List, arguments);
142
+ _this3 = _callSuper(this, List, [props]);
143
+ _this3.highlightedRef = /*#__PURE__*/_react.default.createRef();
144
+ _this3.listRef = /*#__PURE__*/_react.default.createRef();
145
+ return _this3;
142
146
  }
143
147
  _inherits(List, _React$Component2);
144
148
  return _createClass(List, [{
145
149
  key: "componentDidUpdate",
146
150
  value: function componentDidUpdate() {
147
- var _this3 = this;
151
+ var _this4 = this;
148
152
  // Ensure that highlighted item is entirely visible
149
153
 
150
154
  // NOTE: I've spent very little time on this. It works, but it
151
155
  // surely can be more clearly.
152
156
 
153
- var highlighted = this.refs.highlighted;
157
+ var highlighted = this.highlightedRef.current;
154
158
  if (highlighted) {
155
- var scrollableNode = _reactDom.default.findDOMNode(this);
156
- var highlightedNode = _reactDom.default.findDOMNode(highlighted);
159
+ var scrollableNode = this.listRef.current;
160
+ var highlightedNode = highlighted;
157
161
  var relativeOffsetTop = highlightedNode.offsetTop - scrollableNode.scrollTop;
158
162
  var scrollTopDelta = 0;
159
163
  if (relativeOffsetTop + highlightedNode.offsetHeight > scrollableNode.clientHeight) {
@@ -166,7 +170,7 @@ var List = /*#__PURE__*/function (_React$Component2) {
166
170
  scrollableNode.scrollTop += scrollTopDelta;
167
171
  if (this.timeout) clearTimeout(this.timeout);
168
172
  this.timeout = setTimeout(function () {
169
- return _this3.preventHighlight = false;
173
+ return _this4.preventHighlight = false;
170
174
  }, 100);
171
175
  }
172
176
  }
@@ -187,25 +191,26 @@ var List = /*#__PURE__*/function (_React$Component2) {
187
191
  }, {
188
192
  key: "render",
189
193
  value: function render() {
190
- var _this4 = this;
194
+ var _this5 = this;
191
195
  var items = this.props.items.map(function (x) {
192
- var highlighted = x === _this4.props.highlighted;
196
+ var highlighted = x === _this5.props.highlighted;
193
197
  var props = {
194
198
  highlighted: highlighted,
195
199
  label: x.get('label'),
196
200
  onClick: function onClick() {
197
- return _this4.props.onClick(x);
201
+ return _this5.props.onClick(x);
198
202
  },
199
203
  onMouseMove: function onMouseMove() {
200
- return _this4.mouseMoveHandler(x);
204
+ return _this5.mouseMoveHandler(x);
201
205
  }
202
206
  };
203
- if (highlighted) props.ref = 'highlighted';
207
+ if (highlighted) props.ref = _this5.highlightedRef;
204
208
  return /*#__PURE__*/_react.default.createElement(Item, _extends({
205
209
  key: x.get('label')
206
210
  }, props));
207
211
  });
208
212
  return /*#__PURE__*/_react.default.createElement("div", {
213
+ ref: this.listRef,
209
214
  className: "auth0-lock-list-code",
210
215
  onMouseLeave: this.mouseLeaveHandler.bind(this)
211
216
  }, /*#__PURE__*/_react.default.createElement("ul", null, items));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0-lock",
3
- "version": "14.2.1",
3
+ "version": "14.2.2",
4
4
  "description": "Auth0 Lock",
5
5
  "author": "Auth0 <support@auth0.com> (http://auth0.com)",
6
6
  "license": "MIT",
@@ -73,7 +73,7 @@
73
73
  "chalk": "^4.1.2",
74
74
  "core-js": "^3.26.1",
75
75
  "cross-env": "^7.0.3",
76
- "css-loader": "^0.28.11",
76
+ "css-loader": "^7.1.2",
77
77
  "emojic": "^1.1.17",
78
78
  "enzyme": "^3.1.1",
79
79
  "es-check": "^6.0.0",
@@ -131,7 +131,7 @@
131
131
  "qs": "^6.10.3",
132
132
  "react": "^18.2.0",
133
133
  "react-dom": "^18.2.0",
134
- "react-transition-group": "^2.2.1",
134
+ "react-transition-group": "^4.4.5",
135
135
  "trim": "^1.0.1",
136
136
  "url-join": "^1.1.0",
137
137
  "validator": "^13.15.22"