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

css-box-model

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-box-model - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

11

dist/css-box-model.cjs.js

@@ -106,4 +106,3 @@ 'use strict';

var withScroll = function withScroll(original) {
var scroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getWindowScroll();
var offset = function offset(original, change) {
var borderBox = original.borderBox,

@@ -114,3 +113,3 @@ border = original.border,

var shifted = shift(borderBox, scroll);
var shifted = shift(borderBox, change);

@@ -125,2 +124,7 @@ return createBox({

var withScroll = function withScroll(original) {
var scroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getWindowScroll();
return offset(original, scroll);
};
var calculateBox = function calculateBox(borderBox, styles) {

@@ -163,4 +167,5 @@ var margin = {

exports.createBox = createBox;
exports.offset = offset;
exports.withScroll = withScroll;
exports.calculateBox = calculateBox;
exports.getBox = getBox;

@@ -102,4 +102,3 @@ var getRect = function getRect(_ref) {

var withScroll = function withScroll(original) {
var scroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getWindowScroll();
var offset = function offset(original, change) {
var borderBox = original.borderBox,

@@ -110,3 +109,3 @@ border = original.border,

var shifted = shift(borderBox, scroll);
var shifted = shift(borderBox, change);

@@ -121,2 +120,7 @@ return createBox({

var withScroll = function withScroll(original) {
var scroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getWindowScroll();
return offset(original, scroll);
};
var calculateBox = function calculateBox(borderBox, styles) {

@@ -157,2 +161,2 @@ var margin = {

export { getRect, createBox, withScroll, calculateBox, getBox };
export { getRect, createBox, offset, withScroll, calculateBox, getBox };
{
"name": "css-box-model",
"version": "0.0.13",
"version": "0.0.14",
"description": "Returns the css box model for a HTMLElement",

@@ -32,14 +32,14 @@ "author": "Alex Reardon <alexreardon@gmail.com>",

"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-core": "^6.26.3",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-env": "^1.7.0",
"babel-preset-flow": "^6.23.0",
"flow-bin": "^0.70.0",
"jest": "^22.4.3",
"prettier": "1.12.0",
"flow-bin": "^0.74.0",
"jest": "^23.1.0",
"prettier": "1.13.4",
"rimraf": "^2.6.2",
"rollup": "^0.58.1",
"rollup-plugin-babel": "^3.0.3"
"rollup": "^0.60.1",
"rollup-plugin-babel": "^3.0.4"
}
}

@@ -162,8 +162,5 @@ // @flow

export const withScroll = (
original: BoxModel,
scroll?: Position = getWindowScroll(),
): BoxModel => {
export const offset = (original: BoxModel, change: Position): BoxModel => {
const { borderBox, border, margin, padding } = original;
const shifted: Spacing = shift(borderBox, scroll);
const shifted: Spacing = shift(borderBox, change);

@@ -178,2 +175,7 @@ return createBox({

export const withScroll = (
original: BoxModel,
scroll?: Position = getWindowScroll(),
): BoxModel => offset(original, scroll);
// Exposing this function directly for performance. If you have already computed these things

@@ -180,0 +182,0 @@ // then you can simply pass them in

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