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/test.native.js
CHANGED
|
@@ -7011,7 +7011,9 @@ var require_useThemeState_native = __commonJS({
|
|
|
7011
7011
|
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);
|
|
7012
7012
|
if (props.passThrough) return [
|
|
7013
7013
|
!1,
|
|
7014
|
-
lastState
|
|
7014
|
+
lastState || parentState || {
|
|
7015
|
+
name: ""
|
|
7016
|
+
}
|
|
7015
7017
|
];
|
|
7016
7018
|
themes || (themes = (0, import_config.getConfig)().themes);
|
|
7017
7019
|
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)));
|
|
@@ -7345,7 +7347,7 @@ var require_useTheme_native = __commonJS({
|
|
|
7345
7347
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, [theme] = useThemeWithState(props), res = theme;
|
|
7346
7348
|
return res;
|
|
7347
7349
|
}, useThemeWithState = function(props) {
|
|
7348
|
-
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), themeProxied = (0, import_getThemeProxied.getThemeProxied)(props, themeState, keys);
|
|
7350
|
+
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), themeProxied = props.passThrough ? {} : (0, import_getThemeProxied.getThemeProxied)(props, themeState, keys);
|
|
7349
7351
|
return [
|
|
7350
7352
|
themeProxied,
|
|
7351
7353
|
themeState
|
|
@@ -7507,7 +7509,7 @@ var require_Theme_native = __commonJS({
|
|
|
7507
7509
|
}
|
|
7508
7510
|
if (forceClassName === !1) return children;
|
|
7509
7511
|
if (import_constants4.isWeb) {
|
|
7510
|
-
var { className, style } = getThemeClassNameAndStyle(themeState, props, isRoot);
|
|
7512
|
+
var { className = "", style } = passThrough ? {} : getThemeClassNameAndStyle(themeState, props, isRoot);
|
|
7511
7513
|
if (children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
|
|
7512
7514
|
className: `${className} _dsp_contents is_Theme`,
|
|
7513
7515
|
style: passThrough ? void 0 : style,
|
|
@@ -8305,7 +8307,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8305
8307
|
});
|
|
8306
8308
|
}
|
|
8307
8309
|
}
|
|
8308
|
-
if (splitStyles && (
|
|
8310
|
+
if (splitStyles && (hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
|
|
8309
8311
|
var useStyleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
|
|
8310
8312
|
stateRef.current.setStateShallow = function(nextOrGetNext) {
|
|
8311
8313
|
var prev = NextState.get(stateRef) || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
@@ -8320,9 +8322,9 @@ var require_createComponent_native = __commonJS({
|
|
|
8320
8322
|
};
|
|
8321
8323
|
NextState.set(stateRef, updatedState);
|
|
8322
8324
|
var { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
|
|
8323
|
-
|
|
8325
|
+
groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
|
|
8324
8326
|
var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
|
|
8325
|
-
useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
|
|
8327
|
+
useStyleListener == null || useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
|
|
8326
8328
|
} else ogSetStateShallow(next);
|
|
8327
8329
|
}
|
|
8328
8330
|
}, setStateShallow = function(state2) {
|
|
@@ -12835,7 +12837,7 @@ var require_index_native19 = __commonJS({
|
|
|
12835
12837
|
}
|
|
12836
12838
|
});
|
|
12837
12839
|
module2.exports = __toCommonJS2(index_exports2);
|
|
12838
|
-
var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native12(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
|
|
12840
|
+
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";
|
|
12839
12841
|
function setOnLayoutStrategy3(state) {
|
|
12840
12842
|
strategy = state;
|
|
12841
12843
|
}
|
|
@@ -12846,52 +12848,64 @@ var require_index_native19 = __commonJS({
|
|
|
12846
12848
|
}), queuedUpdates.clear()));
|
|
12847
12849
|
}
|
|
12848
12850
|
var expectedFrameTime = 16.67, numDroppedFramesUntilPause = 10;
|
|
12851
|
+
function startGlobalIntersectionObserver() {
|
|
12852
|
+
!import_constants4.isClient || globalIntersectionObserver || (globalIntersectionObserver = new IntersectionObserver(function(entries) {
|
|
12853
|
+
entries.forEach(function(entry) {
|
|
12854
|
+
var node = entry.target;
|
|
12855
|
+
IntersectionState.get(node) !== entry.isIntersecting && IntersectionState.set(node, entry.isIntersecting);
|
|
12856
|
+
});
|
|
12857
|
+
}, {
|
|
12858
|
+
threshold: 0
|
|
12859
|
+
}));
|
|
12860
|
+
}
|
|
12849
12861
|
if (import_constants4.isClient && rAF) {
|
|
12850
12862
|
layoutOnAnimationFrame = function() {
|
|
12851
12863
|
var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
12852
|
-
if (lastFrameAt = now, frameCount
|
|
12853
|
-
frameCount
|
|
12864
|
+
if (lastFrameAt = now, frameCount++, frameCount % RUN_EVERY_X_FRAMES === 0) {
|
|
12865
|
+
frameCount = 0, rAF(layoutOnAnimationFrame);
|
|
12854
12866
|
return;
|
|
12855
12867
|
}
|
|
12856
|
-
if (
|
|
12868
|
+
if (strategy !== "off") {
|
|
12857
12869
|
var hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
|
|
12858
12870
|
hasRecentSyncWork || Nodes.forEach(function(node) {
|
|
12859
12871
|
updateLayoutIfChanged(node, lastFrameAt);
|
|
12860
12872
|
});
|
|
12861
12873
|
}
|
|
12862
12874
|
rAF(layoutOnAnimationFrame);
|
|
12863
|
-
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, lastFrameAt = Date.now();
|
|
12875
|
+
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body, lastFrameAt = Date.now();
|
|
12864
12876
|
async function updateLayoutIfChanged(node, frameId) {
|
|
12865
|
-
|
|
12866
|
-
|
|
12867
|
-
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12877
|
+
if (IntersectionState.get(node) !== !1 && !(process.env.TAMAGUI_ONLAYOUT_VISIBILITY_CHECK === "1" && supportsCheckVisibility && !node.checkVisibility())) {
|
|
12878
|
+
var onLayout = LayoutHandlers.get(node);
|
|
12879
|
+
if (typeof onLayout == "function") {
|
|
12880
|
+
var parentNode = node.parentElement;
|
|
12881
|
+
if (parentNode) {
|
|
12882
|
+
var nodeRect, parentRect;
|
|
12883
|
+
if (strategy === "async") {
|
|
12884
|
+
var [nr, pr] = await Promise.all([
|
|
12885
|
+
getBoundingClientRectAsync(node),
|
|
12886
|
+
getBoundingClientRectAsync(parentNode)
|
|
12887
|
+
]);
|
|
12888
|
+
if (nr === !1 || pr === !1 || frameId !== lastFrameAt) return;
|
|
12889
|
+
nodeRect = nr, parentRect = pr;
|
|
12890
|
+
} else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
|
|
12891
|
+
var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
|
|
12892
|
+
if (!cachedRect || // has changed one rect
|
|
12893
|
+
// @ts-expect-error DOMRectReadOnly can go into object
|
|
12894
|
+
!(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && // @ts-expect-error DOMRectReadOnly can go into object
|
|
12895
|
+
(!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
|
|
12896
|
+
NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
|
|
12897
|
+
var event = getElementLayoutEvent(nodeRect, parentRect);
|
|
12898
|
+
avoidUpdates ? queuedUpdates.set(node, function() {
|
|
12899
|
+
return onLayout(event);
|
|
12900
|
+
}) : onLayout(event);
|
|
12901
|
+
}
|
|
12888
12902
|
}
|
|
12889
12903
|
}
|
|
12890
12904
|
}
|
|
12891
12905
|
}
|
|
12892
|
-
rAF(layoutOnAnimationFrame), frameCount = 0,
|
|
12906
|
+
rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES = 4;
|
|
12893
12907
|
}
|
|
12894
|
-
var layoutOnAnimationFrame, layoutOnAnimationFrame2, lastFrameAt, frameCount,
|
|
12908
|
+
var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility, lastFrameAt, frameCount, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
12895
12909
|
return {
|
|
12896
12910
|
nativeEvent: {
|
|
12897
12911
|
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
@@ -12956,10 +12970,10 @@ var require_index_native19 = __commonJS({
|
|
|
12956
12970
|
if (onLayout) {
|
|
12957
12971
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
12958
12972
|
if (node2) {
|
|
12959
|
-
LayoutHandlers.set(node2, onLayout), Nodes.add(node2);
|
|
12973
|
+
LayoutHandlers.set(node2, onLayout), Nodes.add(node2), startGlobalIntersectionObserver(), globalIntersectionObserver && (globalIntersectionObserver.observe(node2), IntersectionState.set(node2, !0));
|
|
12960
12974
|
var parentNode = node2.parentNode;
|
|
12961
12975
|
return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), function() {
|
|
12962
|
-
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2);
|
|
12976
|
+
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2), IntersectionState.delete(node2), globalIntersectionObserver && globalIntersectionObserver.unobserve(node2);
|
|
12963
12977
|
};
|
|
12964
12978
|
}
|
|
12965
12979
|
}
|
|
@@ -12973,14 +12987,13 @@ var require_index_native19 = __commonJS({
|
|
|
12973
12987
|
}
|
|
12974
12988
|
var getBoundingClientRectAsync = function(node) {
|
|
12975
12989
|
return new Promise(function(res) {
|
|
12976
|
-
if (!
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
}
|
|
12990
|
+
if (!node || node.nodeType !== 1) return res(!1);
|
|
12991
|
+
var io = new IntersectionObserver(function(entries) {
|
|
12992
|
+
return io.disconnect(), res(entries[0].boundingClientRect);
|
|
12993
|
+
}, {
|
|
12994
|
+
threshold: 0
|
|
12995
|
+
});
|
|
12996
|
+
io.observe(node);
|
|
12984
12997
|
});
|
|
12985
12998
|
}, getBoundingClientRect = function(node) {
|
|
12986
12999
|
var _node_getBoundingClientRect;
|
|
@@ -17212,11 +17225,15 @@ var require_RemoveScroll_native = __commonJS({
|
|
|
17212
17225
|
__export2(RemoveScroll_native_exports, {
|
|
17213
17226
|
RemoveScroll: function() {
|
|
17214
17227
|
return RemoveScroll;
|
|
17228
|
+
},
|
|
17229
|
+
getAllowedScrollableNode: function() {
|
|
17230
|
+
return getAllowedScrollableNode;
|
|
17215
17231
|
}
|
|
17216
17232
|
});
|
|
17217
17233
|
module2.exports = __toCommonJS2(RemoveScroll_native_exports);
|
|
17218
17234
|
var RemoveScroll = function(props) {
|
|
17219
17235
|
return props.children;
|
|
17236
|
+
}, getAllowedScrollableNode = function() {
|
|
17220
17237
|
};
|
|
17221
17238
|
}
|
|
17222
17239
|
});
|
|
@@ -17489,11 +17506,11 @@ var require_useSheetOpenState_native = __commonJS({
|
|
|
17489
17506
|
var { isHidden, controller } = (0, import_useSheetController.useSheetController)(), onOpenChangeInternal = function(val) {
|
|
17490
17507
|
var _controller_onOpenChange, _props_onOpenChange;
|
|
17491
17508
|
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);
|
|
17492
|
-
}, _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)({
|
|
17509
|
+
}, _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)({
|
|
17493
17510
|
prop: propVal,
|
|
17494
17511
|
defaultProp: (_props_defaultOpen = props.defaultOpen) !== null && _props_defaultOpen !== void 0 ? _props_defaultOpen : !1,
|
|
17495
17512
|
onChange: onOpenChangeInternal,
|
|
17496
|
-
strategy: "
|
|
17513
|
+
strategy: "most-recent-wins"
|
|
17497
17514
|
});
|
|
17498
17515
|
return {
|
|
17499
17516
|
open,
|
|
@@ -17580,7 +17597,7 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
17580
17597
|
prop: props.position,
|
|
17581
17598
|
defaultProp: props.defaultPosition || (state.open ? 0 : -1),
|
|
17582
17599
|
onChange: props.onPositionChange,
|
|
17583
|
-
strategy: "
|
|
17600
|
+
strategy: "most-recent-wins"
|
|
17584
17601
|
}), position = state.open === !1 ? -1 : position_, { open } = state, setPosition = import_react3.default.useCallback(function(next) {
|
|
17585
17602
|
props.dismissOnSnapToBottom && next === snapPoints.length - 1 ? state.setOpen(!1) : setPositionImmediate(next);
|
|
17586
17603
|
}, [
|
|
@@ -17600,7 +17617,7 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
17600
17617
|
var { animationDriver } = (0, import_core12.useConfiguration)();
|
|
17601
17618
|
if (!animationDriver) throw new Error("Must set animations in tamagui.config.ts");
|
|
17602
17619
|
var scrollBridge = (0, import_use_constant.useConstant)(function() {
|
|
17603
|
-
|
|
17620
|
+
var parentDragListeners = /* @__PURE__ */ new Set(), bridge = {
|
|
17604
17621
|
enabled: !1,
|
|
17605
17622
|
y: 0,
|
|
17606
17623
|
paneY: 0,
|
|
@@ -17610,8 +17627,20 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
17610
17627
|
},
|
|
17611
17628
|
release: function() {
|
|
17612
17629
|
},
|
|
17613
|
-
scrollLock: !1
|
|
17630
|
+
scrollLock: !1,
|
|
17631
|
+
isParentDragging: !1,
|
|
17632
|
+
onParentDragging: function(cb) {
|
|
17633
|
+
return parentDragListeners.add(cb), function() {
|
|
17634
|
+
parentDragListeners.delete(cb);
|
|
17635
|
+
};
|
|
17636
|
+
},
|
|
17637
|
+
setParentDragging: function(val) {
|
|
17638
|
+
val !== bridge.isParentDragging && (bridge.isParentDragging = val, parentDragListeners.forEach(function(cb) {
|
|
17639
|
+
return cb(val);
|
|
17640
|
+
}));
|
|
17641
|
+
}
|
|
17614
17642
|
};
|
|
17643
|
+
return bridge;
|
|
17615
17644
|
}), _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 = {
|
|
17616
17645
|
screenSize,
|
|
17617
17646
|
maxSnapPoint,
|
|
@@ -17716,7 +17745,6 @@ var require_nativeSheet_native = __commonJS({
|
|
|
17716
17745
|
}
|
|
17717
17746
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
|
|
17718
17747
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
|
|
17719
|
-
scrollEnabled: !0,
|
|
17720
17748
|
setHasScrollView: emptyFn,
|
|
17721
17749
|
...providerProps,
|
|
17722
17750
|
onlyShowFrame: !0,
|
|
@@ -18009,15 +18037,13 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18009
18037
|
isAbleToPosition,
|
|
18010
18038
|
position
|
|
18011
18039
|
]);
|
|
18012
|
-
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),
|
|
18013
|
-
scrollEnabled.current = val;
|
|
18014
|
-
}, []), panResponder = import_react3.default.useMemo(function() {
|
|
18040
|
+
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() {
|
|
18015
18041
|
if (disableDrag || !frameSize || isShowingInnerSheet) return;
|
|
18016
18042
|
var minY = positions[0];
|
|
18017
18043
|
scrollBridge.paneMinY = minY;
|
|
18018
18044
|
var startY = at.current;
|
|
18019
18045
|
function setPanning(val) {
|
|
18020
|
-
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 = "");
|
|
18046
|
+
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 = "");
|
|
18021
18047
|
}
|
|
18022
18048
|
var release = function(param) {
|
|
18023
18049
|
var { vy, dragAt } = param;
|
|
@@ -18027,7 +18053,7 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18027
18053
|
var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
18028
18054
|
curDist < dist && (dist = curDist, closestPoint = i);
|
|
18029
18055
|
}
|
|
18030
|
-
setPosition(closestPoint), animateTo(closestPoint)
|
|
18056
|
+
setPosition(closestPoint), animateTo(closestPoint);
|
|
18031
18057
|
}
|
|
18032
18058
|
}, finish = function(_e, state2) {
|
|
18033
18059
|
release({
|
|
@@ -18037,14 +18063,15 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18037
18063
|
}, previouslyScrolling = !1, onMoveShouldSet = function(e, param) {
|
|
18038
18064
|
var { dy } = param;
|
|
18039
18065
|
function getShouldSet() {
|
|
18040
|
-
if (e.target === providerProps.handleRef.current
|
|
18066
|
+
if (e.target === providerProps.handleRef.current) return !0;
|
|
18041
18067
|
if (scrollBridge.scrollLock) return !1;
|
|
18042
18068
|
var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
18043
|
-
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) >
|
|
18069
|
+
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) > 5;
|
|
18044
18070
|
}
|
|
18045
|
-
|
|
18071
|
+
var granted = getShouldSet();
|
|
18072
|
+
return granted && scrollBridge.setParentDragging(!0), granted;
|
|
18046
18073
|
}, grant = function() {
|
|
18047
|
-
|
|
18074
|
+
setPanning(!0), stopSpring(), startY = at.current;
|
|
18048
18075
|
}, isExternalDrag = !1;
|
|
18049
18076
|
return scrollBridge.drag = function(dy) {
|
|
18050
18077
|
isExternalDrag || (isExternalDrag = !0, grant());
|
|
@@ -18056,8 +18083,8 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18056
18083
|
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
18057
18084
|
onPanResponderGrant: grant,
|
|
18058
18085
|
onPanResponderMove: function(_e, param) {
|
|
18059
|
-
var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
18060
|
-
animatedNumber.setValue(to, {
|
|
18086
|
+
var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY), isAtTop = to <= minY;
|
|
18087
|
+
isAtTop ? scrollBridge.setParentDragging(!1) : scrollBridge.setParentDragging(!0), animatedNumber.setValue(to, {
|
|
18061
18088
|
type: "direct"
|
|
18062
18089
|
});
|
|
18063
18090
|
},
|
|
@@ -18131,7 +18158,6 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18131
18158
|
value: nextParentContext,
|
|
18132
18159
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
|
|
18133
18160
|
...providerProps,
|
|
18134
|
-
scrollEnabled: scrollEnabled.current,
|
|
18135
18161
|
setHasScrollView,
|
|
18136
18162
|
children: [
|
|
18137
18163
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
|
|
@@ -18388,7 +18414,7 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18388
18414
|
});
|
|
18389
18415
|
module2.exports = __toCommonJS2(SheetScrollView_exports);
|
|
18390
18416
|
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) {
|
|
18391
|
-
var { __scopeSheet, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge,
|
|
18417
|
+
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)({
|
|
18392
18418
|
prop: scrollEnabledProp,
|
|
18393
18419
|
defaultProp: !0
|
|
18394
18420
|
}), scrollRef = import_react3.default.useRef(null), setScrollEnabled = function(next) {
|
|
@@ -18402,7 +18428,7 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18402
18428
|
dys: [],
|
|
18403
18429
|
// store a few recent dys to get velocity on release
|
|
18404
18430
|
isScrolling: !1,
|
|
18405
|
-
|
|
18431
|
+
isDraggingScrollArea: !1
|
|
18406
18432
|
});
|
|
18407
18433
|
(0, import_react3.useEffect)(function() {
|
|
18408
18434
|
return setHasScrollView(!0), function() {
|
|
@@ -18410,8 +18436,8 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18410
18436
|
};
|
|
18411
18437
|
}, []);
|
|
18412
18438
|
var release = function() {
|
|
18413
|
-
if (state.current.
|
|
18414
|
-
state.current.
|
|
18439
|
+
if (state.current.isDraggingScrollArea) {
|
|
18440
|
+
state.current.isDraggingScrollArea = !1, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = !1, state.current.isScrolling = !1, setScrollEnabled(!0);
|
|
18415
18441
|
var vy = 0;
|
|
18416
18442
|
if (state.current.dys.length) {
|
|
18417
18443
|
var recentDys = state.current.dys.slice(-10), dist = recentDys.length ? recentDys.reduce(function(a, b) {
|
|
@@ -18424,8 +18450,31 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18424
18450
|
vy
|
|
18425
18451
|
});
|
|
18426
18452
|
}
|
|
18427
|
-
}, scrollable = scrollEnabled
|
|
18428
|
-
return
|
|
18453
|
+
}, scrollable = scrollEnabled;
|
|
18454
|
+
return (0, import_react3.useEffect)(function() {
|
|
18455
|
+
if (!(typeof window > "u") && scrollRef.current) {
|
|
18456
|
+
var controller = new AbortController(), node = scrollRef.current.getScrollableNode();
|
|
18457
|
+
node.addEventListener(
|
|
18458
|
+
"touchmove",
|
|
18459
|
+
function(e) {
|
|
18460
|
+
scrollBridge.isParentDragging && node.scrollTo({
|
|
18461
|
+
top: scrollBridge.y,
|
|
18462
|
+
behavior: "instant"
|
|
18463
|
+
});
|
|
18464
|
+
},
|
|
18465
|
+
// can't preventdefault its not cancellable
|
|
18466
|
+
{
|
|
18467
|
+
signal: controller.signal,
|
|
18468
|
+
passive: !1
|
|
18469
|
+
}
|
|
18470
|
+
);
|
|
18471
|
+
var disposeBridgeListen = scrollBridge.onParentDragging(function(val) {
|
|
18472
|
+
});
|
|
18473
|
+
return function() {
|
|
18474
|
+
disposeBridgeListen(), controller.abort();
|
|
18475
|
+
};
|
|
18476
|
+
}
|
|
18477
|
+
}, []), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
|
|
18429
18478
|
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
18430
18479
|
flex: 1,
|
|
18431
18480
|
scrollEventThrottle: 8,
|
|
@@ -18446,7 +18495,7 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18446
18495
|
// renderScrollComponent={Sheet.ScrollView}
|
|
18447
18496
|
// ```
|
|
18448
18497
|
onStartShouldSetResponder: function() {
|
|
18449
|
-
return scrollBridge.scrollStartY = -1, state.current.
|
|
18498
|
+
return scrollBridge.scrollStartY = -1, state.current.isDraggingScrollArea = !0, scrollable;
|
|
18450
18499
|
},
|
|
18451
18500
|
// setting to false while onResponderMove is disabled
|
|
18452
18501
|
onMoveShouldSetResponder: function(e) {
|
|
@@ -18458,15 +18507,15 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18458
18507
|
onResponderMove: function(e) {
|
|
18459
18508
|
if (import_core12.isWeb) {
|
|
18460
18509
|
var { pageY } = e.nativeEvent;
|
|
18461
|
-
|
|
18462
|
-
scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
|
|
18510
|
+
state.current.isScrolling || scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
|
|
18463
18511
|
var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
|
|
18464
18512
|
state.current.lastPageY = pageY;
|
|
18465
18513
|
var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = (dy === 0 || isDraggingUp) && isPaneAtTop;
|
|
18466
|
-
if (shouldScrollLock) {
|
|
18514
|
+
if (shouldScrollLock && !state.current.isScrolling) {
|
|
18467
18515
|
state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
|
|
18468
18516
|
return;
|
|
18469
18517
|
}
|
|
18518
|
+
if (scrollBridge.y >= 0) return;
|
|
18470
18519
|
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));
|
|
18471
18520
|
}
|
|
18472
18521
|
},
|
|
@@ -18621,7 +18670,7 @@ var require_createSheet_native = __commonJS({
|
|
|
18621
18670
|
element
|
|
18622
18671
|
]), context.onlyShowFrame, null;
|
|
18623
18672
|
})), SheetFrame = Frame.extractable(/* @__PURE__ */ (0, import_react3.forwardRef)(function(param2, forwardedRef) {
|
|
18624
|
-
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() {
|
|
18673
|
+
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() {
|
|
18625
18674
|
return (
|
|
18626
18675
|
// @ts-expect-error
|
|
18627
18676
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Frame, {
|
|
@@ -24250,23 +24299,20 @@ var require_Popover_native = __commonJS({
|
|
|
24250
24299
|
}));
|
|
24251
24300
|
function PopoverRepropagateContext(props) {
|
|
24252
24301
|
var popperContext = (0, import_popper.usePopperContext)(props.scope || POPOVER_SCOPE);
|
|
24253
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
24254
|
-
|
|
24255
|
-
|
|
24256
|
-
|
|
24257
|
-
...
|
|
24258
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
24259
|
-
...props.
|
|
24260
|
-
children:
|
|
24261
|
-
...props.adaptContext,
|
|
24262
|
-
children: props.children
|
|
24263
|
-
})
|
|
24302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
|
|
24303
|
+
scope: props.scope,
|
|
24304
|
+
...popperContext,
|
|
24305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
|
|
24306
|
+
...props.context,
|
|
24307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.ProvideAdaptContext, {
|
|
24308
|
+
...props.adaptContext,
|
|
24309
|
+
children: props.children
|
|
24264
24310
|
})
|
|
24265
24311
|
})
|
|
24266
24312
|
});
|
|
24267
24313
|
}
|
|
24268
24314
|
function PopoverContentPortal(props) {
|
|
24269
|
-
var { __scopePopover } = props, zIndex = props.zIndex, context = usePopoverContext(__scopePopover), themeName = (0, import_core12.useThemeName)(), adaptContext = (0, import_adapt.useAdaptContext)(), contents = props.children;
|
|
24315
|
+
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;
|
|
24270
24316
|
return needsRepropagation && (contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverRepropagateContext, {
|
|
24271
24317
|
scope: __scopePopover || POPOVER_SCOPE,
|
|
24272
24318
|
context,
|
|
@@ -24280,10 +24326,11 @@ var require_Popover_native = __commonJS({
|
|
|
24280
24326
|
/* forceClassName avoids forced re-mount renders for some reason... see the HeadMenu as you change tints a few times */
|
|
24281
24327
|
/* without this you'll see the site menu re-rendering. It must be something in wrapping children in Theme */
|
|
24282
24328
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core12.Theme, {
|
|
24329
|
+
passThrough: isPopover,
|
|
24283
24330
|
forceClassName: !0,
|
|
24284
24331
|
name: themeName,
|
|
24285
24332
|
children: [
|
|
24286
|
-
!!context.open &&
|
|
24333
|
+
!!context.open && isSheet && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
|
|
24287
24334
|
fullscreen: !0,
|
|
24288
24335
|
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
|
|
24289
24336
|
}),
|