tamagui 1.130.1 → 1.130.3
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 +138 -91
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +135 -88
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/native.js
CHANGED
|
@@ -7401,7 +7401,9 @@ var require_useThemeState_native = __commonJS({
|
|
|
7401
7401
|
var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0, { debug } = props, parentState = states.get(parentId);
|
|
7402
7402
|
if (props.passThrough) return [
|
|
7403
7403
|
!1,
|
|
7404
|
-
lastState
|
|
7404
|
+
lastState || parentState || {
|
|
7405
|
+
name: ""
|
|
7406
|
+
}
|
|
7405
7407
|
];
|
|
7406
7408
|
themes || (themes = (0, import_config.getConfig)().themes);
|
|
7407
7409
|
var name = !propsKey && (!lastState || !(lastState != null && lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? !0 : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
|
|
@@ -7748,10 +7750,10 @@ var require_useTheme_native = __commonJS({
|
|
|
7748
7750
|
return res;
|
|
7749
7751
|
}, useThemeWithState = function(props) {
|
|
7750
7752
|
var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = (0, import_react3.useRef)(null), themeState = (0, import_useThemeState.useThemeState)(props, isRoot, keys);
|
|
7751
|
-
process.env.NODE_ENV === "development" && (themeState != null && themeState.theme
|
|
7753
|
+
process.env.NODE_ENV === "development" && !props.passThrough && !(themeState != null && themeState.theme) && process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.error(`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(props)}).
|
|
7752
7754
|
|
|
7753
|
-
If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`)
|
|
7754
|
-
var themeProxied = (0, import_getThemeProxied.getThemeProxied)(props, themeState, keys);
|
|
7755
|
+
If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`);
|
|
7756
|
+
var themeProxied = props.passThrough ? {} : (0, import_getThemeProxied.getThemeProxied)(props, themeState, keys);
|
|
7755
7757
|
return [
|
|
7756
7758
|
themeProxied,
|
|
7757
7759
|
themeState
|
|
@@ -7915,7 +7917,7 @@ var require_Theme_native = __commonJS({
|
|
|
7915
7917
|
})) : child;
|
|
7916
7918
|
});
|
|
7917
7919
|
}
|
|
7918
|
-
if (process.env.NODE_ENV === "development" && props.debug && console.warn(" getThemedChildren", {
|
|
7920
|
+
if (process.env.NODE_ENV === "development" && !passThrough && props.debug && console.warn(" getThemedChildren", {
|
|
7919
7921
|
requiresExtraWrapper,
|
|
7920
7922
|
forceClassName,
|
|
7921
7923
|
themeState,
|
|
@@ -7923,7 +7925,7 @@ var require_Theme_native = __commonJS({
|
|
|
7923
7925
|
...getThemeClassNameAndStyle(themeState, props, isRoot)
|
|
7924
7926
|
}), forceClassName === !1) return children;
|
|
7925
7927
|
if (import_constants4.isWeb) {
|
|
7926
|
-
var { className, style } = getThemeClassNameAndStyle(themeState, props, isRoot);
|
|
7928
|
+
var { className = "", style } = passThrough ? {} : getThemeClassNameAndStyle(themeState, props, isRoot);
|
|
7927
7929
|
if (children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
|
|
7928
7930
|
className: `${className} _dsp_contents is_Theme`,
|
|
7929
7931
|
style: passThrough ? void 0 : style,
|
|
@@ -8787,7 +8789,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8787
8789
|
});
|
|
8788
8790
|
}
|
|
8789
8791
|
}
|
|
8790
|
-
if (splitStyles && (
|
|
8792
|
+
if (splitStyles && (hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
|
|
8791
8793
|
var useStyleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
|
|
8792
8794
|
stateRef.current.setStateShallow = function(nextOrGetNext) {
|
|
8793
8795
|
var prev = NextState.get(stateRef) || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
@@ -8805,9 +8807,9 @@ var require_createComponent_native = __commonJS({
|
|
|
8805
8807
|
props
|
|
8806
8808
|
}), console.info(stateRef.current.host), console.groupEnd());
|
|
8807
8809
|
var { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
|
|
8808
|
-
|
|
8810
|
+
groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
|
|
8809
8811
|
var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
|
|
8810
|
-
useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
|
|
8812
|
+
useStyleListener == null || useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
|
|
8811
8813
|
} else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
|
|
8812
8814
|
canAvoidReRender,
|
|
8813
8815
|
next
|
|
@@ -13407,7 +13409,7 @@ var require_index_native19 = __commonJS({
|
|
|
13407
13409
|
}
|
|
13408
13410
|
});
|
|
13409
13411
|
module2.exports = __toCommonJS2(index_exports2);
|
|
13410
|
-
var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native12(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
|
|
13412
|
+
var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native12(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), IntersectionState = /* @__PURE__ */ new WeakMap(), globalIntersectionObserver = null, strategy = "async";
|
|
13411
13413
|
function setOnLayoutStrategy3(state) {
|
|
13412
13414
|
strategy = state;
|
|
13413
13415
|
}
|
|
@@ -13418,52 +13420,64 @@ var require_index_native19 = __commonJS({
|
|
|
13418
13420
|
}), queuedUpdates.clear()));
|
|
13419
13421
|
}
|
|
13420
13422
|
var expectedFrameTime = 16.67, numDroppedFramesUntilPause = 10;
|
|
13423
|
+
function startGlobalIntersectionObserver() {
|
|
13424
|
+
!import_constants4.isClient || globalIntersectionObserver || (globalIntersectionObserver = new IntersectionObserver(function(entries) {
|
|
13425
|
+
entries.forEach(function(entry) {
|
|
13426
|
+
var node = entry.target;
|
|
13427
|
+
IntersectionState.get(node) !== entry.isIntersecting && IntersectionState.set(node, entry.isIntersecting);
|
|
13428
|
+
});
|
|
13429
|
+
}, {
|
|
13430
|
+
threshold: 0
|
|
13431
|
+
}));
|
|
13432
|
+
}
|
|
13421
13433
|
if (import_constants4.isClient) if (rAF) {
|
|
13422
13434
|
layoutOnAnimationFrame = function() {
|
|
13423
13435
|
var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
13424
|
-
if (lastFrameAt = now, frameCount
|
|
13425
|
-
frameCount
|
|
13436
|
+
if (lastFrameAt = now, frameCount++, frameCount % RUN_EVERY_X_FRAMES === 0) {
|
|
13437
|
+
frameCount = 0, rAF(layoutOnAnimationFrame);
|
|
13426
13438
|
return;
|
|
13427
13439
|
}
|
|
13428
|
-
if (
|
|
13440
|
+
if (strategy !== "off") {
|
|
13429
13441
|
var hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
|
|
13430
13442
|
hasRecentSyncWork || Nodes.forEach(function(node) {
|
|
13431
13443
|
updateLayoutIfChanged(node, lastFrameAt);
|
|
13432
13444
|
});
|
|
13433
13445
|
}
|
|
13434
13446
|
rAF(layoutOnAnimationFrame);
|
|
13435
|
-
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now();
|
|
13447
|
+
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body, lastFrameAt = Date.now();
|
|
13436
13448
|
async function updateLayoutIfChanged(node, frameId) {
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13449
|
+
if (IntersectionState.get(node) !== !1 && !(process.env.TAMAGUI_ONLAYOUT_VISIBILITY_CHECK === "1" && supportsCheckVisibility && !node.checkVisibility())) {
|
|
13450
|
+
var onLayout = LayoutHandlers.get(node);
|
|
13451
|
+
if (typeof onLayout == "function") {
|
|
13452
|
+
var parentNode = node.parentElement;
|
|
13453
|
+
if (parentNode) {
|
|
13454
|
+
var nodeRect, parentRect;
|
|
13455
|
+
if (strategy === "async") {
|
|
13456
|
+
var [nr, pr] = await Promise.all([
|
|
13457
|
+
getBoundingClientRectAsync(node),
|
|
13458
|
+
getBoundingClientRectAsync(parentNode)
|
|
13459
|
+
]);
|
|
13460
|
+
if (nr === !1 || pr === !1 || frameId !== lastFrameAt) return;
|
|
13461
|
+
nodeRect = nr, parentRect = pr;
|
|
13462
|
+
} else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
|
|
13463
|
+
var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
|
|
13464
|
+
if (!cachedRect || // has changed one rect
|
|
13465
|
+
// @ts-expect-error DOMRectReadOnly can go into object
|
|
13466
|
+
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && // @ts-expect-error DOMRectReadOnly can go into object
|
|
13467
|
+
(!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
13468
|
+
NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
|
|
13469
|
+
var event = getElementLayoutEvent(nodeRect, parentRect);
|
|
13470
|
+
avoidUpdates ? queuedUpdates.set(node, function() {
|
|
13471
|
+
return onLayout(event);
|
|
13472
|
+
}) : onLayout(event);
|
|
13473
|
+
}
|
|
13460
13474
|
}
|
|
13461
13475
|
}
|
|
13462
13476
|
}
|
|
13463
13477
|
}
|
|
13464
|
-
rAF(layoutOnAnimationFrame), frameCount = 0,
|
|
13478
|
+
rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES = 4;
|
|
13465
13479
|
} else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
|
|
13466
|
-
var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt, frameCount,
|
|
13480
|
+
var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility, lastFrameAt, frameCount, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
13467
13481
|
return {
|
|
13468
13482
|
nativeEvent: {
|
|
13469
13483
|
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
@@ -13528,10 +13542,10 @@ var require_index_native19 = __commonJS({
|
|
|
13528
13542
|
if (onLayout) {
|
|
13529
13543
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
13530
13544
|
if (node2) {
|
|
13531
|
-
LayoutHandlers.set(node2, onLayout), Nodes.add(node2);
|
|
13545
|
+
LayoutHandlers.set(node2, onLayout), Nodes.add(node2), startGlobalIntersectionObserver(), globalIntersectionObserver && (globalIntersectionObserver.observe(node2), IntersectionState.set(node2, !0));
|
|
13532
13546
|
var parentNode = node2.parentNode;
|
|
13533
13547
|
return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), function() {
|
|
13534
|
-
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2);
|
|
13548
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2), IntersectionState.delete(node2), globalIntersectionObserver && globalIntersectionObserver.unobserve(node2);
|
|
13535
13549
|
};
|
|
13536
13550
|
}
|
|
13537
13551
|
}
|
|
@@ -13545,14 +13559,13 @@ var require_index_native19 = __commonJS({
|
|
|
13545
13559
|
}
|
|
13546
13560
|
var getBoundingClientRectAsync = function(node) {
|
|
13547
13561
|
return new Promise(function(res) {
|
|
13548
|
-
if (!
|
|
13549
|
-
|
|
13550
|
-
|
|
13551
|
-
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
}
|
|
13562
|
+
if (!node || node.nodeType !== 1) return res(!1);
|
|
13563
|
+
var io = new IntersectionObserver(function(entries) {
|
|
13564
|
+
return io.disconnect(), res(entries[0].boundingClientRect);
|
|
13565
|
+
}, {
|
|
13566
|
+
threshold: 0
|
|
13567
|
+
});
|
|
13568
|
+
io.observe(node);
|
|
13556
13569
|
});
|
|
13557
13570
|
}, getBoundingClientRect = function(node) {
|
|
13558
13571
|
var _node_getBoundingClientRect;
|
|
@@ -17798,11 +17811,15 @@ var require_RemoveScroll_native = __commonJS({
|
|
|
17798
17811
|
__export2(RemoveScroll_native_exports, {
|
|
17799
17812
|
RemoveScroll: function() {
|
|
17800
17813
|
return RemoveScroll;
|
|
17814
|
+
},
|
|
17815
|
+
getAllowedScrollableNode: function() {
|
|
17816
|
+
return getAllowedScrollableNode;
|
|
17801
17817
|
}
|
|
17802
17818
|
});
|
|
17803
17819
|
module2.exports = __toCommonJS2(RemoveScroll_native_exports);
|
|
17804
17820
|
var RemoveScroll = function(props) {
|
|
17805
17821
|
return props.children;
|
|
17822
|
+
}, getAllowedScrollableNode = function() {
|
|
17806
17823
|
};
|
|
17807
17824
|
}
|
|
17808
17825
|
});
|
|
@@ -18075,11 +18092,11 @@ var require_useSheetOpenState_native = __commonJS({
|
|
|
18075
18092
|
var { isHidden, controller } = (0, import_useSheetController.useSheetController)(), onOpenChangeInternal = function(val) {
|
|
18076
18093
|
var _controller_onOpenChange, _props_onOpenChange;
|
|
18077
18094
|
controller == null || (_controller_onOpenChange = controller.onOpenChange) === null || _controller_onOpenChange === void 0 || _controller_onOpenChange.call(controller, val), (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 || _props_onOpenChange.call(props, val);
|
|
18078
|
-
}, _controller_open, propVal = (_controller_open = controller == null ? void 0 : controller.open) !== null && _controller_open !== void 0 ? _controller_open : props.open, _props_defaultOpen, [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
18095
|
+
}, _controller_open, _props_open, propVal = props.preferAdaptParentOpenState ? (_controller_open = controller == null ? void 0 : controller.open) !== null && _controller_open !== void 0 ? _controller_open : props.open : (_props_open = props.open) !== null && _props_open !== void 0 ? _props_open : controller == null ? void 0 : controller.open, _props_defaultOpen, [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
18079
18096
|
prop: propVal,
|
|
18080
18097
|
defaultProp: (_props_defaultOpen = props.defaultOpen) !== null && _props_defaultOpen !== void 0 ? _props_defaultOpen : !1,
|
|
18081
18098
|
onChange: onOpenChangeInternal,
|
|
18082
|
-
strategy: "
|
|
18099
|
+
strategy: "most-recent-wins"
|
|
18083
18100
|
});
|
|
18084
18101
|
return {
|
|
18085
18102
|
open,
|
|
@@ -18166,7 +18183,7 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
18166
18183
|
prop: props.position,
|
|
18167
18184
|
defaultProp: props.defaultPosition || (state.open ? 0 : -1),
|
|
18168
18185
|
onChange: props.onPositionChange,
|
|
18169
|
-
strategy: "
|
|
18186
|
+
strategy: "most-recent-wins"
|
|
18170
18187
|
}), position = state.open === !1 ? -1 : position_, { open } = state, setPosition = import_react3.default.useCallback(function(next) {
|
|
18171
18188
|
props.dismissOnSnapToBottom && next === snapPoints.length - 1 ? state.setOpen(!1) : setPositionImmediate(next);
|
|
18172
18189
|
}, [
|
|
@@ -18200,7 +18217,7 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
18200
18217
|
var { animationDriver } = (0, import_core12.useConfiguration)();
|
|
18201
18218
|
if (!animationDriver) throw new Error(process.env.NODE_ENV === "production" ? "\u274C 008" : "Must set animations in tamagui.config.ts");
|
|
18202
18219
|
var scrollBridge = (0, import_use_constant.useConstant)(function() {
|
|
18203
|
-
|
|
18220
|
+
var parentDragListeners = /* @__PURE__ */ new Set(), bridge = {
|
|
18204
18221
|
enabled: !1,
|
|
18205
18222
|
y: 0,
|
|
18206
18223
|
paneY: 0,
|
|
@@ -18210,8 +18227,20 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
18210
18227
|
},
|
|
18211
18228
|
release: function() {
|
|
18212
18229
|
},
|
|
18213
|
-
scrollLock: !1
|
|
18230
|
+
scrollLock: !1,
|
|
18231
|
+
isParentDragging: !1,
|
|
18232
|
+
onParentDragging: function(cb) {
|
|
18233
|
+
return parentDragListeners.add(cb), function() {
|
|
18234
|
+
parentDragListeners.delete(cb);
|
|
18235
|
+
};
|
|
18236
|
+
},
|
|
18237
|
+
setParentDragging: function(val) {
|
|
18238
|
+
val !== bridge.isParentDragging && (bridge.isParentDragging = val, parentDragListeners.forEach(function(cb) {
|
|
18239
|
+
return cb(val);
|
|
18240
|
+
}));
|
|
18241
|
+
}
|
|
18214
18242
|
};
|
|
18243
|
+
return bridge;
|
|
18215
18244
|
}), _props_forceRemoveScrollEnabled, removeScrollEnabled = (_props_forceRemoveScrollEnabled = props.forceRemoveScrollEnabled) !== null && _props_forceRemoveScrollEnabled !== void 0 ? _props_forceRemoveScrollEnabled : open && props.modal, maxSnapPoint = snapPoints[0], screenSize = snapPointsMode === "percent" ? frameSize / ((typeof maxSnapPoint == "number" ? maxSnapPoint : 100) / 100) : maxContentSize, _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, providerProps = {
|
|
18216
18245
|
screenSize,
|
|
18217
18246
|
maxSnapPoint,
|
|
@@ -18316,7 +18345,6 @@ var require_nativeSheet_native = __commonJS({
|
|
|
18316
18345
|
}
|
|
18317
18346
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
|
|
18318
18347
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
|
|
18319
|
-
scrollEnabled: !0,
|
|
18320
18348
|
setHasScrollView: emptyFn,
|
|
18321
18349
|
...providerProps,
|
|
18322
18350
|
onlyShowFrame: !0,
|
|
@@ -18609,15 +18637,13 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18609
18637
|
isAbleToPosition,
|
|
18610
18638
|
position
|
|
18611
18639
|
]);
|
|
18612
|
-
var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1),
|
|
18613
|
-
scrollEnabled.current = val;
|
|
18614
|
-
}, []), panResponder = import_react3.default.useMemo(function() {
|
|
18640
|
+
var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1), panResponder = import_react3.default.useMemo(function() {
|
|
18615
18641
|
if (disableDrag || !frameSize || isShowingInnerSheet) return;
|
|
18616
18642
|
var minY = positions[0];
|
|
18617
18643
|
scrollBridge.paneMinY = minY;
|
|
18618
18644
|
var startY = at.current;
|
|
18619
18645
|
function setPanning(val) {
|
|
18620
|
-
setIsDragging(val), import_constants4.isClient && (sheetHiddenStyleSheet || (sheetHiddenStyleSheet = document.createElement("style"), typeof document.head < "u" && document.head.appendChild(sheetHiddenStyleSheet)), val ? sheetHiddenStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : sheetHiddenStyleSheet.innerText = "");
|
|
18646
|
+
setIsDragging(val), scrollBridge.setParentDragging(!1), import_constants4.isClient && (sheetHiddenStyleSheet || (sheetHiddenStyleSheet = document.createElement("style"), typeof document.head < "u" && document.head.appendChild(sheetHiddenStyleSheet)), val ? sheetHiddenStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : sheetHiddenStyleSheet.innerText = "");
|
|
18621
18647
|
}
|
|
18622
18648
|
var release = function(param) {
|
|
18623
18649
|
var { vy, dragAt } = param;
|
|
@@ -18627,7 +18653,7 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18627
18653
|
var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
18628
18654
|
curDist < dist && (dist = curDist, closestPoint = i);
|
|
18629
18655
|
}
|
|
18630
|
-
setPosition(closestPoint), animateTo(closestPoint)
|
|
18656
|
+
setPosition(closestPoint), animateTo(closestPoint);
|
|
18631
18657
|
}
|
|
18632
18658
|
}, finish = function(_e, state2) {
|
|
18633
18659
|
release({
|
|
@@ -18637,14 +18663,15 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18637
18663
|
}, previouslyScrolling = !1, onMoveShouldSet = function(e, param) {
|
|
18638
18664
|
var { dy } = param;
|
|
18639
18665
|
function getShouldSet() {
|
|
18640
|
-
if (e.target === providerProps.handleRef.current
|
|
18666
|
+
if (e.target === providerProps.handleRef.current) return !0;
|
|
18641
18667
|
if (scrollBridge.scrollLock) return !1;
|
|
18642
18668
|
var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
18643
|
-
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) >
|
|
18669
|
+
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) > 5;
|
|
18644
18670
|
}
|
|
18645
|
-
|
|
18671
|
+
var granted = getShouldSet();
|
|
18672
|
+
return granted && scrollBridge.setParentDragging(!0), granted;
|
|
18646
18673
|
}, grant = function() {
|
|
18647
|
-
|
|
18674
|
+
setPanning(!0), stopSpring(), startY = at.current;
|
|
18648
18675
|
}, isExternalDrag = !1;
|
|
18649
18676
|
return scrollBridge.drag = function(dy) {
|
|
18650
18677
|
isExternalDrag || (isExternalDrag = !0, grant());
|
|
@@ -18656,8 +18683,8 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18656
18683
|
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
18657
18684
|
onPanResponderGrant: grant,
|
|
18658
18685
|
onPanResponderMove: function(_e, param) {
|
|
18659
|
-
var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
18660
|
-
animatedNumber.setValue(to, {
|
|
18686
|
+
var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY), isAtTop = to <= minY;
|
|
18687
|
+
isAtTop ? scrollBridge.setParentDragging(!1) : scrollBridge.setParentDragging(!0), animatedNumber.setValue(to, {
|
|
18661
18688
|
type: "direct"
|
|
18662
18689
|
});
|
|
18663
18690
|
},
|
|
@@ -18731,7 +18758,6 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18731
18758
|
value: nextParentContext,
|
|
18732
18759
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
|
|
18733
18760
|
...providerProps,
|
|
18734
|
-
scrollEnabled: scrollEnabled.current,
|
|
18735
18761
|
setHasScrollView,
|
|
18736
18762
|
children: [
|
|
18737
18763
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
|
|
@@ -18988,7 +19014,7 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18988
19014
|
});
|
|
18989
19015
|
module2.exports = __toCommonJS2(SheetScrollView_exports);
|
|
18990
19016
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_core12 = require_index_native20(), import_scroll_view = require_index_native37(), import_use_controllable_state = require_index_native10(), import_react3 = __toESM2(require("react")), import_SheetContext = require_SheetContext_native(), SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ */ import_react3.default.forwardRef(function(param, ref) {
|
|
18991
|
-
var { __scopeSheet, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge,
|
|
19017
|
+
var { __scopeSheet, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge, setHasScrollView } = context, [scrollEnabled, setScrollEnabled_] = (0, import_use_controllable_state.useControllableState)({
|
|
18992
19018
|
prop: scrollEnabledProp,
|
|
18993
19019
|
defaultProp: !0
|
|
18994
19020
|
}), scrollRef = import_react3.default.useRef(null), setScrollEnabled = function(next) {
|
|
@@ -19002,7 +19028,7 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
19002
19028
|
dys: [],
|
|
19003
19029
|
// store a few recent dys to get velocity on release
|
|
19004
19030
|
isScrolling: !1,
|
|
19005
|
-
|
|
19031
|
+
isDraggingScrollArea: !1
|
|
19006
19032
|
});
|
|
19007
19033
|
(0, import_react3.useEffect)(function() {
|
|
19008
19034
|
return setHasScrollView(!0), function() {
|
|
@@ -19010,8 +19036,8 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
19010
19036
|
};
|
|
19011
19037
|
}, []);
|
|
19012
19038
|
var release = function() {
|
|
19013
|
-
if (state.current.
|
|
19014
|
-
state.current.
|
|
19039
|
+
if (state.current.isDraggingScrollArea) {
|
|
19040
|
+
state.current.isDraggingScrollArea = !1, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = !1, state.current.isScrolling = !1, setScrollEnabled(!0);
|
|
19015
19041
|
var vy = 0;
|
|
19016
19042
|
if (state.current.dys.length) {
|
|
19017
19043
|
var recentDys = state.current.dys.slice(-10), dist = recentDys.length ? recentDys.reduce(function(a, b) {
|
|
@@ -19024,8 +19050,31 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
19024
19050
|
vy
|
|
19025
19051
|
});
|
|
19026
19052
|
}
|
|
19027
|
-
}, scrollable = scrollEnabled
|
|
19028
|
-
return
|
|
19053
|
+
}, scrollable = scrollEnabled;
|
|
19054
|
+
return (0, import_react3.useEffect)(function() {
|
|
19055
|
+
if (!(typeof window > "u") && scrollRef.current) {
|
|
19056
|
+
var controller = new AbortController(), node = scrollRef.current.getScrollableNode();
|
|
19057
|
+
node.addEventListener(
|
|
19058
|
+
"touchmove",
|
|
19059
|
+
function(e) {
|
|
19060
|
+
scrollBridge.isParentDragging && node.scrollTo({
|
|
19061
|
+
top: scrollBridge.y,
|
|
19062
|
+
behavior: "instant"
|
|
19063
|
+
});
|
|
19064
|
+
},
|
|
19065
|
+
// can't preventdefault its not cancellable
|
|
19066
|
+
{
|
|
19067
|
+
signal: controller.signal,
|
|
19068
|
+
passive: !1
|
|
19069
|
+
}
|
|
19070
|
+
);
|
|
19071
|
+
var disposeBridgeListen = scrollBridge.onParentDragging(function(val) {
|
|
19072
|
+
});
|
|
19073
|
+
return function() {
|
|
19074
|
+
disposeBridgeListen(), controller.abort();
|
|
19075
|
+
};
|
|
19076
|
+
}
|
|
19077
|
+
}, []), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
|
|
19029
19078
|
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
19030
19079
|
flex: 1,
|
|
19031
19080
|
scrollEventThrottle: 8,
|
|
@@ -19046,7 +19095,7 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
19046
19095
|
// renderScrollComponent={Sheet.ScrollView}
|
|
19047
19096
|
// ```
|
|
19048
19097
|
onStartShouldSetResponder: function() {
|
|
19049
|
-
return scrollBridge.scrollStartY = -1, state.current.
|
|
19098
|
+
return scrollBridge.scrollStartY = -1, state.current.isDraggingScrollArea = !0, scrollable;
|
|
19050
19099
|
},
|
|
19051
19100
|
// setting to false while onResponderMove is disabled
|
|
19052
19101
|
onMoveShouldSetResponder: function(e) {
|
|
@@ -19058,15 +19107,15 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
19058
19107
|
onResponderMove: function(e) {
|
|
19059
19108
|
if (import_core12.isWeb) {
|
|
19060
19109
|
var { pageY } = e.nativeEvent;
|
|
19061
|
-
|
|
19062
|
-
scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
|
|
19110
|
+
state.current.isScrolling || scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
|
|
19063
19111
|
var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
|
|
19064
19112
|
state.current.lastPageY = pageY;
|
|
19065
19113
|
var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = (dy === 0 || isDraggingUp) && isPaneAtTop;
|
|
19066
|
-
if (shouldScrollLock) {
|
|
19114
|
+
if (shouldScrollLock && !state.current.isScrolling) {
|
|
19067
19115
|
state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
|
|
19068
19116
|
return;
|
|
19069
19117
|
}
|
|
19118
|
+
if (scrollBridge.y >= 0) return;
|
|
19070
19119
|
setScrollEnabled(!1), scrollBridge.drag(dragAt), state.current.dragAt = dragAt, state.current.dys.push(dy), state.current.dys.length > 100 && (state.current.dys = state.current.dys.slice(-10));
|
|
19071
19120
|
}
|
|
19072
19121
|
},
|
|
@@ -19221,7 +19270,7 @@ var require_createSheet_native = __commonJS({
|
|
|
19221
19270
|
element
|
|
19222
19271
|
]), context.onlyShowFrame, null;
|
|
19223
19272
|
})), SheetFrame = Frame.extractable(/* @__PURE__ */ (0, import_react3.forwardRef)(function(param2, forwardedRef) {
|
|
19224
|
-
var { __scopeSheet, adjustPaddingForOffscreenContent, disableHideBottomOverflow, children, ...props } = param2, context = (0, import_SheetContext.useSheetContext)(import_constants22.SHEET_NAME, __scopeSheet), { hasFit, removeScrollEnabled, frameSize, contentRef, open } = context, composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), offscreenSize = (0, import_useSheetOffscreenSize.useSheetOffscreenSize)(context), sheetContents = (0, import_react3.useMemo)(function() {
|
|
19273
|
+
var { __scopeSheet, adjustPaddingForOffscreenContent, disableHideBottomOverflow, children, ...props } = param2, context = (0, import_SheetContext.useSheetContext)(import_constants22.SHEET_NAME, __scopeSheet), { hasFit, removeScrollEnabled = !0, frameSize, contentRef, open } = context, composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), offscreenSize = (0, import_useSheetOffscreenSize.useSheetOffscreenSize)(context), sheetContents = (0, import_react3.useMemo)(function() {
|
|
19225
19274
|
return (
|
|
19226
19275
|
// @ts-expect-error
|
|
19227
19276
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Frame, {
|
|
@@ -24937,23 +24986,20 @@ var require_Popover_native = __commonJS({
|
|
|
24937
24986
|
}));
|
|
24938
24987
|
function PopoverRepropagateContext(props) {
|
|
24939
24988
|
var popperContext = (0, import_popper.usePopperContext)(props.scope || POPOVER_SCOPE);
|
|
24940
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
24941
|
-
|
|
24942
|
-
|
|
24943
|
-
|
|
24944
|
-
...
|
|
24945
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
24946
|
-
...props.
|
|
24947
|
-
children:
|
|
24948
|
-
...props.adaptContext,
|
|
24949
|
-
children: props.children
|
|
24950
|
-
})
|
|
24989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
|
|
24990
|
+
scope: props.scope,
|
|
24991
|
+
...popperContext,
|
|
24992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
|
|
24993
|
+
...props.context,
|
|
24994
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.ProvideAdaptContext, {
|
|
24995
|
+
...props.adaptContext,
|
|
24996
|
+
children: props.children
|
|
24951
24997
|
})
|
|
24952
24998
|
})
|
|
24953
24999
|
});
|
|
24954
25000
|
}
|
|
24955
25001
|
function PopoverContentPortal(props) {
|
|
24956
|
-
var { __scopePopover } = props, zIndex = props.zIndex, context = usePopoverContext(__scopePopover), themeName = (0, import_core12.useThemeName)(), adaptContext = (0, import_adapt.useAdaptContext)(), contents = props.children;
|
|
25002
|
+
var { __scopePopover } = props, zIndex = props.zIndex, context = usePopoverContext(__scopePopover), themeName = (0, import_core12.useThemeName)(), adaptContext = (0, import_adapt.useAdaptContext)(), contents = props.children, isPopover = !context.breakpointActive, isSheet = context.breakpointActive;
|
|
24957
25003
|
return needsRepropagation && (contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverRepropagateContext, {
|
|
24958
25004
|
scope: __scopePopover || POPOVER_SCOPE,
|
|
24959
25005
|
context,
|
|
@@ -24967,10 +25013,11 @@ var require_Popover_native = __commonJS({
|
|
|
24967
25013
|
/* forceClassName avoids forced re-mount renders for some reason... see the HeadMenu as you change tints a few times */
|
|
24968
25014
|
/* without this you'll see the site menu re-rendering. It must be something in wrapping children in Theme */
|
|
24969
25015
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core12.Theme, {
|
|
25016
|
+
passThrough: isPopover,
|
|
24970
25017
|
forceClassName: !0,
|
|
24971
25018
|
name: themeName,
|
|
24972
25019
|
children: [
|
|
24973
|
-
!!context.open &&
|
|
25020
|
+
!!context.open && isSheet && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
|
|
24974
25021
|
fullscreen: !0,
|
|
24975
25022
|
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
24976
25023
|
}),
|