tamagui 1.100.0 → 1.100.1
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 +29 -15
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +29 -15
- package/dist/test.native.js.map +2 -2
- package/package.json +54 -54
package/dist/native.js
CHANGED
|
@@ -3301,8 +3301,19 @@ var require_useMedia_native = __commonJS({
|
|
|
3301
3301
|
return listeners.delete(subscriber);
|
|
3302
3302
|
};
|
|
3303
3303
|
}
|
|
3304
|
+
function useLayoutExternalStore(subscriber, getSnapshot, getServerSnapshot) {
|
|
3305
|
+
var _useState = _sliced_to_array((0, import_react4.useState)(getServerSnapshot), 2), state = _useState[0], setState = _useState[1];
|
|
3306
|
+
return (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
3307
|
+
return subscriber(function() {
|
|
3308
|
+
setState(function(prev) {
|
|
3309
|
+
var next = getSnapshot();
|
|
3310
|
+
return next !== prev ? next : prev;
|
|
3311
|
+
});
|
|
3312
|
+
});
|
|
3313
|
+
}, []), state;
|
|
3314
|
+
}
|
|
3304
3315
|
function useMedia3(uid, componentContext) {
|
|
3305
|
-
var internal = (0, import_react4.useRef)(), disableSSR = (0, import_useDisableSSR.getDisableSSR)(componentContext), initialState = (disableSSR || !import_constants4.isWeb ? mediaState3 : initState) || {}, state = (
|
|
3316
|
+
var internal = (0, import_react4.useRef)(), disableSSR = (0, import_useDisableSSR.getDisableSSR)(componentContext), initialState = (disableSSR || !import_constants4.isWeb ? mediaState3 : initState) || {}, state = useLayoutExternalStore(subscribe, function() {
|
|
3306
3317
|
if (!internal.current) return initialState;
|
|
3307
3318
|
var _internal_current = internal.current, touched = _internal_current.touched, prev = _internal_current.prev, componentState = uid ? shouldUpdate.get(uid) : void 0;
|
|
3308
3319
|
if (componentState && componentState.enabled === !1) return prev;
|
|
@@ -26351,14 +26362,17 @@ var require_Group_native = __commonJS({
|
|
|
26351
26362
|
Item: GroupItem
|
|
26352
26363
|
});
|
|
26353
26364
|
}
|
|
26354
|
-
var GroupItem = function(props) {
|
|
26365
|
+
var GroupItem = /* @__PURE__ */ import_react4.default.forwardRef(function(props, ref) {
|
|
26355
26366
|
var _children_props, __scopeGroup = props.__scopeGroup, children = props.children, forcePlacement = props.forcePlacement, groupItemProps = useGroupItem({
|
|
26356
26367
|
disabled: /* @__PURE__ */ (0, import_react4.isValidElement)(children) ? children.props.disabled : void 0
|
|
26357
26368
|
}, forcePlacement, __scopeGroup);
|
|
26358
|
-
return /* @__PURE__ */ (0, import_react4.isValidElement)(children) ? (0, import_core12.isTamaguiElement)(children) ? /* @__PURE__ */ import_react4.default.cloneElement(children, groupItemProps)
|
|
26359
|
-
|
|
26369
|
+
return /* @__PURE__ */ (0, import_react4.isValidElement)(children) ? (0, import_core12.isTamaguiElement)(children) ? /* @__PURE__ */ import_react4.default.cloneElement(children, _object_spread_props8(_object_spread9({}, groupItemProps), {
|
|
26370
|
+
ref
|
|
26371
|
+
})) : /* @__PURE__ */ import_react4.default.cloneElement(children, {
|
|
26372
|
+
style: _object_spread9({}, (_children_props = children.props) === null || _children_props === void 0 ? void 0 : _children_props.style, groupItemProps),
|
|
26373
|
+
ref
|
|
26360
26374
|
}) : children;
|
|
26361
|
-
}, useGroupItem = function(childrenProps, forcePlacement, __scopeGroup) {
|
|
26375
|
+
}), useGroupItem = function(childrenProps, forcePlacement, __scopeGroup) {
|
|
26362
26376
|
var treeIndex = (0, import_reforest.useIndex)(), context = useGroupContext("GroupItem", __scopeGroup);
|
|
26363
26377
|
if (import_react4.default.useEffect(function() {
|
|
26364
26378
|
return context.onItemMount(), function() {
|
|
@@ -27995,10 +28009,12 @@ function _detectOverflow() {
|
|
|
27995
28009
|
case 6:
|
|
27996
28010
|
return clippingClientRect = rectToClientRect.apply(void 0, [
|
|
27997
28011
|
_state.sent()
|
|
27998
|
-
]), rect = elementContext === "floating" ?
|
|
28012
|
+
]), rect = elementContext === "floating" ? {
|
|
27999
28013
|
x,
|
|
28000
|
-
y
|
|
28001
|
-
|
|
28014
|
+
y,
|
|
28015
|
+
width: rects.floating.width,
|
|
28016
|
+
height: rects.floating.height
|
|
28017
|
+
} : rects.reference, [
|
|
28002
28018
|
4,
|
|
28003
28019
|
platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)
|
|
28004
28020
|
];
|
|
@@ -28032,6 +28048,7 @@ function _detectOverflow() {
|
|
|
28032
28048
|
return offsetScale = _tmp3, platform.convertOffsetParentRelativeRectToViewportRelativeRect ? [
|
|
28033
28049
|
4,
|
|
28034
28050
|
platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
28051
|
+
elements,
|
|
28035
28052
|
rect,
|
|
28036
28053
|
offsetParent,
|
|
28037
28054
|
strategy
|
|
@@ -28238,10 +28255,7 @@ var computePosition, arrow, autoPlacement, flip, hide, inline, offset, shift, li
|
|
|
28238
28255
|
case 8:
|
|
28239
28256
|
ref = computeCoordsFromPlacement(rects, statefulPlacement, rtl), x = ref.x, y = ref.y, _state.label = 9;
|
|
28240
28257
|
case 9:
|
|
28241
|
-
|
|
28242
|
-
3,
|
|
28243
|
-
10
|
|
28244
|
-
];
|
|
28258
|
+
i = -1, _state.label = 10;
|
|
28245
28259
|
case 10:
|
|
28246
28260
|
return i++, [
|
|
28247
28261
|
3,
|
|
@@ -28301,7 +28315,7 @@ var computePosition, arrow, autoPlacement, flip, hide, inline, offset, shift, li
|
|
|
28301
28315
|
case 3:
|
|
28302
28316
|
_tmp = !_state.sent(), _state.label = 4;
|
|
28303
28317
|
case 4:
|
|
28304
|
-
return _tmp && (clientSize = elements.floating[clientProp] || rects.floating[length]), centerToReference = endDiff / 2 - startDiff / 2, largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1, minPadding = min(paddingObject[minProp], largestPossiblePadding), maxPadding = min(paddingObject[maxProp], largestPossiblePadding), min$1 = minPadding, max2 = clientSize - arrowDimensions[length] - maxPadding, center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference, offset3 = clamp(min$1, center, max2), shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center
|
|
28318
|
+
return _tmp && (clientSize = elements.floating[clientProp] || rects.floating[length]), centerToReference = endDiff / 2 - startDiff / 2, largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1, minPadding = min(paddingObject[minProp], largestPossiblePadding), maxPadding = min(paddingObject[maxProp], largestPossiblePadding), min$1 = minPadding, max2 = clientSize - arrowDimensions[length] - maxPadding, center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference, offset3 = clamp(min$1, center, max2), shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset3 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0, alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0, [
|
|
28305
28319
|
2,
|
|
28306
28320
|
(_obj1 = {}, _define_property2(_obj1, axis, coords[axis] + alignmentOffset), _define_property2(_obj1, "data", _object_spread2((_obj = {}, _define_property2(_obj, axis, offset3), _define_property2(_obj, "centerOffset", center - offset3 - alignmentOffset), _obj), shouldAddOffset && {
|
|
28307
28321
|
alignmentOffset
|
|
@@ -28792,7 +28806,7 @@ var computePosition, arrow, autoPlacement, flip, hide, inline, offset, shift, li
|
|
|
28792
28806
|
options,
|
|
28793
28807
|
fn: function(state) {
|
|
28794
28808
|
return _async_to_generator(function() {
|
|
28795
|
-
var placement, rects, platform, elements, _evaluate, _evaluate_apply, apply, detectOverflowOptions, overflow, side, alignment, isYAxis, _rects_floating, width, height, heightSide, widthSide, overflowAvailableHeight, overflowAvailableWidth, noShift, availableHeight, availableWidth,
|
|
28809
|
+
var placement, rects, platform, elements, _evaluate, _evaluate_apply, apply, detectOverflowOptions, overflow, side, alignment, isYAxis, _rects_floating, width, height, heightSide, widthSide, maximumClippingHeight, maximumClippingWidth, overflowAvailableHeight, overflowAvailableWidth, noShift, availableHeight, availableWidth, xMin, xMax, yMin, yMax, nextDimensions;
|
|
28796
28810
|
return _ts_generator(this, function(_state) {
|
|
28797
28811
|
switch (_state.label) {
|
|
28798
28812
|
case 0:
|
|
@@ -28819,7 +28833,7 @@ var computePosition, arrow, autoPlacement, flip, hide, inline, offset, shift, li
|
|
|
28819
28833
|
case 3:
|
|
28820
28834
|
widthSide = side, heightSide = alignment === "end" ? "top" : "bottom", _state.label = 4;
|
|
28821
28835
|
case 4:
|
|
28822
|
-
return overflowAvailableHeight = height - overflow[heightSide], overflowAvailableWidth = width - overflow[widthSide], noShift = !state.middlewareData.shift, availableHeight = overflowAvailableHeight, availableWidth = overflowAvailableWidth, isYAxis ?
|
|
28836
|
+
return maximumClippingHeight = height - overflow.top - overflow.bottom, maximumClippingWidth = width - overflow.left - overflow.right, overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight), overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth), noShift = !state.middlewareData.shift, availableHeight = overflowAvailableHeight, availableWidth = overflowAvailableWidth, isYAxis ? availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth : availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight, noShift && !alignment && (xMin = max(overflow.left, 0), xMax = max(overflow.right, 0), yMin = max(overflow.top, 0), yMax = max(overflow.bottom, 0), isYAxis ? availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)) : availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom))), [
|
|
28823
28837
|
4,
|
|
28824
28838
|
apply(_object_spread_props2(_object_spread2({}, state), {
|
|
28825
28839
|
availableWidth,
|