@tamagui/core
Advanced tools
Comparing version 1.0.0-beta.9 to 1.0.0-beta.10
@@ -25,23 +25,16 @@ var __defProp = Object.defineProperty; | ||
const matchRgbaHsla = /(rgba|hsla)\(\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,})\s*\)$/; | ||
function fixNativeShadow(styles) { | ||
if (!styles) { | ||
function fixNativeShadow(props) { | ||
if (!props.shadowColor) { | ||
return; | ||
} | ||
const color = styles.find((x) => x[0] === "shadowColor"); | ||
if (!color) { | ||
return; | ||
if (!props.shadowOffset) { | ||
props.shadowOffset = { | ||
width: 0, | ||
height: 0 | ||
}; | ||
} | ||
if (!styles.find((x) => x[0] === "shadowOffset")) { | ||
styles.push([ | ||
"shadowOffset", | ||
{ | ||
width: 0, | ||
height: 0 | ||
} | ||
]); | ||
} | ||
if (styles.find((x) => x[0] === "shadowOpacity")) { | ||
if ("shadowOpacity" in props) { | ||
return; | ||
} | ||
const c = `${color[1]}`; | ||
const c = `${props.shadowColor}`; | ||
if ((c[0] === "r" || c[0] === "h") && c[3] === "a") { | ||
@@ -53,6 +46,6 @@ const [_, type, _1, _2, _3, a] = c.match(matchRgbaHsla) || []; | ||
} | ||
styles.push(["shadowColor", `${type.replace("a", "")}(${_1},${_2},${_3})`]); | ||
styles.push(["shadowOpacity", +a]); | ||
props.shadowColor = `${type.replace("a", "")}(${_1},${_2},${_3})`; | ||
props.shadowOpacity = +a; | ||
} else { | ||
styles.push(["shadowOpacity", 1]); | ||
props.shadowOpacity = 1; | ||
} | ||
@@ -59,0 +52,0 @@ } |
var __defProp = Object.defineProperty; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
const matchRgbaHsla = /(rgba|hsla)\(\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,})\s*\)$/; | ||
function fixNativeShadow(styles) { | ||
if (!styles) { | ||
function fixNativeShadow(props) { | ||
if (!props.shadowColor) { | ||
return; | ||
} | ||
const color = styles.find((x) => x[0] === "shadowColor"); | ||
if (!color) { | ||
return; | ||
if (!props.shadowOffset) { | ||
props.shadowOffset = { | ||
width: 0, | ||
height: 0 | ||
}; | ||
} | ||
if (!styles.find((x) => x[0] === "shadowOffset")) { | ||
styles.push([ | ||
"shadowOffset", | ||
{ | ||
width: 0, | ||
height: 0 | ||
} | ||
]); | ||
} | ||
if (styles.find((x) => x[0] === "shadowOpacity")) { | ||
if ("shadowOpacity" in props) { | ||
return; | ||
} | ||
const c = `${color[1]}`; | ||
const c = `${props.shadowColor}`; | ||
if ((c[0] === "r" || c[0] === "h") && c[3] === "a") { | ||
@@ -31,6 +24,6 @@ const [_, type, _1, _2, _3, a] = c.match(matchRgbaHsla) || []; | ||
} | ||
styles.push(["shadowColor", `${type.replace("a", "")}(${_1},${_2},${_3})`]); | ||
styles.push(["shadowOpacity", +a]); | ||
props.shadowColor = `${type.replace("a", "")}(${_1},${_2},${_3})`; | ||
props.shadowOpacity = +a; | ||
} else { | ||
styles.push(["shadowOpacity", 1]); | ||
props.shadowOpacity = 1; | ||
} | ||
@@ -37,0 +30,0 @@ } |
var __defProp = Object.defineProperty; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
const matchRgbaHsla = /(rgba|hsla)\(\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,}%?)\s*,\s*([\d\.]{1,})\s*\)$/; | ||
function fixNativeShadow(styles) { | ||
if (!styles) { | ||
function fixNativeShadow(props) { | ||
if (!props.shadowColor) { | ||
return; | ||
} | ||
const color = styles.find((x) => x[0] === "shadowColor"); | ||
if (!color) { | ||
return; | ||
if (!props.shadowOffset) { | ||
props.shadowOffset = { | ||
width: 0, | ||
height: 0 | ||
}; | ||
} | ||
if (!styles.find((x) => x[0] === "shadowOffset")) { | ||
styles.push([ | ||
"shadowOffset", | ||
{ | ||
width: 0, | ||
height: 0 | ||
} | ||
]); | ||
} | ||
if (styles.find((x) => x[0] === "shadowOpacity")) { | ||
if ("shadowOpacity" in props) { | ||
return; | ||
} | ||
const c = `${color[1]}`; | ||
const c = `${props.shadowColor}`; | ||
if ((c[0] === "r" || c[0] === "h") && c[3] === "a") { | ||
@@ -31,6 +24,6 @@ const [_, type, _1, _2, _3, a] = c.match(matchRgbaHsla) || []; | ||
} | ||
styles.push(["shadowColor", `${type.replace("a", "")}(${_1},${_2},${_3})`]); | ||
styles.push(["shadowOpacity", +a]); | ||
props.shadowColor = `${type.replace("a", "")}(${_1},${_2},${_3})`; | ||
props.shadowOpacity = +a; | ||
} else { | ||
styles.push(["shadowOpacity", 1]); | ||
props.shadowOpacity = 1; | ||
} | ||
@@ -37,0 +30,0 @@ } |
{ | ||
"name": "@tamagui/core", | ||
"version": "1.0.0-beta.9", | ||
"version": "1.0.0-beta.10", | ||
"source": "src/index.ts", | ||
@@ -22,6 +22,6 @@ "main": "dist/cjs", | ||
"dependencies": { | ||
"@tamagui/helpers": "^1.0.0-beta.9", | ||
"@tamagui/helpers": "^1.0.0-beta.10", | ||
"@tamagui/ow": "^0.28.1", | ||
"@tamagui/use-debounce": "^1.0.0-beta.9", | ||
"@tamagui/use-force-update": "^1.0.0-beta.9", | ||
"@tamagui/use-debounce": "^1.0.0-beta.10", | ||
"@tamagui/use-force-update": "^1.0.0-beta.10", | ||
"react": "*", | ||
@@ -34,3 +34,3 @@ "react-dom": "*" | ||
"devDependencies": { | ||
"@tamagui/build": "^1.0.0-beta.9", | ||
"@tamagui/build": "^1.0.0-beta.10", | ||
"@types/react": "^17.0.35", | ||
@@ -37,0 +37,0 @@ "csstype": "^3.0.10", |
@@ -1,2 +0,2 @@ | ||
export declare function fixNativeShadow(styles: [string, any][]): void; | ||
export declare function fixNativeShadow(props: any): void; | ||
//# sourceMappingURL=fixNativeShadow.native.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1039351
13867