Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-fit

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fit - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

dist/esm/Fit.js

42

package.json
{
"name": "react-fit",
"version": "1.0.5",
"version": "1.1.0",
"description": "Fit a popover element on the screen.",
"main": "dist/Fit.js",
"main": "dist/umd/Fit.js",
"module": "dist/esm/Fit.js",
"source": "src/Fit.jsx",
"scripts": {
"build": "babel src -d dist --ignore **/__tests__",
"build": "yarn build-js-all",
"build-js-all": "yarn build-js-esm && yarn build-js-umd",
"build-js-esm": "cross-env BABEL_ENV=production-esm babel src -d dist/esm --ignore **/*.spec.js,**/*.spec.jsx",
"build-js-umd": "cross-env BABEL_ENV=production-umd babel src -d dist/umd --ignore **/*.spec.js,**/*.spec.jsx",
"clean": "rimraf dist",
"prepublishOnly": "yarn run clean && yarn run build",
"test": "yarn run test-eslint",
"test-eslint": "eslint src/ test/ --ext .jsx,.js"
"lint": "eslint src/ test/ --ext .jsx,.js",
"prepublishOnly": "yarn clean && yarn build",
"test": "yarn lint"
},

@@ -26,20 +30,22 @@ "keywords": [

"dependencies": {
"detect-element-overflow": "^1.1.1",
"detect-element-overflow": "^1.2.0",
"prop-types": "^15.6.0"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.11.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.1",
"babel-eslint": "^10.0.0",
"cross-env": "^6.0.3",
"eslint": "^6.1.0",
"eslint-config-airbnb": "^18.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.7.0",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"rimraf": "^2.6.2"
"rimraf": "^3.0.0"
},

@@ -46,0 +52,0 @@ "peerDependencies": {

@@ -61,2 +61,3 @@ import React, { Component } from 'react';

const overflowEndProperty = `overflow${capitalize(endProperty)}`;
const scrollProperty = `scroll${capitalize(startProperty)}`;
const uppercasedSizeProperty = capitalize(sizeProperty);

@@ -67,6 +68,17 @@ const offsetSizeProperty = `offset${uppercasedSizeProperty}`;

const scroll = scrollContainer[scrollProperty];
const scrollbarWidth = scrollContainer[offsetSizeProperty] - scrollContainer[clientSizeProperty];
let availableStartSpace = -parentCollisions[overflowStartProperty] - spacing;
let availableEndSpace = -parentCollisions[overflowEndProperty] - spacing - scrollbarWidth;
let availableStartSpace = (
-parentCollisions[overflowStartProperty]
- spacing
+ scroll
);
let availableEndSpace = (
-parentCollisions[overflowEndProperty]
- spacing
- scroll
- scrollbarWidth
);
if (secondary) {

@@ -258,4 +270,3 @@ availableStartSpace += parent[clientSizeProperty];

return (
<div
style={{ display: 'contents' }}
<span
ref={(ref) => {

@@ -265,5 +276,6 @@ this.container = ref;

}}
style={{ display: 'contents' }}
>
{child}
</div>
</span>
);

@@ -270,0 +282,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc