tamagui 1.101.4 → 1.101.5

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
@@ -2754,44 +2754,33 @@ var require_insertStyleRule_native = __commonJS({
2754
2754
  function insertStyleRules(rulesToInsert) {
2755
2755
  if (!process.env.TAMAGUI_REACT_19) {
2756
2756
  if (!rulesToInsert.length || !sheet) return;
2757
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2758
- try {
2759
- for (var _iterator = rulesToInsert[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2760
- var styleObject = _step.value, identifier = styleObject[import_helpers.StyleObjectIdentifier];
2761
- if (shouldInsertStyleRules(identifier)) {
2762
- var rules = styleObject[import_helpers.StyleObjectRules];
2763
- allSelectors[identifier] = rules.join(`
2757
+ for (var key in rulesToInsert) {
2758
+ var styleObject = rulesToInsert[key], identifier = styleObject[import_helpers.StyleObjectIdentifier];
2759
+ if (shouldInsertStyleRules(identifier)) {
2760
+ var rules = styleObject[import_helpers.StyleObjectRules];
2761
+ allSelectors[identifier] = rules.join(`
2764
2762
  `), track(identifier), updateRules(identifier, rules);
2765
- var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
2766
- try {
2767
- for (var _iterator1 = rules[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
2768
- var rule = _step1.value;
2769
- if (process.env.NODE_ENV === "production") try {
2770
- sheet.insertRule(rule, sheet.cssRules.length);
2771
- } catch (err) {
2772
- console.error("Error inserting CSS", err);
2773
- }
2774
- else sheet.insertRule(rule, sheet.cssRules.length);
2763
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2764
+ try {
2765
+ for (var _iterator = rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
2766
+ var rule = _step.value;
2767
+ if (process.env.NODE_ENV === "production") try {
2768
+ sheet.insertRule(rule, sheet.cssRules.length);
2769
+ } catch (err) {
2770
+ console.error("Error inserting CSS", err);
2775
2771
  }
2776
- } catch (err) {
2777
- _didIteratorError1 = !0, _iteratorError1 = err;
2772
+ else sheet.insertRule(rule, sheet.cssRules.length);
2773
+ }
2774
+ } catch (err) {
2775
+ _didIteratorError = !0, _iteratorError = err;
2776
+ } finally {
2777
+ try {
2778
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2778
2779
  } finally {
2779
- try {
2780
- !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
2781
- } finally {
2782
- if (_didIteratorError1) throw _iteratorError1;
2783
- }
2780
+ if (_didIteratorError) throw _iteratorError;
2784
2781
  }
2785
2782
  }
2786
2783
  }
2787
- } catch (err) {
2788
- _didIteratorError = !0, _iteratorError = err;
2789
- } finally {
2790
- try {
2791
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2792
- } finally {
2793
- if (_didIteratorError) throw _iteratorError;
2794
- }
2795
2784
  }
2796
2785
  }
2797
2786
  }
@@ -9746,23 +9735,27 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9746
9735
  children: content
9747
9736
  }));
9748
9737
  }
9749
- if (process.env.TAMAGUI_REACT_19 && splitStyles.rulesToInsert.length && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, {
9750
- children: [
9751
- content,
9752
- /* lets see if we can put a single style tag per rule for optimal de-duping */
9753
- splitStyles.rulesToInsert.map(function(styleObject) {
9754
- var identifier = styleObject[import_helpers.StyleObjectIdentifier];
9755
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", {
9756
- // @ts-ignore
9757
- href: "t_".concat(identifier),
9758
- // @ts-ignore
9759
- precedence: "default",
9760
- children: styleObject[import_helpers.StyleObjectRules].join(`
9738
+ if (process.env.TAMAGUI_REACT_19) {
9739
+ var rulesToInsert = splitStyles.rulesToInsert, keys = Object.keys(splitStyles.rulesToInsert);
9740
+ keys.length && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, {
9741
+ children: [
9742
+ content,
9743
+ /* lets see if we can put a single style tag per rule for optimal de-duping */
9744
+ keys.map(function(key3) {
9745
+ var styleObject = rulesToInsert[key3], identifier = styleObject[import_helpers.StyleObjectIdentifier];
9746
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", {
9747
+ // @ts-ignore
9748
+ href: "t_".concat(identifier),
9749
+ // @ts-ignore
9750
+ precedence: "default",
9751
+ children: styleObject[import_helpers.StyleObjectRules].join(`
9761
9752
  `)
9762
- }, identifier);
9763
- })
9764
- ]
9765
- })), process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
9753
+ }, identifier);
9754
+ })
9755
+ ]
9756
+ }));
9757
+ }
9758
+ if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
9766
9759
  var element1 = typeof elementType == "string" ? elementType : "Component", title = "render <".concat(element1, " /> (").concat(internalID, ") with props");
9767
9760
  if (import_constants4.isWeb) {
9768
9761
  console.groupCollapsed(title);
@@ -9875,10 +9868,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9875
9868
  }
9876
9869
  });
9877
9870
  function spacedChildren2(props) {
9878
- 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;
9879
- if (!(hasSpace || hasSeparator || isZStack)) return children;
9880
- var childrenList = import_react4.Children.toArray(children), len = childrenList.length;
9881
- 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;
9871
+ 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);
9872
+ if (!ensureKeys && !(hasSpace || hasSeparator || isZStack)) return children;
9873
+ var childrenList = areChildrenArray ? children : import_react4.Children.toArray(children), len = childrenList.length;
9874
+ 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;
9882
9875
  var final = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
