@tamagui/sheet 3.0.0-beta.755.1 → 3.0.0-beta.804.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ var import_useSheetScrollViewGestures = require("./useSheetScrollViewGestures.cj
39
39
  var import_webViewport = require("./webViewport.cjs");
40
40
  var import_jsx_runtime = require("react/jsx-runtime");
41
41
  const SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
42
- const SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, ({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props }, ref) => {
42
+ const SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, ({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props }, ref) => {
43
43
  const context = (0, import_SheetContext.useSheetContext)(scope);
44
44
  const gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();
45
45
  const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -64,6 +64,11 @@ const SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scro
64
64
  height: frozenFrameHeight,
65
65
  maxHeight: frozenFrameHeight
66
66
  } : null;
67
+ const scrollViewStyle = [
68
+ fitSizingStyle,
69
+ ...Array.isArray(style) ? style : [style],
70
+ keyboardFrozenOverride
71
+ ];
67
72
  const panGestureRef = gestureContext?.panGestureRef;
68
73
  const { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();
69
74
  const useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;
@@ -235,7 +240,7 @@ const SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scro
235
240
  const RNGHComponent = RNGHScrollView;
236
241
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {
237
242
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
238
- style: fitSizingStyle,
243
+ style: scrollViewStyle,
239
244
  scrollEventThrottle: 1,
240
245
  scrollEnabled,
241
246
  simultaneousHandlers: [panGestureRef],
@@ -281,7 +286,6 @@ const SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scro
281
286
  keyboardShouldPersistTaps: "always",
282
287
  keyboardDismissMode: "none",
283
288
  ...props,
284
- ...keyboardFrozenOverride,
285
289
  children: contentWrapper
286
290
  });
287
291
  }
@@ -291,7 +295,6 @@ const SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scro
291
295
  updateScrollable();
292
296
  },
293
297
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
294
- ...fitSizingStyle,
295
298
  scrollEventThrottle: 1,
296
299
  className: "_ovs-contain",
297
300
  scrollEnabled,
@@ -306,7 +309,7 @@ const SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scro
306
309
  contentContainerStyle,
307
310
  ...gestureProps,
308
311
  ...props,
309
- ...keyboardFrozenOverride,
312
+ style: scrollViewStyle,
310
313
  children: contentWrapper
311
314
  });
312
315
  }, {
@@ -42,7 +42,7 @@ var import_useSheetScrollViewGestures = require("./useSheetScrollViewGestures.na
42
42
  var import_webViewport = require("./webViewport.native.js");
43
43
  var SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
44
44
  var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {
45
- var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;
45
+ var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;
46
46
  var context = (0, import_SheetContext.useSheetContext)(scope);
47
47
  var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();
48
48
  var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -67,6 +67,11 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
67
67
  height: frozenFrameHeight,
68
68
  maxHeight: frozenFrameHeight
69
69
  } : null;
70
+ var scrollViewStyle = [
71
+ fitSizingStyle,
72
+ ...Array.isArray(style) ? style : [style],
73
+ keyboardFrozenOverride
74
+ ];
70
75
  var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;
71
76
  var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();
72
77
  var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;
@@ -244,7 +249,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
244
249
  var RNGHComponent = RNGHScrollView;
245
250
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {
246
251
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
247
- style: fitSizingStyle,
252
+ style: scrollViewStyle,
248
253
  scrollEventThrottle: 1,
249
254
  scrollEnabled,
250
255
  simultaneousHandlers: [panGestureRef],
@@ -291,7 +296,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
291
296
  keyboardShouldPersistTaps: "always",
292
297
  keyboardDismissMode: "none",
293
298
  ...props,
294
- ...keyboardFrozenOverride,
295
299
  children: contentWrapper
296
300
  });
297
301
  }
@@ -301,7 +305,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
301
305
  updateScrollable();
302
306
  },
303
307
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
304
- ...fitSizingStyle,
305
308
  scrollEventThrottle: 1,
306
309
  className: "_ovs-contain",
307
310
  scrollEnabled,
@@ -316,7 +319,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
316
319
  contentContainerStyle,
317
320
  ...gestureProps,
318
321
  ...props,
319
- ...keyboardFrozenOverride,
322
+ style: scrollViewStyle,
320
323
  children: contentWrapper
321
324
  });
322
325
  }, {
@@ -42,7 +42,7 @@ var import_useSheetScrollViewGestures = require("./useSheetScrollViewGestures.na
42
42
  var import_webViewport = require("./webViewport.native.js");
43
43
  var SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
44
44
  var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {
45
- var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;
45
+ var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;
46
46
  var context = (0, import_SheetContext.useSheetContext)(scope);
47
47
  var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();
48
48
  var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -67,6 +67,11 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
67
67
  height: frozenFrameHeight,
68
68
  maxHeight: frozenFrameHeight
69
69
  } : null;
70
+ var scrollViewStyle = [
71
+ fitSizingStyle,
72
+ ...Array.isArray(style) ? style : [style],
73
+ keyboardFrozenOverride
74
+ ];
70
75
  var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;
71
76
  var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();
72
77
  var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;
@@ -244,7 +249,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
244
249
  var RNGHComponent = RNGHScrollView;
245
250
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {
246
251
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
247
- style: fitSizingStyle,
252
+ style: scrollViewStyle,
248
253
  scrollEventThrottle: 1,
249
254
  scrollEnabled,
250
255
  simultaneousHandlers: [panGestureRef],
@@ -291,7 +296,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
291
296
  keyboardShouldPersistTaps: "always",
292
297
  keyboardDismissMode: "none",
293
298
  ...props,
294
- ...keyboardFrozenOverride,
295
299
  children: contentWrapper
296
300
  });
297
301
  }
@@ -301,7 +305,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
301
305
  updateScrollable();
302
306
  },
303
307
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
304
- ...fitSizingStyle,
305
308
  scrollEventThrottle: 1,
306
309
  className: "_ovs-contain",
307
310
  scrollEnabled,
@@ -316,7 +319,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
316
319
  contentContainerStyle,
317
320
  ...gestureProps,
318
321
  ...props,
319
- ...keyboardFrozenOverride,
322
+ style: scrollViewStyle,
320
323
  children: contentWrapper
321
324
  });
