gatsby-link 2.2.27 → 2.2.31

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.31](https://github.com/gatsbyjs/gatsby/compare/gatsby-link@2.2.30...gatsby-link@2.2.31) (2020-03-16)
7
+
8
+ **Note:** Version bump only for package gatsby-link
9
+
10
+ ## [2.2.30](https://github.com/gatsbyjs/gatsby/compare/gatsby-link@2.2.29...gatsby-link@2.2.30) (2020-03-06)
11
+
12
+ **Note:** Version bump only for package gatsby-link
13
+
14
+ ## [2.2.29](https://github.com/gatsbyjs/gatsby/compare/gatsby-link@2.2.28...gatsby-link@2.2.29) (2020-02-01)
15
+
16
+ ### Bug Fixes
17
+
18
+ - **gatsby-link:** Adds Type, PropType, tests, and docs for `st… ([#20807](https://github.com/gatsbyjs/gatsby/issues/20807)) ([d8937d0](https://github.com/gatsbyjs/gatsby/commit/d8937d0))
19
+
20
+ ## [2.2.28](https://github.com/gatsbyjs/gatsby/compare/gatsby-link@2.2.27...gatsby-link@2.2.28) (2020-01-09)
21
+
22
+ **Note:** Version bump only for package gatsby-link
23
+
6
24
  ## [2.2.27](https://github.com/gatsbyjs/gatsby/compare/gatsby-link@2.2.25...gatsby-link@2.2.27) (2019-12-10)
7
25
 
8
26
  **Note:** Version bump only for package gatsby-link
package/index.d.ts CHANGED
@@ -12,6 +12,10 @@ export interface GatsbyLinkProps<TState> extends LinkProps<TState> {
12
12
  partiallyActive?: boolean
13
13
  /** Used to declare that this link replaces the current URL in history with the target */
14
14
  replace?: boolean
15
+ /** Used to pass state data to the linked page.
16
+ * The linked page will have a `location` prop containing a nested `state` object structure containing the passed data.
17
+ */
18
+ state?: TState
15
19
  /** The URL you want to link to */
16
20
  to: string
17
21
  }
package/index.js CHANGED
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.withPrefix = withPrefix;
7
7
  exports.withAssetPrefix = withAssetPrefix;
8
- exports.navigateTo = exports.replace = exports.push = exports.navigate = exports["default"] = void 0;
8
+ exports.navigateTo = exports.replace = exports.push = exports.navigate = exports.default = void 0;
9
9
 
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
 
@@ -40,9 +40,9 @@ function normalizePath(path) {
40
40
  }
41
41
 
42
42
  var NavLinkPropTypes = {
43
- activeClassName: _propTypes["default"].string,
44
- activeStyle: _propTypes["default"].object,
45
- partiallyActive: _propTypes["default"].bool
43
+ activeClassName: _propTypes.default.string,
44
+ activeStyle: _propTypes.default.object,
45
+ partiallyActive: _propTypes.default.bool
46
46
  }; // Set up IntersectionObserver
47
47
 
48
48
  var createIntersectionObserver = function createIntersectionObserver(el, cb) {
@@ -67,24 +67,22 @@ var createIntersectionObserver = function createIntersectionObserver(el, cb) {
67
67
  };
68
68
  };
69
69
 
70
- var GatsbyLink =
71
- /*#__PURE__*/
72
- function (_React$Component) {
73
- (0, _inheritsLoose2["default"])(GatsbyLink, _React$Component);
70
+ var GatsbyLink = /*#__PURE__*/function (_React$Component) {
71
+ (0, _inheritsLoose2.default)(GatsbyLink, _React$Component);
74
72
 
75
73
  function GatsbyLink(props) {
76
74
  var _this;
77
75
 
78
76
  _this = _React$Component.call(this, props) || this; // Default to no support for IntersectionObserver
79
77
 
80
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultGetProps", function (_ref) {
78
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "defaultGetProps", function (_ref) {
81
79
  var isPartiallyCurrent = _ref.isPartiallyCurrent,
82
80
  isCurrent = _ref.isCurrent;
83
81
 
84
82
  if (_this.props.partiallyActive ? isPartiallyCurrent : isCurrent) {
85
83
  return {
86
84
  className: [_this.props.className, _this.props.activeClassName].filter(Boolean).join(" "),
87
- style: (0, _extends2["default"])({}, _this.props.style, {}, _this.props.activeStyle)
85
+ style: (0, _extends2.default)({}, _this.props.style, {}, _this.props.activeStyle)
88
86
  };
89
87
  }
90
88
 
@@ -99,7 +97,7 @@ function (_React$Component) {
99
97
  _this.state = {
100
98
  IOSupported: IOSupported
101
99
  };
102
- _this.handleRef = _this.handleRef.bind((0, _assertThisInitialized2["default"])(_this));
100
+ _this.handleRef = _this.handleRef.bind((0, _assertThisInitialized2.default)(_this));
103
101
  return _this;
104
102
  }
105
103
 
@@ -163,7 +161,7 @@ function (_React$Component) {
163
161
  partiallyActive = _this$props.partiallyActive,
164
162
  state = _this$props.state,
165
163
  replace = _this$props.replace,
166
- rest = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, ["to", "getProps", "onClick", "onMouseEnter", "activeClassName", "activeStyle", "innerRef", "partiallyActive", "state", "replace"]);
164
+ rest = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["to", "getProps", "onClick", "onMouseEnter", "activeClassName", "activeStyle", "innerRef", "partiallyActive", "state", "replace"]);
167
165
  var LOCAL_URL = /^\/(?!\/)/;
168
166
 
169
167
  if (process.env.NODE_ENV !== "production" && !LOCAL_URL.test(to)) {
@@ -171,7 +169,7 @@ function (_React$Component) {
171
169
  }
172
170
 
173
171
  var prefixedTo = withPrefix(to);
174
- return _react["default"].createElement(_router.Link, (0, _extends2["default"])({
172
+ return _react.default.createElement(_router.Link, (0, _extends2.default)({
175
173
  to: prefixedTo,
176
174
  state: state,
177
175
  getProps: getProps,
@@ -208,25 +206,26 @@ function (_React$Component) {
208
206
  };
209
207
 
210
208
  return GatsbyLink;
211
- }(_react["default"].Component);
209
+ }(_react.default.Component);
212
210
 
213
- GatsbyLink.propTypes = (0, _extends2["default"])({}, NavLinkPropTypes, {
214
- onClick: _propTypes["default"].func,
215
- to: _propTypes["default"].string.isRequired,
216
- replace: _propTypes["default"].bool
211
+ GatsbyLink.propTypes = (0, _extends2.default)({}, NavLinkPropTypes, {
212
+ onClick: _propTypes.default.func,
213
+ to: _propTypes.default.string.isRequired,
214
+ replace: _propTypes.default.bool,
215
+ state: _propTypes.default.object
217
216
  });
218
217
 
219
218
  var showDeprecationWarning = function showDeprecationWarning(functionName, altFunctionName, version) {
220
219
  return console.warn("The \"" + functionName + "\" method is now deprecated and will be removed in Gatsby v" + version + ". Please use \"" + altFunctionName + "\" instead.");
221
220
  };
222
221
 
223
- var _default = _react["default"].forwardRef(function (props, ref) {
224
- return _react["default"].createElement(GatsbyLink, (0, _extends2["default"])({
222
+ var _default = _react.default.forwardRef(function (props, ref) {
223
+ return _react.default.createElement(GatsbyLink, (0, _extends2.default)({
225
224
  innerRef: ref
226
225
  }, props));
227
226
  });
228
227
 
229
- exports["default"] = _default;
228
+ exports.default = _default;
230
229
 
231
230
  var navigate = function navigate(to, options) {
232
231
  window.___navigate(withPrefix(to), options);
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "gatsby-link",
3
3
  "description": "An enhanced Link component for Gatsby sites with support for resource prefetching",
4
- "version": "2.2.27",
4
+ "version": "2.2.31",
5
5
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/gatsbyjs/gatsby/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@babel/runtime": "^7.7.6",
11
- "@types/reach__router": "^1.2.6",
10
+ "@babel/runtime": "^7.8.7",
11
+ "@types/reach__router": "^1.3.0",
12
12
  "prop-types": "^15.7.2"
13
13
  },
14
14
  "devDependencies": {
15
- "@babel/cli": "^7.7.5",
16
- "@babel/core": "^7.7.5",
17
- "@testing-library/react": "^9.3.2",
18
- "babel-preset-gatsby-package": "^0.2.14",
15
+ "@babel/cli": "^7.8.4",
16
+ "@babel/core": "^7.8.7",
17
+ "@testing-library/react": "^9.5.0",
18
+ "babel-preset-gatsby-package": "^0.2.18",
19
19
  "cross-env": "^5.2.1"
20
20
  },
21
21
  "homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-link#readme",
@@ -41,5 +41,5 @@
41
41
  "watch": "babel -w src --out-dir . --ignore **/__tests__"
42
42
  },
43
43
  "types": "index.d.ts",
44
- "gitHead": "a9e404620b8d855b8c6f8ded028b93dab6071ead"
44
+ "gitHead": "2ff2ba395a86407e3ccfd1e010be7408a4817a82"
45
45
  }
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }