@react-pdf/stylesheet
Advanced tools
Comparing version 4.1.0 to 4.1.1
# @react-pdf/stylesheet | ||
## 4.1.1 | ||
### Patch Changes | ||
- [#2186](https://github.com/diegomura/react-pdf/pull/2186) [`72435bd`](https://github.com/diegomura/react-pdf/commit/72435bd81afdada5b811a1d82af0c873cfb62fa0) Thanks [@jeetiss](https://github.com/jeetiss)! - update yoga-layout to support flexBasis auto | ||
## 4.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -22,9 +22,19 @@ 'use strict'; | ||
var flexDefaults = [1, 1, 0]; | ||
// https://developer.mozilla.org/en-US/docs/Web/CSS/flex#values | ||
var flexDefaults = [0, 1, 'auto']; | ||
var flexAuto = [1, 1, 'auto']; | ||
var expandFlex = function expandFlex(key, value) { | ||
var matches = ("" + value).split(' '); | ||
var flexGrow = matches[0] || flexDefaults[0]; | ||
var flexShrink = matches[1] || flexDefaults[1]; | ||
var flexBasis = matches[2] || flexDefaults[2]; | ||
var defaults = flexDefaults; | ||
var matches = []; | ||
if (value === 'auto') { | ||
defaults = flexAuto; | ||
} else { | ||
matches = ("" + value).split(' '); | ||
} | ||
var flexGrow = matches[0] || defaults[0]; | ||
var flexShrink = matches[1] || defaults[1]; | ||
var flexBasis = matches[2] || defaults[2]; | ||
return { | ||
@@ -31,0 +41,0 @@ flexGrow: flexGrow, |
@@ -9,9 +9,19 @@ import { compose, castArray } from '@react-pdf/fns'; | ||
var flexDefaults = [1, 1, 0]; | ||
// https://developer.mozilla.org/en-US/docs/Web/CSS/flex#values | ||
var flexDefaults = [0, 1, 'auto']; | ||
var flexAuto = [1, 1, 'auto']; | ||
var expandFlex = function expandFlex(key, value) { | ||
var matches = ("" + value).split(' '); | ||
var flexGrow = matches[0] || flexDefaults[0]; | ||
var flexShrink = matches[1] || flexDefaults[1]; | ||
var flexBasis = matches[2] || flexDefaults[2]; | ||
var defaults = flexDefaults; | ||
var matches = []; | ||
if (value === 'auto') { | ||
defaults = flexAuto; | ||
} else { | ||
matches = ("" + value).split(' '); | ||
} | ||
var flexGrow = matches[0] || defaults[0]; | ||
var flexShrink = matches[1] || defaults[1]; | ||
var flexBasis = matches[2] || defaults[2]; | ||
return { | ||
@@ -18,0 +28,0 @@ flexGrow: flexGrow, |
{ | ||
"name": "@react-pdf/stylesheet", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"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
46607
1386