@tamagui/core 1.0.1-beta.149 → 1.0.1-beta.152
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 +4 -1
- package/dist/cjs/Tamagui.js.map +1 -1
- package/dist/cjs/addTheme.js.map +1 -1
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/platform.native.js.map +1 -1
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/cjs/contexts/FontLanguageContext.js.map +1 -1
- package/dist/cjs/contexts/TextAncestorContext.js +6 -7
- package/dist/cjs/contexts/TextAncestorContext.js.map +2 -2
- package/dist/cjs/contexts/ThemeContext.js.map +1 -1
- package/dist/cjs/createComponent.js +315 -123
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createFont.js +2 -1
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +5 -3
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTokens.js.map +1 -1
- package/dist/cjs/createVariable.js +3 -1
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.js.map +2 -2
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/cjs/helpers/calc.js.map +2 -2
- package/dist/cjs/helpers/createMediaStyle.js +10 -4
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +89 -9
- package/dist/cjs/helpers/createPropMapper.js.map +1 -1
- package/dist/cjs/helpers/createShallowUpdate.js +12 -9
- package/dist/cjs/helpers/createShallowUpdate.js.map +1 -1
- package/dist/cjs/helpers/cssHash.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.js.map +2 -2
- package/dist/cjs/helpers/expandStyles.js.map +1 -1
- package/dist/cjs/helpers/extendStaticConfig.js +10 -7
- package/dist/cjs/helpers/extendStaticConfig.js.map +1 -1
- package/dist/cjs/helpers/getAnimationDriver.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getFont.js.map +1 -1
- package/dist/cjs/helpers/getSize.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +99 -53
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +8 -2
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +7 -3
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +9 -7
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +4 -1
- package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js.map +1 -1
- package/dist/cjs/helpers/mergeTransform.js.map +2 -2
- package/dist/cjs/helpers/normalizeColor.js +4 -1
- package/dist/cjs/helpers/normalizeColor.js.map +2 -2
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
- package/dist/cjs/helpers/startTransition.js +4 -1
- package/dist/cjs/helpers/startTransition.js.map +2 -2
- package/dist/cjs/helpers/themeable.js +12 -5
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/helpers/themes.js.map +1 -1
- package/dist/cjs/hooks/useConstant.js.map +1 -1
- package/dist/cjs/hooks/useFeatures.js +0 -120
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useIsSSR.js.map +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.js.map +1 -1
- package/dist/cjs/hooks/useMedia.js +10 -7
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useSafeRef.js.map +1 -1
- package/dist/cjs/hooks/useServerHooks.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +6 -1
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/injectStyles.js.map +1 -1
- package/dist/cjs/insertFont.js +3 -1
- package/dist/cjs/insertFont.js.map +2 -2
- package/dist/cjs/styled.js +3 -1
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/updateTheme.js +7 -4
- package/dist/cjs/updateTheme.js.map +1 -1
- package/dist/cjs/views/FontLanguage.js +5 -7
- package/dist/cjs/views/FontLanguage.js.map +1 -1
- package/dist/cjs/views/FontLanguage.native.js +6 -7
- package/dist/cjs/views/FontLanguage.native.js.map +1 -1
- package/dist/cjs/views/Slot.js +16 -8
- package/dist/cjs/views/Slot.js.map +1 -1
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.js +21 -12
- package/dist/cjs/views/TamaguiProvider.js.map +1 -1
- package/dist/cjs/views/Text.js.map +1 -1
- package/dist/cjs/views/Theme.js +25 -11
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeInverse.js +6 -7
- package/dist/cjs/views/ThemeInverse.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +14 -8
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +9 -4
- package/dist/cjs/views/ThemeReset.js.map +2 -2
- package/dist/esm/Tamagui.js.map +1 -1
- package/dist/esm/addTheme.js.map +1 -1
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/platform.native.js.map +1 -1
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/esm/contexts/FontLanguageContext.js.map +1 -1
- package/dist/esm/contexts/TextAncestorContext.js +6 -4
- package/dist/esm/contexts/TextAncestorContext.js.map +1 -1
- package/dist/esm/contexts/ThemeContext.js.map +1 -1
- package/dist/esm/createComponent.js +319 -125
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createFont.js +2 -1
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createShorthands.js.map +1 -1
- package/dist/esm/createTamagui.js +5 -3
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTokens.js.map +1 -1
- package/dist/esm/createVariable.js +3 -1
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js.map +1 -1
- package/dist/esm/helpers/RNComponents.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.js.map +2 -2
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/esm/helpers/calc.js.map +2 -2
- package/dist/esm/helpers/createMediaStyle.js +10 -4
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +89 -9
- package/dist/esm/helpers/createPropMapper.js.map +1 -1
- package/dist/esm/helpers/createShallowUpdate.js +12 -9
- package/dist/esm/helpers/createShallowUpdate.js.map +1 -1
- package/dist/esm/helpers/cssHash.js.map +1 -1
- package/dist/esm/helpers/expandStyle.js.map +2 -2
- package/dist/esm/helpers/expandStyles.js.map +1 -1
- package/dist/esm/helpers/extendStaticConfig.js +10 -7
- package/dist/esm/helpers/extendStaticConfig.js.map +1 -1
- package/dist/esm/helpers/getAnimationDriver.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/esm/helpers/getFont.js.map +1 -1
- package/dist/esm/helpers/getSize.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +99 -53
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +4 -1
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +7 -3
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js +9 -7
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/esm/helpers/isTamaguiElement.js.map +1 -1
- package/dist/esm/helpers/matchMedia.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js.map +1 -1
- package/dist/esm/helpers/mergeTransform.js.map +2 -2
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.js.map +1 -1
- package/dist/esm/helpers/startTransition.js.map +1 -1
- package/dist/esm/helpers/themeable.js +8 -4
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/themes.js.map +1 -1
- package/dist/esm/hooks/useConstant.js.map +1 -1
- package/dist/esm/hooks/useFeatures.js +0 -120
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/hooks/useId.js.map +1 -1
- package/dist/esm/hooks/useIsMounted.js.map +1 -1
- package/dist/esm/hooks/useIsSSR.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +10 -7
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useSafeRef.js.map +1 -1
- package/dist/esm/hooks/useServerHooks.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +6 -1
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/injectStyles.js.map +1 -1
- package/dist/esm/insertFont.js +3 -1
- package/dist/esm/insertFont.js.map +2 -2
- package/dist/esm/static.js.map +1 -1
- package/dist/esm/styled.js +3 -1
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/updateTheme.js +7 -4
- package/dist/esm/updateTheme.js.map +1 -1
- package/dist/esm/views/FontLanguage.js +5 -4
- package/dist/esm/views/FontLanguage.js.map +1 -1
- package/dist/esm/views/FontLanguage.native.js +6 -4
- package/dist/esm/views/FontLanguage.native.js.map +1 -1
- package/dist/esm/views/Slot.js +12 -7
- package/dist/esm/views/Slot.js.map +1 -1
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.js +17 -11
- package/dist/esm/views/TamaguiProvider.js.map +1 -1
- package/dist/esm/views/Text.js.map +1 -1
- package/dist/esm/views/Theme.js +21 -10
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +6 -4
- package/dist/esm/views/ThemeInverse.js.map +1 -1
- package/dist/esm/views/ThemeProvider.js +10 -7
- package/dist/esm/views/ThemeProvider.js.map +1 -1
- package/dist/esm/views/ThemeReset.js +5 -3
- package/dist/esm/views/ThemeReset.js.map +1 -1
- package/package.json +10 -10
- package/src/constants/platform.ts +1 -0
- package/src/createComponent.tsx +246 -57
- package/src/createFont.ts +4 -1
- package/src/createVariable.ts +2 -1
- package/src/helpers/createMediaStyle.ts +2 -2
- package/src/helpers/getSplitStyles.tsx +73 -65
- package/src/helpers/mergeTransform.ts +2 -0
- package/src/insertFont.ts +2 -1
- package/src/types.tsx +7 -5
- package/types/createVariable.d.ts +1 -1
- package/types/helpers/getSplitStyles.d.ts +1 -0
- package/types/hooks/useFeatures.d.ts +0 -1
- package/types/types.d.ts +11 -3
- package/src/helpers/cssHash.ts +0 -28
- package/src/hooks/useFeatures.tsx +0 -289
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var createComponent_exports = {};
|
|
23
26
|
__export(createComponent_exports, {
|
|
@@ -30,6 +33,7 @@ __export(createComponent_exports, {
|
|
|
30
33
|
spacedChildren: () => spacedChildren
|
|
31
34
|
});
|
|
32
35
|
module.exports = __toCommonJS(createComponent_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
37
|
var import_helpers = require("@tamagui/helpers");
|
|
34
38
|
var import_rnw = require("@tamagui/rnw");
|
|
35
39
|
var import_use_force_update = require("@tamagui/use-force-update");
|
|
@@ -48,7 +52,6 @@ var import_getSplitStyles = require("./helpers/getSplitStyles");
|
|
|
48
52
|
var import_insertStyleRule = require("./helpers/insertStyleRule");
|
|
49
53
|
var import_mergeProps = require("./helpers/mergeProps");
|
|
50
54
|
var import_proxyThemeVariables = require("./helpers/proxyThemeVariables");
|
|
51
|
-
var import_useFeatures = require("./hooks/useFeatures");
|
|
52
55
|
var import_useMedia = require("./hooks/useMedia");
|
|
53
56
|
var import_usePressable = require("./hooks/usePressable");
|
|
54
57
|
var import_useServerHooks = require("./hooks/useServerHooks");
|
|
@@ -82,6 +85,7 @@ function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
|
82
85
|
}
|
|
83
86
|
let initialTheme;
|
|
84
87
|
let config;
|
|
88
|
+
let mediaPropNames = [];
|
|
85
89
|
function createComponent(configIn, ParentComponent) {
|
|
86
90
|
const staticConfig = (() => {
|
|
87
91
|
const next = (0, import_extendStaticConfig.extendStaticConfig)(configIn, ParentComponent);
|
|
@@ -101,7 +105,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
101
105
|
let tamaguiDefaultProps;
|
|
102
106
|
let initialSplitStyles;
|
|
103
107
|
const component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
|
|
104
|
-
var _a, _b, _c, _d;
|
|
108
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
105
109
|
let props;
|
|
106
110
|
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
107
111
|
props = (0, import_mergeProps.mergeProps)(tamaguiDefaultProps, propsIn)[0];
|
|
@@ -131,7 +135,15 @@ function createComponent(configIn, ParentComponent) {
|
|
|
131
135
|
resolveVariablesAs: "value"
|
|
132
136
|
};
|
|
133
137
|
const languageContext = import_platform.isRSC ? null : (0, import_react.useContext)(import_FontLanguageContext.FontLanguageContext);
|
|
134
|
-
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(
|
|
138
|
+
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(
|
|
139
|
+
props,
|
|
140
|
+
staticConfig,
|
|
141
|
+
theme,
|
|
142
|
+
splitStyleState,
|
|
143
|
+
props.asChild ? null : initialSplitStyles == null ? void 0 : initialSplitStyles.classNames,
|
|
144
|
+
languageContext || void 0,
|
|
145
|
+
props["debug"]
|
|
146
|
+
);
|
|
135
147
|
const hostRef = (0, import_useServerHooks.useServerRef)(null);
|
|
136
148
|
const setState = states[1];
|
|
137
149
|
const setStateShallow = (0, import_createShallowUpdate.createShallowUpdate)(setState);
|
|
@@ -150,23 +162,76 @@ function createComponent(configIn, ParentComponent) {
|
|
|
150
162
|
}
|
|
151
163
|
}
|
|
152
164
|
}
|
|
153
|
-
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
165
|
+
const { viewProps: viewPropsIn, pseudos, medias, style, classNames, mediaKeys } = splitStyles;
|
|
166
|
+
(0, import_platform.useIsomorphicLayoutEffect)(() => {
|
|
167
|
+
for (const key of mediaKeys) {
|
|
168
|
+
(0, import_useMedia.addMediaQueryListener)(key, forceUpdate);
|
|
169
|
+
}
|
|
170
|
+
return () => {
|
|
171
|
+
for (const key of mediaKeys) {
|
|
172
|
+
(0, import_useMedia.removeMediaQueryListener)(key, forceUpdate);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}, [mediaKeys.join(",")]);
|
|
154
176
|
const useAnimations = (_a = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
155
177
|
const isAnimated = !!(useAnimations && props.animation);
|
|
156
178
|
const hasEnterStyle = !!props.enterStyle;
|
|
157
179
|
const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...style } : null;
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
180
|
+
const propsWithAnimation = props;
|
|
181
|
+
if (!import_platform.isRSC && isAnimated) {
|
|
182
|
+
const animationState = useAnimations(propsWithAnimation, {
|
|
183
|
+
state,
|
|
184
|
+
pseudos,
|
|
185
|
+
onDidAnimate: props.onDidAnimate,
|
|
186
|
+
hostRef,
|
|
187
|
+
staticConfig,
|
|
188
|
+
getStyle({ isExiting, isEntering, exitVariant, enterVariant } = {}) {
|
|
189
|
+
var _a2, _b2, _c2, _d2;
|
|
190
|
+
const style2 = animationFeatureStylesIn;
|
|
191
|
+
const enterStyle = isEntering ? enterVariant && ((_a2 = staticConfig.variants) == null ? void 0 : _a2[enterVariant]["true"]) ? (0, import_getSplitStyles.getSubStyle)(
|
|
192
|
+
"",
|
|
193
|
+
(_b2 = staticConfig.variants) == null ? void 0 : _b2[enterVariant]["true"],
|
|
194
|
+
staticConfig,
|
|
195
|
+
theme,
|
|
196
|
+
props,
|
|
197
|
+
state,
|
|
198
|
+
tamaguiConfig
|
|
199
|
+
) || pseudos.enterStyle : pseudos.enterStyle : null;
|
|
200
|
+
const exitStyle = isExiting ? exitVariant && ((_c2 = staticConfig.variants) == null ? void 0 : _c2[exitVariant]["true"]) ? (0, import_getSplitStyles.getSubStyle)(
|
|
201
|
+
"",
|
|
202
|
+
(_d2 = staticConfig.variants) == null ? void 0 : _d2[exitVariant]["true"],
|
|
203
|
+
staticConfig,
|
|
204
|
+
theme,
|
|
205
|
+
props,
|
|
206
|
+
state,
|
|
207
|
+
tamaguiConfig
|
|
208
|
+
) || pseudos.exitStyle : pseudos.exitStyle : null;
|
|
209
|
+
ensureBaseHasDefaults(
|
|
210
|
+
style2,
|
|
211
|
+
pseudos.hoverStyle,
|
|
212
|
+
pseudos.focusStyle,
|
|
213
|
+
pseudos.pressStyle,
|
|
214
|
+
pseudos.pressStyle
|
|
215
|
+
);
|
|
216
|
+
enterStyle && isEntering && merge(style2, enterStyle);
|
|
217
|
+
state.hover && pseudos.hoverStyle && merge(style2, pseudos.hoverStyle);
|
|
218
|
+
state.focus && pseudos.focusStyle && merge(style2, pseudos.focusStyle);
|
|
219
|
+
state.press && pseudos.pressStyle && merge(style2, pseudos.pressStyle);
|
|
220
|
+
exitStyle && isExiting && merge(style2, exitStyle);
|
|
221
|
+
if (process.env.NODE_ENV === "development") {
|
|
222
|
+
if (props["debug"]) {
|
|
223
|
+
console.log("animation style", style2);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return style2;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
if (animationState !== state.animation) {
|
|
230
|
+
setStateShallow({
|
|
231
|
+
animation: animationState
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
170
235
|
const {
|
|
171
236
|
tag,
|
|
172
237
|
hitSlop,
|
|
@@ -298,7 +363,21 @@ function createComponent(configIn, ParentComponent) {
|
|
|
298
363
|
onStartShouldSetResponderCapture
|
|
299
364
|
});
|
|
300
365
|
const platformMethodsRef = (0, import_rnw.usePlatformMethods)(viewProps);
|
|
301
|
-
const
|
|
366
|
+
const shouldSetMounted = Boolean(
|
|
367
|
+
import_platform.isClient && (hasEnterStyle || props.animation) && !state.mounted
|
|
368
|
+
);
|
|
369
|
+
const setRef = (0, import_rnw.useMergeRefs)(
|
|
370
|
+
hostRef,
|
|
371
|
+
platformMethodsRef,
|
|
372
|
+
forwardedRef,
|
|
373
|
+
shouldSetMounted ? () => {
|
|
374
|
+
setTimeout(() => {
|
|
375
|
+
setStateShallow({
|
|
376
|
+
mounted: true
|
|
377
|
+
});
|
|
378
|
+
}, 10);
|
|
379
|
+
} : void 0
|
|
380
|
+
);
|
|
302
381
|
viewProps.ref = setRef;
|
|
303
382
|
}
|
|
304
383
|
if (props.href != void 0 && hrefAttrs != void 0) {
|
|
@@ -343,26 +422,13 @@ function createComponent(configIn, ParentComponent) {
|
|
|
343
422
|
}
|
|
344
423
|
});
|
|
345
424
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
425
|
+
if (!import_platform.isRSC) {
|
|
426
|
+
(0, import_react.useEffect)(() => {
|
|
427
|
+
return () => {
|
|
428
|
+
mouseUps.delete(unPress);
|
|
429
|
+
};
|
|
430
|
+
}, []);
|
|
351
431
|
}
|
|
352
|
-
(0, import_platform.useIsomorphicLayoutEffect)(() => {
|
|
353
|
-
if (import_platform.isClient && (hasEnterStyle || props.animation) && !state.mounted) {
|
|
354
|
-
setStateShallow({
|
|
355
|
-
mounted: true
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
internal.current.isMounted = true;
|
|
359
|
-
return () => {
|
|
360
|
-
var _a2;
|
|
361
|
-
mouseUps.delete(unPress);
|
|
362
|
-
internal.current.isMounted = false;
|
|
363
|
-
(_a2 = internal.current.unmountEffects) == null ? void 0 : _a2.forEach((cb) => cb());
|
|
364
|
-
};
|
|
365
|
-
}, [hasEnterStyle, props.animation]);
|
|
366
432
|
let styles;
|
|
367
433
|
const animationStyles = state.animation ? state.animation.style : null;
|
|
368
434
|
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
@@ -379,11 +445,10 @@ function createComponent(configIn, ParentComponent) {
|
|
|
379
445
|
];
|
|
380
446
|
if (!animationStyles && initialSplitStyles) {
|
|
381
447
|
const initPseudos = initialSplitStyles.pseudos;
|
|
382
|
-
const force = shouldForcePseudo;
|
|
383
448
|
!state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, "enterStyle");
|
|
384
|
-
state.hover && addPseudoToStyles(styles, initPseudos, pseudos, "hoverStyle",
|
|
385
|
-
state.focus && addPseudoToStyles(styles, initPseudos, pseudos, "focusStyle",
|
|
386
|
-
state.press && addPseudoToStyles(styles, initPseudos, pseudos, "pressStyle",
|
|
449
|
+
state.hover && addPseudoToStyles(styles, initPseudos, pseudos, "hoverStyle", shouldForcePseudo);
|
|
450
|
+
state.focus && addPseudoToStyles(styles, initPseudos, pseudos, "focusStyle", shouldForcePseudo);
|
|
451
|
+
state.press && addPseudoToStyles(styles, initPseudos, pseudos, "pressStyle", shouldForcePseudo);
|
|
387
452
|
}
|
|
388
453
|
if (shouldForcePseudo) {
|
|
389
454
|
const next = {};
|
|
@@ -427,7 +492,31 @@ function createComponent(configIn, ParentComponent) {
|
|
|
427
492
|
viewProps.className = className;
|
|
428
493
|
}
|
|
429
494
|
viewProps.style = style2;
|
|
430
|
-
}
|
|
495
|
+
}
|
|
496
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
497
|
+
if (splitStyles.fontFamily) {
|
|
498
|
+
const faceInfo = (_b = config.fontsParsed[splitStyles.fontFamily]) == null ? void 0 : _b.face;
|
|
499
|
+
if (faceInfo) {
|
|
500
|
+
const [weight, style2] = (() => {
|
|
501
|
+
var _a2, _b2;
|
|
502
|
+
let weight2;
|
|
503
|
+
let style3;
|
|
504
|
+
for (let i = styles.length; i >= 0; i--) {
|
|
505
|
+
weight2 ?? (weight2 = (_a2 = styles[i]) == null ? void 0 : _a2.fontWeight);
|
|
506
|
+
style3 ?? (style3 = (_b2 = styles[i]) == null ? void 0 : _b2.fontStyle);
|
|
507
|
+
}
|
|
508
|
+
return [weight2 || "400", style3 || "normal"];
|
|
509
|
+
})();
|
|
510
|
+
const overrideFace = (_d = (_c = faceInfo[weight]) == null ? void 0 : _c[style2]) == null ? void 0 : _d.val;
|
|
511
|
+
if (overrideFace) {
|
|
512
|
+
for (const style3 of styles) {
|
|
513
|
+
if (style3 == null ? void 0 : style3.fontFamily) {
|
|
514
|
+
style3.fontFamily = overrideFace;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
431
520
|
viewProps.style = styles;
|
|
432
521
|
}
|
|
433
522
|
const initialPseudos = initialSplitStyles == null ? void 0 : initialSplitStyles.pseudos;
|
|
@@ -440,8 +529,6 @@ function createComponent(configIn, ParentComponent) {
|
|
|
440
529
|
const pressOutKey = handlesPressEvents ? "onPressOut" : "onMouseUp";
|
|
441
530
|
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));
|
|
442
531
|
const unPress = (0, import_react.useCallback)(() => {
|
|
443
|
-
if (!internal.current.isMounted)
|
|
444
|
-
return;
|
|
445
532
|
setStateShallow({
|
|
446
533
|
press: false,
|
|
447
534
|
pressIn: false
|
|
@@ -504,7 +591,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
504
591
|
} : null,
|
|
505
592
|
...!import_platform.isWeb && {
|
|
506
593
|
cancelable: !props.rejectResponderTermination,
|
|
507
|
-
disabled: props.disabled !== null ? props.disabled : (
|
|
594
|
+
disabled: props.disabled !== null ? props.disabled : (_e = props.accessibilityState) == null ? void 0 : _e.disabled,
|
|
508
595
|
hitSlop: props.hitSlop,
|
|
509
596
|
delayLongPress: props.delayLongPress,
|
|
510
597
|
delayPressIn: props.delayPressIn,
|
|
@@ -514,7 +601,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
514
601
|
}
|
|
515
602
|
} : null;
|
|
516
603
|
let space = spaceProp;
|
|
517
|
-
if (
|
|
604
|
+
if (mediaKeys.length) {
|
|
518
605
|
for (const key in import_useMedia.mediaState) {
|
|
519
606
|
if (!import_useMedia.mediaState[key])
|
|
520
607
|
continue;
|
|
@@ -524,15 +611,21 @@ function createComponent(configIn, ParentComponent) {
|
|
|
524
611
|
}
|
|
525
612
|
}
|
|
526
613
|
const themeManager = (0, import_useTheme.getThemeManager)(theme);
|
|
527
|
-
const shouldSetChildrenThemeToParent = Boolean(
|
|
614
|
+
const shouldSetChildrenThemeToParent = Boolean(
|
|
615
|
+
themeShallow && themeManager && themeManager.didChangeTheme
|
|
616
|
+
);
|
|
528
617
|
const shouldProvideThemeManager = shouldSetChildrenThemeToParent || themeManager && themeManager.didChangeTheme;
|
|
529
|
-
const childEls = !children || asChild ? children : (0, import_Theme.wrapThemeManagerContext)(
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
618
|
+
const childEls = !children || asChild ? children : (0, import_Theme.wrapThemeManagerContext)(
|
|
619
|
+
spacedChildren({
|
|
620
|
+
separator,
|
|
621
|
+
children,
|
|
622
|
+
space,
|
|
623
|
+
direction: props.spaceDirection || "both",
|
|
624
|
+
isZStack
|
|
625
|
+
}),
|
|
626
|
+
shouldProvideThemeManager ? themeManager : void 0,
|
|
627
|
+
shouldSetChildrenThemeToParent
|
|
628
|
+
);
|
|
536
629
|
let content;
|
|
537
630
|
if (asChild) {
|
|
538
631
|
elementType = import_Slot.Slot;
|
|
@@ -544,17 +637,19 @@ function createComponent(configIn, ParentComponent) {
|
|
|
544
637
|
};
|
|
545
638
|
}
|
|
546
639
|
if (!import_platform.isRSC && import_platform.isWeb) {
|
|
547
|
-
const [pressableProps] = (0, import_usePressable.usePressable)(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
hitSlop
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
640
|
+
const [pressableProps] = (0, import_usePressable.usePressable)(
|
|
641
|
+
events ? {
|
|
642
|
+
disabled,
|
|
643
|
+
...hitSlop && {
|
|
644
|
+
hitSlop
|
|
645
|
+
},
|
|
646
|
+
onPressOut: events[pressOutKey],
|
|
647
|
+
onPressIn: events[pressInKey],
|
|
648
|
+
onPress: events[pressKey]
|
|
649
|
+
} : {
|
|
650
|
+
disabled: true
|
|
651
|
+
}
|
|
652
|
+
);
|
|
558
653
|
if (events) {
|
|
559
654
|
if (handlesPressEvents) {
|
|
560
655
|
Object.assign(viewProps, pressableProps);
|
|
@@ -591,12 +686,12 @@ function createComponent(configIn, ParentComponent) {
|
|
|
591
686
|
content = (0, import_react.createElement)(elementType, viewProps, childEls);
|
|
592
687
|
if (process.env.TAMAGUI_TARGET === "web") {
|
|
593
688
|
const isAnimatedRNWView = isAnimated && typeof elementType !== "string";
|
|
594
|
-
const shouldWrapWithComponentTheme = isAnimatedRNWView && (0, import_createPropMapper.getReturnVariablesAs)(props, splitStyleState) === "non-color-value";
|
|
689
|
+
const shouldWrapWithComponentTheme = !!theme.className && isAnimatedRNWView && (0, import_createPropMapper.getReturnVariablesAs)(props, splitStyleState) === "non-color-value";
|
|
595
690
|
const shouldWrapWithHover = Boolean(events || import_platform.isRSC) && attachHover;
|
|
596
691
|
if (shouldWrapWithHover || shouldWrapWithComponentTheme) {
|
|
597
692
|
const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : "";
|
|
598
693
|
const hoverClassName = shouldWrapWithHover ? "t_Hoverable" : "";
|
|
599
|
-
content = /* @__PURE__ */
|
|
694
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
600
695
|
className: `${hoverClassName} ${themeClassName}`,
|
|
601
696
|
style: {
|
|
602
697
|
display: "contents"
|
|
@@ -604,8 +699,9 @@ function createComponent(configIn, ParentComponent) {
|
|
|
604
699
|
...events && shouldWrapWithHover && {
|
|
605
700
|
onMouseEnter: events.onMouseEnter,
|
|
606
701
|
onMouseLeave: events.onMouseLeave
|
|
607
|
-
}
|
|
608
|
-
|
|
702
|
+
},
|
|
703
|
+
children: content
|
|
704
|
+
});
|
|
609
705
|
}
|
|
610
706
|
}
|
|
611
707
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -618,12 +714,12 @@ function createComponent(configIn, ParentComponent) {
|
|
|
618
714
|
console.log("children", content);
|
|
619
715
|
console.groupEnd();
|
|
620
716
|
if (typeof window !== "undefined") {
|
|
621
|
-
console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: (
|
|
717
|
+
console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: (_f = props.className) == null ? void 0 : _f.split(" "), classNamesOut: (_g = viewProps.className) == null ? void 0 : _g.split(" "), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...typeof window !== "undefined" ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, (0, import_insertStyleRule.getAllSelectors)()[v]])) } : null });
|
|
622
718
|
}
|
|
623
719
|
console.groupEnd();
|
|
624
720
|
}
|
|
625
721
|
}
|
|
626
|
-
return
|
|
722
|
+
return content;
|
|
627
723
|
});
|
|
628
724
|
if (staticConfig.componentName) {
|
|
629
725
|
component.displayName = staticConfig.componentName;
|
|
@@ -643,23 +739,41 @@ function createComponent(configIn, ParentComponent) {
|
|
|
643
739
|
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
644
740
|
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
645
741
|
if (config.defaultProps && parentNames && staticConfig.componentName) {
|
|
646
|
-
defaultPropsIn = mergeConfigDefaultProps(
|
|
742
|
+
defaultPropsIn = mergeConfigDefaultProps(
|
|
743
|
+
staticConfig.componentName,
|
|
744
|
+
defaultPropsIn,
|
|
745
|
+
config.defaultProps,
|
|
746
|
+
parentNames,
|
|
747
|
+
conf
|
|
748
|
+
);
|
|
647
749
|
}
|
|
648
750
|
const debug = true ? defaultPropsIn["debug"] : false;
|
|
649
751
|
if (process.env.NODE_ENV === "development" && debug === "break") {
|
|
650
752
|
debugger;
|
|
651
753
|
}
|
|
652
754
|
const [parentProps, parentClassNames] = (0, import_mergeProps.mergeProps)(defaultPropsIn, {}, true);
|
|
653
|
-
initialSplitStyles = (0, import_getSplitStyles.insertSplitStyles)(
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
755
|
+
initialSplitStyles = (0, import_getSplitStyles.insertSplitStyles)(
|
|
756
|
+
parentProps,
|
|
757
|
+
staticConfig,
|
|
758
|
+
initialTheme,
|
|
759
|
+
{
|
|
760
|
+
mounted: true,
|
|
761
|
+
hover: false,
|
|
762
|
+
press: false,
|
|
763
|
+
pressIn: false,
|
|
764
|
+
focus: false,
|
|
765
|
+
resolveVariablesAs: "both",
|
|
766
|
+
keepVariantsAsProps: true
|
|
767
|
+
},
|
|
768
|
+
void 0,
|
|
769
|
+
void 0,
|
|
770
|
+
debug
|
|
771
|
+
);
|
|
772
|
+
const [defaults2, defaultsClassnames] = (0, import_mergeProps.mergeProps)(
|
|
773
|
+
component.defaultProps,
|
|
774
|
+
initialSplitStyles.viewProps,
|
|
775
|
+
true
|
|
776
|
+
);
|
|
663
777
|
initialSplitStyles.classNames = {
|
|
664
778
|
...parentClassNames,
|
|
665
779
|
...defaultsClassnames,
|
|
@@ -673,7 +787,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
673
787
|
if (import_helpers.validPseudoKeys[key])
|
|
674
788
|
continue;
|
|
675
789
|
if (typeof val === "string" && val[0] === "$" || !validStyles2[key]) {
|
|
676
|
-
|
|
790
|
+
defaults2[key] = val;
|
|
677
791
|
} else {
|
|
678
792
|
defaultNativeStyle[key] = val;
|
|
679
793
|
}
|
|
@@ -682,8 +796,8 @@ function createComponent(configIn, ParentComponent) {
|
|
|
682
796
|
defaultNativeStyleSheet = import_react_native.StyleSheet.create({
|
|
683
797
|
base: defaultNativeStyle
|
|
684
798
|
});
|
|
685
|
-
if (Object.keys(
|
|
686
|
-
tamaguiDefaultProps =
|
|
799
|
+
if (Object.keys(defaults2).length) {
|
|
800
|
+
tamaguiDefaultProps = defaults2;
|
|
687
801
|
}
|
|
688
802
|
if (process.env.NODE_ENV === "development" && debug) {
|
|
689
803
|
if (process.env.IS_STATIC !== "is_static") {
|
|
@@ -692,7 +806,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
692
806
|
initialSplitStyles,
|
|
693
807
|
tamaguiDefaultProps,
|
|
694
808
|
defaultNativeStyle,
|
|
695
|
-
defaults,
|
|
809
|
+
defaults: defaults2,
|
|
696
810
|
defaultPropsIn
|
|
697
811
|
});
|
|
698
812
|
}
|
|
@@ -707,16 +821,19 @@ function createComponent(configIn, ParentComponent) {
|
|
|
707
821
|
...staticConfig
|
|
708
822
|
};
|
|
709
823
|
res.extractable = (Component, conf) => {
|
|
710
|
-
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)(
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
824
|
+
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)(
|
|
825
|
+
{
|
|
826
|
+
Component,
|
|
827
|
+
...conf,
|
|
828
|
+
neverFlatten: true,
|
|
829
|
+
isExtractable: true,
|
|
830
|
+
defaultProps: {
|
|
831
|
+
...Component.defaultProps,
|
|
832
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
res
|
|
836
|
+
);
|
|
720
837
|
return Component;
|
|
721
838
|
};
|
|
722
839
|
return res;
|
|
@@ -791,9 +908,13 @@ function spacedChildren({
|
|
|
791
908
|
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
792
909
|
final.push(child);
|
|
793
910
|
} else {
|
|
794
|
-
final.push(
|
|
795
|
-
|
|
796
|
-
|
|
911
|
+
final.push(
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, {
|
|
913
|
+
children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, {
|
|
914
|
+
children: child
|
|
915
|
+
}) : child
|
|
916
|
+
}, index)
|
|
917
|
+
);
|
|
797
918
|
}
|
|
798
919
|
if (isUnspaced(child) && index === 0) {
|
|
799
920
|
continue;
|
|
@@ -805,53 +926,61 @@ function spacedChildren({
|
|
|
805
926
|
if (next && !isUnspaced(next)) {
|
|
806
927
|
if (separator) {
|
|
807
928
|
if (hasSpace) {
|
|
808
|
-
final.push(
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
929
|
+
final.push(
|
|
930
|
+
createSpacer({
|
|
931
|
+
key: `_${index}_before_sep_spacer`,
|
|
932
|
+
direction,
|
|
933
|
+
space,
|
|
934
|
+
spaceFlex
|
|
935
|
+
})
|
|
936
|
+
);
|
|
814
937
|
}
|
|
815
|
-
final.push(
|
|
938
|
+
final.push(
|
|
939
|
+
import_react.default.isValidElement(separator) ? import_react.default.cloneElement(separator, { key: `sep_${index}` }) : separator
|
|
940
|
+
);
|
|
816
941
|
if (hasSpace) {
|
|
817
|
-
final.push(
|
|
818
|
-
|
|
942
|
+
final.push(
|
|
943
|
+
createSpacer({
|
|
944
|
+
key: `_${index}_after_sep_spacer`,
|
|
945
|
+
direction,
|
|
946
|
+
space,
|
|
947
|
+
spaceFlex
|
|
948
|
+
})
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
} else {
|
|
952
|
+
final.push(
|
|
953
|
+
createSpacer({
|
|
954
|
+
key: `_${index}_spacer`,
|
|
819
955
|
direction,
|
|
820
956
|
space,
|
|
821
957
|
spaceFlex
|
|
822
|
-
})
|
|
823
|
-
|
|
824
|
-
} else {
|
|
825
|
-
final.push(createSpacer({
|
|
826
|
-
key: `_${index}_spacer`,
|
|
827
|
-
direction,
|
|
828
|
-
space,
|
|
829
|
-
spaceFlex
|
|
830
|
-
}));
|
|
958
|
+
})
|
|
959
|
+
);
|
|
831
960
|
}
|
|
832
961
|
}
|
|
833
962
|
}
|
|
834
963
|
return final;
|
|
835
964
|
}
|
|
836
965
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
837
|
-
return /* @__PURE__ */
|
|
838
|
-
key,
|
|
966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {
|
|
839
967
|
size: space,
|
|
840
968
|
direction,
|
|
841
969
|
...spaceFlex && {
|
|
842
970
|
flex: spaceFlex
|
|
843
971
|
}
|
|
844
|
-
});
|
|
972
|
+
}, key);
|
|
845
973
|
}
|
|
846
974
|
function isUnspaced(child) {
|
|
847
975
|
var _a, _b;
|
|
848
976
|
return ((_a = child == null ? void 0 : child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) || ((_b = child == null ? void 0 : child["type"]) == null ? void 0 : _b["isUnspaced"]);
|
|
849
977
|
}
|
|
850
978
|
function AbsoluteFill(props) {
|
|
851
|
-
return /* @__PURE__ */
|
|
979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
852
980
|
pointerEvents: "box-none",
|
|
853
|
-
style: import_react_native.StyleSheet.absoluteFill
|
|
854
|
-
|
|
981
|
+
style: import_react_native.StyleSheet.absoluteFill,
|
|
982
|
+
children: props.children
|
|
983
|
+
});
|
|
855
984
|
}
|
|
856
985
|
function processIDRefList(idRefList) {
|
|
857
986
|
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
@@ -907,6 +1036,69 @@ function mergeConfigDefaultProps(name, props, configDefaults, parentNames, conf)
|
|
|
907
1036
|
}
|
|
908
1037
|
return props;
|
|
909
1038
|
}
|
|
1039
|
+
const defaults = {
|
|
1040
|
+
left: 0,
|
|
1041
|
+
right: 0,
|
|
1042
|
+
top: 0,
|
|
1043
|
+
bottom: 0,
|
|
1044
|
+
opacity: 1,
|
|
1045
|
+
translateX: 0,
|
|
1046
|
+
translateY: 0,
|
|
1047
|
+
skew: 0,
|
|
1048
|
+
skewX: 0,
|
|
1049
|
+
skewY: 0,
|
|
1050
|
+
scale: 1,
|
|
1051
|
+
rotate: "0deg",
|
|
1052
|
+
rotateY: "0deg",
|
|
1053
|
+
rotateX: "0deg"
|
|
1054
|
+
};
|
|
1055
|
+
function ensureBaseHasDefaults(base, ...pseudos) {
|
|
1056
|
+
for (const pseudo of pseudos) {
|
|
1057
|
+
if (!pseudo)
|
|
1058
|
+
continue;
|
|
1059
|
+
for (const key in pseudo) {
|
|
1060
|
+
const val = pseudo[key];
|
|
1061
|
+
if (key === "transform") {
|
|
1062
|
+
if (typeof val === "string") {
|
|
1063
|
+
continue;
|
|
1064
|
+
}
|
|
1065
|
+
for (const t of val) {
|
|
1066
|
+
const tkey = Object.keys(t)[0];
|
|
1067
|
+
const defaultVal = defaults[tkey];
|
|
1068
|
+
const tDefaultVal = { [tkey]: defaultVal };
|
|
1069
|
+
if (!base.transform) {
|
|
1070
|
+
base.transform = [tDefaultVal];
|
|
1071
|
+
} else {
|
|
1072
|
+
if (!base.transform.find((x) => x[tkey])) {
|
|
1073
|
+
base.transform.push(tDefaultVal);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
} else {
|
|
1078
|
+
if (!(key in base)) {
|
|
1079
|
+
base[key] = defaults[key];
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
function merge(base, next) {
|
|
1086
|
+
if (!next.transform || !base.transform) {
|
|
1087
|
+
Object.assign(base, next);
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
const { transform, ...rest } = next;
|
|
1091
|
+
Object.assign(base, rest);
|
|
1092
|
+
for (const t of transform) {
|
|
1093
|
+
const key = Object.keys(t)[0];
|
|
1094
|
+
const existing = base.transform.find((x) => key in x);
|
|
1095
|
+
if (existing) {
|
|
1096
|
+
existing[key] = t[key];
|
|
1097
|
+
} else {
|
|
1098
|
+
base.transform.push(t);
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
910
1102
|
// Annotate the CommonJS export names for ESM import in node:
|
|
911
1103
|
0 && (module.exports = {
|
|
912
1104
|
Spacer,
|