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.
Files changed (241) hide show
  1. package/.browserslistrc +1 -0
  2. package/.circleci/config.yml +4 -2
  3. package/.eslintrc.json +5 -5
  4. package/.github/workflows/codeql.yml +41 -0
  5. package/.shiprc +4 -5
  6. package/CHANGELOG.md +32 -0
  7. package/EXAMPLES.md +626 -0
  8. package/README.md +77 -649
  9. package/karma.conf.js +1 -1
  10. package/lib/CSSCore.js +1 -4
  11. package/lib/__tests__/auth_button.js +12 -22
  12. package/lib/__tests__/connection/database/actions.js +48 -49
  13. package/lib/__tests__/connection/database/index.js +22 -28
  14. package/lib/__tests__/connection/database/login_pane.js +20 -41
  15. package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
  16. package/lib/__tests__/connection/database/reset_password.js +17 -39
  17. package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
  18. package/lib/__tests__/connection/enterprise/actions.js +22 -47
  19. package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
  20. package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
  21. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
  22. package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
  23. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
  24. package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
  25. package/lib/__tests__/core/actions.js +23 -46
  26. package/lib/__tests__/core/client/index.js +10 -13
  27. package/lib/__tests__/core/index.js +46 -94
  28. package/lib/__tests__/core/remote_data.js +14 -20
  29. package/lib/__tests__/core/signed_in_confirmation.js +19 -26
  30. package/lib/__tests__/core/sso/last_login_screen.js +27 -50
  31. package/lib/__tests__/core/tenant.js +10 -12
  32. package/lib/__tests__/core/web_api/helper.js +6 -14
  33. package/lib/__tests__/core/web_api/p2_api.js +38 -33
  34. package/lib/__tests__/core/web_api.js +37 -33
  35. package/lib/__tests__/engine/classic/login.js +20 -41
  36. package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
  37. package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
  38. package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
  39. package/lib/__tests__/engine/classic.js +13 -6
  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 +19 -36
  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 +14 -32
  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 -62
  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 +152 -301
  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 +28 -48
  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 +24 -30
  115. package/lib/core/web_api/p2_api.js +156 -165
  116. package/lib/core/web_api.js +101 -90
  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 +71 -106
  124. package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
  125. package/lib/engine/passwordless.js +75 -104
  126. package/lib/field/actions.js +11 -17
  127. package/lib/field/captcha/captcha_pane.js +82 -102
  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 +51 -88
  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/opslevel.yml +6 -0
  240. package/package.json +53 -38
  241. package/webpack.config.js +36 -3
