@tamagui/web 1.135.2 → 1.135.4-1761748186554
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/Tamagui.cjs +1 -1
- package/dist/cjs/Tamagui.js +1 -1
- package/dist/cjs/Tamagui.js.map +1 -1
- package/dist/cjs/Tamagui.native.js +58 -54
- package/dist/cjs/Tamagui.native.js.map +1 -6
- package/dist/cjs/_withStableStyle.cjs +1 -1
- package/dist/cjs/_withStableStyle.js +1 -1
- package/dist/cjs/_withStableStyle.js.map +1 -1
- package/dist/cjs/_withStableStyle.native.js +39 -26
- package/dist/cjs/_withStableStyle.native.js.map +1 -6
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/config.native.js +95 -87
- package/dist/cjs/config.native.js.map +1 -6
- package/dist/cjs/constants/accessibilityDirectMap.native.js +21 -18
- package/dist/cjs/constants/accessibilityDirectMap.native.js.map +1 -6
- package/dist/cjs/constants/constants.native.js +33 -30
- package/dist/cjs/constants/constants.native.js.map +1 -6
- package/dist/cjs/constants/isDevTools.native.js +21 -20
- package/dist/cjs/constants/isDevTools.native.js.map +1 -6
- package/dist/cjs/constants/webToNativeProps.native.js +99 -172
- package/dist/cjs/constants/webToNativeProps.native.js.map +1 -6
- package/dist/cjs/contexts/ComponentContext.cjs +11 -8
- package/dist/cjs/contexts/ComponentContext.js +4 -3
- package/dist/cjs/contexts/ComponentContext.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.native.js +31 -22
- package/dist/cjs/contexts/ComponentContext.native.js.map +1 -6
- package/dist/cjs/contexts/GroupContext.native.js +19 -15
- package/dist/cjs/contexts/GroupContext.native.js.map +1 -6
- package/dist/cjs/createComponent.cjs +1 -1
- package/dist/cjs/createComponent.js +1 -1
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +501 -366
- package/dist/cjs/createComponent.native.js.map +1 -6
- package/dist/cjs/createFont.native.js +39 -51
- package/dist/cjs/createFont.native.js.map +1 -6
- package/dist/cjs/createShorthands.native.js +17 -14
- package/dist/cjs/createShorthands.native.js.map +1 -6
- package/dist/cjs/createTamagui.js.map +1 -1
- package/dist/cjs/createTamagui.native.js +131 -112
- package/dist/cjs/createTamagui.native.js.map +1 -6
- package/dist/cjs/createTheme.native.js +18 -15
- package/dist/cjs/createTheme.native.js.map +1 -6
- package/dist/cjs/createTokens.js.map +1 -1
- package/dist/cjs/createTokens.native.js +18 -15
- package/dist/cjs/createTokens.native.js.map +1 -6
- package/dist/cjs/createVariable.js.map +1 -1
- package/dist/cjs/createVariable.native.js +52 -47
- package/dist/cjs/createVariable.native.js.map +1 -6
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/createVariables.native.js +62 -44
- package/dist/cjs/createVariables.native.js.map +1 -6
- package/dist/cjs/defaultComponentState.native.js +34 -31
- package/dist/cjs/defaultComponentState.native.js.map +1 -6
- package/dist/cjs/helpers/consoleLog.native.js +18 -16
- package/dist/cjs/helpers/consoleLog.native.js.map +1 -6
- package/dist/cjs/helpers/createMediaStyle.native.js +82 -58
- package/dist/cjs/helpers/createMediaStyle.native.js.map +1 -6
- package/dist/cjs/helpers/createStyledContext.cjs +1 -1
- package/dist/cjs/helpers/createStyledContext.js +1 -1
- package/dist/cjs/helpers/createStyledContext.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.js +66 -44
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -6
- package/dist/cjs/helpers/defaultOffset.native.js +17 -14
- package/dist/cjs/helpers/defaultOffset.native.js.map +1 -6
- package/dist/cjs/helpers/expandStyle.native.js +58 -95
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -6
- package/dist/cjs/helpers/expandStyles.native.js +31 -27
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -6
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js +22 -18
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -6
- package/dist/cjs/helpers/getDynamicVal.native.js +24 -18
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -6
- package/dist/cjs/helpers/getExpandedShorthands.native.js +21 -19
- package/dist/cjs/helpers/getExpandedShorthands.native.js.map +1 -6
- package/dist/cjs/helpers/getFontLanguage.native.js +18 -15
- package/dist/cjs/helpers/getFontLanguage.native.js.map +1 -6
- package/dist/cjs/helpers/getGroupPropParts.native.js +22 -16
- package/dist/cjs/helpers/getGroupPropParts.native.js.map +1 -6
- package/dist/cjs/helpers/getShorthandValue.native.js +24 -19
- package/dist/cjs/helpers/getShorthandValue.native.js.map +1 -6
- package/dist/cjs/helpers/getSplitStyles.cjs +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +1 -1
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +346 -271
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -6
- package/dist/cjs/helpers/getThemeCSSRules.cjs +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.native.js +16 -13
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +1 -6
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.native.js +48 -43
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -6
- package/dist/cjs/helpers/insertStyleRule.native.js +138 -112
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -6
- package/dist/cjs/helpers/isActivePlatform.native.js +20 -17
- package/dist/cjs/helpers/isActivePlatform.native.js.map +1 -6
- package/dist/cjs/helpers/isActiveTheme.native.js +18 -16
- package/dist/cjs/helpers/isActiveTheme.native.js.map +1 -6
- package/dist/cjs/helpers/isObj.native.js +24 -16
- package/dist/cjs/helpers/isObj.native.js.map +1 -6
- package/dist/cjs/helpers/isTamaguiComponent.native.js +18 -15
- package/dist/cjs/helpers/isTamaguiComponent.native.js.map +1 -6
- package/dist/cjs/helpers/isTamaguiElement.cjs +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.native.js +28 -20
- package/dist/cjs/helpers/isTamaguiElement.native.js.map +1 -6
- package/dist/cjs/helpers/log.native.js +19 -17
- package/dist/cjs/helpers/log.native.js.map +1 -6
- package/dist/cjs/helpers/matchMedia.native.js +24 -24
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -6
- package/dist/cjs/helpers/mergeProps.native.js +41 -48
- package/dist/cjs/helpers/mergeProps.native.js.map +1 -6
- package/dist/cjs/helpers/mergeVariants.native.js +22 -17
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -6
- package/dist/cjs/helpers/normalizeColor.native.js +37 -34
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -6
- package/dist/cjs/helpers/normalizeShadow.native.js +30 -16
- package/dist/cjs/helpers/normalizeShadow.native.js.map +1 -6
- package/dist/cjs/helpers/normalizeStyle.native.js +28 -18
- package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -6
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js +16 -13
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +1 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +27 -18
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -6
- package/dist/cjs/helpers/objectIdentityKey.native.js +26 -21
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -6
- package/dist/cjs/helpers/propMapper.cjs +1 -1
- package/dist/cjs/helpers/propMapper.js +9 -3
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +258 -217
- package/dist/cjs/helpers/propMapper.native.js.map +1 -6
- package/dist/cjs/helpers/proxyThemeToParents.native.js +53 -33
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -6
- package/dist/cjs/helpers/proxyThemeVariables.native.js +18 -15
- package/dist/cjs/helpers/proxyThemeVariables.native.js.map +1 -6
- package/dist/cjs/helpers/pseudoDescriptors.cjs +3 -1
- package/dist/cjs/helpers/pseudoDescriptors.js +2 -1
- package/dist/cjs/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.native.js +66 -61
- package/dist/cjs/helpers/pseudoDescriptors.native.js.map +1 -6
- package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.native.js +26 -22
- package/dist/cjs/helpers/registerCSSVariable.native.js.map +1 -6
- package/dist/cjs/helpers/setElementProps.native.js +18 -16
- package/dist/cjs/helpers/setElementProps.native.js.map +1 -6
- package/dist/cjs/helpers/skipProps.native.js +34 -30
- package/dist/cjs/helpers/skipProps.native.js.map +1 -6
- package/dist/cjs/helpers/sortString.native.js +18 -15
- package/dist/cjs/helpers/sortString.native.js.map +1 -6
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +80 -66
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -6
- package/dist/cjs/helpers/themeable.cjs +1 -1
- package/dist/cjs/helpers/themeable.js +1 -1
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/themeable.native.js +66 -47
- package/dist/cjs/helpers/themeable.native.js.map +1 -6
- package/dist/cjs/helpers/themes.native.js +18 -15
- package/dist/cjs/helpers/themes.native.js.map +1 -6
- package/dist/cjs/helpers/timer.native.js +18 -15
- package/dist/cjs/helpers/timer.native.js.map +1 -6
- package/dist/cjs/helpers/transformsToString.native.js +27 -24
- package/dist/cjs/helpers/transformsToString.native.js.map +1 -6
- package/dist/cjs/helpers/webPropsToSkip.native.js +16 -13
- package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -6
- package/dist/cjs/helpers/wrapStyleTags.native.js +20 -15
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -6
- package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js +18 -14
- package/dist/cjs/hooks/doesRootSchemeMatchSystem.native.js.map +1 -6
- package/dist/cjs/hooks/getThemeProxied.cjs +2 -2
- package/dist/cjs/hooks/getThemeProxied.js +1 -1
- package/dist/cjs/hooks/getThemeProxied.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.js +63 -48
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -6
- package/dist/cjs/hooks/useComponentState.native.js +89 -40
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -6
- package/dist/cjs/hooks/useDisableSSR.native.js +19 -16
- package/dist/cjs/hooks/useDisableSSR.native.js.map +1 -6
- package/dist/cjs/hooks/useIsTouchDevice.native.js +22 -17
- package/dist/cjs/hooks/useIsTouchDevice.native.js.map +1 -6
- package/dist/cjs/hooks/useMedia.cjs +3 -5
- package/dist/cjs/hooks/useMedia.js +3 -5
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useMedia.native.js +118 -108
- package/dist/cjs/hooks/useMedia.native.js.map +1 -6
- package/dist/cjs/hooks/useProps.cjs +1 -1
- package/dist/cjs/hooks/useProps.js +1 -1
- package/dist/cjs/hooks/useProps.js.map +1 -1
- package/dist/cjs/hooks/useProps.native.js +75 -61
- package/dist/cjs/hooks/useProps.native.js.map +1 -6
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js +34 -27
- package/dist/cjs/hooks/useTheme.native.js.map +1 -6
- package/dist/cjs/hooks/useThemeName.native.js +28 -25
- package/dist/cjs/hooks/useThemeName.native.js.map +1 -6
- package/dist/cjs/hooks/useThemeState.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.native.js +207 -176
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -6
- package/dist/cjs/index.cjs +33 -35
- package/dist/cjs/index.js +32 -34
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +84 -164
- package/dist/cjs/index.native.js.map +1 -6
- package/dist/cjs/inject-styles.native.js +30 -22
- package/dist/cjs/inject-styles.native.js.map +1 -6
- package/dist/cjs/insertFont.js.map +1 -1
- package/dist/cjs/insertFont.native.js +39 -38
- package/dist/cjs/insertFont.native.js.map +1 -6
- package/dist/cjs/interfaces/CSSColorNames.native.js +9 -5
- package/dist/cjs/interfaces/CSSColorNames.native.js.map +1 -6
- package/dist/cjs/interfaces/GetRef.native.js +9 -5
- package/dist/cjs/interfaces/GetRef.native.js.map +1 -6
- package/dist/cjs/interfaces/RNExclusiveTypes.native.js +9 -5
- package/dist/cjs/interfaces/RNExclusiveTypes.native.js.map +1 -6
- package/dist/cjs/interfaces/TamaguiComponentEvents.native.js +9 -5
- package/dist/cjs/interfaces/TamaguiComponentEvents.native.js.map +1 -6
- package/dist/cjs/loadDuplicatedConfig.native.js +17 -14
- package/dist/cjs/loadDuplicatedConfig.native.js.map +1 -6
- package/dist/cjs/setupHooks.js.map +1 -1
- package/dist/cjs/setupHooks.native.js +17 -15
- package/dist/cjs/setupHooks.native.js.map +1 -6
- package/dist/cjs/setupReactNative.native.js +20 -23
- package/dist/cjs/setupReactNative.native.js.map +1 -6
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/styled.native.js +80 -57
- package/dist/cjs/styled.native.js.map +1 -6
- package/dist/cjs/type-utils.native.js +9 -5
- package/dist/cjs/type-utils.native.js.map +1 -6
- package/dist/cjs/types.cjs +7 -10
- package/dist/cjs/types.js +1 -3
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js +10 -13
- package/dist/cjs/types.native.js.map +1 -6
- package/dist/cjs/views/Configuration.cjs +1 -1
- package/dist/cjs/views/Configuration.js +1 -1
- package/dist/cjs/views/Configuration.js.map +1 -1
- package/dist/cjs/views/Configuration.native.js +38 -27
- package/dist/cjs/views/Configuration.native.js.map +1 -6
- package/dist/cjs/views/FontLanguage.native.js +36 -25
- package/dist/cjs/views/FontLanguage.native.js.map +1 -6
- package/dist/cjs/views/Slot.native.js +53 -41
- package/dist/cjs/views/Slot.native.js.map +1 -6
- package/dist/cjs/views/Stack.native.js +25 -19
- package/dist/cjs/views/Stack.native.js.map +1 -6
- package/dist/cjs/views/TamaguiProvider.cjs +1 -1
- package/dist/cjs/views/TamaguiProvider.js +1 -1
- package/dist/cjs/views/TamaguiProvider.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js +54 -37
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -6
- package/dist/cjs/views/Text.native.js +43 -40
- package/dist/cjs/views/Text.native.js.map +1 -6
- package/dist/cjs/views/Theme.cjs +1 -1
- package/dist/cjs/views/Theme.js +1 -1
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/Theme.native.js +96 -60
- package/dist/cjs/views/Theme.native.js.map +1 -6
- package/dist/cjs/views/ThemeDebug.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.native.js +21 -14
- package/dist/cjs/views/ThemeDebug.native.js.map +1 -6
- package/dist/cjs/views/ThemeProvider.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.native.js +46 -37
- package/dist/cjs/views/ThemeProvider.native.js.map +1 -6
- package/dist/cjs/views/View.native.js +25 -19
- package/dist/cjs/views/View.native.js.map +1 -6
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.js +4 -2
- package/dist/esm/contexts/ComponentContext.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.mjs +9 -7
- package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +11 -7
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.js.map +1 -1
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.js.map +1 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.js.map +1 -1
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +6 -1
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.js.map +1 -1
- package/dist/esm/createVariables.mjs.map +1 -1
- package/dist/esm/createVariables.native.js +7 -2
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +6 -1
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +6 -3
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.native.js +6 -1
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +7 -2
- package/dist/esm/helpers/mergeProps.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +6 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +6 -1
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +9 -3
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +1 -1
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +7 -2
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.js +2 -1
- package/dist/esm/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.mjs +3 -2
- package/dist/esm/helpers/pseudoDescriptors.mjs.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.native.js +3 -2
- package/dist/esm/helpers/pseudoDescriptors.native.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.mjs.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.js +1 -1
- package/dist/esm/hooks/getThemeProxied.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +6 -1
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +2 -4
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -4
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +1 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +46 -48
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +32 -34
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +32 -34
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/insertFont.js.map +1 -1
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/setupHooks.js.map +1 -1
- package/dist/esm/setupHooks.mjs.map +1 -1
- package/dist/esm/setupHooks.native.js.map +1 -1
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +2 -2
- package/dist/esm/types.mjs +1 -2
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +1 -2
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.native.js +2 -3
- package/dist/esm/views/FontLanguage.native.js.map +1 -1
- package/dist/esm/views/Theme.js.map +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.js.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/package.json +14 -21
- package/src/config.ts +2 -3
- package/src/contexts/ComponentContext.tsx +5 -0
- package/src/createComponent.tsx +2 -2
- package/src/createTamagui.ts +1 -1
- package/src/createTheme.ts +1 -1
- package/src/createTokens.ts +1 -2
- package/src/createVariable.ts +1 -20
- package/src/createVariables.ts +1 -2
- package/src/defaultComponentState.tsx +1 -1
- package/src/helpers/createStyledContext.tsx +2 -17
- package/src/helpers/getSplitStyles.tsx +1 -1
- package/src/helpers/getThemeCSSRules.ts +2 -4
- package/src/helpers/getVariantExtras.tsx +1 -2
- package/src/helpers/propMapper.ts +13 -3
- package/src/helpers/pseudoDescriptors.ts +3 -0
- package/src/helpers/registerCSSVariable.ts +1 -2
- package/src/hooks/getThemeProxied.ts +3 -3
- package/src/hooks/useMedia.tsx +1 -4
- package/src/hooks/useTheme.tsx +6 -2
- package/src/hooks/useThemeState.ts +6 -13
- package/src/index.ts +55 -59
- package/src/insertFont.ts +1 -2
- package/src/loadDuplicatedConfig.ts +1 -1
- package/src/setupHooks.ts +6 -2
- package/src/styled.tsx +1 -1
- package/src/types.tsx +382 -11
- package/src/views/FontLanguage.native.tsx +2 -5
- package/src/views/FontLanguage.tsx +1 -1
- package/src/views/Theme.tsx +1 -2
- package/src/views/ThemeDebug.native.tsx +1 -2
- package/src/views/ThemeDebug.tsx +2 -2
- package/src/views/ThemeProvider.tsx +1 -12
- package/types/config.d.ts +18 -18
- package/types/config.d.ts.map +1 -1
- package/types/contexts/ComponentContext.d.ts +2 -1
- package/types/contexts/ComponentContext.d.ts.map +1 -1
- package/types/createComponent.d.ts +1 -2
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTheme.d.ts +1 -1
- package/types/createTheme.d.ts.map +1 -1
- package/types/createTokens.d.ts +1 -2
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts +1 -21
- package/types/createVariable.d.ts.map +1 -1
- package/types/createVariables.d.ts +1 -1
- package/types/createVariables.d.ts.map +1 -1
- package/types/defaultComponentState.d.ts +1 -1
- package/types/defaultComponentState.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts +1 -13
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +1 -2
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts +1 -2
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/pseudoDescriptors.d.ts +1 -0
- package/types/helpers/pseudoDescriptors.d.ts.map +1 -1
- package/types/helpers/registerCSSVariable.d.ts +1 -2
- package/types/helpers/registerCSSVariable.d.ts.map +1 -1
- package/types/helpers/sortString.d.ts +1 -1
- package/types/hooks/getThemeProxied.d.ts +1 -3
- package/types/hooks/getThemeProxied.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +1 -2
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts +1 -12
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +36 -40
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts.map +1 -1
- package/types/loadDuplicatedConfig.d.ts.map +1 -1
- package/types/setupHooks.d.ts +1 -2
- package/types/setupHooks.d.ts.map +1 -1
- package/types/styled.d.ts +1 -2
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +179 -12
- package/types/types.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +1 -1
- package/types/views/FontLanguage.d.ts.map +1 -1
- package/types/views/FontLanguage.native.d.ts +2 -5
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/Theme.d.ts +1 -2
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts +1 -2
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/types/views/ThemeDebug.native.d.ts +1 -2
- package/types/views/ThemeDebug.native.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -10
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/dist/cjs/hooks/useConfiguration.cjs +0 -39
- package/dist/cjs/hooks/useConfiguration.js +0 -30
- package/dist/cjs/hooks/useConfiguration.js.map +0 -6
- package/dist/cjs/hooks/useConfiguration.native.js +0 -36
- package/dist/cjs/hooks/useConfiguration.native.js.map +0 -6
- package/dist/cjs/interfaces/KeyTypes.cjs +0 -16
- package/dist/cjs/interfaces/KeyTypes.js +0 -14
- package/dist/cjs/interfaces/KeyTypes.js.map +0 -6
- package/dist/cjs/interfaces/KeyTypes.native.js +0 -15
- package/dist/cjs/interfaces/KeyTypes.native.js.map +0 -6
- package/dist/cjs/interfaces/Role.cjs +0 -16
- package/dist/cjs/interfaces/Role.js +0 -14
- package/dist/cjs/interfaces/Role.js.map +0 -6
- package/dist/cjs/interfaces/Role.native.js +0 -15
- package/dist/cjs/interfaces/Role.native.js.map +0 -6
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.cjs +0 -16
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.js +0 -14
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.js.map +0 -6
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js +0 -15
- package/dist/cjs/interfaces/TamaguiComponentPropsBaseBase.native.js.map +0 -6
- package/dist/cjs/interfaces/TamaguiComponentState.cjs +0 -16
- package/dist/cjs/interfaces/TamaguiComponentState.js +0 -14
- package/dist/cjs/interfaces/TamaguiComponentState.js.map +0 -6
- package/dist/cjs/interfaces/TamaguiComponentState.native.js +0 -15
- package/dist/cjs/interfaces/TamaguiComponentState.native.js.map +0 -6
- package/dist/cjs/interfaces/WebOnlyPressEvents.cjs +0 -16
- package/dist/cjs/interfaces/WebOnlyPressEvents.js +0 -14
- package/dist/cjs/interfaces/WebOnlyPressEvents.js.map +0 -6
- package/dist/cjs/interfaces/WebOnlyPressEvents.native.js +0 -15
- package/dist/cjs/interfaces/WebOnlyPressEvents.native.js.map +0 -6
- package/dist/cjs/views/FontLanguage.types.cjs +0 -16
- package/dist/cjs/views/FontLanguage.types.js +0 -14
- package/dist/cjs/views/FontLanguage.types.js.map +0 -6
- package/dist/cjs/views/FontLanguage.types.native.js +0 -15
- package/dist/cjs/views/FontLanguage.types.native.js.map +0 -6
- package/dist/esm/hooks/useConfiguration.js +0 -7
- package/dist/esm/hooks/useConfiguration.js.map +0 -6
- package/dist/esm/hooks/useConfiguration.mjs +0 -5
- package/dist/esm/hooks/useConfiguration.mjs.map +0 -1
- package/dist/esm/hooks/useConfiguration.native.js +0 -7
- package/dist/esm/hooks/useConfiguration.native.js.map +0 -1
- package/dist/esm/interfaces/KeyTypes.js +0 -1
- package/dist/esm/interfaces/KeyTypes.js.map +0 -6
- package/dist/esm/interfaces/KeyTypes.mjs +0 -2
- package/dist/esm/interfaces/KeyTypes.mjs.map +0 -1
- package/dist/esm/interfaces/KeyTypes.native.js +0 -2
- package/dist/esm/interfaces/KeyTypes.native.js.map +0 -1
- package/dist/esm/interfaces/Role.js +0 -1
- package/dist/esm/interfaces/Role.js.map +0 -6
- package/dist/esm/interfaces/Role.mjs +0 -2
- package/dist/esm/interfaces/Role.mjs.map +0 -1
- package/dist/esm/interfaces/Role.native.js +0 -2
- package/dist/esm/interfaces/Role.native.js.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.js +0 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.js.map +0 -6
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.mjs +0 -2
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.mjs.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js +0 -2
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentState.js +0 -1
- package/dist/esm/interfaces/TamaguiComponentState.js.map +0 -6
- package/dist/esm/interfaces/TamaguiComponentState.mjs +0 -2
- package/dist/esm/interfaces/TamaguiComponentState.mjs.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentState.native.js +0 -2
- package/dist/esm/interfaces/TamaguiComponentState.native.js.map +0 -1
- package/dist/esm/interfaces/WebOnlyPressEvents.js +0 -1
- package/dist/esm/interfaces/WebOnlyPressEvents.js.map +0 -6
- package/dist/esm/interfaces/WebOnlyPressEvents.mjs +0 -2
- package/dist/esm/interfaces/WebOnlyPressEvents.mjs.map +0 -1
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js +0 -2
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js.map +0 -1
- package/dist/esm/views/FontLanguage.types.js +0 -1
- package/dist/esm/views/FontLanguage.types.js.map +0 -6
- package/dist/esm/views/FontLanguage.types.mjs +0 -2
- package/dist/esm/views/FontLanguage.types.mjs.map +0 -1
- package/dist/esm/views/FontLanguage.types.native.js +0 -2
- package/dist/esm/views/FontLanguage.types.native.js.map +0 -1
- package/src/hooks/useConfiguration.tsx +0 -7
- package/src/interfaces/KeyTypes.tsx +0 -100
- package/src/interfaces/Role.tsx +0 -68
- package/src/interfaces/TamaguiComponentPropsBaseBase.tsx +0 -112
- package/src/interfaces/TamaguiComponentState.tsx +0 -20
- package/src/interfaces/WebOnlyPressEvents.tsx +0 -17
- package/src/views/FontLanguage.types.ts +0 -13
- package/types/hooks/useConfiguration.d.ts +0 -2
- package/types/hooks/useConfiguration.d.ts.map +0 -1
- package/types/interfaces/KeyTypes.d.ts +0 -4
- package/types/interfaces/KeyTypes.d.ts.map +0 -1
- package/types/interfaces/Role.d.ts +0 -2
- package/types/interfaces/Role.d.ts.map +0 -1
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts +0 -93
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts.map +0 -1
- package/types/interfaces/TamaguiComponentState.d.ts +0 -18
- package/types/interfaces/TamaguiComponentState.d.ts.map +0 -1
- package/types/interfaces/WebOnlyPressEvents.d.ts +0 -17
- package/types/interfaces/WebOnlyPressEvents.d.ts.map +0 -1
- package/types/views/FontLanguage.types.d.ts +0 -11
- package/types/views/FontLanguage.types.d.ts.map +0 -1
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
__copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
16
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
23
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
24
|
// file that has been converted to a CommonJS file using a Babel-
|
|
19
25
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
26
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: !0
|
|
30
|
+
}) : target, mod)),
|
|
31
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: !0
|
|
33
|
+
}), mod);
|
|
24
34
|
var createComponent_exports = {};
|
|
25
35
|
__export(createComponent_exports, {
|
|
26
36
|
Spacer: () => Spacer,
|
|
@@ -30,47 +40,85 @@ __export(createComponent_exports, {
|
|
|
30
40
|
spacedChildren: () => spacedChildren
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(createComponent_exports);
|
|
33
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
44
|
+
import_compose_refs = require("@tamagui/compose-refs"),
|
|
45
|
+
import_constants = require("@tamagui/constants"),
|
|
46
|
+
import_helpers = require("@tamagui/helpers"),
|
|
47
|
+
import_is_equal_shallow = require("@tamagui/is-equal-shallow"),
|
|
48
|
+
import_react = __toESM(require("react"), 1),
|
|
49
|
+
import_config = require("./config.native.js"),
|
|
50
|
+
import_constants2 = require("./constants/constants.native.js"),
|
|
51
|
+
import_isDevTools = require("./constants/isDevTools.native.js"),
|
|
52
|
+
import_ComponentContext = require("./contexts/ComponentContext.native.js"),
|
|
53
|
+
import_GroupContext = require("./contexts/GroupContext.native.js"),
|
|
54
|
+
import_createVariable = require("./createVariable.native.js"),
|
|
55
|
+
import_defaultComponentState = require("./defaultComponentState.native.js"),
|
|
56
|
+
import_getSplitStyles = require("./helpers/getSplitStyles.native.js"),
|
|
57
|
+
import_log = require("./helpers/log.native.js"),
|
|
58
|
+
import_mergeProps = require("./helpers/mergeProps.native.js"),
|
|
59
|
+
import_objectIdentityKey = require("./helpers/objectIdentityKey.native.js"),
|
|
60
|
+
import_setElementProps = require("./helpers/setElementProps.native.js"),
|
|
61
|
+
import_subscribeToContextGroup = require("./helpers/subscribeToContextGroup.native.js"),
|
|
62
|
+
import_themeable = require("./helpers/themeable.native.js"),
|
|
63
|
+
import_wrapStyleTags = require("./helpers/wrapStyleTags.native.js"),
|
|
64
|
+
import_useComponentState = require("./hooks/useComponentState.native.js"),
|
|
65
|
+
import_useMedia = require("./hooks/useMedia.native.js"),
|
|
66
|
+
import_useTheme = require("./hooks/useTheme.native.js"),
|
|
67
|
+
import_setupHooks = require("./setupHooks.native.js"),
|
|
68
|
+
import_Slot = require("./views/Slot.native.js"),
|
|
69
|
+
import_Theme = require("./views/Theme.native.js");
|
|
70
|
+
var time,
|
|
71
|
+
debugKeyListeners,
|
|
72
|
+
startVisualizer,
|
|
73
|
+
componentSetStates = /* @__PURE__ */new Set(),
|
|
74
|
+
avoidReRenderKeys = /* @__PURE__ */new Set(["hover", "press", "pressIn", "group", "focus", "focusWithin", "media", "group"]);
|
|
75
|
+
if (0) var cancelTouches;
|
|
76
|
+
var BaseText,
|
|
77
|
+
BaseView,
|
|
78
|
+
hasSetupBaseViews = !1,
|
|
79
|
+
lastInteractionWasKeyboard = {
|
|
80
|
+
value: !1
|
|
81
|
+
};
|
|
82
|
+
import_constants.isWeb && typeof document < "u" && (document.addEventListener("keydown", function () {
|
|
49
83
|
lastInteractionWasKeyboard.value || (lastInteractionWasKeyboard.value = !0);
|
|
50
|
-
}), document.addEventListener("mousedown", function() {
|
|
84
|
+
}), document.addEventListener("mousedown", function () {
|
|
51
85
|
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
52
|
-
}), document.addEventListener("mousemove", function() {
|
|
86
|
+
}), document.addEventListener("mousemove", function () {
|
|
53
87
|
lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
|
|
54
88
|
}));
|
|
55
89
|
function createComponent(staticConfig) {
|
|
56
|
-
var _staticConfig_defaultProps,
|
|
57
|
-
|
|
90
|
+
var _staticConfig_defaultProps,
|
|
91
|
+
{
|
|
92
|
+
componentName
|
|
93
|
+
} = staticConfig,
|
|
94
|
+
config = null,
|
|
95
|
+
defaultProps = staticConfig.defaultProps;
|
|
96
|
+
(0, import_config.onConfiguredOnce)(function (conf) {
|
|
58
97
|
if (config = conf, componentName) {
|
|
59
|
-
var _conf_defaultProps,
|
|
98
|
+
var _conf_defaultProps,
|
|
99
|
+
defaultForComponent = (_conf_defaultProps = conf.defaultProps) === null || _conf_defaultProps === void 0 ? void 0 : _conf_defaultProps[componentName];
|
|
60
100
|
defaultForComponent && (defaultProps = {
|
|
61
101
|
...defaultForComponent,
|
|
62
102
|
...defaultProps
|
|
63
103
|
});
|
|
64
104
|
}
|
|
65
105
|
});
|
|
66
|
-
var {
|
|
67
|
-
|
|
106
|
+
var {
|
|
107
|
+
Component,
|
|
108
|
+
isText,
|
|
109
|
+
isZStack,
|
|
110
|
+
isHOC
|
|
111
|
+
} = staticConfig;
|
|
112
|
+
process.env.NODE_ENV === "development" && !((_staticConfig_defaultProps = staticConfig.defaultProps) === null || _staticConfig_defaultProps === void 0) && _staticConfig_defaultProps.debug && process.env.IS_STATIC !== "is_static" && (0, import_log.log)(`\u{1F41B} [${componentName || "Component"}]`, {
|
|
68
113
|
staticConfig,
|
|
69
114
|
defaultProps,
|
|
70
115
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
71
116
|
});
|
|
72
|
-
var component = /* @__PURE__ */
|
|
73
|
-
var _hooks_usePropsTransform,
|
|
117
|
+
var component = /* @__PURE__ */import_react.default.forwardRef(function (propsIn, forwardedRef) {
|
|
118
|
+
var _hooks_usePropsTransform,
|
|
119
|
+
_hooks_useEvents,
|
|
120
|
+
_config_animations,
|
|
121
|
+
internalID = process.env.NODE_ENV === "development" ? import_react.default.useId() : "";
|
|
74
122
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
75
123
|
var _hooks_getBaseViews;
|
|
76
124
|
hasSetupBaseViews = !0;
|
|
@@ -81,7 +129,13 @@ function createComponent(staticConfig) {
|
|
|
81
129
|
var _propsIn_datatestrenders, _current, _;
|
|
82
130
|
(_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
|
|
83
131
|
}
|
|
84
|
-
var {
|
|
132
|
+
var {
|
|
133
|
+
context,
|
|
134
|
+
isReactNative
|
|
135
|
+
} = staticConfig,
|
|
136
|
+
debugProp = propsIn.debug,
|
|
137
|
+
styledContextValue = context ? import_react.default.useContext(context) : void 0,
|
|
138
|
+
overriddenContextProps = null;
|
|
85
139
|
if (!process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time) {
|
|
86
140
|
var timer = require("@tamagui/timer").timer();
|
|
87
141
|
time = timer.start(), globalThis.time = time;
|
|
@@ -93,83 +147,110 @@ function createComponent(staticConfig) {
|
|
|
93
147
|
nextProps && (props = nextProps), overriddenContextProps = overrides;
|
|
94
148
|
}
|
|
95
149
|
var componentName2 = props.componentName || staticConfig.componentName;
|
|
96
|
-
process.env.NODE_ENV === "development" && import_constants.isClient && import_react.default.useEffect(function() {
|
|
97
|
-
var node,
|
|
98
|
-
|
|
99
|
-
|
|
150
|
+
process.env.NODE_ENV === "development" && import_constants.isClient && import_react.default.useEffect(function () {
|
|
151
|
+
var node,
|
|
152
|
+
overlay = null,
|
|
153
|
+
remove = function () {
|
|
154
|
+
if (overlay) try {
|
|
100
155
|
var _overlay_parentNode;
|
|
101
156
|
(_overlay_parentNode = overlay.parentNode) === null || _overlay_parentNode === void 0 || _overlay_parentNode.removeChild(overlay), overlay = null;
|
|
102
|
-
} catch {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (show) {
|
|
157
|
+
} catch {}
|
|
158
|
+
},
|
|
159
|
+
debugVisualizerHandler = function () {
|
|
160
|
+
var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
161
|
+
if (node = stateRef.current.host, !!node) if (show) {
|
|
108
162
|
overlay || (overlay = document.createElement("span"), overlay.style.inset = "0px", overlay.style.zIndex = "1000000", overlay.style.position = "absolute", overlay.style.borderColor = "red", overlay.style.borderWidth = "1px", overlay.style.borderStyle = "dotted");
|
|
109
|
-
var dataAt = node.getAttribute("data-at") || "",
|
|
163
|
+
var dataAt = node.getAttribute("data-at") || "",
|
|
164
|
+
dataIn = node.getAttribute("data-in") || "",
|
|
165
|
+
tooltip = document.createElement("span");
|
|
110
166
|
tooltip.style.position = "absolute", tooltip.style.top = "0px", tooltip.style.left = "0px", tooltip.style.padding = "3px", tooltip.style.background = "rgba(0,0,0,0.75)", tooltip.style.color = "rgba(255,255,255,1)", tooltip.style.fontSize = "12px", tooltip.style.lineHeight = "12px", tooltip.style.fontFamily = "monospace", tooltip.innerText = `${componentName2 || ""} ${dataAt} ${dataIn}`.trim(), overlay.appendChild(tooltip), node.appendChild(overlay);
|
|
111
|
-
} else
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
remove(), debugKeyListeners == null || debugKeyListeners.delete(debugVisualizerHandler);
|
|
167
|
+
} else remove();
|
|
168
|
+
};
|
|
169
|
+
return debugKeyListeners || (debugKeyListeners = /* @__PURE__ */new Set()), debugKeyListeners.add(debugVisualizerHandler), function () {
|
|
170
|
+
remove(), debugKeyListeners?.delete(debugVisualizerHandler);
|
|
116
171
|
};
|
|
117
|
-
}, [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
172
|
+
}, [componentName2]);
|
|
173
|
+
var componentContext = import_react.default.useContext(import_ComponentContext.ComponentContext),
|
|
174
|
+
groupContextParent = import_react.default.useContext(import_GroupContext.GroupContext),
|
|
175
|
+
animationDriver = componentContext.animationDriver,
|
|
176
|
+
useAnimations = animationDriver?.useAnimations,
|
|
177
|
+
componentState = (0, import_useComponentState.useComponentState)(props, animationDriver, staticConfig, config),
|
|
178
|
+
{
|
|
179
|
+
disabled,
|
|
180
|
+
groupName,
|
|
181
|
+
hasAnimationProp,
|
|
182
|
+
hasEnterStyle,
|
|
183
|
+
isAnimated,
|
|
184
|
+
isExiting,
|
|
185
|
+
isHydrated,
|
|
186
|
+
presence,
|
|
187
|
+
presenceState,
|
|
188
|
+
setState,
|
|
189
|
+
noClass,
|
|
190
|
+
state,
|
|
191
|
+
stateRef,
|
|
192
|
+
supportsCSS,
|
|
193
|
+
willBeAnimated,
|
|
194
|
+
willBeAnimatedClient,
|
|
195
|
+
startedUnhydrated
|
|
196
|
+
} = componentState;
|
|
197
|
+
hasAnimationProp && animationDriver?.avoidReRenders && (0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
122
198
|
var pendingState = stateRef.current.nextState;
|
|
123
199
|
pendingState && (stateRef.current.nextState = void 0, componentState.setStateShallow(pendingState));
|
|
124
200
|
});
|
|
125
|
-
var allGroupContexts = (0, import_react.useMemo)(function() {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return l(state2);
|
|
135
|
-
});
|
|
136
|
-
},
|
|
137
|
-
subscribe(cb) {
|
|
138
|
-
return listeners.add(cb), listeners.size === 1 && setStateShallow({
|
|
139
|
-
hasDynGroupChildren: !0
|
|
140
|
-
}), function() {
|
|
141
|
-
listeners.delete(cb), listeners.size === 0 && setStateShallow({
|
|
142
|
-
hasDynGroupChildren: !1
|
|
201
|
+
var allGroupContexts = (0, import_react.useMemo)(function () {
|
|
202
|
+
var _stateRef_current_group_listeners, _stateRef_current_group;
|
|
203
|
+
if (!groupName || props.passThrough) return groupContextParent;
|
|
204
|
+
var listeners = /* @__PURE__ */new Set();
|
|
205
|
+
return (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || (_stateRef_current_group_listeners = _stateRef_current_group.listeners) === null || _stateRef_current_group_listeners === void 0 || _stateRef_current_group_listeners.clear(), stateRef.current.group = {
|
|
206
|
+
listeners,
|
|
207
|
+
emit(state2) {
|
|
208
|
+
listeners.forEach(function (l) {
|
|
209
|
+
return l(state2);
|
|
143
210
|
});
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
}, {
|
|
147
|
-
...groupContextParent,
|
|
148
|
-
[groupName]: {
|
|
149
|
-
state: {
|
|
150
|
-
pseudo: import_defaultComponentState.defaultComponentStateMounted
|
|
151
211
|
},
|
|
152
|
-
subscribe
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
212
|
+
subscribe(cb) {
|
|
213
|
+
return listeners.add(cb), listeners.size === 1 && setStateShallow({
|
|
214
|
+
hasDynGroupChildren: !0
|
|
215
|
+
}), function () {
|
|
216
|
+
listeners.delete(cb), listeners.size === 0 && setStateShallow({
|
|
217
|
+
hasDynGroupChildren: !1
|
|
218
|
+
});
|
|
156
219
|
};
|
|
157
220
|
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
221
|
+
}, {
|
|
222
|
+
...groupContextParent,
|
|
223
|
+
[groupName]: {
|
|
224
|
+
state: {
|
|
225
|
+
pseudo: import_defaultComponentState.defaultComponentStateMounted
|
|
226
|
+
},
|
|
227
|
+
subscribe: function (listener) {
|
|
228
|
+
var _stateRef_current_group2,
|
|
229
|
+
dispose = (_stateRef_current_group2 = stateRef.current.group) === null || _stateRef_current_group2 === void 0 ? void 0 : _stateRef_current_group2.subscribe(listener);
|
|
230
|
+
return function () {
|
|
231
|
+
dispose?.();
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}, [stateRef, groupName, groupContextParent]),
|
|
237
|
+
setStateShallow = componentState.setStateShallow;
|
|
165
238
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
166
|
-
var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText),
|
|
167
|
-
|
|
239
|
+
var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText),
|
|
240
|
+
isTaggable = !Component || typeof Component == "string",
|
|
241
|
+
tagProp = props.tag,
|
|
242
|
+
element = import_constants.isWeb && isTaggable && tagProp || Component,
|
|
243
|
+
BaseTextComponent = BaseText || element || "span",
|
|
244
|
+
BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"),
|
|
245
|
+
elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
246
|
+
animationDriver && isAnimated &&
|
|
247
|
+
// this should really be behind another prop as it's not really related to
|
|
168
248
|
// "needsWebStyles" basically with motion we just animate a plain div, but
|
|
169
249
|
// we still have animated.View/Text for Sheet which wants to control
|
|
170
250
|
// things declaratively
|
|
171
251
|
!animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
172
|
-
var disableThemeProp = !1,
|
|
252
|
+
var disableThemeProp = !1,
|
|
253
|
+
disableTheme = disableThemeProp || isHOC;
|
|
173
254
|
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
174
255
|
var themeStateProps = {
|
|
175
256
|
componentName: componentName2,
|
|
@@ -177,10 +258,15 @@ function createComponent(staticConfig) {
|
|
|
177
258
|
shallow: stateRef.current.themeShallow,
|
|
178
259
|
debug: debugProp
|
|
179
260
|
};
|
|
180
|
-
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
|
|
261
|
+
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function () {
|
|
181
262
|
return !!stateRef.current.isListeningToTheme;
|
|
182
263
|
}), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
183
|
-
var name = `${componentName2 ||
|
|
264
|
+
var name = `${componentName2 || Component?.displayName || Component?.name || "[Unnamed Component]"}`,
|
|
265
|
+
type = (hasEnterStyle ? "(hasEnter)" : " ") + (isAnimated ? "(animated)" : " ") + (isReactNative ? "(rnw)" : " ") + (noClass ? "(noClass)" : " ") + (state.press || state.pressIn ? "(PRESSED)" : " ") + (state.hover ? "(HOVERED)" : " ") + (state.focus ? "(FOCUSED)" : " ") + (state.focusWithin ? "(WITHIN FOCUSED)" : " ") + (presenceState?.isPresent === !1 ? "(EXIT)" : ""),
|
|
266
|
+
dataIs = propsIn["data-is"] || "",
|
|
267
|
+
banner = `<${name} /> ${internalID} ${dataIs ? ` ${dataIs}` : ""} ${type.trim()} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`,
|
|
268
|
+
ch = propsIn.children,
|
|
269
|
+
childLog = typeof ch == "string" ? ch.length > 4 ? ch.slice(0, 4) + "..." : ch : "";
|
|
184
270
|
childLog.length && (childLog = `(children: ${childLog})`), import_constants.isWeb ? (console.info(`%c ${banner}`, "background: green; color: white;"), import_constants.isServer ? (0, import_log.log)({
|
|
185
271
|
noClass,
|
|
186
272
|
isAnimated,
|
|
@@ -219,25 +305,30 @@ ${banner}
|
|
|
219
305
|
process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
|
|
220
306
|
var [theme, themeState] = (0, import_useTheme.useThemeWithState)(themeStateProps);
|
|
221
307
|
process.env.NODE_ENV === "development" && time && time`theme`, elementType = Component || elementType;
|
|
222
|
-
var isStringElement = typeof elementType == "string",
|
|
308
|
+
var isStringElement = typeof elementType == "string",
|
|
309
|
+
mediaState = (0, import_useMedia.useMedia)(componentContext, debugProp);
|
|
223
310
|
(0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time && time`media`;
|
|
224
|
-
var resolveValues =
|
|
311
|
+
var resolveValues =
|
|
225
312
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
226
|
-
isAnimated && !supportsCSS || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
313
|
+
isAnimated && !supportsCSS || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto",
|
|
314
|
+
styleProps = {
|
|
315
|
+
mediaState,
|
|
316
|
+
noClass,
|
|
317
|
+
resolveValues,
|
|
318
|
+
isExiting,
|
|
319
|
+
isAnimated,
|
|
320
|
+
willBeAnimated,
|
|
321
|
+
styledContext: styledContextValue
|
|
322
|
+
},
|
|
323
|
+
themeName = themeState?.name || "";
|
|
236
324
|
process.env.NODE_ENV === "development" && time && time`split-styles-prepare`;
|
|
237
|
-
var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp),
|
|
238
|
-
|
|
325
|
+
var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp),
|
|
326
|
+
isPassthrough = !splitStyles,
|
|
327
|
+
groupContext = groupName && allGroupContexts?.[groupName] || null;
|
|
328
|
+
if (!isPassthrough && groupContext &&
|
|
329
|
+
// avoids onLayout if we don't need it
|
|
239
330
|
props.containerType !== "normal") {
|
|
240
|
-
var groupState = groupContext
|
|
331
|
+
var groupState = groupContext?.state;
|
|
241
332
|
if (groupState && groupState.layout === void 0) {
|
|
242
333
|
var _splitStyles_style, _splitStyles_style1;
|
|
243
334
|
(!((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0) && _splitStyles_style.width || !((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0) && _splitStyles_style1.height) && (groupState.layout = {
|
|
@@ -246,46 +337,58 @@ ${banner}
|
|
|
246
337
|
});
|
|
247
338
|
}
|
|
248
339
|
}
|
|
249
|
-
if (!isPassthrough && (hasAnimationProp || groupName) &&
|
|
250
|
-
let updateGroupListeners2 = function() {
|
|
340
|
+
if (!isPassthrough && (hasAnimationProp || groupName) && animationDriver?.avoidReRenders) {
|
|
341
|
+
let updateGroupListeners2 = function () {
|
|
251
342
|
var updatedState = stateRef.current.nextState;
|
|
252
343
|
if (groupContext) {
|
|
253
|
-
var {
|
|
344
|
+
var {
|
|
345
|
+
group,
|
|
346
|
+
hasDynGroupChildren,
|
|
347
|
+
unmounted,
|
|
348
|
+
animation,
|
|
349
|
+
...childrenGroupState
|
|
350
|
+
} = updatedState;
|
|
254
351
|
notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
|
|
255
352
|
}
|
|
256
353
|
};
|
|
257
|
-
var updateGroupListeners = updateGroupListeners2,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
354
|
+
var updateGroupListeners = updateGroupListeners2,
|
|
355
|
+
_componentContext,
|
|
356
|
+
ogSetStateShallow = setStateShallow;
|
|
357
|
+
stateRef.current.updateStyleListener = function () {
|
|
358
|
+
var updatedState = stateRef.current.nextState || state,
|
|
359
|
+
mediaState2 = stateRef.current.nextMedia,
|
|
360
|
+
nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, mediaState2 ? {
|
|
361
|
+
...styleProps,
|
|
362
|
+
mediaState: mediaState2
|
|
363
|
+
} : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp),
|
|
364
|
+
useStyleListener = stateRef.current.useStyleListener;
|
|
365
|
+
useStyleListener?.(nextStyles?.style || {});
|
|
366
|
+
}, (_componentContext = componentContext).mediaEmit || (_componentContext.mediaEmit = function (next) {
|
|
265
367
|
var _stateRef_current_updateStyleListener, _stateRef_current;
|
|
266
368
|
stateRef.current.nextMedia = next, (_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
|
|
267
|
-
}), stateRef.current.setStateShallow = function(nextOrGetNext) {
|
|
268
|
-
var prev = stateRef.current.nextState || state,
|
|
369
|
+
}), stateRef.current.setStateShallow = function (nextOrGetNext) {
|
|
370
|
+
var prev = stateRef.current.nextState || state,
|
|
371
|
+
next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
269
372
|
if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
|
|
270
|
-
var canAvoidReRender = Object.keys(next).every(function(key2) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
373
|
+
var canAvoidReRender = Object.keys(next).every(function (key2) {
|
|
374
|
+
return avoidReRenderKeys.has(key2);
|
|
375
|
+
}),
|
|
376
|
+
updatedState = {
|
|
377
|
+
...prev,
|
|
378
|
+
...next
|
|
379
|
+
};
|
|
276
380
|
if (stateRef.current.nextState = updatedState, canAvoidReRender) {
|
|
277
381
|
var _stateRef_current_updateStyleListener, _stateRef_current;
|
|
278
382
|
process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed("[\u26A1\uFE0F] avoid setState", componentName2, next, {
|
|
279
383
|
updatedState,
|
|
280
384
|
props
|
|
281
385
|
}), console.info(stateRef.current.host), console.groupEnd()), updateGroupListeners2(), (_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
|
|
282
|
-
} else
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}), ogSetStateShallow(next);
|
|
386
|
+
} else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
|
|
387
|
+
canAvoidReRender,
|
|
388
|
+
next
|
|
389
|
+
}), ogSetStateShallow(next);
|
|
287
390
|
}
|
|
288
|
-
}, setStateShallow = function(state2) {
|
|
391
|
+
}, setStateShallow = function (state2) {
|
|
289
392
|
var _stateRef_current_setStateShallow, _stateRef_current;
|
|
290
393
|
(_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state2);
|
|
291
394
|
};
|
|
@@ -297,96 +400,114 @@ ${banner}
|
|
|
297
400
|
}
|
|
298
401
|
splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess);
|
|
299
402
|
}
|
|
300
|
-
var hasRuntimeMediaKeys =
|
|
403
|
+
var hasRuntimeMediaKeys = splitStyles?.hasMedia && splitStyles.hasMedia !== !0,
|
|
404
|
+
shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles?.hasMedia === !0,
|
|
405
|
+
mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
|
|
301
406
|
process.env.NODE_ENV === "development" && debugProp === "verbose" && console.info("useMedia() createComponent", shouldListenForMedia, mediaListeningKeys), (0, import_useMedia.setMediaShouldUpdate)(componentContext, shouldListenForMedia, mediaListeningKeys);
|
|
302
|
-
var {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
407
|
+
var {
|
|
408
|
+
viewProps: viewPropsIn,
|
|
409
|
+
pseudos,
|
|
410
|
+
style: splitStylesStyle,
|
|
411
|
+
classNames,
|
|
412
|
+
space,
|
|
413
|
+
pseudoGroups,
|
|
414
|
+
mediaGroups
|
|
415
|
+
} = splitStyles || {},
|
|
416
|
+
propsWithAnimation = props,
|
|
417
|
+
{
|
|
418
|
+
asChild,
|
|
419
|
+
children,
|
|
420
|
+
themeShallow,
|
|
421
|
+
spaceDirection: _spaceDirection,
|
|
422
|
+
onPress,
|
|
423
|
+
onLongPress,
|
|
424
|
+
onPressIn,
|
|
425
|
+
onPressOut,
|
|
426
|
+
onHoverIn,
|
|
427
|
+
onHoverOut,
|
|
428
|
+
onMouseUp,
|
|
429
|
+
onMouseDown,
|
|
430
|
+
onMouseEnter,
|
|
431
|
+
onMouseLeave,
|
|
432
|
+
onFocus,
|
|
433
|
+
onBlur,
|
|
434
|
+
separator,
|
|
435
|
+
// ignore from here on out
|
|
436
|
+
passThrough,
|
|
437
|
+
forceStyle: _forceStyle,
|
|
438
|
+
// @ts-ignore for next/link compat etc
|
|
439
|
+
onClick,
|
|
440
|
+
theme: _themeProp,
|
|
441
|
+
...nonTamaguiProps
|
|
442
|
+
} = viewPropsIn || {},
|
|
443
|
+
viewProps = nonTamaguiProps;
|
|
328
444
|
!isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && (typeof _themeProp < "u" && (viewProps.theme = _themeProp), typeof passThrough < "u" && (viewProps.passThrough = passThrough)), tagProp && elementType.acceptTagProp && (viewProps.tag = tagProp);
|
|
329
|
-
var animationStyles,
|
|
445
|
+
var animationStyles,
|
|
446
|
+
shouldUseAnimation =
|
|
330
447
|
// if it supports css vars we run it on server too to get matching initial style
|
|
331
|
-
(supportsCSS ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
332
|
-
|
|
448
|
+
(supportsCSS ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC,
|
|
449
|
+
animatedRef;
|
|
333
450
|
if (shouldUseAnimation) {
|
|
334
|
-
var useStyleEmitter = animationDriver
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
451
|
+
var useStyleEmitter = animationDriver?.avoidReRenders ? function (listener) {
|
|
452
|
+
stateRef.current.useStyleListener = listener;
|
|
453
|
+
} : void 0,
|
|
454
|
+
animations = useAnimations({
|
|
455
|
+
props: propsWithAnimation,
|
|
456
|
+
// if hydrating, send empty style
|
|
457
|
+
style: splitStylesStyle || {},
|
|
458
|
+
// @ts-ignore
|
|
459
|
+
styleState: splitStyles,
|
|
460
|
+
useStyleEmitter,
|
|
461
|
+
presence,
|
|
462
|
+
componentState: state,
|
|
463
|
+
styleProps,
|
|
464
|
+
theme,
|
|
465
|
+
pseudos: pseudos || null,
|
|
466
|
+
staticConfig,
|
|
467
|
+
stateRef
|
|
468
|
+
});
|
|
351
469
|
animations && (animations.ref && (animatedRef = animations.ref), isHydrated && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`))), process.env.NODE_ENV === "development" && time && time`animations`;
|
|
352
470
|
}
|
|
353
471
|
process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
|
|
354
472
|
|
|
355
|
-
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time && time`destructure`, !isPassthrough && groupContext &&
|
|
356
|
-
|
|
357
|
-
|
|
473
|
+
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time && time`destructure`, !isPassthrough && groupContext &&
|
|
474
|
+
// avoids onLayout if we don't need it
|
|
475
|
+
props.containerType !== "normal" && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function (e) {
|
|
476
|
+
var _stateRef_current_group,
|
|
477
|
+
layout = e.nativeEvent.layout;
|
|
358
478
|
groupContext.state.layout = layout, (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.emit({
|
|
359
479
|
layout
|
|
360
|
-
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
|
|
480
|
+
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function (prev) {
|
|
361
481
|
return {
|
|
362
482
|
...prev
|
|
363
483
|
};
|
|
364
484
|
}), stateRef.current.hasMeasured = !0;
|
|
365
|
-
})), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, stateRef.current.willHydrate)) || nonTamaguiProps, stateRef.current.composedRef || (stateRef.current.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
|
|
485
|
+
})), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, stateRef.current.willHydrate)) || nonTamaguiProps, stateRef.current.composedRef || (stateRef.current.composedRef = (0, import_compose_refs.composeRefs)(function (x) {
|
|
366
486
|
return stateRef.current.host = x;
|
|
367
|
-
}, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = stateRef.current.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react.default.Children.toArray(props.children).forEach(function(item) {
|
|
487
|
+
}, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = stateRef.current.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react.default.Children.toArray(props.children).forEach(function (item) {
|
|
368
488
|
typeof item == "string" && item !== `
|
|
369
489
|
` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <${staticConfig.componentName || propsIn.tag || "View"}>.`, props);
|
|
370
490
|
}), process.env.NODE_ENV === "development" && time && time`events-hooks`;
|
|
371
|
-
var unPress = function() {
|
|
491
|
+
var unPress = function () {
|
|
372
492
|
setStateShallow({
|
|
373
493
|
press: !1,
|
|
374
494
|
pressIn: !1
|
|
375
495
|
});
|
|
376
496
|
};
|
|
377
|
-
process.env.NODE_ENV === "development" && import_constants.isWeb && (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
497
|
+
process.env.NODE_ENV === "development" && import_constants.isWeb && (0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
378
498
|
if (debugProp === "verbose") {
|
|
379
|
-
let cssStyleDeclarationToObject2 = function(style) {
|
|
499
|
+
let cssStyleDeclarationToObject2 = function (style) {
|
|
380
500
|
for (var styleObject = {}, i = 0; i < style.length; i++) {
|
|
381
501
|
var prop = style[i];
|
|
382
502
|
styleObject[prop] = style.getPropertyValue(prop);
|
|
383
503
|
}
|
|
384
504
|
return styleObject;
|
|
385
505
|
};
|
|
386
|
-
var cssStyleDeclarationToObject = cssStyleDeclarationToObject2,
|
|
506
|
+
var cssStyleDeclarationToObject = cssStyleDeclarationToObject2,
|
|
507
|
+
computed = stateRef.current.host ? cssStyleDeclarationToObject2(getComputedStyle(stateRef.current.host)) : {};
|
|
387
508
|
console.groupCollapsed(`Rendered > (opacity: ${computed.opacity})`), console.warn(stateRef.current.host), console.warn(computed), console.groupEnd();
|
|
388
509
|
}
|
|
389
|
-
}), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
510
|
+
}), (0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
390
511
|
if (state.unmounted === !0 && hasEnterStyle) {
|
|
391
512
|
setStateShallow({
|
|
392
513
|
unmounted: "should-enter"
|
|
@@ -395,48 +516,44 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
395
516
|
}
|
|
396
517
|
var tm;
|
|
397
518
|
if (state.unmounted) {
|
|
398
|
-
if (animationDriver
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
};
|
|
519
|
+
if (animationDriver?.supportsCSS || import_constants.isAndroid) return tm = setTimeout(function () {
|
|
520
|
+
setStateShallow({
|
|
521
|
+
unmounted: !1
|
|
522
|
+
});
|
|
523
|
+
}), function () {
|
|
524
|
+
return clearTimeout(tm);
|
|
525
|
+
};
|
|
406
526
|
setStateShallow({
|
|
407
527
|
unmounted: !1
|
|
408
528
|
});
|
|
409
529
|
return;
|
|
410
530
|
}
|
|
411
|
-
return function() {
|
|
531
|
+
return function () {
|
|
412
532
|
componentSetStates.delete(setState);
|
|
413
533
|
};
|
|
414
|
-
}, [
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
mediaGroups,
|
|
423
|
-
pseudoGroups
|
|
424
|
-
});
|
|
425
|
-
}, [
|
|
426
|
-
allGroupContexts,
|
|
427
|
-
disabled,
|
|
428
|
-
pseudoGroups ? (0, import_objectIdentityKey.objectIdentityKey)(pseudoGroups) : 0,
|
|
429
|
-
mediaGroups ? (0, import_objectIdentityKey.objectIdentityKey)(mediaGroups) : 0
|
|
430
|
-
]);
|
|
534
|
+
}, [state.unmounted, disabled]), (0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
535
|
+
if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
536
|
+
groupContext: allGroupContexts,
|
|
537
|
+
setStateShallow,
|
|
538
|
+
mediaGroups,
|
|
539
|
+
pseudoGroups
|
|
540
|
+
});
|
|
541
|
+
}, [allGroupContexts, disabled, pseudoGroups ? (0, import_objectIdentityKey.objectIdentityKey)(pseudoGroups) : 0, mediaGroups ? (0, import_objectIdentityKey.objectIdentityKey)(mediaGroups) : 0]);
|
|
431
542
|
var groupEmitter = stateRef.current.group;
|
|
432
|
-
(0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
543
|
+
(0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
433
544
|
!groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state);
|
|
434
|
-
}, [
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
545
|
+
}, [groupContext, groupEmitter, state]);
|
|
546
|
+
var runtimePressStyle = !disabled && noClass && pseudos?.pressStyle,
|
|
547
|
+
runtimeFocusStyle = !disabled && noClass && pseudos?.focusStyle,
|
|
548
|
+
runtimeFocusVisibleStyle = !disabled && noClass && pseudos?.focusVisibleStyle,
|
|
549
|
+
attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur || componentContext.setParentFocusState),
|
|
550
|
+
hasDynamicGroupChildren = !!(groupName && state.hasDynGroupChildren),
|
|
551
|
+
attachPress = !!(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos?.focusVisibleStyle),
|
|
552
|
+
runtimeHoverStyle = !disabled && noClass && pseudos?.hoverStyle,
|
|
553
|
+
needsHoverState = !!(hasDynamicGroupChildren || runtimeHoverStyle),
|
|
554
|
+
attachHover = import_constants.isWeb && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave),
|
|
555
|
+
shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle),
|
|
556
|
+
needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle);
|
|
440
557
|
process.env.NODE_ENV === "development" && time && time`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
|
|
441
558
|
runtimeFocusStyle,
|
|
442
559
|
runtimePressStyle,
|
|
@@ -450,48 +567,48 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
450
567
|
pseudos
|
|
451
568
|
});
|
|
452
569
|
var events = shouldAttach ? {
|
|
453
|
-
onPressOut: attachPress ? function(e) {
|
|
454
|
-
unPress(), onPressOut
|
|
570
|
+
onPressOut: attachPress ? function (e) {
|
|
571
|
+
unPress(), onPressOut?.(e), onMouseUp?.(e);
|
|
455
572
|
} : void 0,
|
|
456
|
-
...(attachHover || attachPress) && {
|
|
457
|
-
onMouseEnter: function(e) {
|
|
573
|
+
...((attachHover || attachPress) && {
|
|
574
|
+
onMouseEnter: function (e) {
|
|
458
575
|
var next = {};
|
|
459
|
-
needsHoverState && (next.hover = !0), needsPressState && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn
|
|
576
|
+
needsHoverState && (next.hover = !0), needsPressState && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn?.(e), onMouseEnter?.(e);
|
|
460
577
|
},
|
|
461
|
-
onMouseLeave: function(e) {
|
|
578
|
+
onMouseLeave: function (e) {
|
|
462
579
|
var next = {};
|
|
463
|
-
needsHoverState && (next.hover = !1), needsPressState && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut
|
|
580
|
+
needsHoverState && (next.hover = !1), needsPressState && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut?.(e), onMouseLeave?.(e);
|
|
464
581
|
}
|
|
465
|
-
},
|
|
466
|
-
onPressIn: attachPress ? function(e) {
|
|
582
|
+
}),
|
|
583
|
+
onPressIn: attachPress ? function (e) {
|
|
467
584
|
needsPressState && setStateShallow({
|
|
468
585
|
press: !0,
|
|
469
586
|
pressIn: !0
|
|
470
|
-
}), onPressIn
|
|
587
|
+
}), onPressIn?.(e), onMouseDown?.(e), import_constants.isWeb && componentSetStates.add(setState);
|
|
471
588
|
} : void 0,
|
|
472
|
-
onPress: attachPress ? function(e) {
|
|
473
|
-
unPress(), import_constants.isWeb &&
|
|
589
|
+
onPress: attachPress ? function (e) {
|
|
590
|
+
unPress(), import_constants.isWeb && onClick?.(e), onPress?.(e);
|
|
474
591
|
} : void 0,
|
|
475
|
-
...attachPress && onLongPress && {
|
|
476
|
-
onLongPress: function(e) {
|
|
477
|
-
unPress(), onLongPress
|
|
592
|
+
...(attachPress && onLongPress && {
|
|
593
|
+
onLongPress: function (e) {
|
|
594
|
+
unPress(), onLongPress?.(e);
|
|
478
595
|
}
|
|
479
|
-
},
|
|
480
|
-
...attachFocus && {
|
|
481
|
-
onFocus: function(e) {
|
|
596
|
+
}),
|
|
597
|
+
...(attachFocus && {
|
|
598
|
+
onFocus: function (e) {
|
|
482
599
|
var next = {};
|
|
483
|
-
componentContext.setParentFocusState && (next.focusWithin = !0), pseudos
|
|
600
|
+
componentContext.setParentFocusState && (next.focusWithin = !0), pseudos?.focusVisibleStyle && lastInteractionWasKeyboard.value ? next.focusVisible = !0 : next.focus = !0, setStateShallow(next), onFocus?.(e);
|
|
484
601
|
},
|
|
485
|
-
onBlur: function(e) {
|
|
602
|
+
onBlur: function (e) {
|
|
486
603
|
componentContext.setParentFocusState && componentContext.setParentFocusState({
|
|
487
604
|
focusWithin: !1
|
|
488
605
|
}), setStateShallow({
|
|
489
606
|
focus: !1,
|
|
490
607
|
focusVisible: !1,
|
|
491
608
|
focusWithin: !1
|
|
492
|
-
}), onBlur
|
|
609
|
+
}), onBlur?.(e);
|
|
493
610
|
}
|
|
494
|
-
}
|
|
611
|
+
})
|
|
495
612
|
} : null;
|
|
496
613
|
if (events && !asChild) {
|
|
497
614
|
var _viewProps_focusable;
|
|
@@ -521,51 +638,51 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
521
638
|
isZStack,
|
|
522
639
|
debug: debugProp
|
|
523
640
|
});
|
|
524
|
-
if (asChild)
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
Object.assign(viewProps, {
|
|
529
|
-
onPress,
|
|
530
|
-
onLongPress
|
|
531
|
-
});
|
|
641
|
+
if (asChild) if (elementType = import_Slot.Slot, 0) var webStyleEvents, passEvents;else Object.assign(viewProps, {
|
|
642
|
+
onPress,
|
|
643
|
+
onLongPress
|
|
644
|
+
});
|
|
532
645
|
process.env.NODE_ENV === "development" && time && time`spaced-as-child`, isPassthrough && (content = propsIn.children, elementType = BaseViewComponent, viewProps = {
|
|
533
646
|
style: {
|
|
534
647
|
display: "contents"
|
|
535
648
|
}
|
|
536
649
|
});
|
|
537
650
|
var useChildrenResult;
|
|
538
|
-
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time && time`use-children`, useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */
|
|
539
|
-
var ResetPresence = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence,
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
651
|
+
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time && time`use-children`, useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */import_react.default.createElement(elementType, viewProps, content);
|
|
652
|
+
var ResetPresence = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence,
|
|
653
|
+
needsReset = !!(
|
|
654
|
+
// not when passing down to child
|
|
655
|
+
!asChild &&
|
|
656
|
+
// not when passThrough
|
|
657
|
+
splitStyles &&
|
|
658
|
+
// not when HOC
|
|
659
|
+
!isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState)),
|
|
660
|
+
hasEverReset = stateRef.current.hasEverResetPresence;
|
|
543
661
|
needsReset && !hasEverReset && (stateRef.current.hasEverResetPresence = !0);
|
|
544
662
|
var renderReset = needsReset || hasEverReset;
|
|
545
|
-
if (renderReset && ResetPresence && (content = /* @__PURE__ */
|
|
663
|
+
if (renderReset && ResetPresence && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResetPresence, {
|
|
546
664
|
disabled: !needsReset,
|
|
547
665
|
children: content
|
|
548
|
-
})), process.env.NODE_ENV === "development" && time && time`create-element`, "focusWithinStyle" in propsIn && (content = /* @__PURE__ */
|
|
666
|
+
})), process.env.NODE_ENV === "development" && time && time`create-element`, "focusWithinStyle" in propsIn && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
549
667
|
...componentContext,
|
|
550
668
|
setParentFocusState: setStateShallow,
|
|
551
669
|
children: content
|
|
552
|
-
})), "group" in props && (content = /* @__PURE__ */
|
|
670
|
+
})), "group" in props && (content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_GroupContext.GroupContext.Provider, {
|
|
553
671
|
value: allGroupContexts,
|
|
554
672
|
children: content
|
|
555
673
|
})), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme || !splitStyles ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time && time`themed-children`, overriddenContextProps) {
|
|
556
674
|
var Provider = staticConfig.context.Provider;
|
|
557
|
-
for (var key in styledContextValue)
|
|
558
|
-
|
|
559
|
-
debugProp && console.info("overriddenContextProps", overriddenContextProps), content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, {
|
|
675
|
+
for (var key in styledContextValue) key in overriddenContextProps || (overriddenContextProps[key] = styledContextValue[key]);
|
|
676
|
+
debugProp && console.info("overriddenContextProps", overriddenContextProps), content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(Provider, {
|
|
560
677
|
__disableMergeDefaultValues: !0,
|
|
561
678
|
...overriddenContextProps,
|
|
562
679
|
children: content
|
|
563
680
|
});
|
|
564
681
|
}
|
|
565
|
-
if (process.env.NODE_ENV === "development" && time && time`context-override`, 0)
|
|
566
|
-
var styleTags;
|
|
682
|
+
if (process.env.NODE_ENV === "development" && time && time`context-override`, 0) var styleTags;
|
|
567
683
|
if (process.env.NODE_ENV === "development" && time && time`style-tags`, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
568
|
-
var element1 = typeof elementType == "string" ? elementType : "Component",
|
|
684
|
+
var element1 = typeof elementType == "string" ? elementType : "Component",
|
|
685
|
+
title = `render <${element1} /> (${internalID}) with props`;
|
|
569
686
|
if (import_constants.isWeb) {
|
|
570
687
|
console.groupCollapsed(title);
|
|
571
688
|
try {
|
|
@@ -598,19 +715,16 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
598
715
|
willBeAnimated,
|
|
599
716
|
startedUnhydrated
|
|
600
717
|
});
|
|
601
|
-
} catch {
|
|
602
|
-
} finally {
|
|
718
|
+
} catch {} finally {
|
|
603
719
|
console.groupEnd();
|
|
604
720
|
}
|
|
605
721
|
} else {
|
|
606
722
|
(0, import_log.log)(title), (0, import_log.log)("state: ", state), import_isDevTools.isDevTools && (0, import_log.log)("viewProps", viewProps), (0, import_log.log)("final styles:");
|
|
607
|
-
for (var key1 in splitStylesStyle)
|
|
608
|
-
(0, import_log.log)(key1, splitStylesStyle[key1]);
|
|
723
|
+
for (var key1 in splitStylesStyle) (0, import_log.log)(key1, splitStylesStyle[key1]);
|
|
609
724
|
}
|
|
610
|
-
if (debugProp === "break")
|
|
611
|
-
debugger;
|
|
725
|
+
if (debugProp === "break") debugger;
|
|
612
726
|
}
|
|
613
|
-
return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(function() {
|
|
727
|
+
return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(function () {
|
|
614
728
|
delete globalThis.willPrint, time.print(), time = null;
|
|
615
729
|
}, 50))), content;
|
|
616
730
|
});
|
|
@@ -625,7 +739,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
625
739
|
}
|
|
626
740
|
staticConfig.componentName && (component.displayName = staticConfig.componentName);
|
|
627
741
|
var res = component;
|
|
628
|
-
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */
|
|
742
|
+
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */import_react.default.memo(res)), res.staticConfig = staticConfig;
|
|
629
743
|
function extendStyledConfig(extended) {
|
|
630
744
|
return {
|
|
631
745
|
...staticConfig,
|
|
@@ -639,8 +753,11 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
639
753
|
return Component2.staticConfig = extendStyledConfig(extended), Component2.styleable = styleable, Component2;
|
|
640
754
|
}
|
|
641
755
|
function styleable(Component2, options) {
|
|
642
|
-
var _Component_render,
|
|
643
|
-
|
|
756
|
+
var _Component_render,
|
|
757
|
+
skipForwardRef = import_constants.IS_REACT_19 && typeof Component2 == "function" && Component2.length === 1 || ((_Component_render = Component2.render) === null || _Component_render === void 0 ? void 0 : _Component_render.length) === 2,
|
|
758
|
+
out = skipForwardRef ? Component2 : /* @__PURE__ */import_react.default.forwardRef(Component2),
|
|
759
|
+
extendedConfig = extendStyledConfig(options?.staticConfig);
|
|
760
|
+
return out = options?.disableTheme ? out : (0, import_themeable.themeable)(out, extendedConfig, !0), (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLEABLE) && (out = /* @__PURE__ */import_react.default.memo(out)), out.staticConfig = extendedConfig, out.styleable = styleable, out;
|
|
644
761
|
}
|
|
645
762
|
return res.extractable = extractable, res.styleable = styleable, res;
|
|
646
763
|
}
|
|
@@ -648,69 +765,90 @@ function Unspaced(props) {
|
|
|
648
765
|
return props.children;
|
|
649
766
|
}
|
|
650
767
|
Unspaced.isUnspaced = !0;
|
|
651
|
-
var getSpacerSize = function(size, param) {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
componentName: "Spacer",
|
|
665
|
-
validStyles: import_helpers.validStyles,
|
|
666
|
-
defaultProps: {
|
|
667
|
-
...import_constants2.stackDefaultStyles,
|
|
668
|
-
// avoid nesting issues
|
|
669
|
-
tag: "span",
|
|
670
|
-
size: !0,
|
|
671
|
-
pointerEvents: "none"
|
|
768
|
+
var getSpacerSize = function (size, param) {
|
|
769
|
+
var {
|
|
770
|
+
tokens
|
|
771
|
+
} = param;
|
|
772
|
+
size = size === !1 ? 0 : size === !0 ? "$true" : size;
|
|
773
|
+
var _tokens_space_size,
|
|
774
|
+
sizePx = (_tokens_space_size = tokens.space[size]) !== null && _tokens_space_size !== void 0 ? _tokens_space_size : size;
|
|
775
|
+
return {
|
|
776
|
+
width: sizePx,
|
|
777
|
+
height: sizePx,
|
|
778
|
+
minWidth: sizePx,
|
|
779
|
+
minHeight: sizePx
|
|
780
|
+
};
|
|
672
781
|
},
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
782
|
+
Spacer = createComponent({
|
|
783
|
+
acceptsClassName: !0,
|
|
784
|
+
memo: !0,
|
|
785
|
+
componentName: "Spacer",
|
|
786
|
+
validStyles: import_helpers.validStyles,
|
|
787
|
+
defaultProps: {
|
|
788
|
+
...import_constants2.stackDefaultStyles,
|
|
789
|
+
// avoid nesting issues
|
|
790
|
+
tag: "span",
|
|
791
|
+
size: !0,
|
|
792
|
+
pointerEvents: "none"
|
|
681
793
|
},
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
minHeight: 0
|
|
794
|
+
variants: {
|
|
795
|
+
size: {
|
|
796
|
+
"...": getSpacerSize
|
|
686
797
|
},
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
798
|
+
flex: {
|
|
799
|
+
true: {
|
|
800
|
+
flexGrow: 1
|
|
801
|
+
}
|
|
690
802
|
},
|
|
691
|
-
|
|
803
|
+
direction: {
|
|
804
|
+
horizontal: {
|
|
805
|
+
height: 0,
|
|
806
|
+
minHeight: 0
|
|
807
|
+
},
|
|
808
|
+
vertical: {
|
|
809
|
+
width: 0,
|
|
810
|
+
minWidth: 0
|
|
811
|
+
},
|
|
812
|
+
both: {}
|
|
813
|
+
}
|
|
692
814
|
}
|
|
693
|
-
}
|
|
694
|
-
});
|
|
815
|
+
});
|
|
695
816
|
function spacedChildren(props) {
|
|
696
|
-
var _childrenList__type,
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
817
|
+
var _childrenList__type,
|
|
818
|
+
_childrenList_,
|
|
819
|
+
{
|
|
820
|
+
isZStack,
|
|
821
|
+
children,
|
|
822
|
+
space,
|
|
823
|
+
direction,
|
|
824
|
+
spaceFlex,
|
|
825
|
+
separator,
|
|
826
|
+
ensureKeys
|
|
827
|
+
} = props,
|
|
828
|
+
hasSpace = !!(space || spaceFlex),
|
|
829
|
+
hasSeparator = separator != null,
|
|
830
|
+
areChildrenArray = Array.isArray(children);
|
|
831
|
+
if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) return children;
|
|
832
|
+
var childrenList = areChildrenArray ? children : import_react.default.Children.toArray(children),
|
|
833
|
+
len = childrenList.length;
|
|
834
|
+
if (len <= 1 && !isZStack && !(!((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 || (_childrenList__type = _childrenList_.type) === null || _childrenList__type === void 0) && _childrenList__type.shouldForwardSpace)) return children;
|
|
835
|
+
var final = [],
|
|
836
|
+
_iteratorNormalCompletion = !0,
|
|
837
|
+
_didIteratorError = !1,
|
|
838
|
+
_iteratorError = void 0;
|
|
703
839
|
try {
|
|
704
840
|
for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
705
|
-
var [index, child] = _step.value,
|
|
706
|
-
|
|
841
|
+
var [index, child] = _step.value,
|
|
842
|
+
_child_type,
|
|
843
|
+
isEmpty = child == null || Array.isArray(child) && child.length === 0;
|
|
844
|
+
if (!isEmpty && /* @__PURE__ */import_react.default.isValidElement(child) && !((_child_type = child.type) === null || _child_type === void 0) && _child_type.shouldForwardSpace && (child = /* @__PURE__ */import_react.default.cloneElement(child, {
|
|
707
845
|
// @ts-expect-error we explicitly know with shouldForwardSpace
|
|
708
846
|
space,
|
|
709
847
|
spaceFlex,
|
|
710
848
|
separator,
|
|
711
849
|
key: child.key
|
|
712
|
-
})), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(/* @__PURE__ */
|
|
713
|
-
children: isZStack ? /* @__PURE__ */
|
|
850
|
+
})), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.default.Fragment, {
|
|
851
|
+
children: isZStack ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(AbsoluteFill, {
|
|
714
852
|
children: child
|
|
715
853
|
}) : child
|
|
716
854
|
}, `${index}0t`)), !(isUnspaced(child) && index === 0) && !isZStack) {
|
|
@@ -720,7 +858,7 @@ function spacedChildren(props) {
|
|
|
720
858
|
direction,
|
|
721
859
|
space,
|
|
722
860
|
spaceFlex
|
|
723
|
-
})), final.push(/* @__PURE__ */
|
|
861
|
+
})), final.push(/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.default.Fragment, {
|
|
724
862
|
children: separator
|
|
725
863
|
}, `${index}03t`)), hasSpace && final.push(createSpacer({
|
|
726
864
|
key: `_${index}01t`,
|
|
@@ -741,46 +879,43 @@ function spacedChildren(props) {
|
|
|
741
879
|
try {
|
|
742
880
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
743
881
|
} finally {
|
|
744
|
-
if (_didIteratorError)
|
|
745
|
-
throw _iteratorError;
|
|
882
|
+
if (_didIteratorError) throw _iteratorError;
|
|
746
883
|
}
|
|
747
884
|
}
|
|
748
885
|
return process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)(" Spaced children", final, props), final;
|
|
749
886
|
}
|
|
750
887
|
function createSpacer(param) {
|
|
751
|
-
var {
|
|
752
|
-
|
|
888
|
+
var {
|
|
889
|
+
key,
|
|
890
|
+
direction,
|
|
891
|
+
space,
|
|
892
|
+
spaceFlex
|
|
893
|
+
} = param;
|
|
894
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(Spacer, {
|
|
753
895
|
size: space,
|
|
754
896
|
direction,
|
|
755
|
-
...typeof spaceFlex < "u" && {
|
|
897
|
+
...(typeof spaceFlex < "u" && {
|
|
756
898
|
flex: spaceFlex === !0 ? 1 : spaceFlex === !1 ? 0 : spaceFlex
|
|
757
|
-
}
|
|
899
|
+
})
|
|
758
900
|
}, key);
|
|
759
901
|
}
|
|
760
902
|
function isUnspaced(child) {
|
|
761
|
-
var t = child
|
|
762
|
-
return
|
|
903
|
+
var t = child?.type;
|
|
904
|
+
return t?.isVisuallyHidden || t?.isUnspaced;
|
|
763
905
|
}
|
|
764
906
|
var AbsoluteFill = createComponent({
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
}),
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
Spacer,
|
|
781
|
-
Unspaced,
|
|
782
|
-
componentSetStates,
|
|
783
|
-
createComponent,
|
|
784
|
-
spacedChildren
|
|
785
|
-
});
|
|
786
|
-
//# sourceMappingURL=createComponent.js.map
|
|
907
|
+
defaultProps: {
|
|
908
|
+
...import_constants2.stackDefaultStyles,
|
|
909
|
+
flexDirection: "column",
|
|
910
|
+
position: "absolute",
|
|
911
|
+
top: 0,
|
|
912
|
+
right: 0,
|
|
913
|
+
bottom: 0,
|
|
914
|
+
left: 0,
|
|
915
|
+
pointerEvents: "box-none"
|
|
916
|
+
}
|
|
917
|
+
}),
|
|
918
|
+
fromPx = function (val) {
|
|
919
|
+
return typeof val == "number" ? val : typeof val == "string" ? +val.replace("px", "") : 0;
|
|
920
|
+
};
|
|
921
|
+
//# sourceMappingURL=createComponent.native.js.map
|