@vve/react-router 8.4.0 → 9.0.0-alpha.10

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.
@@ -1,45 +1,16 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
- 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); }; }
8
-
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
1
  import React from 'react';
12
2
  import PropTypes from 'prop-types';
13
-
14
- var Deactivatable = /*#__PURE__*/function (_React$Component) {
15
- _inherits(Deactivatable, _React$Component);
16
-
17
- var _super = _createSuper(Deactivatable);
18
-
19
- function Deactivatable() {
20
- _classCallCheck(this, Deactivatable);
21
-
22
- return _super.apply(this, arguments);
3
+ export default class Deactivatable extends React.Component {
4
+ shouldComponentUpdate(nextProps) {
5
+ return this.props.active || nextProps.active;
23
6
  }
24
-
25
- _createClass(Deactivatable, [{
26
- key: "shouldComponentUpdate",
27
- value: function shouldComponentUpdate(nextProps) {
28
- return this.props.active || nextProps.active;
29
- }
30
- }, {
31
- key: "render",
32
- value: function render() {
33
- var children = this.props.children;
34
- return children;
35
- }
36
- }]);
37
-
38
- return Deactivatable;
39
- }(React.Component);
40
-
41
- export { Deactivatable as default };
7
+ render() {
8
+ var children = this.props.children;
9
+ return children;
10
+ }
11
+ }
42
12
  Deactivatable.propTypes = {
43
13
  active: PropTypes.bool.isRequired,
44
14
  children: PropTypes.element.isRequired
45
- };
15
+ };
16
+ //# sourceMappingURL=deactivatable-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deactivatable-wrapper.js","names":["React","PropTypes","Deactivatable","Component","shouldComponentUpdate","nextProps","props","active","render","children","propTypes","bool","isRequired","element"],"sources":["../deactivatable-wrapper.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Deactivatable extends React.Component {\n shouldComponentUpdate(nextProps) {\n return this.props.active || nextProps.active;\n }\n\n render() {\n const { children } = this.props;\n return children;\n }\n}\n\nDeactivatable.propTypes = {\n active: PropTypes.bool.isRequired,\n children: PropTypes.element.isRequired,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,eAAe,MAAMC,aAAa,SAASF,KAAK,CAACG,SAAS,CAAC;EACzDC,qBAAqBA,CAACC,SAAS,EAAE;IAC/B,OAAO,IAAI,CAACC,KAAK,CAACC,MAAM,IAAIF,SAAS,CAACE,MAAM;EAC9C;EAEAC,MAAMA,CAAA,EAAG;IACP,IAAQC,QAAQ,GAAK,IAAI,CAACH,KAAK,CAAvBG,QAAQ;IAChB,OAAOA,QAAQ;EACjB;AACF;AAEAP,aAAa,CAACQ,SAAS,GAAG;EACxBH,MAAM,EAAEN,SAAS,CAACU,IAAI,CAACC,UAAU;EACjCH,QAAQ,EAAER,SAAS,CAACY,OAAO,CAACD;AAC9B,CAAC"}
package/lib/garden.js CHANGED
@@ -1,96 +1,59 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
-
8
- 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); }; }
9
-
10
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
11
-
12
1
  import PropTypes from 'prop-types';
13
2
  import React from 'react';
14
3
  import { polyfill } from 'react-lifecycles-compat';
