auth0-lock 11.35.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/.browserslistrc +1 -0
  2. package/.circleci/config.yml +3 -1
  3. package/.shiprc +4 -5
  4. package/CHANGELOG.md +25 -0
  5. package/DEVELOPMENT.md +1 -1
  6. package/README.md +20 -16
  7. package/karma.conf.js +1 -1
  8. package/lib/CSSCore.js +1 -4
  9. package/lib/__tests__/auth_button.js +12 -22
  10. package/lib/__tests__/connection/database/actions.js +48 -49
  11. package/lib/__tests__/connection/database/index.js +22 -28
  12. package/lib/__tests__/connection/database/login_pane.js +24 -47
  13. package/lib/__tests__/connection/database/password_reset_confirmation.js +23 -32
  14. package/lib/__tests__/connection/database/reset_password.js +17 -39
  15. package/lib/__tests__/connection/database/signed_up_confirmation.js +23 -32
  16. package/lib/__tests__/connection/enterprise/actions.js +22 -47
  17. package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
  18. package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
  19. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +32 -75
  20. package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
  21. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +23 -32
  22. package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
  23. package/lib/__tests__/core/actions.js +23 -46
  24. package/lib/__tests__/core/client/index.js +10 -13
  25. package/lib/__tests__/core/index.js +46 -94
  26. package/lib/__tests__/core/remote_data.js +14 -20
  27. package/lib/__tests__/core/signed_in_confirmation.js +23 -32
  28. package/lib/__tests__/core/sso/last_login_screen.js +27 -50
  29. package/lib/__tests__/core/tenant.js +10 -12
  30. package/lib/__tests__/core/web_api/helper.js +6 -14
  31. package/lib/__tests__/core/web_api/p2_api.js +38 -33
  32. package/lib/__tests__/core/web_api.js +37 -33
  33. package/lib/__tests__/engine/classic/login.js +20 -41
  34. package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
  35. package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
  36. package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
  37. package/lib/__tests__/engine/classic.js +13 -6
  38. package/lib/__tests__/engine/passwordless/social_or_email_login_screen.js +7 -28
  39. package/lib/__tests__/engine/passwordless/social_or_phone_number_login_screen.js +7 -28
  40. package/lib/__tests__/engine/passwordless.js +2 -5
  41. package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
  42. package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
  43. package/lib/__tests__/field/captcha.js +39 -51
  44. package/lib/__tests__/field/custom_input.js +23 -47
  45. package/lib/__tests__/field/email.js +2 -3
  46. package/lib/__tests__/field/email_pane.js +25 -48
  47. package/lib/__tests__/field/field.js +9 -13
  48. package/lib/__tests__/field/login_pane.js +30 -34
  49. package/lib/__tests__/field/mfa_code_pane.js +13 -28
  50. package/lib/__tests__/field/option_selection_pane.js +7 -25
  51. package/lib/__tests__/field/password.js +6 -12
  52. package/lib/__tests__/field/password_pane.js +29 -46
  53. package/lib/__tests__/field/phone_number_pane.js +18 -41
  54. package/lib/__tests__/field/social_buttons_pane.js +30 -47
  55. package/lib/__tests__/field/username.js +27 -48
  56. package/lib/__tests__/field/username_pane.js +30 -47
  57. package/lib/__tests__/field/vcode.js +5 -13
  58. package/lib/__tests__/field/vcode_pane.js +20 -44
  59. package/lib/__tests__/i18n.js +28 -53
  60. package/lib/__tests__/quick-auth/actions.js +4 -27
  61. package/lib/__tests__/setup-tests.js +7 -9
  62. package/lib/__tests__/testUtils.js +41 -58
  63. package/lib/__tests__/ui/box/chrome.js +24 -49
  64. package/lib/__tests__/ui/box/confirmation_pane.js +23 -42
  65. package/lib/__tests__/ui/box/container.js +21 -46
  66. package/lib/__tests__/ui/box/global_message.js +60 -37
  67. package/lib/__tests__/ui/input/email_input.js +6 -17
  68. package/lib/__tests__/ui/input/input_wrap.js +6 -19
  69. package/lib/__tests__/ui/input/password/password_strength.js +13 -15
  70. package/lib/__tests__/ui/input/password_input.js +22 -27
  71. package/lib/__tests__/utils/format.js +10 -17
  72. package/lib/__tests__/utils/url_utils.js +2 -5
  73. package/lib/avatar/gravatar_provider.js +13 -28
  74. package/lib/avatar.js +22 -41
  75. package/lib/browser.js +372 -23
  76. package/lib/connection/captcha.js +15 -34
  77. package/lib/connection/database/actions.js +39 -108
  78. package/lib/connection/database/index.js +90 -191
  79. package/lib/connection/database/login_pane.js +107 -147
  80. package/lib/connection/database/login_sign_up_tabs.js +106 -125
  81. package/lib/connection/database/mfa_pane.js +50 -69
  82. package/lib/connection/database/password_reset_confirmation.js +51 -73
  83. package/lib/connection/database/reset_password.js +116 -132
  84. package/lib/connection/database/reset_password_pane.js +45 -56
  85. package/lib/connection/database/sign_up_terms.js +17 -23
  86. package/lib/connection/database/signed_up_confirmation.js +52 -75
  87. package/lib/connection/enterprise/actions.js +23 -52
  88. package/lib/connection/enterprise/hrd_pane.js +60 -76
  89. package/lib/connection/enterprise/hrd_screen.js +60 -75
  90. package/lib/connection/enterprise/kerberos_screen.js +46 -60
  91. package/lib/connection/enterprise/quick_auth_screen.js +46 -64
  92. package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
  93. package/lib/connection/enterprise.js +51 -84
  94. package/lib/connection/passwordless/actions.js +29 -65
  95. package/lib/connection/passwordless/ask_vcode.js +53 -60
  96. package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
  97. package/lib/connection/passwordless/index.js +36 -68
  98. package/lib/connection/social/index.js +12 -15
  99. package/lib/core/actions.js +33 -85
  100. package/lib/core/client/index.js +38 -58
  101. package/lib/core/client/settings.js +12 -20
  102. package/lib/core/error_screen.js +38 -52
  103. package/lib/core/index.js +154 -305
  104. package/lib/core/loading_screen.js +61 -71
  105. package/lib/core/pane_separator.js +10 -10
  106. package/lib/core/remote_data.js +30 -51
  107. package/lib/core/screen.js +85 -79
  108. package/lib/core/signed_in_confirmation.js +51 -73
  109. package/lib/core/sso/data.js +9 -17
  110. package/lib/core/sso/index.js +5 -6
  111. package/lib/core/sso/last_login_screen.js +46 -63
  112. package/lib/core/tenant/index.js +37 -59
  113. package/lib/core/tenant/settings.js +11 -15
  114. package/lib/core/web_api/helper.js +22 -28
  115. package/lib/core/web_api/p2_api.js +162 -171
  116. package/lib/core/web_api.js +106 -94
  117. package/lib/core.js +126 -160
  118. package/lib/engine/classic/login.js +92 -144
  119. package/lib/engine/classic/mfa_login_screen.js +61 -67
  120. package/lib/engine/classic/sign_up_pane.js +89 -123
  121. package/lib/engine/classic/sign_up_screen.js +112 -158
  122. package/lib/engine/classic.js +122 -183
  123. package/lib/engine/passwordless/social_or_email_login_screen.js +80 -116
  124. package/lib/engine/passwordless/social_or_phone_number_login_screen.js +79 -110
  125. package/lib/engine/passwordless.js +75 -104
  126. package/lib/field/actions.js +11 -17
  127. package/lib/field/captcha/captcha_pane.js +83 -103
  128. package/lib/field/captcha/recaptcha.js +140 -145
  129. package/lib/field/captcha.js +7 -10
  130. package/lib/field/custom_input.js +37 -50
  131. package/lib/field/email/email_pane.js +90 -109
  132. package/lib/field/email.js +17 -35
  133. package/lib/field/index.js +50 -87
  134. package/lib/field/mfa-code/mfa_code_pane.js +57 -71
  135. package/lib/field/mfa_code.js +15 -21
  136. package/lib/field/option_selection_pane.js +16 -22
  137. package/lib/field/password/password_pane.js +79 -91
  138. package/lib/field/password.js +8 -14
  139. package/lib/field/phone-number/locations.js +7 -3
  140. package/lib/field/phone-number/phone_number_pane.js +87 -124
  141. package/lib/field/phone_number.js +16 -30
  142. package/lib/field/social/event.js +9 -12
  143. package/lib/field/social/social_buttons_pane.js +93 -121
  144. package/lib/field/username/username_pane.js +105 -123
  145. package/lib/field/username.js +16 -26
  146. package/lib/field/vcode/vcode_pane.js +67 -93
  147. package/lib/field/vcode.js +5 -5
  148. package/lib/i18n/af.js +7 -4
  149. package/lib/i18n/ar.js +7 -4
  150. package/lib/i18n/az.js +7 -4
  151. package/lib/i18n/bg.js +7 -4
  152. package/lib/i18n/ca.js +7 -4
  153. package/lib/i18n/cs.js +7 -4
  154. package/lib/i18n/da.js +7 -4
  155. package/lib/i18n/de.js +7 -3
  156. package/lib/i18n/el.js +7 -4
  157. package/lib/i18n/en.js +9 -4
  158. package/lib/i18n/es.js +7 -3
  159. package/lib/i18n/et.js +7 -4
  160. package/lib/i18n/fa.js +7 -4
  161. package/lib/i18n/fi.js +7 -4
  162. package/lib/i18n/fr.js +7 -4
  163. package/lib/i18n/he.js +7 -4
  164. package/lib/i18n/hr.js +7 -4
  165. package/lib/i18n/hu.js +7 -4
  166. package/lib/i18n/id.js +7 -4
  167. package/lib/i18n/it.js +7 -3
  168. package/lib/i18n/ja.js +7 -4
  169. package/lib/i18n/ko.js +7 -4
  170. package/lib/i18n/lt.js +7 -4
  171. package/lib/i18n/lv.js +7 -4
  172. package/lib/i18n/ms.js +7 -4
  173. package/lib/i18n/nb.js +7 -4
  174. package/lib/i18n/nl.js +7 -4
  175. package/lib/i18n/nn.js +7 -4
  176. package/lib/i18n/no.js +7 -4
  177. package/lib/i18n/pl.js +7 -4
  178. package/lib/i18n/pt-br.js +7 -3
  179. package/lib/i18n/pt.js +7 -4
  180. package/lib/i18n/ro.js +7 -4
  181. package/lib/i18n/ru.js +7 -4
  182. package/lib/i18n/sk.js +7 -4
  183. package/lib/i18n/sl.js +7 -4
  184. package/lib/i18n/sr.js +7 -4
  185. package/lib/i18n/sv.js +7 -4
  186. package/lib/i18n/tr.js +7 -4
  187. package/lib/i18n/ua.js +7 -4
  188. package/lib/i18n/uk.js +7 -4
  189. package/lib/i18n/vi.js +7 -4
  190. package/lib/i18n/zh-tw.js +7 -4
  191. package/lib/i18n/zh.js +7 -4
  192. package/lib/i18n.js +38 -75
  193. package/lib/index.js +14 -17
  194. package/lib/lock.js +29 -32
  195. package/lib/passwordless.js +29 -31
  196. package/lib/quick-auth/actions.js +19 -26
  197. package/lib/quick_auth.js +8 -10
  198. package/lib/sanitizer.js +5 -5
  199. package/lib/store/index.js +22 -42
  200. package/lib/sync.js +21 -42
  201. package/lib/ui/box/button.js +85 -105
  202. package/lib/ui/box/chrome.js +463 -548
  203. package/lib/ui/box/confirmation_pane.js +34 -48
  204. package/lib/ui/box/container.js +305 -339
  205. package/lib/ui/box/global_message.js +51 -60
  206. package/lib/ui/box/header.js +155 -177
  207. package/lib/ui/box/multisize_slide.js +233 -229
  208. package/lib/ui/box/success_pane.js +34 -37
  209. package/lib/ui/box.js +88 -93
  210. package/lib/ui/button/auth_button.js +44 -51
  211. package/lib/ui/input/captcha_input.js +162 -181
  212. package/lib/ui/input/checkbox_input.js +57 -59
  213. package/lib/ui/input/email_input.js +117 -124
  214. package/lib/ui/input/input_wrap.js +65 -80
  215. package/lib/ui/input/location_input.js +130 -150
  216. package/lib/ui/input/mfa_code_input.js +98 -98
  217. package/lib/ui/input/password/password_strength.js +103 -127
  218. package/lib/ui/input/password_input.js +141 -147
  219. package/lib/ui/input/phone_number_input.js +101 -109
  220. package/lib/ui/input/select_input.js +120 -132
  221. package/lib/ui/input/text_input.js +89 -84
  222. package/lib/ui/input/username_input.js +109 -115
  223. package/lib/ui/input/vcode_input.js +110 -118
  224. package/lib/ui/list.js +224 -247
  225. package/lib/ui/pane/quick_auth_pane.js +55 -80
  226. package/lib/utils/atom.js +55 -48
  227. package/lib/utils/cache.js +54 -43
  228. package/lib/utils/cdn_utils.js +17 -31
  229. package/lib/utils/createRef.js +3 -1
  230. package/lib/utils/data_utils.js +10 -16
  231. package/lib/utils/fn_utils.js +5 -4
  232. package/lib/utils/format.js +6 -8
  233. package/lib/utils/id_utils.js +4 -3
  234. package/lib/utils/jsonp_utils.js +20 -17
  235. package/lib/utils/media_utils.js +4 -2
  236. package/lib/utils/preload_utils.js +4 -3
  237. package/lib/utils/string_utils.js +4 -4
  238. package/lib/utils/url_utils.js +4 -3
  239. package/package.json +48 -34
  240. package/webpack.config.js +36 -3