@@ -1,91 +1,66 @@
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 _auth_button = require('../button/auth_button');
14
-
15
- var _auth_button2 = _interopRequireDefault(_auth_button);
16
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _propTypes = _interopRequireDefault(require("prop-types"));
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _auth_button = _interopRequireDefault(require("../button/auth_button"));
17
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
19
11
  var QuickAuthPane = function QuickAuthPane(props) {
20
12
  var alternativeLabel = props.alternativeLabel,
21
- alternativeClickHandler = props.alternativeClickHandler,
22
- buttonLabel = props.buttonLabel,
23
- buttonClickHandler = props.buttonClickHandler,
24
- header = props.header,
25
- strategy = props.strategy,
26
- buttonIcon = props.buttonIcon,
27
- primaryColor = props.primaryColor,
28
- foregroundColor = props.foregroundColor;
29
-
30
-
31
- var alternative = alternativeLabel ? _react2.default.createElement(
32
- 'p',
33
- { className: 'auth0-lock-alternative' },
34
- _react2.default.createElement(
35
- 'a',
36
- {
37
- className: 'auth0-lock-alternative-link',
38
- href: '#',
39
- onClick: function onClick(e) {
40
- e.preventDefault();
41
- alternativeClickHandler(e);
42
- }
43
- },
44
- alternativeLabel
45
- )
46
- ) : null;
47
-
48
- return _react2.default.createElement(
49
- 'div',
50
- { className: 'auth0-lock-last-login-pane' },
51
- header,
52
- _react2.default.createElement(_auth_button2.default, {
53
- label: buttonLabel,
54
- onClick: function onClick(e) {
55
- e.preventDefault();
56
- buttonClickHandler(e);
57
- },
58
- strategy: strategy,
59
- primaryColor: primaryColor,
60
- foregroundColor: foregroundColor,
61
- icon: buttonIcon
62
- }),
63
- alternative,
64
- _react2.default.createElement(
65
- 'div',
66
- { className: 'auth0-loading-container' },
67
- _react2.default.createElement('div', { className: 'auth0-loading' })
68
- )
69
- );
13
+ alternativeClickHandler = props.alternativeClickHandler,
14
+ buttonLabel = props.buttonLabel,
15
+ buttonClickHandler = props.buttonClickHandler,
16
+ header = props.header,
17
+ strategy = props.strategy,
18
+ buttonIcon = props.buttonIcon,
19
+ primaryColor = props.primaryColor,
20
+ foregroundColor = props.foregroundColor;
21
+ var alternative = alternativeLabel ? /*#__PURE__*/_react.default.createElement("p", {
22
+ className: "auth0-lock-alternative"
23
+ }, /*#__PURE__*/_react.default.createElement("a", {
24
+ className: "auth0-lock-alternative-link",
25
+ href: "#",
26
+ onClick: function onClick(e) {
27
+ e.preventDefault();
28
+ alternativeClickHandler(e);
29
+ }
30
+ }, alternativeLabel)) : null;
31
+ return /*#__PURE__*/_react.default.createElement("div", {
32
+ className: "auth0-lock-last-login-pane"
33
+ }, header, /*#__PURE__*/_react.default.createElement(_auth_button.default, {
34
+ label: buttonLabel,
35
+ onClick: function onClick(e) {
36
+ e.preventDefault();
37
+ buttonClickHandler(e);
38
+ },
39
+ strategy: strategy,
40
+ primaryColor: primaryColor,
41
+ foregroundColor: foregroundColor,
42
+ icon: buttonIcon
43
+ }), alternative, /*#__PURE__*/_react.default.createElement("div", {
44
+ className: "auth0-loading-container"
45
+ }, /*#__PURE__*/_react.default.createElement("div", {
46
+ className: "auth0-loading"
47
+ })));
70
48
  };
71
-
72
49
  QuickAuthPane.propTypes = {
73
- alternativeLabel: _propTypes2.default.string,
50
+ alternativeLabel: _propTypes.default.string,
74
51
  alternativeClickHandler: function alternativeClickHandler(props, propName, component) {
75
- for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
76
- rest[_key - 3] = arguments[_key];
77
- }
78
-
79
52
  if (props.alternativeLabel !== undefined) {
80
53
  var _PropTypes$func;
81
-
82
- return (_PropTypes$func = _propTypes2.default.func).isRequired.apply(_PropTypes$func, [props, propName, component].concat(rest));
54
+ for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
55
+ rest[_key - 3] = arguments[_key];
56
+ }
57
+ return (_PropTypes$func = _propTypes.default.func).isRequired.apply(_PropTypes$func, [props, propName, component].concat(rest));
83
58
  }
84
59
  },
85
- buttonLabel: _propTypes2.default.string.isRequired,
86
- buttonClickHandler: _propTypes2.default.func.isRequired,
87
- header: _propTypes2.default.element,
88
- strategy: _propTypes2.default.string.isRequired
60
+ buttonLabel: _propTypes.default.string.isRequired,
61
+ buttonClickHandler: _propTypes.default.func.isRequired,
62
+ header: _propTypes.default.element,
63
+ strategy: _propTypes.default.string.isRequired
89
64
  };