15
- import withRouter from './with-router';
16
-
17
- var Garden = /*#__PURE__*/function (_React$Component) {
18
- _inherits(Garden, _React$Component);
19
-
20
- var _super = _createSuper(Garden);
21
-
22
- function Garden(props) {
23
- var _this;
24
-
25
- _classCallCheck(this, Garden);
26
-
27
- _this = _super.call(this, props);
28
- _this.state = {
4
+ import withRouter from "./with-router";
5
+ class Garden extends React.Component {
6
+ constructor(props) {
7
+ super(props);
8
+ this.state = {
29
9
  history: props.history,
30
10
  Component: null
31
11
  };
32
- _this.block = _this.block.bind(_assertThisInitialized(_this));
33
- return _this;
12
+ this.block = this.block.bind(this);
13
+ }
14
+ componentDidMount() {
15
+ var _this$props = this.props,
16
+ history = _this$props.history,
17
+ location = _this$props.location;
18
+ history.block(this.block);
19
+ this.block(location); // init.
34
20
  }
35
21
 
36
- _createClass(Garden, [{
37
- key: "componentDidMount",
38
- value: function componentDidMount() {
39
- var _this$props = this.props,
40
- history = _this$props.history,
41
- location = _this$props.location;
42
- history.block(this.block);
43
- this.block(location); // init.
44
- }
45
- }, {
46
- key: "block",
47
- value: function block(location) {
48
- var watcher = this.props.watcher;
49
- var result = watcher(location, true);
50
- this.setState({
51
- Component: result,
52
- skipDerived: true,
53
- fromLocationChange: true
54
- });
55
- return typeof result === 'function' ? false : result;
56
- }
57
- }, {
58
- key: "render",
59
- value: function render() {
60
- var children = this.props.children;
61
- var _this$state = this.state,
62
- Component = _this$state.Component,
63
- fromLocationChange = _this$state.fromLocationChange;
64
-
65
- if (typeof Component === 'function') {
66
- return /*#__PURE__*/React.createElement(Component, null);
67
- }
68
-
69
- if (!fromLocationChange && Component === false) {
70
- return null;
71
- }
72
-
73
- return children;
74
- }
75
- }], [{
76
- key: "getDerivedStateFromProps",
77
- value: function getDerivedStateFromProps(nextProps, prevState) {
78
- if (prevState.skipDerived) {
79
- return {
80
- skipDerived: false
81
- };
82
- }
83
-
22
+ static getDerivedStateFromProps(nextProps, prevState) {
23
+ if (prevState.skipDerived) {
84
24
  return {
85
- Component: nextProps.watcher(prevState.history.location, false),
86
- fromLocationChange: false
25
+ skipDerived: false
87
26
  };
88
27
  }
89
- }]);
90
-
91
- return Garden;
92
- }(React.Component);
93
-
28
+ return {
29
+ Component: nextProps.watcher(prevState.history.location, false),
30
+ fromLocationChange: false
31
+ };
32
+ }
33
+ block(location) {
34
+ var watcher = this.props.watcher;
35
+ var result = watcher(location, true);
36
+ this.setState({
37
+ Component: result,
38
+ skipDerived: true,
39
+ fromLocationChange: true
40
+ });
41
+ return typeof result === 'function' ? false : result;
42
+ }
43
+ render() {
44
+ var children = this.props.children;
45
+ var _this$state = this.state,
46
+ Component = _this$state.Component,
47
+ fromLocationChange = _this$state.fromLocationChange;
48
+ if (typeof Component === 'function') {
49
+ return /*#__PURE__*/React.createElement(Component, null);
50
+ }
51
+ if (!fromLocationChange && Component === false) {
52
+ return null;
53
+ }
54
+ return children;
55
+ }
56
+ }
94
57
  if (process.env.NODE_ENV !== 'production') {
95
58
  Garden.propTypes = {
96
59
  value: PropTypes.shape({}),
@@ -102,5 +65,5 @@ if (process.env.NODE_ENV !== 'production') {
102
65
  children: PropTypes.element.isRequired
103
66
  };
104
67
  }
105
-
106
- export default withRouter(polyfill(Garden));
68
+ export default withRouter(polyfill(Garden));
69
+ //# sourceMappingURL=garden.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"garden.js","names":["PropTypes","React","polyfill","withRouter","Garden","Component","constructor","props","state","history","block","bind","componentDidMount","_this$props","location","getDerivedStateFromProps","nextProps","prevState","skipDerived","watcher","fromLocationChange","result","setState","render","children","_this$state","createElement","process","env","NODE_ENV","propTypes","value","shape","isRequired","func","element"],"sources":["../garden.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport withRouter from './with-router';\n\nclass Garden extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n history: props.history,\n Component: null,\n };\n\n this.block = this.block.bind(this);\n }\n\n componentDidMount() {\n const { history, location } = this.props;\n history.block(this.block);\n\n this.block(location); // init.\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n if (prevState.skipDerived) {\n return {\n skipDerived: false,\n };\n }\n return {\n Component: nextProps.watcher(prevState.history.location, false),\n fromLocationChange: false,\n };\n }\n\n block(location) {\n const { watcher } = this.props;\n\n const result = watcher(location, true);\n\n this.setState({\n Component: result,\n skipDerived: true,\n fromLocationChange: true,\n });\n\n return typeof result === 'function' ? false : result;\n }\n\n render() {\n const { children } = this.props;\n const { Component, fromLocationChange } = this.state;\n\n if (typeof Component === 'function') {\n return <Component />;\n }\n\n if (!fromLocationChange && Component === false) {\n return null;\n }\n return children;\n }\n}\n\nif (process.env.NODE_ENV !== 'production') {\n Garden.propTypes = {\n value: PropTypes.shape({}),\n location: PropTypes.shape({}).isRequired,\n history: PropTypes.shape({\n block: PropTypes.func.isRequired,\n }).isRequired,\n watcher: PropTypes.func.isRequired,\n children: PropTypes.element.isRequired,\n };\n}\n\nexport default withRouter(polyfill(Garden));\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,OAAO;A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K,GAAGA,MAAM;EACtD;EAEAE,MAAMA,CAAA,EAAG;IACP,IAAQC,QAAQ,GAAK,IAAI,CAACjB,KAAK,CAAvBiB,QAAQ;IAChB,IAAAC,WAAA,GAA0C,IAAI,CAACjB,KAAK;MAA5CH,SAAS,GAAAoB,WAAA,CAATpB,SAAS;MAAEe,kBAAkB,GAAAK,WAAA,CAAlBL,kBAAkB;IAErC,IAAI,OAAOf,SAAS,KAAK,UAAU,EAAE;MACnC,oBAAOJ,KAAA,CAAAyB,aAAA,CAACrB,SAAS,OAAG;IACtB;IAEA,IAAI,CAACe,kBAAkB,IAAIf,SAAS,KAAK,KAAK,EAAE;MAC9C,OAAO,IAAI;IACb;IACA,OAAOmB,QAAQ;EACjB;AACF;AAEA,IAAIG,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;EACzCzB,MAAM,CAAC0B,SAAS,GAAG;IACjBC,KAAK,EAAE/B,SAAS,CAACgC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1BlB,QAAQ,EAAEd,SAAS,CAACgC,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,UAAU;IACxCxB,OAAO,EAAET,SAAS,CAACgC,KAAK,CAAC;MACvBtB,KAAK,EAAEV,SAAS,CAACkC,IAAI,CAACD;IACxB,CAAC,CAAC,CAACA,UAAU;IACbd,OAAO,EAAEnB,SAAS,CAACkC,IAAI,CAACD,UAAU;IAClCT,QAAQ,EAAExB,SAAS,CAACmC,OAAO,CAACF;EAC9B,CAAC;AACH;AAEA,eAAe9B,UAAU,CAACD,QAAQ,CAACE,MAAM,CAAC,CAAC"}
@@ -2,23 +2,19 @@ import pathToRegexp from 'path-to-regexp';
2
2
  var cache = {};
3
3
  var cacheLimit = 10000;
4
4
  var cacheCount = 0;
5
-
6
5
  function compilePath(path) {
7
6
  if (cache[path]) return cache[path];
8
7
  var generator = pathToRegexp.compile(path);
9
-
10
8
  if (cacheCount < cacheLimit) {
11
9
  cache[path] = generator;
12
10
  cacheCount += 1;
13
11
  }
14
-
15
12
  return generator;
16
13
  }
14
+
17
15
  /**
18
16
  * Public API for generating a URL pathname from a path and parameters.
19
17
  */
20
-
21
-
22
18
  function generatePath() {
23
19
  var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/';
24
20
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -26,5 +22,5 @@ function generatePath() {
26
22
  pretty: true
27
23
  });
28
24
  }
29
-
30
- export default generatePath;
25
+ export default generatePath;
26
+ //# sourceMappingURL=generate-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-path.js","names":["pathToRegexp","cache","cacheLimit","cacheCount","compilePath","path","generator","compile","generatePath","arguments","length","undefined","params","pretty"],"sources":["../generate-path.js"],"sourcesContent":["import pathToRegexp from 'path-to-regexp';\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path) {\n if (cache[path]) return cache[path];\n\n const generator = pathToRegexp.compile(path);\n\n if (cacheCount < cacheLimit) {\n cache[path] = generator;\n cacheCount += 1;\n }\n\n return generator;\n}\n\n/**\n * Public API for generating a URL pathname from a path and parameters.\n */\nfunction generatePath(path = '/', params = {}) {\n return path === '/' ? path : compilePath(path)(params, { pretty: true });\n}\n\nexport default generatePath;\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,IAAMC,KAAK,GAAG,CAAC,CAAC;AAChB,IAAMC,UAAU,GAAG,KAAK;AACxB,IAAIC,UAAU,GAAG,CAAC;AAElB,SAASC,WAAWA,CAACC,IAAI,EAAE;EACzB,IAAIJ,KAAK,CAACI,IAAI,CAAC,EAAE,OAAOJ,KAAK,CAACI,IAAI,CAAC;EAEnC,IAAMC,SAAS,GAAGN,YAAY,CAACO,OAAO,CAACF,IAAI,CAAC;EAE5C,IAAIF,UAAU,GAAGD,UAAU,EAAE;IAC3BD,KAAK,CAACI,IAAI,CAAC,GAAGC,SAAS;IACvBH,UAAU,IAAI,CAAC;EACjB;EAEA,OAAOG,SAAS;AAClB;;AAEA;AACA;AACA;AACA,SAASE,YAAYA,CAAA,EAA0B;EAAA,IAAzBH,IAAI,GAAAI,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,GAAG;EAAA,IAAEG,MAAM,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC3C,OAAOJ,IAAI,KAAK,GAAG,GAAGA,IAAI,GAAGD,WAAW,CAACC,IAAI,CAAC,CAACO,MAAM,EAAE;IAAEC,MAAM,EAAE;EAAK,CAAC,CAAC;AAC1E;AAEA,eAAeL,YAAY"}
package/lib/index.js CHANGED
@@ -1,12 +1,14 @@
1
- import Link from './link';
2
- import Redirect from './redirect';
3
- import Route from './route';
4
- import Router from './router';
5
- import Switch from './switch';
6
- import NavLink from './nav-link';
7
- import withRouter from './with-router';
8
- import Prompt from './prompt';
9
- import Garden from './garden'; // @compat react-router-redux
1
+ import Link from "./link";
2
+ import Redirect from "./redirect";
3
+ import Route from "./route";
4
+ import Router from "./router";
5
+ import Switch from "./switch";
6
+ import NavLink from "./nav-link";
7
+ import withRouter from "./with-router";
8
+ import Prompt from "./prompt";
9
+ import Garden from "./garden";
10
10
 
11
+ // @compat react-router-redux
11
12
  var LOCATION_CHANGE = '@@router/LOCATION_CHANGE';
12
- export { Link, Redirect, Route, Router, Switch, NavLink, withRouter, Prompt, Garden, LOCATION_CHANGE };
13
+ export { Link, Redirect, Route, Router, Switch, NavLink, withRouter, Prompt, Garden, LOCATION_CHANGE };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["Link","Redirect","Route","Router","Switch","NavLink","withRouter","Prompt","Garden","LOCATION_CHANGE"],"sources":["../index.js"],"sourcesContent":["import Link from './link';\nimport Redirect from './redirect';\nimport Route from './route';\nimport Router from './router';\nimport Switch from './switch';\nimport NavLink from './nav-link';\nimport withRouter from './with-router';\nimport Prompt from './prompt';\nimport Garden from './garden';\n\n// @compat react-router-redux\nconst LOCATION_CHANGE = '@@router/LOCATION_CHANGE';\n\nexport {\n Link,\n Redirect,\n Route,\n Router,\n Switch,\n NavLink,\n withRouter,\n Prompt,\n Garden,\n LOCATION_CHANGE,\n};\n"],"mappings":"AAAA,OAAOA,IAAI;AACX,OAAOC,QAAQ;AACf,OAAOC,KAAK;AACZ,OAAOC,MAAM;AACb,OAAOC,MAAM;AACb,OAAOC,OAAO;AACd,OAAOC,UAAU;AACjB,OAAOC,MAAM;AACb,OAAOC,MAAM;;AAEb;AACA,IAAMC,eAAe,GAAG,0BAA0B;AAElD,SACET,IAAI,EACJC,QAAQ,EACRC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,MAAM,EACNC,eAAe"}
package/lib/lifecycle.js CHANGED
@@ -1,49 +1,17 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
- 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); }; }
8
-
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
1
  import React from 'react';
