tamagui 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 CHANGED
@@ -3319,30 +3319,32 @@ var require_useMedia_native = __commonJS({
3319
3319
  }, States.set(uid, componentState));
3320
3320
  var getSnapshot = function() {
3321
3321
  if (!componentState) return initialState;
3322
- var keys = componentState.keys, _componentState_prev = componentState.prev, prev = _componentState_prev === void 0 ? initialState : _componentState_prev;
3323
- if (componentState && componentState.enabled === !1) return prev;
3324
- var _componentState_keys, _ref, testKeys = (_ref = (_componentState_keys = componentState == null ? void 0 : componentState.keys) !== null && _componentState_keys !== void 0 ? _componentState_keys : (!componentState || componentState.enabled) && keys) !== null && _ref !== void 0 ? _ref : null, hasntUpdated = !testKeys || (testKeys == null ? void 0 : testKeys.every(function(key) {
3322
+ var enabled = componentState.enabled, keys = componentState.keys, _componentState_prev = componentState.prev, prev = _componentState_prev === void 0 ? initialState : _componentState_prev;
3323
+ if (enabled === !1) return prev;
3324
+ var _ref, testKeys = (_ref = (keys != null || enabled) && keys) !== null && _ref !== void 0 ? _ref : null, hasntUpdated = !testKeys || Object.keys(testKeys).every(function(key) {
3325
3325
  return mediaState3[key] === prev[key];
3326
- }));
3326
+ });
3327
3327
  return hasntUpdated ? prev : (componentState.prev = mediaState3, mediaState3);
3328
3328
  }, state;
3329
3329
  if (process.env.TAMAGUI_SYNC_MEDIA_QUERY) state = (0, import_react4.useSyncExternalStore)(subscribe, getSnapshot, function() {
3330
3330
  return initialState;
3331
3331
  });
3332
3332
  else {
3333
- var _useState = _sliced_to_array((0, import_react4.useState)(initialState), 2), internalState = _useState[0], setState = _useState[1];
3334
- state = internalState, (0, import_constants4.useIsomorphicLayoutEffect)(function() {
3333
+ var _useState = _sliced_to_array((0, import_react4.useState)(initialState), 2), _state = _useState[0], setState = _useState[1];
3334
+ state = _state, (0, import_constants4.useIsomorphicLayoutEffect)(function() {
3335
3335
  var update = function() {
3336
3336
  setState(getSnapshot);
3337
3337
  };
3338
- return update(), subscribe(update);
3338
+ return update(), disableSSR || Promise.resolve().then(function() {
3339
+ update();
3340
+ }), subscribe(update);
3339
3341
  }, []);
3340
3342
  }
3341
3343
  return new Proxy(state, {
3342
3344
  get: function(_, key) {
3343
3345
  if (typeof key == "string") {
3344
3346
  var _componentState;
3345
- (_componentState = componentState).keys || (_componentState.keys = []), componentState.keys.includes(key) || componentState.keys.push(key), process.env.NODE_ENV === "development" && debug && console.info("useMedia() TOUCH", key);
3347
+ (_componentState = componentState).keys || (_componentState.keys = {}), componentState.keys[key] = !0, process.env.NODE_ENV === "development" && debug && console.info("useMedia() TOUCH", key);
3346
3348
  }
3347
3349
  return Reflect.get(state, key);
3348
3350
  }
@@ -7843,7 +7845,7 @@ current`, _object_spread9({}, styleState.style)));
7843
7845
  if (isMedia) {
7844
7846
  if (!val) continue;
7845
7847
  var hasSpace = val.space, mediaKeyShort = key.slice(1);
7846
- if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), isMedia === "platform") {
7848
+ if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (typeof hasMedia != "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform") {
7847
7849
  var platform = key.slice(10);
7848
7850
  if (
7849
7851
  // supports web, ios, android
@@ -9504,7 +9506,7 @@ var require_createComponent_native = __commonJS({
9504
9506
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
9505
9507
  }
9506
9508
  process.env.NODE_ENV === "development" && time && time(_templateObject10()), curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
9507
- var isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
9509
+ var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
9508
9510
  process.env.NODE_ENV === "development" && debugProp && console.info("useMedia() createComponent", shouldListenForMedia, mediaListeningKeys), (0, import_useMedia.setMediaShouldUpdate)(stateRef, {
9509
9511
  enabled: shouldListenForMedia,
9510
9512
  keys: mediaListeningKeys
@@ -9762,7 +9764,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9762
9764
  elementType,
9763
9765
  events,
9764
9766
  isAnimated,
9765
- isMediaArray,
9767
+ hasRuntimeMediaKeys,
9766
9768
  isStringElement,
9767
9769
  mediaListeningKeys,
9768
9770
  pseudos,