@tamagui/web
Advanced tools
Comparing version 1.29.3 to 1.29.4
@@ -103,3 +103,10 @@ "use strict"; | ||
})(); | ||
const { isHOC } = staticConfig; | ||
const { | ||
Component, | ||
isText, | ||
isZStack, | ||
isHOC, | ||
validStyles: validStyles2 = {}, | ||
variants = {} | ||
} = staticConfig; | ||
const defaultComponentClassName = `is_${staticConfig.componentName}`; | ||
@@ -126,3 +133,3 @@ let defaultProps; | ||
} | ||
let contextProps; | ||
let styledContextProps; | ||
let overriddenContextProps; | ||
@@ -134,8 +141,13 @@ const { context } = staticConfig; | ||
for (const key in context.props) { | ||
const propVal = propsIn[key] || propsIn[inverseShorthands[key]]; | ||
const propVal = ( | ||
// because its after default props but before props this annoying amount of checks | ||
propsIn[key] || propsIn[inverseShorthands[key]] || defaultProps[key] || defaultProps[inverseShorthands[key]] | ||
); | ||
if (propVal == null) { | ||
if (contextValue && // is valid style or variant allow it | ||
(staticConfig.validStyles && key in staticConfig.validStyles || staticConfig.variants && key in staticConfig.variants)) { | ||
contextProps || (contextProps = {}); | ||
contextProps[key] = contextValue[key]; | ||
if (contextValue) { | ||
const isValidValue = key in validStyles2 || key in variants; | ||
if (isValidValue) { | ||
styledContextProps || (styledContextProps = {}); | ||
styledContextProps[key] = contextValue[key]; | ||
} | ||
} | ||
@@ -148,3 +160,3 @@ } else { | ||
} | ||
const curDefaultProps = contextProps ? { ...defaultProps, ...contextProps } : defaultProps; | ||
const curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps; | ||
let props; | ||
@@ -157,3 +169,2 @@ if (curDefaultProps && !propsIn.asChild) { | ||
const debugProp = props["debug"]; | ||
const { Component, isText, isZStack } = staticConfig; | ||
const componentName = props.componentName || staticConfig.componentName; | ||
@@ -278,3 +289,3 @@ const stateRef = (0, import_react.useRef)( | ||
themeState, | ||
styledContext: { contextProps, overriddenContextProps } | ||
styledContext: { contextProps: styledContextProps, overriddenContextProps } | ||
}); | ||
@@ -684,3 +695,3 @@ console.groupEnd(); | ||
const noClassNames = !staticConfig.acceptsClassName; | ||
const { name, variants, defaultVariants, ...restProps } = defaultPropsIn; | ||
const { name, variants: variants2, defaultVariants, ...restProps } = defaultPropsIn; | ||
defaultProps = restProps; | ||
@@ -721,11 +732,11 @@ if (staticConfig.isText && !defaultProps.fontFamily && conf.defaultFont) { | ||
} | ||
function extractable(Component) { | ||
Component.staticConfig = extendStyledConfig(); | ||
Component.styleable = styleable; | ||
return Component; | ||
function extractable(Component2) { | ||
Component2.staticConfig = extendStyledConfig(); | ||
Component2.styleable = styleable; | ||
return Component2; | ||
} | ||
function styleable(Component) { | ||
function styleable(Component2) { | ||
var _a; | ||
const isForwardedRefAlready = ((_a = Component.render) == null ? void 0 : _a.length) === 2; | ||
const ComponentForwardedRef = isForwardedRefAlready ? Component : (0, import_react.forwardRef)(Component); | ||
const isForwardedRefAlready = ((_a = Component2.render) == null ? void 0 : _a.length) === 2; | ||
const ComponentForwardedRef = isForwardedRefAlready ? Component2 : (0, import_react.forwardRef)(Component2); | ||
const extendedConfig = extendStyledConfig(); | ||
@@ -732,0 +743,0 @@ const out = (0, import_themeable.themeable)(ComponentForwardedRef, extendedConfig); |
@@ -187,6 +187,5 @@ "use strict"; | ||
const getNewCSS = (opts) => getCSS({ ...opts, sinceLastCall: true }); | ||
const fontKeys = Object.keys(configIn.fonts); | ||
const defaultFont = configIn.defaultFont || // uses font named "body" if present for compat | ||
("body" in configIn.fonts ? "body" : false) || // defaults to the first font to make life easier | ||
fontKeys[0]; | ||
Object.keys(configIn.fonts)[0]; | ||
const config = { | ||
@@ -193,0 +192,0 @@ onlyAllowShorthands: false, |
@@ -81,3 +81,10 @@ import { jsx } from "react/jsx-runtime"; | ||
})(); | ||
const { isHOC } = staticConfig; | ||
const { | ||
Component, | ||
isText, | ||
isZStack, | ||
isHOC, | ||
validStyles: validStyles2 = {}, | ||
variants = {} | ||
} = staticConfig; | ||
const defaultComponentClassName = `is_${staticConfig.componentName}`; | ||
@@ -104,3 +111,3 @@ let defaultProps; | ||
} | ||
let contextProps; | ||
let styledContextProps; | ||
let overriddenContextProps; | ||
@@ -112,8 +119,13 @@ const { context } = staticConfig; | ||
for (const key in context.props) { | ||
const propVal = propsIn[key] || propsIn[inverseShorthands[key]]; | ||
const propVal = ( | ||
// because its after default props but before props this annoying amount of checks | ||
propsIn[key] || propsIn[inverseShorthands[key]] || defaultProps[key] || defaultProps[inverseShorthands[key]] | ||
); | ||
if (propVal == null) { | ||
if (contextValue && // is valid style or variant allow it | ||
(staticConfig.validStyles && key in staticConfig.validStyles || staticConfig.variants && key in staticConfig.variants)) { | ||
contextProps ||= {}; | ||
contextProps[key] = contextValue[key]; | ||
if (contextValue) { | ||
const isValidValue = key in validStyles2 || key in variants; | ||
if (isValidValue) { | ||
styledContextProps ||= {}; | ||
styledContextProps[key] = contextValue[key]; | ||
} | ||
} | ||
@@ -126,3 +138,3 @@ } else { | ||
} | ||
const curDefaultProps = contextProps ? { ...defaultProps, ...contextProps } : defaultProps; | ||
const curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps; | ||
let props; | ||
@@ -135,3 +147,2 @@ if (curDefaultProps && !propsIn.asChild) { | ||
const debugProp = props["debug"]; | ||
const { Component, isText, isZStack } = staticConfig; | ||
const componentName = props.componentName || staticConfig.componentName; | ||
@@ -256,3 +267,3 @@ const stateRef = useRef( | ||
themeState, | ||
styledContext: { contextProps, overriddenContextProps } | ||
styledContext: { contextProps: styledContextProps, overriddenContextProps } | ||
}); | ||
@@ -662,3 +673,3 @@ console.groupEnd(); | ||
const noClassNames = !staticConfig.acceptsClassName; | ||
const { name, variants, defaultVariants, ...restProps } = defaultPropsIn; | ||
const { name, variants: variants2, defaultVariants, ...restProps } = defaultPropsIn; | ||
defaultProps = restProps; | ||
@@ -699,11 +710,11 @@ if (staticConfig.isText && !defaultProps.fontFamily && conf.defaultFont) { | ||
} | ||
function extractable(Component) { | ||
Component.staticConfig = extendStyledConfig(); | ||
Component.styleable = styleable; | ||
return Component; | ||
function extractable(Component2) { | ||
Component2.staticConfig = extendStyledConfig(); | ||
Component2.styleable = styleable; | ||
return Component2; | ||
} | ||
function styleable(Component) { | ||
function styleable(Component2) { | ||
var _a; | ||
const isForwardedRefAlready = ((_a = Component.render) == null ? void 0 : _a.length) === 2; | ||
const ComponentForwardedRef = isForwardedRefAlready ? Component : forwardRef(Component); | ||
const isForwardedRefAlready = ((_a = Component2.render) == null ? void 0 : _a.length) === 2; | ||
const ComponentForwardedRef = isForwardedRefAlready ? Component2 : forwardRef(Component2); | ||
const extendedConfig = extendStyledConfig(); | ||
@@ -710,0 +721,0 @@ const out = themeable(ComponentForwardedRef, extendedConfig); |
@@ -172,6 +172,5 @@ import { isRSC, isWeb } from "@tamagui/constants"; | ||
const getNewCSS = (opts) => getCSS({ ...opts, sinceLastCall: true }); | ||
const fontKeys = Object.keys(configIn.fonts); | ||
const defaultFont = configIn.defaultFont || // uses font named "body" if present for compat | ||
("body" in configIn.fonts ? "body" : false) || // defaults to the first font to make life easier | ||
fontKeys[0]; | ||
Object.keys(configIn.fonts)[0]; | ||
const config = { | ||
@@ -178,0 +177,0 @@ onlyAllowShorthands: false, |
{ | ||
"name": "@tamagui/web", | ||
"version": "1.29.3", | ||
"version": "1.29.4", | ||
"source": "src/index.ts", | ||
@@ -30,9 +30,9 @@ "main": "dist/cjs", | ||
"dependencies": { | ||
"@tamagui/compose-refs": "1.29.3", | ||
"@tamagui/constants": "1.29.3", | ||
"@tamagui/helpers": "1.29.3", | ||
"@tamagui/normalize-css-color": "1.29.3", | ||
"@tamagui/use-did-finish-ssr": "1.29.3", | ||
"@tamagui/use-event": "1.29.3", | ||
"@tamagui/use-force-update": "1.29.3" | ||
"@tamagui/compose-refs": "1.29.4", | ||
"@tamagui/constants": "1.29.4", | ||
"@tamagui/helpers": "1.29.4", | ||
"@tamagui/normalize-css-color": "1.29.4", | ||
"@tamagui/use-did-finish-ssr": "1.29.4", | ||
"@tamagui/use-event": "1.29.4", | ||
"@tamagui/use-force-update": "1.29.4" | ||
}, | ||
@@ -43,3 +43,3 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@tamagui/build": "1.29.3", | ||
"@tamagui/build": "1.29.4", | ||
"@testing-library/react": "^13.4.0", | ||
@@ -46,0 +46,0 @@ "csstype": "^3.0.10", |
@@ -244,4 +244,2 @@ import { isRSC, isWeb } from '@tamagui/constants' | ||
const fontKeys = Object.keys(configIn.fonts) | ||
const defaultFont = | ||
@@ -252,3 +250,3 @@ configIn.defaultFont || | ||
// defaults to the first font to make life easier | ||
fontKeys[0] | ||
Object.keys(configIn.fonts)[0] | ||
@@ -255,0 +253,0 @@ const config: TamaguiInternalConfig = { |
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
1174011
24802
+ Added@tamagui/compose-refs@1.29.4(transitive)
+ Added@tamagui/constants@1.29.4(transitive)
+ Added@tamagui/helpers@1.29.4(transitive)
+ Added@tamagui/normalize-css-color@1.29.4(transitive)
+ Added@tamagui/simple-hash@1.29.4(transitive)
+ Added@tamagui/use-did-finish-ssr@1.29.4(transitive)
+ Added@tamagui/use-event@1.29.4(transitive)
+ Added@tamagui/use-force-update@1.29.4(transitive)
- Removed@tamagui/compose-refs@1.29.3(transitive)
- Removed@tamagui/constants@1.29.3(transitive)
- Removed@tamagui/helpers@1.29.3(transitive)
- Removed@tamagui/normalize-css-color@1.29.3(transitive)
- Removed@tamagui/simple-hash@1.29.3(transitive)
- Removed@tamagui/use-did-finish-ssr@1.29.3(transitive)
- Removed@tamagui/use-event@1.29.3(transitive)
- Removed@tamagui/use-force-update@1.29.3(transitive)
Updated@tamagui/compose-refs@1.29.4
Updated@tamagui/constants@1.29.4
Updated@tamagui/helpers@1.29.4
Updated@tamagui/use-event@1.29.4