@react-pdf/stylesheet
Advanced tools
Comparing version 3.1.0 to 3.2.0
# @react-pdf/stylesheet | ||
## 3.2.0 | ||
### Minor Changes | ||
- [#1892](https://github.com/diegomura/react-pdf/pull/1892) [`035d3f8`](https://github.com/diegomura/react-pdf/commit/035d3f8d24fa4f4af9f350950d81b51547858367) Thanks [@diegomura](https://github.com/diegomura)! - feat: add skew transformation support | ||
## 3.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -37,2 +37,13 @@ "use strict"; | ||
var parseAngle = function parseAngle(value) { | ||
var unitsRegexp = /(-?\d*\.?\d*)(\w*)?/i; | ||
var _unitsRegexp$exec = unitsRegexp.exec(value), | ||
angle = _unitsRegexp$exec[1], | ||
unit = _unitsRegexp$exec[2]; | ||
var number = Number.parseFloat(angle); | ||
return unit === 'rad' ? number * 180 / Math.PI : number; | ||
}; | ||
var normalizeTransformOperation = function normalizeTransformOperation(_ref) { | ||
@@ -76,12 +87,5 @@ var operation = _ref.operation, | ||
{ | ||
var unitsRegexp = /(-?\d*\.?\d*)(\w*)?/i; | ||
var _unitsRegexp$exec = unitsRegexp.exec(value), | ||
angle = _unitsRegexp$exec[1], | ||
unit = _unitsRegexp$exec[2]; | ||
var number = Number.parseFloat(angle); | ||
return { | ||
operation: 'rotate', | ||
value: [unit === 'rad' ? number * 180 / Math.PI : number] | ||
value: [parseAngle(value)] | ||
}; | ||
@@ -116,2 +120,26 @@ } | ||
case 'skew': | ||
{ | ||
return { | ||
operation: 'skew', | ||
value: value.map(parseAngle) | ||
}; | ||
} | ||
case 'skewX': | ||
{ | ||
return { | ||
operation: 'skew', | ||
value: [parseAngle(value), 0] | ||
}; | ||
} | ||
case 'skewY': | ||
{ | ||
return { | ||
operation: 'skew', | ||
value: [0, parseAngle(value)] | ||
}; | ||
} | ||
default: | ||
@@ -118,0 +146,0 @@ { |
{ | ||
"name": "@react-pdf/stylesheet", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "A styles engine for Node and the browser", |
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
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
30829
792