90
-
91
- exports.default = QuickAuthPane;
65
+ var _default = QuickAuthPane;
66
+ exports.default = _default;
package/lib/utils/atom.js CHANGED
@@ -1,64 +1,71 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.default = atom;
5
-
7
+ 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); }
6
8
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
-
8
- var Atom = function () {
9
+ 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); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ 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); }
13
+ var Atom = /*#__PURE__*/function () {
9
14
  function Atom(state) {
10
15
  _classCallCheck(this, Atom);
11
-
12
16
  this.state = state;
13
17
  this.watches = {};
14
18
  }
15
-
16
- Atom.prototype.reset = function reset(state) {
17
- return this._change(state);
18
- };
19
-
20
- Atom.prototype.swap = function swap(f) {
21
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
22
- args[_key - 1] = arguments[_key];
19
+ _createClass(Atom, [{
20
+ key: "reset",
21
+ value: function reset(state) {
22
+ return this._change(state);
23
23
  }
24
-
25
- return this._change(f.apply(undefined, [this.state].concat(args)));
26
- };
27
-
28
- Atom.prototype.deref = function deref() {
29
- return this.state;
30
- };
31
-
32
- Atom.prototype.addWatch = function addWatch(k, f) {
33
- // if (this.watches[key]) {
34
- // console.warn(`adding a watch with an already registered key: ${k}`);
35
- // }
36
- this.watches[k] = f;
37
- return this;
38
- };
39
-
40
- Atom.prototype.removeWatch = function removeWatch(k) {
41
- // if (!this.watches[key]) {
42
- // console.warn(`removing a watch with an unknown key: ${k}`);
43
- // }
44
- delete this.watches[k];
45
- return this;
46
- };
47
-
48
- Atom.prototype._change = function _change(newState) {
49
- var state = this.state,
24
+ }, {
25
+ key: "swap",
26
+ value: function swap(f) {
27
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
28
+ args[_key - 1] = arguments[_key];
29
+ }
30
+ return this._change(f.apply(void 0, [this.state].concat(args)));
31
+ }
32
+ }, {
33
+ key: "deref",
34
+ value: function deref() {
35
+ return this.state;
36
+ }
37
+ }, {
38
+ key: "addWatch",
39
+ value: function addWatch(k, f) {
40
+ // if (this.watches[key]) {
41
+ // console.warn(`adding a watch with an already registered key: ${k}`);
42
+ // }
43
+ this.watches[k] = f;
44
+ return this;
45
+ }
46
+ }, {
47
+ key: "removeWatch",
48
+ value: function removeWatch(k) {
49
+ // if (!this.watches[key]) {
50
+ // console.warn(`removing a watch with an unknown key: ${k}`);
51
+ // }
52
+ delete this.watches[k];
53
+ return this;
54
+ }
55
+ }, {
56
+ key: "_change",
57
+ value: function _change(newState) {
58
+ var state = this.state,
50
59
  watches = this.watches;
51
-
52
- this.state = newState;
53
- Object.keys(watches).forEach(function (k) {
54
- return watches[k](k, state, newState);
55
- });
56
- return this.state;
57
- };
58
-
60
+ this.state = newState;
61
+ Object.keys(watches).forEach(function (k) {
62
+ return watches[k](k, state, newState);
63
+ });
64
+ return this.state;
65
+ }
66
+ }]);
59
67
  return Atom;
60
68
  }();
61
-
62
69
  function atom(state) {
63
70
  return new Atom(state);
64
71
  }
@@ -1,57 +1,68 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
4
-
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ 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); }
8
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
-
7
- var Cache = function () {
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
+ var Cache = /*#__PURE__*/function () {
8
20
  function Cache(fetchFn) {
9
21
  _classCallCheck(this, Cache);
10
-
11
22
  this.cache = {};
12
23
  this.cbs = {};
13
24
  this.fetchFn = fetchFn;
14
25
  }
15
-
16
- Cache.prototype.get = function get() {
17
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
18
- args[_key] = arguments[_key];
26
+ _createClass(Cache, [{
27
+ key: "get",
28
+ value: function get() {
29
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
30
+ args[_key] = arguments[_key];
31
+ }
32
+ var cb = args.pop();
33
+ var key = JSON.stringify(args);
34
+ if (this.cache[key]) return cb(null, this.cache[key]);
35
+ if (this.registerCallback(key, cb) > 1) return;
36
+ this.fetch(key, args);
19
37
  }
20
-
21
- var cb = args.pop();
22
- var key = JSON.stringify(args);
23
- if (this.cache[key]) return cb(null, this.cache[key]);
24
- if (this.registerCallback(key, cb) > 1) return;
25
- this.fetch(key, args);
26
- };
27
-
28
- Cache.prototype.fetch = function fetch(key, args) {
29
- var _this = this;
30
-
31
- this.fetchFn.apply(this, args.concat([function (error, result) {
32
- if (!error) _this.cache[key] = result;
33
- _this.execCallbacks(key, error, result);
34
- }]));
35
- };
36
-
37
- Cache.prototype.registerCallback = function registerCallback(key, cb) {
38
- this.cbs[key] = this.cbs[key] || [];
39
- this.cbs[key].push(cb);
40
- return this.cbs[key].length;
41
- };
42
-
43
- Cache.prototype.execCallbacks = function execCallbacks(key) {
44
- for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
45
- args[_key2 - 1] = arguments[_key2];
38
+ }, {
39
+ key: "fetch",
40
+ value: function fetch(key, args) {
41
+ var _this = this;
42
+ this.fetchFn.apply(this, _toConsumableArray(args).concat([function (error, result) {
43
+ if (!error) _this.cache[key] = result;
44
+ _this.execCallbacks(key, error, result);
45
+ }]));
46
46
  }
47
-
48
- if (this.cbs[key]) this.cbs[key].forEach(function (f) {
49
- return f.apply(undefined, args);
50
- });
51
- delete this.cbs[key];
52
- };
53
-
47
+ }, {
48
+ key: "registerCallback",
49
+ value: function registerCallback(key, cb) {
50
+ this.cbs[key] = this.cbs[key] || [];
51
+ this.cbs[key].push(cb);
52
+ return this.cbs[key].length;
53
+ }
54
+ }, {
55
+ key: "execCallbacks",
56
+ value: function execCallbacks(key) {
57
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
58
+ args[_key2 - 1] = arguments[_key2];
59
+ }
60
+ if (this.cbs[key]) this.cbs[key].forEach(function (f) {
61
+ return f.apply(void 0, args);
62
+ });
63
+ delete this.cbs[key];
64
+ }
65
+ }]);
54
66
  return Cache;