322
325
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"SheetScrollView.native.js","names":[],"sources":["cjs/SheetScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar SheetScrollView_exports = {};\n__export(SheetScrollView_exports, {\n SheetScrollView: () => SheetScrollView\n});\nmodule.exports = __toCommonJS(SheetScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_core = require(\"@tamagui/core\");\nvar import_scroll_view = require(\"@tamagui/scroll-view\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_GestureSheetContext = require(\"./GestureSheetContext\");\nvar import_gestureState = require(\"./gestureState\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_useSheetScrollViewGestures = require(\"./useSheetScrollViewGestures\");\nvar import_webViewport = require(\"./webViewport\");\nvar SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nvar SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();\n var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n var isKeyboardVisible = context.isKeyboardVisible === true || import_core.isWeb && (0, import_webViewport.getWebKeyboardResizeHeight)() >= import_webViewport.MIN_KEYBOARD_HEIGHT;\n var [scrollEnabled] = (0, import_use_controllable_state.useControllableState)({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n var scrollRef = import_react.default.useRef(null);\n var [hasScrollableContent, setHasScrollableContent] = (0, import_react.useState)(true);\n var parentHeight = (0, import_react.useRef)(0);\n var contentHeight = (0, import_react.useRef)(0);\n var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n var fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : {\n flex: 1\n };\n var contentContainerStyle = hasFit ? void 0 : {\n minHeight: \"100%\"\n };\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;\n var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();\n var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;\n var currentScrollOffset = (0, import_react.useRef)(0);\n var lastEmittedScrollOffset = (0, import_react.useRef)(0);\n var lockedScrollY = (0, import_react.useRef)(0);\n var focusedInputScrollFrame = (0, import_react.useRef)(0);\n var setScrollEnabled = function(next, lockTo) {\n if (!next) {\n var _ref;\n var lockY = (_ref = lockTo !== null && lockTo !== void 0 ? lockTo : scrollBridge.scrollLockY) !== null && _ref !== void 0 ? _ref : currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: lockY,\n animated: false\n });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n var forceScrollTo = function(y) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y,\n animated: false\n });\n currentScrollOffset.current = y;\n };\n var emitManualScroll = import_react.default.useCallback(function(node, y) {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n }, [\n onScroll,\n scrollBridge\n ]);\n var scrollFocusedInputClearOfKeyboard = import_react.default.useCallback(function() {\n var _scrollRef_current;\n if (!import_core.isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n var node = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.getScrollableNode();\n var active = document.activeElement;\n if (!node || !active || !(0, import_webViewport.isEditableElement)(active) || !node.contains(active)) {\n return;\n }\n var keyboardHeight = Math.max(keyboardOccludedHeight, (0, import_webViewport.getWebKeyboardBottomInset)());\n if (keyboardHeight <= 0) return;\n var activeRect = active.getBoundingClientRect();\n var nodeRect = node.getBoundingClientRect();\n var margin = 12;\n var keyboardTop = (0, import_webViewport.getStableLayoutViewportHeight)() - keyboardHeight;\n var visibleTop = nodeRect.top + margin;\n var visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n var nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n var maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [\n hasFit,\n isKeyboardVisible,\n keyboardOccludedHeight,\n scrollBridge\n ]);\n var scheduleFocusedInputScroll = import_react.default.useCallback(function() {\n if (!import_core.isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(function() {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(scrollFocusedInputClearOfKeyboard);\n });\n }, [\n hasFit,\n scrollFocusedInputClearOfKeyboard\n ]);\n (0, import_react.useEffect)(function() {\n var _window_visualViewport;\n if (!import_core.isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return function() {\n var _window_visualViewport2;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport2 = window.visualViewport) === null || _window_visualViewport2 === void 0 ? void 0 : _window_visualViewport2.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [\n hasFit,\n scheduleFocusedInputScroll\n ]);\n (0, import_react.useEffect)(function() {\n setHasScrollView(true);\n if ((0, import_gestureState.isGestureHandlerEnabled)()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return function() {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n var updateScrollable = function() {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n var recordFitHeight = function(height) {\n parentHeight.current = height;\n };\n (0, import_react.useEffect)(function() {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [\n hasScrollableContent\n ]);\n var gestureProps = (0, import_useSheetScrollViewGestures.useSheetScrollViewGestures)({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n var contentWrapper = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.View, {\n onLayout: function(e) {\n var height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n })\n ]\n });\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n var RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n style: fitSizingStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [\n panGestureRef\n ],\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.ScrollView, {\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n ...fitSizingStyle,\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n });\n}, {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n});\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KA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,WAAW,GAAG;EACxD,GAAG;EACH,qBAAqB;EACrB,WAAW;EACX;EACA,UAAU,SAAS,GAAG;GACpB,IAAI,EAAE,MAAM,EAAE,YAAY;GAC1B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,CAAC;EAChE;EACA;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAAU;CACZ,CAAC;AACH,GAAG;CACD,cAAc;CACd,aAAa;AACf,CAAC"}
1
+ {"version":3,"file":"SheetScrollView.native.js","names":[],"sources":["cjs/SheetScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar SheetScrollView_exports = {};\n__export(SheetScrollView_exports, {\n SheetScrollView: () => SheetScrollView\n});\nmodule.exports = __toCommonJS(SheetScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_core = require(\"@tamagui/core\");\nvar import_scroll_view = require(\"@tamagui/scroll-view\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_GestureSheetContext = require(\"./GestureSheetContext\");\nvar import_gestureState = require(\"./gestureState\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_useSheetScrollViewGestures = require(\"./useSheetScrollViewGestures\");\nvar import_webViewport = require(\"./webViewport\");\nvar SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nvar SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();\n var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n var isKeyboardVisible = context.isKeyboardVisible === true || import_core.isWeb && (0, import_webViewport.getWebKeyboardResizeHeight)() >= import_webViewport.MIN_KEYBOARD_HEIGHT;\n var [scrollEnabled] = (0, import_use_controllable_state.useControllableState)({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n var scrollRef = import_react.default.useRef(null);\n var [hasScrollableContent, setHasScrollableContent] = (0, import_react.useState)(true);\n var parentHeight = (0, import_react.useRef)(0);\n var contentHeight = (0, import_react.useRef)(0);\n var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n var fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : {\n flex: 1\n };\n var contentContainerStyle = hasFit ? void 0 : {\n minHeight: \"100%\"\n };\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var scrollViewStyle = [\n fitSizingStyle,\n ...Array.isArray(style) ? style : [\n style\n ],\n keyboardFrozenOverride\n ];\n var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;\n var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();\n var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;\n var currentScrollOffset = (0, import_react.useRef)(0);\n var lastEmittedScrollOffset = (0, import_react.useRef)(0);\n var lockedScrollY = (0, import_react.useRef)(0);\n var focusedInputScrollFrame = (0, import_react.useRef)(0);\n var setScrollEnabled = function(next, lockTo) {\n if (!next) {\n var _ref;\n var lockY = (_ref = lockTo !== null && lockTo !== void 0 ? lockTo : scrollBridge.scrollLockY) !== null && _ref !== void 0 ? _ref : currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: lockY,\n animated: false\n });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n var forceScrollTo = function(y) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y,\n animated: false\n });\n currentScrollOffset.current = y;\n };\n var emitManualScroll = import_react.default.useCallback(function(node, y) {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n }, [\n onScroll,\n scrollBridge\n ]);\n var scrollFocusedInputClearOfKeyboard = import_react.default.useCallback(function() {\n var _scrollRef_current;\n if (!import_core.isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n var node = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.getScrollableNode();\n var active = document.activeElement;\n if (!node || !active || !(0, import_webViewport.isEditableElement)(active) || !node.contains(active)) {\n return;\n }\n var keyboardHeight = Math.max(keyboardOccludedHeight, (0, import_webViewport.getWebKeyboardBottomInset)());\n if (keyboardHeight <= 0) return;\n var activeRect = active.getBoundingClientRect();\n var nodeRect = node.getBoundingClientRect();\n var margin = 12;\n var keyboardTop = (0, import_webViewport.getStableLayoutViewportHeight)() - keyboardHeight;\n var visibleTop = nodeRect.top + margin;\n var visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n var nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n var maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [\n hasFit,\n isKeyboardVisible,\n keyboardOccludedHeight,\n scrollBridge\n ]);\n var scheduleFocusedInputScroll = import_react.default.useCallback(function() {\n if (!import_core.isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(function() {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(scrollFocusedInputClearOfKeyboard);\n });\n }, [\n hasFit,\n scrollFocusedInputClearOfKeyboard\n ]);\n (0, import_react.useEffect)(function() {\n var _window_visualViewport;\n if (!import_core.isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return function() {\n var _window_visualViewport2;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport2 = window.visualViewport) === null || _window_visualViewport2 === void 0 ? void 0 : _window_visualViewport2.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [\n hasFit,\n scheduleFocusedInputScroll\n ]);\n (0, import_react.useEffect)(function() {\n setHasScrollView(true);\n if ((0, import_gestureState.isGestureHandlerEnabled)()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return function() {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n var updateScrollable = function() {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n var recordFitHeight = function(height) {\n parentHeight.current = height;\n };\n (0, import_react.useEffect)(function() {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [\n hasScrollableContent\n ]);\n var gestureProps = (0, import_useSheetScrollViewGestures.useSheetScrollViewGestures)({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n var contentWrapper = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.View, {\n onLayout: function(e) {\n var height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n })\n ]\n });\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n var RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n style: scrollViewStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [\n panGestureRef\n ],\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n children: contentWrapper\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.ScrollView, {\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n style: scrollViewStyle,\n children: contentWrapper\n });\n}, {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n});\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,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;EAChF,UAAU,SAAS,GAAG;GACpB,gBAAgB,KAAK,KAAK,EAAE,YAAY,OAAO,MAAM,CAAC;GACtD,iBAAiB;EACnB;EACA,MAAM,GAAG,oBAAoB,YAAW,CAAE,WAAW,GAAG;EACxD,qBAAqB;EACrB,WAAW;EACX;EACA,UAAU,SAAS,GAAG;GACpB,IAAI,EAAE,MAAM,EAAE,YAAY;GAC1B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,CAAC;EAChE;EACA;EACA,GAAG;EACH,GAAG;EACH,OAAO;EACP,UAAU;CACZ,CAAC;AACH,GAAG;CACD,cAAc;CACd,aAAa;AACf,CAAC"}
@@ -11,7 +11,7 @@ import { MIN_KEYBOARD_HEIGHT, getStableLayoutViewportHeight, getWebKeyboardBotto
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
 
13
13
  const SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
14
- const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props }, ref) => {
14
+ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props }, ref) => {
15
15
  const context = useSheetContext(scope);
16
16
  const gestureContext = useGestureSheetContext();
17
17
  const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -36,6 +36,11 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
36
36
  height: frozenFrameHeight,
37
37
  maxHeight: frozenFrameHeight
38
38
  } : null;
39
+ const scrollViewStyle = [
40
+ fitSizingStyle,
41
+ ...Array.isArray(style) ? style : [style],
42
+ keyboardFrozenOverride
43
+ ];
39
44
  const panGestureRef = gestureContext?.panGestureRef;
40
45
  const { ScrollView: RNGHScrollView } = getGestureHandlerState();
41
46
  const useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;
@@ -207,7 +212,7 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
207
212
  const RNGHComponent = RNGHScrollView;
208
213
  return /* @__PURE__ */ jsx(RNGHComponent, {
209
214
  ref: composeRefs(scrollRef, ref),
210
- style: fitSizingStyle,
215
+ style: scrollViewStyle,
211
216
  scrollEventThrottle: 1,
212
217
  scrollEnabled,
213
218
  simultaneousHandlers: [panGestureRef],
@@ -253,7 +258,6 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
253
258
  keyboardShouldPersistTaps: "always",
254
259
  keyboardDismissMode: "none",
255
260
  ...props,
256
- ...keyboardFrozenOverride,
257
261
  children: contentWrapper
258
262
  });
259
263
  }
@@ -263,7 +267,6 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
263
267
  updateScrollable();
264
268
  },
265
269
  ref: composeRefs(scrollRef, ref),
266
- ...fitSizingStyle,
267
270
  scrollEventThrottle: 1,
268
271
  className: "_ovs-contain",
269
272
  scrollEnabled,
@@ -278,7 +281,7 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
278
281
  contentContainerStyle,
279
282
  ...gestureProps,
280
283
  ...props,
281
- ...keyboardFrozenOverride,
284
+ style: scrollViewStyle,
282
285
  children: contentWrapper
283
286
  });