12
-
13
- var Lifecycle = /*#__PURE__*/function (_React$Component) {
14
- _inherits(Lifecycle, _React$Component);
15
-
16
- var _super = _createSuper(Lifecycle);
17
-
18
- function Lifecycle() {
19
- _classCallCheck(this, Lifecycle);
20
-
21
- return _super.apply(this, arguments);
2
+ class Lifecycle extends React.Component {
3
+ componentDidMount() {
4
+ if (this.props.onMount) this.props.onMount.call(this, this);
22
5
  }
23
-
24
- _createClass(Lifecycle, [{
25
- key: "componentDidMount",
26
- value: function componentDidMount() {
27
- if (this.props.onMount) this.props.onMount.call(this, this);
28
- }
29
- }, {
30
- key: "componentDidUpdate",
31
- value: function componentDidUpdate(prevProps) {
32
- if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
33
- }
34
- }, {
35
- key: "componentWillUnmount",
36
- value: function componentWillUnmount() {
37
- if (this.props.onUnmount) this.props.onUnmount.call(this, this);
38
- }
39
- }, {
40
- key: "render",
41
- value: function render() {
42
- return null;
43
- }
44
- }]);
45
-
46
- return Lifecycle;
47
- }(React.Component);
48
-
49
- export default Lifecycle;
6
+ componentDidUpdate(prevProps) {
7
+ if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
8
+ }
9
+ componentWillUnmount() {
10
+ if (this.props.onUnmount) this.props.onUnmount.call(this, this);
11
+ }
12
+ render() {
13
+ return null;
14
+ }
15
+ }
16
+ export default Lifecycle;
17
+ //# sourceMappingURL=lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.js","names":["React","Lifecycle","Component","componentDidMount","props","onMount","call","componentDidUpdate","prevProps","onUpdate","componentWillUnmount","onUnmount","render"],"sources":["../lifecycle.js"],"sourcesContent":["import React from 'react';\n\nclass Lifecycle extends React.Component {\n componentDidMount() {\n if (this.props.onMount) this.props.onMount.call(this, this);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);\n }\n\n componentWillUnmount() {\n if (this.props.onUnmount) this.props.onUnmount.call(this, this);\n }\n\n render() {\n return null;\n }\n}\n\nexport default Lifecycle;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,SAAS,SAASD,KAAK,CAACE,SAAS,CAAC;EACtCC,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACC,KAAK,CAACC,OAAO,EAAE,IAAI,CAACD,KAAK,CAACC,OAAO,CAACC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;EAC7D;EAEAC,kBAAkBA,CAACC,SAAS,EAAE;IAC5B,IAAI,IAAI,CAACJ,KAAK,CAACK,QAAQ,EAAE,IAAI,CAACL,KAAK,CAACK,QAAQ,CAACH,IAAI,CAAC,IAAI,EAAE,IAAI,EAAEE,SAAS,CAAC;EAC1E;EAEAE,oBAAoBA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACN,KAAK,CAACO,SAAS,EAAE,IAAI,CAACP,KAAK,CAACO,SAAS,CAACL,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;EACjE;EAEAM,MAAMA,CAAA,EAAG;IACP,OAAO,IAAI;EACb;AACF;AAEA,eAAeX,SAAS"}
package/lib/link.js CHANGED
@@ -1,97 +1,59 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
-
9
- 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); }; }
10
-
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
12
-
3
+ var _excluded = ["innerRef", "replace", "to", "children", "linkExtendable"];
13
4
  import React from 'react';