@@ -1,162 +1,152 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _propTypes = require('prop-types');
6
-
7
- var _propTypes2 = _interopRequireDefault(_propTypes);
8
-
9
- var _react = require('react');
10
-
11
- var _react2 = _interopRequireDefault(_react);
12
-
13
- var _reactDom = require('react-dom');
14
-
15
- var _reactDom2 = _interopRequireDefault(_reactDom);
16
-
17
- var _CSSCore = require('../../CSSCore');
18
-
19
- var _CSSCore2 = _interopRequireDefault(_CSSCore);
20
-
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 _CSSCore = _interopRequireDefault(require("../../CSSCore"));
21
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
-
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; }
23
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
24
-
25
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
26
-
27
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
28
-
29
- var Slider = function (_React$Component) {
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 Slider = /*#__PURE__*/function (_React$Component) {
30
27
  _inherits(Slider, _React$Component);
31
-
28
+ var _super = _createSuper(Slider);
32
29
  function Slider(props) {
30
+ var _this;
33
31
  _classCallCheck(this, Slider);
34
-
35
- var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
36
-
37
- _this.state = { children: { current: props.children } };
32
+ _this = _super.call(this, props);
33
+ _this.state = {
34
+ children: {
35
+ current: props.children
36
+ }
37
+ };
38
38
  return _this;
39
39
  }
40
40
 
41
41
  // eslint-disable-next-line react/no-deprecated
42
-
43
-
44
- Slider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
45
- // TODO: take a prop to identify what are we rendering instead of
46
- // inferring it from children keys so we can accept more than one
47
- // child (we are already wrapping them).
48
- if (this.state.children.current.key != nextProps.children.key) {
49
- this.setState({
50
- children: {
51
- current: nextProps.children,
52
- prev: this.state.children.current
53
- },
54
- transitionName: this.props.transitionName
55
- });
56
- this.animate = true;
57
- } else if (!this.timeout) {
58
- this.setState({
59
- children: { current: nextProps.children },
60
- transitionName: nextProps.transitionName
61
- });
42
+ _createClass(Slider, [{
43
+ key: "UNSAFE_componentWillReceiveProps",
44
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
45
+ // TODO: take a prop to identify what are we rendering instead of
46
+ // inferring it from children keys so we can accept more than one
47
+ // child (we are already wrapping them).
48
+ if (this.state.children.current.key != nextProps.children.key) {
49
+ this.setState({
50
+ children: {
51
+ current: nextProps.children,
52
+ prev: this.state.children.current
53
+ },
54
+ transitionName: this.props.transitionName
55
+ });
56
+ this.animate = true;
57
+ } else if (!this.timeout) {
58
+ this.setState({
59
+ children: {
60
+ current: nextProps.children
61
+ },
62
+ transitionName: nextProps.transitionName
63
+ });
64
+ }
62
65
  }
63
- };
64
-
65
- Slider.prototype.componentDidUpdate = function componentDidUpdate() {
66
- var _this2 = this;
67
-
68
- if (this.animate) {
69
- this.animate = false;
70
-
71
- var transitionName = this.state.transitionName;
72
- var _state$children = this.state.children,
73
- current = _state$children.current,
74
- prev = _state$children.prev;
75
- var reverse = this.props.reverse;
76
-
77
- var currentComponent = this.refs[current.key];
78
- var prevComponent = this.refs[prev.key];
79
-
80
- var transition = function transition(component, className, delay) {
81
- // eslint-disable-next-line
82
- var node = _reactDom2.default.findDOMNode(component);
83
- var activeClassName = className + '-active';
84
-
85
- _CSSCore2.default.addClass(node, className);
86
-
87
- setTimeout(function () {
88
- return _CSSCore2.default.addClass(node, activeClassName);
89
- }, 17);
90
-
91
- if (delay) {
66
+ }, {
67
+ key: "componentDidUpdate",
68
+ value: function componentDidUpdate() {
69
+ var _this2 = this;
70
+ if (this.animate) {
71
+ this.animate = false;
72
+ var transitionName = this.state.transitionName;
73
+ var _this$state$children = this.state.children,
74
+ current = _this$state$children.current,
75
+ prev = _this$state$children.prev;
76
+ var reverse = this.props.reverse;
77
+ var currentComponent = this.refs[current.key];
78
+ var prevComponent = this.refs[prev.key];
79
+ var transition = function transition(component, className, delay) {
80
+ // eslint-disable-next-line
81
+ var node = _reactDom.default.findDOMNode(component);
82
+ var activeClassName = "".concat(className, "-active");
83
+ _CSSCore.default.addClass(node, className);
92
84
  setTimeout(function () {
93
- _CSSCore2.default.removeClass(node, className);
94
- _CSSCore2.default.removeClass(node, activeClassName);
95
- }, delay);
96
- }
97
- };
98
-
99
- var callback = function callback(slide) {
100
- currentComponent.componentWillSlideIn(slide);
101
- var classNamePrefix = reverse ? 'reverse-' : '';
102
- transition(currentComponent, '' + classNamePrefix + transitionName + '-enter', _this2.props.delay);
103
- transition(prevComponent, '' + classNamePrefix + transitionName + '-exit');
104
-
105
- _this2.timeout = setTimeout(function () {
106
- var _context;
107
-
108
- _this2.setState({
109
- children: { current: _this2.state.children.current },
110
- transitionName: _this2.props.transitionName
111
- });
112
- currentComponent.componentDidSlideIn((_context = _this2.props).onDidAppear.bind(_context));
113
- _this2.props.onDidSlide();
114
- _this2.timeout = null;
115
- }, _this2.props.delay);
116
- };
117
-
118
- this.props.onWillSlide();
119
- prevComponent.componentWillSlideOut(callback);
85
+ return _CSSCore.default.addClass(node, activeClassName);
86
+ }, 17);
87
+ if (delay) {
88
+ setTimeout(function () {
89
+ _CSSCore.default.removeClass(node, className);
90
+ _CSSCore.default.removeClass(node, activeClassName);
91
+ }, delay);
92
+ }
93
+ };
94
+ var callback = function callback(slide) {
95
+ currentComponent.componentWillSlideIn(slide);
96
+ var classNamePrefix = reverse ? 'reverse-' : '';
97
+ transition(currentComponent, "".concat(classNamePrefix).concat(transitionName, "-enter"), _this2.props.delay);
98
+ transition(prevComponent, "".concat(classNamePrefix).concat(transitionName, "-exit"));
99
+ _this2.timeout = setTimeout(function () {
100
+ var _context;
101
+ _this2.setState({
102
+ children: {
103
+ current: _this2.state.children.current
104
+ },
105
+ transitionName: _this2.props.transitionName
106
+ });
107
+ currentComponent.componentDidSlideIn((_context = _this2.props).onDidAppear.bind(_context));
108
+ _this2.props.onDidSlide();
109
+ _this2.timeout = null;
110
+ }, _this2.props.delay);
111
+ };
112
+ this.props.onWillSlide();
113
+ prevComponent.componentWillSlideOut(callback);
114
+ }
120
115
  }
121
- };
122
-
123
- Slider.prototype.componentWillUnmount = function componentWillUnmount() {
124
- if (this.timeout) clearTimeout(this.timeout);
125
- };
126
-
127
- Slider.prototype.render = function render() {
128
- var _state$children2 = this.state.children,
129
- current = _state$children2.current,
130
- prev = _state$children2.prev;
131
-
132
- var children = prev ? [current, prev] : [current];
133
- var childrenToRender = children.map(function (child) {
134
- return _react2.default.cloneElement(_react2.default.createElement(Child, {}, child), {
135
- ref: child.key,
136
- key: child.key
116
+ }, {
117
+ key: "componentWillUnmount",
118
+ value: function componentWillUnmount() {
119
+ if (this.timeout) clearTimeout(this.timeout);
120
+ }
121
+ }, {
122
+ key: "render",
123
+ value: function render() {
124
+ var _this$state$children2 = this.state.children,
125
+ current = _this$state$children2.current,
126
+ prev = _this$state$children2.prev;
127
+ var children = prev ? [current, prev] : [current];
128
+ var childrenToRender = children.map(function (child) {
129
+ return /*#__PURE__*/_react.default.cloneElement( /*#__PURE__*/_react.default.createElement(Child, {}, child), {
130
+ ref: child.key,
131
+ key: child.key
132
+ });
137
133
  });
138
- });
139
-
140
- return _react2.default.createElement(this.props.component, {}, childrenToRender);
141
- };
142
-
134
+ return /*#__PURE__*/_react.default.createElement(this.props.component, {}, childrenToRender);
135
+ }
136
+ }]);
143
137
  return Slider;
144
- }(_react2.default.Component);
145
-
138
+ }(_react.default.Component);
146
139
  exports.default = Slider;
