@tamagui/core 1.129.11 → 1.129.12-1751358691172

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
@@ -1460,6 +1460,9 @@ var require_insertStyleRule_native = __commonJS({
1460
1460
  shouldInsertStyleRules: function() {
1461
1461
  return shouldInsertStyleRules;
1462
1462
  },
1463
+ stopAccumulatingRules: function() {
1464
+ return stopAccumulatingRules;
1465
+ },
1463
1466
  updateRules: function() {
1464
1467
  return updateRules;
1465
1468
  }
@@ -1550,7 +1553,7 @@ var require_insertStyleRule_native = __commonJS({
1550
1553
  return themes;
1551
1554
  }
1552
1555
  }
1553
- function track(id) {
1556
+ function trackInsertedStyle(id) {
1554
1557
  var remove = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, next = (totalSelectorsInserted.get(id) || 0) + (remove ? -1 : 1);
1555
1558
  return totalSelectorsInserted.set(id, next), next;
1556
1559
  }
@@ -1598,7 +1601,7 @@ var require_insertStyleRule_native = __commonJS({
1598
1601
  }
1599
1602
  continue;
1600
1603
  }
1601
- var total = track(identifier, remove);
1604
+ var total = trackInsertedStyle(identifier, remove);
1602
1605
  if (remove) total === 0 && delete allSelectors[identifier];
1603
1606
  else if (!(identifier in allSelectors)) {
1604
1607
  var isTransform = identifier.startsWith("_transform-"), shouldInsert = isTransform ? addTransform(identifier, cssRule.cssText, cssRule) : !0;
@@ -1698,53 +1701,62 @@ var require_insertStyleRule_native = __commonJS({
1698
1701
  var getIdentifierFromTamaguiSelector = function(selector) {
1699
1702
  var dotIndex = selector.indexOf(":");
1700
1703
  return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
1701
- }, sheet = null;
1704
+ }, sheet = null, trackAllRules = !0;
1705
+ function stopAccumulatingRules() {
1706
+ trackAllRules = !0;
1707
+ }
1702
1708
  function updateRules(identifier, rules) {
1703
- return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
1709
+ return trackAllRules && (allRules[identifier] = rules.join(" ")), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0;
1704
1710
  }
1705
1711
  var nonce = "";
1706
1712
  function setNonce2(_) {
1707
1713
  nonce = _;
1708
1714
  }
1709
1715
  function insertStyleRules2(rulesToInsert) {
1710
- if (!sheet && import_constants.isClient && document.head) {
1711
- var styleTag = document.createElement("style");
1712
- nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
1713
- }
1714
- if (sheet) for (var key in rulesToInsert) {
1715
- var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers2.StyleObjectIdentifier];
1716
- if (shouldInsertStyleRules(identifier)) {
1717
- var rules = styleObject[import_helpers2.StyleObjectRules];
1718
- allSelectors[identifier] = rules.join(`
1719
- `), track(identifier), updateRules(identifier, rules);
1720
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1721
- try {
1722
- for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1723
- var rule = _step.value;
1724
- if (process.env.NODE_ENV === "production") try {
1725
- sheet.insertRule(rule, sheet.cssRules.length);
1726
- } catch (err) {
1727
- console.error("Error inserting CSS", err);
1728
- }
1729
- else sheet.insertRule(rule, sheet.cssRules.length);
1730
- }
1731
- } catch (err) {
1732
- _didIteratorError = !0, _iteratorError = err;
1733
- } finally {
1716
+ if (import_constants.isClient) {
1717
+ if (!sheet && document.head) {
1718
+ var styleTag = document.createElement("style");
1719
+ nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
1720
+ }
1721
+ if (!sheet) {
1722
+ console.warn("[tamagui] no sheet");
1723
+ return;
1724
+ }
1725
+ for (var key in rulesToInsert) {
1726
+ var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers2.StyleObjectIdentifier];
1727
+ if (shouldInsertStyleRules(identifier)) {
1728
+ var rules = styleObject[import_helpers2.StyleObjectRules];
1729
+ allSelectors[identifier] = rules.join(`
1730
+ `), updateRules(identifier, rules), trackInsertedStyle(identifier);
1731
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1734
1732
  try {
1735
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1733
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1734
+ var rule = _step.value;
1735
+ if (process.env.NODE_ENV === "production") try {
1736
+ sheet.insertRule(rule, sheet.cssRules.length);
1737
+ } catch (err) {
1738
+ console.error("Error inserting CSS", err);
1739
+ }
1740
+ else sheet.insertRule(rule, sheet.cssRules.length);
1741
+ }
1742
+ } catch (err) {
1743
+ _didIteratorError = !0, _iteratorError = err;
1736
1744
  } finally {
1737
- if (_didIteratorError) throw _iteratorError;
1745
+ try {
1746
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1747
+ } finally {
1748
+ if (_didIteratorError) throw _iteratorError;
1749
+ }
1738
1750
  }
1739
1751
  }
1740
1752
  }
1741
1753
  }
1742
1754
  }
1743
- var minInsertAmt = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
1755
+ var maxToInsert = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
1744
1756
  function shouldInsertStyleRules(identifier) {
1745
1757
  if (process.env.IS_STATIC === "is_static") return !0;
1746
- var total = totalSelectorsInserted.get(identifier);
1747
- return process.env.NODE_ENV === "development" && totalSelectorsInserted.size > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 1e4) && console.warn('Warning: inserting many CSS rules, you may be animating something and generating many CSS insertions, which can degrade performance. Instead, try using the "disableClassName" property on elements that change styles often. To disable this warning set TAMAGUI_STYLE_INSERTION_WARNING_LIMIT from 50000 to something higher'), total === void 0 || total < minInsertAmt;
1758
+ var total = totalSelectorsInserted.get(identifier) || 0;
1759
+ return process.env.NODE_ENV === "development" && total > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 10) && console.warn('Warning: inserting many CSS rules, you may be animating something and generating many CSS insertions, which can degrade performance. Instead, try using the "disableClassName" property on elements that change styles often. To disable this warning set TAMAGUI_STYLE_INSERTION_WARNING_LIMIT from 50000 to something higher'), total < maxToInsert;
1748
1760
  }
1749
1761
  }
1750
1762
  });
