@tamagui/web 1.88.1 → 1.88.3
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.js +0 -6
- package/dist/cjs/config.js +5 -31
- package/dist/cjs/config.js.map +2 -2
- package/dist/cjs/constants/accessibilityDirectMap.js +0 -8
- package/dist/cjs/constants/constants.js +0 -7
- package/dist/cjs/constants/isDevTools.js +0 -4
- package/dist/cjs/contexts/ComponentContext.js +0 -4
- package/dist/cjs/createComponent.js +36 -51
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createComponent.native.js +15 -15
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createFont.js +0 -4
- package/dist/cjs/createShorthands.js +0 -4
- package/dist/cjs/createTamagui.js +2 -7
- package/dist/cjs/createTamagui.js.map +1 -1
- package/dist/cjs/createTheme.js +0 -4
- package/dist/cjs/createTokens.js +0 -4
- package/dist/cjs/createVariable.js +0 -13
- package/dist/cjs/createVariables.js +0 -4
- package/dist/cjs/defaultComponentState.js +0 -6
- package/dist/cjs/helpers/ThemeManager.js +8 -16
- package/dist/cjs/helpers/ThemeManager.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.native.js +4 -4
- package/dist/cjs/helpers/ThemeManager.native.js.map +1 -1
- package/dist/cjs/helpers/ThemeManagerContext.js +0 -4
- package/dist/cjs/helpers/createMediaStyle.js +2 -7
- package/dist/cjs/helpers/createMediaStyle.js.map +1 -1
- package/dist/cjs/helpers/createShallowSetState.js +0 -6
- package/dist/cjs/helpers/createStyledContext.js +0 -4
- package/dist/cjs/helpers/defaultOffset.js +0 -4
- package/dist/cjs/helpers/expandStyle.js +1 -6
- package/dist/cjs/helpers/expandStyle.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.js +0 -4
- package/dist/cjs/helpers/expandStyles.native.js +2 -1
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js +0 -4
- package/dist/cjs/helpers/getFontLanguage.js +0 -4
- package/dist/cjs/helpers/getGroupPropParts.js +0 -4
- package/dist/cjs/helpers/getSplitStyles.js +13 -23
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +8 -8
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +3 -10
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +0 -4
- package/dist/cjs/helpers/getVariantExtras.js +1 -6
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js +1 -14
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +2 -2
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isObj.js +0 -4
- package/dist/cjs/helpers/isTamaguiComponent.js +1 -5
- package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js +0 -4
- package/dist/cjs/helpers/log.js +0 -4
- package/dist/cjs/helpers/matchMedia.js +0 -5
- package/dist/cjs/helpers/mergeProps.js +1 -5
- package/dist/cjs/helpers/mergeProps.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.js +1 -5
- package/dist/cjs/helpers/mergeVariants.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.js +0 -6
- package/dist/cjs/helpers/normalizeShadow.js +1 -6
- package/dist/cjs/helpers/normalizeShadow.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.js +0 -4
- package/dist/cjs/helpers/normalizeStylePropKeys.js +0 -4
- package/dist/cjs/helpers/normalizeValueWithProperty.js +0 -5
- package/dist/cjs/helpers/objectIdentityKey.js +0 -4
- package/dist/cjs/helpers/propMapper.js +8 -18
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +2 -2
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.js +0 -5
- package/dist/cjs/helpers/proxyThemeVariables.js +0 -4
- package/dist/cjs/helpers/pseudoDescriptors.js +0 -6
- package/dist/cjs/helpers/registerCSSVariable.js +0 -6
- package/dist/cjs/helpers/themeable.js +2 -6
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/themes.js +0 -4
- package/dist/cjs/helpers/timer.js +0 -4
- package/dist/cjs/hooks/useConfiguration.js +0 -4
- package/dist/cjs/hooks/useDisableSSR.js +1 -5
- package/dist/cjs/hooks/useDisableSSR.js.map +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.js +0 -4
- package/dist/cjs/hooks/useMedia.js +3 -21
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useMedia.native.js +2 -1
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useProps.js +2 -9
- package/dist/cjs/hooks/useProps.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +18 -28
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js +1 -1
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeName.js +3 -7
- package/dist/cjs/hooks/useThemeName.js.map +1 -1
- package/dist/cjs/index.js +0 -78
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +0 -4
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/inject-styles.js +0 -4
- package/dist/cjs/insertFont.js +1 -9
- package/dist/cjs/insertFont.js.map +1 -1
- package/dist/cjs/internalWithTheme.js +0 -4
- package/dist/cjs/setupHooks.js +0 -5
- package/dist/cjs/setupReactNative.js +1 -7
- package/dist/cjs/setupReactNative.js.map +1 -1
- package/dist/cjs/styled.js +6 -10
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/views/Configuration.js +0 -4
- package/dist/cjs/views/FontLanguage.js +0 -4
- package/dist/cjs/views/Slot.js +0 -5
- package/dist/cjs/views/Stack.js +0 -4
- package/dist/cjs/views/TamaguiProvider.js +0 -4
- package/dist/cjs/views/Text.js +0 -4
- package/dist/cjs/views/Theme.js +3 -10
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.js +9 -16
- package/dist/cjs/views/ThemeDebug.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +0 -4
- package/dist/cjs/views/View.js +0 -4
- package/dist/esm/Tamagui.native.js +41 -14
- package/dist/esm/Tamagui.native.js.map +1 -1
- package/dist/esm/config.native.js +51 -8
- package/dist/esm/config.native.js.map +2 -2
- package/dist/esm/constants/accessibilityDirectMap.native.js +27 -2
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +1 -1
- package/dist/esm/constants/constants.native.js +26 -2
- package/dist/esm/constants/constants.native.js.map +1 -1
- package/dist/esm/constants/isDevTools.native.js +23 -2
- package/dist/esm/constants/isDevTools.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +25 -4
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/createComponent.native.js +130 -131
- package/dist/esm/createComponent.native.js.map +2 -2
- package/dist/esm/createFont.native.js +23 -2
- package/dist/esm/createFont.native.js.map +1 -1
- package/dist/esm/createShorthands.native.js +23 -2
- package/dist/esm/createShorthands.native.js.map +1 -1
- package/dist/esm/createTamagui.native.js +42 -34
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTheme.native.js +23 -2
- package/dist/esm/createTheme.native.js.map +1 -1
- package/dist/esm/createTokens.native.js +25 -4
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.native.js +38 -10
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.native.js +27 -7
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/defaultComponentState.native.js +25 -2
- package/dist/esm/defaultComponentState.native.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.native.js +44 -21
- package/dist/esm/helpers/ThemeManager.native.js.map +2 -2
- package/dist/esm/helpers/ThemeManagerContext.native.js +25 -4
- package/dist/esm/helpers/ThemeManagerContext.native.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.native.js +29 -9
- package/dist/esm/helpers/createMediaStyle.native.js.map +1 -1
- package/dist/esm/helpers/createShallowSetState.native.js +25 -2
- package/dist/esm/helpers/createShallowSetState.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +30 -11
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/defaultOffset.native.js +23 -2
- package/dist/esm/helpers/defaultOffset.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +28 -6
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +28 -7
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.native.js +25 -4
- package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/esm/helpers/getFontLanguage.native.js +23 -2
- package/dist/esm/helpers/getFontLanguage.native.js.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.native.js +25 -4
- package/dist/esm/helpers/getGroupPropParts.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +97 -119
- package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +26 -2
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.native.js +23 -2
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +27 -5
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +40 -11
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.native.js +23 -2
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.native.js +24 -3
- package/dist/esm/helpers/isTamaguiComponent.native.js.map +1 -1
- package/dist/esm/helpers/isTamaguiElement.native.js +25 -5
- package/dist/esm/helpers/isTamaguiElement.native.js.map +1 -1
- package/dist/esm/helpers/log.native.js +23 -2
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +24 -2
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +26 -6
- package/dist/esm/helpers/mergeProps.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +24 -3
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.native.js +29 -7
- package/dist/esm/helpers/normalizeColor.native.js.map +2 -2
- package/dist/esm/helpers/normalizeShadow.native.js +28 -7
- package/dist/esm/helpers/normalizeShadow.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +28 -11
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +23 -2
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +29 -9
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +23 -2
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +56 -38
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +26 -4
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeVariables.native.js +23 -2
- package/dist/esm/helpers/proxyThemeVariables.native.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.native.js +25 -2
- package/dist/esm/helpers/pseudoDescriptors.native.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.native.js +28 -5
- package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -1
- package/dist/esm/helpers/themeable.native.js +33 -14
- package/dist/esm/helpers/themeable.native.js.map +1 -1
- package/dist/esm/helpers/themes.native.js +26 -5
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/helpers/timer.native.js +23 -2
- package/dist/esm/helpers/timer.native.js.map +1 -1
- package/dist/esm/hooks/useConfiguration.native.js +26 -7
- package/dist/esm/hooks/useConfiguration.native.js.map +1 -1
- package/dist/esm/hooks/useDisableSSR.native.js +25 -4
- package/dist/esm/hooks/useDisableSSR.native.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.native.js +25 -5
- package/dist/esm/hooks/useIsTouchDevice.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +49 -18
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useProps.native.js +31 -13
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +64 -46
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeName.native.js +28 -10
- package/dist/esm/hooks/useThemeName.native.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.native.js +154 -80
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/inject-styles.native.js +23 -2
- package/dist/esm/inject-styles.native.js.map +1 -1
- package/dist/esm/insertFont.native.js +33 -11
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/interfaces/CSSColorNames.native.js +14 -0
- package/dist/esm/interfaces/CSSColorNames.native.js.map +2 -2
- package/dist/esm/interfaces/GetRef.native.js +14 -0
- package/dist/esm/interfaces/GetRef.native.js.map +2 -2
- package/dist/esm/interfaces/RNExclusiveTypes.native.js +14 -0
- package/dist/esm/interfaces/RNExclusiveTypes.native.js.map +2 -2
- package/dist/esm/interfaces/Role.native.js +14 -0
- package/dist/esm/interfaces/Role.native.js.map +2 -2
- package/dist/esm/internalWithTheme.native.js +26 -6
- package/dist/esm/internalWithTheme.native.js.map +1 -1
- package/dist/esm/setupHooks.native.js +24 -2
- package/dist/esm/setupHooks.native.js.map +1 -1
- package/dist/esm/setupReactNative.native.js +26 -3
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/styled.native.js +31 -12
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/type-utils.native.js +14 -0
- package/dist/esm/type-utils.native.js.map +2 -2
- package/dist/esm/types.native.js +14 -0
- package/dist/esm/types.native.js.map +2 -2
- package/dist/esm/views/Configuration.native.js +26 -7
- package/dist/esm/views/Configuration.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.native.js +26 -7
- package/dist/esm/views/FontLanguage.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.types.native.js +14 -0
- package/dist/esm/views/FontLanguage.types.native.js.map +2 -2
- package/dist/esm/views/Slot.native.js +33 -15
- package/dist/esm/views/Slot.native.js.map +1 -1
- package/dist/esm/views/Stack.native.js +27 -8
- package/dist/esm/views/Stack.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +35 -11
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.native.js +27 -7
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.native.js +51 -25
- package/dist/esm/views/Theme.native.js.map +2 -2
- package/dist/esm/views/ThemeDebug.native.js +23 -2
- package/dist/esm/views/ThemeDebug.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +28 -11
- package/dist/esm/views/ThemeProvider.native.js.map +2 -2
- package/dist/esm/views/View.native.js +27 -8
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +10 -10
- package/src/index.ts +3 -2
- package/types/index.d.ts +2 -2
- package/types/index.d.ts.map +1 -1
|
@@ -1,45 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
import { mergeProps } from "./helpers/mergeProps";
|
|
35
|
-
import { themeable } from "./helpers/themeable";
|
|
36
|
-
import { mediaKeyMatch, setMediaShouldUpdate, useMedia } from "./hooks/useMedia";
|
|
37
|
-
import { useThemeWithState } from "./hooks/useTheme";
|
|
38
|
-
import { hooks } from "./setupHooks";
|
|
39
|
-
import { Slot } from "./views/Slot";
|
|
40
|
-
import { getThemedChildren } from "./views/Theme";
|
|
41
|
-
import { ThemeDebug } from "./views/ThemeDebug";
|
|
42
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var createComponent_exports = {};
|
|
25
|
+
__export(createComponent_exports, {
|
|
26
|
+
Spacer: () => Spacer,
|
|
27
|
+
Unspaced: () => Unspaced,
|
|
28
|
+
createComponent: () => createComponent,
|
|
29
|
+
mouseUps: () => mouseUps,
|
|
30
|
+
spacedChildren: () => spacedChildren
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(createComponent_exports);
|
|
33
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr"), import_react = __toESM(require("react")), import_config = require("./config"), import_constants2 = require("./constants/constants"), import_ComponentContext = require("./contexts/ComponentContext"), import_createVariable = require("./createVariable"), import_defaultComponentState = require("./defaultComponentState"), import_createShallowSetState = require("./helpers/createShallowSetState"), import_getSplitStyles = require("./helpers/getSplitStyles"), import_isObj = require("./helpers/isObj"), import_log = require("./helpers/log"), import_mergeProps = require("./helpers/mergeProps"), import_themeable = require("./helpers/themeable"), import_useMedia = require("./hooks/useMedia"), import_useTheme = require("./hooks/useTheme"), import_setupHooks = require("./setupHooks"), import_Slot = require("./views/Slot"), import_Theme = require("./views/Theme"), import_ThemeDebug = require("./views/ThemeDebug"), import_jsx_runtime = require("react/jsx-runtime");
|
|
43
34
|
let tamaguiConfig, time, debugKeyListeners, startVisualizer;
|
|
44
35
|
const mouseUps = /* @__PURE__ */ new Set();
|
|
45
36
|
if (typeof document < "u") {
|
|
@@ -47,7 +38,8 @@ if (typeof document < "u") {
|
|
|
47
38
|
mouseUps.forEach((x) => x()), mouseUps.clear();
|
|
48
39
|
};
|
|
49
40
|
addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = () => {
|
|
50
|
-
|
|
41
|
+
var _a;
|
|
42
|
+
const devVisualizerConfig = (_a = import_config.devConfig) == null ? void 0 : _a.visualizer;
|
|
51
43
|
if (devVisualizerConfig) {
|
|
52
44
|
debugKeyListeners = /* @__PURE__ */ new Set();
|
|
53
45
|
let tm, isShowing = !1;
|
|
@@ -60,21 +52,23 @@ if (typeof document < "u") {
|
|
|
60
52
|
clearTimeout(tm);
|
|
61
53
|
}), document.addEventListener("keydown", ({ key, defaultPrevented }) => {
|
|
62
54
|
defaultPrevented || (clearTimeout(tm), key === options.key && (tm = setTimeout(() => {
|
|
63
|
-
isShowing = !0, debugKeyListeners
|
|
55
|
+
isShowing = !0, debugKeyListeners == null || debugKeyListeners.forEach((l) => l(!0));
|
|
64
56
|
}, options.delay)));
|
|
65
57
|
}), document.addEventListener("keyup", ({ key, defaultPrevented }) => {
|
|
66
|
-
defaultPrevented || key === options.key && (clearTimeout(tm), isShowing && debugKeyListeners
|
|
58
|
+
defaultPrevented || key === options.key && (clearTimeout(tm), isShowing && (debugKeyListeners == null || debugKeyListeners.forEach((l) => l(!1))));
|
|
67
59
|
});
|
|
68
60
|
}
|
|
69
61
|
});
|
|
70
62
|
}
|
|
71
63
|
let BaseText, BaseView, hasSetupBaseViews = !1;
|
|
72
64
|
function createComponent(staticConfig) {
|
|
65
|
+
var _a;
|
|
73
66
|
const { componentName } = staticConfig;
|
|
74
67
|
let config = null, defaultProps = staticConfig.defaultProps;
|
|
75
|
-
onConfiguredOnce((conf) => {
|
|
68
|
+
(0, import_config.onConfiguredOnce)((conf) => {
|
|
69
|
+
var _a2;
|
|
76
70
|
if (config = conf, componentName) {
|
|
77
|
-
const defaultForComponent = conf.defaultProps
|
|
71
|
+
const defaultForComponent = (_a2 = conf.defaultProps) == null ? void 0 : _a2[componentName];
|
|
78
72
|
defaultForComponent && (defaultProps = { ...defaultForComponent, ...defaultProps });
|
|
79
73
|
}
|
|
80
74
|
});
|
|
@@ -86,38 +80,39 @@ function createComponent(staticConfig) {
|
|
|
86
80
|
validStyles: validStyles2 = {},
|
|
87
81
|
variants = {}
|
|
88
82
|
} = staticConfig;
|
|
89
|
-
process.env.NODE_ENV === "development" && staticConfig.defaultProps
|
|
83
|
+
process.env.NODE_ENV === "development" && ((_a = staticConfig.defaultProps) != null && _a.debug) && process.env.IS_STATIC !== "is_static" && (0, import_log.log)(`\u{1F41B} [${componentName || "Component"}]`, {
|
|
90
84
|
staticConfig,
|
|
91
85
|
defaultProps,
|
|
92
86
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
93
87
|
});
|
|
94
|
-
const component = forwardRef((propsIn, forwardedRef) => {
|
|
95
|
-
|
|
88
|
+
const component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
|
|
89
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
90
|
+
const internalID = process.env.NODE_ENV === "development" ? (0, import_react.useId)() : "";
|
|
96
91
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
97
92
|
hasSetupBaseViews = !0;
|
|
98
|
-
const baseViews = hooks.getBaseViews
|
|
93
|
+
const baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
|
|
99
94
|
baseViews && (BaseText = baseViews.Text, BaseView = baseViews.View);
|
|
100
95
|
}
|
|
101
|
-
process.env.NODE_ENV === "test" && propsIn["data-test-renders"] && (propsIn["data-test-renders"].current
|
|
102
|
-
const componentContext = useContext(ComponentContext);
|
|
96
|
+
process.env.NODE_ENV === "test" && propsIn["data-test-renders"] && ((_c = propsIn["data-test-renders"]).current ?? (_c.current = 0), propsIn["data-test-renders"].current += 1);
|
|
97
|
+
const componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext);
|
|
103
98
|
let styledContextProps, overriddenContextProps, contextValue;
|
|
104
99
|
const { context } = staticConfig;
|
|
105
100
|
if (context) {
|
|
106
|
-
contextValue = useContext(context);
|
|
107
|
-
const { inverseShorthands } = getConfig();
|
|
101
|
+
contextValue = (0, import_react.useContext)(context);
|
|
102
|
+
const { inverseShorthands } = (0, import_config.getConfig)();
|
|
108
103
|
for (const key in context.props) {
|
|
109
104
|
const propVal = (
|
|
110
105
|
// because its after default props but before props this annoying amount of checks
|
|
111
|
-
propsIn[key] ?? propsIn[inverseShorthands[key]] ?? defaultProps
|
|
106
|
+
propsIn[key] ?? propsIn[inverseShorthands[key]] ?? (defaultProps == null ? void 0 : defaultProps[key]) ?? (defaultProps == null ? void 0 : defaultProps[inverseShorthands[key]])
|
|
112
107
|
);
|
|
113
|
-
propVal === void 0 ? contextValue && (key in validStyles2 || key in variants) && (styledContextProps
|
|
108
|
+
propVal === void 0 ? contextValue && (key in validStyles2 || key in variants) && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = contextValue[key]) : (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal);
|
|
114
109
|
}
|
|
115
110
|
}
|
|
116
111
|
const curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps;
|
|
117
112
|
let props = propsIn;
|
|
118
|
-
curDefaultProps && (props = mergeProps(curDefaultProps, propsIn));
|
|
113
|
+
curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
|
|
119
114
|
const debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
|
|
120
|
-
process.env.NODE_ENV === "development" && isClient && useEffect(() => {
|
|
115
|
+
process.env.NODE_ENV === "development" && import_constants.isClient && (0, import_react.useEffect)(() => {
|
|
121
116
|
let overlay = null;
|
|
122
117
|
const debugVisualizerHandler = (show = !1) => {
|
|
123
118
|
const node = curState.host;
|
|
@@ -129,27 +124,27 @@ function createComponent(staticConfig) {
|
|
|
129
124
|
} else
|
|
130
125
|
overlay && node.removeChild(overlay);
|
|
131
126
|
};
|
|
132
|
-
return debugKeyListeners
|
|
133
|
-
debugKeyListeners
|
|
127
|
+
return debugKeyListeners || (debugKeyListeners = /* @__PURE__ */ new Set()), debugKeyListeners.add(debugVisualizerHandler), () => {
|
|
128
|
+
debugKeyListeners == null || debugKeyListeners.delete(debugVisualizerHandler);
|
|
134
129
|
};
|
|
135
130
|
}, [componentName2]), !process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time && (time = require("@tamagui/timer").timer().start()), process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`;
|
|
136
|
-
const stateRef = useRef({});
|
|
131
|
+
const stateRef = (0, import_react.useRef)({});
|
|
137
132
|
process.env.NODE_ENV === "development" && time && time`stateref`;
|
|
138
|
-
const animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig
|
|
133
|
+
const animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, curState = stateRef.current, willBeAnimatedClient = !!(!!(hasAnimationProp && !isHOC && useAnimations) || curState.hasAnimated), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
139
134
|
willBeAnimated && !curState.hasAnimated && (curState.hasAnimated = !0);
|
|
140
|
-
const isHydrated = config
|
|
135
|
+
const isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), presence = willBeAnimated && ((_d = animationsConfig == null ? void 0 : animationsConfig.usePresence) == null ? void 0 : _d.call(animationsConfig)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = staticConfig.isReactNative;
|
|
141
136
|
let isAnimated = willBeAnimated;
|
|
142
137
|
!isReactNative && hasRNAnimation && !isHOC && !isHydrated && (isAnimated = !1, curState.willHydrate = !0), process.env.NODE_ENV === "development" && time && time`pre-use-state`;
|
|
143
|
-
const hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curState.host, initialState = hasEnterState ? needsToMount ? defaultComponentStateShouldEnter : defaultComponentState : defaultComponentStateMounted, states = useState(initialState), state = props.forceStyle ? { ...states[0], [props.forceStyle]: !0 } : states[0], setState = states[1];
|
|
144
|
-
let setStateShallow = createShallowSetState(setState, debugProp);
|
|
138
|
+
const hasEnterState = hasEnterStyle || isEntering, needsToMount = !isHydrated || !curState.host, initialState = hasEnterState ? needsToMount ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react.useState)(initialState), state = props.forceStyle ? { ...states[0], [props.forceStyle]: !0 } : states[0], setState = states[1];
|
|
139
|
+
let setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, debugProp);
|
|
145
140
|
if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
146
141
|
process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
|
|
147
142
|
const { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
|
|
148
|
-
isObj(custom) && Object.assign(props, custom);
|
|
143
|
+
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
149
144
|
const exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
150
145
|
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
|
|
151
146
|
}
|
|
152
|
-
const shouldAvoidClasses = !!(!isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
|
|
147
|
+
const shouldAvoidClasses = !!(!import_constants.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
|
|
153
148
|
if (groupName && !curState.group) {
|
|
154
149
|
const listeners = /* @__PURE__ */ new Set();
|
|
155
150
|
curState.group = {
|
|
@@ -178,9 +173,9 @@ function createComponent(staticConfig) {
|
|
|
178
173
|
};
|
|
179
174
|
}
|
|
180
175
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
181
|
-
const componentNameFinal = props.componentName || componentName2, componentClassName = props.asChild || !componentNameFinal ? "" : `is_${componentNameFinal}`, hasTextAncestor = !!(isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? props.accessibilityState
|
|
176
|
+
const componentNameFinal = props.componentName || componentName2, componentClassName = props.asChild || !componentNameFinal ? "" : `is_${componentNameFinal}`, hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_e = props.accessibilityState) == null ? void 0 : _e.disabled);
|
|
182
177
|
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
183
|
-
const element = isWeb && (!Component || typeof Component == "string") && props.tag || Component;
|
|
178
|
+
const element = import_constants.isWeb && (!Component || typeof Component == "string") && props.tag || Component;
|
|
184
179
|
let elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
185
180
|
animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
|
|
186
181
|
const disableTheme = !1 || isHOC;
|
|
@@ -194,24 +189,24 @@ function createComponent(staticConfig) {
|
|
|
194
189
|
debug: debugProp
|
|
195
190
|
};
|
|
196
191
|
if (typeof curState.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
197
|
-
const name = `${componentName2 || Component
|
|
192
|
+
const name = `${componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = (hasEnterStyle ? "(hasEnter)" : "") + (isAnimated ? "(animated)" : "") + (isReactNative ? "(rnw)" : "") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = `${internalID} ${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
|
|
198
193
|
if (console.info(
|
|
199
194
|
`%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`,
|
|
200
195
|
"background: green; color: white;"
|
|
201
|
-
), !isServer) {
|
|
196
|
+
), !import_constants.isServer) {
|
|
202
197
|
console.groupEnd();
|
|
203
198
|
const stateLog = `${`${state.press || state.pressIn ? " PRESS " : ""}`}${state.hover ? " HOVER " : ""}${state.focus ? " FOCUS" : " "}`, ch = propsIn.children;
|
|
204
199
|
let childLog = typeof ch == "string" ? ch.length > 4 ? ch.slice(0, 4) + "..." : ch : "";
|
|
205
|
-
childLog.length && (childLog = `(children: ${childLog})`), console.groupCollapsed(`${childLog}${stateLog}Props:`), log("props in:", propsIn), log("final props:", props), log({ state, staticConfig, elementType, themeStateProps }), log({ contextProps: styledContextProps, overriddenContextProps }), log({ presence, isAnimated, isHOC, hasAnimationProp, useAnimations }), console.groupEnd();
|
|
200
|
+
childLog.length && (childLog = `(children: ${childLog})`), console.groupCollapsed(`${childLog}${stateLog}Props:`), (0, import_log.log)("props in:", propsIn), (0, import_log.log)("final props:", props), (0, import_log.log)({ state, staticConfig, elementType, themeStateProps }), (0, import_log.log)({ contextProps: styledContextProps, overriddenContextProps }), (0, import_log.log)({ presence, isAnimated, isHOC, hasAnimationProp, useAnimations }), console.groupEnd();
|
|
206
201
|
}
|
|
207
202
|
}
|
|
208
203
|
process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
|
|
209
|
-
const [themeState, theme] = useThemeWithState(themeStateProps);
|
|
204
|
+
const [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
|
|
210
205
|
elementType = Component || elementType;
|
|
211
206
|
const isStringElement = typeof elementType == "string";
|
|
212
207
|
process.env.NODE_ENV === "development" && time && time`theme`;
|
|
213
|
-
const mediaState = useMedia(stateRef, componentContext);
|
|
214
|
-
process.env.NODE_ENV === "development" && time && time`media`, setDidGetVariableValue(!1);
|
|
208
|
+
const mediaState = (0, import_useMedia.useMedia)(stateRef, componentContext);
|
|
209
|
+
process.env.NODE_ENV === "development" && time && time`media`, (0, import_createVariable.setDidGetVariableValue)(!1);
|
|
215
210
|
const resolveValues = (
|
|
216
211
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
217
212
|
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
@@ -221,11 +216,11 @@ function createComponent(staticConfig) {
|
|
|
221
216
|
resolveValues,
|
|
222
217
|
isExiting,
|
|
223
218
|
isAnimated
|
|
224
|
-
}, splitStyles = useSplitStyles(
|
|
219
|
+
}, splitStyles = (0, import_getSplitStyles.useSplitStyles)(
|
|
225
220
|
props,
|
|
226
221
|
staticConfig,
|
|
227
222
|
theme,
|
|
228
|
-
themeState
|
|
223
|
+
((_f = themeState == null ? void 0 : themeState.state) == null ? void 0 : _f.name) || "",
|
|
229
224
|
state,
|
|
230
225
|
styleProps,
|
|
231
226
|
null,
|
|
@@ -234,8 +229,8 @@ function createComponent(staticConfig) {
|
|
|
234
229
|
debugProp
|
|
235
230
|
);
|
|
236
231
|
props.group && props.untilMeasured === "hide" && !curState.hasMeasured && (splitStyles.style.opacity = 0), process.env.NODE_ENV === "development" && time && time`split-styles`, curState.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
237
|
-
const isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = didGetVariableValue() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
|
|
238
|
-
setMediaShouldUpdate(stateRef, {
|
|
232
|
+
const isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
|
|
233
|
+
(0, import_useMedia.setMediaShouldUpdate)(stateRef, {
|
|
239
234
|
enabled: shouldListenForMedia,
|
|
240
235
|
keys: mediaListeningKeys
|
|
241
236
|
});
|
|
@@ -258,7 +253,7 @@ function createComponent(staticConfig) {
|
|
|
258
253
|
presence,
|
|
259
254
|
componentState: state,
|
|
260
255
|
styleProps,
|
|
261
|
-
theme: themeState.state
|
|
256
|
+
theme: (_g = themeState.state) == null ? void 0 : _g.theme,
|
|
262
257
|
pseudos: pseudos || null,
|
|
263
258
|
staticConfig,
|
|
264
259
|
stateRef
|
|
@@ -298,25 +293,26 @@ function createComponent(staticConfig) {
|
|
|
298
293
|
|
|
299
294
|
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}`
|
|
300
295
|
), process.env.NODE_ENV === "development" && time && time`destructure`;
|
|
301
|
-
const disabled = props.accessibilityState
|
|
296
|
+
const disabled = ((_h = props.accessibilityState) == null ? void 0 : _h.disabled) || // @ts-expect-error (comes from core)
|
|
302
297
|
props.accessibilityDisabled;
|
|
303
298
|
let viewProps = nonTamaguiProps;
|
|
304
|
-
hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = composeEventHandlers(
|
|
299
|
+
hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
|
|
305
300
|
nonTamaguiProps.onLayout,
|
|
306
301
|
(e) => {
|
|
307
302
|
stateRef.current.group.emit(groupName, {
|
|
308
303
|
layout: e.nativeEvent.layout
|
|
309
304
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState((prev) => ({ ...prev })), stateRef.current.hasMeasured = !0;
|
|
310
305
|
}
|
|
311
|
-
)), viewProps = hooks.usePropsTransform
|
|
306
|
+
)), viewProps = ((_j = (_i = import_setupHooks.hooks).usePropsTransform) == null ? void 0 : _j.call(
|
|
307
|
+
_i,
|
|
312
308
|
elementType,
|
|
313
309
|
nonTamaguiProps,
|
|
314
310
|
stateRef,
|
|
315
311
|
curState.willHydrate
|
|
316
|
-
) ?? nonTamaguiProps, curState.composedRef || (curState.composedRef = composeRefs(
|
|
312
|
+
)) ?? nonTamaguiProps, curState.composedRef || (curState.composedRef = (0, import_compose_refs.composeRefs)(
|
|
317
313
|
(x) => stateRef.current.host = x,
|
|
318
314
|
forwardedRef
|
|
319
|
-
)), viewProps.ref = curState.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && isWeb && !isHOC && Children.toArray(props.children).forEach((item) => {
|
|
315
|
+
)), viewProps.ref = curState.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react.Children.toArray(props.children).forEach((item) => {
|
|
320
316
|
typeof item == "string" && item !== `
|
|
321
317
|
` && console.error(
|
|
322
318
|
`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`
|
|
@@ -325,7 +321,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
325
321
|
const { pseudoGroups, mediaGroups } = splitStyles;
|
|
326
322
|
curState.unPress || (curState.unPress = () => setStateShallow({ press: !1, pressIn: !1 }));
|
|
327
323
|
const unPress = curState.unPress, shouldEnter = state.unmounted;
|
|
328
|
-
useEffect(() => {
|
|
324
|
+
(0, import_react.useEffect)(() => {
|
|
329
325
|
if (shouldEnter) {
|
|
330
326
|
setStateShallow({ unmounted: !1 });
|
|
331
327
|
return;
|
|
@@ -338,10 +334,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
338
334
|
};
|
|
339
335
|
disposeGroupsListener = componentContext.groups.subscribe(
|
|
340
336
|
(name, { layout, pseudo }) => {
|
|
341
|
-
if (pseudo && pseudoGroups
|
|
337
|
+
if (pseudo && (pseudoGroups != null && pseudoGroups.has(name)))
|
|
342
338
|
Object.assign(current.pseudo, pseudo), persist();
|
|
343
339
|
else if (layout && mediaGroups) {
|
|
344
|
-
const mediaState2 = getMediaState(mediaGroups, layout), next = mergeIfNotShallowEqual(current.media, mediaState2);
|
|
340
|
+
const mediaState2 = getMediaState(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
|
|
345
341
|
next !== current.media && (Object.assign(current.media, next), persist());
|
|
346
342
|
}
|
|
347
343
|
function persist() {
|
|
@@ -357,58 +353,58 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
357
353
|
);
|
|
358
354
|
}
|
|
359
355
|
return () => {
|
|
360
|
-
disposeGroupsListener
|
|
356
|
+
disposeGroupsListener == null || disposeGroupsListener(), mouseUps.delete(unPress);
|
|
361
357
|
};
|
|
362
358
|
}, [
|
|
363
359
|
shouldEnter,
|
|
364
360
|
pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
|
|
365
361
|
mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
|
|
366
362
|
]);
|
|
367
|
-
let fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps
|
|
363
|
+
let fontFamily = isText ? splitStyles.fontFamily || ((_k = staticConfig.defaultProps) == null ? void 0 : _k.fontFamily) : null;
|
|
368
364
|
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
369
365
|
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style;
|
|
370
366
|
let className;
|
|
371
367
|
asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
|
|
372
|
-
const runtimePressStyle = !disabled && noClassNames && pseudos
|
|
368
|
+
const runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
|
|
373
369
|
process.env.NODE_ENV === "development" && time && time`events-setup`;
|
|
374
370
|
const events = shouldAttach && !isDisabled && !props.asChild ? {
|
|
375
371
|
onPressOut: attachPress ? (e) => {
|
|
376
|
-
unPress(), onPressOut
|
|
372
|
+
unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
|
|
377
373
|
} : void 0,
|
|
378
374
|
...(isHoverable || attachPress) && {
|
|
379
375
|
onMouseEnter: (e) => {
|
|
380
376
|
const next = {};
|
|
381
|
-
needsHoverState && (next.hover = !0), runtimePressStyle && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn
|
|
377
|
+
needsHoverState && (next.hover = !0), runtimePressStyle && state.pressIn && (next.press = !0), setStateShallow(next), onHoverIn == null || onHoverIn(e), onMouseEnter == null || onMouseEnter(e);
|
|
382
378
|
},
|
|
383
379
|
onMouseLeave: (e) => {
|
|
384
380
|
const next = {};
|
|
385
|
-
mouseUps.add(unPress), needsHoverState && (next.hover = !1), runtimePressStyle && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut
|
|
381
|
+
mouseUps.add(unPress), needsHoverState && (next.hover = !1), runtimePressStyle && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
|
|
386
382
|
}
|
|
387
383
|
},
|
|
388
384
|
onPressIn: attachPress ? (e) => {
|
|
389
385
|
runtimePressStyle && setStateShallow({
|
|
390
386
|
press: !0,
|
|
391
387
|
pressIn: !0
|
|
392
|
-
}), onPressIn
|
|
388
|
+
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants.isWeb && mouseUps.add(unPress);
|
|
393
389
|
} : void 0,
|
|
394
390
|
onPress: attachPress ? (e) => {
|
|
395
|
-
unPress(), isWeb && onClick
|
|
391
|
+
unPress(), import_constants.isWeb && (onClick == null || onClick(e)), onPress == null || onPress(e);
|
|
396
392
|
} : void 0,
|
|
397
393
|
...attachPress && onLongPress && {
|
|
398
394
|
onLongPress: (e) => {
|
|
399
|
-
unPress(), onLongPress
|
|
395
|
+
unPress(), onLongPress == null || onLongPress(e);
|
|
400
396
|
}
|
|
401
397
|
},
|
|
402
398
|
...attachFocus && {
|
|
403
399
|
onFocus: (e) => {
|
|
404
400
|
setStateShallow({
|
|
405
401
|
focus: !0
|
|
406
|
-
}), onFocus
|
|
402
|
+
}), onFocus == null || onFocus(e);
|
|
407
403
|
},
|
|
408
404
|
onBlur: (e) => {
|
|
409
405
|
setStateShallow({
|
|
410
406
|
focus: !1
|
|
411
|
-
}), onBlur
|
|
407
|
+
}), onBlur == null || onBlur(e);
|
|
412
408
|
}
|
|
413
409
|
}
|
|
414
410
|
} : null;
|
|
@@ -421,7 +417,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
421
417
|
delayPressOut: viewProps.delayPressOut,
|
|
422
418
|
focusable: viewProps.focusable ?? !0,
|
|
423
419
|
minPressDuration: 0
|
|
424
|
-
}), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && log("events", { events, isHoverable, attachPress }), hooks.useEvents
|
|
420
|
+
}), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (_m = (_l = import_setupHooks.hooks).useEvents) == null || _m.call(_l, viewProps, events, splitStyles, setStateShallow, staticConfig);
|
|
425
421
|
const direction = props.spaceDirection || "both";
|
|
426
422
|
process.env.NODE_ENV === "development" && time && time`hooks`;
|
|
427
423
|
let content = !children || asChild ? children : spacedChildren({
|
|
@@ -432,18 +428,18 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
432
428
|
isZStack,
|
|
433
429
|
debug: debugProp
|
|
434
430
|
});
|
|
435
|
-
asChild && (elementType = Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
|
|
431
|
+
asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
|
|
436
432
|
let useChildrenResult;
|
|
437
|
-
hooks.useChildren && (useChildrenResult = hooks.useChildren(
|
|
433
|
+
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(
|
|
438
434
|
elementType,
|
|
439
435
|
content,
|
|
440
436
|
viewProps,
|
|
441
437
|
events,
|
|
442
438
|
staticConfig
|
|
443
|
-
)), useChildrenResult ? content = useChildrenResult : content = createElement(elementType, viewProps, content);
|
|
444
|
-
const ResetPresence = config
|
|
445
|
-
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ jsx(ResetPresence, { children: content })), process.env.NODE_ENV === "development" && time && time`create-element`;
|
|
446
|
-
const groupState = curState.group, subGroupContext = useMemo(() => {
|
|
439
|
+
)), useChildrenResult ? content = useChildrenResult : content = (0, import_react.createElement)(elementType, viewProps, content);
|
|
440
|
+
const ResetPresence = (_n = config == null ? void 0 : config.animations) == null ? void 0 : _n.ResetPresence;
|
|
441
|
+
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResetPresence, { children: content })), process.env.NODE_ENV === "development" && time && time`create-element`;
|
|
442
|
+
const groupState = curState.group, subGroupContext = (0, import_react.useMemo)(() => {
|
|
447
443
|
if (!(!groupState || !groupName))
|
|
448
444
|
return groupState.listeners.clear(), {
|
|
449
445
|
...componentContext.groups,
|
|
@@ -451,7 +447,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
451
447
|
state: {
|
|
452
448
|
...componentContext.groups.state,
|
|
453
449
|
[groupName]: {
|
|
454
|
-
pseudo: defaultComponentStateMounted,
|
|
450
|
+
pseudo: import_defaultComponentState.defaultComponentStateMounted,
|
|
455
451
|
// capture just initial width and height if they exist
|
|
456
452
|
// will have top, left, width, height (not x, y)
|
|
457
453
|
layout: {
|
|
@@ -464,19 +460,19 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
464
460
|
subscribe: groupState.subscribe
|
|
465
461
|
};
|
|
466
462
|
}, [groupName]);
|
|
467
|
-
if (groupName && subGroupContext && (content = /* @__PURE__ */ jsx(ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : getThemedChildren(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ jsx(ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
|
|
463
|
+
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
|
|
468
464
|
const contextProps = staticConfig.context.props;
|
|
469
465
|
for (const key in contextProps)
|
|
470
|
-
(key in style || key in viewProps) && (overriddenContextProps
|
|
466
|
+
(key in style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = style[key] ?? viewProps[key]);
|
|
471
467
|
}
|
|
472
468
|
if (overriddenContextProps) {
|
|
473
469
|
const Provider = staticConfig.context.Provider;
|
|
474
|
-
content = /* @__PURE__ */ jsx(Provider, { ...contextValue, ...overriddenContextProps, children: content });
|
|
470
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { ...contextValue, ...overriddenContextProps, children: content });
|
|
475
471
|
}
|
|
476
472
|
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
477
473
|
console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> (${internalID}) with props`);
|
|
478
474
|
try {
|
|
479
|
-
log("viewProps", viewProps), log("children", content), typeof window < "u" && (log("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), log({
|
|
475
|
+
(0, import_log.log)("viewProps", viewProps), (0, import_log.log)("children", content), typeof window < "u" && ((0, import_log.log)("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), (0, import_log.log)({
|
|
480
476
|
animationStyles,
|
|
481
477
|
classNames,
|
|
482
478
|
content,
|
|
@@ -515,7 +511,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
515
511
|
});
|
|
516
512
|
staticConfig.componentName && (component.displayName = staticConfig.componentName);
|
|
517
513
|
let res = component;
|
|
518
|
-
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = memo(res)), res.staticConfig = staticConfig;
|
|
514
|
+
(process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = (0, import_react.memo)(res)), res.staticConfig = staticConfig;
|
|
519
515
|
function extendStyledConfig(extended) {
|
|
520
516
|
return {
|
|
521
517
|
...staticConfig,
|
|
@@ -529,9 +525,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
529
525
|
return Component2.staticConfig = extendStyledConfig(extended), Component2.styleable = styleable, Component2;
|
|
530
526
|
}
|
|
531
527
|
function styleable(Component2, options) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
528
|
+
var _a2;
|
|
529
|
+
let out = ((_a2 = Component2.render) == null ? void 0 : _a2.length) === 2 ? Component2 : (0, import_react.forwardRef)(Component2);
|
|
530
|
+
const extendedConfig = extendStyledConfig(options == null ? void 0 : options.staticConfig);
|
|
531
|
+
return out = options != null && options.disableTheme ? out : (0, import_themeable.themeable)(out, extendedConfig), process.env.TAMAGUI_MEMOIZE_STYLEABLE && (out = (0, import_react.memo)(out)), out.staticConfig = extendedConfig, out.styleable = styleable, out;
|
|
535
532
|
}
|
|
536
533
|
return res.extractable = extractable, res.styleable = styleable, res;
|
|
537
534
|
}
|
|
@@ -552,9 +549,9 @@ const getSpacerSize = (size, { tokens }) => {
|
|
|
552
549
|
acceptsClassName: !0,
|
|
553
550
|
memo: !0,
|
|
554
551
|
componentName: "Spacer",
|
|
555
|
-
validStyles,
|
|
552
|
+
validStyles: import_helpers.validStyles,
|
|
556
553
|
defaultProps: {
|
|
557
|
-
...stackDefaultStyles,
|
|
554
|
+
...import_constants2.stackDefaultStyles,
|
|
558
555
|
// avoid nesting issues
|
|
559
556
|
tag: "span",
|
|
560
557
|
size: !0,
|
|
@@ -583,22 +580,23 @@ const getSpacerSize = (size, { tokens }) => {
|
|
|
583
580
|
}
|
|
584
581
|
});
|
|
585
582
|
function spacedChildren(props) {
|
|
583
|
+
var _a, _b, _c;
|
|
586
584
|
const { isZStack, children, space, direction, spaceFlex, separator } = props, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null;
|
|
587
585
|
if (!(hasSpace || hasSeparator || isZStack))
|
|
588
586
|
return children;
|
|
589
|
-
const childrenList = Children.toArray(children);
|
|
590
|
-
if (childrenList.length <= 1 && !isZStack && !childrenList[0]
|
|
587
|
+
const childrenList = import_react.Children.toArray(children);
|
|
588
|
+
if (childrenList.length <= 1 && !isZStack && !((_b = (_a = childrenList[0]) == null ? void 0 : _a.type) != null && _b.shouldForwardSpace))
|
|
591
589
|
return childrenList;
|
|
592
590
|
const final = [];
|
|
593
591
|
for (let [index, child] of childrenList.entries()) {
|
|
594
592
|
const isEmpty = child == null || Array.isArray(child) && child.length === 0;
|
|
595
|
-
if (!isEmpty &&
|
|
593
|
+
if (!isEmpty && import_react.default.isValidElement(child) && ((_c = child.type) != null && _c.shouldForwardSpace) && (child = import_react.default.cloneElement(child, {
|
|
596
594
|
space,
|
|
597
595
|
spaceFlex,
|
|
598
596
|
separator,
|
|
599
597
|
key: child.key
|
|
600
598
|
})), isEmpty || !child || child.key && !isZStack ? final.push(child) : final.push(
|
|
601
|
-
/* @__PURE__ */ jsx(Fragment, { children: isZStack ? /* @__PURE__ */ jsx(AbsoluteFill, { children: child }) : child }, index)
|
|
599
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, { children: child }) : child }, index)
|
|
602
600
|
), isUnspaced(child) && index === 0 || isZStack)
|
|
603
601
|
continue;
|
|
604
602
|
const next = childrenList[index + 1];
|
|
@@ -610,7 +608,7 @@ function spacedChildren(props) {
|
|
|
610
608
|
spaceFlex
|
|
611
609
|
})
|
|
612
610
|
), final.push(
|
|
613
|
-
|
|
611
|
+
import_react.default.isValidElement(separator) ? import_react.default.cloneElement(separator, { key: `sep_${index}` }) : separator
|
|
614
612
|
), hasSpace && final.push(
|
|
615
613
|
createSpacer({
|
|
616
614
|
key: `_${index}01tmgui`,
|
|
@@ -627,10 +625,10 @@ function spacedChildren(props) {
|
|
|
627
625
|
})
|
|
628
626
|
));
|
|
629
627
|
}
|
|
630
|
-
return process.env.NODE_ENV === "development" && props.debug && log(" Spaced children", final, props), final;
|
|
628
|
+
return process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)(" Spaced children", final, props), final;
|
|
631
629
|
}
|
|
632
630
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
633
|
-
return /* @__PURE__ */ jsx(
|
|
631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
634
632
|
Spacer,
|
|
635
633
|
{
|
|
636
634
|
size: space,
|
|
@@ -643,12 +641,12 @@ function createSpacer({ key, direction, space, spaceFlex }) {
|
|
|
643
641
|
);
|
|
644
642
|
}
|
|
645
643
|
function isUnspaced(child) {
|
|
646
|
-
const t = child
|
|
647
|
-
return t
|
|
644
|
+
const t = child == null ? void 0 : child.type;
|
|
645
|
+
return (t == null ? void 0 : t.isVisuallyHidden) || (t == null ? void 0 : t.isUnspaced);
|
|
648
646
|
}
|
|
649
647
|
const AbsoluteFill = createComponent({
|
|
650
648
|
defaultProps: {
|
|
651
|
-
...stackDefaultStyles,
|
|
649
|
+
...import_constants2.stackDefaultStyles,
|
|
652
650
|
flexDirection: "column",
|
|
653
651
|
position: "absolute",
|
|
654
652
|
top: 0,
|
|
@@ -666,15 +664,16 @@ function hasAnimatedStyleValue(style) {
|
|
|
666
664
|
}
|
|
667
665
|
function getMediaState(mediaGroups, layout) {
|
|
668
666
|
return Object.fromEntries(
|
|
669
|
-
[...mediaGroups].map((mediaKey) => [mediaKey, mediaKeyMatch(mediaKey, layout)])
|
|
667
|
+
[...mediaGroups].map((mediaKey) => [mediaKey, (0, import_useMedia.mediaKeyMatch)(mediaKey, layout)])
|
|
670
668
|
);
|
|
671
669
|
}
|
|
672
670
|
const fromPx = (val) => typeof val != "string" ? val : +val.replace("px", "");
|
|
673
|
-
export
|
|
671
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
672
|
+
0 && (module.exports = {
|
|
674
673
|
Spacer,
|
|
675
674
|
Unspaced,
|
|
676
675
|
createComponent,
|
|
677
676
|
mouseUps,
|
|
678
677
|
spacedChildren
|
|
679
|
-
};
|
|
678
|
+
});
|
|
680
679
|
//# sourceMappingURL=createComponent.js.map
|