@tamagui/web 3.0.0-beta.765.1 → 3.0.0-beta.806.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createComponent.cjs +83 -86
- package/dist/cjs/createComponent.native.cjs +96 -103
- package/dist/cjs/createComponent.native.js +96 -103
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +9 -7
- package/dist/cjs/createTamagui.native.cjs +9 -7
- package/dist/cjs/createTamagui.native.js +9 -7
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.cjs +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +348 -0
- package/dist/cjs/helpers/directStyleCSS.native.cjs +20 -0
- package/dist/cjs/helpers/directStyleCSS.native.js +22 -0
- package/dist/cjs/helpers/directStyleCSS.native.js.map +1 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +40 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +46 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +48 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +1 -0
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +92 -74
- package/dist/cjs/helpers/{getFontLanguage.native.cjs → getCSSStylesAtomicCompiled.cjs} +12 -8
- package/dist/cjs/helpers/{getFontLanguage.native.js → getCSSStylesAtomicCompiled.native.cjs} +12 -8
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +36 -0
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
- package/dist/cjs/helpers/getSplitStyles.cjs +2417 -548
- package/dist/cjs/helpers/getSplitStyles.native.cjs +2758 -621
- package/dist/cjs/helpers/getSplitStyles.native.js +2758 -621
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.cjs +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.js +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +2 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +68 -5
- package/dist/cjs/helpers/insertStyleRule.native.js +68 -5
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/mediaState.cjs +12 -0
- package/dist/cjs/helpers/mediaState.native.cjs +12 -0
- package/dist/cjs/helpers/mediaState.native.js +12 -0
- package/dist/cjs/helpers/mediaState.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.cjs +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.cjs +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.js +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/resolveRem.cjs +1 -1
- package/dist/cjs/helpers/skipProps.cjs +6 -1
- package/dist/cjs/helpers/skipProps.native.cjs +6 -1
- package/dist/cjs/helpers/skipProps.native.js +6 -1
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +2 -8
- package/dist/cjs/helpers/styleFrontend.native.cjs +2 -10
- package/dist/cjs/helpers/styleFrontend.native.js +2 -10
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
- package/dist/cjs/helpers/styleToCSS.cjs +59 -0
- package/dist/cjs/helpers/{normalizeStylePropKeys.cjs → styleToCSS.native.cjs} +6 -4
- package/dist/cjs/helpers/{getFontLanguage.cjs → styleToCSS.native.js} +8 -4
- package/dist/cjs/helpers/styleToCSS.native.js.map +1 -0
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +28 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +45 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +45 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +3 -2
- package/dist/cjs/helpers/variables.native.cjs +3 -2
- package/dist/cjs/helpers/variables.native.js +3 -2
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +5 -3
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +3 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js +3 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +70 -89
- package/dist/cjs/hooks/useComponentState.native.cjs +70 -88
- package/dist/cjs/hooks/useComponentState.native.js +70 -88
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +3 -15
- package/dist/cjs/hooks/useMedia.native.cjs +3 -15
- package/dist/cjs/hooks/useMedia.native.js +3 -15
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useProps.cjs +7 -5
- package/dist/cjs/hooks/useProps.native.cjs +7 -5
- package/dist/cjs/hooks/useProps.native.js +7 -5
- package/dist/cjs/hooks/useProps.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +42 -0
- package/dist/cjs/hooks/useSplitStyles.native.cjs +42 -0
- package/dist/cjs/hooks/useSplitStyles.native.js +44 -0
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -0
- package/dist/cjs/index.cjs +184 -70
- package/dist/cjs/index.native.cjs +184 -70
- package/dist/cjs/index.native.js +184 -70
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/insertFont.cjs +1 -1
- package/dist/cjs/insertFont.native.cjs +1 -0
- package/dist/cjs/insertFont.native.js +1 -0
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +33 -6
- package/dist/cjs/internal-runtime.native.cjs +33 -6
- package/dist/cjs/internal-runtime.native.js +33 -6
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/setupReactNative.cjs +1 -29
- package/dist/cjs/setupReactNative.native.cjs +1 -3
- package/dist/cjs/setupReactNative.native.js +1 -3
- package/dist/cjs/setupReactNative.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +229 -0
- package/dist/cjs/static-resolve.native.cjs +242 -0
- package/dist/cjs/static-resolve.native.js +244 -0
- package/dist/cjs/static-resolve.native.js.map +1 -0
- package/dist/cjs/styled.cjs +23 -37
- package/dist/cjs/styled.native.cjs +22 -37
- package/dist/cjs/styled.native.js +22 -37
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +4 -8
- package/dist/cjs/views/TamaguiProvider.native.cjs +4 -8
- package/dist/cjs/views/TamaguiProvider.native.js +4 -8
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/ThemeUpdate.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +85 -88
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +98 -105
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +9 -7
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +9 -7
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +0 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +0 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/directStyleCSS.mjs +320 -0
- package/dist/esm/helpers/directStyleCSS.mjs.map +1 -0
- package/dist/esm/helpers/directStyleCSS.native.js +1 -0
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +11 -0
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +1 -0
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +15 -0
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +1 -0
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +86 -72
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +9 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +9 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
- package/dist/esm/helpers/getSplitStyles.mjs +2406 -545
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +2751 -618
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +8 -3
- package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +8 -3
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +2 -1
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +69 -3
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/mediaState.mjs +12 -1
- package/dist/esm/helpers/mediaState.mjs.map +1 -1
- package/dist/esm/helpers/mediaState.native.js +12 -1
- package/dist/esm/helpers/mediaState.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.mjs +16 -2
- package/dist/esm/helpers/normalizeStyle.mjs.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +16 -2
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/resolveRem.mjs +1 -1
- package/dist/esm/helpers/resolveRem.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +3 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +2 -4
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
- package/dist/esm/helpers/styleFrontend.native.js +2 -6
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
- package/dist/esm/helpers/styleToCSS.mjs +40 -0
- package/dist/esm/helpers/styleToCSS.mjs.map +1 -0
- package/dist/esm/helpers/styleToCSS.native.js +4 -0
- package/dist/esm/helpers/styleToCSS.native.js.map +1 -0
- package/dist/esm/helpers/subscribeToContextGroup.mjs +25 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +42 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +2 -1
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +2 -1
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +5 -3
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +3 -1
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +71 -90
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +71 -89
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -15
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -15
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useProps.mjs +7 -5
- package/dist/esm/hooks/useProps.mjs.map +1 -1
- package/dist/esm/hooks/useProps.native.js +7 -5
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +17 -0
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -0
- package/dist/esm/hooks/useSplitStyles.native.js +14 -0
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -0
- package/dist/esm/index.js +57 -137
- package/dist/esm/index.mjs +57 -137
- package/dist/esm/index.native.js +57 -137
- package/dist/esm/insertFont.mjs +1 -1
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +1 -0
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/internal-runtime.mjs +23 -4
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +23 -4
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +1 -29
- package/dist/esm/setupReactNative.mjs.map +1 -1
- package/dist/esm/setupReactNative.native.js +1 -3
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +194 -0
- package/dist/esm/static-resolve.mjs.map +1 -0
- package/dist/esm/static-resolve.native.js +205 -0
- package/dist/esm/static-resolve.native.js.map +1 -0
- package/dist/esm/styled.mjs +24 -40
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +23 -40
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +4 -8
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +4 -8
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/ThemeUpdate.mjs +1 -1
- package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.native.js +1 -1
- package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
- package/package.json +26 -16
- package/reset.css +3 -3
- package/src/createComponent.tsx +175 -192
- package/src/createTamagui.ts +10 -9
- package/src/helpers/defaultAnimationDriver.tsx +0 -1
- package/src/helpers/directStyleCSS.native.ts +1 -0
- package/src/helpers/directStyleCSS.ts +534 -0
- package/src/helpers/directStyleCSSCompiled.ts +32 -0
- package/src/helpers/getCSSStylesAtomic.ts +168 -88
- package/src/helpers/getCSSStylesAtomicCompiled.ts +9 -0
- package/src/helpers/getSplitStyles.tsx +4653 -1003
- package/src/helpers/getVariantExtras.tsx +15 -3
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/mediaState.ts +15 -0
- package/src/helpers/normalizeStyle.ts +27 -2
- package/src/helpers/resolveRem.ts +1 -1
- package/src/helpers/skipProps.ts +3 -0
- package/src/helpers/styleFrontend.ts +20 -27
- package/src/helpers/styleToCSS.native.ts +1 -0
- package/src/helpers/styleToCSS.ts +43 -0
- package/src/helpers/subscribeToContextGroup.tsx +30 -0
- package/src/helpers/variables.ts +2 -1
- package/src/helpers/warnOnce.ts +3 -4
- package/src/helpers/wrapStyleTags.tsx +1 -1
- package/src/hooks/useComponentState.ts +118 -158
- package/src/hooks/useMedia.tsx +2 -18
- package/src/hooks/useProps.tsx +19 -15
- package/src/hooks/useSplitStyles.tsx +26 -0
- package/src/index.ts +298 -73
- package/src/insertFont.ts +5 -1
- package/src/internal-runtime.ts +49 -24
- package/src/internalRuntimeTypes.ts +2 -7
- package/src/setupReactNative.ts +7 -30
- package/src/static-resolve.ts +396 -0
- package/src/styled.tsx +34 -11
- package/src/types.tsx +40 -30
- package/src/views/TamaguiProvider.tsx +23 -22
- package/src/views/ThemeUpdate.tsx +3 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/defaultAnimationDriver.d.ts.map +1 -1
- package/types/helpers/directStyleCSS.d.ts +28 -0
- package/types/helpers/directStyleCSS.d.ts.map +1 -0
- package/types/helpers/directStyleCSS.native.d.ts +2 -0
- package/types/helpers/directStyleCSS.native.d.ts.map +1 -0
- package/types/helpers/directStyleCSSCompiled.d.ts +10 -0
- package/types/helpers/directStyleCSSCompiled.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +22 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +4 -0
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts +11 -4
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/mediaState.d.ts +4 -0
- package/types/helpers/mediaState.d.ts.map +1 -1
- package/types/helpers/normalizeStyle.d.ts +1 -1
- package/types/helpers/normalizeStyle.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +2 -0
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +13 -17
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleToCSS.d.ts +2 -0
- package/types/helpers/styleToCSS.d.ts.map +1 -0
- package/types/helpers/styleToCSS.native.d.ts +2 -0
- package/types/helpers/styleToCSS.native.d.ts.map +1 -0
- package/types/helpers/subscribeToContextGroup.d.ts +1 -0
- package/types/helpers/subscribeToContextGroup.d.ts.map +1 -1
- package/types/helpers/variables.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +5 -0
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts +3 -2
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +1 -5
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts +3 -0
- package/types/hooks/useSplitStyles.d.ts.map +1 -0
- package/types/index.d.ts +58 -72
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +24 -11
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -6
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/setupReactNative.d.ts +2 -3
- package/types/setupReactNative.d.ts.map +1 -1
- package/types/static-resolve.d.ts +79 -0
- package/types/static-resolve.d.ts.map +1 -0
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +29 -22
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/ThemeUpdate.d.ts.map +1 -1
- package/dist/cjs/constants/accessibilityDirectMap.cjs +0 -34
- package/dist/cjs/constants/accessibilityDirectMap.native.cjs +0 -36
- package/dist/cjs/constants/accessibilityDirectMap.native.js +0 -38
- package/dist/cjs/constants/accessibilityDirectMap.native.js.map +0 -1
- package/dist/cjs/helpers/directStyle.cjs +0 -962
- package/dist/cjs/helpers/directStyle.native.cjs +0 -1165
- package/dist/cjs/helpers/directStyle.native.js +0 -1167
- package/dist/cjs/helpers/directStyle.native.js.map +0 -1
- package/dist/cjs/helpers/frontendProgram.cjs +0 -43
- package/dist/cjs/helpers/frontendProgram.native.cjs +0 -49
- package/dist/cjs/helpers/frontendProgram.native.js +0 -51
- package/dist/cjs/helpers/frontendProgram.native.js.map +0 -1
- package/dist/cjs/helpers/getFontLanguage.native.js.map +0 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs +0 -37
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js +0 -39
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +0 -1
- package/dist/cjs/helpers/propMapper.cjs +0 -384
- package/dist/cjs/helpers/propMapper.native.cjs +0 -536
- package/dist/cjs/helpers/propMapper.native.js +0 -538
- package/dist/cjs/helpers/propMapper.native.js.map +0 -1
- package/dist/cjs/helpers/useRenderElement.cjs +0 -47
- package/dist/cjs/helpers/useRenderElement.native.cjs +0 -53
- package/dist/cjs/helpers/useRenderElement.native.js +0 -55
- package/dist/cjs/helpers/useRenderElement.native.js.map +0 -1
- package/dist/esm/constants/accessibilityDirectMap.mjs +0 -8
- package/dist/esm/constants/accessibilityDirectMap.mjs.map +0 -1
- package/dist/esm/constants/accessibilityDirectMap.native.js +0 -8
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +0 -1
- package/dist/esm/helpers/directStyle.mjs +0 -929
- package/dist/esm/helpers/directStyle.mjs.map +0 -1
- package/dist/esm/helpers/directStyle.native.js +0 -1132
- package/dist/esm/helpers/directStyle.native.js.map +0 -1
- package/dist/esm/helpers/frontendProgram.mjs +0 -20
- package/dist/esm/helpers/frontendProgram.mjs.map +0 -1
- package/dist/esm/helpers/frontendProgram.native.js +0 -24
- package/dist/esm/helpers/frontendProgram.native.js.map +0 -1
- package/dist/esm/helpers/getFontLanguage.mjs +0 -4
- package/dist/esm/helpers/getFontLanguage.mjs.map +0 -1
- package/dist/esm/helpers/getFontLanguage.native.js +0 -6
- package/dist/esm/helpers/getFontLanguage.native.js.map +0 -1
- package/dist/esm/helpers/normalizeStylePropKeys.mjs +0 -4
- package/dist/esm/helpers/normalizeStylePropKeys.mjs.map +0 -1
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +0 -15
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +0 -1
- package/dist/esm/helpers/propMapper.mjs +0 -360
- package/dist/esm/helpers/propMapper.mjs.map +0 -1
- package/dist/esm/helpers/propMapper.native.js +0 -511
- package/dist/esm/helpers/propMapper.native.js.map +0 -1
- package/dist/esm/helpers/useRenderElement.mjs +0 -26
- package/dist/esm/helpers/useRenderElement.mjs.map +0 -1
- package/dist/esm/helpers/useRenderElement.native.js +0 -31
- package/dist/esm/helpers/useRenderElement.native.js.map +0 -1
- package/src/constants/accessibilityDirectMap.native.tsx +0 -10
- package/src/constants/accessibilityDirectMap.tsx +0 -11
- package/src/helpers/directStyle.ts +0 -2294
- package/src/helpers/frontendProgram.ts +0 -48
- package/src/helpers/getFontLanguage.ts +0 -2
- package/src/helpers/normalizeStylePropKeys.native.ts +0 -12
- package/src/helpers/normalizeStylePropKeys.ts +0 -3
- package/src/helpers/propMapper.ts +0 -721
- package/src/helpers/useRenderElement.tsx +0 -73
- package/types/constants/accessibilityDirectMap.d.ts +0 -6
- package/types/constants/accessibilityDirectMap.d.ts.map +0 -1
- package/types/constants/accessibilityDirectMap.native.d.ts +0 -6
- package/types/constants/accessibilityDirectMap.native.d.ts.map +0 -1
- package/types/helpers/directStyle.d.ts +0 -15
- package/types/helpers/directStyle.d.ts.map +0 -1
- package/types/helpers/frontendProgram.d.ts +0 -10
- package/types/helpers/frontendProgram.d.ts.map +0 -1
- package/types/helpers/getFontLanguage.d.ts +0 -2
- package/types/helpers/getFontLanguage.d.ts.map +0 -1
- package/types/helpers/normalizeStylePropKeys.d.ts +0 -2
- package/types/helpers/normalizeStylePropKeys.d.ts.map +0 -1
- package/types/helpers/normalizeStylePropKeys.native.d.ts +0 -13
- package/types/helpers/normalizeStylePropKeys.native.d.ts.map +0 -1
- package/types/helpers/propMapper.d.ts +0 -6
- package/types/helpers/propMapper.d.ts.map +0 -1
- package/types/helpers/useRenderElement.d.ts +0 -13
- package/types/helpers/useRenderElement.d.ts.map +0 -1
package/src/createComponent.tsx
CHANGED
|
@@ -21,8 +21,7 @@ import { defaultComponentStateMounted } from './defaultComponentState'
|
|
|
21
21
|
import { getWebEvents, useEvents, wrapWithGestureDetector } from './eventHandling'
|
|
22
22
|
import { getDefaultProps } from './helpers/getDefaultProps'
|
|
23
23
|
import { componentDisplayName } from './helpers/componentDisplayName'
|
|
24
|
-
import {
|
|
25
|
-
import { getSplitStyles, useSplitStyles } from './helpers/getSplitStyles'
|
|
24
|
+
import { getSplitStyles, prepareStyleStaticConfig } from './helpers/getSplitStyles'
|
|
26
25
|
import {
|
|
27
26
|
getNativeStyleEngine,
|
|
28
27
|
queueNativeViewState,
|
|
@@ -33,20 +32,24 @@ import { log } from './helpers/log'
|
|
|
33
32
|
import { type GenericProps, mergeComponentProps } from './helpers/mergeProps'
|
|
34
33
|
import { mergeRenderElementProps } from './helpers/mergeRenderElementProps'
|
|
35
34
|
import { getMedia } from './helpers/mediaState'
|
|
36
|
-
import { objectIdentityKey } from './helpers/objectIdentityKey'
|
|
37
35
|
import { usePointerEvents } from './helpers/pointerEvents'
|
|
38
36
|
import { extractPseudoState } from './helpers/extractPseudoState'
|
|
39
37
|
import { subscribeToSafeArea } from './helpers/resolveSafeAreaVariable'
|
|
40
38
|
import { setElementProps } from './helpers/setElementProps'
|
|
41
|
-
import {
|
|
39
|
+
import {
|
|
40
|
+
subscribeToContextGroup,
|
|
41
|
+
useGroupSetRevision,
|
|
42
|
+
} from './helpers/subscribeToContextGroup'
|
|
42
43
|
import { getStyleTags } from './helpers/wrapStyleTags'
|
|
43
44
|
import { useComponentState } from './hooks/useComponentState'
|
|
45
|
+
import { useSplitStyles } from './hooks/useSplitStyles'
|
|
44
46
|
import { setMediaShouldUpdate, useMedia } from './hooks/useMedia'
|
|
45
47
|
import { useThemeWithState } from './hooks/useTheme'
|
|
46
48
|
import type { TamaguiComponentEvents } from './interfaces/TamaguiComponentEvents'
|
|
47
49
|
import { hooks } from './setupHooks'
|
|
48
50
|
import type {
|
|
49
51
|
AllGroupContexts,
|
|
52
|
+
AnimationDriverLike,
|
|
50
53
|
ComponentGroupEmitter,
|
|
51
54
|
DebugProp,
|
|
52
55
|
GroupStateListener,
|
|
@@ -100,25 +103,6 @@ const groupPseudoKeys = [
|
|
|
100
103
|
'focusWithin',
|
|
101
104
|
] as const satisfies readonly (keyof PseudoGroupState)[]
|
|
102
105
|
|
|
103
|
-
function getStyledContextKeys(
|
|
104
|
-
staticConfig: StaticConfig,
|
|
105
|
-
styledContextValue: GenericProps | undefined
|
|
106
|
-
) {
|
|
107
|
-
const propKeys = staticConfig.contextProps || staticConfig.context?.propKeys
|
|
108
|
-
if (!propKeys) {
|
|
109
|
-
return styledContextValue
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const out: GenericProps = {}
|
|
113
|
-
for (const key of propKeys) {
|
|
114
|
-
out[key] = true
|
|
115
|
-
}
|
|
116
|
-
if (styledContextValue) {
|
|
117
|
-
Object.assign(out, styledContextValue)
|
|
118
|
-
}
|
|
119
|
-
return out
|
|
120
|
-
}
|
|
121
|
-
|
|
122
106
|
if (process.env.TAMAGUI_TARGET !== 'native' && typeof window !== 'undefined') {
|
|
123
107
|
const cancelPresses = () => {
|
|
124
108
|
// clear all press downs
|
|
@@ -283,9 +267,16 @@ export function createComponent<
|
|
|
283
267
|
)
|
|
284
268
|
}
|
|
285
269
|
|
|
270
|
+
prepareStyleStaticConfig(staticConfig)
|
|
271
|
+
|
|
286
272
|
let config: TamaguiInternalConfig | null = null
|
|
287
273
|
let resolvedDefaultProps: Record<string, any> | undefined
|
|
288
274
|
let didResolveDefaultProps = false
|
|
275
|
+
const styledContextPropKeys =
|
|
276
|
+
staticConfig.contextProps || staticConfig.context?.propKeys
|
|
277
|
+
const styledContextKeys = styledContextPropKeys
|
|
278
|
+
? new Set(styledContextPropKeys)
|
|
279
|
+
: undefined
|
|
289
280
|
|
|
290
281
|
const { Component, isText, isHOC } = staticConfig
|
|
291
282
|
|
|
@@ -350,7 +341,7 @@ export function createComponent<
|
|
|
350
341
|
|
|
351
342
|
// set variants through context
|
|
352
343
|
// order is after default props but before props
|
|
353
|
-
const { context
|
|
344
|
+
const { context } = staticConfig
|
|
354
345
|
const debugProp = propsIn['debug'] as DebugProp
|
|
355
346
|
|
|
356
347
|
const styledContextValue: GenericProps | undefined = context
|
|
@@ -419,17 +410,6 @@ export function createComponent<
|
|
|
419
410
|
props = nextProps as ViewProps | TextProps
|
|
420
411
|
overriddenContextProps = overrides
|
|
421
412
|
|
|
422
|
-
// frontend single pass (hoisted): the component's descriptor tokenizes className +
|
|
423
|
-
// flattens props ONCE here, so flat values and transition props are in place before
|
|
424
|
-
// the state machine / variant / animation driver below read them. preprocessProps
|
|
425
|
-
// marks its result, so getSplitStyles skips its own preprocess.
|
|
426
|
-
// components without a descriptor pay one property read.
|
|
427
|
-
if (staticConfig.styleFrontend) {
|
|
428
|
-
props = staticConfig.styleFrontend.preprocessProps(props, config) as
|
|
429
|
-
| ViewProps
|
|
430
|
-
| TextProps
|
|
431
|
-
}
|
|
432
|
-
|
|
433
413
|
if (process.env.NODE_ENV === 'development' && isClient) {
|
|
434
414
|
React.useEffect(() => {
|
|
435
415
|
let node: HTMLElement | undefined
|
|
@@ -496,27 +476,24 @@ export function createComponent<
|
|
|
496
476
|
const groupContextParent = React.useContext(GroupContext)
|
|
497
477
|
|
|
498
478
|
// Get animation driver - either from animatedBy prop lookup or context/config fallback
|
|
499
|
-
const animationDriver = (() => {
|
|
479
|
+
const animationDriver: AnimationDriverLike | null = (() => {
|
|
500
480
|
if (props.animatedBy && config) {
|
|
501
|
-
let selectedDriver
|
|
502
481
|
// check animationDrivers for multi-driver config
|
|
503
482
|
if (config.animationDrivers) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
selectedDriver = props.animatedBy === 'default' ? config.animations : null
|
|
483
|
+
return (
|
|
484
|
+
props.animatedBy in config.animationDrivers
|
|
485
|
+
? config.animationDrivers[props.animatedBy]
|
|
486
|
+
: config.animations
|
|
487
|
+
) as AnimationDriverLike | null
|
|
510
488
|
}
|
|
511
|
-
|
|
489
|
+
// single driver config - only 'default' makes sense
|
|
490
|
+
return props.animatedBy === 'default'
|
|
491
|
+
? (config.animations as AnimationDriverLike)
|
|
492
|
+
: null
|
|
512
493
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
resolveAnimationDriver(componentContext.animationDriver) ??
|
|
517
|
-
resolveAnimationDriver(config?.animations) ??
|
|
518
|
-
null
|
|
519
|
-
)
|
|
494
|
+
return (componentContext.animationDriver ??
|
|
495
|
+
config?.animations ??
|
|
496
|
+
null) as AnimationDriverLike | null
|
|
520
497
|
})()
|
|
521
498
|
|
|
522
499
|
const useAnimations = animationDriver?.isStub
|
|
@@ -532,10 +509,7 @@ export function createComponent<
|
|
|
532
509
|
|
|
533
510
|
const {
|
|
534
511
|
disabled,
|
|
535
|
-
groupName,
|
|
536
512
|
hasAnimationProp,
|
|
537
|
-
hasEnterStyle,
|
|
538
|
-
isAnimated,
|
|
539
513
|
isExiting,
|
|
540
514
|
isHydrated,
|
|
541
515
|
presence,
|
|
@@ -546,10 +520,15 @@ export function createComponent<
|
|
|
546
520
|
stateRef,
|
|
547
521
|
inputStyle,
|
|
548
522
|
outputStyle,
|
|
523
|
+
startedUnhydrated,
|
|
524
|
+
} = componentState
|
|
525
|
+
let { groupName } = componentState
|
|
526
|
+
let {
|
|
527
|
+
hasEnterStyle,
|
|
528
|
+
isAnimated,
|
|
549
529
|
willBeAnimated,
|
|
550
530
|
willBeAnimatedClient,
|
|
551
531
|
platformPseudo,
|
|
552
|
-
startedUnhydrated,
|
|
553
532
|
} = componentState
|
|
554
533
|
|
|
555
534
|
// adopt the props object useComponentState resolved: on the enter/exit presence
|
|
@@ -619,72 +598,6 @@ export function createComponent<
|
|
|
619
598
|
})
|
|
620
599
|
}, [platformPseudo, props.disabled])
|
|
621
600
|
|
|
622
|
-
// a component is a query container when any container prop says so; the
|
|
623
|
-
// boolean `container` is the unnamed inline-size shorthand (decision 17)
|
|
624
|
-
const containerName = props.containerName as string | undefined
|
|
625
|
-
const isContainer = !!(
|
|
626
|
-
props.container ||
|
|
627
|
-
containerName ||
|
|
628
|
-
(props.containerType && props.containerType !== 'normal')
|
|
629
|
-
)
|
|
630
|
-
|
|
631
|
-
// create new context with groups, or else sublings will grab the same one
|
|
632
|
-
const allGroupContexts = useMemo((): AllGroupContexts | null => {
|
|
633
|
-
if ((!groupName && !isContainer) || props.passThrough) {
|
|
634
|
-
return groupContextParent
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
const listeners = new Set<GroupStateListener>()
|
|
638
|
-
stateRef.current.group?.listeners?.clear()
|
|
639
|
-
stateRef.current.group = {
|
|
640
|
-
listeners,
|
|
641
|
-
emit(state) {
|
|
642
|
-
listeners.forEach((l) => l(state))
|
|
643
|
-
},
|
|
644
|
-
subscribe(cb) {
|
|
645
|
-
listeners.add(cb)
|
|
646
|
-
if (listeners.size === 1) {
|
|
647
|
-
setStateShallow({ hasDynGroupChildren: true })
|
|
648
|
-
}
|
|
649
|
-
return () => {
|
|
650
|
-
listeners.delete(cb)
|
|
651
|
-
if (listeners.size === 0) {
|
|
652
|
-
setStateShallow({ hasDynGroupChildren: false })
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
},
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
// one entry object serves every key this component provides: the group
|
|
659
|
-
// name and the container keys share the same state and emitter
|
|
660
|
-
const entry: SingleGroupContext = {
|
|
661
|
-
state: {
|
|
662
|
-
pseudo: defaultComponentStateMounted,
|
|
663
|
-
},
|
|
664
|
-
subscribe: (listener) => {
|
|
665
|
-
const dispose = stateRef.current.group?.subscribe(listener)
|
|
666
|
-
return () => {
|
|
667
|
-
dispose?.()
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
const next: AllGroupContexts = { ...groupContextParent }
|
|
673
|
-
if (groupName) {
|
|
674
|
-
next[groupName] = entry
|
|
675
|
-
}
|
|
676
|
-
if (isContainer) {
|
|
677
|
-
// `@sm:` reads the nearest container of any name, so every container
|
|
678
|
-
// writes the `@` key; a named one also writes `@name`. group names
|
|
679
|
-
// cannot contain `@`, so the namespaces never collide
|
|
680
|
-
next['@'] = entry
|
|
681
|
-
if (containerName) {
|
|
682
|
-
next[`@${containerName}`] = entry
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
return next
|
|
686
|
-
}, [stateRef, groupName, containerName, isContainer, groupContextParent])
|
|
687
|
-
|
|
688
601
|
// if our animation driver supports avoidReRenders, we'll replace this below with
|
|
689
602
|
// a version that essentially uses an internall emitter rather than setting state
|
|
690
603
|
// but still stores the current state and applies if it it needs to during render
|
|
@@ -764,7 +677,6 @@ export function createComponent<
|
|
|
764
677
|
const type =
|
|
765
678
|
(hasEnterStyle ? '(hasEnter)' : ' ') +
|
|
766
679
|
(isAnimated ? '(animated)' : ' ') +
|
|
767
|
-
(isReactNative ? '(rnw)' : ' ') +
|
|
768
680
|
(noClass ? '(noClass)' : ' ') +
|
|
769
681
|
(state.press || state.pressIn ? '(PRESSED)' : ' ') +
|
|
770
682
|
(state.hover ? '(HOVERED)' : ' ') +
|
|
@@ -792,7 +704,7 @@ export function createComponent<
|
|
|
792
704
|
|
|
793
705
|
console.groupCollapsed(`${childLog} [inspect props, state, context 👇]`)
|
|
794
706
|
log('props in:', propsIn)
|
|
795
|
-
log('final props:', props
|
|
707
|
+
log('final props:', props)
|
|
796
708
|
log({ state, staticConfig, elementType, themeStateProps })
|
|
797
709
|
log({
|
|
798
710
|
context,
|
|
@@ -848,8 +760,10 @@ export function createComponent<
|
|
|
848
760
|
isExiting,
|
|
849
761
|
isAnimated,
|
|
850
762
|
willBeAnimated,
|
|
763
|
+
canPlatformPseudo: componentState.platformPseudo,
|
|
851
764
|
displayName,
|
|
852
|
-
styledContext:
|
|
765
|
+
styledContext: styledContextValue,
|
|
766
|
+
styledContextKeys,
|
|
853
767
|
} as const
|
|
854
768
|
|
|
855
769
|
const themeName = themeState?.name || ''
|
|
@@ -865,13 +779,91 @@ export function createComponent<
|
|
|
865
779
|
styleProps,
|
|
866
780
|
null,
|
|
867
781
|
componentContext,
|
|
868
|
-
|
|
782
|
+
groupContextParent,
|
|
869
783
|
elementType,
|
|
870
784
|
startedUnhydrated,
|
|
871
785
|
debugProp,
|
|
872
786
|
animationDriver
|
|
873
787
|
)
|
|
874
788
|
|
|
789
|
+
const finalizedComponentState = componentState.finalizeStyleFlags(
|
|
790
|
+
!!splitStyles?.hasEnterStyle,
|
|
791
|
+
!!splitStyles?.platformPseudo
|
|
792
|
+
)
|
|
793
|
+
hasEnterStyle = finalizedComponentState.hasEnterStyle
|
|
794
|
+
isAnimated = finalizedComponentState.isAnimated
|
|
795
|
+
willBeAnimated = finalizedComponentState.willBeAnimated
|
|
796
|
+
willBeAnimatedClient = finalizedComponentState.willBeAnimatedClient
|
|
797
|
+
platformPseudo = finalizedComponentState.platformPseudo
|
|
798
|
+
|
|
799
|
+
groupName = (splitStyles?.frontendGroup ?? groupName) as typeof groupName
|
|
800
|
+
const containerProp = splitStyles?.frontendContainer ?? props.container
|
|
801
|
+
const containerName =
|
|
802
|
+
(props.containerName as string | undefined) ||
|
|
803
|
+
(typeof containerProp === 'string' ? containerProp : undefined)
|
|
804
|
+
const containerType =
|
|
805
|
+
(splitStyles?.frontendContainerType as string | undefined) ||
|
|
806
|
+
(props.containerType as string | undefined) ||
|
|
807
|
+
(containerProp ? 'inline-size' : undefined)
|
|
808
|
+
const isContainer = !!containerType && containerType !== 'normal'
|
|
809
|
+
|
|
810
|
+
// create new context with groups, or else siblings will grab the same one
|
|
811
|
+
const allGroupContexts = useMemo((): AllGroupContexts | null => {
|
|
812
|
+
if ((!groupName && !isContainer) || props.passThrough) {
|
|
813
|
+
return groupContextParent
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
const listeners = new Set<GroupStateListener>()
|
|
817
|
+
stateRef.current.group?.listeners?.clear()
|
|
818
|
+
stateRef.current.group = {
|
|
819
|
+
listeners,
|
|
820
|
+
emit(state) {
|
|
821
|
+
listeners.forEach((l) => l(state))
|
|
822
|
+
},
|
|
823
|
+
subscribe(cb) {
|
|
824
|
+
listeners.add(cb)
|
|
825
|
+
if (listeners.size === 1) {
|
|
826
|
+
setStateShallow({ hasDynGroupChildren: true })
|
|
827
|
+
}
|
|
828
|
+
return () => {
|
|
829
|
+
listeners.delete(cb)
|
|
830
|
+
if (listeners.size === 0) {
|
|
831
|
+
setStateShallow({ hasDynGroupChildren: false })
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
// one entry object serves every key this component provides: the group
|
|
838
|
+
// name and the container keys share the same state and emitter
|
|
839
|
+
const entry: SingleGroupContext = {
|
|
840
|
+
state: {
|
|
841
|
+
pseudo: defaultComponentStateMounted,
|
|
842
|
+
},
|
|
843
|
+
subscribe: (listener) => {
|
|
844
|
+
const dispose = stateRef.current.group?.subscribe(listener)
|
|
845
|
+
return () => {
|
|
846
|
+
dispose?.()
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
const next: AllGroupContexts = { ...groupContextParent }
|
|
852
|
+
if (groupName) {
|
|
853
|
+
next[groupName] = entry
|
|
854
|
+
}
|
|
855
|
+
if (isContainer) {
|
|
856
|
+
// `@sm:` reads the nearest container of any name, so every container
|
|
857
|
+
// writes the `@` key; a named one also writes `@name`. group names
|
|
858
|
+
// cannot contain `@`, so the namespaces never collide
|
|
859
|
+
next['@'] = entry
|
|
860
|
+
if (containerName) {
|
|
861
|
+
next[`@${containerName}`] = entry
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
return next
|
|
865
|
+
}, [stateRef, groupName, containerName, isContainer, groupContextParent])
|
|
866
|
+
|
|
875
867
|
const isPassthrough = !splitStyles
|
|
876
868
|
|
|
877
869
|
// splitStyles === null === passThrough
|
|
@@ -1058,7 +1050,7 @@ export function createComponent<
|
|
|
1058
1050
|
!isPassthrough &&
|
|
1059
1051
|
groupContext &&
|
|
1060
1052
|
// avoids onLayout if we don't need it
|
|
1061
|
-
|
|
1053
|
+
isContainer
|
|
1062
1054
|
) {
|
|
1063
1055
|
const groupState = groupContext?.state
|
|
1064
1056
|
if (groupState && groupState.layout === undefined) {
|
|
@@ -1209,9 +1201,13 @@ export function createComponent<
|
|
|
1209
1201
|
}
|
|
1210
1202
|
|
|
1211
1203
|
// one thing we have to handle here and where it gets a bit more complex is group styles
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1204
|
+
let canAvoidReRender = true
|
|
1205
|
+
for (const key in next) {
|
|
1206
|
+
if (!avoidReRenderKeys.has(key)) {
|
|
1207
|
+
canAvoidReRender = false
|
|
1208
|
+
break
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1215
1211
|
|
|
1216
1212
|
const updatedState = {
|
|
1217
1213
|
...prev,
|
|
@@ -1296,6 +1292,7 @@ export function createComponent<
|
|
|
1296
1292
|
pseudoGroups,
|
|
1297
1293
|
mediaGroups,
|
|
1298
1294
|
} = splitStyles || {}
|
|
1295
|
+
const groupSetRevision = useGroupSetRevision(pseudoGroups, mediaGroups)
|
|
1299
1296
|
|
|
1300
1297
|
const propsWithAnimation = props as UseAnimationProps
|
|
1301
1298
|
|
|
@@ -1327,8 +1324,7 @@ export function createComponent<
|
|
|
1327
1324
|
...nonTamaguiProps
|
|
1328
1325
|
} = viewPropsIn || {}
|
|
1329
1326
|
|
|
1330
|
-
// these can ultimately be for DOM
|
|
1331
|
-
// so the type is pretty loose
|
|
1327
|
+
// these can ultimately be for DOM or custom animated views, so the type is loose
|
|
1332
1328
|
let viewProps = nonTamaguiProps
|
|
1333
1329
|
|
|
1334
1330
|
if (props.forceStyle) {
|
|
@@ -1432,9 +1428,9 @@ export function createComponent<
|
|
|
1432
1428
|
viewProps.className = `t_exiting ${viewProps.className || ''}`
|
|
1433
1429
|
}
|
|
1434
1430
|
|
|
1435
|
-
if (process.env.NODE_ENV === 'development' && props.untilMeasured && !
|
|
1431
|
+
if (process.env.NODE_ENV === 'development' && props.untilMeasured && !isContainer) {
|
|
1436
1432
|
console.warn(
|
|
1437
|
-
`You set
|
|
1433
|
+
`You set untilMeasured without establishing a container. Set it on the parent with container or container="name", not on the child using a container clause.`
|
|
1438
1434
|
)
|
|
1439
1435
|
}
|
|
1440
1436
|
|
|
@@ -1443,7 +1439,7 @@ export function createComponent<
|
|
|
1443
1439
|
if (
|
|
1444
1440
|
!isPassthrough &&
|
|
1445
1441
|
groupContext && // avoids onLayout if we don't need it
|
|
1446
|
-
|
|
1442
|
+
isContainer
|
|
1447
1443
|
) {
|
|
1448
1444
|
nonTamaguiProps.onLayout = composeEventHandlers(
|
|
1449
1445
|
nonTamaguiProps.onLayout,
|
|
@@ -1503,7 +1499,7 @@ export function createComponent<
|
|
|
1503
1499
|
usePointerEvents(props, viewProps)
|
|
1504
1500
|
|
|
1505
1501
|
if (process.env.NODE_ENV === 'development') {
|
|
1506
|
-
if (!
|
|
1502
|
+
if (!isText && isWeb && !isHOC) {
|
|
1507
1503
|
React.Children.toArray(props.children).forEach((item) => {
|
|
1508
1504
|
// allow newlines because why not its annoying with mdx
|
|
1509
1505
|
if (typeof item === 'string' && item !== '\n') {
|
|
@@ -1606,7 +1602,9 @@ export function createComponent<
|
|
|
1606
1602
|
disposeSafeArea = subscribeToSafeArea(updateSafeArea)
|
|
1607
1603
|
// close the render-to-subscribe race: the provider tracker may have
|
|
1608
1604
|
// published new insets after this component evaluated its styles.
|
|
1609
|
-
|
|
1605
|
+
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
1606
|
+
updateSafeArea()
|
|
1607
|
+
}
|
|
1610
1608
|
}
|
|
1611
1609
|
|
|
1612
1610
|
if (disabled) return disposeSafeArea
|
|
@@ -1624,13 +1622,7 @@ export function createComponent<
|
|
|
1624
1622
|
disposeSafeArea()
|
|
1625
1623
|
disposeGroup?.()
|
|
1626
1624
|
}
|
|
1627
|
-
}, [
|
|
1628
|
-
allGroupContexts,
|
|
1629
|
-
disabled,
|
|
1630
|
-
splitStyles?.usesSafeArea,
|
|
1631
|
-
pseudoGroups ? objectIdentityKey(pseudoGroups) : 0,
|
|
1632
|
-
mediaGroups ? objectIdentityKey(mediaGroups) : 0,
|
|
1633
|
-
])
|
|
1625
|
+
}, [allGroupContexts, disabled, splitStyles?.usesSafeArea, groupSetRevision])
|
|
1634
1626
|
|
|
1635
1627
|
const groupEmitter = stateRef.current.group
|
|
1636
1628
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -1846,7 +1838,7 @@ export function createComponent<
|
|
|
1846
1838
|
})
|
|
1847
1839
|
}
|
|
1848
1840
|
|
|
1849
|
-
if (process.env.TAMAGUI_TARGET === 'web' && events
|
|
1841
|
+
if (process.env.TAMAGUI_TARGET === 'web' && events) {
|
|
1850
1842
|
Object.assign(viewProps, getWebEvents(events))
|
|
1851
1843
|
}
|
|
1852
1844
|
|
|
@@ -1856,38 +1848,39 @@ export function createComponent<
|
|
|
1856
1848
|
log(`events`, { events, attachHover, attachPress })
|
|
1857
1849
|
}
|
|
1858
1850
|
|
|
1859
|
-
const propsWithHref = props as typeof props & { href?: unknown }
|
|
1860
|
-
const propsInWithHref = propsIn as typeof propsIn & { href?: unknown }
|
|
1861
|
-
|
|
1862
|
-
const pressDebugDetail =
|
|
1863
|
-
props.testID ??
|
|
1864
|
-
propsIn.testID ??
|
|
1865
|
-
props.accessibilityLabel ??
|
|
1866
|
-
propsIn.accessibilityLabel ??
|
|
1867
|
-
(typeof propsWithHref.href === 'string' ? propsWithHref.href : null) ??
|
|
1868
|
-
(typeof propsInWithHref.href === 'string' ? propsInWithHref.href : null)
|
|
1869
|
-
|
|
1870
|
-
const pressDebugName =
|
|
1871
|
-
[displayName, pressDebugDetail].filter(Boolean).join(':') || null
|
|
1872
|
-
|
|
1873
1851
|
// EVENTS native - handles focus/blur, input special cases, and RNGH press handling
|
|
1874
1852
|
// Skip gesture setup for HOC components - they may return null which crashes GestureDetector
|
|
1875
1853
|
// hasRealPressEvents distinguishes user-provided handlers from events.onPress
|
|
1876
1854
|
// synthesized for press clauses alone — only the former should claim the responder.
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1855
|
+
let hasRealPressEvents = false
|
|
1856
|
+
let pressGesture: ReturnType<typeof useEvents> = null
|
|
1857
|
+
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
1858
|
+
const propsWithHref = props as typeof props & { href?: unknown }
|
|
1859
|
+
const propsInWithHref = propsIn as typeof propsIn & { href?: unknown }
|
|
1860
|
+
const pressDebugDetail =
|
|
1861
|
+
props.testID ??
|
|
1862
|
+
propsIn.testID ??
|
|
1863
|
+
props.accessibilityLabel ??
|
|
1864
|
+
propsIn.accessibilityLabel ??
|
|
1865
|
+
(typeof propsWithHref.href === 'string' ? propsWithHref.href : null) ??
|
|
1866
|
+
(typeof propsInWithHref.href === 'string' ? propsInWithHref.href : null)
|
|
1867
|
+
const pressDebugName = displayName
|
|
1868
|
+
? pressDebugDetail
|
|
1869
|
+
? `${displayName}:${pressDebugDetail}`
|
|
1870
|
+
: displayName
|
|
1871
|
+
: pressDebugDetail || null
|
|
1872
|
+
hasRealPressEvents = !!(onPress || onPressIn || onPressOut || onLongPress)
|
|
1873
|
+
pressGesture = useEvents(
|
|
1874
|
+
events,
|
|
1875
|
+
viewProps,
|
|
1876
|
+
stateRef,
|
|
1877
|
+
staticConfig,
|
|
1878
|
+
isHOC,
|
|
1879
|
+
isInsideNativeMenu,
|
|
1880
|
+
pressDebugName,
|
|
1881
|
+
hasRealPressEvents
|
|
1882
|
+
)
|
|
1883
|
+
}
|
|
1891
1884
|
|
|
1892
1885
|
if (process.env.NODE_ENV === 'development' && time) time`hooks`
|
|
1893
1886
|
|
|
@@ -2040,12 +2033,10 @@ export function createComponent<
|
|
|
2040
2033
|
)
|
|
2041
2034
|
}
|
|
2042
2035
|
|
|
2043
|
-
// containers provide the same context channel groups do
|
|
2044
|
-
//
|
|
2045
|
-
//
|
|
2046
|
-
|
|
2047
|
-
// real parent/descendant integration; injected-context tests masked it)
|
|
2048
|
-
if ('group' in props || isContainer) {
|
|
2036
|
+
// containers provide the same context channel groups do. Mount the
|
|
2037
|
+
// provider whenever the resolved component establishes either capability
|
|
2038
|
+
// so descendant clauses can subscribe.
|
|
2039
|
+
if (groupName || isContainer) {
|
|
2049
2040
|
content = (
|
|
2050
2041
|
<GroupContext.Provider value={allGroupContexts}>{content}</GroupContext.Provider>
|
|
2051
2042
|
)
|
|
@@ -2069,19 +2060,6 @@ export function createComponent<
|
|
|
2069
2060
|
|
|
2070
2061
|
if (process.env.NODE_ENV === 'development' && time) time`themed-children`
|
|
2071
2062
|
|
|
2072
|
-
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
2073
|
-
if (isReactNative && !asChild) {
|
|
2074
|
-
content = (
|
|
2075
|
-
<span
|
|
2076
|
-
className="_dsp_contents"
|
|
2077
|
-
{...(!isPassthrough && isHydrated && events && getWebEvents(events))}
|
|
2078
|
-
>
|
|
2079
|
-
{content}
|
|
2080
|
-
</span>
|
|
2081
|
-
)
|
|
2082
|
-
}
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
2063
|
if (overriddenContextProps && contextForOverride) {
|
|
2086
2064
|
const Provider = contextForOverride.Provider!
|
|
2087
2065
|
|
|
@@ -2103,7 +2081,12 @@ export function createComponent<
|
|
|
2103
2081
|
|
|
2104
2082
|
// SSR style support - for non compiled styles we render them inline until client takes over
|
|
2105
2083
|
// on client we then switch over to our global sheet insert, because rendering inline is expensive
|
|
2106
|
-
if (
|
|
2084
|
+
if (
|
|
2085
|
+
!process.env.TAMAGUI_DID_OUTPUT_CSS &&
|
|
2086
|
+
process.env.TAMAGUI_TARGET === 'web' &&
|
|
2087
|
+
startedUnhydrated &&
|
|
2088
|
+
splitStyles
|
|
2089
|
+
) {
|
|
2107
2090
|
content = (
|
|
2108
2091
|
<>
|
|
2109
2092
|
{content}
|
package/src/createTamagui.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { parseFont, registerFontVariables } from './insertFont'
|
|
|
20
20
|
import { Tamagui } from './Tamagui'
|
|
21
21
|
import type {
|
|
22
22
|
CreateTamaguiProps,
|
|
23
|
+
AnimationDriverLike,
|
|
23
24
|
DedupedTheme,
|
|
24
25
|
DedupedThemes,
|
|
25
26
|
GenericFont,
|
|
@@ -249,10 +250,13 @@ export function createTamagui<Conf extends CreateTamaguiProps>(
|
|
|
249
250
|
const resolvedDriver = resolveAnimationDriver(inputAnimations)
|
|
250
251
|
// multi-driver when resolveAnimationDriver extracted .default (returned different ref)
|
|
251
252
|
const isMultiDriver = resolvedDriver !== null && resolvedDriver !== inputAnimations
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
let animationDrivers: Record<string, AnimationDriverLike | null> | undefined
|
|
254
|
+
if (isMultiDriver) {
|
|
255
|
+
animationDrivers = {}
|
|
256
|
+
for (const name in inputAnimations) {
|
|
257
|
+
animationDrivers[name] = resolveAnimationDriver(inputAnimations[name])
|
|
258
|
+
}
|
|
259
|
+
}
|
|
256
260
|
|
|
257
261
|
const config: TamaguiInternalConfig = {
|
|
258
262
|
fonts: {},
|
|
@@ -261,12 +265,9 @@ export function createTamagui<Conf extends CreateTamaguiProps>(
|
|
|
261
265
|
media: {},
|
|
262
266
|
...configIn,
|
|
263
267
|
// normalized animations (resolved from multi-driver format if needed)
|
|
264
|
-
animations:
|
|
268
|
+
animations: resolvedDriver ?? defaultAnimationDriver,
|
|
265
269
|
animationDrivers,
|
|
266
|
-
settings:
|
|
267
|
-
webContainerType: 'inline-size',
|
|
268
|
-
...settingsIn,
|
|
269
|
-
},
|
|
270
|
+
settings: settingsIn,
|
|
270
271
|
tokens: tokens as any,
|
|
271
272
|
// vite made this into a function if it wasn't set
|
|
272
273
|
shorthands,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './directStyleCSSCompiled'
|