@tamagui/core 1.126.16 → 1.126.18

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.
@@ -1472,39 +1472,36 @@ var require_insertStyleRule_native = __commonJS({
1472
1472
  }
1473
1473
  var bailAfterEnv = process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES, bailAfter = bailAfterEnv ? +bailAfterEnv : 700, sheet = null;
1474
1474
  function updateRules(identifier, rules) {
1475
- if (!process.env.TAMAGUI_REACT_19) return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
1475
+ return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
1476
1476
  }
1477
1477
  var nonce = "";
1478
1478
  function setNonce2(_) {
1479
1479
  nonce = _;
1480
1480
  }
1481
1481
  function insertStyleRules(rulesToInsert) {
1482
- if (!process.env.TAMAGUI_REACT_19) {
1483
- if (!sheet && import_constants2.isClient && document.head) {
1484
- var styleTag = document.createElement("style");
1485
- nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
1486
- }
1487
- if (!sheet) return;
1488
- for (var key in rulesToInsert) {
1489
- var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers2.StyleObjectIdentifier];
1490
- if (shouldInsertStyleRules(identifier)) {
1491
- var rules = styleObject[import_helpers2.StyleObjectRules];
1492
- allSelectors[identifier] = rules.join(`
1482
+ if (!sheet && import_constants2.isClient && document.head) {
1483
+ var styleTag = document.createElement("style");
1484
+ nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
1485
+ }
1486
+ if (sheet) for (var key in rulesToInsert) {
1487
+ var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers2.StyleObjectIdentifier];
1488
+ if (shouldInsertStyleRules(identifier)) {
1489
+ var rules = styleObject[import_helpers2.StyleObjectRules];
1490
+ allSelectors[identifier] = rules.join(`
1493
1491
  `), track(identifier), updateRules(identifier, rules);
1494
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1492
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
1493
+ try {
1494
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1495
+ var rule = _step.value;
1496
+ sheet.insertRule(rule, sheet.cssRules.length);
1497
+ }
1498
+ } catch (err) {
1499
+ _didIteratorError = !0, _iteratorError = err;
1500
+ } finally {
1495
1501
  try {
1496
- for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
1497
- var rule = _step.value;
1498
- sheet.insertRule(rule, sheet.cssRules.length);
1499
- }
1500
- } catch (err) {
1501
- _didIteratorError = !0, _iteratorError = err;
1502
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1502
1503
  } finally {
1503
- try {
1504
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1505
- } finally {
1506
- if (_didIteratorError) throw _iteratorError;
1507
- }
1504
+ if (_didIteratorError) throw _iteratorError;
1508
1505
  }
1509
1506
  }
1510
1507
  }
@@ -1512,7 +1509,7 @@ var require_insertStyleRule_native = __commonJS({
1512
1509
  }
1513
1510
  var minInsertAmt = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
1514
1511
  function shouldInsertStyleRules(identifier) {
1515
- if (process.env.TAMAGUI_REACT_19 || process.env.IS_STATIC === "is_static") return !0;
1512
+ if (process.env.IS_STATIC === "is_static") return !0;
1516
1513
  var total = totalSelectorsInserted.get(identifier);
1517
1514
  return total === void 0 || total < minInsertAmt;
1518
1515
  }
@@ -5023,7 +5020,7 @@ var require_getSplitStyles_native = __commonJS({
5023
5020
  function isValidStyleKey(key, validStyles2, accept) {
5024
5021
  return key in validStyles2 ? !0 : accept && key in accept;
5025
5022
  }
5026
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
5023
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, startedUnhydrated, debug) {
5027
5024
  var _loop = function(keyOg2) {
5028
5025
  var keyInit = keyOg2, valInit = props[keyInit];
5029
5026
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -5406,12 +5403,13 @@ var require_getSplitStyles_native = __commonJS({
5406
5403
  }
5407
5404
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
5408
5405
  }, useInsertEffectCompat = import_constants2.isWeb ? import_react3.default.useInsertionEffect || import_constants2.useIsomorphicLayoutEffect : function() {
5409
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
5406
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
5410
5407
  conf = conf || (0, import_config.getConfig)();
5411
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
5408
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
5412
5409
  return res;
5413
5410
  };
5414
5411
  function addStyleToInsertRules(rulesToInsert, styleObject) {
5412
+ var startedUnhydrated = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
5415
5413
  if (0) var identifier;
5416
5414
  }
5417
5415
  var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
@@ -6520,9 +6518,9 @@ var require_wrapStyleTags_native = __commonJS({
6520
6518
  }
6521
6519
  });
6522
6520
  module2.exports = __toCommonJS2(wrapStyleTags_exports);
6523
- var import_jsx_runtime = require("react/jsx-runtime"), import_helpers2 = require_index_native3();
6521
+ var import_jsx_runtime = require("react/jsx-runtime"), import_helpers2 = require_index_native3(), import_constants2 = require_index_native2();
6524
6522
  function wrapStyleTags(styles, content) {
6525
- return process.env.TAMAGUI_REACT_19, content;
6523
+ return import_constants2.IS_REACT_19, content;
6526
6524
  }
6527
6525
  }
6528
6526
  });
@@ -6640,7 +6638,7 @@ var require_useComponentState_native = __commonJS({
6640
6638
  });
6641
6639
  module2.exports = __toCommonJS2(useComponentState_exports);
6642
6640
  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) {
6643
- 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);
6641
+ 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);
6644
6642
  stateRef.current || (stateRef.current = {});
6645
6643
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
6646
6644
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -6700,6 +6698,7 @@ var require_useComponentState_native = __commonJS({
6700
6698
  };
6701
6699
  }
6702
6700
  return {
6701
+ startedUnhydrated,
6703
6702
  curStateRef,
6704
6703
  disabled,
6705
6704
  groupName,
@@ -7011,7 +7010,7 @@ var require_createComponent_native = __commonJS({
7011
7010
  ...styledContextProps
7012
7011
  } : defaultProps, props = propsIn;
7013
7012
  curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
7014
- var componentName2 = props.componentName || staticConfig.componentName, 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), 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;
7013
+ var componentName2 = props.componentName || staticConfig.componentName, 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), 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;
7015
7014
  animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
7016
7015
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
7017
7016
  props.themeShallow && (curStateRef.themeShallow = !0);
@@ -7042,7 +7041,7 @@ var require_createComponent_native = __commonJS({
7042
7041
  isAnimated,
7043
7042
  willBeAnimated,
7044
7043
  styledContextProps
7045
- }, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, debugProp);
7044
+ }, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7046
7045
  if (props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
7047
7046
  var _splitStyles;
7048
7047
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
@@ -7304,7 +7303,6 @@ var require_createComponent_native = __commonJS({
7304
7303
  children: content
7305
7304
  });
7306
7305
  }
7307
- var { rulesToInsert } = splitStyles;
7308
7306
  if (0) {
7309
7307
  var element1, title;
7310
7308
  if (!import_constants2.isWeb)
@@ -8165,7 +8163,7 @@ var require_createTamagui_native = __commonJS({
8165
8163
  var foundThemes;
8166
8164
  if (configIn.themes) {
8167
8165
  var noThemes = Object.keys(configIn.themes).length === 0;
8168
- noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), process.env.TAMAGUI_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
8166
+ noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), import_constants2.IS_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
8169
8167
  }
8170
8168
  var fontSizeTokens = null, fontsParsed;
8171
8169
  if (configIn.fonts) {
@@ -9638,7 +9636,7 @@ var require_TamaguiProvider_native = __commonJS({
9638
9636
  }), didRender = !0, function() {
9639
9637
  didRender = !1;
9640
9638
  };
9641
- }, []), process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
9639
+ }, []), import_constants2.IS_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
9642
9640
  if (config && !disableInjectCSS) {
9643
9641
  var style = document.createElement("style");
9644
9642
  return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {