@react-spring/shared
Advanced tools
Comparing version 9.2.6 to 9.3.0
@@ -623,2 +623,3 @@ 'use strict'; | ||
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; | ||
const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i'); | ||
let namedColorRegex; | ||
@@ -644,4 +645,7 @@ const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi; | ||
return input => { | ||
var _output$find; | ||
const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find(value => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, '')); | ||
let i = 0; | ||
return output[0].replace(numberRegex, () => String(interpolators[i++](input))).replace(rgbaRegex, rgbaRound); | ||
return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ''}`).replace(rgbaRegex, rgbaRound); | ||
}; | ||
@@ -648,0 +652,0 @@ }; |
@@ -623,2 +623,3 @@ 'use strict'; | ||
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; | ||
const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i'); | ||
let namedColorRegex; | ||
@@ -644,4 +645,7 @@ const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi; | ||
return input => { | ||
var _output$find; | ||
const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find(value => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, '')); | ||
let i = 0; | ||
return output[0].replace(numberRegex, () => String(interpolators[i++](input))).replace(rgbaRegex, rgbaRound); | ||
return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ''}`).replace(rgbaRegex, rgbaRound); | ||
}; | ||
@@ -648,0 +652,0 @@ }; |
@@ -599,2 +599,3 @@ import { raf } from '@react-spring/rafz'; | ||
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; | ||
const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i'); | ||
let namedColorRegex; | ||
@@ -620,4 +621,7 @@ const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi; | ||
return input => { | ||
var _output$find; | ||
const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find(value => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, '')); | ||
let i = 0; | ||
return output[0].replace(numberRegex, () => String(interpolators[i++](input))).replace(rgbaRegex, rgbaRound); | ||
return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ''}`).replace(rgbaRegex, rgbaRound); | ||
}; | ||
@@ -624,0 +628,0 @@ }; |
{ | ||
"name": "@react-spring/shared", | ||
"version": "9.2.6", | ||
"version": "9.3.0", | ||
"description": "Globals and shared modules", | ||
@@ -31,4 +31,4 @@ "main": "dist/react-spring-shared.cjs.js", | ||
"dependencies": { | ||
"@react-spring/rafz": "~9.2.6-beta.0", | ||
"@react-spring/types": "~9.2.6-beta.0" | ||
"@react-spring/rafz": "~9.3.0", | ||
"@react-spring/types": "~9.3.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "peerDependencies": { |
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
81168
2411
+ Added@react-spring/rafz@9.3.2(transitive)
+ Added@react-spring/types@9.3.2(transitive)
- Removed@react-spring/rafz@9.2.6(transitive)
- Removed@react-spring/types@9.2.6(transitive)
Updated@react-spring/rafz@~9.3.0
Updated@react-spring/types@~9.3.0