@tamagui/core 1.101.2 → 1.101.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 +13 -11
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +12 -10
- package/dist/test.native.js.map +2 -2
- package/package.json +6 -6
package/dist/test.native.js
CHANGED
|
@@ -3029,30 +3029,32 @@ var require_useMedia_native = __commonJS({
|
|
|
3029
3029
|
}, States.set(uid, componentState));
|
|
3030
3030
|
var getSnapshot = function() {
|
|
3031
3031
|
if (!componentState) return initialState;
|
|
3032
|
-
var keys = componentState.keys, _componentState_prev = componentState.prev, prev = _componentState_prev === void 0 ? initialState : _componentState_prev;
|
|
3033
|
-
if (
|
|
3034
|
-
var
|
|
3032
|
+
var enabled = componentState.enabled, keys = componentState.keys, _componentState_prev = componentState.prev, prev = _componentState_prev === void 0 ? initialState : _componentState_prev;
|
|
3033
|
+
if (enabled === !1) return prev;
|
|
3034
|
+
var _ref, testKeys = (_ref = (keys != null || enabled) && keys) !== null && _ref !== void 0 ? _ref : null, hasntUpdated = !testKeys || Object.keys(testKeys).every(function(key) {
|
|
3035
3035
|
return mediaState2[key] === prev[key];
|
|
3036
|
-
})
|
|
3036
|
+
});
|
|
3037
3037
|
return hasntUpdated ? prev : (componentState.prev = mediaState2, mediaState2);
|
|
3038
3038
|
}, state;
|
|
3039
3039
|
if (process.env.TAMAGUI_SYNC_MEDIA_QUERY) state = (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, function() {
|
|
3040
3040
|
return initialState;
|
|
3041
3041
|
});
|
|
3042
3042
|
else {
|
|
3043
|
-
var _useState = _sliced_to_array((0, import_react3.useState)(initialState), 2),
|
|
3044
|
-
state =
|
|
3043
|
+
var _useState = _sliced_to_array((0, import_react3.useState)(initialState), 2), _state = _useState[0], setState = _useState[1];
|
|
3044
|
+
state = _state, (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
3045
3045
|
var update = function() {
|
|
3046
3046
|
setState(getSnapshot);
|
|
3047
3047
|
};
|
|
3048
|
-
return update(),
|
|
3048
|
+
return update(), disableSSR || Promise.resolve().then(function() {
|
|
3049
|
+
update();
|
|
3050
|
+
}), subscribe(update);
|
|
3049
3051
|
}, []);
|
|
3050
3052
|
}
|
|
3051
3053
|
return new Proxy(state, {
|
|
3052
3054
|
get: function(_, key) {
|
|
3053
3055
|
if (typeof key == "string") {
|
|
3054
3056
|
var _componentState;
|
|
3055
|
-
(_componentState = componentState).keys || (_componentState.keys =
|
|
3057
|
+
(_componentState = componentState).keys || (_componentState.keys = {}), componentState.keys[key] = !0;
|
|
3056
3058
|
}
|
|
3057
3059
|
return Reflect.get(state, key);
|
|
3058
3060
|
}
|
|
@@ -7300,7 +7302,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7300
7302
|
if (isMedia) {
|
|
7301
7303
|
if (!val) continue;
|
|
7302
7304
|
var hasSpace = val.space, mediaKeyShort = key.slice(1);
|
|
7303
|
-
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (
|
|
7305
|
+
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (typeof hasMedia != "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform") {
|
|
7304
7306
|
var platform = key.slice(10);
|
|
7305
7307
|
if (
|
|
7306
7308
|
// supports web, ios, android
|
|
@@ -8662,7 +8664,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8662
8664
|
(_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
|
|
8663
8665
|
}
|
|
8664
8666
|
curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
8665
|
-
var
|
|
8667
|
+
var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
|
|
8666
8668
|
(0, import_useMedia.setMediaShouldUpdate)(stateRef, {
|
|
8667
8669
|
enabled: shouldListenForMedia,
|
|
8668
8670
|
keys: mediaListeningKeys
|