@tamagui/web 1.111.7 → 1.111.9
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/esm/Tamagui.native.js +41 -50
- package/dist/esm/Tamagui.native.js.map +1 -6
- package/dist/esm/_withStableStyle.native.js +11 -9
- package/dist/esm/_withStableStyle.native.js.map +1 -6
- package/dist/esm/config.native.js +72 -71
- package/dist/esm/config.native.js.map +1 -6
- package/dist/esm/constants/accessibilityDirectMap.native.js +6 -8
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +1 -6
- package/dist/esm/constants/constants.native.js +17 -19
- package/dist/esm/constants/constants.native.js.map +1 -6
- package/dist/esm/constants/isDevTools.native.js +6 -10
- package/dist/esm/constants/isDevTools.native.js.map +1 -6
- package/dist/esm/constants/webToNativeProps.native.js +84 -162
- package/dist/esm/constants/webToNativeProps.native.js.map +1 -6
- package/dist/esm/contexts/ComponentContext.native.js +3 -5
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -6
- package/dist/esm/createComponent.native.js +558 -407
- package/dist/esm/createComponent.native.js.map +1 -6
- package/dist/esm/createFont.native.js +24 -41
- package/dist/esm/createFont.native.js.map +1 -6
- package/dist/esm/createShorthands.native.js +2 -4
- package/dist/esm/createShorthands.native.js.map +1 -6
- package/dist/esm/createTamagui.native.js +179 -160
- package/dist/esm/createTamagui.native.js.map +1 -6
- package/dist/esm/createTheme.native.js +3 -5
- package/dist/esm/createTheme.native.js.map +1 -6
- package/dist/esm/createTokens.native.js +3 -5
- package/dist/esm/createTokens.native.js.map +1 -6
- package/dist/esm/createVariable.native.js +28 -33
- package/dist/esm/createVariable.native.js.map +1 -6
- package/dist/esm/createVariables.native.js +34 -29
- package/dist/esm/createVariables.native.js.map +1 -6
- package/dist/esm/defaultComponentState.native.js +18 -20
- package/dist/esm/defaultComponentState.native.js.map +1 -6
- package/dist/esm/helpers/ThemeManager.native.js +95 -99
- package/dist/esm/helpers/ThemeManager.native.js.map +1 -6
- package/dist/esm/helpers/ThemeManagerContext.native.js +3 -5
- package/dist/esm/helpers/ThemeManagerContext.native.js.map +1 -6
- package/dist/esm/helpers/createMediaStyle.native.js +63 -49
- package/dist/esm/helpers/createMediaStyle.native.js.map +1 -6
- package/dist/esm/helpers/createShallowSetState.native.js +9 -17
- package/dist/esm/helpers/createShallowSetState.native.js.map +1 -6
- package/dist/esm/helpers/createStyledContext.native.js +31 -25
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -6
- package/dist/esm/helpers/defaultOffset.native.js +2 -4
- package/dist/esm/helpers/defaultOffset.native.js.map +1 -6
- package/dist/esm/helpers/expandStyle.native.js +39 -84
- package/dist/esm/helpers/expandStyle.native.js.map +1 -6
- package/dist/esm/helpers/expandStyles.native.js +15 -17
- package/dist/esm/helpers/expandStyles.native.js.map +1 -6
- package/dist/esm/helpers/getExpandedShorthands.native.js +4 -7
- package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -6
- package/dist/esm/helpers/getFontLanguage.native.js +3 -5
- package/dist/esm/helpers/getFontLanguage.native.js.map +1 -6
- package/dist/esm/helpers/getGroupPropParts.native.js +7 -6
- package/dist/esm/helpers/getGroupPropParts.native.js.map +1 -6
- package/dist/esm/helpers/getSplitStyles.native.js +436 -398
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -6
- package/dist/esm/helpers/getStylesAtomic.native.js +7 -8
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -6
- package/dist/esm/helpers/getThemeCSSRules.native.js +1 -3
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +1 -6
- package/dist/esm/helpers/getVariantExtras.native.js +33 -34
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -6
- package/dist/esm/helpers/insertStyleRule.native.js +113 -103
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -6
- package/dist/esm/helpers/isActivePlatform.native.js +4 -5
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -6
- package/dist/esm/helpers/isObj.native.js +3 -5
- package/dist/esm/helpers/isObj.native.js.map +1 -6
- package/dist/esm/helpers/isTamaguiComponent.native.js +2 -4
- package/dist/esm/helpers/isTamaguiComponent.native.js.map +1 -6
- package/dist/esm/helpers/isTamaguiElement.native.js +5 -7
- package/dist/esm/helpers/isTamaguiElement.native.js.map +1 -6
- package/dist/esm/helpers/log.native.js +4 -7
- package/dist/esm/helpers/log.native.js.map +1 -6
- package/dist/esm/helpers/matchMedia.native.js +9 -14
- package/dist/esm/helpers/matchMedia.native.js.map +1 -6
- package/dist/esm/helpers/mergeProps.native.js +9 -13
- package/dist/esm/helpers/mergeProps.native.js.map +1 -6
- package/dist/esm/helpers/mergeVariants.native.js +7 -7
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -6
- package/dist/esm/helpers/normalizeColor.native.js +20 -24
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -6
- package/dist/esm/helpers/normalizeShadow.native.js +15 -7
- package/dist/esm/helpers/normalizeShadow.native.js.map +1 -6
- package/dist/esm/helpers/normalizeStyle.native.js +13 -12
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -6
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +1 -3
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +1 -6
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -12
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -6
- package/dist/esm/helpers/objectIdentityKey.native.js +6 -11
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -6
- package/dist/esm/helpers/propMapper.native.js +233 -211
- package/dist/esm/helpers/propMapper.native.js.map +1 -6
- package/dist/esm/helpers/proxyThemeToParents.native.js +39 -27
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -6
- package/dist/esm/helpers/proxyThemeVariables.native.js +3 -5
- package/dist/esm/helpers/proxyThemeVariables.native.js.map +1 -6
- package/dist/esm/helpers/pseudoDescriptors.native.js +44 -46
- package/dist/esm/helpers/pseudoDescriptors.native.js.map +1 -6
- package/dist/esm/helpers/registerCSSVariable.native.js +11 -13
- package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -6
- package/dist/esm/helpers/setElementProps.native.js +3 -6
- package/dist/esm/helpers/setElementProps.native.js.map +1 -6
- package/dist/esm/helpers/skipProps.native.js +3 -5
- package/dist/esm/helpers/skipProps.native.js.map +1 -6
- package/dist/esm/helpers/themeable.native.js +31 -24
- package/dist/esm/helpers/themeable.native.js.map +1 -6
- package/dist/esm/helpers/themes.native.js +3 -5
- package/dist/esm/helpers/themes.native.js.map +1 -6
- package/dist/esm/helpers/timer.native.js +3 -5
- package/dist/esm/helpers/timer.native.js.map +1 -6
- package/dist/esm/helpers/transformsToString.native.js +11 -13
- package/dist/esm/helpers/transformsToString.native.js.map +1 -6
- package/dist/esm/helpers/webPropsToSkip.native.js +1 -3
- package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -6
- package/dist/esm/hooks/useConfiguration.native.js +14 -8
- package/dist/esm/hooks/useConfiguration.native.js.map +1 -6
- package/dist/esm/hooks/useDidHydrateOnce.native.js +14 -15
- package/dist/esm/hooks/useDidHydrateOnce.native.js.map +1 -6
- package/dist/esm/hooks/useDisableSSR.native.js +3 -5
- package/dist/esm/hooks/useDisableSSR.native.js.map +1 -6
- package/dist/esm/hooks/useIsTouchDevice.native.js +3 -5
- package/dist/esm/hooks/useIsTouchDevice.native.js.map +1 -6
- package/dist/esm/hooks/useMedia.native.js +106 -104
- package/dist/esm/hooks/useMedia.native.js.map +1 -6
- package/dist/esm/hooks/useProps.native.js +40 -41
- package/dist/esm/hooks/useProps.native.js.map +1 -6
- package/dist/esm/hooks/useTheme.native.js +240 -219
- package/dist/esm/hooks/useTheme.native.js.map +1 -6
- package/dist/esm/hooks/useThemeName.native.js +12 -16
- package/dist/esm/hooks/useThemeName.native.js.map +1 -6
- package/dist/esm/index.native.js +61 -77
- package/dist/esm/index.native.js.map +1 -6
- package/dist/esm/inject-styles.native.js +15 -12
- package/dist/esm/inject-styles.native.js.map +1 -6
- package/dist/esm/insertFont.native.js +24 -32
- package/dist/esm/insertFont.native.js.map +1 -6
- package/dist/esm/interfaces/CSSColorNames.native.js +2 -1
- package/dist/esm/interfaces/CSSColorNames.native.js.map +1 -6
- package/dist/esm/interfaces/GetRef.native.js +2 -1
- package/dist/esm/interfaces/GetRef.native.js.map +1 -6
- package/dist/esm/interfaces/KeyTypes.native.js +2 -1
- package/dist/esm/interfaces/KeyTypes.native.js.map +1 -6
- package/dist/esm/interfaces/RNExclusiveTypes.native.js +2 -1
- package/dist/esm/interfaces/RNExclusiveTypes.native.js.map +1 -6
- package/dist/esm/interfaces/Role.native.js +2 -1
- package/dist/esm/interfaces/Role.native.js.map +1 -6
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js +2 -1
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js.map +1 -6
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js +2 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js.map +1 -6
- package/dist/esm/interfaces/TamaguiComponentState.native.js +2 -1
- package/dist/esm/interfaces/TamaguiComponentState.native.js.map +1 -6
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js +2 -1
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js.map +1 -6
- package/dist/esm/setupHooks.native.js +2 -5
- package/dist/esm/setupHooks.native.js.map +1 -6
- package/dist/esm/setupReactNative.native.js +5 -13
- package/dist/esm/setupReactNative.native.js.map +1 -6
- package/dist/esm/styled.native.js +66 -50
- package/dist/esm/styled.native.js.map +1 -6
- package/dist/esm/type-utils.native.js +2 -1
- package/dist/esm/type-utils.native.js.map +1 -6
- package/dist/esm/types.native.js +3 -3
- package/dist/esm/types.native.js.map +1 -6
- package/dist/esm/views/Configuration.native.js +5 -7
- package/dist/esm/views/Configuration.native.js.map +1 -6
- package/dist/esm/views/FontLanguage.native.js +11 -11
- package/dist/esm/views/FontLanguage.native.js.map +1 -6
- package/dist/esm/views/FontLanguage.types.native.js +2 -1
- package/dist/esm/views/FontLanguage.types.native.js.map +1 -6
- package/dist/esm/views/Slot.native.js +33 -31
- package/dist/esm/views/Slot.native.js.map +1 -6
- package/dist/esm/views/Stack.native.js +4 -6
- package/dist/esm/views/Stack.native.js.map +1 -6
- package/dist/esm/views/TamaguiProvider.native.js +24 -20
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -6
- package/dist/esm/views/Text.native.js +27 -30
- package/dist/esm/views/Text.native.js.map +1 -6
- package/dist/esm/views/Theme.native.js +76 -54
- package/dist/esm/views/Theme.native.js.map +1 -6
- package/dist/esm/views/ThemeDebug.native.js +6 -4
- package/dist/esm/views/ThemeDebug.native.js.map +1 -6
- package/dist/esm/views/ThemeProvider.native.js +12 -16
- package/dist/esm/views/ThemeProvider.native.js.map +1 -6
- package/dist/esm/views/View.native.js +4 -6
- package/dist/esm/views/View.native.js.map +1 -6
- package/package.json +14 -14
- package/dist/esm/Tamagui.native.mjs +0 -84
- package/dist/esm/Tamagui.native.mjs.map +0 -1
- package/dist/esm/_withStableStyle.native.mjs +0 -19
- package/dist/esm/_withStableStyle.native.mjs.map +0 -1
- package/dist/esm/config.native.mjs +0 -93
- package/dist/esm/config.native.mjs.map +0 -1
- package/dist/esm/constants/accessibilityDirectMap.native.mjs +0 -7
- package/dist/esm/constants/accessibilityDirectMap.native.mjs.map +0 -1
- package/dist/esm/constants/constants.native.mjs +0 -17
- package/dist/esm/constants/constants.native.mjs.map +0 -1
- package/dist/esm/constants/isDevTools.native.mjs +0 -8
- package/dist/esm/constants/isDevTools.native.mjs.map +0 -1
- package/dist/esm/constants/webToNativeProps.native.mjs +0 -88
- package/dist/esm/constants/webToNativeProps.native.mjs.map +0 -1
- package/dist/esm/contexts/ComponentContext.native.mjs +0 -14
- package/dist/esm/contexts/ComponentContext.native.mjs.map +0 -1
- package/dist/esm/createComponent.native.mjs +0 -969
- package/dist/esm/createComponent.native.mjs.map +0 -1
- package/dist/esm/createFont.native.mjs +0 -24
- package/dist/esm/createFont.native.mjs.map +0 -1
- package/dist/esm/createShorthands.native.mjs +0 -5
- package/dist/esm/createShorthands.native.mjs.map +0 -1
- package/dist/esm/createTamagui.native.mjs +0 -253
- package/dist/esm/createTamagui.native.mjs.map +0 -1
- package/dist/esm/createTheme.native.mjs +0 -5
- package/dist/esm/createTheme.native.mjs.map +0 -1
- package/dist/esm/createTokens.native.mjs +0 -7
- package/dist/esm/createTokens.native.mjs.map +0 -1
- package/dist/esm/createVariable.native.mjs +0 -68
- package/dist/esm/createVariable.native.mjs.map +0 -1
- package/dist/esm/createVariables.native.mjs +0 -36
- package/dist/esm/createVariables.native.mjs.map +0 -1
- package/dist/esm/defaultComponentState.native.mjs +0 -19
- package/dist/esm/defaultComponentState.native.mjs.map +0 -1
- package/dist/esm/helpers/ThemeManager.native.mjs +0 -220
- package/dist/esm/helpers/ThemeManager.native.mjs.map +0 -1
- package/dist/esm/helpers/ThemeManagerContext.native.mjs +0 -4
- package/dist/esm/helpers/ThemeManagerContext.native.mjs.map +0 -1
- package/dist/esm/helpers/createMediaStyle.native.mjs +0 -84
- package/dist/esm/helpers/createMediaStyle.native.mjs.map +0 -1
- package/dist/esm/helpers/createShallowSetState.native.mjs +0 -31
- package/dist/esm/helpers/createShallowSetState.native.mjs.map +0 -1
- package/dist/esm/helpers/createStyledContext.native.mjs +0 -39
- package/dist/esm/helpers/createStyledContext.native.mjs.map +0 -1
- package/dist/esm/helpers/defaultOffset.native.mjs +0 -6
- package/dist/esm/helpers/defaultOffset.native.mjs.map +0 -1
- package/dist/esm/helpers/expandStyle.native.mjs +0 -46
- package/dist/esm/helpers/expandStyle.native.mjs.map +0 -1
- package/dist/esm/helpers/expandStyles.native.mjs +0 -19
- package/dist/esm/helpers/expandStyles.native.mjs.map +0 -1
- package/dist/esm/helpers/getExpandedShorthands.native.mjs +0 -10
- package/dist/esm/helpers/getExpandedShorthands.native.mjs.map +0 -1
- package/dist/esm/helpers/getFontLanguage.native.mjs +0 -5
- package/dist/esm/helpers/getFontLanguage.native.mjs.map +0 -1
- package/dist/esm/helpers/getGroupPropParts.native.mjs +0 -14
- package/dist/esm/helpers/getGroupPropParts.native.mjs.map +0 -1
- package/dist/esm/helpers/getSplitStyles.native.mjs +0 -683
- package/dist/esm/helpers/getSplitStyles.native.mjs.map +0 -1
- package/dist/esm/helpers/getStylesAtomic.native.mjs +0 -8
- package/dist/esm/helpers/getStylesAtomic.native.mjs.map +0 -1
- package/dist/esm/helpers/getThemeCSSRules.native.mjs +0 -5
- package/dist/esm/helpers/getThemeCSSRules.native.mjs.map +0 -1
- package/dist/esm/helpers/getVariantExtras.native.mjs +0 -42
- package/dist/esm/helpers/getVariantExtras.native.mjs.map +0 -1
- package/dist/esm/helpers/insertStyleRule.native.mjs +0 -312
- package/dist/esm/helpers/insertStyleRule.native.mjs.map +0 -1
- package/dist/esm/helpers/isActivePlatform.native.mjs +0 -12
- package/dist/esm/helpers/isActivePlatform.native.mjs.map +0 -1
- package/dist/esm/helpers/isObj.native.mjs +0 -5
- package/dist/esm/helpers/isObj.native.mjs.map +0 -1
- package/dist/esm/helpers/isTamaguiComponent.native.mjs +0 -6
- package/dist/esm/helpers/isTamaguiComponent.native.mjs.map +0 -1
- package/dist/esm/helpers/isTamaguiElement.native.mjs +0 -7
- package/dist/esm/helpers/isTamaguiElement.native.mjs.map +0 -1
- package/dist/esm/helpers/log.native.mjs +0 -14
- package/dist/esm/helpers/log.native.mjs.map +0 -1
- package/dist/esm/helpers/matchMedia.native.mjs +0 -20
- package/dist/esm/helpers/matchMedia.native.mjs.map +0 -1
- package/dist/esm/helpers/mergeProps.native.mjs +0 -22
- package/dist/esm/helpers/mergeProps.native.mjs.map +0 -1
- package/dist/esm/helpers/mergeVariants.native.mjs +0 -18
- package/dist/esm/helpers/mergeVariants.native.mjs.map +0 -1
- package/dist/esm/helpers/normalizeColor.native.mjs +0 -24
- package/dist/esm/helpers/normalizeColor.native.mjs.map +0 -1
- package/dist/esm/helpers/normalizeShadow.native.mjs +0 -26
- package/dist/esm/helpers/normalizeShadow.native.mjs.map +0 -1
- package/dist/esm/helpers/normalizeStyle.native.mjs +0 -26
- package/dist/esm/helpers/normalizeStyle.native.mjs.map +0 -1
- package/dist/esm/helpers/normalizeStylePropKeys.native.mjs +0 -14
- package/dist/esm/helpers/normalizeStylePropKeys.native.mjs.map +0 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.mjs +0 -35
- package/dist/esm/helpers/normalizeValueWithProperty.native.mjs.map +0 -1
- package/dist/esm/helpers/objectIdentityKey.native.mjs +0 -16
- package/dist/esm/helpers/objectIdentityKey.native.mjs.map +0 -1
- package/dist/esm/helpers/propMapper.native.mjs +0 -290
- package/dist/esm/helpers/propMapper.native.mjs.map +0 -1
- package/dist/esm/helpers/proxyThemeToParents.native.mjs +0 -101
- package/dist/esm/helpers/proxyThemeToParents.native.mjs.map +0 -1
- package/dist/esm/helpers/proxyThemeVariables.native.mjs +0 -15
- package/dist/esm/helpers/proxyThemeVariables.native.mjs.map +0 -1
- package/dist/esm/helpers/pseudoDescriptors.native.mjs +0 -47
- package/dist/esm/helpers/pseudoDescriptors.native.mjs.map +0 -1
- package/dist/esm/helpers/registerCSSVariable.native.mjs +0 -11
- package/dist/esm/helpers/registerCSSVariable.native.mjs.map +0 -1
- package/dist/esm/helpers/setElementProps.native.mjs +0 -7
- package/dist/esm/helpers/setElementProps.native.mjs.map +0 -1
- package/dist/esm/helpers/skipProps.native.mjs +0 -21
- package/dist/esm/helpers/skipProps.native.mjs.map +0 -1
- package/dist/esm/helpers/themeable.native.mjs +0 -36
- package/dist/esm/helpers/themeable.native.mjs.map +0 -1
- package/dist/esm/helpers/themes.native.mjs +0 -15
- package/dist/esm/helpers/themes.native.mjs.map +0 -1
- package/dist/esm/helpers/timer.native.mjs +0 -9
- package/dist/esm/helpers/timer.native.mjs.map +0 -1
- package/dist/esm/helpers/transformsToString.native.mjs +0 -14
- package/dist/esm/helpers/transformsToString.native.mjs.map +0 -1
- package/dist/esm/helpers/webPropsToSkip.native.mjs +0 -56
- package/dist/esm/helpers/webPropsToSkip.native.mjs.map +0 -1
- package/dist/esm/hooks/useConfiguration.native.mjs +0 -21
- package/dist/esm/hooks/useConfiguration.native.mjs.map +0 -1
- package/dist/esm/hooks/useDidHydrateOnce.native.mjs +0 -23
- package/dist/esm/hooks/useDidHydrateOnce.native.mjs.map +0 -1
- package/dist/esm/hooks/useDisableSSR.native.mjs +0 -7
- package/dist/esm/hooks/useDisableSSR.native.mjs.map +0 -1
- package/dist/esm/hooks/useIsTouchDevice.native.mjs +0 -7
- package/dist/esm/hooks/useIsTouchDevice.native.mjs.map +0 -1
- package/dist/esm/hooks/useMedia.native.mjs +0 -206
- package/dist/esm/hooks/useMedia.native.mjs.map +0 -1
- package/dist/esm/hooks/useProps.native.mjs +0 -74
- package/dist/esm/hooks/useProps.native.mjs.map +0 -1
- package/dist/esm/hooks/useTheme.native.mjs +0 -299
- package/dist/esm/hooks/useTheme.native.mjs.map +0 -1
- package/dist/esm/hooks/useThemeName.native.mjs +0 -16
- package/dist/esm/hooks/useThemeName.native.mjs.map +0 -1
- package/dist/esm/index.native.mjs +0 -66
- package/dist/esm/index.native.mjs.map +0 -1
- package/dist/esm/inject-styles.native.mjs +0 -15
- package/dist/esm/inject-styles.native.mjs.map +0 -1
- package/dist/esm/insertFont.native.mjs +0 -44
- package/dist/esm/insertFont.native.mjs.map +0 -1
- package/dist/esm/interfaces/CSSColorNames.native.mjs +0 -2
- package/dist/esm/interfaces/CSSColorNames.native.mjs.map +0 -1
- package/dist/esm/interfaces/GetRef.native.mjs +0 -2
- package/dist/esm/interfaces/GetRef.native.mjs.map +0 -1
- package/dist/esm/interfaces/KeyTypes.native.mjs +0 -2
- package/dist/esm/interfaces/KeyTypes.native.mjs.map +0 -1
- package/dist/esm/interfaces/RNExclusiveTypes.native.mjs +0 -2
- package/dist/esm/interfaces/RNExclusiveTypes.native.mjs.map +0 -1
- package/dist/esm/interfaces/Role.native.mjs +0 -2
- package/dist/esm/interfaces/Role.native.mjs.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentEvents.native.mjs +0 -2
- package/dist/esm/interfaces/TamaguiComponentEvents.native.mjs.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.mjs +0 -2
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.mjs.map +0 -1
- package/dist/esm/interfaces/TamaguiComponentState.native.mjs +0 -2
- package/dist/esm/interfaces/TamaguiComponentState.native.mjs.map +0 -1
- package/dist/esm/interfaces/WebOnlyPressEvents.native.mjs +0 -2
- package/dist/esm/interfaces/WebOnlyPressEvents.native.mjs.map +0 -1
- package/dist/esm/setupHooks.native.mjs +0 -7
- package/dist/esm/setupHooks.native.mjs.map +0 -1
- package/dist/esm/setupReactNative.native.mjs +0 -29
- package/dist/esm/setupReactNative.native.mjs.map +0 -1
- package/dist/esm/styled.native.mjs +0 -72
- package/dist/esm/styled.native.mjs.map +0 -1
- package/dist/esm/type-utils.native.mjs +0 -2
- package/dist/esm/type-utils.native.mjs.map +0 -1
- package/dist/esm/types.native.mjs +0 -3
- package/dist/esm/types.native.mjs.map +0 -1
- package/dist/esm/views/Configuration.native.mjs +0 -13
- package/dist/esm/views/Configuration.native.mjs.map +0 -1
- package/dist/esm/views/FontLanguage.native.mjs +0 -19
- package/dist/esm/views/FontLanguage.native.mjs.map +0 -1
- package/dist/esm/views/FontLanguage.types.native.mjs +0 -2
- package/dist/esm/views/FontLanguage.types.native.mjs.map +0 -1
- package/dist/esm/views/Slot.native.mjs +0 -59
- package/dist/esm/views/Slot.native.mjs.map +0 -1
- package/dist/esm/views/Stack.native.mjs +0 -11
- package/dist/esm/views/Stack.native.mjs.map +0 -1
- package/dist/esm/views/TamaguiProvider.native.mjs +0 -55
- package/dist/esm/views/TamaguiProvider.native.mjs.map +0 -1
- package/dist/esm/views/Text.native.mjs +0 -33
- package/dist/esm/views/Text.native.mjs.map +0 -1
- package/dist/esm/views/Theme.native.mjs +0 -123
- package/dist/esm/views/Theme.native.mjs.map +0 -1
- package/dist/esm/views/ThemeDebug.native.mjs +0 -11
- package/dist/esm/views/ThemeDebug.native.mjs.map +0 -1
- package/dist/esm/views/ThemeProvider.native.mjs +0 -28
- package/dist/esm/views/ThemeProvider.native.mjs.map +0 -1
- package/dist/esm/views/View.native.mjs +0 -10
- package/dist/esm/views/View.native.mjs.map +0 -1
|
@@ -3,31 +3,35 @@ import React from "react";
|
|
|
3
3
|
import { composeRefs } from "@tamagui/compose-refs";
|
|
4
4
|
import { isClient, isServer, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
5
5
|
import { composeEventHandlers, validStyles } from "@tamagui/helpers";
|
|
6
|
-
import { devConfig, getConfig, onConfiguredOnce } from "./config";
|
|
7
|
-
import { stackDefaultStyles } from "./constants/constants";
|
|
8
|
-
import { isDevTools } from "./constants/isDevTools";
|
|
9
|
-
import { ComponentContext } from "./contexts/ComponentContext";
|
|
10
|
-
import { didGetVariableValue, setDidGetVariableValue } from "./createVariable";
|
|
11
|
-
import { defaultComponentState, defaultComponentStateMounted, defaultComponentStateShouldEnter } from "./defaultComponentState";
|
|
12
|
-
import { createShallowSetState, mergeIfNotShallowEqual } from "./helpers/createShallowSetState";
|
|
13
|
-
import { useSplitStyles } from "./helpers/getSplitStyles";
|
|
14
|
-
import { isObj } from "./helpers/isObj";
|
|
15
|
-
import { log } from "./helpers/log";
|
|
16
|
-
import { mergeProps } from "./helpers/mergeProps";
|
|
17
|
-
import { setElementProps } from "./helpers/setElementProps";
|
|
18
|
-
import { themeable } from "./helpers/themeable";
|
|
19
|
-
import { useDidHydrateOnce } from "./hooks/useDidHydrateOnce";
|
|
20
|
-
import { getMediaState, setMediaShouldUpdate, useMedia } from "./hooks/useMedia";
|
|
21
|
-
import { useThemeWithState } from "./hooks/useTheme";
|
|
22
|
-
import { hooks } from "./setupHooks";
|
|
23
|
-
import { Slot } from "./views/Slot";
|
|
24
|
-
import { getThemedChildren } from "./views/Theme";
|
|
25
|
-
import { ThemeDebug } from "./views/ThemeDebug";
|
|
26
|
-
var tamaguiConfig,
|
|
6
|
+
import { devConfig, getConfig, onConfiguredOnce } from "./config.native.js";
|
|
7
|
+
import { stackDefaultStyles } from "./constants/constants.native.js";
|
|
8
|
+
import { isDevTools } from "./constants/isDevTools.native.js";
|
|
9
|
+
import { ComponentContext } from "./contexts/ComponentContext.native.js";
|
|
10
|
+
import { didGetVariableValue, setDidGetVariableValue } from "./createVariable.native.js";
|
|
11
|
+
import { defaultComponentState, defaultComponentStateMounted, defaultComponentStateShouldEnter } from "./defaultComponentState.native.js";
|
|
12
|
+
import { createShallowSetState, mergeIfNotShallowEqual } from "./helpers/createShallowSetState.native.js";
|
|
13
|
+
import { useSplitStyles } from "./helpers/getSplitStyles.native.js";
|
|
14
|
+
import { isObj } from "./helpers/isObj.native.js";
|
|
15
|
+
import { log } from "./helpers/log.native.js";
|
|
16
|
+
import { mergeProps } from "./helpers/mergeProps.native.js";
|
|
17
|
+
import { setElementProps } from "./helpers/setElementProps.native.js";
|
|
18
|
+
import { themeable } from "./helpers/themeable.native.js";
|
|
19
|
+
import { useDidHydrateOnce } from "./hooks/useDidHydrateOnce.native.js";
|
|
20
|
+
import { getMediaState, setMediaShouldUpdate, useMedia } from "./hooks/useMedia.native.js";
|
|
21
|
+
import { useThemeWithState } from "./hooks/useTheme.native.js";
|
|
22
|
+
import { hooks } from "./setupHooks.native.js";
|
|
23
|
+
import { Slot } from "./views/Slot.native.js";
|
|
24
|
+
import { getThemedChildren } from "./views/Theme.native.js";
|
|
25
|
+
import { ThemeDebug } from "./views/ThemeDebug.native.js";
|
|
26
|
+
var tamaguiConfig,
|
|
27
|
+
time,
|
|
28
|
+
debugKeyListeners,
|
|
29
|
+
startVisualizer,
|
|
30
|
+
componentSetStates = /* @__PURE__ */new Set();
|
|
27
31
|
if (typeof document < "u") {
|
|
28
|
-
var cancelTouches = function() {
|
|
29
|
-
componentSetStates.forEach(function(setState) {
|
|
30
|
-
return setState(function(prev) {
|
|
32
|
+
var cancelTouches = function () {
|
|
33
|
+
componentSetStates.forEach(function (setState) {
|
|
34
|
+
return setState(function (prev) {
|
|
31
35
|
return prev.press || prev.pressIn ? {
|
|
32
36
|
...prev,
|
|
33
37
|
press: !1,
|
|
@@ -36,155 +40,219 @@ if (typeof document < "u") {
|
|
|
36
40
|
});
|
|
37
41
|
}), componentSetStates.clear();
|
|
38
42
|
};
|
|
39
|
-
addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = function() {
|
|
43
|
+
addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = function () {
|
|
40
44
|
var devVisualizerConfig = devConfig === null || devConfig === void 0 ? void 0 : devConfig.visualizer;
|
|
41
45
|
if (devVisualizerConfig) {
|
|
42
|
-
debugKeyListeners = /* @__PURE__ */
|
|
43
|
-
var tm,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
debugKeyListeners = /* @__PURE__ */new Set();
|
|
47
|
+
var tm,
|
|
48
|
+
isShowing = !1,
|
|
49
|
+
options = {
|
|
50
|
+
key: "Alt",
|
|
51
|
+
delay: 800,
|
|
52
|
+
...(typeof devVisualizerConfig == "object" ? devVisualizerConfig : {})
|
|
53
|
+
};
|
|
54
|
+
document.addEventListener("blur", function () {
|
|
49
55
|
clearTimeout(tm);
|
|
50
|
-
}), document.addEventListener("keydown", function(param) {
|
|
51
|
-
var {
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
}), document.addEventListener("keydown", function (param) {
|
|
57
|
+
var {
|
|
58
|
+
key,
|
|
59
|
+
defaultPrevented
|
|
60
|
+
} = param;
|
|
61
|
+
defaultPrevented || (clearTimeout(tm), key === options.key && (tm = setTimeout(function () {
|
|
62
|
+
isShowing = !0, debugKeyListeners?.forEach(function (l) {
|
|
54
63
|
return l(!0);
|
|
55
64
|
});
|
|
56
65
|
}, options.delay)));
|
|
57
|
-
}), document.addEventListener("keyup", function(param) {
|
|
58
|
-
var {
|
|
59
|
-
|
|
66
|
+
}), document.addEventListener("keyup", function (param) {
|
|
67
|
+
var {
|
|
68
|
+
key,
|
|
69
|
+
defaultPrevented
|
|
70
|
+
} = param;
|
|
71
|
+
defaultPrevented || key === options.key && (clearTimeout(tm), isShowing && debugKeyListeners?.forEach(function (l) {
|
|
60
72
|
return l(!1);
|
|
61
73
|
}));
|
|
62
74
|
});
|
|
63
75
|
}
|
|
64
76
|
});
|
|
65
77
|
}
|
|
66
|
-
var useComponentState = function(props, param, staticConfig, config) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
78
|
+
var useComponentState = function (props, param, staticConfig, config) {
|
|
79
|
+
var {
|
|
80
|
+
animationDriver,
|
|
81
|
+
groups
|
|
82
|
+
} = param,
|
|
83
|
+
_animationDriver_usePresence,
|
|
84
|
+
useAnimations = animationDriver?.useAnimations,
|
|
85
|
+
stateRef = React.useRef(void 0);
|
|
86
|
+
stateRef.current || (stateRef.current = {});
|
|
87
|
+
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)),
|
|
88
|
+
supportsCSSVars = animationDriver?.supportsCSSVars,
|
|
89
|
+
curStateRef = stateRef.current,
|
|
90
|
+
willBeAnimatedClient = function () {
|
|
91
|
+
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
92
|
+
return !!(next || curStateRef.hasAnimated);
|
|
93
|
+
}(),
|
|
94
|
+
willBeAnimated = !isServer && willBeAnimatedClient;
|
|
95
|
+
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
96
|
+
var presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null,
|
|
97
|
+
presenceState = presence?.[2],
|
|
98
|
+
isExiting = presenceState?.isPresent === !1,
|
|
99
|
+
isEntering = presenceState?.isPresent === !0 && presenceState.initial !== !1,
|
|
100
|
+
hasEnterStyle = !!props.enterStyle,
|
|
101
|
+
hasRNAnimation = hasAnimationProp && animationDriver?.isReactNative;
|
|
102
|
+
process.env.NODE_ENV === "development" && time && time`pre-use-state`;
|
|
103
|
+
var hasEnterState = hasEnterStyle || isEntering,
|
|
104
|
+
didHydrateOnce = willBeAnimated ? useDidHydrateOnce() : !0,
|
|
105
|
+
shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation,
|
|
106
|
+
shouldEnterFromUnhydrated = isWeb && !didHydrateOnce,
|
|
107
|
+
initialState = shouldEnter ?
|
|
108
|
+
// on the very first render we switch all spring animation drivers to css rendering
|
|
109
|
+
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
110
|
+
// without flickers of the wrong colors.
|
|
111
|
+
// but once we do that initial hydration and we are in client side rendering mode,
|
|
112
|
+
// we can avoid the extra re-render on mount
|
|
113
|
+
shouldEnterFromUnhydrated ? defaultComponentState : defaultComponentStateShouldEnter : defaultComponentStateMounted,
|
|
114
|
+
disabled = isDisabled(props);
|
|
115
|
+
disabled != null && (initialState.disabled = disabled);
|
|
116
|
+
var states = React.useState(initialState),
|
|
117
|
+
state = props.forceStyle ? {
|
|
118
|
+
...states[0],
|
|
119
|
+
[props.forceStyle]: !0
|
|
120
|
+
} : states[0],
|
|
121
|
+
setState = states[1],
|
|
122
|
+
isHydrated = state.unmounted === !1 || state.unmounted === "should-enter",
|
|
123
|
+
isAnimated = willBeAnimated;
|
|
124
|
+
isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, defaultComponentStateMounted), setState({
|
|
125
|
+
...state
|
|
107
126
|
}));
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
127
|
+
var setStateShallow = createShallowSetState(setState, disabled, !1, props.debug);
|
|
128
|
+
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
129
|
+
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
|
|
130
|
+
var {
|
|
131
|
+
enterVariant,
|
|
132
|
+
exitVariant,
|
|
133
|
+
enterExitVariant,
|
|
134
|
+
custom
|
|
135
|
+
} = presenceState;
|
|
136
|
+
isObj(custom) && Object.assign(props, custom);
|
|
137
|
+
var exv = exitVariant ?? enterExitVariant,
|
|
138
|
+
env = enterVariant ?? enterExitVariant;
|
|
139
|
+
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
|
|
140
|
+
}
|
|
141
|
+
var shouldAvoidClasses = !isWeb;
|
|
142
|
+
if (isWeb) {
|
|
143
|
+
var {
|
|
144
|
+
disableClassName
|
|
145
|
+
} = props,
|
|
146
|
+
isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !isServer,
|
|
147
|
+
isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce),
|
|
148
|
+
isDisabledManually = disableClassName && !isServer && didHydrateOnce && state.unmounted === !0;
|
|
149
|
+
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && log("avoiding className", {
|
|
150
|
+
isAnimatedAndHydrated,
|
|
151
|
+
isDisabledManually,
|
|
152
|
+
isClassNameDisabled
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
var groupName = props.group;
|
|
156
|
+
if (groupName && !curStateRef.group) {
|
|
157
|
+
var listeners = /* @__PURE__ */new Set();
|
|
158
|
+
curStateRef.group = {
|
|
159
|
+
listeners,
|
|
160
|
+
emit(name, state2) {
|
|
161
|
+
listeners.forEach(function (l) {
|
|
162
|
+
return l(name, state2);
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
subscribe(cb) {
|
|
166
|
+
return listeners.add(cb), function () {
|
|
167
|
+
listeners.delete(cb);
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
if (groupName) {
|
|
173
|
+
var groupContextState = groups.state,
|
|
174
|
+
og = setStateShallow;
|
|
175
|
+
setStateShallow = function (state2) {
|
|
176
|
+
og(state2), curStateRef.group.emit(groupName, {
|
|
177
|
+
pseudo: state2
|
|
117
178
|
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
listeners.delete(cb);
|
|
179
|
+
var next = {
|
|
180
|
+
...groupContextState[groupName],
|
|
181
|
+
...state2
|
|
122
182
|
};
|
|
123
|
-
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
if (groupName) {
|
|
127
|
-
var groupContextState = groups.state, og = setStateShallow;
|
|
128
|
-
setStateShallow = function(state2) {
|
|
129
|
-
og(state2), curStateRef.group.emit(groupName, {
|
|
130
|
-
pseudo: state2
|
|
131
|
-
});
|
|
132
|
-
var next = {
|
|
133
|
-
...groupContextState[groupName],
|
|
134
|
-
...state2
|
|
183
|
+
groupContextState[groupName] = next;
|
|
135
184
|
};
|
|
136
|
-
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
curStateRef,
|
|
188
|
+
disabled,
|
|
189
|
+
groupName,
|
|
190
|
+
hasAnimationProp,
|
|
191
|
+
hasEnterStyle,
|
|
192
|
+
isAnimated,
|
|
193
|
+
isExiting,
|
|
194
|
+
isHydrated,
|
|
195
|
+
presence,
|
|
196
|
+
presenceState,
|
|
197
|
+
setState,
|
|
198
|
+
setStateShallow,
|
|
199
|
+
shouldAvoidClasses,
|
|
200
|
+
state,
|
|
201
|
+
stateRef,
|
|
202
|
+
supportsCSSVars,
|
|
203
|
+
willBeAnimated,
|
|
204
|
+
willBeAnimatedClient
|
|
137
205
|
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
hasEnterStyle,
|
|
145
|
-
isAnimated,
|
|
146
|
-
isExiting,
|
|
147
|
-
isHydrated,
|
|
148
|
-
presence,
|
|
149
|
-
presenceState,
|
|
150
|
-
setState,
|
|
151
|
-
setStateShallow,
|
|
152
|
-
shouldAvoidClasses,
|
|
153
|
-
state,
|
|
154
|
-
stateRef,
|
|
155
|
-
supportsCSSVars,
|
|
156
|
-
willBeAnimated,
|
|
157
|
-
willBeAnimatedClient
|
|
206
|
+
},
|
|
207
|
+
BaseText,
|
|
208
|
+
BaseView,
|
|
209
|
+
hasSetupBaseViews = !1,
|
|
210
|
+
lastInteractionWasKeyboard = {
|
|
211
|
+
value: !1
|
|
158
212
|
};
|
|
159
|
-
|
|
160
|
-
value: !1
|
|
161
|
-
};
|
|
162
|
-
isWeb && globalThis.document && (document.addEventListener("keydown", function() {
|
|
213
|
+
isWeb && globalThis.document && (document.addEventListener("keydown", function () {
|
|
163
214
|
lastInteractionWasKeyboard.value = !0;
|
|
164
|
-
}), document.addEventListener("mousedown", function() {
|
|
215
|
+
}), document.addEventListener("mousedown", function () {
|
|
165
216
|
lastInteractionWasKeyboard.value = !1;
|
|
166
|
-
}), document.addEventListener("mousemove", function() {
|
|
217
|
+
}), document.addEventListener("mousemove", function () {
|
|
167
218
|
lastInteractionWasKeyboard.value = !1;
|
|
168
219
|
}));
|
|
169
220
|
function createComponent(staticConfig) {
|
|
170
|
-
var _staticConfig_defaultProps,
|
|
171
|
-
|
|
221
|
+
var _staticConfig_defaultProps,
|
|
222
|
+
{
|
|
223
|
+
componentName
|
|
224
|
+
} = staticConfig,
|
|
225
|
+
config = null,
|
|
226
|
+
defaultProps = staticConfig.defaultProps;
|
|
227
|
+
onConfiguredOnce(function (conf) {
|
|
172
228
|
if (config = conf, componentName) {
|
|
173
|
-
var _conf_defaultProps,
|
|
229
|
+
var _conf_defaultProps,
|
|
230
|
+
defaultForComponent = (_conf_defaultProps = conf.defaultProps) === null || _conf_defaultProps === void 0 ? void 0 : _conf_defaultProps[componentName];
|
|
174
231
|
defaultForComponent && (defaultProps = {
|
|
175
232
|
...defaultForComponent,
|
|
176
233
|
...defaultProps
|
|
177
234
|
});
|
|
178
235
|
}
|
|
179
236
|
});
|
|
180
|
-
var {
|
|
181
|
-
|
|
237
|
+
var {
|
|
238
|
+
Component,
|
|
239
|
+
isText,
|
|
240
|
+
isZStack,
|
|
241
|
+
isHOC,
|
|
242
|
+
validStyles: _$validStyles = {},
|
|
243
|
+
variants = {}
|
|
244
|
+
} = staticConfig;
|
|
245
|
+
process.env.NODE_ENV === "development" && !((_staticConfig_defaultProps = staticConfig.defaultProps) === null || _staticConfig_defaultProps === void 0) && _staticConfig_defaultProps.debug && process.env.IS_STATIC !== "is_static" && log(`\u{1F41B} [${componentName || "Component"}]`, {
|
|
182
246
|
staticConfig,
|
|
183
247
|
defaultProps,
|
|
184
248
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
185
249
|
});
|
|
186
|
-
var component = /* @__PURE__ */
|
|
187
|
-
var _themeState_state,
|
|
250
|
+
var component = /* @__PURE__ */React.forwardRef(function (propsIn, forwardedRef) {
|
|
251
|
+
var _themeState_state,
|
|
252
|
+
_hooks_usePropsTransform,
|
|
253
|
+
_hooks_useEvents,
|
|
254
|
+
_config_animations,
|
|
255
|
+
internalID = process.env.NODE_ENV === "development" ? React.useId() : "";
|
|
188
256
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
189
257
|
var _hooks_getBaseViews;
|
|
190
258
|
hasSetupBaseViews = !0;
|
|
@@ -195,53 +263,95 @@ function createComponent(staticConfig) {
|
|
|
195
263
|
var _propsIn_datatestrenders, _current, _;
|
|
196
264
|
(_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
|
|
197
265
|
}
|
|
198
|
-
var componentContext = React.useContext(ComponentContext),
|
|
266
|
+
var componentContext = React.useContext(ComponentContext),
|
|
267
|
+
styledContextProps,
|
|
268
|
+
overriddenContextProps,
|
|
269
|
+
contextValue,
|
|
270
|
+
{
|
|
271
|
+
context,
|
|
272
|
+
isReactNative
|
|
273
|
+
} = staticConfig;
|
|
199
274
|
if (context) {
|
|
200
275
|
contextValue = React.useContext(context);
|
|
201
|
-
var {
|
|
276
|
+
var {
|
|
277
|
+
inverseShorthands
|
|
278
|
+
} = getConfig();
|
|
202
279
|
for (var key in context.props) {
|
|
203
|
-
var _propsIn_key,
|
|
280
|
+
var _propsIn_key,
|
|
281
|
+
_ref,
|
|
282
|
+
_ref1,
|
|
283
|
+
propVal = (_ref1 = (_ref = (_propsIn_key = propsIn[key]) !== null && _propsIn_key !== void 0 ? _propsIn_key : propsIn[inverseShorthands[key]]) !== null && _ref !== void 0 ? _ref : defaultProps?.[key]) !== null && _ref1 !== void 0 ? _ref1 : defaultProps?.[inverseShorthands[key]];
|
|
204
284
|
if (propVal === void 0) {
|
|
205
285
|
var val = contextValue?.[key];
|
|
206
286
|
val !== void 0 && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = val);
|
|
207
|
-
} else
|
|
208
|
-
overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal;
|
|
287
|
+
} else overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal;
|
|
209
288
|
}
|
|
210
289
|
}
|
|
211
290
|
var curDefaultProps = styledContextProps ? {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
291
|
+
...defaultProps,
|
|
292
|
+
...styledContextProps
|
|
293
|
+
} : defaultProps,
|
|
294
|
+
props = propsIn;
|
|
215
295
|
curDefaultProps && (props = mergeProps(curDefaultProps, propsIn));
|
|
216
|
-
var debugProp = props.debug,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
296
|
+
var debugProp = props.debug,
|
|
297
|
+
componentName2 = props.componentName || staticConfig.componentName;
|
|
298
|
+
if (process.env.NODE_ENV === "development" && isClient && React.useEffect(function () {
|
|
299
|
+
var overlay = null,
|
|
300
|
+
debugVisualizerHandler = function () {
|
|
301
|
+
var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1,
|
|
302
|
+
node = curStateRef.host;
|
|
303
|
+
if (node) if (show) {
|
|
222
304
|
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";
|
|
223
|
-
var dataAt = node.getAttribute("data-at") || "",
|
|
305
|
+
var dataAt = node.getAttribute("data-at") || "",
|
|
306
|
+
dataIn = node.getAttribute("data-in") || "",
|
|
307
|
+
tooltip = document.createElement("span");
|
|
224
308
|
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.style.webkitFontSmoothing = "none", tooltip.innerText = `${componentName2 || ""} ${dataAt} ${dataIn}`.trim(), overlay.appendChild(tooltip), node.appendChild(overlay);
|
|
225
|
-
} else
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return debugKeyListeners || (debugKeyListeners = /* @__PURE__ */ new Set()), debugKeyListeners.add(debugVisualizerHandler), function() {
|
|
309
|
+
} else overlay && node.removeChild(overlay);
|
|
310
|
+
};
|
|
311
|
+
return debugKeyListeners || (debugKeyListeners = /* @__PURE__ */new Set()), debugKeyListeners.add(debugVisualizerHandler), function () {
|
|
229
312
|
debugKeyListeners?.delete(debugVisualizerHandler);
|
|
230
313
|
};
|
|
231
|
-
}, [
|
|
232
|
-
componentName2
|
|
233
|
-
]), !process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time) {
|
|
314
|
+
}, [componentName2]), !process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time) {
|
|
234
315
|
var timer = require("@tamagui/timer").timer();
|
|
235
316
|
time = timer.start();
|
|
236
317
|
}
|
|
237
318
|
process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`, process.env.NODE_ENV === "development" && time && time`stateref`;
|
|
238
|
-
var animationDriver = componentContext.animationDriver,
|
|
319
|
+
var animationDriver = componentContext.animationDriver,
|
|
320
|
+
useAnimations = animationDriver?.useAnimations,
|
|
321
|
+
{
|
|
322
|
+
curStateRef,
|
|
323
|
+
disabled,
|
|
324
|
+
groupName,
|
|
325
|
+
hasAnimationProp,
|
|
326
|
+
hasEnterStyle,
|
|
327
|
+
isAnimated,
|
|
328
|
+
isExiting,
|
|
329
|
+
isHydrated,
|
|
330
|
+
presence,
|
|
331
|
+
presenceState,
|
|
332
|
+
setState,
|
|
333
|
+
setStateShallow,
|
|
334
|
+
shouldAvoidClasses,
|
|
335
|
+
state,
|
|
336
|
+
stateRef,
|
|
337
|
+
supportsCSSVars,
|
|
338
|
+
willBeAnimated,
|
|
339
|
+
willBeAnimatedClient
|
|
340
|
+
} = useComponentState(props, componentContext, staticConfig, config),
|
|
341
|
+
shouldForcePseudo = !!propsIn.forceStyle,
|
|
342
|
+
noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
239
343
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
240
344
|
var hasTextAncestor = !!(isWeb && isText && componentContext.inText);
|
|
241
345
|
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
242
|
-
var isTaggable = !Component || typeof Component == "string",
|
|
346
|
+
var isTaggable = !Component || typeof Component == "string",
|
|
347
|
+
tagProp = props.tag,
|
|
348
|
+
element = isWeb && isTaggable && tagProp || Component,
|
|
349
|
+
BaseTextComponent = BaseText || element || "span",
|
|
350
|
+
BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"),
|
|
351
|
+
elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
243
352
|
animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
244
|
-
var disableThemeProp = !1,
|
|
353
|
+
var disableThemeProp = !1,
|
|
354
|
+
disableTheme = disableThemeProp || isHOC;
|
|
245
355
|
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (curStateRef.themeShallow = !0);
|
|
246
356
|
var themeStateProps = {
|
|
247
357
|
componentName: componentName2,
|
|
@@ -249,21 +359,23 @@ function createComponent(staticConfig) {
|
|
|
249
359
|
shallow: curStateRef.themeShallow,
|
|
250
360
|
debug: debugProp
|
|
251
361
|
};
|
|
252
|
-
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof curStateRef.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = function() {
|
|
362
|
+
if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof curStateRef.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = function () {
|
|
253
363
|
return stateRef.current.isListeningToTheme;
|
|
254
364
|
}), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
255
|
-
var name = `${componentName2 || Component?.displayName || Component?.name || "[Unnamed Component]"}`,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
365
|
+
var name = `${componentName2 || Component?.displayName || Component?.name || "[Unnamed Component]"}`,
|
|
366
|
+
type = (hasEnterStyle ? "(hasEnter)" : " ") + (isAnimated ? "(animated)" : " ") + (isReactNative ? "(rnw)" : " ") + (shouldAvoidClasses ? "(shouldAvoidClasses)" : " ") + (state.press || state.pressIn ? "(PRESSED)" : " ") + (state.hover ? "(HOVERED)" : " ") + (state.focus ? "(FOCUSED)" : " ") + (presenceState?.isPresent === !1 ? "(EXIT)" : ""),
|
|
367
|
+
dataIs = propsIn["data-is"] || "",
|
|
368
|
+
banner = `${internalID} ${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
|
|
369
|
+
if (console.info(`%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`, "background: green; color: white;"), isServer) log({
|
|
370
|
+
noClassNames,
|
|
371
|
+
isAnimated,
|
|
372
|
+
shouldAvoidClasses,
|
|
373
|
+
isWeb,
|
|
374
|
+
supportsCSSVars
|
|
375
|
+
});else {
|
|
265
376
|
console.groupEnd();
|
|
266
|
-
var ch = propsIn.children,
|
|
377
|
+
var ch = propsIn.children,
|
|
378
|
+
childLog = typeof ch == "string" ? ch.length > 4 ? ch.slice(0, 4) + "..." : ch : "";
|
|
267
379
|
childLog.length && (childLog = `(children: ${childLog})`), console.groupCollapsed(`${childLog} Props:`), log("props in:", propsIn), log("final props:", props), log({
|
|
268
380
|
state,
|
|
269
381
|
staticConfig,
|
|
@@ -288,98 +400,115 @@ function createComponent(staticConfig) {
|
|
|
288
400
|
process.env.NODE_ENV === "development" && time && time`theme`;
|
|
289
401
|
var mediaState = useMedia(stateRef, componentContext, debugProp);
|
|
290
402
|
setDidGetVariableValue(!1), process.env.NODE_ENV === "development" && time && time`media`;
|
|
291
|
-
var resolveValues =
|
|
403
|
+
var resolveValues =
|
|
292
404
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
293
|
-
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
405
|
+
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto",
|
|
406
|
+
styleProps = {
|
|
407
|
+
mediaState,
|
|
408
|
+
noClassNames,
|
|
409
|
+
resolveValues,
|
|
410
|
+
isExiting,
|
|
411
|
+
isAnimated,
|
|
412
|
+
willBeAnimated,
|
|
413
|
+
styledContextProps
|
|
414
|
+
},
|
|
415
|
+
splitStyles = useSplitStyles(props, staticConfig, theme, (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, styleProps, null, componentContext, elementType, debugProp);
|
|
303
416
|
if (props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
|
|
304
417
|
var _splitStyles;
|
|
305
418
|
(_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
|
|
306
419
|
}
|
|
307
420
|
process.env.NODE_ENV === "development" && time && time`split-styles`, curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
308
|
-
var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0,
|
|
421
|
+
var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0,
|
|
422
|
+
shouldListenForMedia = didGetVariableValue() || hasRuntimeMediaKeys || noClassNames && splitStyles.hasMedia === !0,
|
|
423
|
+
mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
|
|
309
424
|
process.env.NODE_ENV === "development" && debugProp && console.info("useMedia() createComponent", shouldListenForMedia, mediaListeningKeys), setMediaShouldUpdate(stateRef, {
|
|
310
425
|
enabled: shouldListenForMedia,
|
|
311
426
|
keys: mediaListeningKeys
|
|
312
427
|
});
|
|
313
|
-
var {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
428
|
+
var {
|
|
429
|
+
viewProps: viewPropsIn,
|
|
430
|
+
pseudos,
|
|
431
|
+
style: splitStylesStyle,
|
|
432
|
+
classNames,
|
|
433
|
+
space
|
|
434
|
+
} = splitStyles,
|
|
435
|
+
propsWithAnimation = props,
|
|
436
|
+
{
|
|
437
|
+
asChild,
|
|
438
|
+
children,
|
|
439
|
+
themeShallow,
|
|
440
|
+
spaceDirection: _spaceDirection,
|
|
441
|
+
onPress,
|
|
442
|
+
onLongPress,
|
|
443
|
+
onPressIn,
|
|
444
|
+
onPressOut,
|
|
445
|
+
onHoverIn,
|
|
446
|
+
onHoverOut,
|
|
447
|
+
onMouseUp,
|
|
448
|
+
onMouseDown,
|
|
449
|
+
onMouseEnter,
|
|
450
|
+
onMouseLeave,
|
|
451
|
+
onFocus,
|
|
452
|
+
onBlur,
|
|
453
|
+
separator,
|
|
454
|
+
// ignore from here on out
|
|
455
|
+
forceStyle: _forceStyle,
|
|
456
|
+
// @ts-ignore for next/link compat etc
|
|
457
|
+
onClick,
|
|
458
|
+
theme: _themeProp,
|
|
459
|
+
...nonTamaguiProps
|
|
460
|
+
} = viewPropsIn,
|
|
461
|
+
viewProps = nonTamaguiProps;
|
|
338
462
|
!isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && _themeProp && (viewProps.theme = _themeProp), elementType.acceptTagProp && (viewProps.tag = tagProp);
|
|
339
|
-
var animationStyles,
|
|
463
|
+
var animationStyles,
|
|
464
|
+
shouldUseAnimation =
|
|
340
465
|
// if it supports css vars we run it on server too to get matching initial style
|
|
341
|
-
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
342
|
-
);
|
|
466
|
+
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC;
|
|
343
467
|
if (shouldUseAnimation) {
|
|
344
|
-
var _themeState_state1,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
468
|
+
var _themeState_state1,
|
|
469
|
+
animations = useAnimations({
|
|
470
|
+
props: propsWithAnimation,
|
|
471
|
+
// if hydrating, send empty style
|
|
472
|
+
style: splitStylesStyle || {},
|
|
473
|
+
presence,
|
|
474
|
+
componentState: state,
|
|
475
|
+
styleProps,
|
|
476
|
+
theme: (_themeState_state1 = themeState.state) === null || _themeState_state1 === void 0 ? void 0 : _themeState_state1.theme,
|
|
477
|
+
pseudos: pseudos || null,
|
|
478
|
+
staticConfig,
|
|
479
|
+
stateRef
|
|
480
|
+
});
|
|
356
481
|
(isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${viewProps.className || ""} ${animations.className}`)), process.env.NODE_ENV === "development" && time && time`animations`;
|
|
357
482
|
}
|
|
358
483
|
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.
|
|
359
484
|
|
|
360
|
-
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`, groupName && (nonTamaguiProps.onLayout = composeEventHandlers(nonTamaguiProps.onLayout, function(e) {
|
|
485
|
+
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`, groupName && (nonTamaguiProps.onLayout = composeEventHandlers(nonTamaguiProps.onLayout, function (e) {
|
|
361
486
|
stateRef.current.group.emit(groupName, {
|
|
362
487
|
layout: e.nativeEvent.layout
|
|
363
|
-
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
|
|
488
|
+
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function (prev) {
|
|
364
489
|
return {
|
|
365
490
|
...prev
|
|
366
491
|
};
|
|
367
492
|
}), stateRef.current.hasMeasured = !0;
|
|
368
|
-
})), viewProps = ((_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, elementType, nonTamaguiProps, stateRef, curStateRef.willHydrate)) || nonTamaguiProps, curStateRef.composedRef || (curStateRef.composedRef = composeRefs(function(x) {
|
|
493
|
+
})), viewProps = ((_hooks_usePropsTransform = hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(hooks, elementType, nonTamaguiProps, stateRef, curStateRef.willHydrate)) || nonTamaguiProps, curStateRef.composedRef || (curStateRef.composedRef = composeRefs(function (x) {
|
|
369
494
|
return stateRef.current.host = x;
|
|
370
|
-
}, forwardedRef, setElementProps)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && isWeb && !isHOC && React.Children.toArray(props.children).forEach(function(item) {
|
|
495
|
+
}, forwardedRef, setElementProps)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && isWeb && !isHOC && React.Children.toArray(props.children).forEach(function (item) {
|
|
371
496
|
typeof item == "string" && item !== `
|
|
372
497
|
` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
373
498
|
}), process.env.NODE_ENV === "development" && time && time`events-hooks`;
|
|
374
|
-
var {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
499
|
+
var {
|
|
500
|
+
pseudoGroups,
|
|
501
|
+
mediaGroups
|
|
502
|
+
} = splitStyles,
|
|
503
|
+
unPress = function () {
|
|
504
|
+
return setStateShallow({
|
|
505
|
+
press: !1,
|
|
506
|
+
pressIn: !1
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
process.env.NODE_ENV === "development" && isWeb && useIsomorphicLayoutEffect(function () {
|
|
381
510
|
debugProp && (console.groupCollapsed("Rendered style >"), console.warn(getComputedStyle(stateRef.current.host)), console.groupEnd());
|
|
382
|
-
}), React.useEffect(function() {
|
|
511
|
+
}), React.useEffect(function () {
|
|
383
512
|
if (!disabled) {
|
|
384
513
|
if (state.unmounted === !0 && hasEnterStyle) {
|
|
385
514
|
setStateShallow({
|
|
@@ -401,21 +530,21 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
401
530
|
mediaGroups,
|
|
402
531
|
pseudoGroups
|
|
403
532
|
});
|
|
404
|
-
return function() {
|
|
533
|
+
return function () {
|
|
405
534
|
dispose?.(), componentSetStates.delete(setState);
|
|
406
535
|
};
|
|
407
536
|
}
|
|
408
|
-
}, [
|
|
409
|
-
|
|
410
|
-
disabled,
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
537
|
+
}, [state.unmounted, disabled, pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0, mediaGroups ? Object.keys([...mediaGroups]).join("") : 0]);
|
|
538
|
+
var runtimePressStyle = !disabled && noClassNames && pseudos?.pressStyle,
|
|
539
|
+
runtimeFocusStyle = !disabled && noClassNames && pseudos?.focusStyle,
|
|
540
|
+
runtimeFocusVisibleStyle = !disabled && noClassNames && pseudos?.focusVisibleStyle,
|
|
541
|
+
attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur),
|
|
542
|
+
attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos?.focusVisibleStyle),
|
|
543
|
+
runtimeHoverStyle = !disabled && noClassNames && pseudos?.hoverStyle,
|
|
544
|
+
needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut),
|
|
545
|
+
attachHover = isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave),
|
|
546
|
+
shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle),
|
|
547
|
+
needsPressState = !!(groupName || runtimePressStyle);
|
|
419
548
|
process.env.NODE_ENV === "development" && time && time`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && log("\u{1FAA9} events()", {
|
|
420
549
|
runtimeFocusStyle,
|
|
421
550
|
runtimePressStyle,
|
|
@@ -428,36 +557,36 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
428
557
|
needsHoverState
|
|
429
558
|
});
|
|
430
559
|
var events = shouldAttach ? {
|
|
431
|
-
onPressOut: attachPress ? function(e) {
|
|
560
|
+
onPressOut: attachPress ? function (e) {
|
|
432
561
|
unPress(), onPressOut?.(e), onMouseUp?.(e);
|
|
433
562
|
} : void 0,
|
|
434
|
-
...(attachHover || attachPress) && {
|
|
435
|
-
onMouseEnter: function(e) {
|
|
563
|
+
...((attachHover || attachPress) && {
|
|
564
|
+
onMouseEnter: function (e) {
|
|
436
565
|
var next = {};
|
|
437
566
|
needsHoverState && (next.hover = !0), needsPressState && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn?.(e), onMouseEnter?.(e);
|
|
438
567
|
},
|
|
439
|
-
onMouseLeave: function(e) {
|
|
568
|
+
onMouseLeave: function (e) {
|
|
440
569
|
var next = {};
|
|
441
570
|
needsHoverState && (next.hover = !1), needsPressState && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut?.(e), onMouseLeave?.(e);
|
|
442
571
|
}
|
|
443
|
-
},
|
|
444
|
-
onPressIn: attachPress ? function(e) {
|
|
572
|
+
}),
|
|
573
|
+
onPressIn: attachPress ? function (e) {
|
|
445
574
|
(runtimePressStyle || groupName) && setStateShallow({
|
|
446
575
|
press: !0,
|
|
447
576
|
pressIn: !0
|
|
448
577
|
}), onPressIn?.(e), onMouseDown?.(e), isWeb && componentSetStates.add(setState);
|
|
449
578
|
} : void 0,
|
|
450
|
-
onPress: attachPress ? function(e) {
|
|
579
|
+
onPress: attachPress ? function (e) {
|
|
451
580
|
unPress(), isWeb && onClick?.(e), onPress?.(e);
|
|
452
581
|
} : void 0,
|
|
453
|
-
...attachPress && onLongPress && {
|
|
454
|
-
onLongPress: function(e) {
|
|
582
|
+
...(attachPress && onLongPress && {
|
|
583
|
+
onLongPress: function (e) {
|
|
455
584
|
unPress(), onLongPress?.(e);
|
|
456
585
|
}
|
|
457
|
-
},
|
|
458
|
-
...attachFocus && {
|
|
459
|
-
onFocus: function(e) {
|
|
460
|
-
pseudos?.focusVisibleStyle ? setTimeout(function() {
|
|
586
|
+
}),
|
|
587
|
+
...(attachFocus && {
|
|
588
|
+
onFocus: function (e) {
|
|
589
|
+
pseudos?.focusVisibleStyle ? setTimeout(function () {
|
|
461
590
|
setStateShallow({
|
|
462
591
|
focus: !0,
|
|
463
592
|
focusVisible: !!lastInteractionWasKeyboard.value
|
|
@@ -467,13 +596,13 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
467
596
|
focusVisible: !1
|
|
468
597
|
}), onFocus?.(e);
|
|
469
598
|
},
|
|
470
|
-
onBlur: function(e) {
|
|
599
|
+
onBlur: function (e) {
|
|
471
600
|
setStateShallow({
|
|
472
601
|
focus: !1,
|
|
473
602
|
focusVisible: !1
|
|
474
603
|
}), onBlur?.(e);
|
|
475
604
|
}
|
|
476
|
-
}
|
|
605
|
+
})
|
|
477
606
|
} : null;
|
|
478
607
|
if (events && !asChild) {
|
|
479
608
|
var _viewProps_focusable;
|
|
@@ -503,25 +632,21 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
503
632
|
isZStack,
|
|
504
633
|
debug: debugProp
|
|
505
634
|
});
|
|
506
|
-
if (asChild)
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
Object.assign(viewProps, {
|
|
511
|
-
onPress,
|
|
512
|
-
onLongPress
|
|
513
|
-
});
|
|
635
|
+
if (asChild) if (elementType = Slot, 0) var webStyleEvents, passEvents;else Object.assign(viewProps, {
|
|
636
|
+
onPress,
|
|
637
|
+
onLongPress
|
|
638
|
+
});
|
|
514
639
|
process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
|
|
515
640
|
var useChildrenResult;
|
|
516
|
-
hooks.useChildren && (useChildrenResult = hooks.useChildren(elementType, content, viewProps, events, staticConfig)), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */
|
|
641
|
+
hooks.useChildren && (useChildrenResult = hooks.useChildren(elementType, content, viewProps, events, staticConfig)), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */React.createElement(elementType, viewProps, content);
|
|
517
642
|
var ResetPresence = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence;
|
|
518
|
-
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */
|
|
643
|
+
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */_jsx(ResetPresence, {
|
|
519
644
|
children: content
|
|
520
645
|
})), process.env.NODE_ENV === "development" && time && time`create-element`;
|
|
521
|
-
var groupState = curStateRef.group,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
return groupState.listeners.clear(), {
|
|
646
|
+
var groupState = curStateRef.group,
|
|
647
|
+
subGroupContext = React.useMemo(function () {
|
|
648
|
+
var _splitStyles_style, _splitStyles_style1;
|
|
649
|
+
if (!(!groupState || !groupName)) return groupState.listeners.clear(), {
|
|
525
650
|
...componentContext.groups,
|
|
526
651
|
// change reference so as we mutate it doesn't affect siblings etc
|
|
527
652
|
state: {
|
|
@@ -539,39 +664,36 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
539
664
|
emit: groupState.emit,
|
|
540
665
|
subscribe: groupState.subscribe
|
|
541
666
|
};
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
]);
|
|
545
|
-
if (groupName && subGroupContext && (content = /* @__PURE__ */ _jsx(ComponentContext.Provider, {
|
|
667
|
+
}, [groupName]);
|
|
668
|
+
if (groupName && subGroupContext && (content = /* @__PURE__ */_jsx(ComponentContext.Provider, {
|
|
546
669
|
...componentContext,
|
|
547
670
|
groups: subGroupContext,
|
|
548
671
|
children: content
|
|
549
|
-
})), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : getThemedChildren(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */
|
|
672
|
+
})), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : getThemedChildren(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */_jsx(ThemeDebug, {
|
|
550
673
|
themeState,
|
|
551
674
|
themeProps: props,
|
|
552
675
|
children: content
|
|
553
676
|
})), staticConfig.context) {
|
|
554
677
|
var contextProps = staticConfig.context.props;
|
|
555
|
-
for (var key1 in contextProps)
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
678
|
+
for (var key1 in contextProps) if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
|
|
679
|
+
var _viewProps_style;
|
|
680
|
+
overriddenContextProps || (overriddenContextProps = {});
|
|
681
|
+
var _viewProps_style_key;
|
|
682
|
+
overriddenContextProps[key1] = (_viewProps_style_key = (_viewProps_style = viewProps.style) === null || _viewProps_style === void 0 ? void 0 : _viewProps_style[key1]) !== null && _viewProps_style_key !== void 0 ? _viewProps_style_key : viewProps[key1];
|
|
683
|
+
}
|
|
562
684
|
}
|
|
563
685
|
if (overriddenContextProps) {
|
|
564
686
|
var Provider = staticConfig.context.Provider;
|
|
565
|
-
content = /* @__PURE__ */
|
|
687
|
+
content = /* @__PURE__ */_jsx(Provider, {
|
|
566
688
|
...contextValue,
|
|
567
689
|
...overriddenContextProps,
|
|
568
690
|
children: content
|
|
569
691
|
});
|
|
570
692
|
}
|
|
571
|
-
if (process.env.TAMAGUI_REACT_19 && !1)
|
|
572
|
-
var rulesToInsert, keys;
|
|
693
|
+
if (process.env.TAMAGUI_REACT_19 && !1) var rulesToInsert, keys;
|
|
573
694
|
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
574
|
-
var element1 = typeof elementType == "string" ? elementType : "Component",
|
|
695
|
+
var element1 = typeof elementType == "string" ? elementType : "Component",
|
|
696
|
+
title = `render <${element1} /> (${internalID}) with props`;
|
|
575
697
|
if (isWeb) {
|
|
576
698
|
console.groupCollapsed(title);
|
|
577
699
|
try {
|
|
@@ -602,25 +724,22 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
602
724
|
viewProps,
|
|
603
725
|
willBeAnimated
|
|
604
726
|
}));
|
|
605
|
-
} catch {
|
|
606
|
-
} finally {
|
|
727
|
+
} catch {} finally {
|
|
607
728
|
console.groupEnd();
|
|
608
729
|
}
|
|
609
730
|
} else {
|
|
610
731
|
log(title), log("state: ", state), isDevTools && log("viewProps", viewProps), log("final styles:");
|
|
611
|
-
for (var key2 in splitStylesStyle)
|
|
612
|
-
log(key2, splitStylesStyle[key2]);
|
|
732
|
+
for (var key2 in splitStylesStyle) log(key2, splitStylesStyle[key2]);
|
|
613
733
|
}
|
|
614
|
-
if (debugProp === "break")
|
|
615
|
-
debugger;
|
|
734
|
+
if (debugProp === "break") debugger;
|
|
616
735
|
}
|
|
617
|
-
return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(function() {
|
|
736
|
+
return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(function () {
|
|
618
737
|
delete globalThis.willPrint, time.print(), time = null;
|
|
619
738
|
}, 50))), content;
|
|
620
739
|
});
|
|
621
740
|
staticConfig.componentName && (component.displayName = staticConfig.componentName);
|
|
622
741
|
var res = component;
|
|
623
|
-
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */
|
|
742
|
+
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */React.memo(res)), res.staticConfig = staticConfig;
|
|
624
743
|
function extendStyledConfig(extended) {
|
|
625
744
|
return {
|
|
626
745
|
...staticConfig,
|
|
@@ -634,8 +753,11 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
634
753
|
return Component2.staticConfig = extendStyledConfig(extended), Component2.styleable = styleable, Component2;
|
|
635
754
|
}
|
|
636
755
|
function styleable(Component2, options) {
|
|
637
|
-
var _Component_render,
|
|
638
|
-
|
|
756
|
+
var _Component_render,
|
|
757
|
+
isForwardedRefAlready = ((_Component_render = Component2.render) === null || _Component_render === void 0 ? void 0 : _Component_render.length) === 2,
|
|
758
|
+
out = isForwardedRefAlready ? Component2 : /* @__PURE__ */React.forwardRef(Component2),
|
|
759
|
+
extendedConfig = extendStyledConfig(options?.staticConfig);
|
|
760
|
+
return out = options?.disableTheme ? out : themeable(out, extendedConfig), process.env.TAMAGUI_MEMOIZE_STYLEABLE && (out = /* @__PURE__ */React.memo(out)), out.staticConfig = extendedConfig, out.styleable = styleable, out;
|
|
639
761
|
}
|
|
640
762
|
return res.extractable = extractable, res.styleable = styleable, res;
|
|
641
763
|
}
|
|
@@ -643,68 +765,89 @@ function Unspaced(props) {
|
|
|
643
765
|
return props.children;
|
|
644
766
|
}
|
|
645
767
|
Unspaced.isUnspaced = !0;
|
|
646
|
-
var getSpacerSize = function(size, param) {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
componentName: "Spacer",
|
|
660
|
-
validStyles,
|
|
661
|
-
defaultProps: {
|
|
662
|
-
...stackDefaultStyles,
|
|
663
|
-
// avoid nesting issues
|
|
664
|
-
tag: "span",
|
|
665
|
-
size: !0,
|
|
666
|
-
pointerEvents: "none"
|
|
768
|
+
var getSpacerSize = function (size, param) {
|
|
769
|
+
var {
|
|
770
|
+
tokens
|
|
771
|
+
} = param;
|
|
772
|
+
size = 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
|
+
};
|
|
667
781
|
},
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
782
|
+
Spacer = createComponent({
|
|
783
|
+
acceptsClassName: !0,
|
|
784
|
+
memo: !0,
|
|
785
|
+
componentName: "Spacer",
|
|
786
|
+
validStyles,
|
|
787
|
+
defaultProps: {
|
|
788
|
+
...stackDefaultStyles,
|
|
789
|
+
// avoid nesting issues
|
|
790
|
+
tag: "span",
|
|
791
|
+
size: !0,
|
|
792
|
+
pointerEvents: "none"
|
|
676
793
|
},
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
minHeight: 0
|
|
794
|
+
variants: {
|
|
795
|
+
size: {
|
|
796
|
+
"...": getSpacerSize
|
|
681
797
|
},
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
798
|
+
flex: {
|
|
799
|
+
true: {
|
|
800
|
+
flexGrow: 1
|
|
801
|
+
}
|
|
685
802
|
},
|
|
686
|
-
|
|
803
|
+
direction: {
|
|
804
|
+
horizontal: {
|
|
805
|
+
height: 0,
|
|
806
|
+
minHeight: 0
|
|
807
|
+
},
|
|
808
|
+
vertical: {
|
|
809
|
+
width: 0,
|
|
810
|
+
minWidth: 0
|
|
811
|
+
},
|
|
812
|
+
both: {}
|
|
813
|
+
}
|
|
687
814
|
}
|
|
688
|
-
}
|
|
689
|
-
});
|
|
815
|
+
});
|
|
690
816
|
function spacedChildren(props) {
|
|
691
|
-
var _childrenList__type,
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
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 : React.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;
|
|
698
839
|
try {
|
|
699
840
|
for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
700
|
-
var [index, child] = _step.value,
|
|
701
|
-
|
|
841
|
+
var [index, child] = _step.value,
|
|
842
|
+
_child_type,
|
|
843
|
+
isEmpty = child == null || Array.isArray(child) && child.length === 0;
|
|
844
|
+
if (!isEmpty && /* @__PURE__ */React.isValidElement(child) && !((_child_type = child.type) === null || _child_type === void 0) && _child_type.shouldForwardSpace && (child = /* @__PURE__ */React.cloneElement(child, {
|
|
702
845
|
space,
|
|
703
846
|
spaceFlex,
|
|
704
847
|
separator,
|
|
705
848
|
key: child.key
|
|
706
|
-
})), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(/* @__PURE__ */
|
|
707
|
-
children: isZStack ? /* @__PURE__ */
|
|
849
|
+
})), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(/* @__PURE__ */_jsx(React.Fragment, {
|
|
850
|
+
children: isZStack ? /* @__PURE__ */_jsx(AbsoluteFill, {
|
|
708
851
|
children: child
|
|
709
852
|
}) : child
|
|
710
853
|
}, `${index}0t`)), !(isUnspaced(child) && index === 0) && !isZStack) {
|
|
@@ -714,7 +857,7 @@ function spacedChildren(props) {
|
|
|
714
857
|
direction,
|
|
715
858
|
space,
|
|
716
859
|
spaceFlex
|
|
717
|
-
})), final.push(/* @__PURE__ */
|
|
860
|
+
})), final.push(/* @__PURE__ */_jsx(React.Fragment, {
|
|
718
861
|
children: separator
|
|
719
862
|
}, `${index}03t`)), hasSpace && final.push(createSpacer({
|
|
720
863
|
key: `_${index}01t`,
|
|
@@ -735,20 +878,24 @@ function spacedChildren(props) {
|
|
|
735
878
|
try {
|
|
736
879
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
737
880
|
} finally {
|
|
738
|
-
if (_didIteratorError)
|
|
739
|
-
throw _iteratorError;
|
|
881
|
+
if (_didIteratorError) throw _iteratorError;
|
|
740
882
|
}
|
|
741
883
|
}
|
|
742
884
|
return process.env.NODE_ENV === "development" && props.debug && log(" Spaced children", final, props), final;
|
|
743
885
|
}
|
|
744
886
|
function createSpacer(param) {
|
|
745
|
-
var {
|
|
746
|
-
|
|
887
|
+
var {
|
|
888
|
+
key,
|
|
889
|
+
direction,
|
|
890
|
+
space,
|
|
891
|
+
spaceFlex
|
|
892
|
+
} = param;
|
|
893
|
+
return /* @__PURE__ */_jsx(Spacer, {
|
|
747
894
|
size: space,
|
|
748
895
|
direction,
|
|
749
|
-
...typeof spaceFlex < "u" && {
|
|
896
|
+
...(typeof spaceFlex < "u" && {
|
|
750
897
|
flex: spaceFlex === !0 ? 1 : spaceFlex === !1 ? 0 : spaceFlex
|
|
751
|
-
}
|
|
898
|
+
})
|
|
752
899
|
}, key);
|
|
753
900
|
}
|
|
754
901
|
function isUnspaced(child) {
|
|
@@ -768,51 +915,55 @@ var AbsoluteFill = createComponent({
|
|
|
768
915
|
}
|
|
769
916
|
});
|
|
770
917
|
function hasAnimatedStyleValue(style) {
|
|
771
|
-
return Object.keys(style).some(function(k) {
|
|
918
|
+
return Object.keys(style).some(function (k) {
|
|
772
919
|
var val = style[k];
|
|
773
920
|
return val && typeof val == "object" && "_animation" in val;
|
|
774
921
|
});
|
|
775
922
|
}
|
|
776
|
-
var fromPx = function(val) {
|
|
777
|
-
|
|
778
|
-
},
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
var
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
...state.group,
|
|
799
|
-
[name]: current
|
|
923
|
+
var fromPx = function (val) {
|
|
924
|
+
return typeof val != "string" ? val : +val.replace("px", "");
|
|
925
|
+
},
|
|
926
|
+
isDisabled = function (props) {
|
|
927
|
+
var _props_accessibilityState;
|
|
928
|
+
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
929
|
+
},
|
|
930
|
+
subscribeToContextGroup = function (param) {
|
|
931
|
+
var {
|
|
932
|
+
disabled = !1,
|
|
933
|
+
setStateShallow,
|
|
934
|
+
pseudoGroups,
|
|
935
|
+
mediaGroups,
|
|
936
|
+
componentContext,
|
|
937
|
+
state
|
|
938
|
+
} = param;
|
|
939
|
+
if (pseudoGroups || mediaGroups) {
|
|
940
|
+
var _componentContext_groups_subscribe,
|
|
941
|
+
_componentContext_groups,
|
|
942
|
+
current = {
|
|
943
|
+
pseudo: {},
|
|
944
|
+
media: {}
|
|
800
945
|
};
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
946
|
+
return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function (name, param2) {
|
|
947
|
+
var {
|
|
948
|
+
layout,
|
|
949
|
+
pseudo
|
|
950
|
+
} = param2;
|
|
951
|
+
if (pseudo && pseudoGroups?.has(String(name))) Object.assign(current.pseudo, pseudo), persist();else if (layout && mediaGroups) {
|
|
952
|
+
var mediaState = getMediaState(mediaGroups, layout),
|
|
953
|
+
next = mergeIfNotShallowEqual(current.media, mediaState);
|
|
954
|
+
next !== current.media && (Object.assign(current.media, next), persist());
|
|
955
|
+
}
|
|
956
|
+
function persist() {
|
|
957
|
+
var group = {
|
|
958
|
+
...state.group,
|
|
959
|
+
[name]: current
|
|
960
|
+
};
|
|
961
|
+
setStateShallow({
|
|
962
|
+
group
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
export { Spacer, Unspaced, componentSetStates, createComponent, isDisabled, spacedChildren, subscribeToContextGroup, useComponentState };
|
|
969
|
+
//# sourceMappingURL=createComponent.native.js.map
|