@tamagui/core 1.121.1 → 1.121.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +14 -14
- package/types/createOptimizedView.d.ts +2 -0
- package/types/createOptimizedView.d.ts.map +1 -0
- package/types/createOptimizedView.native.d.ts +17 -0
- package/types/createOptimizedView.native.d.ts.map +1 -0
- package/types/getBaseViews.d.ts +2 -0
- package/types/getBaseViews.d.ts.map +1 -0
- package/types/getBaseViews.native.d.ts +8 -0
- package/types/getBaseViews.native.d.ts.map +1 -0
- package/types/helpers/getBoundingClientRect.d.ts +2 -0
- package/types/helpers/getBoundingClientRect.d.ts.map +1 -0
- package/types/helpers/getRect.d.ts +9 -0
- package/types/helpers/getRect.d.ts.map +1 -0
- package/types/hooks/useElementLayout.d.ts +21 -0
- package/types/hooks/useElementLayout.d.ts.map +1 -0
- package/types/index.d.ts +16 -0
- package/types/index.d.ts.map +1 -0
- package/types/inject-styles.d.ts +7 -0
- package/types/inject-styles.d.ts.map +1 -0
- package/types/reactNativeTypes.d.ts +2 -0
- package/types/reactNativeTypes.d.ts.map +1 -0
- package/types/vendor/Pressability.d.ts +3 -0
- package/types/vendor/Pressability.d.ts.map +1 -0
- package/types/vendor/Pressability.native.d.ts +3 -0
- package/types/vendor/Pressability.native.d.ts.map +1 -0
package/dist/native.js
CHANGED
|
@@ -4554,6 +4554,9 @@ var require_defaultComponentState_native = __commonJS({
|
|
|
4554
4554
|
},
|
|
4555
4555
|
defaultComponentStateMounted: function() {
|
|
4556
4556
|
return defaultComponentStateMounted;
|
|
4557
|
+
},
|
|
4558
|
+
defaultComponentStateShouldEnter: function() {
|
|
4559
|
+
return defaultComponentStateShouldEnter;
|
|
4557
4560
|
}
|
|
4558
4561
|
});
|
|
4559
4562
|
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
@@ -4568,6 +4571,9 @@ var require_defaultComponentState_native = __commonJS({
|
|
|
4568
4571
|
}, defaultComponentStateMounted = {
|
|
4569
4572
|
...defaultComponentState,
|
|
4570
4573
|
unmounted: !1
|
|
4574
|
+
}, defaultComponentStateShouldEnter = {
|
|
4575
|
+
...defaultComponentState,
|
|
4576
|
+
unmounted: "should-enter"
|
|
4571
4577
|
};
|
|
4572
4578
|
}
|
|
4573
4579
|
});
|
|
@@ -8086,6 +8092,62 @@ var require_wrapStyleTags_native = __commonJS({
|
|
|
8086
8092
|
}
|
|
8087
8093
|
});
|
|
8088
8094
|
|
|
8095
|
+
// ../web/dist/cjs/hooks/useIsHydrated.native.js
|
|
8096
|
+
var require_useIsHydrated_native = __commonJS({
|
|
8097
|
+
"../web/dist/cjs/hooks/useIsHydrated.native.js"(exports2, module2) {
|
|
8098
|
+
"use strict";
|
|
8099
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
8100
|
+
for (var name in all) __defProp2(target, name, {
|
|
8101
|
+
get: all[name],
|
|
8102
|
+
enumerable: !0
|
|
8103
|
+
});
|
|
8104
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
8105
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8106
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
8107
|
+
for (var _loop = function() {
|
|
8108
|
+
var key = _step.value;
|
|
8109
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
8110
|
+
get: function() {
|
|
8111
|
+
return from[key];
|
|
8112
|
+
},
|
|
8113
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
8114
|
+
});
|
|
8115
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
8116
|
+
} catch (err) {
|
|
8117
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
8118
|
+
} finally {
|
|
8119
|
+
try {
|
|
8120
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
8121
|
+
} finally {
|
|
8122
|
+
if (_didIteratorError)
|
|
8123
|
+
throw _iteratorError;
|
|
8124
|
+
}
|
|
8125
|
+
}
|
|
8126
|
+
return to;
|
|
8127
|
+
}, __toCommonJS2 = function(mod) {
|
|
8128
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
8129
|
+
value: !0
|
|
8130
|
+
}), mod);
|
|
8131
|
+
}, useIsHydrated_exports = {};
|
|
8132
|
+
__export2(useIsHydrated_exports, {
|
|
8133
|
+
useIsHydrated: function() {
|
|
8134
|
+
return useIsHydrated;
|
|
8135
|
+
}
|
|
8136
|
+
});
|
|
8137
|
+
module2.exports = __toCommonJS2(useIsHydrated_exports);
|
|
8138
|
+
var import_react3 = require("react"), nullSubscribe = function() {
|
|
8139
|
+
return function() {
|
|
8140
|
+
};
|
|
8141
|
+
}, useIsHydrated = function() {
|
|
8142
|
+
return (0, import_react3.useSyncExternalStore)(nullSubscribe, function() {
|
|
8143
|
+
return !0;
|
|
8144
|
+
}, function() {
|
|
8145
|
+
return !1;
|
|
8146
|
+
});
|
|
8147
|
+
};
|
|
8148
|
+
}
|
|
8149
|
+
});
|
|
8150
|
+
|
|
8089
8151
|
// ../web/dist/cjs/hooks/useComponentState.native.js
|
|
8090
8152
|
var require_useComponentState_native = __commonJS({
|
|
8091
8153
|
"../web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
|
|
@@ -8129,15 +8191,15 @@ var require_useComponentState_native = __commonJS({
|
|
|
8129
8191
|
}
|
|
8130
8192
|
});
|
|
8131
8193
|
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
8132
|
-
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) {
|
|
8133
|
-
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
8194
|
+
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) {
|
|
8195
|
+
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);
|
|
8134
8196
|
stateRef.current || (stateRef.current = {});
|
|
8135
8197
|
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
8136
8198
|
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
8137
8199
|
return !!(next || curStateRef.hasAnimated);
|
|
8138
8200
|
}(), willBeAnimated = !import_constants2.isServer && willBeAnimatedClient;
|
|
8139
8201
|
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
8140
|
-
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
|
|
8202
|
+
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
|
|
8141
8203
|
// this is just for a better ux, supports css variables for light/dark, media queries, etc
|
|
8142
8204
|
disableClassName, initialState = shouldEnter ? (
|
|
8143
8205
|
// on the very first render we switch all spring animation drivers to css rendering
|
|
@@ -8145,14 +8207,14 @@ var require_useComponentState_native = __commonJS({
|
|
|
8145
8207
|
// without flickers of the wrong colors.
|
|
8146
8208
|
// but once we do that initial hydration and we are in client side rendering mode,
|
|
8147
8209
|
// we can avoid the extra re-render on mount
|
|
8148
|
-
import_defaultComponentState.defaultComponentState
|
|
8210
|
+
hasEnterState ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState
|
|
8149
8211
|
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
8150
8212
|
disabled != null && (initialState.disabled = disabled);
|
|
8151
8213
|
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
8152
8214
|
...states[0],
|
|
8153
8215
|
[props.forceStyle]: !0
|
|
8154
|
-
} : states[0], setState = states[1],
|
|
8155
|
-
import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC &&
|
|
8216
|
+
} : states[0], setState = states[1], isAnimated = willBeAnimated;
|
|
8217
|
+
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({
|
|
8156
8218
|
...state
|
|
8157
8219
|
}));
|
|
8158
8220
|
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|