284
287
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"SheetScrollView.js","names":[],"sources":["esm/SheetScrollView.js"],"sourcesContent":["import { composeRefs } from \"@tamagui/compose-refs\";\nimport { createStyledHOC, isWeb, View } from \"@tamagui/core\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useGestureSheetContext } from \"./GestureSheetContext\";\nimport { getGestureHandlerState, isGestureHandlerEnabled } from \"./gestureState\";\nimport { useSheetContext } from \"./SheetContext\";\nimport { useSheetScrollViewGestures } from \"./useSheetScrollViewGestures\";\nimport {\n getStableLayoutViewportHeight,\n getWebKeyboardBottomInset,\n getWebKeyboardResizeHeight,\n isEditableElement,\n MIN_KEYBOARD_HEIGHT\n} from \"./webViewport\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nconst SheetScrollView = createStyledHOC(\n ScrollView,\n ({\n scope,\n children,\n onScroll,\n scrollEnabled: scrollEnabledProp,\n ...props\n }, ref) => {\n const context = useSheetContext(scope);\n const gestureContext = useGestureSheetContext();\n const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n const keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n const isKeyboardVisible = context.isKeyboardVisible === true || isWeb && getWebKeyboardResizeHeight() >= MIN_KEYBOARD_HEIGHT;\n const [scrollEnabled] = useControllableState({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n const scrollRef = React.useRef(null);\n const [hasScrollableContent, setHasScrollableContent] = useState(true);\n const parentHeight = useRef(0);\n const contentHeight = useRef(0);\n const frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n const fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : { flex: 1 };\n const contentContainerStyle = hasFit ? void 0 : { minHeight: \"100%\" };\n const keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? { height: frozenFrameHeight, maxHeight: frozenFrameHeight } : null;\n const panGestureRef = gestureContext?.panGestureRef;\n const { ScrollView: RNGHScrollView } = getGestureHandlerState();\n const useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;\n const currentScrollOffset = useRef(0);\n const lastEmittedScrollOffset = useRef(0);\n const lockedScrollY = useRef(0);\n const focusedInputScrollFrame = useRef(0);\n const setScrollEnabled = (next, lockTo) => {\n if (!next) {\n const lockY = lockTo ?? scrollBridge.scrollLockY ?? currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n scrollRef.current?.scrollTo?.({ x: 0, y: lockY, animated: false });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n const forceScrollTo = (y) => {\n scrollRef.current?.scrollTo?.({ x: 0, y, animated: false });\n currentScrollOffset.current = y;\n };\n const emitManualScroll = React.useCallback(\n (node, y) => {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n },\n [onScroll, scrollBridge]\n );\n const scrollFocusedInputClearOfKeyboard = React.useCallback(() => {\n if (!isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n const node = scrollRef.current?.getScrollableNode();\n const active = document.activeElement;\n if (!node || !active || !isEditableElement(active) || !node.contains(active)) {\n return;\n }\n const keyboardHeight = Math.max(keyboardOccludedHeight, getWebKeyboardBottomInset());\n if (keyboardHeight <= 0) return;\n const activeRect = active.getBoundingClientRect();\n const nodeRect = node.getBoundingClientRect();\n const margin = 12;\n const keyboardTop = getStableLayoutViewportHeight() - keyboardHeight;\n const visibleTop = nodeRect.top + margin;\n const visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n let nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n const maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [hasFit, isKeyboardVisible, keyboardOccludedHeight, scrollBridge]);\n const scheduleFocusedInputScroll = React.useCallback(() => {\n if (!isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(() => {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(\n scrollFocusedInputClearOfKeyboard\n );\n });\n }, [hasFit, scrollFocusedInputClearOfKeyboard]);\n useEffect(() => {\n if (!isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return () => {\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [hasFit, scheduleFocusedInputScroll]);\n useEffect(() => {\n setHasScrollView(true);\n if (isGestureHandlerEnabled()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return () => {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n const updateScrollable = () => {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n const recordFitHeight = (height) => {\n parentHeight.current = height;\n };\n useEffect(() => {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [hasScrollableContent]);\n const gestureProps = useSheetScrollViewGestures({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n const contentWrapper = /* @__PURE__ */ jsxs(\n View,\n {\n onLayout: (e) => {\n const height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ jsx(\n View,\n {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n }\n )\n ]\n }\n );\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n const RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ jsx(\n RNGHComponent,\n {\n ref: composeRefs(scrollRef, ref),\n style: fitSizingStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [panGestureRef],\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n scrollRef.current?.scrollTo?.({\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll?.({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n }\n );\n }\n return /* @__PURE__ */ jsx(\n ScrollView,\n {\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: composeRefs(scrollRef, ref),\n ...fitSizingStyle,\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n }\n );\n },\n {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n }\n);\nexport {\n SheetScrollView\n};\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,yBAAyB;AAC/B,MAAM,kBAAkB,gBACtB,aACC,EACC,OACA,UACA,UACA,eAAe,mBACf,GAAG,SACF,QAAQ;CACT,MAAM,UAAU,gBAAgB,KAAK;CACrC,MAAM,iBAAiB,uBAAuB;CAC9C,MAAM,EAAE,cAAc,kBAAkB,QAAQ,eAAe;CAC/D,MAAM,yBAAyB,KAAK,IAAI,GAAG,QAAQ,0BAA0B,CAAC;CAC9E,MAAM,oBAAoB,QAAQ,sBAAsB,QAAQ,SAAS,2BAA2B,KAAK;CACzG,MAAM,CAAC,iBAAiB,qBAAqB;EAC3C,MAAM;EACN,aAAa;CACf,CAAC;CACD,MAAM,YAAY,MAAM,OAAO,IAAI;CACnC,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,IAAI;CACrE,MAAM,eAAe,OAAO,CAAC;CAC7B,MAAM,gB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B,qBAAqB;GACrB,GAAG;GACH,GAAG;GACH,UAAU;EACZ,CACF;CACF;CACA,OAAuB,oBACrB,YACA;EACE,WAAW,MAAM;GACf,gBAAgB,KAAK,KAAK,EAAE,YAAY,OAAO,MAAM,CAAC;GACtD,iBAAiB;EACnB;EACA,KAAK,YAAY,WAAW,GAAG;EAC/B,GAAG;EACH,qBAAqB;EACrB,WAAW;EACX;EACA,WAAW,MAAM;GACf,MAAM,EAAE,MAAM,EAAE,YAAY;GAC5B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,WAAW,CAAC;EACd;EACA;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAAU;CACZ,CACF;AACF,GACA;CACE,cAAc;CACd,aAAa;AACf,CACF"}
1
+ {"version":3,"file":"SheetScrollView.js","names":[],"sources":["esm/SheetScrollView.js"],"sourcesContent":["import { composeRefs } from \"@tamagui/compose-refs\";\nimport { createStyledHOC, isWeb, View } from \"@tamagui/core\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useGestureSheetContext } from \"./GestureSheetContext\";\nimport { getGestureHandlerState, isGestureHandlerEnabled } from \"./gestureState\";\nimport { useSheetContext } from \"./SheetContext\";\nimport { useSheetScrollViewGestures } from \"./useSheetScrollViewGestures\";\nimport {\n getStableLayoutViewportHeight,\n getWebKeyboardBottomInset,\n getWebKeyboardResizeHeight,\n isEditableElement,\n MIN_KEYBOARD_HEIGHT\n} from \"./webViewport\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nconst SheetScrollView = createStyledHOC(\n ScrollView,\n ({\n scope,\n children,\n onScroll,\n scrollEnabled: scrollEnabledProp,\n style,\n ...props\n }, ref) => {\n const context = useSheetContext(scope);\n const gestureContext = useGestureSheetContext();\n const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n const keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n const isKeyboardVisible = context.isKeyboardVisible === true || isWeb && getWebKeyboardResizeHeight() >= MIN_KEYBOARD_HEIGHT;\n const [scrollEnabled] = useControllableState({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n const scrollRef = React.useRef(null);\n const [hasScrollableContent, setHasScrollableContent] = useState(true);\n const parentHeight = useRef(0);\n const contentHeight = useRef(0);\n const frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n const fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : { flex: 1 };\n const contentContainerStyle = hasFit ? void 0 : { minHeight: \"100%\" };\n const keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? { height: frozenFrameHeight, maxHeight: frozenFrameHeight } : null;\n const scrollViewStyle = [\n fitSizingStyle,\n ...Array.isArray(style) ? style : [style],\n keyboardFrozenOverride\n ];\n const panGestureRef = gestureContext?.panGestureRef;\n const { ScrollView: RNGHScrollView } = getGestureHandlerState();\n const useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;\n const currentScrollOffset = useRef(0);\n const lastEmittedScrollOffset = useRef(0);\n const lockedScrollY = useRef(0);\n const focusedInputScrollFrame = useRef(0);\n const setScrollEnabled = (next, lockTo) => {\n if (!next) {\n const lockY = lockTo ?? scrollBridge.scrollLockY ?? currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n scrollRef.current?.scrollTo?.({ x: 0, y: lockY, animated: false });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n const forceScrollTo = (y) => {\n scrollRef.current?.scrollTo?.({ x: 0, y, animated: false });\n currentScrollOffset.current = y;\n };\n const emitManualScroll = React.useCallback(\n (node, y) => {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n },\n [onScroll, scrollBridge]\n );\n const scrollFocusedInputClearOfKeyboard = React.useCallback(() => {\n if (!isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n const node = scrollRef.current?.getScrollableNode();\n const active = document.activeElement;\n if (!node || !active || !isEditableElement(active) || !node.contains(active)) {\n return;\n }\n const keyboardHeight = Math.max(keyboardOccludedHeight, getWebKeyboardBottomInset());\n if (keyboardHeight <= 0) return;\n const activeRect = active.getBoundingClientRect();\n const nodeRect = node.getBoundingClientRect();\n const margin = 12;\n const keyboardTop = getStableLayoutViewportHeight() - keyboardHeight;\n const visibleTop = nodeRect.top + margin;\n const visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n let nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n const maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [hasFit, isKeyboardVisible, keyboardOccludedHeight, scrollBridge]);\n const scheduleFocusedInputScroll = React.useCallback(() => {\n if (!isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(() => {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(\n scrollFocusedInputClearOfKeyboard\n );\n });\n }, [hasFit, scrollFocusedInputClearOfKeyboard]);\n useEffect(() => {\n if (!isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return () => {\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [hasFit, scheduleFocusedInputScroll]);\n useEffect(() => {\n setHasScrollView(true);\n if (isGestureHandlerEnabled()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return () => {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n const updateScrollable = () => {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n const recordFitHeight = (height) => {\n parentHeight.current = height;\n };\n useEffect(() => {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [hasScrollableContent]);\n const gestureProps = useSheetScrollViewGestures({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n const contentWrapper = /* @__PURE__ */ jsxs(\n View,\n {\n onLayout: (e) => {\n const height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ jsx(\n View,\n {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n }\n )\n ]\n }\n );\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n const RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ jsx(\n RNGHComponent,\n {\n ref: composeRefs(scrollRef, ref),\n style: scrollViewStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [panGestureRef],\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n scrollRef.current?.scrollTo?.({\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll?.({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n children: contentWrapper\n }\n );\n }\n return /* @__PURE__ */ jsx(\n ScrollView,\n {\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: composeRefs(scrollRef, ref),\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n style: scrollViewStyle,\n children: contentWrapper\n }\n );\n },\n {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n }\n);\nexport {\n SheetScrollView\n};\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,yBAAyB;AAC/B,MAAM,kBAAkB,gBACtB,aACC,EACC,OACA,UACA,UACA,eAAe,mBACf,OACA,GAAG,SACF,QAAQ;CACT,MAAM,UAAU,gBAAgB,KAAK;CACrC,MAAM,iBAAiB,uBAAuB;CAC9C,MAAM,EAAE,cAAc,kBAAkB,QAAQ,eAAe;CAC/D,MAAM,yBAAyB,KAAK,IAAI,GAAG,QAAQ,0BAA0B,CAAC;CAC9E,MAAM,oBAAoB,QAAQ,sBAAsB,QAAQ,SAAS,2BAA2B,KAAK;CACzG,MAAM,CAAC,iBAAiB,qBAAqB;EAC3C,MAAM;EACN,aAAa;CACf,CAAC;CACD,MAAM,YAAY,MAAM,OAAO,IAAI;CACnC,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,IAAI;CACrE,MAAM,eAAe,OAAO,CAAC;CAC7B,MAAM,gBAAgB,OAAO,CAAC;CAC9B,MAAM,oBAAoB,KAAK,IAAI,GAAG,QAAQ,6BAA6B,CAAC;CAC5E,MAAM,iBAAiB,SAAS;EAC9B,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,WAAW,cAAc,KAAK;CAChC,IAAI,EAAE,MAAM,EAAE;CACd,MAAM,wBAAwB,SAAS,KAAK,IAAI,EAAE,WAAW,OAAO;CACpE,MAAM,yBAAyB,UAAU,qBAAqB,oBAAoB,IAAI;EAAE,QAAQ;E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X;EACA,WAAW,MAAM;GACf,MAAM,EAAE,MAAM,EAAE,YAAY;GAC5B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,WAAW,CAAC;EACd;EACA;EACA,GAAG;EACH,GAAG;EACH,OAAO;EACP,UAAU;CACZ,CACF;AACF,GACA;CACE,cAAc;CACd,aAAa;AACf,CACF"}
@@ -12,7 +12,7 @@ import { MIN_KEYBOARD_HEIGHT, getStableLayoutViewportHeight, getWebKeyboardBotto
12
12
 
13
13
  var SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
14
14
  var SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {
15
- var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;
15
+ var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;
16
16
  var context = useSheetContext(scope);
17
17
  var gestureContext = useGestureSheetContext();
18
18
  var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -37,6 +37,11 @@ var SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {
37
37
  height: frozenFrameHeight,
38
38
  maxHeight: frozenFrameHeight
39
39
  } : null;
40
+ var scrollViewStyle = [
41
+ fitSizingStyle,
42
+ ...Array.isArray(style) ? style : [style],
43
+ keyboardFrozenOverride
44
+ ];
40
45
  var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;
41
46
  var { ScrollView: RNGHScrollView } = getGestureHandlerState();
42
47
  var useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;
@@ -214,7 +219,7 @@ var SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {
214
219
  var RNGHComponent = RNGHScrollView;
215
220
  return /* @__PURE__ */ jsx(RNGHComponent, {
216
221
  ref: composeRefs(scrollRef, ref),
217
- style: fitSizingStyle,
222
+ style: scrollViewStyle,
218
223
  scrollEventThrottle: 1,
219
224
  scrollEnabled,
220
225
  simultaneousHandlers: [panGestureRef],
@@ -261,7 +266,6 @@ var SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {
261
266
  keyboardShouldPersistTaps: "always",
262
267
  keyboardDismissMode: "none",
263
268
  ...props,
264
- ...keyboardFrozenOverride,
265
269
  children: contentWrapper
266
270
  });
267
271
  }
@@ -271,7 +275,6 @@ var SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {
271
275
  updateScrollable();
272
276
  },
273
277
  ref: composeRefs(scrollRef, ref),
274
- ...fitSizingStyle,
275
278
  scrollEventThrottle: 1,
276
279
  className: "_ovs-contain",
277
280
  scrollEnabled,
@@ -286,7 +289,7 @@ var SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {
286
289
  contentContainerStyle,
287
290
  ...gestureProps,
288
291
  ...props,
289
- ...keyboardFrozenOverride,
292
+ style: scrollViewStyle,
290
293
  children: contentWrapper
291
294
  });
292
295
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"SheetScrollView.native.js","names":[],"sources":["esm/SheetScrollView.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { composeRefs } from \"@tamagui/compose-refs\";\nimport { createStyledHOC, isWeb, View } from \"@tamagui/core\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useGestureSheetContext } from \"./GestureSheetContext\";\nimport { getGestureHandlerState, isGestureHandlerEnabled } from \"./gestureState\";\nimport { useSheetContext } from \"./SheetContext\";\nimport { useSheetScrollViewGestures } from \"./useSheetScrollViewGestures\";\nimport { getStableLayoutViewportHeight, getWebKeyboardBottomInset, getWebKeyboardResizeHeight, isEditableElement, MIN_KEYBOARD_HEIGHT } from \"./webViewport\";\nvar SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nvar SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;\n var context = useSheetContext(scope);\n var gestureContext = useGestureSheetContext();\n var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n var isKeyboardVisible = context.isKeyboardVisible === true || isWeb && getWebKeyboardResizeHeight() >= MIN_KEYBOARD_HEIGHT;\n var [scrollEnabled] = useControllableState({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n var scrollRef = React.useRef(null);\n var [hasScrollableContent, setHasScrollableContent] = useState(true);\n var parentHeight = useRef(0);\n var contentHeight = useRef(0);\n var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n var fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : {\n flex: 1\n };\n var contentContainerStyle = hasFit ? void 0 : {\n minHeight: \"100%\"\n };\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;\n var { ScrollView: RNGHScrollView } = getGestureHandlerState();\n var useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;\n var currentScrollOffset = useRef(0);\n var lastEmittedScrollOffset = useRef(0);\n var lockedScrollY = useRef(0);\n var focusedInputScrollFrame = useRef(0);\n var setScrollEnabled = function(next, lockTo) {\n if (!next) {\n var _ref;\n var lockY = (_ref = lockTo !== null && lockTo !== void 0 ? lockTo : scrollBridge.scrollLockY) !== null && _ref !== void 0 ? _ref : currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: lockY,\n animated: false\n });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n var forceScrollTo = function(y) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y,\n animated: false\n });\n currentScrollOffset.current = y;\n };\n var emitManualScroll = React.useCallback(function(node, y) {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n }, [\n onScroll,\n scrollBridge\n ]);\n var scrollFocusedInputClearOfKeyboard = React.useCallback(function() {\n var _scrollRef_current;\n if (!isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n var node = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.getScrollableNode();\n var active = document.activeElement;\n if (!node || !active || !isEditableElement(active) || !node.contains(active)) {\n return;\n }\n var keyboardHeight = Math.max(keyboardOccludedHeight, getWebKeyboardBottomInset());\n if (keyboardHeight <= 0) return;\n var activeRect = active.getBoundingClientRect();\n var nodeRect = node.getBoundingClientRect();\n var margin = 12;\n var keyboardTop = getStableLayoutViewportHeight() - keyboardHeight;\n var visibleTop = nodeRect.top + margin;\n var visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n var nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n var maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [\n hasFit,\n isKeyboardVisible,\n keyboardOccludedHeight,\n scrollBridge\n ]);\n var scheduleFocusedInputScroll = React.useCallback(function() {\n if (!isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(function() {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(scrollFocusedInputClearOfKeyboard);\n });\n }, [\n hasFit,\n scrollFocusedInputClearOfKeyboard\n ]);\n useEffect(function() {\n var _window_visualViewport;\n if (!isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return function() {\n var _window_visualViewport2;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport2 = window.visualViewport) === null || _window_visualViewport2 === void 0 ? void 0 : _window_visualViewport2.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [\n hasFit,\n scheduleFocusedInputScroll\n ]);\n useEffect(function() {\n setHasScrollView(true);\n if (isGestureHandlerEnabled()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return function() {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n var updateScrollable = function() {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n var recordFitHeight = function(height) {\n parentHeight.current = height;\n };\n useEffect(function() {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [\n hasScrollableContent\n ]);\n var gestureProps = useSheetScrollViewGestures({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n var contentWrapper = /* @__PURE__ */ _jsxs(View, {\n onLayout: function(e) {\n var height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ _jsx(View, {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n })\n ]\n });\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n var RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ _jsx(RNGHComponent, {\n ref: composeRefs(scrollRef, ref),\n style: fitSizingStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [\n panGestureRef\n ],\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n });\n }\n return /* @__PURE__ */ _jsx(ScrollView, {\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: composeRefs(scrollRef, ref),\n ...fitSizingStyle,\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n });\n}, {\n disableTheme: true,\n displayName: SHEET_SCRO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I,aAAa;KAC9B,IAAI,wBAAwB,YAAY,aAAa,aAAa;MAChE,wBAAwB,UAAU,aAAa;MAC/C,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS;OAC3D,GAAG;OACH,aAAa;QACX,GAAG,EAAE;QACL,eAAe;SACb,GAAG,EAAE,YAAY;SACjB,GAAG,aAAa;QAClB;OACF;MACF,CAAC;KACH;KACA;IACF;IACA,aAAa,IAAI;IACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;IACxC,wBAAwB,UAAU;IAClC,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,CAAC;GAChE;GACA;GACA,SAAS;GACT,2BAA2B;GAC3B,qBAAqB;GACrB,GAAG;GACH,GAAG;GACH,UAAU;EACZ,CAAC;CACH;CACA,OAAuB,oBAAK,YAAY;EACtC,UAAU,SAAS,GAAG;GACpB,gBAAgB,KAAK,KAAK,EAAE,YAAY,OAAO,MAAM,CAAC;GACtD,iBAAiB;EACnB;EACA,KAAK,YAAY,WAAW,GAAG;EAC/B,GAAG;EACH,qBAAqB;EACrB,WAAW;EACX;EACA,UAAU,SAAS,GAAG;GACpB,IAAI,EAAE,MAAM,EAAE,YAAY;GAC1B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,CAAC;EAChE;EACA;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAAU;CACZ,CAAC;AACH,GAAG;CACD,cAAc;CACd,aAAa;AACf,CAAC"}
1
+ {"version":3,"file":"SheetScrollView.native.js","names":[],"sources":["esm/SheetScrollView.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { composeRefs } from \"@tamagui/compose-refs\";\nimport { createStyledHOC, isWeb, View } from \"@tamagui/core\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useGestureSheetContext } from \"./GestureSheetContext\";\nimport { getGestureHandlerState, isGestureHandlerEnabled } from \"./gestureState\";\nimport { useSheetContext } from \"./SheetContext\";\nimport { useSheetScrollViewGestures } from \"./useSheetScrollViewGestures\";\nimport { getStableLayoutViewportHeight, getWebKeyboardBottomInset, getWebKeyboardResizeHeight, isEditableElement, MIN_KEYBOARD_HEIGHT } from \"./webViewport\";\nvar SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nvar SheetScrollView = createStyledHOC(ScrollView, function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;\n var context = useSheetContext(scope);\n var gestureContext = useGestureSheetContext();\n var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n var isKeyboardVisible = context.isKeyboardVisible === true || isWeb && getWebKeyboardResizeHeight() >= MIN_KEYBOARD_HEIGHT;\n var [scrollEnabled] = useControllableState({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n var scrollRef = React.useRef(null);\n var [hasScrollableContent, setHasScrollableContent] = useState(true);\n var parentHeight = useRef(0);\n var contentHeight = useRef(0);\n var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n var fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : {\n flex: 1\n };\n var contentContainerStyle = hasFit ? void 0 : {\n minHeight: \"100%\"\n };\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var scrollViewStyle = [\n fitSizingStyle,\n ...Array.isArray(style) ? style : [\n style\n ],\n keyboardFrozenOverride\n ];\n var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;\n var { ScrollView: RNGHScrollView } = getGestureHandlerState();\n var useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;\n var currentScrollOffset = useRef(0);\n var lastEmittedScrollOffset = useRef(0);\n var lockedScrollY = useRef(0);\n var focusedInputScrollFrame = useRef(0);\n var setScrollEnabled = function(next, lockTo) {\n if (!next) {\n var _ref;\n var lockY = (_ref = lockTo !== null && lockTo !== void 0 ? lockTo : scrollBridge.scrollLockY) !== null && _ref !== void 0 ? _ref : currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: lockY,\n animated: false\n });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n var forceScrollTo = function(y) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y,\n animated: false\n });\n currentScrollOffset.current = y;\n };\n var emitManualScroll = React.useCallback(function(node, y) {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n }, [\n onScroll,\n scrollBridge\n ]);\n var scrollFocusedInputClearOfKeyboard = React.useCallback(function() {\n var _scrollRef_current;\n if (!isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n var node = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.getScrollableNode();\n var active = document.activeElement;\n if (!node || !active || !isEditableElement(active) || !node.contains(active)) {\n return;\n }\n var keyboardHeight = Math.max(keyboardOccludedHeight, getWebKeyboardBottomInset());\n if (keyboardHeight <= 0) return;\n var activeRect = active.getBoundingClientRect();\n var nodeRect = node.getBoundingClientRect();\n var margin = 12;\n var keyboardTop = getStableLayoutViewportHeight() - keyboardHeight;\n var visibleTop = nodeRect.top + margin;\n var visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n var nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n var maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [\n hasFit,\n isKeyboardVisible,\n keyboardOccludedHeight,\n scrollBridge\n ]);\n var scheduleFocusedInputScroll = React.useCallback(function() {\n if (!isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(function() {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(scrollFocusedInputClearOfKeyboard);\n });\n }, [\n hasFit,\n scrollFocusedInputClearOfKeyboard\n ]);\n useEffect(function() {\n var _window_visualViewport;\n if (!isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return function() {\n var _window_visualViewport2;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport2 = window.visualViewport) === null || _window_visualViewport2 === void 0 ? void 0 : _window_visualViewport2.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [\n hasFit,\n scheduleFocusedInputScroll\n ]);\n useEffect(function() {\n setHasScrollView(true);\n if (isGestureHandlerEnabled()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return function() {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n var updateScrollable = function() {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n var recordFitHeight = function(height) {\n parentHeight.current = height;\n };\n useEffect(function() {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [\n hasScrollableContent\n ]);\n var gestureProps = useSheetScrollViewGestures({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n var contentWrapper = /* @__PURE__ */ _jsxs(View, {\n onLayout: function(e) {\n var height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ _jsx(View, {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n })\n ]\n });\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n var RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ _jsx(RNGHComponent, {\n ref: composeRefs(scrollRef, ref),\n style: scrollViewStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [\n panGestureRef\n ],\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n children: contentWrapper\n });\n }\n return /* @__PURE__ */ _jsx(ScrollView, {\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: composeRefs(scrollRef, ref),\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n style: scrollViewStyle,\n children: contentWrapper\n });\n}, {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n});\nexport {\n SheetScrollView\n};\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAI,yBAAyB;AAC7B,IAAI,kBAAkB,gBAAgB,YAAY,SAAS,OAAO,KAAK;CACrE,IAAI,EAAE,OAAO,UAAU,UAAU,eAAe,mBAAmB,OAAO,GAAG,UAAU;CACvF,IAAI,UAAU,gBAAgB,KAAK;CACnC,IAAI,iBAAiB,uBAAuB;CAC5C,IAAI,EAAE,cAAc,kBAAkB,QAAQ,eAAe;CAC7D,IAAI,yBAAyB,KAAK,IAAI,GAAG,QAAQ,0BAA0B,CAAC;CAC5E,IAAI,oBAAoB,QAAQ,sBAAsB,QAAQ,SAAS,2BAA2B,KAAK;CACvG,IAAI,CAAC,iBAAiB,qBAAqB;EACzC,MAAM;EACN,aAAa;CACf,CAAC;CACD,IAAI,YAAY,MAAM,OAAO,IAAI;CACjC,IAAI,CAAC,sBAAsB,2BAA2B,SAAS,IAAI;CACnE,IAAI,eAAe,OAAO,CAAC;CAC3B,IAAI,gBAAgB,OAAO,CAAC;CAC5B,IAAI,oBAAoB,KAAK,IAAI,GAAG,QAAQ,6BAA6B,CAAC;CAC1E,IAA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EACrB,WAAW;EACX;EACA,UAAU,SAAS,GAAG;GACpB,IAAI,EAAE,MAAM,EAAE,YAAY;GAC1B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,CAAC;EAChE;EACA;EACA,GAAG;EACH,GAAG;EACH,OAAO;EACP,UAAU;CACZ,CAAC;AACH,GAAG;CACD,cAAc;CACd,aAAa;AACf,CAAC"}
@@ -11,7 +11,7 @@ import { MIN_KEYBOARD_HEIGHT, getStableLayoutViewportHeight, getWebKeyboardBotto
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
 
13
13
  const SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
14
- const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props }, ref) => {
14
+ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props }, ref) => {
15
15
  const context = useSheetContext(scope);
16
16
  const gestureContext = useGestureSheetContext();
17
17
  const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -36,6 +36,11 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
36
36
  height: frozenFrameHeight,
37
37
  maxHeight: frozenFrameHeight
38
38
  } : null;
39
+ const scrollViewStyle = [
40
+ fitSizingStyle,
41
+ ...Array.isArray(style) ? style : [style],
42
+ keyboardFrozenOverride
43
+ ];
39
44
  const panGestureRef = gestureContext?.panGestureRef;
40
45
  const { ScrollView: RNGHScrollView } = getGestureHandlerState();
41
46
  const useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;
@@ -207,7 +212,7 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
207
212
  const RNGHComponent = RNGHScrollView;
208
213
  return /* @__PURE__ */ jsx(RNGHComponent, {
209
214
  ref: composeRefs(scrollRef, ref),
210
- style: fitSizingStyle,
215
+ style: scrollViewStyle,
211
216
  scrollEventThrottle: 1,
212
217
  scrollEnabled,
213
218
  simultaneousHandlers: [panGestureRef],
@@ -253,7 +258,6 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
253
258
  keyboardShouldPersistTaps: "always",
254
259
  keyboardDismissMode: "none",
255
260
  ...props,
256
- ...keyboardFrozenOverride,
257
261
  children: contentWrapper
258
262
  });
259
263
  }
@@ -263,7 +267,6 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
263
267
  updateScrollable();
264
268
  },
