@tamagui/web
Advanced tools
Comparing version 1.5.19 to 1.5.20
@@ -153,3 +153,3 @@ "use strict"; | ||
const isAnimated = (() => { | ||
const next = !!(useAnimations && props.animation); | ||
const next = !!(useAnimations && (props.animation || props.style && hasAnimatedStyleValue(props.style))); | ||
if (next && !stateRef.current.hasAnimated) { | ||
@@ -868,2 +868,8 @@ stateRef.current.hasAnimated = true; | ||
}); | ||
function hasAnimatedStyleValue(style) { | ||
return Object.keys(style).some((k) => { | ||
const val = style[k]; | ||
return val && typeof val === "object" && "_animation" in val; | ||
}); | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -870,0 +876,0 @@ 0 && (module.exports = { |
@@ -47,3 +47,2 @@ "use strict"; | ||
componentName: true, | ||
role: true, | ||
tag: true | ||
@@ -391,3 +390,3 @@ }; | ||
isMedia = isMediaKey(key); | ||
isPseudo = import_helpers.validPseudoKeys[key]; | ||
isPseudo = key in import_helpers.validPseudoKeys; | ||
const isMediaOrPseudo = isMedia || isPseudo; | ||
@@ -579,3 +578,3 @@ if (!isMediaOrPseudo && usedKeys[key]) { | ||
if (!variants || !(key in variants)) { | ||
if (!skipProps[key]) { | ||
if (!(key in skipProps)) { | ||
viewProps[key] = val; | ||
@@ -582,0 +581,0 @@ usedKeys[key] = 1; |
@@ -25,4 +25,5 @@ "use strict"; | ||
const withStaticProperties = function(component, staticProps) { | ||
Object.assign(component, staticProps); | ||
return component; | ||
const next = typeof component === "function" ? component : { ...component }; | ||
Object.assign(next, staticProps); | ||
return next; | ||
}; | ||
@@ -29,0 +30,0 @@ // Annotate the CommonJS export names for ESM import in node: |
@@ -24,3 +24,5 @@ "use strict"; | ||
module.exports = __toCommonJS(styled_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var import_helpers = require("@tamagui/helpers"); | ||
var import_react = require("react"); | ||
var import_createComponent = require("./createComponent.js"); | ||
@@ -43,4 +45,20 @@ var import_setupReactNative = require("./setupReactNative.js"); | ||
} | ||
const parentStaticConfig = "staticConfig" in Component ? Component.staticConfig : null; | ||
const isTamagui = !!parentStaticConfig; | ||
const isReactNative = Boolean( | ||
import_setupReactNative.ReactNativeStaticConfigs.has(Component) || (staticExtractionOptions == null ? void 0 : staticExtractionOptions.isReactNative) || import_setupReactNative.ReactNativeStaticConfigs.has(parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isReactNative) | ||
); | ||
if (!isTamagui && !isReactNative) { | ||
if (process.env.NODE_ENV === "development") { | ||
if (options == null ? void 0 : options.variants) { | ||
console.warn( | ||
`Warning: wrapping a non-Tamagui element in styled() and passing variants isn't supported (yet).` | ||
); | ||
} | ||
} | ||
return (0, import_react.forwardRef)(function styled2(props, ref) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...options, ...props }); | ||
}); | ||
} | ||
const staticConfigProps = (() => { | ||
const parentStaticConfig = "staticConfig" in Component ? Component.staticConfig : null; | ||
if (options) { | ||
@@ -57,6 +75,2 @@ const { | ||
} | ||
const isReactNative = Boolean( | ||
import_setupReactNative.ReactNativeStaticConfigs.has(Component) || import_setupReactNative.ReactNativeStaticConfigs.has(parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isReactNative) || (staticExtractionOptions == null ? void 0 : staticExtractionOptions.isReactNative) | ||
); | ||
const isTamagui = !isReactNative && !!parentStaticConfig; | ||
const Comp = isReactNative ? (parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || Component : Component; | ||
@@ -89,5 +103,4 @@ const nativeConf = isReactNative && import_setupReactNative.ReactNativeStaticConfigs.get(Comp) || null; | ||
} | ||
return {}; | ||
})(); | ||
const component = (0, import_createComponent.createComponent)(staticConfigProps, Component); | ||
const component = (0, import_createComponent.createComponent)(staticConfigProps || {}, Component); | ||
return component; | ||
@@ -94,0 +107,0 @@ } |
@@ -125,3 +125,3 @@ import { jsx } from "react/jsx-runtime"; | ||
const isAnimated = (() => { | ||
const next = !!(useAnimations && props.animation); | ||
const next = !!(useAnimations && (props.animation || props.style && hasAnimatedStyleValue(props.style))); | ||
if (next && !stateRef.current.hasAnimated) { | ||
@@ -840,2 +840,8 @@ stateRef.current.hasAnimated = true; | ||
}); | ||
function hasAnimatedStyleValue(style) { | ||
return Object.keys(style).some((k) => { | ||
const val = style[k]; | ||
return val && typeof val === "object" && "_animation" in val; | ||
}); | ||
} | ||
export { | ||
@@ -842,0 +848,0 @@ Spacer, |
@@ -47,3 +47,2 @@ import { | ||
componentName: true, | ||
role: true, | ||
tag: true | ||
@@ -391,3 +390,3 @@ }; | ||
isMedia = isMediaKey(key); | ||
isPseudo = validPseudoKeys[key]; | ||
isPseudo = key in validPseudoKeys; | ||
const isMediaOrPseudo = isMedia || isPseudo; | ||
@@ -579,3 +578,3 @@ if (!isMediaOrPseudo && usedKeys[key]) { | ||
if (!variants || !(key in variants)) { | ||
if (!skipProps[key]) { | ||
if (!(key in skipProps)) { | ||
viewProps[key] = val; | ||
@@ -582,0 +581,0 @@ usedKeys[key] = 1; |
const withStaticProperties = function(component, staticProps) { | ||
Object.assign(component, staticProps); | ||
return component; | ||
const next = typeof component === "function" ? component : { ...component }; | ||
Object.assign(next, staticProps); | ||
return next; | ||
}; | ||
@@ -5,0 +6,0 @@ export { |
@@ -0,2 +1,4 @@ | ||
import { jsx } from "react/jsx-runtime"; | ||
import { stylePropsAll } from "@tamagui/helpers"; | ||
import { forwardRef } from "react"; | ||
import { createComponent } from "./createComponent.js"; | ||
@@ -19,4 +21,20 @@ import { ReactNativeStaticConfigs } from "./setupReactNative.js"; | ||
} | ||
const parentStaticConfig = "staticConfig" in Component ? Component.staticConfig : null; | ||
const isTamagui = !!parentStaticConfig; | ||
const isReactNative = Boolean( | ||
ReactNativeStaticConfigs.has(Component) || (staticExtractionOptions == null ? void 0 : staticExtractionOptions.isReactNative) || ReactNativeStaticConfigs.has(parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isReactNative) | ||
); | ||
if (!isTamagui && !isReactNative) { | ||
if (process.env.NODE_ENV === "development") { | ||
if (options == null ? void 0 : options.variants) { | ||
console.warn( | ||
`Warning: wrapping a non-Tamagui element in styled() and passing variants isn't supported (yet).` | ||
); | ||
} | ||
} | ||
return forwardRef(function styled2(props, ref) { | ||
return /* @__PURE__ */ jsx(Component, { ref, ...options, ...props }); | ||
}); | ||
} | ||
const staticConfigProps = (() => { | ||
const parentStaticConfig = "staticConfig" in Component ? Component.staticConfig : null; | ||
if (options) { | ||
@@ -33,6 +51,2 @@ const { | ||
} | ||
const isReactNative = Boolean( | ||
ReactNativeStaticConfigs.has(Component) || ReactNativeStaticConfigs.has(parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isReactNative) || (staticExtractionOptions == null ? void 0 : staticExtractionOptions.isReactNative) | ||
); | ||
const isTamagui = !isReactNative && !!parentStaticConfig; | ||
const Comp = isReactNative ? (parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || Component : Component; | ||
@@ -65,5 +79,4 @@ const nativeConf = isReactNative && ReactNativeStaticConfigs.get(Comp) || null; | ||
} | ||
return {}; | ||
})(); | ||
const component = createComponent(staticConfigProps, Component); | ||
const component = createComponent(staticConfigProps || {}, Component); | ||
return component; | ||
@@ -70,0 +83,0 @@ } |
{ | ||
"name": "@tamagui/web", | ||
"version": "1.5.19", | ||
"version": "1.5.20", | ||
"source": "src/index.ts", | ||
@@ -30,9 +30,9 @@ "main": "dist/cjs", | ||
"dependencies": { | ||
"@tamagui/compose-refs": "^1.5.19", | ||
"@tamagui/constants": "^1.5.19", | ||
"@tamagui/helpers": "^1.5.19", | ||
"@tamagui/normalize-css-color": "^1.5.19", | ||
"@tamagui/use-did-finish-ssr": "^1.5.19", | ||
"@tamagui/use-event": "^1.5.19", | ||
"@tamagui/use-force-update": "^1.5.19" | ||
"@tamagui/compose-refs": "^1.5.20", | ||
"@tamagui/constants": "^1.5.20", | ||
"@tamagui/helpers": "^1.5.20", | ||
"@tamagui/normalize-css-color": "^1.5.20", | ||
"@tamagui/use-did-finish-ssr": "^1.5.20", | ||
"@tamagui/use-event": "^1.5.20", | ||
"@tamagui/use-force-update": "^1.5.20" | ||
}, | ||
@@ -43,3 +43,3 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@tamagui/build": "^1.5.19", | ||
"@tamagui/build": "^1.5.20", | ||
"@testing-library/react": "^13.4.0", | ||
@@ -46,0 +46,0 @@ "csstype": "^3.0.10", |
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
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
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
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
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
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
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
2021470
27976
228