@tamagui/core 1.101.4 → 1.101.6

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
@@ -2671,45 +2671,34 @@ var require_insertStyleRule_native = __commonJS({
2671
2671
  }
2672
2672
  function insertStyleRules(rulesToInsert) {
2673
2673
  if (!process.env.TAMAGUI_REACT_19) {
2674
- if (!rulesToInsert.length || !sheet) return;
2675
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2676
- try {
2677
- for (var _iterator = rulesToInsert[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2678
- var styleObject = _step.value, identifier = styleObject[import_helpers.StyleObjectIdentifier];
2679
- if (shouldInsertStyleRules(identifier)) {
2680
- var rules = styleObject[import_helpers.StyleObjectRules];
2681
- allSelectors[identifier] = rules.join(`
2674
+ if (!sheet) return;
2675
+ for (var key in rulesToInsert) {
2676
+ var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers.StyleObjectIdentifier];
2677
+ if (shouldInsertStyleRules(identifier)) {
2678
+ var rules = styleObject[import_helpers.StyleObjectRules];
2679
+ allSelectors[identifier] = rules.join(`
2682
2680
  `), track(identifier), updateRules(identifier, rules);
2683
- var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
2684
- try {
2685
- for (var _iterator1 = rules[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
2686
- var rule = _step1.value;
2687
- if (process.env.NODE_ENV === "production") try {
2688
- sheet.insertRule(rule, sheet.cssRules.length);
2689
- } catch (err) {
2690
- console.error("Error inserting CSS", err);
2691
- }
2692
- else sheet.insertRule(rule, sheet.cssRules.length);
2681
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2682
+ try {
2683
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2684
+ var rule = _step.value;
2685
+ if (process.env.NODE_ENV === "production") try {
2686
+ sheet.insertRule(rule, sheet.cssRules.length);
2687
+ } catch (err) {
2688
+ console.error("Error inserting CSS", err);
2693
2689
  }
2694
- } catch (err) {
2695
- _didIteratorError1 = !0, _iteratorError1 = err;
2690
+ else sheet.insertRule(rule, sheet.cssRules.length);
2691
+ }
2692
+ } catch (err) {
2693
+ _didIteratorError = !0, _iteratorError = err;
2694
+ } finally {
2695
+ try {
2696
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2696
2697
  } finally {
2697
- try {
2698
- !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
2699
- } finally {
2700
- if (_didIteratorError1) throw _iteratorError1;
2701
- }
2698
+ if (_didIteratorError) throw _iteratorError;
2702
2699
  }
2703
2700
  }
2704
2701
  }
2705
- } catch (err) {
2706
- _didIteratorError = !0, _iteratorError = err;
2707
- } finally {
2708
- try {
2709
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2710
- } finally {
2711
- if (_didIteratorError) throw _iteratorError;
2712
- }
2713
2702
  }
2714
2703
  }
2715
2704
  }
@@ -7711,7 +7700,7 @@ current`, _object_spread2({}, styleState.style)));
7711
7700
  try {
7712
7701
  for (var _iterator = pseudoStyles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
7713
7702
  var psuedoStyle = _step.value, fullKey = "".concat(psuedoStyle[import_helpers.StyleObjectProperty]).concat(PROP_SPLIT).concat(descriptor.name);
7714
- fullKey in usedKeys || mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo1, !0);
7703
+ fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo1, !0));
7715
7704
  }
7716
7705
  } catch (err) {
7717
7706
  _didIteratorError = !0, _iteratorError = err;
@@ -7793,7 +7782,7 @@ current`, _object_spread2({}, styleState.style)));
7793
7782
  var style = _step1.value, out = (0, import_createMediaStyle.createMediaStyle)(style, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
7794
7783
  process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
7795
7784
  var fullKey1 = "".concat(style[import_helpers.StyleObjectProperty]).concat(PROP_SPLIT).concat(mediaKeyShort).concat(style[import_helpers.StyleObjectPseudo] || "");
7796
- fullKey1 in usedKeys || mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0);
7785
+ fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[import_helpers.StyleObjectIdentifier], !0, !0));
7797
7786
  }
7798
7787
  } catch (err) {
7799
7788
  _didIteratorError1 = !0, _iteratorError1 = err;
@@ -8038,7 +8027,11 @@ current`, _object_spread2({}, styleState.style)));
8038
8027
  conf = conf || (0, import_config.getConfig)();
8039
8028
  var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
8040
8029
  return res;
8041
- }, defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = _object_spread_props(_object_spread2({}, Object.fromEntries(Object.entries(import_helpers.tokenCategories.color).map(function(param) {
8030
+ };
8031
+ function addStyleToInsertRules(rulesToInsert, styleObject) {
8032
+ if (0) var identifier;
8033
+ }
8034
+ var defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", animatableDefaults = _object_spread_props(_object_spread2({}, Object.fromEntries(Object.entries(import_helpers.tokenCategories.color).map(function(param) {
8042
8035
  var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
8043
8036
  return [
8044
8037
  k,
@@ -9664,23 +9657,27 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9664
9657
  children: content
9665
9658
  }));
9666
9659
  }
9667
- if (process.env.TAMAGUI_REACT_19 && splitStyles.rulesToInsert.length && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
9668
- children: [
9669
- content,
9670
- /* lets see if we can put a single style tag per rule for optimal de-duping */
9671
- splitStyles.rulesToInsert.map(function(styleObject) {
9672
- var identifier = styleObject[import_helpers.StyleObjectIdentifier];
9673
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
9674
- // @ts-ignore
9675
- href: "t_".concat(identifier),
9676
- // @ts-ignore
9677
- precedence: "default",
9678
- children: styleObject[import_helpers.StyleObjectRules].join(`
9660
+ if (process.env.TAMAGUI_REACT_19) {
9661
+ var rulesToInsert = splitStyles.rulesToInsert, keys = Object.keys(splitStyles.rulesToInsert);
9662
+ keys.length && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
9663
+ children: [
9664
+ content,
9665
+ /* lets see if we can put a single style tag per rule for optimal de-duping */
9666
+ keys.map(function(key3) {
9667
+ var styleObject = rulesToInsert[key3], identifier = styleObject[import_helpers.StyleObjectIdentifier];
9668
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
9669
+ // @ts-ignore
9670
+ href: "t_".concat(identifier),
9671
+ // @ts-ignore
9672
+ precedence: "default",
9673
+ children: styleObject[import_helpers.StyleObjectRules].join(`
9679
9674
  `)
9680
- }, identifier);
9681
- })
9682
- ]
9683
- })), process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
9675
+ }, identifier);
9676
+ })
9677
+ ]
9678
+ }));
9679
+ }
9680
+ if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
9684
9681
  var element1 = typeof elementType == "string" ? elementType : "Component", title = "render <".concat(element1, " /> (").concat(internalID, ") with props");
9685
9682
  if (import_constants.isWeb) {
9686
9683
  console.groupCollapsed(title);
@@ -9793,10 +9790,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9793
9790
  }
9794
9791
  });
9795
9792
  function spacedChildren(props) {
9796
- var _childrenList__type, _childrenList_, isZStack = props.isZStack, children = props.children, space = props.space, direction = props.direction, spaceFlex = props.spaceFlex, separator = props.separator, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null;
9797
- if (!(hasSpace || hasSeparator || isZStack)) return children;
9798
- var childrenList = import_react3.Children.toArray(children), len = childrenList.length;
9799
- if (len <= 1 && !isZStack && !(!((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 || (_childrenList__type = _childrenList_.type) === null || _childrenList__type === void 0) && _childrenList__type.shouldForwardSpace)) return childrenList;
9793
+ var _childrenList__type, _childrenList_, isZStack = props.isZStack, children = props.children, space = props.space, direction = props.direction, spaceFlex = props.spaceFlex, separator = props.separator, ensureKeys = props.ensureKeys, hasSpace = !!(space || spaceFlex), hasSeparator = separator != null, areChildrenArray = Array.isArray(children);
9794
+ if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) return children;
9795
+ var childrenList = areChildrenArray ? children : import_react3.Children.toArray(children), len = childrenList.length;
9796
+ if (len <= 1 && !isZStack && !(!((_childrenList_ = childrenList[0]) === null || _childrenList_ === void 0 || (_childrenList__type = _childrenList_.type) === null || _childrenList__type === void 0) && _childrenList__type.shouldForwardSpace)) return children;
9800
9797
  var final = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
9801
9798
  try {
9802
9799
  for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
@@ -9810,22 +9807,22 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9810
9807
  children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, {
9811
9808
  children: child
9812
9809
  }) : child
9813
- }, index)), !(isUnspaced(child) && index === 0) && !isZStack) {
9810
+ }, "".concat(index, "0t"))), !(isUnspaced(child) && index === 0) && !isZStack) {
9814
9811
  var next = childrenList[index + 1];
9815
- next && !isUnspaced(next) && (separator ? (hasSpace && final.push(createSpacer({
9816
- key: "_".concat(index, "_00tmgui"),
9812
+ next && !isEmpty && !isUnspaced(next) && (separator ? (hasSpace && final.push(createSpacer({
9813
+ key: "_".concat(index, "_00t"),
9817
9814
  direction,
9818
9815
  space,
9819
9816
  spaceFlex
9820
- })), final.push(/* @__PURE__ */ import_react3.default.isValidElement(separator) ? /* @__PURE__ */ import_react3.default.cloneElement(separator, {
9821
- key: "sep_".concat(index)
9822
- }) : separator), hasSpace && final.push(createSpacer({
9823
- key: "_".concat(index, "01tmgui"),
9817
+ })), final.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react3.Fragment, {
9818
+ children: separator
9819
+ }, "".concat(index, "03t"))), hasSpace && final.push(createSpacer({
9820
+ key: "_".concat(index, "01t"),
9824
9821
  direction,
9825
9822
  space,
9826
9823
  spaceFlex
9827
9824
  }))) : final.push(createSpacer({
9828
- key: "_".concat(index, "02tmgui"),
9825
+ key: "_".concat(index, "02t"),
9829
9826
  direction,
9830
9827
  space,
9831
9828
  spaceFlex