@tamagui/core 1.126.16 → 1.126.17

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
@@ -1551,13 +1551,11 @@ var require_insertStyleRule_native = __commonJS({
1551
1551
  }
1552
1552
  continue;
1553
1553
  }
1554
- if (!process.env.TAMAGUI_REACT_19) {
1555
- var total = track(identifier, remove);
1556
- if (remove) total === 0 && delete allSelectors[identifier];
1557
- else if (!(identifier in allSelectors)) {
1558
- var isTransform = identifier.startsWith("_transform-"), shouldInsert = isTransform ? addTransform(identifier, cssRule.cssText, cssRule) : !0;
1559
- shouldInsert && (allSelectors[identifier] = cssRule.cssText);
1560
- }
1554
+ var total = track(identifier, remove);
1555
+ if (remove) total === 0 && delete allSelectors[identifier];
1556
+ else if (!(identifier in allSelectors)) {
1557
+ var isTransform = identifier.startsWith("_transform-"), shouldInsert = isTransform ? addTransform(identifier, cssRule.cssText, cssRule) : !0;
1558
+ shouldInsert && (allSelectors[identifier] = cssRule.cssText);
1561
1559
  }
1562
1560
  }
1563
1561
  }
@@ -1655,44 +1653,41 @@ var require_insertStyleRule_native = __commonJS({
1655
1653
  return dotIndex > -1 ? selector.slice(7, dotIndex) : selector.slice(7);
1656
1654
  }, sheet = null;
1657
1655
  function updateRules(identifier, rules) {
1658
- if (!process.env.TAMAGUI_REACT_19) return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
1656
+ return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
1659
1657
  }
1660
1658
  var nonce = "";
1661
1659
  function setNonce2(_) {
1662
1660
  nonce = _;
1663
1661
  }
1664
1662
  function insertStyleRules(rulesToInsert) {
1665
- if (!process.env.TAMAGUI_REACT_19) {
1666
- if (!sheet && import_constants2.isClient && document.head) {
1667
- var styleTag = document.createElement("style");
1668
- nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
1669
- }
1670
- if (!sheet) return;
1671
- for (var key in rulesToInsert) {
1672
- var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers2.StyleObjectIdentifier];
1673
- if (shouldInsertStyleRules(identifier)) {
1674
- var rules = styleObject[import_helpers2.StyleObjectRules];
1675
- allSelectors[identifier] = rules.join(`
1663
+ if (!sheet && import_constants2.isClient && document.head) {
1664
+ var styleTag = document.createElement("style");
1665
+ nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
1666
+ }
1667
+ if (sheet) for (var key in rulesToInsert) {
1668
+ var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers2.StyleObjectIdentifier];
1669
+ if (shouldInsertStyleRules(identifier)) {
1670
+ var rules = styleObject[import_helpers2.StyleObjectRules];
1671
+ allSelectors[identifier] = rules.join(`
1676
1672
  `), track(identifier), updateRules(identifier, rules);
1677
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1678
- try {
1679
- for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1680
- var rule = _step.value;
1681
- if (process.env.NODE_ENV === "production") try {
1682
- sheet.insertRule(rule, sheet.cssRules.length);
1683
- } catch (err) {
1684
- console.error("Error inserting CSS", err);
1685
- }
1686
- else sheet.insertRule(rule, sheet.cssRules.length);
1673
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1674
+ try {
1675
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1676
+ var rule = _step.value;
1677
+ if (process.env.NODE_ENV === "production") try {
1678
+ sheet.insertRule(rule, sheet.cssRules.length);
1679
+ } catch (err) {
1680
+ console.error("Error inserting CSS", err);
1687
1681
  }
1688
- } catch (err) {
1689
- _didIteratorError = !0, _iteratorError = err;
1682
+ else sheet.insertRule(rule, sheet.cssRules.length);
1683
+ }
1684
+ } catch (err) {
1685
+ _didIteratorError = !0, _iteratorError = err;
1686
+ } finally {
1687
+ try {
1688
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1690
1689
  } finally {
1691
- try {
1692
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1693
- } finally {
1694
- if (_didIteratorError) throw _iteratorError;
1695
- }
1690
+ if (_didIteratorError) throw _iteratorError;
1696
1691
  }
1697
1692
  }
1698
1693
  }
@@ -1700,7 +1695,7 @@ var require_insertStyleRule_native = __commonJS({
1700
1695
  }
1701
1696
  var minInsertAmt = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
1702
1697
  function shouldInsertStyleRules(identifier) {
1703
- if (process.env.TAMAGUI_REACT_19 || process.env.IS_STATIC === "is_static") return !0;
1698
+ if (process.env.IS_STATIC === "is_static") return !0;
1704
1699
  var total = totalSelectorsInserted.get(identifier);
1705
1700
  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;
1706
1701
  }
@@ -5308,7 +5303,7 @@ var require_getSplitStyles_native = __commonJS({
5308
5303
  function isValidStyleKey(key, validStyles2, accept) {
5309
5304
  return key in validStyles2 ? !0 : accept && key in accept;
5310
5305
  }
5311
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
5306
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, startedUnhydrated, debug) {
5312
5307
  var _loop = function(keyOg2) {
5313
5308
  var keyInit = keyOg2, valInit = props[keyInit];
5314
5309
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -5775,12 +5770,13 @@ var require_getSplitStyles_native = __commonJS({
5775
5770
  }
5776
5771
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
5777
5772
  }, useInsertEffectCompat = import_constants2.isWeb ? import_react3.default.useInsertionEffect || import_constants2.useIsomorphicLayoutEffect : function() {
5778
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
5773
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
5779
5774
  conf = conf || (0, import_config.getConfig)();
5780
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
5775
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
5781
5776
  return res;
5782
5777
  };
5783
5778
  function addStyleToInsertRules(rulesToInsert, styleObject) {
5779
+ var startedUnhydrated = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
5784
5780
  if (0) var identifier;
5785
5781
  }
5786
5782
  var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
@@ -6932,9 +6928,9 @@ var require_wrapStyleTags_native = __commonJS({
6932
6928
  }
6933
6929
  });
6934
6930
  module2.exports = __toCommonJS2(wrapStyleTags_exports);
6935
- var import_jsx_runtime = require("react/jsx-runtime"), import_helpers2 = require_index_native3();
6931
+ var import_jsx_runtime = require("react/jsx-runtime"), import_helpers2 = require_index_native3(), import_constants2 = require_index_native2();
6936
6932
  function wrapStyleTags(styles, content) {
6937
- return process.env.TAMAGUI_REACT_19, content;
6933
+ return import_constants2.IS_REACT_19, content;
6938
6934
  }
6939
6935
  }
6940
6936
  });
@@ -7052,7 +7048,7 @@ var require_useComponentState_native = __commonJS({
7052
7048
  });
7053
7049
  module2.exports = __toCommonJS2(useComponentState_exports);
7054
7050
  var import_constants2 = require_index_native2(), import_use_did_finish_ssr = 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) {
7055
- var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7051
+ var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), [startedUnhydrated] = (0, import_react3.useState)(import_constants2.IS_REACT_19 ? !isHydrated : !1), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7056
7052
  stateRef.current || (stateRef.current = {});
7057
7053
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
7058
7054
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -7117,6 +7113,7 @@ var require_useComponentState_native = __commonJS({
7117
7113
  };
7118
7114
  }
7119
7115
  return {
7116
+ startedUnhydrated,
7120
7117
  curStateRef,
7121
7118
  disabled,
7122
7119
  groupName,
@@ -7478,7 +7475,7 @@ var require_createComponent_native = __commonJS({
7478
7475
  }, [
7479
7476
  componentName2
7480
7477
  ]);
7481
- var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
7478
+ var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
7482
7479
  process.env.NODE_ENV === "development" && time2 && time2`use-state`;
7483
7480
  var hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants2.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
7484
7481
  animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
@@ -7538,7 +7535,7 @@ var require_createComponent_native = __commonJS({
7538
7535
  styledContextProps
7539
7536
  }, themeName = (themeState == null ? void 0 : themeState.name) || "";
7540
7537
  process.env.NODE_ENV === "development" && time2 && time2`split-styles-prepare`;
7541
- var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, debugProp);
7538
+ var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7542
7539
  if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
7543
7540
  var _splitStyles;
7544
7541
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
@@ -7836,8 +7833,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7836
7833
  children: content
7837
7834
  });
7838
7835
  }
7839
- var { rulesToInsert } = splitStyles;
7840
- if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
7836
+ if (process.env.NODE_ENV === "development" && time2 && time2`context-override`, process.env.NODE_ENV === "development" && time2 && time2`style-tags`, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
7841
7837
  var element1 = typeof elementType == "string" ? elementType : "Component", title = `render <${element1} /> (${internalID}) with props`;
7842
7838
  if (import_constants2.isWeb) {
7843
7839
  (0, import_consoleLog.groupCollapsed)(title);
@@ -8736,7 +8732,7 @@ var require_createTamagui_native = __commonJS({
8736
8732
  var foundThemes;
8737
8733
  if (configIn.themes) {
8738
8734
  var noThemes = Object.keys(configIn.themes).length === 0;
8739
- noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), process.env.TAMAGUI_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
8735
+ noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), import_constants2.IS_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
8740
8736
  }
8741
8737
  var fontSizeTokens = null, fontsParsed;
8742
8738
  if (configIn.fonts) {
@@ -10213,7 +10209,7 @@ var require_TamaguiProvider_native = __commonJS({
10213
10209
  }), didRender = !0, function() {
10214
10210
  didRender = !1;
10215
10211
  };
10216
- }, []), process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
10212
+ }, []), import_constants2.IS_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
10217
10213
  if (config && !disableInjectCSS) {
10218
10214
  var style = document.createElement("style");
10219
10215
  return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {