tamagui 1.121.2 → 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 +54 -54
package/dist/native.js
CHANGED
|
@@ -4696,6 +4696,9 @@ var require_defaultComponentState_native = __commonJS({
|
|
|
4696
4696
|
},
|
|
4697
4697
|
defaultComponentStateMounted: function() {
|
|
4698
4698
|
return defaultComponentStateMounted;
|
|
4699
|
+
},
|
|
4700
|
+
defaultComponentStateShouldEnter: function() {
|
|
4701
|
+
return defaultComponentStateShouldEnter;
|
|
4699
4702
|
}
|
|
4700
4703
|
});
|
|
4701
4704
|
module2.exports = __toCommonJS2(defaultComponentState_exports);
|
|
@@ -4710,6 +4713,9 @@ var require_defaultComponentState_native = __commonJS({
|
|
|
4710
4713
|
}, defaultComponentStateMounted = {
|
|
4711
4714
|
...defaultComponentState,
|
|
4712
4715
|
unmounted: !1
|
|
4716
|
+
}, defaultComponentStateShouldEnter = {
|
|
4717
|
+
...defaultComponentState,
|
|
4718
|
+
unmounted: "should-enter"
|
|
4713
4719
|
};
|
|
4714
4720
|
}
|
|
4715
4721
|
});
|
|
@@ -8228,6 +8234,62 @@ var require_wrapStyleTags_native = __commonJS({
|
|
|
8228
8234
|
}
|
|
8229
8235
|
});
|
|
8230
8236
|
|
|
8237
|
+
// ../../core/web/dist/cjs/hooks/useIsHydrated.native.js
|
|
8238
|
+
var require_useIsHydrated_native = __commonJS({
|
|
8239
|
+
"../../core/web/dist/cjs/hooks/useIsHydrated.native.js"(exports2, module2) {
|
|
8240
|
+
"use strict";
|
|
8241
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
8242
|
+
for (var name in all) __defProp2(target, name, {
|
|
8243
|
+
get: all[name],
|
|
8244
|
+
enumerable: !0
|
|
8245
|
+
});
|
|
8246
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
8247
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8248
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
8249
|
+
for (var _loop = function() {
|
|
8250
|
+
var key = _step.value;
|
|
8251
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
8252
|
+
get: function() {
|
|
8253
|
+
return from[key];
|
|
8254
|
+
},
|
|
8255
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
8256
|
+
});
|
|
8257
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
8258
|
+
} catch (err) {
|
|
8259
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
8260
|
+
} finally {
|
|
8261
|
+
try {
|
|
8262
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
8263
|
+
} finally {
|
|
8264
|
+
if (_didIteratorError)
|
|
8265
|
+
throw _iteratorError;
|
|
8266
|
+
}
|
|
8267
|
+
}
|
|
8268
|
+
return to;
|
|
8269
|
+
}, __toCommonJS2 = function(mod) {
|
|
8270
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
8271
|
+
value: !0
|
|
8272
|
+
}), mod);
|
|
8273
|
+
}, useIsHydrated_exports = {};
|
|
8274
|
+
__export2(useIsHydrated_exports, {
|
|
8275
|
+
useIsHydrated: function() {
|
|
8276
|
+
return useIsHydrated;
|
|
8277
|
+
}
|
|
8278
|
+
});
|
|
8279
|
+
module2.exports = __toCommonJS2(useIsHydrated_exports);
|
|
8280
|
+
var import_react3 = require("react"), nullSubscribe = function() {
|
|
8281
|
+
return function() {
|
|
8282
|
+
};
|
|
8283
|
+
}, useIsHydrated = function() {
|
|
8284
|
+
return (0, import_react3.useSyncExternalStore)(nullSubscribe, function() {
|
|
8285
|
+
return !0;
|
|
8286
|
+
}, function() {
|
|
8287
|
+
return !1;
|
|
8288
|
+
});
|
|
8289
|
+
};
|
|
8290
|
+
}
|
|
8291
|
+
});
|
|
8292
|
+
|
|
8231
8293
|
// ../../core/web/dist/cjs/hooks/useComponentState.native.js
|
|
8232
8294
|
var require_useComponentState_native = __commonJS({
|
|
8233
8295
|
"../../core/web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
|
|
@@ -8271,15 +8333,15 @@ var require_useComponentState_native = __commonJS({
|
|
|
8271
8333
|
}
|
|
8272
8334
|
});
|
|
8273
8335
|
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
8274
|
-
var import_constants4 = require_index_native6(), 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) {
|
|
8275
|
-
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
8336
|
+
var import_constants4 = require_index_native6(), 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) {
|
|
8337
|
+
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);
|
|
8276
8338
|
stateRef.current || (stateRef.current = {});
|
|
8277
8339
|
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
8278
8340
|
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
8279
8341
|
return !!(next || curStateRef.hasAnimated);
|
|
8280
8342
|
}(), willBeAnimated = !import_constants4.isServer && willBeAnimatedClient;
|
|
8281
8343
|
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
8282
|
-
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
|
|
8344
|
+
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
|
|
8283
8345
|
// this is just for a better ux, supports css variables for light/dark, media queries, etc
|
|
8284
8346
|
disableClassName, initialState = shouldEnter ? (
|
|
8285
8347
|
// on the very first render we switch all spring animation drivers to css rendering
|
|
@@ -8287,14 +8349,14 @@ var require_useComponentState_native = __commonJS({
|
|
|
8287
8349
|
// without flickers of the wrong colors.
|
|
8288
8350
|
// but once we do that initial hydration and we are in client side rendering mode,
|
|
8289
8351
|
// we can avoid the extra re-render on mount
|
|
8290
|
-
import_defaultComponentState.defaultComponentState
|
|
8352
|
+
hasEnterState ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState
|
|
8291
8353
|
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
8292
8354
|
disabled != null && (initialState.disabled = disabled);
|
|
8293
8355
|
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
8294
8356
|
...states[0],
|
|
8295
8357
|
[props.forceStyle]: !0
|
|
8296
|
-
} : states[0], setState = states[1],
|
|
8297
|
-
import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC &&
|
|
8358
|
+
} : states[0], setState = states[1], isAnimated = willBeAnimated;
|
|
8359
|
+
import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
8298
8360
|
...state
|
|
8299
8361
|
}));
|
|
8300
8362
|
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|