@@ -5401,7 +5413,7 @@ var require_getSplitStyles_native = __commonJS({
5401
5413
  try {
5402
5414
  for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
5403
5415
  var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers2.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
5404
- fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle, startedUnhydrated), classNames[fullKey] = psuedoStyle[import_helpers2.StyleObjectIdentifier]);
5416
+ fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers2.StyleObjectIdentifier]);
5405
5417
  }
5406
5418
  } catch (err) {
5407
5419
  _didIteratorError2 = !0, _iteratorError2 = err;
@@ -5479,7 +5491,7 @@ var require_getSplitStyles_native = __commonJS({
5479
5491
  var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
5480
5492
  process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
5481
5493
  var subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers2.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers2.StyleObjectPseudo] || ""}`;
5482
- fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out, startedUnhydrated), classNames[fullKey1] = out[import_helpers2.StyleObjectIdentifier]);
5494
+ fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers2.StyleObjectIdentifier]);
5483
5495
  }
5484
5496
  }
5485
5497
  } catch (err) {
@@ -5773,7 +5785,6 @@ var require_getSplitStyles_native = __commonJS({
5773
5785
  return res;
5774
5786
  };
5775
5787
  function addStyleToInsertRules(rulesToInsert, styleObject) {
5776
- var startedUnhydrated = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
5777
5788
  if (0) var identifier;
5778
5789
  }
5779
5790
  var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
@@ -6914,7 +6925,7 @@ var require_wrapStyleTags_native = __commonJS({
6914
6925
  });
6915
6926
  module2.exports = __toCommonJS2(wrapStyleTags_exports);
6916
6927
  var import_jsx_runtime2 = require("react/jsx-runtime"), import_constants = require_index_native2(), import_helpers2 = require_index_native3();
6917
- function getStyleTags(styles, content) {
6928
+ function getStyleTags(styles) {
6918
6929
  import_constants.IS_REACT_19;
6919
6930
  }
6920
6931
  }
@@ -7103,14 +7114,14 @@ var require_useComponentState_native = __commonJS({
7103
7114
  var import_constants = require_index_native2(), import_is_equal_shallow = require_index_native6(), import_use_did_finish_ssr = require_index_native7(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
7104
7115
  var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)(), [startedUnhydrated] = (0, import_react3.useState)(needsHydration && !isHydrated), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7105
7116
  stateRef.current || (stateRef.current = {});
7106
- var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current;
7117
+ var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
7107
7118
  !needsHydration && hasAnimationProp && (curStateRef.hasAnimated = !0);
7108
7119
  var willBeAnimatedClient = function() {
7109
7120
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
7110
7121
  return !!(next || curStateRef.hasAnimated);
7111
7122
  }(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
7112
7123
  willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
7113
- 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
7124
+ 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) || !supportsCSS), hasEnterState = hasEnterStyle || isEntering, shouldEnter = hasEnterState || hasAnimationThatNeedsHydrate || // disableClassName doesnt work server side, only client, so needs hydrate
7114
7125
  // this is just for a better ux, supports css variables for light/dark, media queries, etc
7115
7126
  disableClassName, initialState = shouldEnter ? (
7116
7127
  // on the very first render we switch all spring animation drivers to css rendering
@@ -7124,7 +7135,9 @@ var require_useComponentState_native = __commonJS({
7124
7135
  var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
7125
7136
  ...states[0],
7126
7137
  [props.forceStyle]: !0
7127
- } : states[0], setState = states[1], isAnimated = willBeAnimated;
7138
+ } : states[0], setState = states[1];
7139
+ stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
7140
+ var isAnimated = willBeAnimated;
7128
7141
  import_constants.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState(function(_) {
7129
7142
  return {
7130
7143
  ...state
@@ -7140,7 +7153,7 @@ var require_useComponentState_native = __commonJS({
7140
7153
  }
7141
7154
  var noClass = !import_constants.isWeb || !!props.forceStyle || isAnimated && (animationDriver == null ? void 0 : animationDriver.needsWebStyles);
7142
7155
  if (import_constants.isWeb && (!import_constants.isServer || isHydrated)) {
7143
- var isAnimatedAndHydrated = isAnimated && !supportsCSSVars, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
7156
+ var isAnimatedAndHydrated = isAnimated && !supportsCSS, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
7144
7157
  (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (noClass = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
7145
7158
  isAnimatedAndHydrated,
7146
7159
  isDisabledManually,
@@ -7204,7 +7217,7 @@ var require_useComponentState_native = __commonJS({
7204
7217
  noClass,
7205
7218
  state,
7206
7219
  stateRef,
7207
- supportsCSSVars,
7220
+ supportsCSS,
7208
7221
  willBeAnimated,
7209
7222
  willBeAnimatedClient
7210
7223
  };
@@ -7437,44 +7450,8 @@ var require_createComponent_native = __commonJS({
7437
7450
  });
7438
7451
  module2.exports = __toCommonJS2(createComponent_exports);
7439
7452
  var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
7440
- typeof window < "u" && (cancelTouches = function() {
7441
- componentSetStates.forEach(function(setState) {
7442
- return setState(function(prev) {
7443
- return prev.press || prev.pressIn ? {
7444
- ...prev,
7445
- press: !1,
7446
- pressIn: !1
7447
- } : prev;
7448
- });
7449
- }), componentSetStates.clear();
7450
- }, addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches), process.env.NODE_ENV === "development" && (startVisualizer = function() {
7451
- var devVisualizerConfig = import_config.devConfig === null || import_config.devConfig === void 0 ? void 0 : import_config.devConfig.visualizer;
7452
- if (devVisualizerConfig) {
7453
- var show2 = function(val) {
7454
- clearTimeout(tm), isShowing = val, debugKeyListeners == null || debugKeyListeners.forEach(function(l) {
7455
- return l(val);
7456
- });
7457
- }, show = show2;
7458
- debugKeyListeners = /* @__PURE__ */ new Set();
7459
- var tm, isShowing = !1, options = {
7460
- key: "Alt",
7461
- delay: 800,
7462
- ...typeof devVisualizerConfig == "object" ? devVisualizerConfig : {}
7463
- };
7464
- window.addEventListener("blur", function() {
7465
- show2(!1);
7466
- }), window.addEventListener("keydown", function(param) {
7467
- var { key, defaultPrevented } = param;
7468
- defaultPrevented || (clearTimeout(tm), key === options.key && (tm = setTimeout(function() {
7469
- show2(!0);
7470
- }, options.delay)));
7471
- }), window.addEventListener("keyup", function(param) {
7472
- var { key, defaultPrevented } = param;
7473
- defaultPrevented || key === options.key && isShowing && show2(!1);
7474
- });
7475
- }
7476
- }));
7477
- var cancelTouches, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
7453
+ if (0) var cancelTouches;
7454
+ var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
7478
7455
  value: !1
7479
7456
  };
7480
7457
  import_constants.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
@@ -7551,7 +7528,7 @@ var require_createComponent_native = __commonJS({
7551
7528
  }, [
7552
7529
  componentName2
7553
7530
  ]);
7554
- var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState, setStateShallow = componentState.setStateShallow;
7531
+ var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState, setStateShallow = componentState.setStateShallow;
7555
7532
  process.env.NODE_ENV === "development" && time2 && time2`use-state`;
7556
7533
  var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
7557
7534
  animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
@@ -7575,7 +7552,7 @@ var require_createComponent_native = __commonJS({
7575
7552
  noClass,
7576
7553
  isAnimated,
7577
7554
  isWeb: import_constants.isWeb,
7578
- supportsCSSVars
7555
+ supportsCSS
7579
7556
  });
7580
7557
  else {
7581
7558
  console.groupEnd();
@@ -7604,7 +7581,7 @@ var require_createComponent_native = __commonJS({
7604
7581
  (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time2 && time2`media`;
7605
7582
  var resolveValues = (
7606
7583
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
7607
- isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
7584
+ isAnimated && !supportsCSS || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
7608
7585
  ), styleProps = {
7609
7586
  mediaState: mediaState2,
7610
7587
  noClass,
@@ -7631,7 +7608,9 @@ var require_createComponent_native = __commonJS({
7631
7608
  var updatedState = {
7632
7609
  ...state,
7633
7610
  ...next
7634
- }, nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7611
+ };
7612
+ stateRef.current.nextComponentState = updatedState;
7613
+ var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7635
7614
  styleListener(nextStyles.style);
7636
7615
  } else ogSetStateShallow(next);
7637
7616
  };
@@ -7671,7 +7650,7 @@ var require_createComponent_native = __commonJS({
7671
7650
  !isTaggable && props.forceStyle && (viewProps.forceStyle = props.forceStyle), isHOC && _themeProp && (viewProps.theme = _themeProp), tagProp && elementType.acceptTagProp && (viewProps.tag = tagProp);
7672
7651
  var animationStyles, shouldUseAnimation = (
7673
7652
  // if it supports css vars we run it on server too to get matching initial style
7674
- (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
7653
+ (supportsCSS ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
7675
7654
  ), animatedRef;
7676
7655
  if (shouldUseAnimation) {
7677
7656
  var useStyleEmitter = animationDriver != null && animationDriver.avoidReRenders ? function(listener) {
@@ -7736,8 +7715,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7736
7715
  }
7737
7716
  var tm;
7738
7717
  if (state.unmounted) {
7739
- var _config_animations2, _animationDriver_supportsCSSVars;
7740
- if (((_animationDriver_supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars) !== null && _animationDriver_supportsCSSVars !== void 0 ? _animationDriver_supportsCSSVars : !(config == null || (_config_animations2 = config.animations) === null || _config_animations2 === void 0) && _config_animations2.supportsCSSVars) || import_constants.isAndroid) return tm = setTimeout(function() {
7718
+ if (animationDriver != null && animationDriver.supportsCSS || import_constants.isAndroid) return tm = setTimeout(function() {
7741
7719
  setStateShallow({
7742
7720
  unmounted: !1
7743
7721
  });
@@ -10322,7 +10300,7 @@ var require_TamaguiProvider_native = __commonJS({
10322
10300
  }
10323
10301
  });
10324
10302
  module2.exports = __toCommonJS2(TamaguiProvider_exports);
10325
- var import_jsx_runtime2 = require("react/jsx-runtime"), import_constants = require_index_native2(), import_use_did_finish_ssr = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native();
10303
+ var import_jsx_runtime2 = require("react/jsx-runtime"), import_constants = require_index_native2(), import_use_did_finish_ssr = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_insertStyleRule = require_insertStyleRule_native();
10326
10304
  function TamaguiProvider2(param) {
10327
10305
  var { children, disableInjectCSS, config, className, defaultTheme, disableRootThemeClass, reset, themeClassNameOnRoot } = param;
10328
10306
  import_constants.IS_REACT_19 || import_constants.isClient && (0, import_constants.useIsomorphicLayoutEffect)(function() {
@@ -10336,7 +10314,7 @@ var require_TamaguiProvider_native = __commonJS({
10336
10314
  config,
10337
10315
  disableInjectCSS
10338
10316
  ]), (0, import_constants.useIsomorphicLayoutEffect)(function() {
10339
- (0, import_useMedia.updateMediaListeners)();
10317
+ (0, import_insertStyleRule.stopAccumulatingRules)(), (0, import_useMedia.updateMediaListeners)();
10340
10318
  }, []);
10341
10319
  var contents = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(UnmountedClassName, {
10342
10320
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ComponentContext.ComponentContext.Provider, {
@@ -12235,49 +12213,51 @@ var require_index_native12 = __commonJS({
12235
12213
  return cb();
12236
12214
  }), queuedUpdates.clear()));
12237
12215
  }
12216
+ var expectedFrameTime = 16.67, numDroppedFramesUntilPause = 10;
12238
12217
  if (import_constants.isClient) if (rAF) {
12239
12218
  layoutOnAnimationFrame = function() {
12240
12219
  var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
12241
- if (lastFrameAt = now, strategy !== "off") {
12242
- var expectedFrameTime = 16.67, hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
12220
+ if (lastFrameAt = now, frameCount < runEveryXFrames) {
12221
+ frameCount++, rAF(layoutOnAnimationFrame);
12222
+ return;
12223
+ }
12224
+ if (frameCount = 0, strategy !== "off") {
12225
+ var hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
12243
12226
  hasRecentSyncWork || Nodes.forEach(function(node) {
12244
12227
  updateLayoutIfChanged(node, lastFrameAt);
12245
12228
  });
12246
12229
  }
12247
12230
  rAF(layoutOnAnimationFrame);
12248
- }, layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now(), numDroppedFramesUntilPause = 2;
12231
+ }, layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now();
12249
12232
  async function updateLayoutIfChanged(node, frameId) {
12250
- var parentNode = node.parentElement, nodeRect, parentRect;
12251
- if (strategy === "async") {
12252
- var [nr, pr] = await Promise.all([
12253
- getBoundingClientRectAsync(node),
12254
- getBoundingClientRectAsync(parentNode)
12255
- ]);
12256
- if (frameId !== lastFrameAt) return;
12257
- nodeRect = nr, parentRect = pr;
12258
- } else nodeRect = node.getBoundingClientRect(), parentRect = parentNode == null ? void 0 : parentNode.getBoundingClientRect();
12259
- if (parentRect) {
12260
- var onLayout = LayoutHandlers.get(node);
12261
- if (typeof onLayout == "function") {
12262
- var cachedRect = NodeRectCache.get(node), cachedParentRect = parentNode ? NodeRectCache.get(parentNode) : null;
12233
+ var onLayout = LayoutHandlers.get(node);
12234
+ if (typeof onLayout == "function") {
12235
+ var parentNode = node.parentElement;
12236
+ if (parentNode) {
12237
+ var nodeRect, parentRect;
12238
+ if (strategy === "async") {
12239
+ var [nr, pr] = await Promise.all([
12240
+ getBoundingClientRectAsync(node),
12241
+ getBoundingClientRectAsync(parentNode)
12242
+ ]);
12243
+ if (frameId !== lastFrameAt) return;
12244
+ nodeRect = nr, parentRect = pr;
12245
+ } else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
12246
+ var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
12263
12247
  if (!cachedRect || // has changed one rect
12264
12248
  !(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
12265
- if (NodeRectCache.set(node, nodeRect), parentRect && parentNode && ParentRectCache.set(parentNode, parentRect), avoidUpdates) {
12266
- var event = getElementLayoutEvent(nodeRect, parentRect);
12267
- queuedUpdates.set(node, function() {
12268
- return onLayout(event);
12269
- });
12270
- } else if (strategy !== "async") {
12271
- var event1 = getElementLayoutEvent(nodeRect, parentRect);
12272
- onLayout(event1);
12273
- }
12249
+ NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
12250
+ var event = getElementLayoutEvent(nodeRect, parentRect);
12251
+ avoidUpdates ? queuedUpdates.set(node, function() {
12252
+ return onLayout(event);
12253
+ }) : onLayout(event);
12274
12254
  }
12275
12255
  }
12276
12256
  }
12277
12257
  }
12278
- rAF(layoutOnAnimationFrame);
12258
+ rAF(layoutOnAnimationFrame), frameCount = 0, runEveryXFrames = 6;
12279
12259
  } else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
12280
- var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt, numDroppedFramesUntilPause, getElementLayoutEvent = function(nodeRect, parentRect) {
12260
+ var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt, frameCount, runEveryXFrames, getElementLayoutEvent = function(nodeRect, parentRect) {
12281
12261
  return {
12282
12262
  nativeEvent: {
12283
12263
  layout: getRelativeDimensions(nodeRect, parentRect),