@tamagui/core 1.129.15 → 1.129.16

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.
@@ -1431,9 +1431,6 @@ var require_insertStyleRule_native = __commonJS({
1431
1431
  insertedTransforms: function() {
1432
1432
  return insertedTransforms;
1433
1433
  },
1434
- listenForSheetChanges: function() {
1435
- return listenForSheetChanges;
1436
- },
1437
1434
  scanAllSheets: function() {
1438
1435
  return scanAllSheets;
1439
1436
  },
@@ -1465,33 +1462,6 @@ var require_insertStyleRule_native = __commonJS({
1465
1462
  if (!insertedTransforms[identifier]) return insertedTransforms[identifier] = value, !0;
1466
1463
  }
1467
1464
  }
1468
- function listenForSheetChanges() {
1469
- if (import_constants.isClient) {
1470
- var mo = new MutationObserver(function(entries) {
1471
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1472
- try {
1473
- for (var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1474
- var entry = _step.value;
1475
- if (entry instanceof HTMLStyleElement && entry.sheet || entry instanceof HTMLLinkElement && entry.href.endsWith(".css")) {
1476
- scanAllSheets();
1477
- break;
1478
- }
1479
- }
1480
- } catch (err) {
1481
- _didIteratorError = !0, _iteratorError = err;
1482
- } finally {
1483
- try {
1484
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1485
- } finally {
1486
- if (_didIteratorError) throw _iteratorError;
1487
- }
1488
- }
1489
- });
1490
- mo.observe(document.head, {
1491
- childList: !0
1492
- });
1493
- }
1494
- }
1495
1465
  function scanAllSheets() {
1496
1466
  var collectThemes = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, tokens = arguments.length > 1 ? arguments[1] : void 0;
1497
1467
  if (0) {
@@ -1517,7 +1487,7 @@ var require_insertStyleRule_native = __commonJS({
1517
1487
  }
1518
1488
  }
1519
1489
  function trackInsertedStyle(id) {
1520
- var remove = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, next = (totalSelectorsInserted.get(id) || 0) + (remove ? -1 : 1);
1490
+ var next = (totalSelectorsInserted.get(id) || 0) + 1;
1521
1491
  return totalSelectorsInserted.set(id, next), next;
1522
1492
  }
1523
1493
  var bailAfterEnv = process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES, bailAfter = bailAfterEnv ? +bailAfterEnv : 700, sheet = null, trackAllRules = !0;
@@ -1546,21 +1516,24 @@ var require_insertStyleRule_native = __commonJS({
1546
1516
  if (shouldInsertStyleRules(identifier)) {
1547
1517
  var rules = styleObject[import_helpers2.StyleObjectRules];
1548
1518
  allSelectors[identifier] = rules.join(`
1549
- `), updateRules(identifier, rules), trackInsertedStyle(identifier);
1550
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1519
+ `), trackInsertedStyle(identifier), updateRules(identifier, rules);
1551
1520
  try {
1552
- for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1553
- var rule = _step.value;
1554
- sheet.insertRule(rule, sheet.cssRules.length);
1555
- }
1556
- } catch (err) {
1557
- _didIteratorError = !0, _iteratorError = err;
1558
- } finally {
1521
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1559
1522
  try {
1560
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1523
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1524
+ var rule = _step.value;
1525
+ sheet.insertRule(rule, sheet.cssRules.length);
1526
+ }
1527
+ } catch (err) {
1528
+ _didIteratorError = !0, _iteratorError = err;
1561
1529
  } finally {
1562
- if (_didIteratorError) throw _iteratorError;
1530
+ try {
1531
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1532
+ } finally {
1533
+ if (_didIteratorError) throw _iteratorError;
1534
+ }
1563
1535
  }
1536
+ } catch {
1564
1537
  }
1565
1538
  }
1566
1539
  }
@@ -5368,7 +5341,7 @@ var require_getSplitStyles_native = __commonJS({
5368
5341
  conf = conf || (0, import_config.getConfig)();
5369
5342
  var animationDriver = (componentContext == null ? void 0 : componentContext.animationDriver) || conf.animations;
5370
5343
  import_constants.isWeb && styleProps.isAnimated && animationDriver.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
5371
- var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClass && !styleProps.isAnimated, rulesToInsert = void 0, classNames = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles2 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers2.stylePropsText : import_helpers2.validStyles), styleState = {
5344
+ var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles2 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers2.stylePropsText : import_helpers2.validStyles), styleState = {
5372
5345
  classNames,
5373
5346
  conf,
5374
5347
  props,
@@ -5458,7 +5431,7 @@ var require_getSplitStyles_native = __commonJS({
5458
5431
  var style2 = styleState.style;
5459
5432
  if (0) {
5460
5433
  var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
5461
- if (!styleProps.isAnimated && isReactNative) {
5434
+ if (!(styleProps.isAnimated && isReactNative) && isReactNative) {
5462
5435
  var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
5463
5436
  try {
5464
5437
  for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) var name;
@@ -6807,9 +6780,10 @@ var require_useComponentState_native = __commonJS({
6807
6780
  var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
6808
6781
  state.unmounted && env && staticConfig.variants[env] ? props[env] = !0 : isExiting && exv && (props[exv] = exitVariant !== enterExitVariant);
6809
6782
  }
6810
- var noClass = !import_constants.isWeb || !!props.forceStyle || isAnimated && (animationDriver == null ? void 0 : animationDriver.needsWebStyles);
6811
- if (import_constants.isWeb && (!import_constants.isServer || isHydrated)) {
6812
- var isAnimatedAndHydrated = isAnimated && !supportsCSS, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
6783
+ var noClass = !import_constants.isWeb || !!props.forceStyle;
6784
+ if (!isHydrated) noClass = !1;
6785
+ else if (import_constants.isWeb && isHydrated) {
6786
+ var isAnimatedAndHydrated = isAnimated && isHydrated, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
6813
6787
  (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (noClass = !0);
6814
6788
  }
6815
6789
  return {
@@ -7295,7 +7269,7 @@ var require_createComponent_native = __commonJS({
7295
7269
  staticConfig,
7296
7270
  stateRef
7297
7271
  });
7298
- animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`), animations.ref && (animatedRef = animations.ref));
7272
+ isHydrated && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`), animations.ref && (animatedRef = animations.ref));
7299
7273
  }
7300
7274
  groupContext && (nonTamaguiProps.onLayout = (0, import_helpers2.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
7301
7275
  var _stateRef_current_group, layout = e.nativeEvent.layout;
@@ -8355,7 +8329,7 @@ var require_createTamagui_native = __commonJS({
8355
8329
  var foundThemes;
8356
8330
  if (configIn.themes) {
8357
8331
  var noThemes = Object.keys(configIn.themes).length === 0;
8358
- noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), import_constants.IS_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
8332
+ noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed));
8359
8333
  }
8360
8334
  var fontSizeTokens = null, fontsParsed;
8361
8335
  if (configIn.fonts) {