@tamagui/core 1.121.2 → 1.121.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 +68 -6
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +68 -6
- package/dist/test.native.js.map +3 -3
- package/package.json +6 -6
- package/types/createOptimizedView.d.ts.map +1 -0
- package/types/createOptimizedView.native.d.ts.map +1 -0
- package/types/getBaseViews.d.ts.map +1 -0
- package/types/getBaseViews.native.d.ts.map +1 -0
- package/types/helpers/getBoundingClientRect.d.ts.map +1 -0
- package/types/helpers/getRect.d.ts.map +1 -0
- package/types/hooks/useElementLayout.d.ts.map +1 -0
- package/types/index.d.ts.map +1 -0
- package/types/inject-styles.d.ts.map +1 -0
- package/types/reactNativeTypes.d.ts.map +1 -0
- package/types/vendor/Pressability.d.ts.map +1 -0
- package/types/vendor/Pressability.native.d.ts.map +1 -0
package/dist/test.native.js
CHANGED
|
@@ -4237,6 +4237,9 @@ var require_defaultComponentState_native = __commonJS({
|
|
|
4237
4237
|
},
|
|
4238
4238
|
defaultComponentStateMounted: function() {
|
|
4239
4239
|
return defaultComponentStateMounted;
|
|
4240
|
+
},
|
|
4241
|
+
defaultComponentStateShouldEnter: function() {
|
|
4242
|
+
return defaultComponentStateShouldEnter;
|
|
4240
4243
|
}
|
|
4241
4244
|
});
|
|
4242
4245
|
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
@@ -4251,6 +4254,9 @@ var require_defaultComponentState_native = __commonJS({
|
|
|
4251
4254
|
}, defaultComponentStateMounted = {
|
|
4252
4255
|
...defaultComponentState,
|
|
4253
4256
|
unmounted: !1
|
|
4257
|
+
}, defaultComponentStateShouldEnter = {
|
|
4258
|
+
...defaultComponentState,
|
|
4259
|
+
unmounted: "should-enter"
|
|
4254
4260
|
};
|
|
4255
4261
|
}
|
|
4256
4262
|
});
|
|
@@ -7632,6 +7638,62 @@ var require_wrapStyleTags_native = __commonJS({
|
|
|
7632
7638
|
}
|
|
7633
7639
|
});
|
|
7634
7640
|
|
|
7641
|
+
// ../web/dist/cjs/hooks/useIsHydrated.native.js
|
|
7642
|
+
var require_useIsHydrated_native = __commonJS({
|
|
7643
|
+
"../web/dist/cjs/hooks/useIsHydrated.native.js"(exports2, module2) {
|
|
7644
|
+
"use strict";
|
|
7645
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
7646
|
+
for (var name in all) __defProp2(target, name, {
|
|
7647
|
+
get: all[name],
|
|
7648
|
+
enumerable: !0
|
|
7649
|
+
});
|
|
7650
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
7651
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
7652
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
7653
|
+
for (var _loop = function() {
|
|
7654
|
+
var key = _step.value;
|
|
7655
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
7656
|
+
get: function() {
|
|
7657
|
+
return from[key];
|
|
7658
|
+
},
|
|
7659
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
7660
|
+
});
|
|
7661
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
7662
|
+
} catch (err) {
|
|
7663
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
7664
|
+
} finally {
|
|
7665
|
+
try {
|
|
7666
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
7667
|
+
} finally {
|
|
7668
|
+
if (_didIteratorError)
|
|
7669
|
+
throw _iteratorError;
|
|
7670
|
+
}
|
|
7671
|
+
}
|
|
7672
|
+
return to;
|
|
7673
|
+
}, __toCommonJS2 = function(mod) {
|
|
7674
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
7675
|
+
value: !0
|
|
7676
|
+
}), mod);
|
|
7677
|
+
}, useIsHydrated_exports = {};
|
|
7678
|
+
__export2(useIsHydrated_exports, {
|
|
7679
|
+
useIsHydrated: function() {
|
|
7680
|
+
return useIsHydrated;
|
|
7681
|
+
}
|
|
7682
|
+
});
|
|
7683
|
+
module2.exports = __toCommonJS2(useIsHydrated_exports);
|
|
7684
|
+
var import_react3 = require("react"), nullSubscribe = function() {
|
|
7685
|
+
return function() {
|
|
7686
|
+
};
|
|
7687
|
+
}, useIsHydrated = function() {
|
|
7688
|
+
return (0, import_react3.useSyncExternalStore)(nullSubscribe, function() {
|
|
7689
|
+
return !0;
|
|
7690
|
+
}, function() {
|
|
7691
|
+
return !1;
|
|
7692
|
+
});
|
|
7693
|
+
};
|
|
7694
|
+
}
|
|
7695
|
+
});
|
|
7696
|
+
|
|
7635
7697
|
// ../web/dist/cjs/hooks/useComponentState.native.js
|
|
7636
7698
|
var require_useComponentState_native = __commonJS({
|
|
7637
7699
|
"../web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
|
|
@@ -7675,15 +7737,15 @@ var require_useComponentState_native = __commonJS({
|
|
|
7675
7737
|
}
|
|
7676
7738
|
});
|
|
7677
7739
|
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
7678
|
-
var import_constants2 = require_index_native3(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
|
|
7679
|
-
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
7740
|
+
var import_constants2 = require_index_native3(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), import_useIsHydrated = require_useIsHydrated_native(), useComponentState = function(props, param, staticConfig, config) {
|
|
7741
|
+
var { animationDriver, groups } = param, _animationDriver_usePresence, isHydrated = (0, import_useIsHydrated.useIsHydrated)(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
7680
7742
|
stateRef.current || (stateRef.current = {});
|
|
7681
7743
|
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
7682
7744
|
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
7683
7745
|
return !!(next || curStateRef.hasAnimated);
|
|
7684
7746
|
}(), willBeAnimated = !import_constants2.isServer && willBeAnimatedClient;
|
|
7685
7747
|
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
7686
|
-
var { disableClassName } = props, presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasAnimationThatNeedsHydrate = hasAnimationProp && ((animationDriver == null ? void 0 : animationDriver.isReactNative) || !supportsCSSVars), hasEnterState = hasEnterStyle || isEntering, shouldEnter = hasEnterState || hasAnimationThatNeedsHydrate || // disableClassName doesnt work server side, only client, so needs hydrate
|
|
7748
|
+
var { disableClassName } = props, presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasAnimationThatNeedsHydrate = hasAnimationProp && !isHydrated && ((animationDriver == null ? void 0 : animationDriver.isReactNative) || !supportsCSSVars), hasEnterState = hasEnterStyle || isEntering, shouldEnter = hasEnterState || hasAnimationThatNeedsHydrate || // disableClassName doesnt work server side, only client, so needs hydrate
|
|
7687
7749
|
// this is just for a better ux, supports css variables for light/dark, media queries, etc
|
|
7688
7750
|
disableClassName, initialState = shouldEnter ? (
|
|
7689
7751
|
// on the very first render we switch all spring animation drivers to css rendering
|
|
@@ -7691,14 +7753,14 @@ var require_useComponentState_native = __commonJS({
|
|
|
7691
7753
|
// without flickers of the wrong colors.
|
|
7692
7754
|
// but once we do that initial hydration and we are in client side rendering mode,
|
|
7693
7755
|
// we can avoid the extra re-render on mount
|
|
7694
|
-
import_defaultComponentState.defaultComponentState
|
|
7756
|
+
hasEnterState ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState
|
|
7695
7757
|
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
7696
7758
|
disabled != null && (initialState.disabled = disabled);
|
|
7697
7759
|
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
7698
7760
|
...states[0],
|
|
7699
7761
|
[props.forceStyle]: !0
|
|
7700
|
-
} : states[0], setState = states[1],
|
|
7701
|
-
import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC &&
|
|
7762
|
+
} : states[0], setState = states[1], isAnimated = willBeAnimated;
|
|
7763
|
+
import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
7702
7764
|
...state
|
|
7703
7765
|
}));
|
|
7704
7766
|
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|