55
67
  }();
56
-
57
68
  exports.default = Cache;
@@ -1,35 +1,27 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.load = load;
5
7
  exports.preload = preload;
6
-
7
- var _auth0Js = require('auth0-js');
8
-
9
- var _auth0Js2 = _interopRequireDefault(_auth0Js);
10
-
8
+ var _auth0Js = _interopRequireDefault(require("auth0-js"));
11
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
10
  if (typeof window !== 'undefined' && !window.Auth0) {
14
11
  window.Auth0 = {};
15
12
  }
16
-
17
13
  var cbs = {};
18
-
19
14
  function load(attrs) {
20
15
  var cb = attrs.cb,
21
- check = attrs.check,
22
- method = attrs.method,
23
- url = attrs.url;
24
-
25
-
16
+ check = attrs.check,
17
+ method = attrs.method,
18
+ url = attrs.url;
26
19
  if (!cbs[method]) {
27
20
  cbs[method] = [];
28
21
  window.Auth0[method] = function () {
29
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
22
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
30
23
  args[_key] = arguments[_key];
31
24
  }
32
-
33
25
  cbs[method] = cbs[method].filter(function (x) {
34
26
  if (x.check.apply(x, args)) {
35
27
  setTimeout(function () {
@@ -42,19 +34,18 @@ function load(attrs) {
42
34
  });
43
35
  };
44
36
  }
45
-
46
- cbs[method].push({ cb: cb, check: check, url: url });
47
-
37
+ cbs[method].push({
38
+ cb: cb,
39
+ check: check,
40
+ url: url
41
+ });
48
42
  var count = cbs[method].reduce(function (r, x) {
49
43
  return r + (x.url === url ? 1 : 0);
50
44
  }, 0);
51
-
52
45
  if (count > 1) return;
53
-
54
46
  var script = window.document.createElement('script');
55
47
  script.src = url;
56
48
  window.document.getElementsByTagName('head')[0].appendChild(script);
57
-
58
49
  var handleError = function handleError(err) {
59
50
  cbs[method] = cbs[method].filter(function (x) {
60
51
  if (x.url === url) {
@@ -67,24 +58,19 @@ function load(attrs) {
67
58
  }
68
59
  });
69
60
  };
70
-
71
61
  var timeoutID = setTimeout(function () {
72
- return handleError(new Error(url + ' timed out'));
62
+ return handleError(new Error("".concat(url, " timed out")));
73
63
  }, 20000);
74
-
75
64
  script.addEventListener('load', function () {
76
65
  return clearTimeout(timeoutID);
77
66
  });
78
-
79
67
  script.addEventListener('error', function () {
80
68
  clearTimeout(timeoutID);
81
- handleError(new Error(url + ' could not be loaded.'));
69
+ handleError(new Error("".concat(url, " could not be loaded.")));
82
70
  });
83
71
  }
84
-
85
72
  function preload(_ref) {
86
73
  var method = _ref.method,
87
- cb = _ref.cb;
88
-
74
+ cb = _ref.cb;
89
75
  window.Auth0[method] = cb;
90
76
  }
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.createRef = createRef;
5
7
  /**
6
8
  * This is similar to React.createRef(),
@@ -1,40 +1,32 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1
+ "use strict";
6
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
7
6
  exports.dataFns = dataFns;
8
-
9
- var _immutable = require('immutable');
10
-
7
+ var _immutable = require("immutable");
8
+ 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); }
11
9
  function dataFns(baseNSKeyPath) {
12
10
  function keyPath(nsKeyPath, keyOrKeyPath) {
13
- return nsKeyPath.concat((typeof keyOrKeyPath === 'undefined' ? 'undefined' : _typeof(keyOrKeyPath)) === 'object' ? keyOrKeyPath : [keyOrKeyPath]);
11
+ return nsKeyPath.concat(_typeof(keyOrKeyPath) === 'object' ? keyOrKeyPath : [keyOrKeyPath]);
14
12
  }
15
-
16
13
  function getFn(nsKeyPath) {
17
14
  return function (m, keyOrKeyPath) {
18
15
  var notSetValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
19
-
20
16
  return m.getIn(keyPath(nsKeyPath, keyOrKeyPath), notSetValue);
21
17
  };
22
18
  }
23
-
24
19
  function setFn(nsKeyPath) {
25
20
  return function (m, keyOrKeyPath, value) {
26
21
  return m.setIn(keyPath(nsKeyPath, keyOrKeyPath), value);
27
22
  };
28
23
  }
29
-
30
24
  function removeFn(nsKeyPath) {
31
25
  return function (m, keyOrKeyPath) {
32
26
  return m.removeIn(keyPath(nsKeyPath, keyOrKeyPath));
33
27
  };
34
28
  }
35
-
36
29
  var transientNSKeyPath = baseNSKeyPath.concat(['transient']);
37
-
38
30
  return {
39
31
  get: getFn(baseNSKeyPath),
40
32
  set: setFn(baseNSKeyPath),
@@ -48,7 +40,9 @@ function dataFns(baseNSKeyPath) {
48
40
  });
49
41
  },
50
42
  init: function init(id, m) {
51
- return new _immutable.Map({ id: id }).setIn(baseNSKeyPath, m);
43
+ return new _immutable.Map({
44
+ id: id
45
+ }).setIn(baseNSKeyPath, m);
52
46
  },
53
47
  initNS: function initNS(m, ns) {
54
48
  return m.setIn(baseNSKeyPath, ns);
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.debounce = debounce;
5
7
  function debounce(f, delay) {
6
- var t = void 0;
8
+ var t;
7
9
  return function () {
8
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
10
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9
11
  args[_key] = arguments[_key];
10
12
  }
11
-
12
13
  function handler() {
13
14
  clearTimeout(t);
14
15
  f.apply(undefined, args);
@@ -1,16 +1,15 @@
1
- 'use strict';
2
-
3
- exports.__esModule = true;
4
-
5
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1
+ "use strict";
6
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
7
6
  exports.default = format;
7
+ 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); }
8
8
  // Code attribution
9
9
  // Inlined and modified from https://github.com/browserify/node-util/blob/e37ce41f4063bcd7bc27e01470d6654053bdcd14/util.js#L33-L69
10
10
  // Copyright Joyent, Inc. and other Node contributors.
11
11
  // Please see LICENSE for full copyright and license attribution.
12
12
  var formatRegExp = /%[sdj%]/g;
13
-
14
13
  function format(f) {
15
14
  var i = 1;
16
15
  var args = arguments;
@@ -42,7 +41,6 @@ function format(f) {
42
41
  }
43
42
  return str;
44
43
  }
45
-
46
44
  function isObject(arg) {
47
- return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null;
45
+ return _typeof(arg) === 'object' && arg !== null;
48
46
  }
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
4
- exports.random = random;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
5
6
  exports.incremental = incremental;
7
+ exports.random = random;
6
8
  function random() {
7
9
  return (+new Date() + Math.floor(Math.random() * 10000000)).toString(36);
8
10
  }
9
-
10
11
  var start = 1;
11
12
  function incremental() {
12
13
  return start++;