@vx/bounds
Advanced tools
Comparing version 0.0.192 to 0.0.193-alpha.0
@@ -7,6 +7,7 @@ function _extends() { _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; }; return _extends.apply(this, arguments); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
/* eslint react/no-did-mount-set-state: 0, react/no-find-dom-node: 0 */ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import PropTypes from 'prop-types'; | ||
var emptyRect = { | ||
@@ -20,17 +21,6 @@ top: 0, | ||
}; | ||
var rectShape = PropTypes.shape({ | ||
top: PropTypes.number.isRequired, | ||
right: PropTypes.number.isRequired, | ||
bottom: PropTypes.number.isRequired, | ||
left: PropTypes.number.isRequired, | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}); | ||
export var withBoundingRectsProps = { | ||
getRects: PropTypes.func, | ||
rect: rectShape, | ||
parentRect: rectShape | ||
}; | ||
export default function withBoundingRects(BaseComponent) { | ||
var WrappedComponent = | ||
var _class, _temp; | ||
return _temp = _class = | ||
/*#__PURE__*/ | ||
@@ -44,2 +34,5 @@ function (_React$PureComponent) { | ||
_this = _React$PureComponent.call(this, props) || this; | ||
_defineProperty(_assertThisInitialized(_this), "node", void 0); | ||
_this.state = { | ||
@@ -83,8 +76,3 @@ rect: undefined, | ||
return WrappedComponent; | ||
}(React.PureComponent); | ||
WrappedComponent.propTypes = BaseComponent.propTypes; | ||
WrappedComponent.defaultProps = BaseComponent.defaultProps; | ||
WrappedComponent.displayName = "withBoundingRects(" + (BaseComponent.displayName || '') + ")"; | ||
return WrappedComponent; | ||
}(React.PureComponent), _defineProperty(_class, "displayName", "withBoundingRects(" + (BaseComponent.displayName || '') + ")"), _temp; | ||
} |
@@ -1,1 +0,1 @@ | ||
export { default as withBoundingRects, withBoundingRectsProps } from './enhancers/withBoundingRects'; | ||
export { default as withBoundingRects } from './enhancers/withBoundingRects'; |
@@ -5,3 +5,2 @@ "use strict"; | ||
exports.default = withBoundingRects; | ||
exports.withBoundingRectsProps = void 0; | ||
@@ -12,4 +11,2 @@ var _react = _interopRequireDefault(require("react")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -23,2 +20,4 @@ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var emptyRect = { | ||
@@ -33,20 +32,6 @@ top: 0, | ||
var rectShape = _propTypes.default.shape({ | ||
top: _propTypes.default.number.isRequired, | ||
right: _propTypes.default.number.isRequired, | ||
bottom: _propTypes.default.number.isRequired, | ||
left: _propTypes.default.number.isRequired, | ||
width: _propTypes.default.number.isRequired, | ||
height: _propTypes.default.number.isRequired | ||
}); | ||
function withBoundingRects(BaseComponent) { | ||
var _class, _temp; | ||
var withBoundingRectsProps = { | ||
getRects: _propTypes.default.func, | ||
rect: rectShape, | ||
parentRect: rectShape | ||
}; | ||
exports.withBoundingRectsProps = withBoundingRectsProps; | ||
function withBoundingRects(BaseComponent) { | ||
var WrappedComponent = | ||
return _temp = _class = | ||
/*#__PURE__*/ | ||
@@ -60,2 +45,5 @@ function (_React$PureComponent) { | ||
_this = _React$PureComponent.call(this, props) || this; | ||
_defineProperty(_assertThisInitialized(_this), "node", void 0); | ||
_this.state = { | ||
@@ -99,8 +87,3 @@ rect: undefined, | ||
return WrappedComponent; | ||
}(_react.default.PureComponent); | ||
WrappedComponent.propTypes = BaseComponent.propTypes; | ||
WrappedComponent.defaultProps = BaseComponent.defaultProps; | ||
WrappedComponent.displayName = "withBoundingRects(" + (BaseComponent.displayName || '') + ")"; | ||
return WrappedComponent; | ||
}(_react.default.PureComponent), _defineProperty(_class, "displayName", "withBoundingRects(" + (BaseComponent.displayName || '') + ")"), _temp; | ||
} |
"use strict"; | ||
exports.__esModule = true; | ||
exports.withBoundingRectsProps = exports.withBoundingRects = void 0; | ||
exports.withBoundingRects = void 0; | ||
var _withBoundingRects = _interopRequireWildcard(require("./enhancers/withBoundingRects")); | ||
var _withBoundingRects = _interopRequireDefault(require("./enhancers/withBoundingRects")); | ||
exports.withBoundingRects = _withBoundingRects.default; | ||
exports.withBoundingRectsProps = _withBoundingRects.withBoundingRectsProps; | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
{ | ||
"name": "@vx/bounds", | ||
"version": "0.0.192", | ||
"version": "0.0.193-alpha.0", | ||
"description": "Utilities to make your life with bounding boxes better", | ||
@@ -8,2 +8,3 @@ "sideEffects": false, | ||
"module": "esm/index.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
@@ -33,2 +34,4 @@ "lib", | ||
"dependencies": { | ||
"@types/react": "*", | ||
"@types/react-dom": "*", | ||
"prop-types": "^15.5.10" | ||
@@ -40,3 +43,3 @@ }, | ||
}, | ||
"gitHead": "101db6e89d7e8a4966dfafba5a782297110f7844" | ||
"gitHead": "8fb99e77e64fa9c319c0addc2a3fbf61e64885cc" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12843
11
178
5
+ Added@types/react@*
+ Added@types/react-dom@*
+ Added@types/prop-types@15.7.13(transitive)
+ Added@types/react@18.3.8(transitive)
+ Added@types/react-dom@18.3.0(transitive)
+ Addedcsstype@3.1.3(transitive)