147
-
148
-
149
140
  Slider.propTypes = {
150
- children: _propTypes2.default.node.isRequired,
151
- component: _propTypes2.default.string,
152
- delay: _propTypes2.default.number.isRequired,
153
- onDidAppear: _propTypes2.default.func.isRequired,
154
- onDidSlide: _propTypes2.default.func.isRequired,
155
- onWillSlide: _propTypes2.default.func.isRequired,
156
- reverse: _propTypes2.default.bool.isRequired,
157
- transitionName: _propTypes2.default.string.isRequired
141
+ children: _propTypes.default.node.isRequired,
142
+ component: _propTypes.default.string,
143
+ delay: _propTypes.default.number.isRequired,
144
+ onDidAppear: _propTypes.default.func.isRequired,
145
+ onDidSlide: _propTypes.default.func.isRequired,
146
+ onWillSlide: _propTypes.default.func.isRequired,
147
+ reverse: _propTypes.default.bool.isRequired,
148
+ transitionName: _propTypes.default.string.isRequired
158
149
  };
159
-
160
150
  Slider.defaultProps = {
161
151
  component: 'span',
162
152
  onDidAppear: function onDidAppear() {},
@@ -164,101 +154,115 @@ Slider.defaultProps = {
164
154
  onWillSlide: function onWillSlide() {},
165
155
  reverse: false
166
156
  };
167
-
168
- var Child = function (_React$Component2) {
157
+ var Child = /*#__PURE__*/function (_React$Component2) {
169
158
  _inherits(Child, _React$Component2);
170
-
159
+ var _super2 = _createSuper(Child);
171
160
  function Child(props) {
161
+ var _this3;
172
162
  _classCallCheck(this, Child);
173
-
174
- var _this3 = _possibleConstructorReturn(this, _React$Component2.call(this, props));
175
-
176
- _this3.state = { height: '', originalHeight: '', show: true };
163
+ _this3 = _super2.call(this, props);
164
+ _defineProperty(_assertThisInitialized(_this3), "node", void 0);
165
+ _this3.state = {
166
+ height: '',
167
+ originalHeight: '',
168
+ show: true
169
+ };
177
170
  return _this3;
178
171
  }
179
-
180
- Child.prototype.componentWillSlideIn = function componentWillSlideIn(slide) {
181
- this.setState({
182
- height: slide.height,
183
- originalHeight: parseInt(window.getComputedStyle(this.node, null).height, 10),
184
- show: false
185
- });
186
- };
187
-
188
- Child.prototype.componentDidSlideIn = function componentDidSlideIn(cb) {
189
- var _this4 = this;
190
-
191
- var _state = this.state,
192
- height = _state.height,
193
- originalHeight = _state.originalHeight;
194
-
195
-
196
- if (height === originalHeight) {
197
- this.setState({ show: true, height: '' });
198
- cb();
199
- } else {
200
- this.cb = cb;
201
- var frames = 10;
202
- var count = 0;
203
- var current = height;
204
- var last = originalHeight;
205
- var step = Math.abs(current - last) / frames;
206
- var dir = current < last ? 1 : -1;
207
- var dh = step * dir;
208
-
209
- // TODO: rAF
210
- this.t = setInterval(function () {
211
- if (count < frames - 1) {
212
- _this4.setState({ height: current, animating: true });
213
- current += dh;
214
- count++;
215
- } else {
216
- clearInterval(_this4.t);
217
- delete _this4.t;
218
- _this4.setState({ height: '', show: true });
219
- _this4.cb();
220
- }
221
- }, 17);
172
+ _createClass(Child, [{
173
+ key: "componentWillSlideIn",
174
+ value: function componentWillSlideIn(slide) {
175
+ this.setState({
176
+ height: slide.height,
177
+ originalHeight: parseInt(window.getComputedStyle(this.node, null).height, 10),
178
+ show: false
179
+ });
222
180
  }
223
- };
224
-
225
- Child.prototype.componentWillSlideOut = function componentWillSlideOut(cb) {
226
- var size = window.getComputedStyle(this.node, null).height;
227
- cb({ height: parseInt(size, 10), reverse: this.reverse });
228
- };
229
-
230
- Child.prototype.componentWillUnmount = function componentWillUnmount() {
231
- if (this.t) {
232
- clearInterval(this.t);
233
- this.cb();
181
+ }, {
182
+ key: "componentDidSlideIn",
183
+ value: function componentDidSlideIn(cb) {
184
+ var _this4 = this;
185
+ var _this$state = this.state,
186
+ height = _this$state.height,
187
+ originalHeight = _this$state.originalHeight;
188
+ if (height === originalHeight) {
189
+ this.setState({
190
+ show: true,
191
+ height: ''
192
+ });
193
+ cb();
194
+ } else {
195
+ this.cb = cb;
196
+ var frames = 10;
197
+ var count = 0;
198
+ var current = height;
199
+ var last = originalHeight;
200
+ var step = Math.abs(current - last) / frames;
201
+ var dir = current < last ? 1 : -1;
202
+ var dh = step * dir;
203
+
204
+ // TODO: rAF
205
+ this.t = setInterval(function () {
206
+ if (count < frames - 1) {
207
+ _this4.setState({
208
+ height: current,
209
+ animating: true
210
+ });
211
+ current += dh;
212
+ count++;
213
+ } else {
214
+ clearInterval(_this4.t);
215
+ delete _this4.t;
216
+ _this4.setState({
217
+ height: '',
218
+ show: true
219
+ });
220
+ _this4.cb();
221
+ }
222
+ }, 17);
223
+ }
234
224
  }
235
- };
236
-
237
- Child.prototype.render = function render() {
238
- var _this5 = this;
239
-
240
- var children = this.props.children;
241
- var _state2 = this.state,
242
- height = _state2.height,
243
- show = _state2.show;
244
-
245
-
246
- return _react2.default.createElement(
247
- 'div',
248
- { ref: function ref(node) {
225
+ }, {
226
+ key: "componentWillSlideOut",
227
+ value: function componentWillSlideOut(cb) {
228
+ var size = window.getComputedStyle(this.node, null).height;
229
+ cb({
230
+ height: parseInt(size, 10),
231
+ reverse: this.reverse
232
+ });
233
+ }
234
+ }, {
235
+ key: "componentWillUnmount",
236
+ value: function componentWillUnmount() {
237
+ if (this.t) {
238
+ clearInterval(this.t);
239
+ this.cb();
240
+ }
241
+ }
242
+ }, {
243
+ key: "render",
244
+ value: function render() {
245
+ var _this5 = this;
246
+ var children = this.props.children;
247
+ var _this$state2 = this.state,
248
+ height = _this$state2.height,
249
+ show = _this$state2.show;
250
+ return /*#__PURE__*/_react.default.createElement("div", {
251
+ ref: function ref(node) {
249
252
  return _this5.node = node;
250
- }, style: height ? { height: height + 'px' } : {} },
251
- _react2.default.createElement(
252
- 'div',
253
- { style: { visibility: show ? 'inherit' : 'hidden' } },
254
- children
255
- )
256
- );
257
- };
258
-
253
+ },
254
+ style: height ? {
255
+ height: height + 'px'
256
+ } : {}
257
+ }, /*#__PURE__*/_react.default.createElement("div", {
258
+ style: {
259
+ visibility: show ? 'inherit' : 'hidden'
260
+ }
261
+ }, children));
262
+ }
263
+ }]);
259
264
  return Child;
260
- }(_react2.default.Component);
261
-
265
+ }(_react.default.Component);
262
266
  Child.propTypes = {
263
- children: _propTypes2.default.node.isRequired
267
+ children: _propTypes.default.node.isRequired
264
268
  };
@@ -1,40 +1,37 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6
-
7
- var _react = require('react');
8
-
9
- var _react2 = _interopRequireDefault(_react);
10
-
11
- var _confirmation_pane = require('./confirmation_pane');
12
-
13
- var _confirmation_pane2 = _interopRequireDefault(_confirmation_pane);
14
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _confirmation_pane = _interopRequireDefault(require("./confirmation_pane"));
15
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
17
- var svg = _react2.default.createElement(
18
- 'svg',
19
- {
20
- focusable: 'false',
21
- width: '56px',
22
- height: '56px',
23
- viewBox: '0 0 52 52',
24
- version: '1.1',
25
- xmlns: 'http://www.w3.org/2000/svg',
26
- xmlnsXlink: 'http://www.w3.org/1999/xlink',
27
- className: 'checkmark'
28
- },
29
- ' ',
30
- _react2.default.createElement('circle', { cx: '26', cy: '26', r: '25', fill: 'none', className: 'checkmark__circle' }),
31
- ' ',
32
- _react2.default.createElement('path', { fill: 'none', d: 'M14.1 27.2l7.1 7.2 16.7-16.8', className: 'checkmark__check' }),
33
- ' '
34
- );
35
-
10
+ 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); }
11
+ var svg = /*#__PURE__*/_react.default.createElement("svg", {
12
+ focusable: "false",
13
+ width: "56px",
14
+ height: "56px",
15
+ viewBox: "0 0 52 52",
16
+ version: "1.1",
17
+ xmlns: "http://www.w3.org/2000/svg",
18
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
19
+ className: "checkmark"
20
+ }, ' ', /*#__PURE__*/_react.default.createElement("circle", {
21
+ cx: "26",
22
+ cy: "26",
23
+ r: "25",
24
+ fill: "none",
25
+ className: "checkmark__circle"
26
+ }), ' ', /*#__PURE__*/_react.default.createElement("path", {
27
+ fill: "none",
28
+ d: "M14.1 27.2l7.1 7.2 16.7-16.8",
29
+ className: "checkmark__check"
30
+ }), ' ');
36
31
  var SuccessPane = function SuccessPane(props) {
37
- return _react2.default.createElement(_confirmation_pane2.default, _extends({ svg: svg }, props));
32
+ return /*#__PURE__*/_react.default.createElement(_confirmation_pane.default, _extends({
33
+ svg: svg
34
+ }, props));
38
35
  };
39
-
40
- exports.default = SuccessPane;
36
+ var _default = SuccessPane;
37
+ exports.default = _default;