265
269
  ref: composeRefs(scrollRef, ref),
266
- ...fitSizingStyle,
267
270
  scrollEventThrottle: 1,
268
271
  className: "_ovs-contain",
269
272
  scrollEnabled,
@@ -278,7 +281,7 @@ const SheetScrollView = createStyledHOC(ScrollView, ({ scope, children, onScroll
278
281
  contentContainerStyle,
279
282
  ...gestureProps,
280
283
  ...props,
281
- ...keyboardFrozenOverride,
284
+ style: scrollViewStyle,
282
285
  children: contentWrapper
283
286
  });
284
287
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"SheetScrollView.js","names":[],"sources":["jsx/SheetScrollView.js"],"sourcesContent":["import { composeRefs } from \"@tamagui/compose-refs\";\nimport { createStyledHOC, isWeb, View } from \"@tamagui/core\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useGestureSheetContext } from \"./GestureSheetContext\";\nimport { getGestureHandlerState, isGestureHandlerEnabled } from \"./gestureState\";\nimport { useSheetContext } from \"./SheetContext\";\nimport { useSheetScrollViewGestures } from \"./useSheetScrollViewGestures\";\nimport {\n getStableLayoutViewportHeight,\n getWebKeyboardBottomInset,\n getWebKeyboardResizeHeight,\n isEditableElement,\n MIN_KEYBOARD_HEIGHT\n} from \"./webViewport\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nconst SheetScrollView = createStyledHOC(\n ScrollView,\n ({\n scope,\n children,\n onScroll,\n scrollEnabled: scrollEnabledProp,\n ...props\n }, ref) => {\n const context = useSheetContext(scope);\n const gestureContext = useGestureSheetContext();\n const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n const keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n const isKeyboardVisible = context.isKeyboardVisible === true || isWeb && getWebKeyboardResizeHeight() >= MIN_KEYBOARD_HEIGHT;\n const [scrollEnabled] = useControllableState({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n const scrollRef = React.useRef(null);\n const [hasScrollableContent, setHasScrollableContent] = useState(true);\n const parentHeight = useRef(0);\n const contentHeight = useRef(0);\n const frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n const fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : { flex: 1 };\n const contentContainerStyle = hasFit ? void 0 : { minHeight: \"100%\" };\n const keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? { height: frozenFrameHeight, maxHeight: frozenFrameHeight } : null;\n const panGestureRef = gestureContext?.panGestureRef;\n const { ScrollView: RNGHScrollView } = getGestureHandlerState();\n const useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;\n const currentScrollOffset = useRef(0);\n const lastEmittedScrollOffset = useRef(0);\n const lockedScrollY = useRef(0);\n const focusedInputScrollFrame = useRef(0);\n const setScrollEnabled = (next, lockTo) => {\n if (!next) {\n const lockY = lockTo ?? scrollBridge.scrollLockY ?? currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n scrollRef.current?.scrollTo?.({ x: 0, y: lockY, animated: false });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n const forceScrollTo = (y) => {\n scrollRef.current?.scrollTo?.({ x: 0, y, animated: false });\n currentScrollOffset.current = y;\n };\n const emitManualScroll = React.useCallback(\n (node, y) => {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n },\n [onScroll, scrollBridge]\n );\n const scrollFocusedInputClearOfKeyboard = React.useCallback(() => {\n if (!isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n const node = scrollRef.current?.getScrollableNode();\n const active = document.activeElement;\n if (!node || !active || !isEditableElement(active) || !node.contains(active)) {\n return;\n }\n const keyboardHeight = Math.max(keyboardOccludedHeight, getWebKeyboardBottomInset());\n if (keyboardHeight <= 0) return;\n const activeRect = active.getBoundingClientRect();\n const nodeRect = node.getBoundingClientRect();\n const margin = 12;\n const keyboardTop = getStableLayoutViewportHeight() - keyboardHeight;\n const visibleTop = nodeRect.top + margin;\n const visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n let nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n const maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [hasFit, isKeyboardVisible, keyboardOccludedHeight, scrollBridge]);\n const scheduleFocusedInputScroll = React.useCallback(() => {\n if (!isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(() => {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(\n scrollFocusedInputClearOfKeyboard\n );\n });\n }, [hasFit, scrollFocusedInputClearOfKeyboard]);\n useEffect(() => {\n if (!isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return () => {\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [hasFit, scheduleFocusedInputScroll]);\n useEffect(() => {\n setHasScrollView(true);\n if (isGestureHandlerEnabled()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return () => {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n const updateScrollable = () => {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n const recordFitHeight = (height) => {\n parentHeight.current = height;\n };\n useEffect(() => {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [hasScrollableContent]);\n const gestureProps = useSheetScrollViewGestures({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n const contentWrapper = /* @__PURE__ */ jsxs(\n View,\n {\n onLayout: (e) => {\n const height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ jsx(\n View,\n {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n }\n )\n ]\n }\n );\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n const RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ jsx(\n RNGHComponent,\n {\n ref: composeRefs(scrollRef, ref),\n style: fitSizingStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [panGestureRef],\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n scrollRef.current?.scrollTo?.({\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll?.({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n }\n );\n }\n return /* @__PURE__ */ jsx(\n ScrollView,\n {\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: composeRefs(scrollRef, ref),\n ...fitSizingStyle,\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n }\n );\n },\n {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n }\n);\nexport {\n SheetScrollView\n};\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,yBAAyB;AAC/B,MAAM,kBAAkB,gBACtB,aACC,EACC,OACA,UACA,UACA,eAAe,mBACf,GAAG,SACF,QAAQ;CACT,MAAM,UAAU,gBAAgB,KAAK;CACrC,MAAM,iBAAiB,uBAAuB;CAC9C,MAAM,EAAE,cAAc,kBAAkB,QAAQ,eAAe;CAC/D,MAAM,yBAAyB,KAAK,IAAI,GAAG,QAAQ,0BAA0B,CAAC;CAC9E,MAAM,oBAAoB,QAAQ,sBAAsB,QAAQ,SAAS,2BAA2B,KAAK;CACzG,MAAM,CAAC,iBAAiB,qBAAqB;EAC3C,MAAM;EACN,aAAa;CACf,CAAC;CACD,MAAM,YAAY,MAAM,OAAO,IAAI;CACnC,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,IAAI;CACrE,MAAM,eAAe,OAAO,CAAC;CAC7B,MAAM,gBAAgB,OAAO,CAAC;CAC9B,MAAM,oBAAoB,KAAK,IAAI,GAAG,QAAQ,6BAA6B,CAAC;CAC5E,MAAM,iBAAiB,SAAS;EAC9B,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,WAAW,cAAc,KAA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AAiB;EACnB;EACA,KAAK,YAAY,WAAW,GAAG;EAC/B,GAAG;EACH,qBAAqB;EACrB,WAAW;EACX;EACA,WAAW,MAAM;GACf,MAAM,EAAE,MAAM,EAAE,YAAY;GAC5B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,WAAW,CAAC;EACd;EACA;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAAU;CACZ,CACF;AACF,GACA;CACE,cAAc;CACd,aAAa;AACf,CACF"}
1
+ {"version":3,"file":"SheetScrollView.js","names":[],"sources":["jsx/SheetScrollView.js"],"sourcesContent":["import { composeRefs } from \"@tamagui/compose-refs\";\nimport { createStyledHOC, isWeb, View } from \"@tamagui/core\";\nimport { ScrollView } from \"@tamagui/scroll-view\";\nimport { useControllableState } from \"@tamagui/use-controllable-state\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { useGestureSheetContext } from \"./GestureSheetContext\";\nimport { getGestureHandlerState, isGestureHandlerEnabled } from \"./gestureState\";\nimport { useSheetContext } from \"./SheetContext\";\nimport { useSheetScrollViewGestures } from \"./useSheetScrollViewGestures\";\nimport {\n getStableLayoutViewportHeight,\n getWebKeyboardBottomInset,\n getWebKeyboardResizeHeight,\n isEditableElement,\n MIN_KEYBOARD_HEIGHT\n} from \"./webViewport\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nconst SheetScrollView = createStyledHOC(\n ScrollView,\n ({\n scope,\n children,\n onScroll,\n scrollEnabled: scrollEnabledProp,\n style,\n ...props\n }, ref) => {\n const context = useSheetContext(scope);\n const gestureContext = useGestureSheetContext();\n const { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n const keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n const isKeyboardVisible = context.isKeyboardVisible === true || isWeb && getWebKeyboardResizeHeight() >= MIN_KEYBOARD_HEIGHT;\n const [scrollEnabled] = useControllableState({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n const scrollRef = React.useRef(null);\n const [hasScrollableContent, setHasScrollableContent] = useState(true);\n const parentHeight = useRef(0);\n const contentHeight = useRef(0);\n const frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n const fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : { flex: 1 };\n const contentContainerStyle = hasFit ? void 0 : { minHeight: \"100%\" };\n const keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? { height: frozenFrameHeight, maxHeight: frozenFrameHeight } : null;\n const scrollViewStyle = [\n fitSizingStyle,\n ...Array.isArray(style) ? style : [style],\n keyboardFrozenOverride\n ];\n const panGestureRef = gestureContext?.panGestureRef;\n const { ScrollView: RNGHScrollView } = getGestureHandlerState();\n const useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;\n const currentScrollOffset = useRef(0);\n const lastEmittedScrollOffset = useRef(0);\n const lockedScrollY = useRef(0);\n const focusedInputScrollFrame = useRef(0);\n const setScrollEnabled = (next, lockTo) => {\n if (!next) {\n const lockY = lockTo ?? scrollBridge.scrollLockY ?? currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n scrollRef.current?.scrollTo?.({ x: 0, y: lockY, animated: false });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n const forceScrollTo = (y) => {\n scrollRef.current?.scrollTo?.({ x: 0, y, animated: false });\n currentScrollOffset.current = y;\n };\n const emitManualScroll = React.useCallback(\n (node, y) => {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n },\n [onScroll, scrollBridge]\n );\n const scrollFocusedInputClearOfKeyboard = React.useCallback(() => {\n if (!isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n const node = scrollRef.current?.getScrollableNode();\n const active = document.activeElement;\n if (!node || !active || !isEditableElement(active) || !node.contains(active)) {\n return;\n }\n const keyboardHeight = Math.max(keyboardOccludedHeight, getWebKeyboardBottomInset());\n if (keyboardHeight <= 0) return;\n const activeRect = active.getBoundingClientRect();\n const nodeRect = node.getBoundingClientRect();\n const margin = 12;\n const keyboardTop = getStableLayoutViewportHeight() - keyboardHeight;\n const visibleTop = nodeRect.top + margin;\n const visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n let nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n const maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [hasFit, isKeyboardVisible, keyboardOccludedHeight, scrollBridge]);\n const scheduleFocusedInputScroll = React.useCallback(() => {\n if (!isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(() => {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(\n scrollFocusedInputClearOfKeyboard\n );\n });\n }, [hasFit, scrollFocusedInputClearOfKeyboard]);\n useEffect(() => {\n if (!isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return () => {\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n window.visualViewport?.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [hasFit, scheduleFocusedInputScroll]);\n useEffect(() => {\n setHasScrollView(true);\n if (isGestureHandlerEnabled()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return () => {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n const updateScrollable = () => {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n const recordFitHeight = (height) => {\n parentHeight.current = height;\n };\n useEffect(() => {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [hasScrollableContent]);\n const gestureProps = useSheetScrollViewGestures({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n const contentWrapper = /* @__PURE__ */ jsxs(\n View,\n {\n onLayout: (e) => {\n const height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ jsx(\n View,\n {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n }\n )\n ]\n }\n );\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n const RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ jsx(\n RNGHComponent,\n {\n ref: composeRefs(scrollRef, ref),\n style: scrollViewStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [panGestureRef],\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n scrollRef.current?.scrollTo?.({\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll?.({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n children: contentWrapper\n }\n );\n }\n return /* @__PURE__ */ jsx(\n ScrollView,\n {\n onLayout: (e) => {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: composeRefs(scrollRef, ref),\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: (e) => {\n const { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll?.(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n style: scrollViewStyle,\n children: contentWrapper\n }\n );\n },\n {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n }\n);\nexport {\n SheetScrollView\n};\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,yBAAyB;AAC/B,MAAM,kBAAkB,gBACtB,aACC,EACC,OACA,UACA,UACA,eAAe,mBACf,OACA,GAAG,SACF,QAAQ;CACT,MAAM,UAAU,gBAAgB,KAAK;CACrC,MAAM,iBAAiB,uBAAuB;CAC9C,MAAM,EAAE,cAAc,kBAAkB,QAAQ,eAAe;CAC/D,MAAM,yBAAyB,KAAK,IAAI,GAAG,QAAQ,0BAA0B,CAAC;CAC9E,MAAM,oBAAoB,QAAQ,sBAAsB,QAAQ,SAAS,2BAA2B,KAAK;CACzG,MAAM,CAAC,iBAAiB,qBAAqB;EAC3C,MAAM;EACN,aAAa;CACf,CAAC;CACD,MAAM,YAAY,MAAM,OAAO,IAAI;CACnC,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,IAAI;CACrE,MAAM,eAAe,OAAO,CAAC;CAC7B,MAAM,gBAAgB,OAAO,CAAC;CAC9B,MAAM,oBAAoB,KAAK,IAAI,GAAG,QAAQ,6BAA6B,CAAC;CAC5E,MAAM,iBAAiB,SAAS;EAC9B,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,WAAW,cAAc,KAAK;CAChC,IAAI,EAAE,MAAM,EAAE;CACd,MAAM,wBAAwB,SAAS,KAAK,IAAI,EAAE,WAAW,OAAO;CACpE,MAAM,yBAAyB,UAAU,qBAAqB,oBAAoB,IAAI;EAAE,QAAQ;EAAmB,WAAW;CAAkB,IAAI;CACpJ,MAAM,kBAAkB;EACtB;EACA,GAAG,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;EACxC;CACF;CACA,MAAM,gBAAgB,gBAAgB;CACtC,MAAM,EAAE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WAAW,CAAC;EACd;EACA;EACA,GAAG;EACH,GAAG;EACH,OAAO;EACP,UAAU;CACZ,CACF;AACF,GACA;CACE,cAAc;CACd,aAAa;AACf,CACF"}
@@ -42,7 +42,7 @@ var import_useSheetScrollViewGestures = require("./useSheetScrollViewGestures.na
42
42
  var import_webViewport = require("./webViewport.native.js");
43
43
  var SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
44
44
  var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {
45
- var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;
45
+ var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;
46
46
  var context = (0, import_SheetContext.useSheetContext)(scope);
47
47
  var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();
48
48
  var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -67,6 +67,11 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
67
67
  height: frozenFrameHeight,
68
68
  maxHeight: frozenFrameHeight
69
69
  } : null;
70
+ var scrollViewStyle = [
71
+ fitSizingStyle,
72
+ ...Array.isArray(style) ? style : [style],
73
+ keyboardFrozenOverride
74
+ ];
70
75
  var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;
71
76
  var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();
72
77
  var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;
@@ -244,7 +249,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
244
249
  var RNGHComponent = RNGHScrollView;
245
250
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {
246
251
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
247
- style: fitSizingStyle,
252
+ style: scrollViewStyle,
248
253
  scrollEventThrottle: 1,
249
254
  scrollEnabled,
250
255
  simultaneousHandlers: [panGestureRef],
@@ -291,7 +296,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
291
296
  keyboardShouldPersistTaps: "always",
292
297
  keyboardDismissMode: "none",
293
298
  ...props,
294
- ...keyboardFrozenOverride,
295
299
  children: contentWrapper
296
300
  });
297
301
  }
@@ -301,7 +305,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
301
305
  updateScrollable();
302
306
  },
303
307
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
304
- ...fitSizingStyle,
305
308
  scrollEventThrottle: 1,
306
309
  className: "_ovs-contain",
307
310
  scrollEnabled,
@@ -316,7 +319,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
316
319
  contentContainerStyle,
317
320
  ...gestureProps,
318
321
  ...props,
319
- ...keyboardFrozenOverride,
322
+ style: scrollViewStyle,
320
323
  children: contentWrapper
321
324
  });
322
325
  }, {
@@ -42,7 +42,7 @@ var import_useSheetScrollViewGestures = require("./useSheetScrollViewGestures.na
42
42
  var import_webViewport = require("./webViewport.native.js");
43
43
  var SHEET_SCROLL_VIEW_NAME = "SheetScrollView";
44
44
  var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {
45
- var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;
45
+ var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;
46
46
  var context = (0, import_SheetContext.useSheetContext)(scope);
47
47
  var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();
48
48
  var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
@@ -67,6 +67,11 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
67
67
  height: frozenFrameHeight,
68
68
  maxHeight: frozenFrameHeight
69
69
  } : null;
70
+ var scrollViewStyle = [
71
+ fitSizingStyle,
72
+ ...Array.isArray(style) ? style : [style],
73
+ keyboardFrozenOverride
74
+ ];
70
75
  var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;
71
76
  var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();
72
77
  var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;
@@ -244,7 +249,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
244
249
  var RNGHComponent = RNGHScrollView;
245
250
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {
246
251
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
247
- style: fitSizingStyle,
252
+ style: scrollViewStyle,
248
253
  scrollEventThrottle: 1,
249
254
  scrollEnabled,
250
255
  simultaneousHandlers: [panGestureRef],
@@ -291,7 +296,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
291
296
  keyboardShouldPersistTaps: "always",
292
297
  keyboardDismissMode: "none",
293
298
  ...props,
294
- ...keyboardFrozenOverride,
295
299
  children: contentWrapper
296
300
  });
297
301
  }
@@ -301,7 +305,6 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
301
305
  updateScrollable();
302
306
  },
303
307
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
304
- ...fitSizingStyle,
305
308
  scrollEventThrottle: 1,
306
309
  className: "_ovs-contain",
307
310
  scrollEnabled,
@@ -316,7 +319,7 @@ var SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.Scroll
316
319
  contentContainerStyle,
317
320
  ...gestureProps,
318
321
  ...props,
319
- ...keyboardFrozenOverride,
322
+ style: scrollViewStyle,
320
323
  children: contentWrapper
321
324
  });
322
325
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"SheetScrollView.native.js","names":[],"sources":["jsx/SheetScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar SheetScrollView_exports = {};\n__export(SheetScrollView_exports, {\n SheetScrollView: () => SheetScrollView\n});\nmodule.exports = __toCommonJS(SheetScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_core = require(\"@tamagui/core\");\nvar import_scroll_view = require(\"@tamagui/scroll-view\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_GestureSheetContext = require(\"./GestureSheetContext\");\nvar import_gestureState = require(\"./gestureState\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_useSheetScrollViewGestures = require(\"./useSheetScrollViewGestures\");\nvar import_webViewport = require(\"./webViewport\");\nvar SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nvar SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();\n var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n var isKeyboardVisible = context.isKeyboardVisible === true || import_core.isWeb && (0, import_webViewport.getWebKeyboardResizeHeight)() >= import_webViewport.MIN_KEYBOARD_HEIGHT;\n var [scrollEnabled] = (0, import_use_controllable_state.useControllableState)({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n var scrollRef = import_react.default.useRef(null);\n var [hasScrollableContent, setHasScrollableContent] = (0, import_react.useState)(true);\n var parentHeight = (0, import_react.useRef)(0);\n var contentHeight = (0, import_react.useRef)(0);\n var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n var fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : {\n flex: 1\n };\n var contentContainerStyle = hasFit ? void 0 : {\n minHeight: \"100%\"\n };\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;\n var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();\n var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;\n var currentScrollOffset = (0, import_react.useRef)(0);\n var lastEmittedScrollOffset = (0, import_react.useRef)(0);\n var lockedScrollY = (0, import_react.useRef)(0);\n var focusedInputScrollFrame = (0, import_react.useRef)(0);\n var setScrollEnabled = function(next, lockTo) {\n if (!next) {\n var _ref;\n var lockY = (_ref = lockTo !== null && lockTo !== void 0 ? lockTo : scrollBridge.scrollLockY) !== null && _ref !== void 0 ? _ref : currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: lockY,\n animated: false\n });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n var forceScrollTo = function(y) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y,\n animated: false\n });\n currentScrollOffset.current = y;\n };\n var emitManualScroll = import_react.default.useCallback(function(node, y) {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n }, [\n onScroll,\n scrollBridge\n ]);\n var scrollFocusedInputClearOfKeyboard = import_react.default.useCallback(function() {\n var _scrollRef_current;\n if (!import_core.isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n var node = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.getScrollableNode();\n var active = document.activeElement;\n if (!node || !active || !(0, import_webViewport.isEditableElement)(active) || !node.contains(active)) {\n return;\n }\n var keyboardHeight = Math.max(keyboardOccludedHeight, (0, import_webViewport.getWebKeyboardBottomInset)());\n if (keyboardHeight <= 0) return;\n var activeRect = active.getBoundingClientRect();\n var nodeRect = node.getBoundingClientRect();\n var margin = 12;\n var keyboardTop = (0, import_webViewport.getStableLayoutViewportHeight)() - keyboardHeight;\n var visibleTop = nodeRect.top + margin;\n var visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n var nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n var maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [\n hasFit,\n isKeyboardVisible,\n keyboardOccludedHeight,\n scrollBridge\n ]);\n var scheduleFocusedInputScroll = import_react.default.useCallback(function() {\n if (!import_core.isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(function() {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(scrollFocusedInputClearOfKeyboard);\n });\n }, [\n hasFit,\n scrollFocusedInputClearOfKeyboard\n ]);\n (0, import_react.useEffect)(function() {\n var _window_visualViewport;\n if (!import_core.isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return function() {\n var _window_visualViewport2;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport2 = window.visualViewport) === null || _window_visualViewport2 === void 0 ? void 0 : _window_visualViewport2.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [\n hasFit,\n scheduleFocusedInputScroll\n ]);\n (0, import_react.useEffect)(function() {\n setHasScrollView(true);\n if ((0, import_gestureState.isGestureHandlerEnabled)()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return function() {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n var updateScrollable = function() {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n var recordFitHeight = function(height) {\n parentHeight.current = height;\n };\n (0, import_react.useEffect)(function() {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [\n hasScrollableContent\n ]);\n var gestureProps = (0, import_useSheetScrollViewGestures.useSheetScrollViewGestures)({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n var contentWrapper = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.View, {\n onLayout: function(e) {\n var height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n })\n ]\n });\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n var RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n style: fitSizingStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [\n panGestureRef\n ],\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.ScrollView, {\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n ...fitSizingStyle,\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n ...keyboardFrozenOverride,\n children: contentWrapper\n });\n}, {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n});\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC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a,IAAI,aAAa;KAC9B,IAAI,wBAAwB,YAAY,aAAa,aAAa;MAChE,wBAAwB,UAAU,aAAa;MAC/C,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS;OAC3D,GAAG;OACH,aAAa;QACX,GAAG,EAAE;QACL,eAAe;SACb,GAAG,EAAE,YAAY;SACjB,GAAG,aAAa;QAClB;OACF;MACF,CAAC;KACH;KACA;IACF;IACA,aAAa,IAAI;IACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;IACxC,wBAAwB,UAAU;IAClC,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,CAAC;GAChE;GACA;GACA,SAAS;GACT,2BAA2B;GAC3B,qBAAqB;GACrB,GAAG;GACH,GAAG;GACH,UAAU;EACZ,CAAC;CACH;CACA,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,mBAAmB,YAAY;EAChF,UAAU,SAAS,GAAG;GACpB,gBAAgB,KAAK,KAAK,EAAE,YAAY,OAAO,MAAM,CAAC;GACtD,iBAAiB;EACnB;EACA,MAAM,GAAG,oBAAoB,YAAW,CAAE,WAAW,GAAG;EACxD,GAAG;EACH,qBAAqB;EACrB,WAAW;EACX;EACA,UAAU,SAAS,GAAG;GACpB,IAAI,EAAE,MAAM,EAAE,YAAY;GAC1B,oBAAoB,UAAU;GAC9B,aAAa,IAAI;GACjB,IAAI,IAAI,GAAG,aAAa,eAAe,CAAC;GACxC,wBAAwB,UAAU;GAClC,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,CAAC;EAChE;EACA;EACA,GAAG;EACH,GAAG;EACH,GAAG;EACH,UAAU;CACZ,CAAC;AACH,GAAG;CACD,cAAc;CACd,aAAa;AACf,CAAC"}
1
+ {"version":3,"file":"SheetScrollView.native.js","names":[],"sources":["jsx/SheetScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar SheetScrollView_exports = {};\n__export(SheetScrollView_exports, {\n SheetScrollView: () => SheetScrollView\n});\nmodule.exports = __toCommonJS(SheetScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_core = require(\"@tamagui/core\");\nvar import_scroll_view = require(\"@tamagui/scroll-view\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_GestureSheetContext = require(\"./GestureSheetContext\");\nvar import_gestureState = require(\"./gestureState\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_useSheetScrollViewGestures = require(\"./useSheetScrollViewGestures\");\nvar import_webViewport = require(\"./webViewport\");\nvar SHEET_SCROLL_VIEW_NAME = \"SheetScrollView\";\nvar SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n var gestureContext = (0, import_GestureSheetContext.useGestureSheetContext)();\n var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;\n var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);\n var isKeyboardVisible = context.isKeyboardVisible === true || import_core.isWeb && (0, import_webViewport.getWebKeyboardResizeHeight)() >= import_webViewport.MIN_KEYBOARD_HEIGHT;\n var [scrollEnabled] = (0, import_use_controllable_state.useControllableState)({\n prop: scrollEnabledProp,\n defaultProp: true\n });\n var scrollRef = import_react.default.useRef(null);\n var [hasScrollableContent, setHasScrollableContent] = (0, import_react.useState)(true);\n var parentHeight = (0, import_react.useRef)(0);\n var contentHeight = (0, import_react.useRef)(0);\n var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);\n var fitSizingStyle = hasFit ? {\n flex: void 0,\n height: void 0,\n maxHeight: screenSize || void 0\n } : {\n flex: 1\n };\n var contentContainerStyle = hasFit ? void 0 : {\n minHeight: \"100%\"\n };\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var scrollViewStyle = [\n fitSizingStyle,\n ...Array.isArray(style) ? style : [\n style\n ],\n keyboardFrozenOverride\n ];\n var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;\n var { ScrollView: RNGHScrollView } = (0, import_gestureState.getGestureHandlerState)();\n var useRNGHScrollView = (0, import_gestureState.isGestureHandlerEnabled)() && RNGHScrollView && panGestureRef;\n var currentScrollOffset = (0, import_react.useRef)(0);\n var lastEmittedScrollOffset = (0, import_react.useRef)(0);\n var lockedScrollY = (0, import_react.useRef)(0);\n var focusedInputScrollFrame = (0, import_react.useRef)(0);\n var setScrollEnabled = function(next, lockTo) {\n if (!next) {\n var _ref;\n var lockY = (_ref = lockTo !== null && lockTo !== void 0 ? lockTo : scrollBridge.scrollLockY) !== null && _ref !== void 0 ? _ref : currentScrollOffset.current;\n if (scrollBridge.enabled === false && scrollBridge.scrollLockY === lockY) {\n return;\n }\n scrollBridge.enabled = false;\n lockedScrollY.current = lockY;\n scrollBridge.scrollLockY = lockY;\n if (currentScrollOffset.current !== lockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: lockY,\n animated: false\n });\n currentScrollOffset.current = lockY;\n }\n } else {\n if (scrollBridge.enabled === true && scrollBridge.scrollLockY === void 0) {\n return;\n }\n scrollBridge.enabled = true;\n lockedScrollY.current = currentScrollOffset.current;\n scrollBridge.scrollLockY = void 0;\n }\n };\n var forceScrollTo = function(y) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y,\n animated: false\n });\n currentScrollOffset.current = y;\n };\n var emitManualScroll = import_react.default.useCallback(function(node, y) {\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n nativeEvent: {\n contentOffset: {\n x: node.scrollLeft,\n y\n },\n contentSize: {\n height: node.scrollHeight,\n width: node.scrollWidth\n },\n layoutMeasurement: {\n height: node.offsetHeight,\n width: node.offsetWidth\n }\n },\n timeStamp: Date.now()\n });\n }, [\n onScroll,\n scrollBridge\n ]);\n var scrollFocusedInputClearOfKeyboard = import_react.default.useCallback(function() {\n var _scrollRef_current;\n if (!import_core.isWeb || !hasFit || !isKeyboardVisible || keyboardOccludedHeight <= 0) {\n return;\n }\n var node = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.getScrollableNode();\n var active = document.activeElement;\n if (!node || !active || !(0, import_webViewport.isEditableElement)(active) || !node.contains(active)) {\n return;\n }\n var keyboardHeight = Math.max(keyboardOccludedHeight, (0, import_webViewport.getWebKeyboardBottomInset)());\n if (keyboardHeight <= 0) return;\n var activeRect = active.getBoundingClientRect();\n var nodeRect = node.getBoundingClientRect();\n var margin = 12;\n var keyboardTop = (0, import_webViewport.getStableLayoutViewportHeight)() - keyboardHeight;\n var visibleTop = nodeRect.top + margin;\n var visibleBottom = Math.min(nodeRect.bottom, keyboardTop) - margin;\n var nextScrollTop = node.scrollTop;\n if (activeRect.bottom > visibleBottom) {\n nextScrollTop += Math.ceil(activeRect.bottom - visibleBottom);\n } else if (activeRect.top < visibleTop) {\n nextScrollTop -= Math.ceil(visibleTop - activeRect.top);\n }\n var maxScrollTop = Math.max(0, node.scrollHeight - node.clientHeight);\n nextScrollTop = Math.max(0, Math.min(maxScrollTop, nextScrollTop));\n if (nextScrollTop === node.scrollTop) return;\n node.scrollTop = nextScrollTop;\n currentScrollOffset.current = nextScrollTop;\n scrollBridge.y = nextScrollTop;\n if (nextScrollTop > 0) scrollBridge.scrollStartY = -1;\n }, [\n hasFit,\n isKeyboardVisible,\n keyboardOccludedHeight,\n scrollBridge\n ]);\n var scheduleFocusedInputScroll = import_react.default.useCallback(function() {\n if (!import_core.isWeb || !hasFit) return;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n focusedInputScrollFrame.current = requestAnimationFrame(function() {\n scrollFocusedInputClearOfKeyboard();\n focusedInputScrollFrame.current = requestAnimationFrame(scrollFocusedInputClearOfKeyboard);\n });\n }, [\n hasFit,\n scrollFocusedInputClearOfKeyboard\n ]);\n (0, import_react.useEffect)(function() {\n var _window_visualViewport;\n if (!import_core.isWeb || !hasFit) return;\n scheduleFocusedInputScroll();\n window.addEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.addEventListener(\"resize\", scheduleFocusedInputScroll);\n return function() {\n var _window_visualViewport2;\n cancelAnimationFrame(focusedInputScrollFrame.current);\n window.removeEventListener(\"focusin\", scheduleFocusedInputScroll);\n (_window_visualViewport2 = window.visualViewport) === null || _window_visualViewport2 === void 0 ? void 0 : _window_visualViewport2.removeEventListener(\"resize\", scheduleFocusedInputScroll);\n };\n }, [\n hasFit,\n scheduleFocusedInputScroll\n ]);\n (0, import_react.useEffect)(function() {\n setHasScrollView(true);\n if ((0, import_gestureState.isGestureHandlerEnabled)()) {\n scrollBridge.setScrollEnabled = setScrollEnabled;\n scrollBridge.forceScrollTo = forceScrollTo;\n }\n return function() {\n setHasScrollView(false);\n scrollBridge.setScrollEnabled = void 0;\n scrollBridge.forceScrollTo = void 0;\n };\n }, []);\n var updateScrollable = function() {\n if (parentHeight.current && contentHeight.current) {\n setHasScrollableContent(contentHeight.current > parentHeight.current);\n }\n };\n var recordFitHeight = function(height) {\n parentHeight.current = height;\n };\n (0, import_react.useEffect)(function() {\n scrollBridge.hasScrollableContent = hasScrollableContent;\n }, [\n hasScrollableContent\n ]);\n var gestureProps = (0, import_useSheetScrollViewGestures.useSheetScrollViewGestures)({\n scrollRef,\n scrollBridge,\n hasScrollableContent,\n scrollEnabled,\n setScrollEnabled,\n onManualScroll: emitManualScroll\n });\n var contentWrapper = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.View, {\n onLayout: function(e) {\n var height = Math.floor(e.nativeEvent.layout.height);\n if (height !== contentHeight.current) {\n contentHeight.current = height;\n updateScrollable();\n if (keyboardOccludedHeight > 0) {\n scheduleFocusedInputScroll();\n }\n }\n },\n children: [\n children,\n keyboardOccludedHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n \"data-sheet-keyboard-scroll-pad\": true,\n height: keyboardOccludedHeight,\n width: \"100%\"\n })\n ]\n });\n if (useRNGHScrollView && RNGHScrollView && panGestureRef) {\n var RNGHComponent = RNGHScrollView;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RNGHComponent, {\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n style: scrollViewStyle,\n scrollEventThrottle: 1,\n scrollEnabled,\n simultaneousHandlers: [\n panGestureRef\n ],\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n if (scrollBridge.scrollLockY !== void 0) {\n if (y !== scrollBridge.scrollLockY) {\n var _scrollRef_current_scrollTo, _scrollRef_current;\n (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : (_scrollRef_current_scrollTo = _scrollRef_current.scrollTo) === null || _scrollRef_current_scrollTo === void 0 ? void 0 : _scrollRef_current_scrollTo.call(_scrollRef_current, {\n x: 0,\n y: scrollBridge.scrollLockY,\n animated: false\n });\n }\n currentScrollOffset.current = scrollBridge.scrollLockY;\n scrollBridge.y = scrollBridge.scrollLockY;\n if (lastEmittedScrollOffset.current !== scrollBridge.scrollLockY) {\n lastEmittedScrollOffset.current = scrollBridge.scrollLockY;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll({\n ...e,\n nativeEvent: {\n ...e.nativeEvent,\n contentOffset: {\n ...e.nativeEvent.contentOffset,\n y: scrollBridge.scrollLockY\n }\n }\n });\n }\n return;\n }\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n bounces: false,\n keyboardShouldPersistTaps: \"always\",\n keyboardDismissMode: \"none\",\n ...props,\n children: contentWrapper\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.ScrollView, {\n onLayout: function(e) {\n recordFitHeight(Math.ceil(e.nativeEvent.layout.height));\n updateScrollable();\n },\n ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),\n scrollEventThrottle: 1,\n className: \"_ovs-contain\",\n scrollEnabled,\n onScroll: function(e) {\n var { y } = e.nativeEvent.contentOffset;\n currentScrollOffset.current = y;\n scrollBridge.y = y;\n if (y > 0) scrollBridge.scrollStartY = -1;\n lastEmittedScrollOffset.current = y;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n },\n contentContainerStyle,\n ...gestureProps,\n ...props,\n style: scrollViewStyle,\n children: contentWrapper\n });\n}, {\n disableTheme: true,\n displayName: SHEET_SCROLL_VIEW_NAME\n});\n//# sourceMappingURL=SheetScrollView.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,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ANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/sheet",
3
- "version": "3.0.0-beta.755.1",
3
+ "version": "3.0.0-beta.804.1",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "type": "module",
@@ -43,25 +43,25 @@
43
43
  "clean": "tamagui-build clean"
44
44
  },
45
45
  "dependencies": {
46
- "@tamagui/adapt": "3.0.0-beta.755.1",
47
- "@tamagui/animate-presence": "3.0.0-beta.755.1",
48
- "@tamagui/animations-react-native": "3.0.0-beta.755.1",
49
- "@tamagui/compose-refs": "3.0.0-beta.755.1",
50
- "@tamagui/constants": "3.0.0-beta.755.1",
51
- "@tamagui/core": "3.0.0-beta.755.1",
52
- "@tamagui/helpers": "3.0.0-beta.755.1",
53
- "@tamagui/native": "3.0.0-beta.755.1",
54
- "@tamagui/portal": "3.0.0-beta.755.1",
55
- "@tamagui/remove-scroll": "3.0.0-beta.755.1",
56
- "@tamagui/scroll-view": "3.0.0-beta.755.1",
57
- "@tamagui/stacks": "3.0.0-beta.755.1",
58
- "@tamagui/use-constant": "3.0.0-beta.755.1",
59
- "@tamagui/use-controllable-state": "3.0.0-beta.755.1",
60
- "@tamagui/use-did-finish-ssr": "3.0.0-beta.755.1",
61
- "@tamagui/z-index-stack": "3.0.0-beta.755.1"
46
+ "@tamagui/adapt": "3.0.0-beta.804.1",
47
+ "@tamagui/animate-presence": "3.0.0-beta.804.1",
48
+ "@tamagui/animations-react-native": "3.0.0-beta.804.1",
49
+ "@tamagui/compose-refs": "3.0.0-beta.804.1",
50
+ "@tamagui/constants": "3.0.0-beta.804.1",
51
+ "@tamagui/core": "3.0.0-beta.804.1",
52
+ "@tamagui/helpers": "3.0.0-beta.804.1",
53
+ "@tamagui/native": "3.0.0-beta.804.1",
54
+ "@tamagui/portal": "3.0.0-beta.804.1",
55
+ "@tamagui/remove-scroll": "3.0.0-beta.804.1",
56
+ "@tamagui/scroll-view": "3.0.0-beta.804.1",
57
+ "@tamagui/stacks": "3.0.0-beta.804.1",
58
+ "@tamagui/use-constant": "3.0.0-beta.804.1",
59
+ "@tamagui/use-controllable-state": "3.0.0-beta.804.1",
60
+ "@tamagui/use-did-finish-ssr": "3.0.0-beta.804.1",
61
+ "@tamagui/z-index-stack": "3.0.0-beta.804.1"
62
62
  },
63
63
  "devDependencies": {
64
- "@tamagui/build": "3.0.0-beta.755.1",
64
+ "@tamagui/build": "3.0.0-beta.804.1",
65
65
  "react": "19.2.3",
66
66
  "react-native": "0.86.2",
67
67
  "react-native-gesture-handler": "~2.32.0",
@@ -37,6 +37,7 @@ export const SheetScrollView = createStyledHOC(
37
37
  children,
38
38
  onScroll,
39
39
  scrollEnabled: scrollEnabledProp,
40
+ style,
40
41
  ...props
41
42
  }: SheetScrollViewProps,
42
43
  ref
@@ -86,11 +87,16 @@ export const SheetScrollView = createStyledHOC(
86
87
  // that maxHeight is often tied to useWindowDimensions, which SHRINKS when the
87
88
  // keyboard opens and would otherwise collapse the sheet. holding the height
88
89
  // constant means the web frame can translate without resizing. applied
89
- // AFTER {...props} so it wins.
90
+ // last in the ordered style array so it wins.
90
91
  const keyboardFrozenOverride =
91
92
  hasFit && isKeyboardVisible && frozenFrameHeight > 0
92
93
  ? { height: frozenFrameHeight, maxHeight: frozenFrameHeight }
93
94
  : null
95
+ const scrollViewStyle = [
96
+ fitSizingStyle,
97
+ ...(Array.isArray(style) ? style : [style]),
98
+ keyboardFrozenOverride,
99
+ ]
94
100
 
95
101
  const panGestureRef = gestureContext?.panGestureRef
96
102
  const { ScrollView: RNGHScrollView } = getGestureHandlerState()
@@ -288,7 +294,7 @@ export const SheetScrollView = createStyledHOC(
288
294
  return (
289
295
  <RNGHComponent
290
296
  ref={composeRefs(scrollRef as any, ref)}
291
- style={fitSizingStyle}
297
+ style={scrollViewStyle}
292
298
  scrollEventThrottle={1}
293
299
  scrollEnabled={scrollEnabled}
294
300
  simultaneousHandlers={[panGestureRef]}
@@ -336,7 +342,6 @@ export const SheetScrollView = createStyledHOC(
336
342
  keyboardShouldPersistTaps="always"
337
343
  keyboardDismissMode="none"
338
344
  {...props}
339
- {...keyboardFrozenOverride}
340
345
  >
341
346
  {contentWrapper}
342
347
  </RNGHComponent>
@@ -351,7 +356,6 @@ export const SheetScrollView = createStyledHOC(
351
356
  updateScrollable()
352
357
  }}
353
358
  ref={composeRefs(scrollRef as any, ref)}
354
- {...fitSizingStyle}
355
359
  scrollEventThrottle={1}
356
360
  className="_ovs-contain"
357
361
  scrollEnabled={scrollEnabled}
@@ -366,7 +370,7 @@ export const SheetScrollView = createStyledHOC(
366
370
  contentContainerStyle={contentContainerStyle}
367
371
  {...gestureProps}
368
372
  {...props}
369
- {...keyboardFrozenOverride}
373
+ style={scrollViewStyle}
370
374
  >
371
375
  {contentWrapper}
372
376
  </ScrollView>
@@ -1 +1 @@
1
- {"version":3,"file":"SheetScrollView.d.ts","sourceRoot":"","sources":["../src/SheetScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,KAAsC,MAAM,OAAO,CAAA;AAgB1D,KAAK,wBAAwB,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAU3D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;QANpB,wBAAwB,CAAC,QAAQ,CAAC;QAClC,wBAAwB,CAAC,SAAS,CAAC;UACjC,wBAAwB,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+V7C,CAAA"}
1
+ {"version":3,"file":"SheetScrollView.d.ts","sourceRoot":"","sources":["../src/SheetScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,KAAsC,MAAM,OAAO,CAAA;AAgB1D,KAAK,wBAAwB,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAU3D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;QANpB,wBAAwB,CAAC,QAAQ,CAAC;QAClC,wBAAwB,CAAC,SAAS,CAAC;UACjC,wBAAwB,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmW7C,CAAA"}