tamagui 1.130.3 → 1.130.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 +270 -217
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +269 -215
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/native.js
CHANGED
|
@@ -7871,10 +7871,7 @@ var require_Theme_native = __commonJS({
|
|
|
7871
7871
|
}
|
|
7872
7872
|
});
|
|
7873
7873
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
7874
|
-
var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_useTheme = require_useTheme_native(), import_useThemeState = require_useThemeState_native(), import_ThemeDebug = require_ThemeDebug_native(),
|
|
7875
|
-
className: "",
|
|
7876
|
-
style: {}
|
|
7877
|
-
}, Theme2 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, ref) {
|
|
7874
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_useTheme = require_useTheme_native(), import_useThemeState = require_useThemeState_native(), import_ThemeDebug = require_ThemeDebug_native(), Theme2 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, ref) {
|
|
7878
7875
|
if (props.disable) return props.children;
|
|
7879
7876
|
var { passThrough } = props, isRoot = !!props._isRoot, [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot), disableDirectChildTheme = props["disable-child-theme"], finalChildren = disableDirectChildTheme ? import_react3.Children.map(props.children, function(child) {
|
|
7880
7877
|
return passThrough ? child : /* @__PURE__ */ (0, import_react3.cloneElement)(child, {
|
|
@@ -7922,17 +7919,21 @@ var require_Theme_native = __commonJS({
|
|
|
7922
7919
|
forceClassName,
|
|
7923
7920
|
themeState,
|
|
7924
7921
|
state,
|
|
7925
|
-
|
|
7922
|
+
themeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)
|
|
7926
7923
|
}), forceClassName === !1) return children;
|
|
7927
7924
|
if (import_constants4.isWeb) {
|
|
7928
|
-
var { className = "",
|
|
7925
|
+
var baseStyle = props.contain ? inertContainedStyle : inertStyle, { className = "", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);
|
|
7929
7926
|
if (children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
|
|
7930
|
-
className: `${className}
|
|
7931
|
-
style: passThrough ?
|
|
7927
|
+
className: `${className} is_Theme`,
|
|
7928
|
+
style: passThrough ? baseStyle : {
|
|
7929
|
+
color,
|
|
7930
|
+
...baseStyle
|
|
7931
|
+
},
|
|
7932
7932
|
children
|
|
7933
7933
|
}), state.hasEverThemed === "wrapped") {
|
|
7934
|
-
var className1 = !passThrough && requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""}
|
|
7934
|
+
var className1 = !passThrough && requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""} ` : "";
|
|
7935
7935
|
children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
|
|
7936
|
+
style: baseStyle,
|
|
7936
7937
|
className: className1,
|
|
7937
7938
|
children
|
|
7938
7939
|
});
|
|
@@ -7941,14 +7942,21 @@ var require_Theme_native = __commonJS({
|
|
|
7941
7942
|
}
|
|
7942
7943
|
return children;
|
|
7943
7944
|
}
|
|
7944
|
-
|
|
7945
|
+
var inertStyle = {
|
|
7946
|
+
display: "contents"
|
|
7947
|
+
}, inertContainedStyle = {
|
|
7948
|
+
display: "contents",
|
|
7949
|
+
contain: "strict"
|
|
7950
|
+
}, empty = {
|
|
7951
|
+
className: "",
|
|
7952
|
+
color: void 0
|
|
7953
|
+
};
|
|
7954
|
+
function getThemeClassNameAndColor(themeState, props) {
|
|
7945
7955
|
var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
7946
7956
|
if (!themeState.isNew && !props.forceClassName) return empty;
|
|
7947
|
-
var themeColor = themeState != null && themeState.theme && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : "",
|
|
7948
|
-
color: themeColor
|
|
7949
|
-
} : void 0, maxInverses = (0, import_config.getSetting)("maxDarkLightNesting") || 3, themeClassName = themeState.inverses >= maxInverses ? themeState.name : themeState.name.replace(schemePrefix, ""), className = `${isRoot ? "" : "t_sub_theme"} t_${themeClassName}`;
|
|
7957
|
+
var themeColor = themeState != null && themeState.theme && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : "", maxInverses = (0, import_config.getSetting)("maxDarkLightNesting") || 3, themeClassName = themeState.inverses >= maxInverses ? themeState.name : themeState.name.replace(schemePrefix, ""), className = `${isRoot ? "" : "t_sub_theme"} t_${themeClassName}`;
|
|
7950
7958
|
return {
|
|
7951
|
-
|
|
7959
|
+
color: themeColor,
|
|
7952
7960
|
className
|
|
7953
7961
|
};
|
|
7954
7962
|
}
|
|
@@ -9055,13 +9063,13 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
9055
9063
|
onPress,
|
|
9056
9064
|
onLongPress
|
|
9057
9065
|
});
|
|
9058
|
-
process.env.NODE_ENV === "development" && time2 && time2`spaced-as-child
|
|
9059
|
-
var useChildrenResult;
|
|
9060
|
-
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time2 && time2`use-children`, splitStyles || (elementType = "span", content = propsIn.children, viewProps = {
|
|
9066
|
+
process.env.NODE_ENV === "development" && time2 && time2`spaced-as-child`, splitStyles || (content = propsIn.children, elementType = BaseViewComponent, viewProps = {
|
|
9061
9067
|
style: {
|
|
9062
9068
|
display: "contents"
|
|
9063
9069
|
}
|
|
9064
|
-
})
|
|
9070
|
+
});
|
|
9071
|
+
var useChildrenResult;
|
|
9072
|
+
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time2 && time2`use-children`, useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
|
|
9065
9073
|
var ResetPresence2 = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence, needsReset = !!// not when passing down to child
|
|
9066
9074
|
(!asChild && // not when passThrough
|
|
9067
9075
|
splitStyles && // not when HOC
|
|
@@ -13419,7 +13427,6 @@ var require_index_native19 = __commonJS({
|
|
|
13419
13427
|
return cb();
|
|
13420
13428
|
}), queuedUpdates.clear()));
|
|
13421
13429
|
}
|
|
13422
|
-
var expectedFrameTime = 16.67, numDroppedFramesUntilPause = 10;
|
|
13423
13430
|
function startGlobalIntersectionObserver() {
|
|
13424
13431
|
!import_constants4.isClient || globalIntersectionObserver || (globalIntersectionObserver = new IntersectionObserver(function(entries) {
|
|
13425
13432
|
entries.forEach(function(entry) {
|
|
@@ -13432,20 +13439,18 @@ var require_index_native19 = __commonJS({
|
|
|
13432
13439
|
}
|
|
13433
13440
|
if (import_constants4.isClient) if (rAF) {
|
|
13434
13441
|
layoutOnAnimationFrame = function() {
|
|
13435
|
-
var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
|
|
13436
|
-
if (lastFrameAt = now, frameCount++, frameCount % RUN_EVERY_X_FRAMES === 0) {
|
|
13437
|
-
frameCount = 0, rAF(layoutOnAnimationFrame);
|
|
13438
|
-
return;
|
|
13439
|
-
}
|
|
13440
13442
|
if (strategy !== "off") {
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
|
|
13443
|
+
if (frameCount++ % RUN_EVERY_X_FRAMES !== 0) {
|
|
13444
|
+
rAF(layoutOnAnimationFrame);
|
|
13445
|
+
return;
|
|
13446
|
+
}
|
|
13447
|
+
frameCount === Number.MAX_SAFE_INTEGER && (frameCount = 0), Nodes.forEach(function(node) {
|
|
13448
|
+
updateLayoutIfChanged(node);
|
|
13444
13449
|
});
|
|
13445
13450
|
}
|
|
13446
13451
|
rAF(layoutOnAnimationFrame);
|
|
13447
|
-
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body
|
|
13448
|
-
async function updateLayoutIfChanged(node
|
|
13452
|
+
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body;
|
|
13453
|
+
async function updateLayoutIfChanged(node) {
|
|
13449
13454
|
if (IntersectionState.get(node) !== !1 && !(process.env.TAMAGUI_ONLAYOUT_VISIBILITY_CHECK === "1" && supportsCheckVisibility && !node.checkVisibility())) {
|
|
13450
13455
|
var onLayout = LayoutHandlers.get(node);
|
|
13451
13456
|
if (typeof onLayout == "function") {
|
|
@@ -13457,7 +13462,7 @@ var require_index_native19 = __commonJS({
|
|
|
13457
13462
|
getBoundingClientRectAsync(node),
|
|
13458
13463
|
getBoundingClientRectAsync(parentNode)
|
|
13459
13464
|
]);
|
|
13460
|
-
if (nr === !1 || pr === !1
|
|
13465
|
+
if (nr === !1 || pr === !1) return;
|
|
13461
13466
|
nodeRect = nr, parentRect = pr;
|
|
13462
13467
|
} else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
|
|
13463
13468
|
var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
|
|
@@ -13475,9 +13480,9 @@ var require_index_native19 = __commonJS({
|
|
|
13475
13480
|
}
|
|
13476
13481
|
}
|
|
13477
13482
|
}
|
|
13478
|
-
rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES =
|
|
13483
|
+
rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES = 8;
|
|
13479
13484
|
} else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
|
|
13480
|
-
var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility,
|
|
13485
|
+
var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility, frameCount, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
13481
13486
|
return {
|
|
13482
13487
|
nativeEvent: {
|
|
13483
13488
|
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
@@ -13542,7 +13547,7 @@ var require_index_native19 = __commonJS({
|
|
|
13542
13547
|
if (onLayout) {
|
|
13543
13548
|
var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
|
|
13544
13549
|
if (node2) {
|
|
13545
|
-
|
|
13550
|
+
Nodes.add(node2), startGlobalIntersectionObserver(), globalIntersectionObserver && (globalIntersectionObserver.observe(node2), IntersectionState.set(node2, !0));
|
|
13546
13551
|
var parentNode = node2.parentNode;
|
|
13547
13552
|
return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), function() {
|
|
13548
13553
|
Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2), IntersectionState.delete(node2), globalIntersectionObserver && globalIntersectionObserver.unobserve(node2);
|
|
@@ -16828,7 +16833,7 @@ var require_Portal_native = __commonJS({
|
|
|
16828
16833
|
}
|
|
16829
16834
|
});
|
|
16830
16835
|
module2.exports = __toCommonJS2(Portal_native_exports);
|
|
16831
|
-
var import_jsx_runtime6 = require("react/jsx-runtime"),
|
|
16836
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_core12 = require_index_native20(), import_z_index_stack2 = require_index_native29(), React4 = __toESM2(require("react")), import_react_native4 = require_fake_react_native(), import_constants4 = require_constants_native3(), import_GorhomPortalItem = require_GorhomPortalItem_native(), import_helpers = require_helpers_native(), createPortal = function() {
|
|
16832
16837
|
if (import_constants4.IS_FABRIC) try {
|
|
16833
16838
|
var _ReactFabricShimModule_default, ReactFabricShimModule = require_fake_react_native(), _ReactFabricShimModule_default_createPortal;
|
|
16834
16839
|
return (_ReactFabricShimModule_default_createPortal = ReactFabricShimModule == null || (_ReactFabricShimModule_default = ReactFabricShimModule.default) === null || _ReactFabricShimModule_default === void 0 ? void 0 : _ReactFabricShimModule_default.createPortal) !== null && _ReactFabricShimModule_default_createPortal !== void 0 ? _ReactFabricShimModule_default_createPortal : ReactFabricShimModule.createPortal;
|
|
@@ -16842,15 +16847,17 @@ var require_Portal_native = __commonJS({
|
|
|
16842
16847
|
return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
|
|
16843
16848
|
}
|
|
16844
16849
|
}(), Portal = function(propsIn) {
|
|
16845
|
-
var
|
|
16850
|
+
var rootTag = React4.useContext(import_react_native4.RootTagContext), zIndex = (0, import_z_index_stack2.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn)), { children, passThrough } = propsIn, contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
|
|
16846
16851
|
pointerEvents: "box-none",
|
|
16847
|
-
fullscreen: !0,
|
|
16848
16852
|
position: "absolute",
|
|
16853
|
+
inset: 0,
|
|
16849
16854
|
maxWidth: "100%",
|
|
16850
|
-
|
|
16851
|
-
|
|
16855
|
+
zIndex,
|
|
16856
|
+
passThrough,
|
|
16857
|
+
children
|
|
16852
16858
|
});
|
|
16853
16859
|
return !createPortal || !import_constants4.USE_NATIVE_PORTAL || !rootTag ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_GorhomPortalItem.GorhomPortalItem, {
|
|
16860
|
+
passThrough,
|
|
16854
16861
|
hostName: "root",
|
|
16855
16862
|
children: contents
|
|
16856
16863
|
}) : createPortal(contents, rootTag);
|
|
@@ -18643,11 +18650,11 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18643
18650
|
scrollBridge.paneMinY = minY;
|
|
18644
18651
|
var startY = at.current;
|
|
18645
18652
|
function setPanning(val) {
|
|
18646
|
-
setIsDragging(val),
|
|
18653
|
+
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 = "");
|
|
18647
18654
|
}
|
|
18648
18655
|
var release = function(param) {
|
|
18649
18656
|
var { vy, dragAt } = param;
|
|
18650
|
-
if (!scrollBridge.scrollLock) {
|
|
18657
|
+
if (scrollBridge.setParentDragging(!1), !scrollBridge.scrollLock) {
|
|
18651
18658
|
isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
|
|
18652
18659
|
for (var at2 = dragAt + startY, end = at2 + frameSize * vy * 0.2, closestPoint = 0, dist = Number.POSITIVE_INFINITY, i = 0; i < positions.length; i++) {
|
|
18653
18660
|
var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
@@ -18826,6 +18833,7 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18826
18833
|
...portalProps,
|
|
18827
18834
|
children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ContainerComponent, {
|
|
18828
18835
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
|
|
18836
|
+
contain: !0,
|
|
18829
18837
|
forceClassName: !0,
|
|
18830
18838
|
name: themeName,
|
|
18831
18839
|
children: contents
|
|
@@ -19013,116 +19021,144 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
19013
19021
|
}
|
|
19014
19022
|
});
|
|
19015
19023
|
module2.exports = __toCommonJS2(SheetScrollView_exports);
|
|
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(
|
|
19017
|
-
|
|
19018
|
-
|
|
19019
|
-
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
|
|
19024
|
-
|
|
19025
|
-
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
19035
|
-
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
|
|
19039
|
-
|
|
19040
|
-
|
|
19041
|
-
|
|
19042
|
-
if (state.current.
|
|
19043
|
-
|
|
19044
|
-
|
|
19045
|
-
|
|
19046
|
-
|
|
19024
|
+
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(
|
|
19025
|
+
// we disallow customizing it because we want to let people know it doens't work well with out measuring of inner content
|
|
19026
|
+
// height using a view
|
|
19027
|
+
function(param, ref) {
|
|
19028
|
+
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)({
|
|
19029
|
+
prop: scrollEnabledProp,
|
|
19030
|
+
defaultProp: !0
|
|
19031
|
+
}), scrollRef = import_react3.default.useRef(null), setScrollEnabled = function(next) {
|
|
19032
|
+
var _scrollRef_current_setNativeProps, _scrollRef_current;
|
|
19033
|
+
(_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 || (_scrollRef_current_setNativeProps = _scrollRef_current.setNativeProps) === null || _scrollRef_current_setNativeProps === void 0 || _scrollRef_current_setNativeProps.call(_scrollRef_current, {
|
|
19034
|
+
scrollEnabled: next
|
|
19035
|
+
}), setScrollEnabled_(next);
|
|
19036
|
+
}, state = import_react3.default.useRef({
|
|
19037
|
+
lastPageY: 0,
|
|
19038
|
+
dragAt: 0,
|
|
19039
|
+
dys: [],
|
|
19040
|
+
// store a few recent dys to get velocity on release
|
|
19041
|
+
isScrolling: !1,
|
|
19042
|
+
isDraggingScrollArea: !1
|
|
19043
|
+
});
|
|
19044
|
+
(0, import_react3.useEffect)(function() {
|
|
19045
|
+
return setHasScrollView(!0), function() {
|
|
19046
|
+
setHasScrollView(!1);
|
|
19047
|
+
};
|
|
19048
|
+
}, []);
|
|
19049
|
+
var release = function() {
|
|
19050
|
+
if (state.current.isDraggingScrollArea) {
|
|
19051
|
+
state.current.isDraggingScrollArea = !1, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = !1, state.current.isScrolling = !1, setScrollEnabled(!0);
|
|
19052
|
+
var vy = 0;
|
|
19053
|
+
if (state.current.dys.length) {
|
|
19054
|
+
var recentDys = state.current.dys.slice(-10), dist = recentDys.length ? recentDys.reduce(function(a, b) {
|
|
19055
|
+
return a + b;
|
|
19056
|
+
}, 0) : 0, avgDy = dist / recentDys.length;
|
|
19057
|
+
vy = avgDy * 0.04;
|
|
19058
|
+
}
|
|
19059
|
+
state.current.dys = [], scrollBridge.release({
|
|
19060
|
+
dragAt: state.current.dragAt,
|
|
19061
|
+
vy
|
|
19062
|
+
});
|
|
19047
19063
|
}
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
|
|
19057
|
-
|
|
19058
|
-
|
|
19059
|
-
|
|
19060
|
-
|
|
19061
|
-
|
|
19062
|
-
|
|
19064
|
+
}, scrollable = scrollEnabled;
|
|
19065
|
+
(0, import_react3.useEffect)(function() {
|
|
19066
|
+
var _scrollRef_current;
|
|
19067
|
+
if (import_core12.isClient && scrollRef.current) {
|
|
19068
|
+
var controller = new AbortController(), node = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.getScrollableNode();
|
|
19069
|
+
if (node) {
|
|
19070
|
+
node.addEventListener(
|
|
19071
|
+
"touchmove",
|
|
19072
|
+
function(e) {
|
|
19073
|
+
scrollBridge.isParentDragging && node.scrollTo({
|
|
19074
|
+
top: scrollBridge.y,
|
|
19075
|
+
behavior: "instant"
|
|
19076
|
+
});
|
|
19077
|
+
},
|
|
19078
|
+
// can't preventdefault its not cancellable
|
|
19079
|
+
{
|
|
19080
|
+
signal: controller.signal,
|
|
19081
|
+
passive: !1
|
|
19082
|
+
}
|
|
19083
|
+
);
|
|
19084
|
+
var disposeBridgeListen = scrollBridge.onParentDragging(function(val) {
|
|
19063
19085
|
});
|
|
19064
|
-
|
|
19065
|
-
|
|
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, {
|
|
19078
|
-
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
19079
|
-
flex: 1,
|
|
19080
|
-
scrollEventThrottle: 8,
|
|
19081
|
-
onResponderRelease: release,
|
|
19082
|
-
className: "_ovs-contain",
|
|
19083
|
-
scrollEnabled: scrollable,
|
|
19084
|
-
// {...(Platform.OS === 'android' && {
|
|
19085
|
-
// pointerEvents: scrollable ? undefined : 'none',
|
|
19086
|
-
// })}
|
|
19087
|
-
onScroll: function(e) {
|
|
19088
|
-
var { y } = e.nativeEvent.contentOffset;
|
|
19089
|
-
scrollBridge.y = y, import_core12.isWeb && (scrollBridge.scrollLock = y > 0), y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
|
|
19090
|
-
},
|
|
19091
|
-
// This assures that we do not skip the "scrollBridge" values processing
|
|
19092
|
-
// when passing this prop into a <Sheet.ScrollView /> overriding it here
|
|
19093
|
-
// Useful when using this ScrollView with lists such as "FlashList", i.e.
|
|
19094
|
-
// ```
|
|
19095
|
-
// renderScrollComponent={Sheet.ScrollView}
|
|
19096
|
-
// ```
|
|
19097
|
-
onStartShouldSetResponder: function() {
|
|
19098
|
-
return scrollBridge.scrollStartY = -1, state.current.isDraggingScrollArea = !0, scrollable;
|
|
19099
|
-
},
|
|
19100
|
-
// setting to false while onResponderMove is disabled
|
|
19101
|
-
onMoveShouldSetResponder: function(e) {
|
|
19102
|
-
return scrollable;
|
|
19103
|
-
},
|
|
19104
|
-
contentContainerStyle: {
|
|
19105
|
-
minHeight: "100%"
|
|
19106
|
-
},
|
|
19107
|
-
onResponderMove: function(e) {
|
|
19108
|
-
if (import_core12.isWeb) {
|
|
19109
|
-
var { pageY } = e.nativeEvent;
|
|
19110
|
-
state.current.isScrolling || scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
|
|
19111
|
-
var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
|
|
19112
|
-
state.current.lastPageY = pageY;
|
|
19113
|
-
var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = (dy === 0 || isDraggingUp) && isPaneAtTop;
|
|
19114
|
-
if (shouldScrollLock && !state.current.isScrolling) {
|
|
19115
|
-
state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
|
|
19116
|
-
return;
|
|
19086
|
+
return function() {
|
|
19087
|
+
disposeBridgeListen(), controller.abort();
|
|
19088
|
+
};
|
|
19117
19089
|
}
|
|
19118
|
-
if (scrollBridge.y >= 0) return;
|
|
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));
|
|
19120
19090
|
}
|
|
19121
|
-
},
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19091
|
+
}, [
|
|
19092
|
+
scrollRef
|
|
19093
|
+
]);
|
|
19094
|
+
var [hasScrollableContent, setHasScrollableContent] = (0, import_react3.useState)(!0), parentHeight = (0, import_react3.useRef)(0), contentHeight = (0, import_react3.useRef)(0), setIsScrollable = function() {
|
|
19095
|
+
parentHeight.current && contentHeight.current && setHasScrollableContent(contentHeight.current > parentHeight.current);
|
|
19096
|
+
};
|
|
19097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_scroll_view.ScrollView, {
|
|
19098
|
+
onLayout: function(e) {
|
|
19099
|
+
parentHeight.current = e.nativeEvent.layout.height, setIsScrollable();
|
|
19100
|
+
},
|
|
19101
|
+
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
19102
|
+
flex: 1,
|
|
19103
|
+
scrollEventThrottle: 8,
|
|
19104
|
+
onResponderRelease: release,
|
|
19105
|
+
className: "_ovs-contain",
|
|
19106
|
+
scrollEnabled: scrollable,
|
|
19107
|
+
// {...(Platform.OS === 'android' && {
|
|
19108
|
+
// pointerEvents: scrollable ? undefined : 'none',
|
|
19109
|
+
// })}
|
|
19110
|
+
onScroll: function(e) {
|
|
19111
|
+
var { y } = e.nativeEvent.contentOffset;
|
|
19112
|
+
scrollBridge.y = y, import_core12.isWeb && (scrollBridge.scrollLock = y > 0), y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
|
|
19113
|
+
},
|
|
19114
|
+
// This assures that we do not skip the "scrollBridge" values processing
|
|
19115
|
+
// when passing this prop into a <Sheet.ScrollView /> overriding it here
|
|
19116
|
+
// Useful when using this ScrollView with lists such as "FlashList", i.e.
|
|
19117
|
+
// ```
|
|
19118
|
+
// renderScrollComponent={Sheet.ScrollView}
|
|
19119
|
+
// ```
|
|
19120
|
+
onStartShouldSetResponder: function() {
|
|
19121
|
+
return scrollBridge.scrollStartY = -1, state.current.isDraggingScrollArea = !0, scrollable;
|
|
19122
|
+
},
|
|
19123
|
+
// setting to false while onResponderMove is disabled
|
|
19124
|
+
onMoveShouldSetResponder: function(e) {
|
|
19125
|
+
return scrollable;
|
|
19126
|
+
},
|
|
19127
|
+
contentContainerStyle: {
|
|
19128
|
+
minHeight: "100%"
|
|
19129
|
+
},
|
|
19130
|
+
onResponderMove: function(e) {
|
|
19131
|
+
if (import_core12.isWeb) {
|
|
19132
|
+
var { pageY } = e.nativeEvent;
|
|
19133
|
+
state.current.isScrolling || scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
|
|
19134
|
+
var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
|
|
19135
|
+
state.current.lastPageY = pageY;
|
|
19136
|
+
var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = hasScrollableContent && (dy === 0 || isDraggingUp) && isPaneAtTop;
|
|
19137
|
+
if (shouldScrollLock && !state.current.isScrolling) {
|
|
19138
|
+
state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
|
|
19139
|
+
return;
|
|
19140
|
+
}
|
|
19141
|
+
if (scrollBridge.y >= 0) return;
|
|
19142
|
+
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));
|
|
19143
|
+
}
|
|
19144
|
+
},
|
|
19145
|
+
...props,
|
|
19146
|
+
children: [
|
|
19147
|
+
/* content height measurer */
|
|
19148
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
|
|
19149
|
+
position: "absolute",
|
|
19150
|
+
inset: 0,
|
|
19151
|
+
pointerEvents: "none",
|
|
19152
|
+
zIndex: -1,
|
|
19153
|
+
onLayout: function(e) {
|
|
19154
|
+
contentHeight.current = e.nativeEvent.layout.height, setIsScrollable();
|
|
19155
|
+
}
|
|
19156
|
+
}),
|
|
19157
|
+
children
|
|
19158
|
+
]
|
|
19159
|
+
});
|
|
19160
|
+
}
|
|
19161
|
+
);
|
|
19126
19162
|
}
|
|
19127
19163
|
});
|
|
19128
19164
|
|
|
@@ -24110,6 +24146,7 @@ var require_Animate_native = __commonJS({
|
|
|
24110
24146
|
},
|
|
24111
24147
|
children
|
|
24112
24148
|
}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
|
|
24149
|
+
passThrough,
|
|
24113
24150
|
...props,
|
|
24114
24151
|
children: mounted || passThrough ? children : null
|
|
24115
24152
|
}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
|
|
@@ -24879,8 +24916,8 @@ var require_Popover_native = __commonJS({
|
|
|
24879
24916
|
}
|
|
24880
24917
|
});
|
|
24881
24918
|
module2.exports = __toCommonJS2(Popover_exports);
|
|
24882
|
-
var import_jsx_runtime6 = require("react/jsx-runtime"), import_polyfill_dev = require_polyfill_dev(), import_adapt = require_index_native31(), import_animate = require_index_native57(), import_animate_presence = require_index_native4(), import_aria_hidden = require_index_native33(), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_core12 = require_index_native20(), import_floating = require_index_native58(), import_focus_scope = require_index_native35(), import_helpers = require_index_native7(), import_popper = require_index_native59(), import_portal2 = require_index_native30(), import_remove_scroll = require_index_native36(), import_sheet = require_index_native38(), import_stacks3 = require_index_native24(), import_use_controllable_state = require_index_native10(), import_z_index_stack2 = require_index_native29(), React4 = __toESM2(require("react")), import_useFloatingContext = require_useFloatingContext_native(), needsRepropagation = import_constants4.isAndroid || import_constants4.isIos && !import_portal2.USE_NATIVE_PORTAL, POPOVER_SCOPE = "PopoverScope", PopoverContext = (0, import_core12.createStyledContext)({}), usePopoverContext = PopoverContext.useStyledContext, PopoverAnchor = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
24883
|
-
var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), { onCustomAnchorAdd, onCustomAnchorRemove } = context || {};
|
|
24919
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_polyfill_dev = require_polyfill_dev(), import_adapt = require_index_native31(), import_animate = require_index_native57(), import_animate_presence = require_index_native4(), import_aria_hidden = require_index_native33(), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_core12 = require_index_native20(), import_floating = require_index_native58(), import_focus_scope = require_index_native35(), import_helpers = require_index_native7(), import_popper = require_index_native59(), import_portal2 = require_index_native30(), import_remove_scroll = require_index_native36(), import_scroll_view = require_index_native37(), import_sheet = require_index_native38(), import_stacks3 = require_index_native24(), import_use_controllable_state = require_index_native10(), import_z_index_stack2 = require_index_native29(), React4 = __toESM2(require("react")), import_useFloatingContext = require_useFloatingContext_native(), needsRepropagation = import_constants4.isAndroid || import_constants4.isIos && !import_portal2.USE_NATIVE_PORTAL, POPOVER_SCOPE = "PopoverScope", PopoverContext = (0, import_core12.createStyledContext)({}), usePopoverContext = PopoverContext.useStyledContext, PopoverAnchor = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
24920
|
+
var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), { onCustomAnchorAdd, onCustomAnchorRemove } = context || {};
|
|
24884
24921
|
return React4.useEffect(function() {
|
|
24885
24922
|
return onCustomAnchorAdd(), function() {
|
|
24886
24923
|
return onCustomAnchorRemove();
|
|
@@ -24894,7 +24931,7 @@ var require_Popover_native = __commonJS({
|
|
|
24894
24931
|
ref: forwardedRef
|
|
24895
24932
|
});
|
|
24896
24933
|
}), PopoverTrigger = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
24897
|
-
var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
24934
|
+
var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
|
|
24898
24935
|
if (!props.children) return null;
|
|
24899
24936
|
var trigger = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
|
|
24900
24937
|
"aria-expanded": context.open,
|
|
@@ -24938,7 +24975,7 @@ var require_Popover_native = __commonJS({
|
|
|
24938
24975
|
children: trigger
|
|
24939
24976
|
});
|
|
24940
24977
|
}), PopoverContent = import_popper.PopperContentFrame.extractable(/* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
24941
|
-
var { trapFocus, enableRemoveScroll = !1, zIndex, __scopePopover, ...contentImplProps } = props, context = usePopoverContext(__scopePopover), contentRef = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), isRightClickOutsideRef = React4.useRef(!1), [isFullyHidden, setIsFullyHidden] = React4.useState(!context.open);
|
|
24978
|
+
var { trapFocus, enableRemoveScroll = !1, zIndex, __scopePopover, ...contentImplProps } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), contentRef = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), isRightClickOutsideRef = React4.useRef(!1), [isFullyHidden, setIsFullyHidden] = React4.useState(!context.open);
|
|
24942
24979
|
if (context.open && isFullyHidden && setIsFullyHidden(!1), React4.useEffect(function() {
|
|
24943
24980
|
if (context.open) {
|
|
24944
24981
|
var content = contentRef.current;
|
|
@@ -24948,17 +24985,19 @@ var require_Popover_native = __commonJS({
|
|
|
24948
24985
|
context.open
|
|
24949
24986
|
]), !context.keepChildrenMounted && isFullyHidden) return null;
|
|
24950
24987
|
var _contentImplProps_pointerEvents;
|
|
24951
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
24952
|
-
|
|
24988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverPortal, {
|
|
24989
|
+
passThrough: context.breakpointActive,
|
|
24990
|
+
__scopePopover: __scopePopover || POPOVER_SCOPE,
|
|
24953
24991
|
zIndex,
|
|
24954
24992
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
|
|
24993
|
+
passThrough: context.breakpointActive,
|
|
24955
24994
|
pointerEvents: context.open ? (_contentImplProps_pointerEvents = contentImplProps.pointerEvents) !== null && _contentImplProps_pointerEvents !== void 0 ? _contentImplProps_pointerEvents : "auto" : "none",
|
|
24956
24995
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContentImpl, {
|
|
24957
24996
|
...contentImplProps,
|
|
24958
24997
|
enableRemoveScroll,
|
|
24959
24998
|
ref: composedRefs,
|
|
24960
24999
|
setIsFullyHidden,
|
|
24961
|
-
__scopePopover,
|
|
25000
|
+
__scopePopover: __scopePopover || POPOVER_SCOPE,
|
|
24962
25001
|
// we make sure we're not trapping once it's been closed
|
|
24963
25002
|
// (closed !== unmounted when animating out)
|
|
24964
25003
|
trapFocus: trapFocus ?? context.open,
|
|
@@ -24983,55 +25022,76 @@ var require_Popover_native = __commonJS({
|
|
|
24983
25022
|
})
|
|
24984
25023
|
})
|
|
24985
25024
|
});
|
|
24986
|
-
}))
|
|
24987
|
-
|
|
24988
|
-
|
|
25025
|
+
})), useParentContexts = function(scope) {
|
|
25026
|
+
var popperContext = (0, import_popper.usePopperContext)(scope || POPOVER_SCOPE), adaptContext = (0, import_adapt.useAdaptContext)(), context = usePopoverContext(scope || POPOVER_SCOPE);
|
|
25027
|
+
return {
|
|
25028
|
+
popperContext,
|
|
25029
|
+
adaptContext,
|
|
25030
|
+
context
|
|
25031
|
+
};
|
|
25032
|
+
};
|
|
25033
|
+
function RepropagateParentContexts(param) {
|
|
25034
|
+
var { adaptContext, children, context, popperContext, scope } = param;
|
|
24989
25035
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
|
|
24990
|
-
scope
|
|
25036
|
+
scope,
|
|
24991
25037
|
...popperContext,
|
|
24992
25038
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
|
|
24993
|
-
...
|
|
25039
|
+
...context,
|
|
24994
25040
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.ProvideAdaptContext, {
|
|
24995
|
-
...
|
|
24996
|
-
children
|
|
25041
|
+
...adaptContext,
|
|
25042
|
+
children
|
|
24997
25043
|
})
|
|
24998
25044
|
})
|
|
24999
25045
|
});
|
|
25000
25046
|
}
|
|
25001
|
-
function
|
|
25002
|
-
var {
|
|
25003
|
-
|
|
25004
|
-
scope
|
|
25005
|
-
|
|
25006
|
-
|
|
25007
|
-
|
|
25008
|
-
|
|
25009
|
-
|
|
25047
|
+
var PortalAdaptSafe = function(param) {
|
|
25048
|
+
var { children, __scopePopover } = param;
|
|
25049
|
+
if (needsRepropagation) {
|
|
25050
|
+
var scope = __scopePopover || POPOVER_SCOPE, parentContexts = useParentContexts(scope);
|
|
25051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
|
|
25052
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagateParentContexts, {
|
|
25053
|
+
scope,
|
|
25054
|
+
...parentContexts,
|
|
25055
|
+
children
|
|
25056
|
+
})
|
|
25057
|
+
});
|
|
25058
|
+
}
|
|
25059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
|
|
25060
|
+
children
|
|
25061
|
+
});
|
|
25062
|
+
};
|
|
25063
|
+
function PopoverPortal(props) {
|
|
25064
|
+
var scope = props.__scopePopover || POPOVER_SCOPE, zIndex = props.zIndex, themeName = (0, import_core12.useThemeName)(), content = props.children;
|
|
25065
|
+
if (needsRepropagation) {
|
|
25066
|
+
var parentContexts = useParentContexts(scope);
|
|
25067
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagateParentContexts, {
|
|
25068
|
+
scope,
|
|
25069
|
+
...parentContexts,
|
|
25070
|
+
children: content
|
|
25071
|
+
});
|
|
25072
|
+
}
|
|
25073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, {
|
|
25074
|
+
passThrough: props.passThrough,
|
|
25010
25075
|
stackZIndex: !0,
|
|
25011
25076
|
zIndex,
|
|
25012
25077
|
children: (
|
|
25013
25078
|
/* forceClassName avoids forced re-mount renders for some reason... see the HeadMenu as you change tints a few times */
|
|
25014
25079
|
/* without this you'll see the site menu re-rendering. It must be something in wrapping children in Theme */
|
|
25015
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
25016
|
-
passThrough:
|
|
25080
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
|
|
25081
|
+
passThrough: props.passThrough,
|
|
25082
|
+
contain: !0,
|
|
25017
25083
|
forceClassName: !0,
|
|
25018
25084
|
name: themeName,
|
|
25019
|
-
children:
|
|
25020
|
-
|
|
25021
|
-
|
|
25022
|
-
|
|
25023
|
-
}),
|
|
25024
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
|
|
25025
|
-
zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
|
|
25026
|
-
children: contents
|
|
25027
|
-
})
|
|
25028
|
-
]
|
|
25085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
|
|
25086
|
+
zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
|
|
25087
|
+
children: content
|
|
25088
|
+
})
|
|
25029
25089
|
})
|
|
25030
25090
|
)
|
|
25031
25091
|
});
|
|
25032
25092
|
}
|
|
25033
25093
|
var PopoverContentImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
25034
|
-
var { trapFocus, __scopePopover, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, ...contentProps } = props, context = usePopoverContext(__scopePopover), { open, keepChildrenMounted } = context, handleExitComplete = React4.useCallback(function() {
|
|
25094
|
+
var { trapFocus, __scopePopover, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, ...contentProps } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), { open, keepChildrenMounted } = context, handleExitComplete = React4.useCallback(function() {
|
|
25035
25095
|
setIsFullyHidden == null || setIsFullyHidden(!0);
|
|
25036
25096
|
}, [
|
|
25037
25097
|
setIsFullyHidden
|
|
@@ -25039,42 +25099,27 @@ var require_Popover_native = __commonJS({
|
|
|
25039
25099
|
disable: context.breakpointActive,
|
|
25040
25100
|
children
|
|
25041
25101
|
});
|
|
25042
|
-
return context.breakpointActive, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
25043
|
-
|
|
25044
|
-
|
|
25045
|
-
|
|
25046
|
-
|
|
25047
|
-
|
|
25048
|
-
|
|
25049
|
-
|
|
25102
|
+
return context.breakpointActive, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate.Animate, {
|
|
25103
|
+
type: "presence",
|
|
25104
|
+
present: !!open,
|
|
25105
|
+
keepChildrenMounted: !!keepChildrenMounted,
|
|
25106
|
+
onExitComplete: handleExitComplete,
|
|
25107
|
+
lazyMount,
|
|
25108
|
+
passThrough: context.breakpointActive,
|
|
25109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContent, {
|
|
25110
|
+
__scopePopper: __scopePopover || POPOVER_SCOPE,
|
|
25111
|
+
"data-state": getState(open),
|
|
25112
|
+
id: context.contentId,
|
|
25113
|
+
ref: forwardedRef,
|
|
25050
25114
|
passThrough: context.breakpointActive,
|
|
25051
|
-
|
|
25052
|
-
|
|
25053
|
-
"data-state": getState(open),
|
|
25054
|
-
id: context.contentId,
|
|
25055
|
-
ref: forwardedRef,
|
|
25056
|
-
passThrough: context.breakpointActive,
|
|
25057
|
-
...contentProps,
|
|
25115
|
+
...contentProps,
|
|
25116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PortalAdaptSafe, {
|
|
25058
25117
|
children: contents
|
|
25059
|
-
}, context.contentId)
|
|
25060
|
-
})
|
|
25061
|
-
});
|
|
25062
|
-
}), RepropagatePopperAdapt = function(param) {
|
|
25063
|
-
var { children, __scopePopover } = param;
|
|
25064
|
-
if (needsRepropagation) {
|
|
25065
|
-
var popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE);
|
|
25066
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
|
|
25067
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
|
|
25068
|
-
...popperContext,
|
|
25069
|
-
children
|
|
25070
25118
|
})
|
|
25071
|
-
})
|
|
25072
|
-
}
|
|
25073
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
|
|
25074
|
-
children
|
|
25119
|
+
}, context.contentId)
|
|
25075
25120
|
});
|
|
25076
|
-
}, PopoverClose = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
25077
|
-
var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover);
|
|
25121
|
+
}), PopoverClose = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
25122
|
+
var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE);
|
|
25078
25123
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
|
|
25079
25124
|
...rest,
|
|
25080
25125
|
ref: forwardedRef,
|
|
@@ -25094,7 +25139,14 @@ var require_Popover_native = __commonJS({
|
|
|
25094
25139
|
});
|
|
25095
25140
|
}), PopoverScrollView = /* @__PURE__ */ React4.forwardRef(function(props, ref) {
|
|
25096
25141
|
var context = usePopoverContext(POPOVER_SCOPE);
|
|
25097
|
-
return
|
|
25142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
|
|
25143
|
+
ref,
|
|
25144
|
+
// when adapted, no pointer events!
|
|
25145
|
+
pointerEvents: context.breakpointActive ? "none" : void 0,
|
|
25146
|
+
scrollEnabled: !context.breakpointActive,
|
|
25147
|
+
passThrough: context.breakpointActive,
|
|
25148
|
+
...props
|
|
25149
|
+
});
|
|
25098
25150
|
}), Popover = (0, import_helpers.withStaticProperties)(/* @__PURE__ */ React4.forwardRef(function(props, ref) {
|
|
25099
25151
|
var id = React4.useId();
|
|
25100
25152
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptParent, {
|
|
@@ -25174,7 +25226,7 @@ var require_Popover_native = __commonJS({
|
|
|
25174
25226
|
keepChildrenMounted
|
|
25175
25227
|
}, memoizedChildren = React4.useMemo(function() {
|
|
25176
25228
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
|
|
25177
|
-
scope: __scopePopover,
|
|
25229
|
+
scope: __scopePopover || POPOVER_SCOPE,
|
|
25178
25230
|
...popoverContext,
|
|
25179
25231
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverSheetController, {
|
|
25180
25232
|
onOpenChange: setOpen,
|
|
@@ -25182,6 +25234,7 @@ var require_Popover_native = __commonJS({
|
|
|
25182
25234
|
})
|
|
25183
25235
|
});
|
|
25184
25236
|
}, [
|
|
25237
|
+
__scopePopover,
|
|
25185
25238
|
setOpen,
|
|
25186
25239
|
children,
|
|
25187
25240
|
...Object.values(popoverContext)
|
|
@@ -25204,7 +25257,7 @@ var require_Popover_native = __commonJS({
|
|
|
25204
25257
|
return open ? "open" : "closed";
|
|
25205
25258
|
}
|
|
25206
25259
|
var PopoverSheetController = function(param) {
|
|
25207
|
-
var { __scopePopover, ...props } = param, context = usePopoverContext(__scopePopover), showSheet = useShowPopoverSheet(context), breakpointActive = context.breakpointActive, getShowSheet = (0, import_core12.useGet)(showSheet);
|
|
25260
|
+
var { __scopePopover, ...props } = param, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), showSheet = useShowPopoverSheet(context), breakpointActive = context.breakpointActive, getShowSheet = (0, import_core12.useGet)(showSheet);
|
|
25208
25261
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_sheet.SheetController, {
|
|
25209
25262
|
onOpenChange: function(val) {
|
|
25210
25263
|
if (getShowSheet()) {
|