tamagui 1.85.3 → 1.85.4
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/native.js +129 -212
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +110 -166
- package/dist/test.native.js.map +3 -3
- package/package.json +53 -53
package/dist/test.native.js
CHANGED
|
@@ -1476,7 +1476,7 @@ var require_pseudoDescriptors_native = __commonJS({
|
|
|
1476
1476
|
...pseudoDescriptorsBase,
|
|
1477
1477
|
enterStyle: {
|
|
1478
1478
|
name: "enter",
|
|
1479
|
-
|
|
1479
|
+
selector: ".t_unmounted",
|
|
1480
1480
|
priority: 4
|
|
1481
1481
|
},
|
|
1482
1482
|
exitStyle: {
|
|
@@ -1962,10 +1962,10 @@ var require_createShallowSetState_native = __commonJS({
|
|
|
1962
1962
|
mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
|
|
1963
1963
|
});
|
|
1964
1964
|
module2.exports = __toCommonJS2(createShallowSetState_exports);
|
|
1965
|
-
function createShallowSetState(setter) {
|
|
1966
|
-
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next));
|
|
1965
|
+
function createShallowSetState(setter, debug) {
|
|
1966
|
+
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
|
|
1967
1967
|
}
|
|
1968
|
-
function mergeIfNotShallowEqual(prev, next) {
|
|
1968
|
+
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
1969
1969
|
return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
|
|
1970
1970
|
}
|
|
1971
1971
|
function isEqualShallow(prev, next) {
|
|
@@ -3302,7 +3302,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3302
3302
|
inlineWhenUnflattened,
|
|
3303
3303
|
parentStaticConfig,
|
|
3304
3304
|
acceptsClassName
|
|
3305
|
-
} = staticConfig, viewProps = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = "", mediaStylesSeen = 0, styleState = {
|
|
3305
|
+
} = staticConfig, viewProps = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = props.className ?? "", mediaStylesSeen = 0, styleState = {
|
|
3306
3306
|
curProps: { ...props },
|
|
3307
3307
|
classNames,
|
|
3308
3308
|
conf,
|
|
@@ -3409,13 +3409,14 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3409
3409
|
Object.assign(pseudos[key], pseudoStyleObject);
|
|
3410
3410
|
continue;
|
|
3411
3411
|
}
|
|
3412
|
-
if (shouldDoClasses && !
|
|
3412
|
+
if (shouldDoClasses && !isExit) {
|
|
3413
3413
|
let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
|
|
3414
3414
|
for (let psuedoStyle of pseudoStyles)
|
|
3415
3415
|
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
3416
|
-
}
|
|
3417
|
-
|
|
3418
|
-
|
|
3416
|
+
}
|
|
3417
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
3418
|
+
let descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
3419
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted);
|
|
3419
3420
|
let importance = descriptor.priority;
|
|
3420
3421
|
for (let pkey in pseudoStyleObject) {
|
|
3421
3422
|
let val2 = pseudoStyleObject[pkey];
|
|
@@ -3718,37 +3719,6 @@ var require_mergeProps_native = __commonJS({
|
|
|
3718
3719
|
}
|
|
3719
3720
|
});
|
|
3720
3721
|
|
|
3721
|
-
// ../web/dist/cjs/helpers/proxyThemeVariables.native.js
|
|
3722
|
-
var require_proxyThemeVariables_native = __commonJS({
|
|
3723
|
-
"../web/dist/cjs/helpers/proxyThemeVariables.native.js"(exports2, module2) {
|
|
3724
|
-
"use strict";
|
|
3725
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
3726
|
-
for (var name in all)
|
|
3727
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
3728
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
3729
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
3730
|
-
for (let key of __getOwnPropNames2(from))
|
|
3731
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
3732
|
-
return to;
|
|
3733
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), proxyThemeVariables_exports = {};
|
|
3734
|
-
__export2(proxyThemeVariables_exports, {
|
|
3735
|
-
proxyThemeVariables: () => proxyThemeVariables
|
|
3736
|
-
});
|
|
3737
|
-
module2.exports = __toCommonJS2(proxyThemeVariables_exports);
|
|
3738
|
-
function proxyThemeVariables(obj) {
|
|
3739
|
-
return new Proxy(obj || {}, {
|
|
3740
|
-
has(target, key) {
|
|
3741
|
-
return Reflect.has(target, removeStarting$(key));
|
|
3742
|
-
},
|
|
3743
|
-
get(target, key) {
|
|
3744
|
-
return Reflect.get(target, removeStarting$(key));
|
|
3745
|
-
}
|
|
3746
|
-
});
|
|
3747
|
-
}
|
|
3748
|
-
var removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
|
|
3749
|
-
}
|
|
3750
|
-
});
|
|
3751
|
-
|
|
3752
3722
|
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
3753
3723
|
var require_ThemeManagerContext_native = __commonJS({
|
|
3754
3724
|
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
@@ -3861,7 +3831,6 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3861
3831
|
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
3862
3832
|
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
3863
3833
|
let base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
3864
|
-
props.debug && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }));
|
|
3865
3834
|
for (let i = max2; i >= min2; i--) {
|
|
3866
3835
|
let prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3867
3836
|
props.inverse && (prefix = inverseThemeName(prefix));
|
|
@@ -3911,7 +3880,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3911
3880
|
break;
|
|
3912
3881
|
}
|
|
3913
3882
|
}
|
|
3914
|
-
return
|
|
3883
|
+
return props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min: min2, max: max2 }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
3915
3884
|
}
|
|
3916
3885
|
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
3917
3886
|
function getManagers(themeManager) {
|
|
@@ -4214,7 +4183,7 @@ var require_Theme_native = __commonJS({
|
|
|
4214
4183
|
let { themeManager, isNewTheme } = themeState;
|
|
4215
4184
|
if (!themeManager)
|
|
4216
4185
|
throw new Error(
|
|
4217
|
-
"\u274C"
|
|
4186
|
+
"\u274C 005"
|
|
4218
4187
|
);
|
|
4219
4188
|
let { shallow, forceClassName } = props, hasEverThemed = (0, import_react2.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
|
|
4220
4189
|
if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
|
|
@@ -4412,7 +4381,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4412
4381
|
spacedChildren: () => spacedChildren2
|
|
4413
4382
|
});
|
|
4414
4383
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
4415
|
-
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_use_did_finish_ssr = require_index_native2(), import_react2 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(),
|
|
4384
|
+
var import_compose_refs = require_index_native10(), import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_use_did_finish_ssr = require_index_native2(), import_react2 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime6 = require("react/jsx-runtime"), mouseUps = /* @__PURE__ */ new Set();
|
|
4416
4385
|
if (typeof document < "u") {
|
|
4417
4386
|
let cancelTouches = () => {
|
|
4418
4387
|
mouseUps.forEach((x) => x()), mouseUps.clear();
|
|
@@ -4422,17 +4391,13 @@ var require_createComponent_native = __commonJS({
|
|
|
4422
4391
|
var BaseText, BaseView, hasSetupBaseViews = !1;
|
|
4423
4392
|
function createComponent2(staticConfig) {
|
|
4424
4393
|
var _a;
|
|
4425
|
-
let config = null, defaultProps = staticConfig.defaultProps;
|
|
4394
|
+
let { componentName } = staticConfig, config = null, defaultProps = staticConfig.defaultProps;
|
|
4426
4395
|
(0, import_config.onConfiguredOnce)((conf) => {
|
|
4427
4396
|
var _a2;
|
|
4428
|
-
if (config = conf,
|
|
4429
|
-
let defaultForComponent = (_a2 = conf.defaultProps) == null ? void 0 : _a2[
|
|
4397
|
+
if (config = conf, componentName) {
|
|
4398
|
+
let defaultForComponent = (_a2 = conf.defaultProps) == null ? void 0 : _a2[componentName];
|
|
4430
4399
|
defaultForComponent && (defaultProps = { ...defaultForComponent, ...defaultProps });
|
|
4431
4400
|
}
|
|
4432
|
-
if (!tamaguiConfig && (tamaguiConfig = conf, !initialTheme)) {
|
|
4433
|
-
let next = conf.themes[Object.keys(conf.themes)[0]];
|
|
4434
|
-
initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next);
|
|
4435
|
-
}
|
|
4436
4401
|
});
|
|
4437
4402
|
let {
|
|
4438
4403
|
Component,
|
|
@@ -4441,8 +4406,8 @@ var require_createComponent_native = __commonJS({
|
|
|
4441
4406
|
isHOC,
|
|
4442
4407
|
validStyles: validStyles2 = {},
|
|
4443
4408
|
variants = {}
|
|
4444
|
-
} = staticConfig,
|
|
4445
|
-
var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m, _n;
|
|
4409
|
+
} = staticConfig, component = (0, import_react2.forwardRef)((propsIn, forwardedRef) => {
|
|
4410
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
4446
4411
|
let internalID = "";
|
|
4447
4412
|
if (!hasSetupBaseViews) {
|
|
4448
4413
|
hasSetupBaseViews = !0;
|
|
@@ -4464,17 +4429,21 @@ var require_createComponent_native = __commonJS({
|
|
|
4464
4429
|
}
|
|
4465
4430
|
let curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps, props = propsIn;
|
|
4466
4431
|
curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
|
|
4467
|
-
let debugProp = props.debug,
|
|
4432
|
+
let debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName, stateRef = (0, import_react2.useRef)(
|
|
4468
4433
|
{}
|
|
4469
|
-
), hostRef = (0, import_react2.useRef)(null), 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,
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4434
|
+
), hostRef = (0, import_react2.useRef)(null), 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_constants4.isServer && willBeAnimatedClient;
|
|
4435
|
+
willBeAnimated && !curState.hasAnimated && (curState.hasAnimated = !0);
|
|
4436
|
+
let isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), presence = willBeAnimated && ((_c = animationsConfig == null ? void 0 : animationsConfig.usePresence) == null ? void 0 : _c.call(animationsConfig)) || null, presenceState = presence == null ? void 0 : presence[2], enterExitVariant = presenceState == null ? void 0 : presenceState.enterExitVariant, enterVariant = enterExitVariant ?? (presenceState == null ? void 0 : presenceState.enterVariant), hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = staticConfig.isReactNative, isAnimated = willBeAnimated;
|
|
4437
|
+
!isReactNative && hasRNAnimation && !isHOC && !isHydrated && (isAnimated = !1, curState.willHydrate = !0);
|
|
4438
|
+
let initialState = hasEnterStyle || enterVariant ? isHydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react2.useState)(initialState), state = props.forceStyle ? { ...states[0], [props.forceStyle]: !0 } : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, debugProp);
|
|
4439
|
+
if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated) {
|
|
4440
|
+
let isExiting2 = !presenceState.isPresent, exitVariant = enterExitVariant ?? presenceState.exitVariant;
|
|
4441
|
+
state.unmounted && enterVariant ? props[enterVariant] = !0 : isExiting2 && exitVariant && (props[exitVariant] = !enterExitVariant);
|
|
4442
|
+
}
|
|
4443
|
+
let shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
|
|
4444
|
+
if (groupName && !curState.group) {
|
|
4476
4445
|
let listeners = /* @__PURE__ */ new Set();
|
|
4477
|
-
|
|
4446
|
+
curState.group = {
|
|
4478
4447
|
listeners,
|
|
4479
4448
|
emit(name, state2) {
|
|
4480
4449
|
listeners.forEach((l) => l(name, state2));
|
|
@@ -4489,7 +4458,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4489
4458
|
if (groupName) {
|
|
4490
4459
|
let groupContextState = componentContext.groups.state, og = setStateShallow;
|
|
4491
4460
|
setStateShallow = (state2) => {
|
|
4492
|
-
og(state2),
|
|
4461
|
+
og(state2), curState.group.emit(groupName, {
|
|
4493
4462
|
pseudo: state2
|
|
4494
4463
|
});
|
|
4495
4464
|
let next = {
|
|
@@ -4499,27 +4468,19 @@ var require_createComponent_native = __commonJS({
|
|
|
4499
4468
|
groupContextState[groupName] = next;
|
|
4500
4469
|
};
|
|
4501
4470
|
}
|
|
4502
|
-
let
|
|
4503
|
-
|
|
4504
|
-
let
|
|
4505
|
-
|
|
4506
|
-
let presenceState = presence[2];
|
|
4507
|
-
if (presenceState) {
|
|
4508
|
-
let isEntering = state.unmounted, isExiting2 = !presenceState.isPresent, enterExitVariant = presenceState.enterExitVariant, enterVariant = enterExitVariant ?? presenceState.enterVariant, exitVariant = enterExitVariant ?? presenceState.exitVariant;
|
|
4509
|
-
isEntering && enterVariant ? props[enterVariant] = !0 : isExiting2 && exitVariant && (props[exitVariant] = !enterExitVariant);
|
|
4510
|
-
}
|
|
4511
|
-
}
|
|
4512
|
-
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants4.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableTheme = isHOC;
|
|
4513
|
-
props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4471
|
+
let componentNameFinal = props.componentName || componentName2, componentClassName = props.asChild || !componentNameFinal ? "" : `is_${componentNameFinal}`, hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_d = props.accessibilityState) == null ? void 0 : _d.disabled), element = import_constants4.isWeb && (!Component || typeof Component == "string") && props.tag || Component, elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
4472
|
+
animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
|
|
4473
|
+
let disableTheme = isHOC;
|
|
4474
|
+
props.themeShallow && (curState.themeShallow = !0);
|
|
4514
4475
|
let themeStateProps = {
|
|
4515
4476
|
name: props.theme,
|
|
4516
|
-
componentName,
|
|
4477
|
+
componentName: componentName2,
|
|
4517
4478
|
disable: disableTheme,
|
|
4518
|
-
shallow:
|
|
4479
|
+
shallow: curState.themeShallow,
|
|
4519
4480
|
inverse: props.themeInverse,
|
|
4520
4481
|
debug: debugProp
|
|
4521
4482
|
};
|
|
4522
|
-
typeof
|
|
4483
|
+
typeof curState.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated;
|
|
4523
4484
|
let isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1, [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
|
|
4524
4485
|
elementType = Component || elementType;
|
|
4525
4486
|
let isStringElement = typeof elementType == "string", mediaState3 = (0, import_useMedia.useMedia)(stateRef, componentContext);
|
|
@@ -4527,18 +4488,17 @@ var require_createComponent_native = __commonJS({
|
|
|
4527
4488
|
let resolveValues = (
|
|
4528
4489
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
4529
4490
|
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
4530
|
-
),
|
|
4491
|
+
), styleProps = {
|
|
4531
4492
|
mediaState: mediaState3,
|
|
4532
4493
|
noClassNames,
|
|
4533
4494
|
resolveValues,
|
|
4534
4495
|
isExiting,
|
|
4535
|
-
isAnimated
|
|
4536
|
-
keepStyleSSR
|
|
4496
|
+
isAnimated
|
|
4537
4497
|
}, splitStyles = (0, import_getSplitStyles.useSplitStyles)(
|
|
4538
4498
|
props,
|
|
4539
4499
|
staticConfig,
|
|
4540
4500
|
theme,
|
|
4541
|
-
((
|
|
4501
|
+
((_e = themeState == null ? void 0 : themeState.state) == null ? void 0 : _e.name) || "",
|
|
4542
4502
|
state,
|
|
4543
4503
|
styleProps,
|
|
4544
4504
|
null,
|
|
@@ -4546,34 +4506,36 @@ var require_createComponent_native = __commonJS({
|
|
|
4546
4506
|
elementType,
|
|
4547
4507
|
debugProp
|
|
4548
4508
|
);
|
|
4549
|
-
props.group && props.untilMeasured === "hide" && !
|
|
4509
|
+
props.group && props.untilMeasured === "hide" && !curState.hasMeasured && (splitStyles.style.opacity = 0), curState.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
4550
4510
|
let isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
|
|
4551
4511
|
(0, import_useMedia.setMediaShouldUpdate)(stateRef, {
|
|
4552
4512
|
enabled: shouldListenForMedia,
|
|
4553
4513
|
keys: mediaListeningKeys
|
|
4554
4514
|
});
|
|
4555
|
-
let
|
|
4515
|
+
let {
|
|
4556
4516
|
viewProps: viewPropsIn,
|
|
4557
4517
|
pseudos,
|
|
4558
4518
|
style: splitStylesStyle,
|
|
4559
4519
|
classNames,
|
|
4560
4520
|
space
|
|
4561
4521
|
} = splitStyles, propsWithAnimation = props, animationStyles;
|
|
4562
|
-
if (
|
|
4522
|
+
if (
|
|
4523
|
+
// if it supports css vars we run it on server too to get matching initial style
|
|
4524
|
+
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
4525
|
+
) {
|
|
4563
4526
|
let animations = useAnimations({
|
|
4564
4527
|
props: propsWithAnimation,
|
|
4565
4528
|
// if hydrating, send empty style
|
|
4566
4529
|
style: splitStylesStyle,
|
|
4567
|
-
// style: splitStylesStyle,
|
|
4568
4530
|
presence,
|
|
4569
4531
|
componentState: state,
|
|
4570
4532
|
styleProps,
|
|
4571
|
-
theme: (
|
|
4533
|
+
theme: (_f = themeState.state) == null ? void 0 : _f.theme,
|
|
4572
4534
|
pseudos: pseudos || null,
|
|
4573
4535
|
hostRef,
|
|
4574
4536
|
staticConfig
|
|
4575
4537
|
});
|
|
4576
|
-
isAnimated && animations && (animationStyles = animations.style);
|
|
4538
|
+
(isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style);
|
|
4577
4539
|
}
|
|
4578
4540
|
let {
|
|
4579
4541
|
asChild,
|
|
@@ -4602,7 +4564,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4602
4564
|
// @ts-ignore
|
|
4603
4565
|
defaultVariants,
|
|
4604
4566
|
...nonTamaguiProps
|
|
4605
|
-
} = viewPropsIn, disabled = ((
|
|
4567
|
+
} = viewPropsIn, disabled = ((_g = props.accessibilityState) == null ? void 0 : _g.disabled) || // @ts-expect-error (comes from core)
|
|
4606
4568
|
props.accessibilityDisabled, viewProps = nonTamaguiProps;
|
|
4607
4569
|
hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
|
|
4608
4570
|
nonTamaguiProps.onLayout,
|
|
@@ -4611,19 +4573,21 @@ var require_createComponent_native = __commonJS({
|
|
|
4611
4573
|
layout: e.nativeEvent.layout
|
|
4612
4574
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState((prev) => ({ ...prev })), stateRef.current.hasMeasured = !0;
|
|
4613
4575
|
}
|
|
4614
|
-
)), viewProps =
|
|
4576
|
+
)), viewProps = ((_i = (_h = import_setupHooks.hooks).usePropsTransform) == null ? void 0 : _i.call(
|
|
4577
|
+
_h,
|
|
4578
|
+
elementType,
|
|
4579
|
+
nonTamaguiProps,
|
|
4580
|
+
hostRef,
|
|
4581
|
+
curState.willHydrate
|
|
4582
|
+
)) ?? nonTamaguiProps;
|
|
4615
4583
|
let composedRef = (0, import_compose_refs.useComposedRefs)(hostRef, forwardedRef);
|
|
4616
4584
|
viewProps.ref = composedRef;
|
|
4617
|
-
let
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
}), shouldSetMounted = needsMount && state.unmounted, { pseudoGroups, mediaGroups } = splitStyles;
|
|
4585
|
+
let { pseudoGroups, mediaGroups } = splitStyles;
|
|
4586
|
+
curState.unPress || (curState.unPress = () => setStateShallow({ press: !1, pressIn: !1 }));
|
|
4587
|
+
let unPress = curState.unPress, shouldEnter = state.unmounted;
|
|
4621
4588
|
(0, import_react2.useEffect)(() => {
|
|
4622
|
-
if (
|
|
4623
|
-
|
|
4624
|
-
setStateShallow({
|
|
4625
|
-
unmounted
|
|
4626
|
-
});
|
|
4589
|
+
if (shouldEnter) {
|
|
4590
|
+
setStateShallow({ unmounted: !1 });
|
|
4627
4591
|
return;
|
|
4628
4592
|
}
|
|
4629
4593
|
let disposeGroupsListener;
|
|
@@ -4656,14 +4620,13 @@ var require_createComponent_native = __commonJS({
|
|
|
4656
4620
|
disposeGroupsListener == null || disposeGroupsListener(), mouseUps.delete(unPress);
|
|
4657
4621
|
};
|
|
4658
4622
|
}, [
|
|
4659
|
-
|
|
4660
|
-
state.unmounted,
|
|
4623
|
+
shouldEnter,
|
|
4661
4624
|
pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
|
|
4662
4625
|
mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
|
|
4663
4626
|
]);
|
|
4664
|
-
let
|
|
4627
|
+
let fontFamily = isText ? splitStyles.fontFamily || ((_j = staticConfig.defaultProps) == null ? void 0 : _j.fontFamily) : null;
|
|
4665
4628
|
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
4666
|
-
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style =
|
|
4629
|
+
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style, className;
|
|
4667
4630
|
asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
|
|
4668
4631
|
let 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_constants4.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), events = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle) && !isDisabled && !props.asChild ? {
|
|
4669
4632
|
onPressOut: attachPress ? (e) => {
|
|
@@ -4715,7 +4678,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4715
4678
|
delayPressOut: viewProps.delayPressOut,
|
|
4716
4679
|
focusable: viewProps.focusable ?? !0,
|
|
4717
4680
|
minPressDuration: 0
|
|
4718
|
-
}), (
|
|
4681
|
+
}), (_l = (_k = import_setupHooks.hooks).useEvents) == null || _l.call(_k, viewProps, events, splitStyles, setStateShallow, staticConfig);
|
|
4719
4682
|
let direction = props.spaceDirection || "both", content = !children || asChild ? children : spacedChildren2({
|
|
4720
4683
|
separator,
|
|
4721
4684
|
children,
|
|
@@ -4733,9 +4696,9 @@ var require_createComponent_native = __commonJS({
|
|
|
4733
4696
|
events,
|
|
4734
4697
|
staticConfig
|
|
4735
4698
|
)), useChildrenResult ? content = useChildrenResult : content = (0, import_react2.createElement)(elementType, viewProps, content);
|
|
4736
|
-
let ResetPresence = (
|
|
4737
|
-
willBeAnimated &&
|
|
4738
|
-
let groupState =
|
|
4699
|
+
let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
|
|
4700
|
+
willBeAnimated && hasEnterStyle && ResetPresence && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content }));
|
|
4701
|
+
let groupState = curState.group, subGroupContext = (0, import_react2.useMemo)(() => {
|
|
4739
4702
|
if (!(!groupState || !groupName))
|
|
4740
4703
|
return groupState.listeners.clear(), {
|
|
4741
4704
|
...componentContext.groups,
|
|
@@ -4743,7 +4706,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4743
4706
|
state: {
|
|
4744
4707
|
...componentContext.groups.state,
|
|
4745
4708
|
[groupName]: {
|
|
4746
|
-
pseudo:
|
|
4709
|
+
pseudo: import_defaultComponentState.defaultComponentStateMounted,
|
|
4747
4710
|
// capture just initial width and height if they exist
|
|
4748
4711
|
// will have top, left, width, height (not x, y)
|
|
4749
4712
|
layout: {
|
|
@@ -5726,6 +5689,37 @@ var require_isTamaguiElement_native = __commonJS({
|
|
|
5726
5689
|
}
|
|
5727
5690
|
});
|
|
5728
5691
|
|
|
5692
|
+
// ../web/dist/cjs/helpers/proxyThemeVariables.native.js
|
|
5693
|
+
var require_proxyThemeVariables_native = __commonJS({
|
|
5694
|
+
"../web/dist/cjs/helpers/proxyThemeVariables.native.js"(exports2, module2) {
|
|
5695
|
+
"use strict";
|
|
5696
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
5697
|
+
for (var name in all)
|
|
5698
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
5699
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
5700
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
5701
|
+
for (let key of __getOwnPropNames2(from))
|
|
5702
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
5703
|
+
return to;
|
|
5704
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), proxyThemeVariables_exports = {};
|
|
5705
|
+
__export2(proxyThemeVariables_exports, {
|
|
5706
|
+
proxyThemeVariables: () => proxyThemeVariables
|
|
5707
|
+
});
|
|
5708
|
+
module2.exports = __toCommonJS2(proxyThemeVariables_exports);
|
|
5709
|
+
function proxyThemeVariables(obj) {
|
|
5710
|
+
return new Proxy(obj || {}, {
|
|
5711
|
+
has(target, key) {
|
|
5712
|
+
return Reflect.has(target, removeStarting$(key));
|
|
5713
|
+
},
|
|
5714
|
+
get(target, key) {
|
|
5715
|
+
return Reflect.get(target, removeStarting$(key));
|
|
5716
|
+
}
|
|
5717
|
+
});
|
|
5718
|
+
}
|
|
5719
|
+
var removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
|
|
5720
|
+
}
|
|
5721
|
+
});
|
|
5722
|
+
|
|
5729
5723
|
// ../web/dist/cjs/internalWithTheme.native.js
|
|
5730
5724
|
var require_internalWithTheme_native = __commonJS({
|
|
5731
5725
|
"../web/dist/cjs/internalWithTheme.native.js"(exports2, module2) {
|
|
@@ -6088,12 +6082,12 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
6088
6082
|
...themePropsProvider
|
|
6089
6083
|
}) {
|
|
6090
6084
|
return (0, import_useMedia.setupMediaListeners)(), import_constants4.isClient && React2.useLayoutEffect(() => {
|
|
6091
|
-
if (document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), disableInjectCSS)
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
}
|
|
6085
|
+
if (config.disableSSR || document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), !disableInjectCSS) {
|
|
6086
|
+
let style = document.createElement("style");
|
|
6087
|
+
return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), () => {
|
|
6088
|
+
document.head.removeChild(style);
|
|
6089
|
+
};
|
|
6090
|
+
}
|
|
6097
6091
|
}, [config, disableInjectCSS]), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { animationDriver: config.animations, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
6098
6092
|
import_ThemeProvider.ThemeProvider,
|
|
6099
6093
|
{
|
|
@@ -7397,7 +7391,7 @@ var require_usePlatformMethods_native = __commonJS({
|
|
|
7397
7391
|
function usePlatformMethods(hostRef) {
|
|
7398
7392
|
(0, import_constants4.useIsomorphicLayoutEffect)(() => {
|
|
7399
7393
|
let node = hostRef.current;
|
|
7400
|
-
node
|
|
7394
|
+
!node || node.measure || (node.measure = (callback) => (0, import_useElementLayout.measureLayout)(node, null, callback), node.measureLayout = (relativeToNode, success) => (0, import_useElementLayout.measureLayout)(node, relativeToNode, success), node.measureInWindow = (callback) => {
|
|
7401
7395
|
node && setTimeout(() => {
|
|
7402
7396
|
let { height, left, top, width } = (0, import_getRect.getRect)(node);
|
|
7403
7397
|
callback(left, top, width, height);
|
|
@@ -7519,57 +7513,7 @@ var require_index_native15 = __commonJS({
|
|
|
7519
7513
|
var baseViews = (0, import_getBaseViews.getBaseViews)();
|
|
7520
7514
|
(0, import_web.setupHooks)({
|
|
7521
7515
|
getBaseViews: import_getBaseViews.getBaseViews,
|
|
7522
|
-
usePropsTransform(elementType, propsIn, hostRef) {
|
|
7523
|
-
let {
|
|
7524
|
-
// event props
|
|
7525
|
-
onMoveShouldSetResponder,
|
|
7526
|
-
onMoveShouldSetResponderCapture,
|
|
7527
|
-
onResponderEnd,
|
|
7528
|
-
onResponderGrant,
|
|
7529
|
-
onResponderMove,
|
|
7530
|
-
onResponderReject,
|
|
7531
|
-
onResponderRelease,
|
|
7532
|
-
onResponderStart,
|
|
7533
|
-
onResponderTerminate,
|
|
7534
|
-
onResponderTerminationRequest,
|
|
7535
|
-
onScrollShouldSetResponder,
|
|
7536
|
-
onScrollShouldSetResponderCapture,
|
|
7537
|
-
onSelectionChangeShouldSetResponder,
|
|
7538
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
7539
|
-
onStartShouldSetResponder,
|
|
7540
|
-
onStartShouldSetResponderCapture,
|
|
7541
|
-
// android
|
|
7542
|
-
collapsable,
|
|
7543
|
-
focusable,
|
|
7544
|
-
// deprecated,
|
|
7545
|
-
accessible,
|
|
7546
|
-
accessibilityDisabled,
|
|
7547
|
-
onLayout,
|
|
7548
|
-
hrefAttrs,
|
|
7549
|
-
...viewProps
|
|
7550
|
-
} = propsIn;
|
|
7551
|
-
if ((0, import_usePlatformMethods.usePlatformMethods)(hostRef), (0, import_useElementLayout.useElementLayout)(hostRef, onLayout), (0, import_react_native_use_responder_events.useResponderEvents)(hostRef, {
|
|
7552
|
-
onMoveShouldSetResponder,
|
|
7553
|
-
onMoveShouldSetResponderCapture,
|
|
7554
|
-
onResponderEnd,
|
|
7555
|
-
onResponderGrant,
|
|
7556
|
-
onResponderMove,
|
|
7557
|
-
onResponderReject,
|
|
7558
|
-
onResponderRelease,
|
|
7559
|
-
onResponderStart,
|
|
7560
|
-
onResponderTerminate,
|
|
7561
|
-
onResponderTerminationRequest,
|
|
7562
|
-
onScrollShouldSetResponder,
|
|
7563
|
-
onScrollShouldSetResponderCapture,
|
|
7564
|
-
onSelectionChangeShouldSetResponder,
|
|
7565
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
7566
|
-
onStartShouldSetResponder,
|
|
7567
|
-
onStartShouldSetResponderCapture
|
|
7568
|
-
}), viewProps.href && hrefAttrs) {
|
|
7569
|
-
let { download, rel, target } = hrefAttrs;
|
|
7570
|
-
download != null && (viewProps.download = download), rel && (viewProps.rel = rel), typeof target == "string" && (viewProps.target = target.charAt(0) !== "_" ? `_${target}` : target);
|
|
7571
|
-
}
|
|
7572
|
-
return viewProps;
|
|
7516
|
+
usePropsTransform(elementType, propsIn, hostRef, willHydrate) {
|
|
7573
7517
|
},
|
|
7574
7518
|
useEvents(viewProps, events, { pseudos }, setStateShallow, staticConfig) {
|
|
7575
7519
|
if (events && (events.onFocus && (viewProps.onFocus = events.onFocus), events.onBlur && (viewProps.onBlur = events.onBlur)), staticConfig.isInput) {
|