tamagui 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.
@@ -2571,39 +2571,36 @@ var require_insertStyleRule_native = __commonJS({
2571
2571
  }
2572
2572
  var bailAfterEnv = process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES, bailAfter = bailAfterEnv ? +bailAfterEnv : 700, sheet = null;
2573
2573
  function updateRules(identifier, rules) {
2574
- if (!process.env.TAMAGUI_REACT_19) return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
2574
+ return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform-") ? addTransform(identifier, rules[0]) : !0);
2575
2575
  }
2576
2576
  var nonce = "";
2577
2577
  function setNonce2(_) {
2578
2578
  nonce = _;
2579
2579
  }
2580
2580
  function insertStyleRules(rulesToInsert) {
2581
- if (!process.env.TAMAGUI_REACT_19) {
2582
- if (!sheet && import_constants4.isClient && document.head) {
2583
- var styleTag = document.createElement("style");
2584
- nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
2585
- }
2586
- if (!sheet) return;
2587
- for (var key in rulesToInsert) {
2588
- var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers.StyleObjectIdentifier];
2589
- if (shouldInsertStyleRules(identifier)) {
2590
- var rules = styleObject[import_helpers.StyleObjectRules];
2591
- allSelectors[identifier] = rules.join(`
2581
+ if (!sheet && import_constants4.isClient && document.head) {
2582
+ var styleTag = document.createElement("style");
2583
+ nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
2584
+ }
2585
+ if (sheet) for (var key in rulesToInsert) {
2586
+ var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers.StyleObjectIdentifier];
2587
+ if (shouldInsertStyleRules(identifier)) {
2588
+ var rules = styleObject[import_helpers.StyleObjectRules];
2589
+ allSelectors[identifier] = rules.join(`
2592
2590
  `), track(identifier), updateRules(identifier, rules);
2593
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2591
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2592
+ try {
2593
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2594
+ var rule = _step.value;
2595
+ sheet.insertRule(rule, sheet.cssRules.length);
2596
+ }
2597
+ } catch (err) {
2598
+ _didIteratorError = !0, _iteratorError = err;
2599
+ } finally {
2594
2600
  try {
2595
- for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2596
- var rule = _step.value;
2597
- sheet.insertRule(rule, sheet.cssRules.length);
2598
- }
2599
- } catch (err) {
2600
- _didIteratorError = !0, _iteratorError = err;
2601
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2601
2602
  } finally {
2602
- try {
2603
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2604
- } finally {
2605
- if (_didIteratorError) throw _iteratorError;
2606
- }
2603
+ if (_didIteratorError) throw _iteratorError;
2607
2604
  }
2608
2605
  }
2609
2606
  }
@@ -2611,7 +2608,7 @@ var require_insertStyleRule_native = __commonJS({
2611
2608
  }
2612
2609
  var minInsertAmt = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
2613
2610
  function shouldInsertStyleRules(identifier) {
2614
- if (process.env.TAMAGUI_REACT_19 || process.env.IS_STATIC === "is_static") return !0;
2611
+ if (process.env.IS_STATIC === "is_static") return !0;
2615
2612
  var total = totalSelectorsInserted.get(identifier);
2616
2613
  return total === void 0 || total < minInsertAmt;
2617
2614
  }
@@ -6122,7 +6119,7 @@ var require_getSplitStyles_native = __commonJS({
6122
6119
  function isValidStyleKey(key, validStyles, accept) {
6123
6120
  return key in validStyles ? !0 : accept && key in accept;
6124
6121
  }
6125
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
6122
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, startedUnhydrated, debug) {
6126
6123
  var _loop = function(keyOg2) {
6127
6124
  var keyInit = keyOg2, valInit = props[keyInit];
6128
6125
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -6505,12 +6502,13 @@ var require_getSplitStyles_native = __commonJS({
6505
6502
  }
6506
6503
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
6507
6504
  }, useInsertEffectCompat = import_constants4.isWeb ? import_react3.default.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : function() {
6508
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
6505
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
6509
6506
  conf = conf || (0, import_config.getConfig)();
6510
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
6507
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
6511
6508
  return res;
6512
6509
  };
6513
6510
  function addStyleToInsertRules(rulesToInsert, styleObject) {
6511
+ var startedUnhydrated = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
6514
6512
  if (0) var identifier;
6515
6513
  }
6516
6514
  var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = {
@@ -7619,9 +7617,9 @@ var require_wrapStyleTags_native = __commonJS({
7619
7617
  }
7620
7618
  });
7621
7619
  module2.exports = __toCommonJS2(wrapStyleTags_exports);
7622
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_helpers = require_index_native7();
7620
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_helpers = require_index_native7(), import_constants4 = require_index_native6();
7623
7621
  function wrapStyleTags(styles, content) {
7624
- return process.env.TAMAGUI_REACT_19, content;
7622
+ return import_constants4.IS_REACT_19, content;
7625
7623
  }
7626
7624
  }
7627
7625
  });
@@ -7739,7 +7737,7 @@ var require_useComponentState_native = __commonJS({
7739
7737
  });
7740
7738
  module2.exports = __toCommonJS2(useComponentState_exports);
7741
7739
  var import_constants4 = require_index_native6(), import_use_did_finish_ssr = require_index_native13(), 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) {
7742
- 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);
7740
+ var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), [startedUnhydrated] = (0, import_react3.useState)(import_constants4.IS_REACT_19 ? !isHydrated : !1), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7743
7741
  stateRef.current || (stateRef.current = {});
7744
7742
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
7745
7743
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -7799,6 +7797,7 @@ var require_useComponentState_native = __commonJS({
7799
7797
  };
7800
7798
  }
7801
7799
  return {
7800
+ startedUnhydrated,
7802
7801
  curStateRef,
7803
7802
  disabled,
7804
7803
  groupName,
@@ -8110,7 +8109,7 @@ var require_createComponent_native = __commonJS({
8110
8109
  ...styledContextProps
8111
8110
  } : defaultProps, props = propsIn;
8112
8111
  curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
8113
- 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_constants4.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
8112
+ 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_constants4.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
8114
8113
  animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
8115
8114
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
8116
8115
  props.themeShallow && (curStateRef.themeShallow = !0);
@@ -8141,7 +8140,7 @@ var require_createComponent_native = __commonJS({
8141
8140
  isAnimated,
8142
8141
  willBeAnimated,
8143
8142
  styledContextProps
8144
- }, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, debugProp);
8143
+ }, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
8145
8144
  if (props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
8146
8145
  var _splitStyles;
8147
8146
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
@@ -8403,7 +8402,6 @@ var require_createComponent_native = __commonJS({
8403
8402
  children: content
8404
8403
  });
8405
8404
  }
8406
- var { rulesToInsert } = splitStyles;
8407
8405
  if (0) {
8408
8406
  var element1, title;
8409
8407
  if (!import_constants4.isWeb)
@@ -9264,7 +9262,7 @@ var require_createTamagui_native = __commonJS({
9264
9262
  var foundThemes;
9265
9263
  if (configIn.themes) {
9266
9264
  var noThemes = Object.keys(configIn.themes).length === 0;
9267
- noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), process.env.TAMAGUI_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
9265
+ noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), import_constants4.IS_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
9268
9266
  }
9269
9267
  var fontSizeTokens = null, fontsParsed;
9270
9268
  if (configIn.fonts) {
@@ -10737,7 +10735,7 @@ var require_TamaguiProvider_native = __commonJS({
10737
10735
  }), didRender = !0, function() {
10738
10736
  didRender = !1;
10739
10737
  };
10740
- }, []), process.env.TAMAGUI_REACT_19 || import_constants4.isClient && (0, import_constants4.useIsomorphicLayoutEffect)(function() {
10738
+ }, []), import_constants4.IS_REACT_19 || import_constants4.isClient && (0, import_constants4.useIsomorphicLayoutEffect)(function() {
10741
10739
  if (config && !disableInjectCSS) {
10742
10740
  var style = document.createElement("style");
10743
10741
  return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {