@tamagui/core 1.0.0-beta.152 → 1.0.0-beta.17
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/README.md +1 -0
- package/dist/cjs/Tamagui.js +13 -1
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/ThemeContext.js +4 -0
- package/dist/cjs/ThemeManager.js +30 -14
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/conf.js +10 -1
- package/dist/cjs/conf.js.map +2 -2
- package/dist/cjs/constants/constants.js +6 -0
- package/dist/cjs/constants/platform.js +15 -0
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/rnw.js +4 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +4 -0
- package/dist/cjs/createComponent.js +191 -113
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +4 -0
- package/dist/cjs/createShorthands.js +4 -0
- package/dist/cjs/createTamagui.js +48 -27
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +4 -0
- package/dist/cjs/createTokens.js +7 -6
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +18 -2
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/helpers/RNComponents.js +4 -0
- package/dist/cjs/helpers/addStylesUsingClassname.js +8 -0
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/cjs/helpers/areEqualSets.js +4 -0
- package/dist/cjs/helpers/createMediaStyle.js +5 -2
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +53 -22
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +4 -0
- package/dist/cjs/helpers/createTamaguiProvider.js +4 -0
- package/dist/cjs/helpers/extendStaticConfig.js +9 -6
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +4 -0
- package/dist/cjs/helpers/fixNativeShadow.native.js +10 -9
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/cjs/helpers/getButtonSize.js +45 -0
- package/dist/cjs/helpers/getButtonSize.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +4 -0
- package/dist/cjs/helpers/getSize.js +35 -0
- package/dist/cjs/helpers/getSize.js.map +7 -0
- package/dist/cjs/helpers/getSplitStyles.js +137 -55
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +20 -3
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +4 -0
- package/dist/cjs/helpers/getTextSize.js +56 -0
- package/dist/cjs/helpers/getTextSize.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +42 -27
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isObj.js +4 -0
- package/dist/cjs/helpers/isTamaguiElement.js +4 -0
- package/dist/cjs/helpers/matchMedia.js +4 -0
- package/dist/cjs/helpers/matchMedia.native.js +4 -0
- package/dist/cjs/{constants/pseudos.js → helpers/nativeGestureHandler.js} +11 -19
- package/dist/cjs/helpers/nativeGestureHandler.js.map +7 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js +18 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +40 -0
- package/dist/cjs/helpers/proxyThemeVariables.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +7 -2
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/helpers/validate.js +53 -11
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/helpers/withStaticProperties.js +4 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js +4 -0
- package/dist/cjs/hooks/useConstant.js +4 -0
- package/dist/cjs/hooks/useFeatures.js +4 -0
- package/dist/cjs/hooks/useId.js +59 -0
- package/dist/cjs/hooks/useId.js.map +7 -0
- package/dist/cjs/hooks/useIsMounted.js +4 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +8 -4
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +14 -0
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/usePressable.js +4 -0
- package/dist/cjs/hooks/usePrevious.js +1 -0
- package/dist/cjs/{createShallowUpdate.js.map → hooks/usePrevious.js.map} +0 -0
- package/dist/cjs/hooks/useTheme.js +30 -16
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useUnmountEffect.js +4 -0
- package/dist/cjs/index.js +24 -6
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/nativeGestureHandler.native.js +18 -0
- package/dist/cjs/nativeGestureHandler.native.js.map +7 -0
- package/dist/cjs/static.js +3 -0
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +11 -5
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +134 -0
- package/dist/cjs/views/Slot.js.map +7 -0
- package/dist/cjs/views/Stack.js +4 -0
- package/dist/cjs/views/Text.js +13 -14
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/TextAncestorContext.js +6 -0
- package/dist/cjs/views/Theme.js +7 -3
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeInverse.js +10 -1
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +6 -1
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +4 -0
- package/dist/esm/Tamagui.js +8 -2
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/ThemeManager.js +21 -11
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/conf.js +0 -1
- package/dist/esm/conf.js.map +2 -2
- package/dist/esm/constants/platform.js +2 -0
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/createComponent.js +187 -122
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +45 -28
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTokens.js +2 -6
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +8 -2
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/helpers/addStylesUsingClassname.js +4 -1
- package/dist/esm/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/esm/helpers/createMediaStyle.js +0 -2
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +50 -22
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/extendStaticConfig.js +9 -6
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.native.js +7 -9
- package/dist/esm/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/esm/helpers/getButtonSize.js +24 -0
- package/dist/esm/helpers/getButtonSize.js.map +7 -0
- package/dist/esm/helpers/getSize.js +13 -0
- package/dist/esm/helpers/getSize.js.map +7 -0
- package/dist/esm/helpers/getSplitStyles.js +136 -57
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +15 -3
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getTextSize.js +34 -0
- package/dist/esm/helpers/getTextSize.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +32 -27
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/nativeGestureHandler.js +7 -0
- package/dist/esm/helpers/nativeGestureHandler.js.map +7 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js +2 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/esm/helpers/proxyThemeVariables.js +18 -0
- package/dist/esm/helpers/proxyThemeVariables.js.map +7 -0
- package/dist/esm/helpers/themeable.js +3 -2
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/helpers/validate.js +24 -11
- package/dist/esm/helpers/validate.js.map +2 -2
- package/dist/esm/hooks/useId.js +35 -0
- package/dist/esm/hooks/useId.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +6 -6
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +3 -0
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/usePrevious.js +1 -0
- package/dist/esm/{createShallowUpdate.js.map → hooks/usePrevious.js.map} +0 -0
- package/dist/esm/hooks/useTheme.js +22 -16
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/index.js +13 -6
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/nativeGestureHandler.native.js +2 -0
- package/dist/esm/nativeGestureHandler.native.js.map +7 -0
- package/dist/esm/static.js +3 -0
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +7 -5
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/Slot.js +82 -0
- package/dist/esm/views/Slot.js.map +7 -0
- package/dist/esm/views/Text.js +9 -14
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +3 -3
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +6 -2
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +2 -1
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/jsx/Tamagui.js +8 -2
- package/dist/jsx/ThemeManager.js +21 -11
- package/dist/jsx/conf.js +0 -1
- package/dist/jsx/constants/platform.js +2 -0
- package/dist/jsx/createComponent.js +173 -113
- package/dist/jsx/createTamagui.js +45 -28
- package/dist/jsx/createTokens.js +2 -6
- package/dist/jsx/createVariable.js +8 -2
- package/dist/jsx/helpers/addStylesUsingClassname.js +4 -1
- package/dist/jsx/helpers/createMediaStyle.js +0 -2
- package/dist/jsx/helpers/createPropMapper.js +50 -22
- package/dist/jsx/helpers/extendStaticConfig.js +9 -6
- package/dist/jsx/helpers/fixNativeShadow.native.js +7 -9
- package/dist/jsx/helpers/getButtonSize.js +23 -0
- package/dist/jsx/helpers/getSize.js +12 -0
- package/dist/jsx/helpers/getSplitStyles.js +136 -57
- package/dist/jsx/helpers/getStylesAtomic.js +15 -3
- package/dist/jsx/helpers/getTextSize.js +33 -0
- package/dist/jsx/helpers/insertStyleRule.js +32 -27
- package/dist/jsx/helpers/nativeGestureHandler.js +6 -0
- package/dist/jsx/helpers/nativeGestureHandler.native.js +1 -0
- package/dist/jsx/helpers/proxyThemeVariables.js +17 -0
- package/dist/jsx/helpers/themeable.js +3 -3
- package/dist/jsx/helpers/validate.js +24 -11
- package/dist/jsx/hooks/useId.js +34 -0
- package/dist/jsx/hooks/useIsTouchDevice.js +6 -6
- package/dist/jsx/hooks/useMedia.js +3 -0
- package/dist/jsx/{createShallowUpdate.js → hooks/usePrevious.js} +0 -0
- package/dist/jsx/hooks/useTheme.js +22 -16
- package/dist/jsx/index.js +13 -6
- package/dist/jsx/nativeGestureHandler.native.js +1 -0
- package/dist/jsx/static.js +3 -0
- package/dist/jsx/styled.js +7 -5
- package/dist/jsx/views/Slot.js +75 -0
- package/dist/jsx/views/Text.js +9 -14
- package/dist/jsx/views/Theme.js +4 -4
- package/dist/jsx/views/ThemeInverse.js +6 -1
- package/dist/jsx/views/ThemeProvider.js +2 -2
- package/package.json +8 -6
- package/types/Tamagui.d.ts +16 -1
- package/types/Tamagui.d.ts.map +1 -1
- package/types/ThemeManager.d.ts +3 -3
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/conf.d.ts +2 -0
- package/types/conf.d.ts.map +1 -1
- package/types/constants/platform.d.ts +1 -0
- package/types/constants/platform.d.ts.map +1 -1
- package/types/createComponent.d.ts +3 -4
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts +3 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTokens.d.ts +0 -26
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts +1 -0
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/addStylesUsingClassname.d.ts.map +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +1 -1
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/extendStaticConfig.d.ts +2 -2
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/fixNativeShadow.native.d.ts +2 -1
- package/types/helpers/fixNativeShadow.native.d.ts.map +1 -1
- package/types/helpers/getButtonSize.d.ts +8 -0
- package/types/helpers/getButtonSize.d.ts.map +1 -0
- package/types/helpers/getSize.d.ts +3 -0
- package/types/helpers/getSize.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts +14 -6
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getTextSize.d.ts +3 -0
- package/types/helpers/getTextSize.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts +2 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/nativeGestureHandler.d.ts +2 -0
- package/types/helpers/nativeGestureHandler.d.ts.map +1 -0
- package/types/helpers/nativeGestureHandler.native.d.ts +2 -0
- package/types/helpers/nativeGestureHandler.native.d.ts.map +1 -0
- package/types/helpers/proxyThemeVariables.d.ts +2 -0
- package/types/helpers/proxyThemeVariables.d.ts.map +1 -0
- package/types/helpers/themeable.d.ts +3 -1
- package/types/helpers/themeable.d.ts.map +1 -1
- package/types/helpers/validate.d.ts.map +1 -1
- package/types/hooks/useId.d.ts +9 -0
- package/types/hooks/useId.d.ts.map +1 -0
- package/types/hooks/useMedia.d.ts +2 -6
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/usePrevious.d.ts +1 -0
- package/types/hooks/usePrevious.d.ts.map +1 -0
- package/types/hooks/useTheme.d.ts +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/index.d.ts +11 -6
- package/types/index.d.ts.map +1 -1
- package/types/nativeGestureHandler.native.d.ts +2 -0
- package/types/nativeGestureHandler.native.d.ts.map +1 -0
- package/types/static.d.ts +3 -0
- package/types/static.d.ts.map +1 -1
- package/types/styled.d.ts +12 -3
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +86 -46
- package/types/types.d.ts.map +1 -1
- package/types/views/Slot.d.ts +9 -0
- package/types/views/Slot.d.ts.map +1 -0
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts +1 -0
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeInverse.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -0
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/LICENSE +0 -21
- package/dist/cjs/constants/pseudos.js.map +0 -7
- package/dist/cjs/createShallowUpdate.js +0 -1
- package/dist/cjs/devtools.js +0 -32
- package/dist/cjs/devtools.js.map +0 -7
- package/dist/cjs/spacedChildren.js +0 -86
- package/dist/cjs/spacedChildren.js.map +0 -7
- package/dist/cjs/tamagui-base.css +0 -8
- package/dist/cjs/tamagui-base.css.map +0 -7
- package/dist/esm/constants/pseudos.js +0 -18
- package/dist/esm/constants/pseudos.js.map +0 -7
- package/dist/esm/createShallowUpdate.js +0 -1
- package/dist/esm/devtools.js +0 -14
- package/dist/esm/devtools.js.map +0 -7
- package/dist/esm/spacedChildren.js +0 -52
- package/dist/esm/spacedChildren.js.map +0 -7
- package/dist/esm/tamagui-base.css +0 -8
- package/dist/esm/tamagui-base.css.map +0 -7
- package/dist/jsx/constants/pseudos.js +0 -17
- package/dist/jsx/devtools.js +0 -13
- package/dist/jsx/spacedChildren.js +0 -44
- package/dist/jsx/tamagui-base.css +0 -7
- package/types/spacedChildren.d.ts +0 -9
- package/types/spacedChildren.d.ts.map +0 -1
|
@@ -53,7 +53,6 @@ __export(createComponent_exports, {
|
|
|
53
53
|
AbsoluteFill: () => AbsoluteFill,
|
|
54
54
|
Spacer: () => Spacer,
|
|
55
55
|
createComponent: () => createComponent,
|
|
56
|
-
defaultComponentState: () => defaultComponentState,
|
|
57
56
|
mouseUps: () => mouseUps,
|
|
58
57
|
spacedChildren: () => spacedChildren
|
|
59
58
|
});
|
|
@@ -66,15 +65,18 @@ var import_conf = require("./conf");
|
|
|
66
65
|
var import_constants = require("./constants/constants");
|
|
67
66
|
var import_platform = require("./constants/platform");
|
|
68
67
|
var import_rnw = require("./constants/rnw");
|
|
69
|
-
var import_createVariable = require("./createVariable");
|
|
70
68
|
var import_createShallowUpdate = require("./helpers/createShallowUpdate");
|
|
71
69
|
var import_extendStaticConfig = require("./helpers/extendStaticConfig");
|
|
72
70
|
var import_getSplitStyles = require("./helpers/getSplitStyles");
|
|
73
71
|
var import_insertStyleRule = require("./helpers/insertStyleRule");
|
|
72
|
+
var import_nativeGestureHandler = require("./helpers/nativeGestureHandler");
|
|
73
|
+
var import_proxyThemeVariables = require("./helpers/proxyThemeVariables");
|
|
74
74
|
var import_wrapThemeManagerContext = require("./helpers/wrapThemeManagerContext");
|
|
75
75
|
var import_useFeatures = require("./hooks/useFeatures");
|
|
76
|
+
var import_useIsTouchDevice = require("./hooks/useIsTouchDevice");
|
|
76
77
|
var import_usePressable = require("./hooks/usePressable");
|
|
77
78
|
var import_useTheme = require("./hooks/useTheme");
|
|
79
|
+
var import_Slot = require("./views/Slot");
|
|
78
80
|
var import_TextAncestorContext = require("./views/TextAncestorContext");
|
|
79
81
|
import_react.default["keep"];
|
|
80
82
|
const defaultComponentState = {
|
|
@@ -91,55 +93,70 @@ if (typeof document !== "undefined") {
|
|
|
91
93
|
mouseUps.forEach((x) => x());
|
|
92
94
|
mouseUps.clear();
|
|
93
95
|
});
|
|
96
|
+
document.addEventListener("touchend", () => {
|
|
97
|
+
mouseUps.forEach((x) => x());
|
|
98
|
+
mouseUps.clear();
|
|
99
|
+
});
|
|
100
|
+
document.addEventListener("touchcancel", () => {
|
|
101
|
+
mouseUps.forEach((x) => x());
|
|
102
|
+
mouseUps.clear();
|
|
103
|
+
});
|
|
94
104
|
}
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
staticConfig = configIn;
|
|
99
|
-
} else {
|
|
100
|
-
staticConfig = (0, import_extendStaticConfig.parseStaticConfig)(configIn);
|
|
105
|
+
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
106
|
+
for (const key in defaultProps) {
|
|
107
|
+
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
101
108
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
}
|
|
110
|
+
__name(mergeShorthands, "mergeShorthands");
|
|
111
|
+
let initialTheme;
|
|
112
|
+
function createComponent(configIn, ParentComponent) {
|
|
113
|
+
const staticConfig = (() => {
|
|
114
|
+
const config = (0, import_extendStaticConfig.extendStaticConfig)(configIn, ParentComponent);
|
|
115
|
+
if ("parsed" in config) {
|
|
116
|
+
return config;
|
|
117
|
+
} else {
|
|
118
|
+
return (0, import_extendStaticConfig.parseStaticConfig)(config);
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
const componentClassName = `is_${staticConfig.componentName}`;
|
|
105
122
|
let tamaguiConfig;
|
|
106
123
|
let AnimatedText;
|
|
107
124
|
let AnimatedView;
|
|
108
125
|
let avoidClasses = true;
|
|
109
|
-
let defaultPseudos = {};
|
|
110
126
|
let defaultNativeStyle;
|
|
111
|
-
let defaultNativeStyleSheet
|
|
112
|
-
let
|
|
113
|
-
let
|
|
114
|
-
let defaultSplitStyleResult = null;
|
|
127
|
+
let defaultNativeStyleSheet;
|
|
128
|
+
let tamaguiDefaultProps;
|
|
129
|
+
let initialSplitStyles;
|
|
115
130
|
function addPseudoToStyles(styles, name, pseudos) {
|
|
116
131
|
const pseudoStyle = pseudos[name];
|
|
117
132
|
const shouldNestObject = import_platform.isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
118
|
-
|
|
119
|
-
styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle);
|
|
120
|
-
}
|
|
121
|
-
const defaultPseudoStyle = defaultPseudos[name];
|
|
133
|
+
const defaultPseudoStyle = initialSplitStyles.pseudos[name];
|
|
122
134
|
if (defaultPseudoStyle) {
|
|
123
135
|
styles.push(shouldNestObject ? { [name]: defaultPseudoStyle } : defaultPseudoStyle);
|
|
124
136
|
}
|
|
137
|
+
if (pseudoStyle) {
|
|
138
|
+
styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle);
|
|
139
|
+
}
|
|
125
140
|
}
|
|
126
141
|
__name(addPseudoToStyles, "addPseudoToStyles");
|
|
127
142
|
const component = (0, import_react.forwardRef)((props, forwardedRef) => {
|
|
128
143
|
var _a, _c, _d, _e;
|
|
144
|
+
props = tamaguiDefaultProps && !props.asChild ? __spreadValues(__spreadValues({}, tamaguiDefaultProps), props) : props;
|
|
145
|
+
const { Component, componentName, isText, isZStack } = staticConfig;
|
|
129
146
|
if (process.env.NODE_ENV === "development") {
|
|
130
147
|
if (props["debug"]) {
|
|
131
|
-
console.
|
|
132
|
-
console.log("props in:", props);
|
|
148
|
+
console.log("\u26A0\uFE0F", staticConfig.componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]", "debug on");
|
|
149
|
+
console.log("props in:", props, Object.keys(props));
|
|
133
150
|
if (props["debug"] === "break")
|
|
134
151
|
debugger;
|
|
135
152
|
}
|
|
136
153
|
}
|
|
137
154
|
const forceUpdate = (0, import_use_force_update.useForceUpdate)();
|
|
138
|
-
const theme = (0, import_useTheme.useTheme)(props.theme, componentName, props, forceUpdate);
|
|
155
|
+
const theme = (0, import_useTheme.useTheme)(props.theme, staticConfig.componentName, props, forceUpdate);
|
|
139
156
|
const [state, set_] = (0, import_react.useState)(defaultComponentState);
|
|
140
157
|
const setStateShallow = (0, import_createShallowUpdate.createShallowUpdate)(set_);
|
|
141
158
|
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
142
|
-
const splitStyles = (0, import_getSplitStyles.
|
|
159
|
+
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, shouldAvoidClasses ? __spreadProps(__spreadValues({}, state), { noClassNames: true, resolveVariablesAs: "value" }) : state, shouldAvoidClasses || props.asChild ? null : initialSplitStyles.classNames);
|
|
143
160
|
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
144
161
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
145
162
|
const isAnimated = !!(useAnimations && props.animation);
|
|
@@ -158,6 +175,7 @@ function createComponent(configIn) {
|
|
|
158
175
|
const _b = viewPropsIn, {
|
|
159
176
|
tag,
|
|
160
177
|
hitSlop,
|
|
178
|
+
asChild,
|
|
161
179
|
children,
|
|
162
180
|
pointerEvents,
|
|
163
181
|
onPress,
|
|
@@ -192,12 +210,14 @@ function createComponent(configIn) {
|
|
|
192
210
|
accessibilityRole,
|
|
193
211
|
collapsable,
|
|
194
212
|
focusable,
|
|
213
|
+
onClick,
|
|
195
214
|
theme: _themeProp,
|
|
196
215
|
defaultVariants,
|
|
197
216
|
onLayout
|
|
198
217
|
} = _b, viewPropsRest = __objRest(_b, [
|
|
199
218
|
"tag",
|
|
200
219
|
"hitSlop",
|
|
220
|
+
"asChild",
|
|
201
221
|
"children",
|
|
202
222
|
"pointerEvents",
|
|
203
223
|
"onPress",
|
|
@@ -232,6 +252,7 @@ function createComponent(configIn) {
|
|
|
232
252
|
"accessibilityRole",
|
|
233
253
|
"collapsable",
|
|
234
254
|
"focusable",
|
|
255
|
+
"onClick",
|
|
235
256
|
"theme",
|
|
236
257
|
"defaultVariants",
|
|
237
258
|
"onLayout"
|
|
@@ -253,7 +274,7 @@ function createComponent(configIn) {
|
|
|
253
274
|
};
|
|
254
275
|
}
|
|
255
276
|
(0, import_platform.useIsomorphicLayoutEffect)(() => {
|
|
256
|
-
if (typeof window !== "undefined") {
|
|
277
|
+
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
257
278
|
setStateShallow({
|
|
258
279
|
mounted: true
|
|
259
280
|
});
|
|
@@ -263,7 +284,7 @@ function createComponent(configIn) {
|
|
|
263
284
|
mouseUps.delete(unPress);
|
|
264
285
|
internal.current.isMounted = false;
|
|
265
286
|
};
|
|
266
|
-
}, [hasEnterStyle]);
|
|
287
|
+
}, [hasEnterStyle, props.animation]);
|
|
267
288
|
if (nativeID) {
|
|
268
289
|
viewProps.id = nativeID;
|
|
269
290
|
}
|
|
@@ -279,7 +300,7 @@ function createComponent(configIn) {
|
|
|
279
300
|
if (accessibilityRole)
|
|
280
301
|
viewProps.accessibilityRole = accessibilityRole;
|
|
281
302
|
}
|
|
282
|
-
if (import_platform.isWeb) {
|
|
303
|
+
if (import_platform.isWeb && !asChild) {
|
|
283
304
|
import_rnw.rnw.useResponderEvents(hostRef, {
|
|
284
305
|
onMoveShouldSetResponder,
|
|
285
306
|
onMoveShouldSetResponderCapture,
|
|
@@ -336,7 +357,7 @@ function createComponent(configIn) {
|
|
|
336
357
|
const className = classList.join(" ");
|
|
337
358
|
if (process.env.NODE_ENV === "development") {
|
|
338
359
|
if (props["debug"]) {
|
|
339
|
-
console.log(" \xBB className", { isStringElement, pseudos, state,
|
|
360
|
+
console.log(" \xBB className", { isStringElement, pseudos, state, classNames, propsClassName: props.className, style, classList, className: className.trim().split(" "), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, (0, import_insertStyleRule.getAllSelectors)()[v]])) });
|
|
340
361
|
}
|
|
341
362
|
}
|
|
342
363
|
viewProps.className = className;
|
|
@@ -377,11 +398,16 @@ function createComponent(configIn) {
|
|
|
377
398
|
viewProps.ref = forwardedRef;
|
|
378
399
|
}
|
|
379
400
|
}
|
|
380
|
-
const
|
|
381
|
-
const
|
|
401
|
+
const initialPseudos = initialSplitStyles.pseudos;
|
|
402
|
+
const attachPress = !!(pseudos && pseudos.pressStyle || initialPseudos && initialPseudos.pressStyle || onPress || onPressOut || onPressIn || onClick);
|
|
403
|
+
const isTouch = (0, import_useIsTouchDevice.useIsTouchDevice)();
|
|
404
|
+
const isHoverable = import_platform.isWeb && !isTouch;
|
|
382
405
|
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
383
|
-
const
|
|
384
|
-
const
|
|
406
|
+
const handlesPressEvents = !isStringElement && !asChild;
|
|
407
|
+
const pressKey = handlesPressEvents ? "onPress" : "onClick";
|
|
408
|
+
const pressInKey = handlesPressEvents ? "onPressIn" : "onMouseDown";
|
|
409
|
+
const pressOutKey = handlesPressEvents ? "onPressOut" : "onMouseUp";
|
|
410
|
+
const shouldAttach = !asChild && (attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || import_platform.isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props));
|
|
385
411
|
const unPress = (0, import_react.useCallback)(() => {
|
|
386
412
|
if (!internal.current.isMounted)
|
|
387
413
|
return;
|
|
@@ -390,12 +416,12 @@ function createComponent(configIn) {
|
|
|
390
416
|
pressIn: false
|
|
391
417
|
});
|
|
392
418
|
}, []);
|
|
393
|
-
const events = shouldAttach ? __spreadProps(__spreadValues(
|
|
394
|
-
|
|
419
|
+
const events = shouldAttach ? __spreadProps(__spreadValues({
|
|
420
|
+
[pressOutKey]: attachPress ? (e) => {
|
|
395
421
|
unPress();
|
|
396
422
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
423
|
+
} : void 0
|
|
424
|
+
}, isHoverable && {
|
|
399
425
|
onMouseEnter: attachHover ? (e) => {
|
|
400
426
|
let next = {};
|
|
401
427
|
if (attachHover) {
|
|
@@ -427,37 +453,29 @@ function createComponent(configIn) {
|
|
|
427
453
|
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
428
454
|
} : void 0
|
|
429
455
|
}), {
|
|
430
|
-
|
|
456
|
+
[pressInKey]: attachPress ? (e) => {
|
|
431
457
|
setStateShallow({
|
|
432
458
|
press: true,
|
|
433
459
|
pressIn: true
|
|
434
460
|
});
|
|
435
461
|
onPressIn == null ? void 0 : onPressIn(e);
|
|
436
462
|
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
463
|
+
if (import_platform.isWeb) {
|
|
464
|
+
mouseUps.add(unPress);
|
|
465
|
+
}
|
|
437
466
|
} : null,
|
|
438
|
-
[
|
|
439
|
-
onPress == null ? void 0 : onPress(e);
|
|
467
|
+
[pressKey]: attachPress ? (e) => {
|
|
440
468
|
unPress();
|
|
441
|
-
|
|
469
|
+
onClick == null ? void 0 : onClick(e);
|
|
470
|
+
onPress == null ? void 0 : onPress(e);
|
|
442
471
|
} : null
|
|
443
472
|
}) : null;
|
|
444
|
-
|
|
473
|
+
const childEls = !children || asChild ? children : (0, import_wrapThemeManagerContext.wrapThemeManagerContext)(spacedChildren({
|
|
445
474
|
children,
|
|
446
475
|
space,
|
|
447
476
|
flexDirection: props.flexDirection || ((_c = staticConfig.defaultProps) == null ? void 0 : _c.flexDirection),
|
|
448
477
|
isZStack
|
|
449
478
|
}), (0, import_useTheme.getThemeManagerIfChanged)(theme));
|
|
450
|
-
const [pressProps] = (0, import_usePressable.usePressable)(events ? __spreadProps(__spreadValues({
|
|
451
|
-
disabled
|
|
452
|
-
}, hitSlop && {
|
|
453
|
-
hitSlop
|
|
454
|
-
}), {
|
|
455
|
-
onPressIn: events.onMouseDown,
|
|
456
|
-
onPressOut: events.onPressOut,
|
|
457
|
-
onPress: events[pressEventKey]
|
|
458
|
-
}) : {
|
|
459
|
-
disabled: true
|
|
460
|
-
});
|
|
461
479
|
let content;
|
|
462
480
|
if (import_platform.isWeb) {
|
|
463
481
|
if (staticConfig.isReactNativeWeb) {
|
|
@@ -473,14 +491,46 @@ function createComponent(configIn) {
|
|
|
473
491
|
}
|
|
474
492
|
}
|
|
475
493
|
}
|
|
476
|
-
if (
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
494
|
+
if (asChild) {
|
|
495
|
+
ViewComponent = import_Slot.Slot;
|
|
496
|
+
const onlyChild = import_react.default.Children.only(children);
|
|
497
|
+
Object.assign(viewProps, onlyChild.props);
|
|
498
|
+
}
|
|
499
|
+
if (import_platform.isWeb) {
|
|
500
|
+
const [pressableProps] = (0, import_usePressable.usePressable)(events ? __spreadProps(__spreadValues({
|
|
501
|
+
disabled
|
|
502
|
+
}, hitSlop && {
|
|
503
|
+
hitSlop
|
|
504
|
+
}), {
|
|
505
|
+
onPressOut: events[pressOutKey],
|
|
506
|
+
onPressIn: events[pressInKey],
|
|
507
|
+
onPress: events[pressKey]
|
|
508
|
+
}) : {
|
|
509
|
+
disabled: true
|
|
510
|
+
});
|
|
511
|
+
if (events) {
|
|
512
|
+
if (handlesPressEvents) {
|
|
513
|
+
Object.assign(viewProps, pressableProps);
|
|
514
|
+
} else {
|
|
515
|
+
Object.assign(viewProps, events);
|
|
516
|
+
}
|
|
481
517
|
}
|
|
482
518
|
}
|
|
483
519
|
content = (0, import_react.createElement)(ViewComponent, viewProps, childEls);
|
|
520
|
+
if (!import_platform.isWeb) {
|
|
521
|
+
if (attachPress && events) {
|
|
522
|
+
content = /* @__PURE__ */ import_react.default.createElement(import_react_native.Pressable, {
|
|
523
|
+
onPressIn: events[pressInKey],
|
|
524
|
+
onPress: events[pressKey]
|
|
525
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_nativeGestureHandler.BaseButton, {
|
|
526
|
+
onActiveStateChange: (isActive) => {
|
|
527
|
+
if (!isActive) {
|
|
528
|
+
unPress();
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}, content));
|
|
532
|
+
}
|
|
533
|
+
}
|
|
484
534
|
if (import_platform.isWeb && events && attachHover) {
|
|
485
535
|
content = /* @__PURE__ */ import_react.default.createElement("span", {
|
|
486
536
|
className: "tui_Hoverable",
|
|
@@ -493,8 +543,7 @@ function createComponent(configIn) {
|
|
|
493
543
|
}
|
|
494
544
|
if (process.env.NODE_ENV === "development") {
|
|
495
545
|
if (props["debug"]) {
|
|
496
|
-
viewProps
|
|
497
|
-
console.log(" \xBB ", __spreadValues({ propsIn: __spreadValues({}, props), propsOut: __spreadValues({}, viewProps), state, splitStyles, defaultsClassName, animationStyles, isStringElement, classNamesIn: (_d = props.className) == null ? void 0 : _d.split(" "), classNamesOut: (_e = viewProps.className) == null ? void 0 : _e.split(" "), pressProps, events, shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, defaultSplitStyleResult }, typeof window !== "undefined" ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null));
|
|
546
|
+
console.log(" \xBB ", __spreadValues({ propsIn: __spreadValues({}, props), propsOut: __spreadValues({}, viewProps), state, splitStyles, animationStyles, isStringElement, classNamesIn: (_d = props.className) == null ? void 0 : _d.split(" "), classNamesOut: (_e = viewProps.className) == null ? void 0 : _e.split(" "), events, shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles }, typeof window !== "undefined" ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null));
|
|
498
547
|
}
|
|
499
548
|
}
|
|
500
549
|
if (features.length) {
|
|
@@ -502,58 +551,74 @@ function createComponent(configIn) {
|
|
|
502
551
|
}
|
|
503
552
|
return content;
|
|
504
553
|
});
|
|
554
|
+
component.displayName = staticConfig.componentName;
|
|
505
555
|
(0, import_conf.onConfiguredOnce)((conf) => {
|
|
506
556
|
var _a, _b, _c, _d;
|
|
507
557
|
if (process.env.IS_STATIC === "is_static") {
|
|
508
558
|
return;
|
|
509
559
|
}
|
|
510
|
-
const shouldDebug = (_a = staticConfig.defaultProps) == null ? void 0 : _a.debug;
|
|
511
560
|
tamaguiConfig = conf;
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
561
|
+
mergeShorthands(staticConfig, tamaguiConfig);
|
|
562
|
+
avoidClasses = !!((_a = tamaguiConfig.animations) == null ? void 0 : _a.avoidClasses);
|
|
563
|
+
AnimatedText = (_b = tamaguiConfig.animations) == null ? void 0 : _b.Text;
|
|
564
|
+
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
565
|
+
initialTheme = initialTheme || (0, import_proxyThemeVariables.proxyThemeVariables)(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
566
|
+
initialSplitStyles = (0, import_getSplitStyles.insertSplitStyles)(staticConfig.defaultProps, staticConfig, initialTheme, {
|
|
517
567
|
mounted: true,
|
|
518
568
|
hover: false,
|
|
519
569
|
press: false,
|
|
520
570
|
pressIn: false,
|
|
521
571
|
focus: false,
|
|
522
|
-
resolveVariablesAs: "both"
|
|
572
|
+
resolveVariablesAs: "both",
|
|
573
|
+
keepVariantsAsProps: true
|
|
523
574
|
});
|
|
524
|
-
const
|
|
525
|
-
if (import_platform.isWeb) {
|
|
526
|
-
defaultsClassName = classNames;
|
|
527
|
-
}
|
|
528
|
-
defaultPseudos = pseudos;
|
|
575
|
+
const defaults = __spreadValues(__spreadValues({}, component.defaultProps), initialSplitStyles.viewProps);
|
|
529
576
|
defaultNativeStyle = {};
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
577
|
+
const validStyles = staticConfig.validStyles || import_helpers.stylePropsView;
|
|
578
|
+
for (const key in staticConfig.defaultProps) {
|
|
579
|
+
const val = staticConfig.defaultProps[key];
|
|
580
|
+
if (typeof val === "string" && val[0] === "$" || !validStyles[key]) {
|
|
581
|
+
defaults[key] = val;
|
|
582
|
+
} else {
|
|
583
|
+
defaultNativeStyle[key] = val;
|
|
584
|
+
}
|
|
533
585
|
}
|
|
534
586
|
defaultNativeStyleSheet = import_react_native.StyleSheet.create({
|
|
535
587
|
base: defaultNativeStyle
|
|
536
588
|
});
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
589
|
+
if (Object.keys(defaults).length) {
|
|
590
|
+
tamaguiDefaultProps = defaults;
|
|
591
|
+
}
|
|
592
|
+
if (process.env.NODE_ENV === "development" && ((_d = staticConfig.defaultProps) == null ? void 0 : _d.debug)) {
|
|
593
|
+
if (process.env.IS_STATIC !== "is_static") {
|
|
594
|
+
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
595
|
+
staticConfig,
|
|
596
|
+
initialSplitStyles,
|
|
597
|
+
tamaguiDefaultProps,
|
|
598
|
+
defaultNativeStyle,
|
|
599
|
+
defaults
|
|
600
|
+
});
|
|
601
|
+
}
|
|
541
602
|
}
|
|
542
603
|
});
|
|
543
604
|
let res = component;
|
|
544
605
|
if (configIn.memo) {
|
|
545
606
|
res = (0, import_react.memo)(res);
|
|
546
607
|
}
|
|
547
|
-
res["whyDidYouRender"] = true;
|
|
548
608
|
res["staticConfig"] = __spreadValues({
|
|
549
|
-
validStyles:
|
|
609
|
+
validStyles: staticConfig.validStyles || import_helpers.stylePropsView
|
|
550
610
|
}, staticConfig);
|
|
551
|
-
|
|
552
|
-
|
|
611
|
+
if (process.env.NODE_ENV === "development") {
|
|
612
|
+
res["whyDidYouRender"] = true;
|
|
613
|
+
}
|
|
614
|
+
res["extractable"] = (Component, conf) => {
|
|
615
|
+
Component["staticConfig"] = (0, import_extendStaticConfig.extendStaticConfig)(__spreadProps(__spreadValues({
|
|
616
|
+
Component
|
|
617
|
+
}, conf), {
|
|
553
618
|
neverFlatten: true,
|
|
554
|
-
defaultProps: __spreadValues(__spreadValues({},
|
|
555
|
-
}));
|
|
556
|
-
return
|
|
619
|
+
defaultProps: __spreadValues(__spreadValues({}, Component.defaultProps), conf == null ? void 0 : conf.defaultProps)
|
|
620
|
+
}), res);
|
|
621
|
+
return Component;
|
|
557
622
|
};
|
|
558
623
|
return res;
|
|
559
624
|
}
|
|
@@ -592,6 +657,9 @@ const Spacer = createComponent({
|
|
|
592
657
|
minWidth: 0
|
|
593
658
|
}
|
|
594
659
|
}
|
|
660
|
+
},
|
|
661
|
+
defaultVariants: {
|
|
662
|
+
direction: "horizontal"
|
|
595
663
|
}
|
|
596
664
|
});
|
|
597
665
|
function spacedChildren({
|
|
@@ -602,50 +670,60 @@ function spacedChildren({
|
|
|
602
670
|
spaceFlex
|
|
603
671
|
}) {
|
|
604
672
|
var _a;
|
|
605
|
-
const childrenList = import_react.Children.toArray(children);
|
|
673
|
+
const childrenList = Array.isArray(children) ? children : import_react.Children.toArray(children);
|
|
606
674
|
const len = childrenList.length;
|
|
607
|
-
if (len
|
|
675
|
+
if (len <= 1) {
|
|
608
676
|
return childrenList;
|
|
609
677
|
}
|
|
610
|
-
const
|
|
678
|
+
const final = [];
|
|
611
679
|
for (const [index, child] of childrenList.entries()) {
|
|
612
|
-
if (child === null || child === void 0) {
|
|
680
|
+
if (child === null || child === void 0 || child === false || Array.isArray(child) && child.length === 0) {
|
|
613
681
|
continue;
|
|
614
682
|
}
|
|
615
683
|
if (!child || child["key"] && !isZStack) {
|
|
616
|
-
|
|
684
|
+
final.push(child);
|
|
617
685
|
} else {
|
|
618
|
-
|
|
686
|
+
final.push(/* @__PURE__ */ import_react.default.createElement(import_react.Fragment, {
|
|
619
687
|
key: index
|
|
620
688
|
}, isZStack ? /* @__PURE__ */ import_react.default.createElement(AbsoluteFill, null, child) : child));
|
|
621
689
|
}
|
|
622
690
|
if ((_a = child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) {
|
|
623
691
|
continue;
|
|
624
692
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
693
|
+
const next = childrenList[index + 1];
|
|
694
|
+
if (next && space) {
|
|
695
|
+
final.push(/* @__PURE__ */ import_react.default.createElement(Spacer, __spreadValues({
|
|
696
|
+
key: `_${index}_spacer`,
|
|
697
|
+
direction: flexDirection === "row" || flexDirection === "row-reverse" ? "horizontal" : "vertical",
|
|
698
|
+
size: space
|
|
699
|
+
}, spaceFlex && {
|
|
700
|
+
flex: spaceFlex
|
|
701
|
+
})));
|
|
635
702
|
}
|
|
636
703
|
}
|
|
637
|
-
return
|
|
704
|
+
return final;
|
|
638
705
|
}
|
|
639
706
|
__name(spacedChildren, "spacedChildren");
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
|
|
707
|
+
function AbsoluteFill(props) {
|
|
708
|
+
return import_platform.isWeb ? /* @__PURE__ */ import_react.default.createElement("div", {
|
|
709
|
+
style: {
|
|
710
|
+
position: "absolute",
|
|
711
|
+
top: 0,
|
|
712
|
+
left: 0,
|
|
713
|
+
right: 0,
|
|
714
|
+
bottom: 0
|
|
715
|
+
}
|
|
716
|
+
}, props.children) : /* @__PURE__ */ import_react.default.createElement(import_react_native.View, {
|
|
717
|
+
style: import_react_native.StyleSheet.absoluteFill
|
|
718
|
+
}, props.child);
|
|
719
|
+
}
|
|
720
|
+
__name(AbsoluteFill, "AbsoluteFill");
|
|
721
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
722
|
+
0 && (module.exports = {
|
|
723
|
+
AbsoluteFill,
|
|
724
|
+
Spacer,
|
|
725
|
+
createComponent,
|
|
726
|
+
mouseUps,
|
|
727
|
+
spacedChildren
|
|
728
|
+
});
|
|
651
729
|
//# sourceMappingURL=createComponent.js.map
|