14
5
  import { createLocation } from 'history';
15
6
  import PropTypes from 'prop-types';
16
- import RouterContext from './router-context';
17
-
7
+ import RouterContext from "./router-context";
18
8
  function isModifiedEvent(event) {
19
9
  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
20
10
  }
11
+
21
12
  /**
22
13
  * The public API for rendering a history-aware <a>.
23
14
  */
24
-
25
-
26
- var Link = /*#__PURE__*/function (_React$Component) {
27
- _inherits(Link, _React$Component);
28
-
29
- var _super = _createSuper(Link);
30
-
31
- function Link() {
32
- _classCallCheck(this, Link);
33
-
34
- return _super.apply(this, arguments);
35
- }
36
-
37
- _createClass(Link, [{
38
- key: "handleClick",
39
- value: function handleClick(event, context, linkExtendable, to) {
40
- var _this$props = this.props,
41
- onClick = _this$props.onClick,
42
- target = _this$props.target,
43
- replace = _this$props.replace;
44
-
45
- if (onClick) {
46
- onClick(event);
47
- }
48
-
49
- var nextUrl = linkExtendable && context.linkExtendable ? context.genNextUrl(to) : to;
50
-
51
- if (!event.defaultPrevented // onClick prevented default
52
- && event.button === 0 // ignore everything but left clicks
53
- && (!target || target === '_self') // let browser handle "target=_blank" etc.
54
- && !isModifiedEvent(event) // ignore clicks with modifier keys
55
- ) {
56
- event.preventDefault();
57
- var method = replace ? context.history.replace : context.history.push;
58
- method(nextUrl);
59
- }
15
+ class Link extends React.Component {
16
+ handleClick(event, context, linkExtendable, to) {
17
+ var _this$props = this.props,
18
+ onClick = _this$props.onClick,
19
+ target = _this$props.target,
20
+ replace = _this$props.replace;
21
+ if (onClick) {
22
+ onClick(event);
60
23
  }
61
- }, {
62
- key: "render",
63
- value: function render() {
64
- var _this = this;
65
-
66
- var _this$props2 = this.props,
67
- innerRef = _this$props2.innerRef,
68
- replace = _this$props2.replace,
69
- to = _this$props2.to,
70
- children = _this$props2.children,
71
- linkExtendable = _this$props2.linkExtendable,
72
- rest = _objectWithoutProperties(_this$props2, ["innerRef", "replace", "to", "children", "linkExtendable"]);
73
-
74
- return /*#__PURE__*/React.createElement(RouterContext.Consumer, null, function (context) {
75
- if (!context) {
76
- throw new Error('You should not use <Link> outside a <Router>');
77
- }
78
-
79
- var location = typeof to === 'string' ? createLocation(to, null, null, context.location) : to;
80
- var href = location ? context.history.createHref(location) : '';
81
- return /*#__PURE__*/React.createElement("a", _extends({}, rest, {
82
- onClick: function onClick(event) {
83
- return _this.handleClick(event, context, linkExtendable, to);
84
- },
85
- href: href,
86
- ref: innerRef
87
- }), children);
88
- });
24
+ var nextUrl = linkExtendable && context.linkExtendable ? context.genNextUrl(to) : to;
25
+ if (!event.defaultPrevented // onClick prevented default
26
+ && event.button === 0 // ignore everything but left clicks
27
+ && (!target || target === '_self') // let browser handle "target=_blank" etc.
28
+ && !isModifiedEvent(event) // ignore clicks with modifier keys
29
+ ) {
30
+ event.preventDefault();
31
+ var method = replace ? context.history.replace : context.history.push;
32
+ method(nextUrl);
89
33
  }
90
- }]);
91
-
92
- return Link;
93
- }(React.Component);
94
-
34
+ }
35
+ render() {
36
+ var _this$props2 = this.props,
37
+ innerRef = _this$props2.innerRef,
38
+ replace = _this$props2.replace,
39
+ to = _this$props2.to,
40
+ children = _this$props2.children,
41
+ linkExtendable = _this$props2.linkExtendable,
42
+ rest = _objectWithoutProperties(_this$props2, _excluded);
43
+ return /*#__PURE__*/React.createElement(RouterContext.Consumer, null, context => {
44
+ if (!context) {
45
+ throw new Error('You should not use <Link> outside a <Router>');
46
+ }
47
+ var location = typeof to === 'string' ? createLocation(to, null, null, context.location) : to;
48
+ var href = location ? context.history.createHref(location) : '';
49
+ return /*#__PURE__*/React.createElement("a", _extends({}, rest, {
50
+ onClick: event => this.handleClick(event, context, linkExtendable, to),
51
+ href: href,
52
+ ref: innerRef
53
+ }), children);
54
+ });
55
+ }
56
+ }
95
57
  Link.defaultProps = {
96
58
  linkExtendable: true
97
59
  };
@@ -107,4 +69,5 @@ Link.propTypes = {
107
69
  to: toType.isRequired,
108
70
  linkExtendable: PropTypes.bool
109
71
  };
110
- export default Link;
72
+ export default Link;
73
+ //# sourceMappingURL=link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.js","names":["React","createLocation","PropTypes","RouterContext","isModifiedEvent","event","metaKey","altKey","ctrlKey","shiftKey","Link","Component","handleClick","context","linkExtendable","to","_this$props","props","onClick","target","replace","nextUrl","genNextUrl","defaultPrevented","button","preventDefault","method","history","push","render","_this$props2","innerRef","children","rest","_objectWithoutProperties","_excluded","createElement","Consumer","Error","location","href","createHref","_extends","ref","defaultProps","toType","oneOfType","string","object","innerRefType","func","shape","current","any","propTypes","bool","isRequired"],"sources":["../link.js"],"sourcesContent":["import React from 'react';\nimport { createLocation } from 'history';\nimport PropTypes from 'prop-types';\n\nimport RouterContext from './router-context';\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nclass Link extends React.Component {\n handleClick(event, context, linkExtendable, to) {\n const { onClick, target, replace } = this.props;\n if (onClick) {\n onClick(event);\n }\n const nextUrl = (linkExtendable && context.linkExtendable) ? context.genNextUrl(to) : to;\n\n if (\n !event.defaultPrevented // onClick prevented default\n && event.button === 0 // ignore everything but left clicks\n && (!target || target === '_self') // let browser handle \"target=_blank\" etc.\n && !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n\n const method = replace ? context.history.replace : context.history.push;\n\n method(nextUrl);\n }\n }\n\n render() {\n const {\n innerRef, replace, to, children, linkExtendable, ...rest\n } = this.props;\n\n return (\n <RouterContext.Consumer>\n {(context) => {\n if (!context) {\n throw new Error('You should not use <Link> outside a <Router>');\n }\n\n const location = typeof to === 'string' ? createLocation(to, null, null, context.location) : to;\n const href = location ? context.history.createHref(location) : '';\n\n return (\n <a {...rest} onClick={event => this.handleClick(event, context, linkExtendable, to)} href={href} ref={innerRef}>\n {children}\n </a>\n );\n }}\n </RouterContext.Consumer>\n );\n }\n}\n\nLink.defaultProps = {\n linkExtendable: true,\n};\n\nconst toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object]);\nconst innerRefType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({ current: PropTypes.any })]);\nLink.propTypes = {\n innerRef: innerRefType,\n onClick: PropTypes.func,\n replace: PropTypes.bool,\n target: PropTypes.string,\n to: toType.isRequired,\n linkExtendable: PropTypes.bool,\n};\n\nexport default Link;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,SAAS;AACxC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,aAAa;AAEpB,SAASC,eAAeA,CAACC,KAAK,EAAE;EAC9B,OAAO,CAAC,EAAEA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACE,MAAM,IAAIF,KAAK,CAACG,OAAO,IAAIH,KAAK,CAACI,QAAQ,CAAC;AAC7E;;AAEA;AACA;AACA;AACA,MAAMC,IAAI,SAASV,KAAK,CAACW,SAAS,CAAC;EACjCC,WAAWA,CAACP,KAAK,EAAEQ,OAAO,EAAEC,cAAc,EAAEC,EAAE,EAAE;IAC9C,IAAAC,WAAA,GAAqC,IAAI,CAACC,KAAK;MAAvCC,OAAO,GAAAF,WAAA,CAAPE,OAAO;MAAEC,MAAM,GAAAH,WAAA,CAANG,MAAM;MAAEC,OAAO,GAAAJ,WAAA,CAAPI,OAAO;IAChC,IAAIF,OAAO,EAAE;MACXA,OAAO,CAACb,KAAK,CAAC;IAChB;IACA,IAAMgB,OAAO,GAAIP,cAAc,IAAID,OAAO,CAACC,cAAc,GAAID,OAAO,CAACS,UAAU,CAACP,EAAE,CAAC,GAAGA,EAAE;IAExF,IACE,CAACV,KA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,IAAI,CAACO,WAAW,CAACP,KAAK,EAAEQ,OAAO,EAAEC,cAAc,EAAEC,EAAE,CAAE;QAACyB,IAAI,EAAEA,IAAK;QAACG,GAAG,EAAEZ;MAAS,IAC5GC,QAAQ,CACP;IAER,CAAC,CACsB;EAE7B;AACF;AAEAtB,IAAI,CAACkC,YAAY,GAAG;EAClB9B,cAAc,EAAE;AAClB,CAAC;AAED,IAAM+B,MAAM,GAAG3C,SAAS,CAAC4C,SAAS,CAAC,CAAC5C,SAAS,CAAC6C,MAAM,EAAE7C,SAAS,CAAC8C,MAAM,CAAC,CAAC;AACxE,IAAMC,YAAY,GAAG/C,SAAS,CAAC4C,SAAS,CAAC,CAAC5C,SAAS,CAAC6C,MAAM,EAAE7C,SAAS,CAACgD,IAAI,EAAEhD,SAAS,CAACiD,KAAK,CAAC;EAAEC,OAAO,EAAElD,SAAS,CAACmD;AAAI,CAAC,CAAC,CAAC,CAAC;AACzH3C,IAAI,CAAC4C,SAAS,GAAG;EACfvB,QAAQ,EAAEkB,YAAY;EACtB/B,OAAO,EAAEhB,SAAS,CAACgD,IAAI;EACvB9B,OAAO,EAAElB,SAAS,CAACqD,IAAI;EACvBpC,MAAM,EAAEjB,SAAS,CAAC6C,MAAM;EACxBhC,EAAE,EAAE8B,MAAM,CAACW,UAAU;EACrB1C,cAAc,EAAEZ,SAAS,CAACqD;AAC5B,CAAC;AAED,eAAe7C,IAAI"}
package/lib/match-path.js CHANGED
@@ -3,62 +3,54 @@ import pathToRegexp from 'path-to-regexp';
3
3
  var cache = {};
4
4
  var cacheLimit = 10000;
5
5
  var cacheCount = 0;
6
-
7
6
  function compilePath(path, options) {
8
- var cacheKey = "".concat(options.end).concat(options.strict).concat(options.sensitive);
7
+ var cacheKey = `${options.end}${options.strict}${options.sensitive}`;
9
8
  var pathCache = cache[cacheKey] || (cache[cacheKey] = {});
10
9
  if (pathCache[path]) return pathCache[path];
11
10
  var keys = [];
12
11
  var regexp = pathToRegexp(path, keys, options);
13
12
  var result = {
14
- regexp: regexp,
15
- keys: keys
13
+ regexp,
14
+ keys
16
15
  };
17
-
18
16
  if (cacheCount < cacheLimit) {
19
17
  pathCache[path] = result;
20
18
  cacheCount += 1;
21
19
  }
22
-
23
20
  return result;
24
21
  }
22
+
25
23
  /**
26
24
  * Public API for matching a URL pathname to a path.
27
25
  */
28
-
29
-
30
26
  function matchPath(pathname) {
31
27
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
32
28
  if (typeof options === 'string') options = {
33
29
  path: options
34
30
  };
35
31
  var _options = options,
36
- path = _options.path,
37
- _options$exact = _options.exact,
38
- exact = _options$exact === void 0 ? false : _options$exact,
39
- _options$strict = _options.strict,
40
- strict = _options$strict === void 0 ? false : _options$strict,
41
- _options$sensitive = _options.sensitive,
42
- sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
32
+ path = _options.path,
33
+ _options$exact = _options.exact,
34
+ exact = _options$exact === void 0 ? false : _options$exact,
35
+ _options$strict = _options.strict,
36
+ strict = _options$strict === void 0 ? false : _options$strict,
37
+ _options$sensitive = _options.sensitive,
38
+ sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
43
39
  var paths = [].concat(path);
44
- return paths.reduce(function (matched, p) {
40
+ return paths.reduce((matched, p) => {
45
41
  if (matched) return matched;
46
-
47
42
  var _compilePath = compilePath(p, {
48
- end: exact,
49
- strict: strict,
50
- sensitive: sensitive
51
- }),
52
- regexp = _compilePath.regexp,
53
- keys = _compilePath.keys;
54
-
43
+ end: exact,
44
+ strict,
45
+ sensitive
46
+ }),
47
+ regexp = _compilePath.regexp,
48
+ keys = _compilePath.keys;
55
49
  var match = regexp.exec(pathname);
56
50
  if (!match) return null;
57
-
58
51
  var _match = _toArray(match),
59
- url = _match[0],
60
- values = _match.slice(1);
61
-
52
+ url = _match[0],
53
+ values = _match.slice(1);
62
54
  var isExact = pathname === url;
63
55
  if (exact && !isExact) return null;
64
56
  return {
@@ -66,14 +58,14 @@ function matchPath(pathname) {
66
58
  // the p used to match
67
59
  url: p === '/' && url === '' ? '/' : url,
68
60
  // the matched portion of the URL
69
- isExact: isExact,
61
+ isExact,
70
62
  // whether or not we matched exactly
71
- params: keys.reduce(function (memo, key, index) {
63
+ params: keys.reduce((memo, key, index) => {
72
64
  memo[key.name] = values[index];
73
65
  return memo;
74
66
  }, {})
75
67
  };
76
68
  }, null);
77
69
  }
78
-
79
- export default matchPath;
70
+ export default matchPath;
71
+ //# sourceMappingURL=match-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-path.js","names":["pathToRegexp","cache","cacheLimit","cacheCount","compilePath","path","options","cacheKey","end","strict","sensitive","pathCache","keys","regexp","result","matchPath","pathname","arguments","length","undefined","_options","_options$exact","exact","_options$strict","_options$sensitive","paths","concat","reduce","matched","p","_compilePath","match","exec","_match","_toArray","url","values","slice","isExact","params","memo","key","index","name"],"sources":["../match-path.js"],"sourcesContent":["import pathToRegexp from 'path-to-regexp';\n\nconst cache = {};\nconst cacheLimit = 10000;\nlet cacheCount = 0;\n\nfunction compilePath(path, options) {\n const cacheKey = `${options.end}${options.strict}${options.sensitive}`;\n const pathCache = cache[cacheKey] || (cache[cacheKey] = {});\n\n if (pathCache[path]) return pathCache[path];\n\n const keys = [];\n const regexp = pathToRegexp(path, keys, options);\n const result = { regexp, keys };\n\n if (cacheCount < cacheLimit) {\n pathCache[path] = result;\n cacheCount += 1;\n }\n\n return result;\n}\n\n/**\n * Public API for matching a URL pathname to a path.\n */\nfunction matchPath(pathname, options = {}) {\n if (typeof options === 'string') options = { path: options };\n\n const {\n path, exact = false, strict = false, sensitive = false\n } = options;\n\n const paths = [].concat(path);\n\n return paths.reduce((matched, p) => {\n if (matched) return matched;\n const { regexp, keys } = compilePath(p, {\n end: exact,\n strict,\n sensitive\n });\n const match = regexp.exec(pathname);\n\n if (!match) return null;\n\n const [url, ...values] = match;\n const isExact = pathname === url;\n\n if (exact && !isExact) return null;\n\n return {\n path: p, // the p used to match\n url: p === '/' && url === '' ? '/' : url, // the matched portion of the URL\n isExact, // whether or not we matched exactly\n params: keys.reduce((memo, key, index) => {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}\n\nexport default matchPath;\n"],"mappings":";AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,IAAMC,KAAK,GAAG,CAAC,CAAC;AAChB,IAAMC,UAAU,GAAG,KAAK;AACxB,IAAIC,UAAU,GAAG,CAAC;AAElB,SAASC,WAAWA,CAACC,IAAI,EAAEC,OAAO,EAAE;EAClC,IAAMC,QAAQ,GAAI,GAAED,OAAO,CAACE,GAAI,GAAEF,OAAO,CAACG,MAAO,GAAEH,OAAO,CAACI,SAAU,EAAC;EACtE,IAAMC,SAAS,GAAGV,KAAK,CAACM,QAAQ,CAAC,KAAKN,KAAK,CAACM,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;EAE3D,IAAII,SAAS,CAACN,IAAI,CAAC,EAAE,OAAOM,SAAS,CAACN,IAAI,CAAC;EAE3C,IAAMO,IAAI,GAAG,EAAE;EACf,IAAMC,MAAM,GAAGb,YAAY,CAACK,IAAI,EAAEO,IAAI,EAAEN,OAAO,CAAC;EAChD,IAAMQ,MAAM,GAAG;IAAED,MAAM;IAAED;EAAK,CAAC;EAE/B,IAAIT,UAAU,GAAGD,UAAU,EAAE;IAC3BS,SAAS,CAACN,IAAI,CAAC,GAAGS,MAAM;IACxBX,UAAU,IAAI,CAAC;EACjB;EAEA,OAAOW,MAAM;AACf;;AAEA;AACA;AACA;AACA,SAASC,SAASA,CAACC,QAAQ,EAAgB;EAAA,IAAdV,OAAO,GAAAW,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACvC,IAAI,OAAOX,OAAO,KAAK,QAAQ,EAAEA,OAAO,GAAG;IAAED,IAAI,EAAEC;EAAQ,CAAC;EAE5D,IAAAc,QAAA,GAEId,OAAO;IADTD,IAAI,GAAAe,QAAA,CAAJf,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