9883
9876
  try {
9884
9877
  for (var _iterator = childrenList.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
@@ -9892,22 +9885,22 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9892
9885
  children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AbsoluteFill, {
9893
9886
  children: child
9894
9887
  }) : child
9895
- }, index)), !(isUnspaced(child) && index === 0) && !isZStack) {
9888
+ }, "".concat(index, "0t"))), !(isUnspaced(child) && index === 0) && !isZStack) {
9896
9889
  var next = childrenList[index + 1];
9897
- next && !isUnspaced(next) && (separator ? (hasSpace && final.push(createSpacer({
9898
- key: "_".concat(index, "_00tmgui"),
9890
+ next && !isEmpty && !isUnspaced(next) && (separator ? (hasSpace && final.push(createSpacer({
9891
+ key: "_".concat(index, "_00t"),
9899
9892
  direction,
9900
9893
  space,
9901
9894
  spaceFlex
9902
- })), final.push(/* @__PURE__ */ import_react4.default.isValidElement(separator) ? /* @__PURE__ */ import_react4.default.cloneElement(separator, {
9903
- key: "sep_".concat(index)
9904
- }) : separator), hasSpace && final.push(createSpacer({
9905
- key: "_".concat(index, "01tmgui"),
9895
+ })), final.push(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react4.Fragment, {
9896
+ children: separator
9897
+ }, "".concat(index, "03t"))), hasSpace && final.push(createSpacer({
9898
+ key: "_".concat(index, "01t"),
9906
9899
  direction,
9907
9900
  space,
9908
9901
  spaceFlex
9909
9902
  }))) : final.push(createSpacer({
9910
- key: "_".concat(index, "02tmgui"),
9903
+ key: "_".concat(index, "02t"),
9911
9904
  direction,
9912
9905
  space,
9913
9906
  spaceFlex
@@ -23570,8 +23563,11 @@ var require_Button_native = __commonJS({
23570
23563
  // a bit arbitrary but scaling to font size is necessary so long as button does
23571
23564
  space: spaceSize,
23572
23565
  spaceFlex,
23566
+ ensureKeys: !0,
23573
23567
  separator,
23574
23568
  direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
23569
+ // for keys to stay the same we keep indices as similar a possible
23570
+ // so even if icons are undefined we still pass them
23575
23571
  children: [
23576
23572
  themedIcon
23577
23573
  ].concat(_to_consumable_array2(contents), [
@@ -29992,11 +29988,11 @@ var require_Popper_native = __commonJS({
29992
29988
  "virtualRef",
29993
29989
  "__scopePopper"
29994
29990
  ]), _usePopperContext = usePopperContext(__scopePopper), getReferenceProps = _usePopperContext.getReferenceProps, refs = _usePopperContext.refs, ref = React2.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref, refs.setReference);
29995
- if (React2.useEffect(function() {
29991
+ React2.useEffect(function() {
29996
29992
  virtualRef && refs.setReference(virtualRef.current);
29997
29993
  }, [
29998
29994
  virtualRef
29999
- ]), virtualRef) return null;
29995
+ ]);
30000
29996
  var stackProps = _object_spread9({
30001
29997
  ref: composedRefs
30002
29998
  }, anchorProps);
@@ -30457,6 +30453,18 @@ var require_Popover_native = __commonJS({
30457
30453
  var __scopePopover = props.__scopePopover, rest = _object_without_properties5(props, [
30458
30454
  "__scopePopover"
30459
30455
  ]), context = usePopoverContext(__scopePopover), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
30456
+ if (!props.children) return null;
30457
+ var trigger = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, _object_spread_props8(_object_spread9({
30458
+ "aria-haspopup": "dialog",
30459
+ "aria-expanded": context.open,
30460
+ // TODO not matching
30461
+ // aria-controls={context.contentId}
30462
+ "data-state": getState(context.open)
30463
+ }, rest), {
30464
+ // @ts-ignore
30465
+ ref: composedTriggerRef,
30466
+ onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
30467
+ }));
30460
30468
  if (anchorTo) {
30461
30469
  var virtualRef = {
30462
30470
  current: _object_spread9({
@@ -30474,21 +30482,10 @@ var require_Popover_native = __commonJS({
30474
30482
  };
30475
30483
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperAnchor, {
30476
30484
  virtualRef,
30477
- __scopePopper: __scopePopover || POPOVER_SCOPE
30485
+ __scopePopper: __scopePopover || POPOVER_SCOPE,
30486
+ children: trigger
30478
30487
  });
30479
30488
  }
30480
- if (!props.children) return null;
30481
- var trigger = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, _object_spread_props8(_object_spread9({
30482
- "aria-haspopup": "dialog",
30483
- "aria-expanded": context.open,
30484
- // TODO not matching
30485
- // aria-controls={context.contentId}
30486
- "data-state": getState(context.open)
30487
- }, rest), {
30488
- // @ts-ignore
30489
- ref: composedTriggerRef,
30490
- onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
30491
- }));
30492
30489
  return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperAnchor, {
30493
30490
  __scopePopper: __scopePopover || POPOVER_SCOPE,
30494
30491
  asChild: !0,