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

@react-pdf/stylesheet

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-pdf/stylesheet - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

11

CHANGELOG.md
# @react-pdf/stylesheet
## 3.1.0
### Minor Changes
- [#1869](https://github.com/diegomura/react-pdf/pull/1869) [`5d2c308`](https://github.com/diegomura/react-pdf/commit/5d2c3088cf438a8abf1038b14a21117fecf59d57) Thanks [@diegomura](https://github.com/diegomura)! - feat: variable dpi
### Patch Changes
- Updated dependencies [[`1411d16`](https://github.com/diegomura/react-pdf/commit/1411d162e04ca237bad93729695c363fdf4bdbeb), [`4fadb48`](https://github.com/diegomura/react-pdf/commit/4fadb48983d7269452f89f80c7e341ece859aaee), [`ce8762f`](https://github.com/diegomura/react-pdf/commit/ce8762f6de5c796e69ec5a225c7f3ff9c619a960), [`5d2c308`](https://github.com/diegomura/react-pdf/commit/5d2c3088cf438a8abf1038b14a21117fecf59d57)]:
- @react-pdf/types@2.1.0
## 3.0.0

@@ -4,0 +15,0 @@

13

lib/transform/units.js

@@ -5,6 +5,3 @@ "use strict";

exports.default = void 0;
var DPI = 72; // 72pt per inch.
var MM_FACTOR = 1 / 25.4 * DPI;
var CM_FACTOR = 1 / 2.54 * DPI;
/**

@@ -16,3 +13,2 @@ * Parses scalar value in value and unit pairs

*/
var parseValue = function parseValue(value) {

@@ -39,12 +35,15 @@ var match = /^(-?\d*\.?\d+)(in|mm|cm|pt|vh|vw|px)?$/g.exec(value);

var scalar = parseValue(value);
var dpi = container.dpi || 72;
var mmFactor = 1 / 25.4 * dpi;
var cmFactor = 1 / 2.54 * dpi;
switch (scalar.unit) {
case 'in':
return scalar.value * DPI;
return scalar.value * dpi;
case 'mm':
return scalar.value * MM_FACTOR;
return scalar.value * mmFactor;
case 'cm':
return scalar.value * CM_FACTOR;
return scalar.value * cmFactor;

@@ -51,0 +50,0 @@ case 'vh':

{
"name": "@react-pdf/stylesheet",
"version": "3.0.0",
"version": "3.1.0",
"license": "MIT",

@@ -22,3 +22,3 @@ "description": "A styles engine for Node and the browser",

"@react-pdf/fns": "1.0.0",
"@react-pdf/types": "^2.0.9",
"@react-pdf/types": "^2.1.0",
"color-string": "^1.5.3",

@@ -25,0 +25,0 @@ "hsl-to-hex": "^1.0.0",

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