@tamagui/sheet 3.0.0-beta.922.1 → 3.0.0

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.
Files changed (190) hide show
  1. package/dist/cjs/Sheet.cjs +48 -16
  2. package/dist/cjs/Sheet.native.cjs +46 -17
  3. package/dist/cjs/Sheet.native.js +46 -17
  4. package/dist/cjs/Sheet.native.js.map +1 -1
  5. package/dist/cjs/SheetDragSurface.cjs +50 -0
  6. package/dist/{jsx/GestureDetectorWrapper.native.js → cjs/SheetDragSurface.native.cjs} +24 -12
  7. package/dist/cjs/{GestureDetectorWrapper.native.js → SheetDragSurface.native.js} +25 -11
  8. package/dist/cjs/SheetDragSurface.native.js.map +1 -0
  9. package/dist/cjs/SheetImplementationCustom.cjs +41 -58
  10. package/dist/cjs/SheetImplementationCustom.native.cjs +43 -59
  11. package/dist/cjs/SheetImplementationCustom.native.js +43 -59
  12. package/dist/cjs/SheetImplementationCustom.native.js.map +1 -1
  13. package/dist/cjs/SheetScrollView.cjs +15 -3
  14. package/dist/cjs/SheetScrollView.native.cjs +17 -4
  15. package/dist/cjs/SheetScrollView.native.js +17 -4
  16. package/dist/cjs/SheetScrollView.native.js.map +1 -1
  17. package/dist/cjs/nativeSheet.cjs +3 -59
  18. package/dist/cjs/nativeSheet.native.cjs +70 -58
  19. package/dist/cjs/nativeSheet.native.js +70 -58
  20. package/dist/cjs/nativeSheet.native.js.map +1 -1
  21. package/dist/cjs/stableViewportHeight.cjs +27 -0
  22. package/dist/cjs/stableViewportHeight.native.cjs +29 -0
  23. package/dist/cjs/stableViewportHeight.native.js +31 -0
  24. package/dist/cjs/stableViewportHeight.native.js.map +1 -0
  25. package/dist/cjs/useSheetOffscreenSize.cjs +3 -1
  26. package/dist/cjs/useSheetOffscreenSize.native.cjs +3 -2
  27. package/dist/cjs/useSheetOffscreenSize.native.js +3 -2
  28. package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -1
  29. package/dist/cjs/useSheetOpenState.cjs +13 -6
  30. package/dist/cjs/useSheetOpenState.native.cjs +15 -5
  31. package/dist/cjs/useSheetOpenState.native.js +15 -5
  32. package/dist/cjs/useSheetOpenState.native.js.map +1 -1
  33. package/dist/cjs/useSheetProviderProps.cjs +5 -94
  34. package/dist/cjs/useSheetProviderProps.native.cjs +5 -103
  35. package/dist/cjs/useSheetProviderProps.native.js +5 -103
  36. package/dist/cjs/useSheetProviderProps.native.js.map +1 -1
  37. package/dist/cjs/useSheetState.cjs +120 -0
  38. package/dist/cjs/useSheetState.native.cjs +131 -0
  39. package/dist/cjs/useSheetState.native.js +133 -0
  40. package/dist/cjs/useSheetState.native.js.map +1 -0
  41. package/dist/esm/Sheet.mjs +48 -15
  42. package/dist/esm/Sheet.mjs.map +1 -1
  43. package/dist/esm/Sheet.native.js +46 -17
  44. package/dist/esm/Sheet.native.js.map +1 -1
  45. package/dist/esm/SheetDragSurface.mjs +25 -0
  46. package/dist/esm/SheetDragSurface.mjs.map +1 -0
  47. package/dist/esm/SheetDragSurface.native.js +34 -0
  48. package/dist/esm/SheetDragSurface.native.js.map +1 -0
  49. package/dist/esm/SheetImplementationCustom.mjs +39 -56
  50. package/dist/esm/SheetImplementationCustom.mjs.map +1 -1
  51. package/dist/esm/SheetImplementationCustom.native.js +41 -57
  52. package/dist/esm/SheetImplementationCustom.native.js.map +1 -1
  53. package/dist/esm/SheetScrollView.mjs +16 -4
  54. package/dist/esm/SheetScrollView.mjs.map +1 -1
  55. package/dist/esm/SheetScrollView.native.js +18 -5
  56. package/dist/esm/SheetScrollView.native.js.map +1 -1
  57. package/dist/esm/nativeSheet.mjs +3 -60
  58. package/dist/esm/nativeSheet.mjs.map +1 -1
  59. package/dist/esm/nativeSheet.native.js +70 -58
  60. package/dist/esm/nativeSheet.native.js.map +1 -1
  61. package/dist/esm/stableViewportHeight.mjs +8 -0
  62. package/dist/esm/stableViewportHeight.mjs.map +1 -0
  63. package/dist/esm/stableViewportHeight.native.js +8 -0
  64. package/dist/esm/stableViewportHeight.native.js.map +1 -0
  65. package/dist/esm/useKeyboardControllerSheet.native.js +0 -5
  66. package/dist/esm/useSheetOffscreenSize.mjs +3 -1
  67. package/dist/esm/useSheetOffscreenSize.mjs.map +1 -1
  68. package/dist/esm/useSheetOffscreenSize.native.js +3 -2
  69. package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
  70. package/dist/esm/useSheetOpenState.mjs +14 -7
  71. package/dist/esm/useSheetOpenState.mjs.map +1 -1
  72. package/dist/esm/useSheetOpenState.native.js +16 -6
  73. package/dist/esm/useSheetOpenState.native.js.map +1 -1
  74. package/dist/esm/useSheetProviderProps.mjs +5 -88
  75. package/dist/esm/useSheetProviderProps.mjs.map +1 -1
  76. package/dist/esm/useSheetProviderProps.native.js +5 -97
  77. package/dist/esm/useSheetProviderProps.native.js.map +1 -1
  78. package/dist/esm/useSheetState.mjs +95 -0
  79. package/dist/esm/useSheetState.mjs.map +1 -0
  80. package/dist/esm/useSheetState.native.js +104 -0
  81. package/dist/esm/useSheetState.native.js.map +1 -0
  82. package/dist/jsx/Sheet.mjs +48 -15
  83. package/dist/jsx/Sheet.mjs.map +1 -1
  84. package/dist/jsx/Sheet.native.cjs +46 -17
  85. package/dist/jsx/Sheet.native.js +46 -17
  86. package/dist/jsx/Sheet.native.js.map +1 -1
  87. package/dist/jsx/SheetDragSurface.mjs +25 -0
  88. package/dist/jsx/SheetDragSurface.mjs.map +1 -0
  89. package/dist/{cjs/GestureDetectorWrapper.native.cjs → jsx/SheetDragSurface.native.cjs} +24 -10
  90. package/dist/jsx/{GestureDetectorWrapper.native.cjs → SheetDragSurface.native.js} +26 -10
  91. package/dist/jsx/SheetDragSurface.native.js.map +1 -0
  92. package/dist/jsx/SheetImplementationCustom.mjs +39 -56
  93. package/dist/jsx/SheetImplementationCustom.mjs.map +1 -1
  94. package/dist/jsx/SheetImplementationCustom.native.cjs +43 -59
  95. package/dist/jsx/SheetImplementationCustom.native.js +43 -59
  96. package/dist/jsx/SheetImplementationCustom.native.js.map +1 -1
  97. package/dist/jsx/SheetScrollView.mjs +16 -4
  98. package/dist/jsx/SheetScrollView.mjs.map +1 -1
  99. package/dist/jsx/SheetScrollView.native.cjs +17 -4
  100. package/dist/jsx/SheetScrollView.native.js +17 -4
  101. package/dist/jsx/SheetScrollView.native.js.map +1 -1
  102. package/dist/jsx/nativeSheet.mjs +3 -60
  103. package/dist/jsx/nativeSheet.mjs.map +1 -1
  104. package/dist/jsx/nativeSheet.native.cjs +70 -58
  105. package/dist/jsx/nativeSheet.native.js +70 -58
  106. package/dist/jsx/nativeSheet.native.js.map +1 -1
  107. package/dist/jsx/stableViewportHeight.mjs +8 -0
  108. package/dist/jsx/stableViewportHeight.mjs.map +1 -0
  109. package/dist/jsx/stableViewportHeight.native.cjs +29 -0
  110. package/dist/jsx/stableViewportHeight.native.js +31 -0
  111. package/dist/jsx/stableViewportHeight.native.js.map +1 -0
  112. package/dist/jsx/useSheetOffscreenSize.mjs +3 -1
  113. package/dist/jsx/useSheetOffscreenSize.mjs.map +1 -1
  114. package/dist/jsx/useSheetOffscreenSize.native.cjs +3 -2
  115. package/dist/jsx/useSheetOffscreenSize.native.js +3 -2
  116. package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
  117. package/dist/jsx/useSheetOpenState.mjs +14 -7
  118. package/dist/jsx/useSheetOpenState.mjs.map +1 -1
  119. package/dist/jsx/useSheetOpenState.native.cjs +15 -5
  120. package/dist/jsx/useSheetOpenState.native.js +15 -5
  121. package/dist/jsx/useSheetOpenState.native.js.map +1 -1
  122. package/dist/jsx/useSheetProviderProps.mjs +5 -88
  123. package/dist/jsx/useSheetProviderProps.mjs.map +1 -1
  124. package/dist/jsx/useSheetProviderProps.native.cjs +5 -103
  125. package/dist/jsx/useSheetProviderProps.native.js +5 -103
  126. package/dist/jsx/useSheetProviderProps.native.js.map +1 -1
  127. package/dist/jsx/useSheetState.mjs +95 -0
  128. package/dist/jsx/useSheetState.mjs.map +1 -0
  129. package/dist/jsx/useSheetState.native.cjs +131 -0
  130. package/dist/jsx/useSheetState.native.js +133 -0
  131. package/dist/jsx/useSheetState.native.js.map +1 -0
  132. package/package.json +27 -22
  133. package/src/Sheet.tsx +45 -18
  134. package/src/SheetDragSurface.native.tsx +42 -0
  135. package/src/SheetDragSurface.tsx +40 -0
  136. package/src/SheetImplementationCustom.tsx +67 -92
  137. package/src/SheetScrollView.tsx +26 -4
  138. package/src/nativeSheet.native.tsx +110 -0
  139. package/src/nativeSheet.ts +16 -0
  140. package/src/stableViewportHeight.native.ts +9 -0
  141. package/src/stableViewportHeight.ts +15 -0
  142. package/src/types.tsx +44 -1
  143. package/src/useSheetOffscreenSize.tsx +3 -7
  144. package/src/useSheetOpenState.tsx +18 -8
  145. package/src/useSheetProviderProps.tsx +18 -149
  146. package/src/useSheetScrollViewGestures.native.ts +4 -1
  147. package/src/useSheetState.tsx +139 -0
  148. package/types/Sheet.d.ts +71 -167
  149. package/types/Sheet.d.ts.map +1 -1
  150. package/types/SheetDragSurface.d.ts +11 -0
  151. package/types/SheetDragSurface.d.ts.map +1 -0
  152. package/types/SheetDragSurface.native.d.ts +11 -0
  153. package/types/SheetDragSurface.native.d.ts.map +1 -0
  154. package/types/SheetImplementationCustom.d.ts +1 -2
  155. package/types/SheetImplementationCustom.d.ts.map +1 -1
  156. package/types/SheetScrollView.d.ts +3 -3
  157. package/types/SheetScrollView.d.ts.map +1 -1
  158. package/types/nativeSheet.d.ts +8 -9
  159. package/types/nativeSheet.d.ts.map +1 -1
  160. package/types/nativeSheet.native.d.ts +4 -0
  161. package/types/nativeSheet.native.d.ts.map +1 -0
  162. package/types/stableViewportHeight.d.ts +12 -0
  163. package/types/stableViewportHeight.d.ts.map +1 -0
  164. package/types/stableViewportHeight.native.d.ts +6 -0
  165. package/types/stableViewportHeight.native.d.ts.map +1 -0
  166. package/types/types.d.ts +34 -1
  167. package/types/types.d.ts.map +1 -1
  168. package/types/useSheetOffscreenSize.d.ts +1 -1
  169. package/types/useSheetOffscreenSize.d.ts.map +1 -1
  170. package/types/useSheetOpenState.d.ts +3 -1
  171. package/types/useSheetOpenState.d.ts.map +1 -1
  172. package/types/useSheetProviderProps.d.ts +15 -13
  173. package/types/useSheetProviderProps.d.ts.map +1 -1
  174. package/types/useSheetScrollViewGestures.native.d.ts +1 -1
  175. package/types/useSheetScrollViewGestures.native.d.ts.map +1 -1
  176. package/types/useSheetState.d.ts +26 -0
  177. package/types/useSheetState.d.ts.map +1 -0
  178. package/dist/cjs/GestureDetectorWrapper.cjs +0 -44
  179. package/dist/cjs/GestureDetectorWrapper.native.js.map +0 -1
  180. package/dist/esm/GestureDetectorWrapper.mjs +0 -25
  181. package/dist/esm/GestureDetectorWrapper.mjs.map +0 -1
  182. package/dist/esm/GestureDetectorWrapper.native.js +0 -26
  183. package/dist/esm/GestureDetectorWrapper.native.js.map +0 -1
  184. package/dist/jsx/GestureDetectorWrapper.mjs +0 -25
  185. package/dist/jsx/GestureDetectorWrapper.mjs.map +0 -1
  186. package/dist/jsx/GestureDetectorWrapper.native.js.map +0 -1
  187. package/src/GestureDetectorWrapper.tsx +0 -38
  188. package/src/nativeSheet.tsx +0 -86
  189. package/types/GestureDetectorWrapper.d.ts +0 -14
  190. package/types/GestureDetectorWrapper.d.ts.map +0 -1
@@ -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 sheetContentStyle = (0, import_core.style)({\n minHeight: \"100%\"\n});\nvar SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style: _$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 fitSizingProps = 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 : sheetContentStyle;\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var scrollViewStyle = [\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: [\n fitSizingProps,\n ...scrollViewStyle\n ],\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 ...fitSizingProps,\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,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,O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C3C,aAAa,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,UAAU;EACZ,CAAC;CACH;CACA,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,mBAAmB,YAAY;EAChF,GAAG;EACH,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"}
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 sheetContentStyle = {\n minHeight: \"100%\"\n};\nvar SheetScrollViewCustom = (0, import_core.createRefComponent)(function(param, ref) {\n var { scope, children, onScroll, scrollEnabled: scrollEnabledProp, style, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n if (context.onlyShowContainer) throw new Error(\"Custom Sheet scrolling requires a custom Sheet\");\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 fitSizingProps = 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 : sheetContentStyle;\n var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {\n height: frozenFrameHeight,\n maxHeight: frozenFrameHeight\n } : null;\n var scrollViewStyle = [\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: [\n fitSizingProps,\n ...scrollViewStyle\n ],\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 ...fitSizingProps,\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});\nvar SheetScrollView = (0, import_core.createStyledHOC)(import_scroll_view.ScrollView, function(param, ref) {\n var { scope, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n return context.onlyShowContainer ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.ScrollView, {\n ...props,\n ref\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetScrollViewCustom, {\n ...props,\n scope,\n ref\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,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,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,CAAC;AACD,IAAI,mBAAmB,GAAG,YAAY,gBAAe,CAAE,mBAAmB,YAAY,SAAS,OAAO,KAAK;CACzG,IAAI,EAAE,OAAO,GAAG,UAAU;CAC1B,IAAI,WAAW,GAAG,oBAAoB,gBAAe,CAAE,KAAK;CAC5D,OAAO,QAAQ,oBAAoC,iBAAC,GAAG,mBAAmB,IAAG,CAAE,mBAAmB,YAAY;EAC5G,GAAG;EACH;CACF,CAAC,IAAoB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,uBAAuB;EACtE,GAAG;EACH;EACA;CACF,CAAC;AACH,GAAG;CACD,cAAc;CACd,aAAa;AACf,CAAC"}
@@ -24,63 +24,7 @@ __export(nativeSheet_exports, {
24
24
  setupNativeSheet: () => setupNativeSheet
25
25
  });
26
26
  module.exports = __toCommonJS(nativeSheet_exports);
27
- var import_stacks = require("@tamagui/stacks");
28
- var import_react = require("react");
29
- var import_react_native = require("react-native-web");
30
- var import_SheetContext = require("./SheetContext.cjs");
31
- var import_useSheetOpenState = require("./useSheetOpenState.cjs");
32
- var import_useSheetProviderProps = require("./useSheetProviderProps.cjs");
33
- var import_jsx_runtime = require("react/jsx-runtime");
34
- const nativeSheets = { ios: null };
35
- function getNativeSheet(platform) {
36
- return nativeSheets[platform];
27
+ function getNativeSheet(_platform) {
28
+ return null;
37
29
  }
38
- function setupNativeSheet(platform, RNIOSModal) {
39
- const { ModalSheetView, ModalSheetViewMainContent } = RNIOSModal;
40
- if (platform === "ios") {
41
- nativeSheets[platform] = (props) => {
42
- const state = (0, import_useSheetOpenState.useSheetOpenState)(props);
43
- const providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state);
44
- const { open, setOpen } = state;
45
- const ref = (0, import_react.useRef)(void 0);
46
- (0, import_react.useEffect)(() => {
47
- if (open) {
48
- ref.current?.presentModal();
49
- } else {
50
- ref.current?.dismissModal();
51
- }
52
- }, [open]);
53
- function setOpenInternal(next) {
54
- props.onOpenChange?.(open);
55
- setOpen(next);
56
- }
57
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetNativeSystemContext.Provider, {
58
- value: true,
59
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, {
60
- setHasScrollView: emptyFn,
61
- keyboardOccludedHeight: 0,
62
- isKeyboardVisible: false,
63
- keyboardStableFrameHeight: 0,
64
- ...providerProps,
65
- onlyShowContainer: true,
66
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetView, {
67
- ref,
68
- onModalDidDismiss: () => setOpenInternal(false),
69
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetViewMainContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
70
- style: { flex: 1 },
71
- children: props.children
72
- }) })
73
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {
74
- position: "absolute",
75
- display: "none",
76
- pointerEvents: "none",
77
- width: 0,
78
- height: 0,
79
- children: props.children
80
- })]
81
- })
82
- });
83
- };
84
- }
85
- }
86
- const emptyFn = () => {};
30
+ function setupNativeSheet(_platform, _Renderer) {}
@@ -20,74 +20,86 @@ var __copyProps = (to, from, except, desc) => {
20
20
  return to;
21
21
  };
22
22
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
- var nativeSheet_exports = {};
24
- __export(nativeSheet_exports, {
23
+ var nativeSheet_native_exports = {};
24
+ __export(nativeSheet_native_exports, {
25
25
  getNativeSheet: () => getNativeSheet,
26
26
  setupNativeSheet: () => setupNativeSheet
27
27
  });
28
- module.exports = __toCommonJS(nativeSheet_exports);
28
+ module.exports = __toCommonJS(nativeSheet_native_exports);
29
29
  var import_jsx_runtime = require("react/jsx-runtime");
30
- var import_stacks = require("@tamagui/stacks");
30
+ var import_core = require("@tamagui/core");
31
31
  var import_react = require("react");
32
32
  var import_react_native = require("react-native");
33
33
  var import_SheetContext = require("./SheetContext.native.js");
34
34
  var import_useSheetOpenState = require("./useSheetOpenState.native.js");
35
- var import_useSheetProviderProps = require("./useSheetProviderProps.native.js");
36
- var nativeSheets = { ios: null };
35
+ var import_useSheetState = require("./useSheetState.native.js");
36
+ var nativeSheets = {};
37
37
  function getNativeSheet(platform) {
38
- return nativeSheets[platform];
38
+ if (import_react_native.Platform.OS !== platform) return null;
39
+ var _nativeSheets_platform;
40
+ return (_nativeSheets_platform = nativeSheets[platform]) !== null && _nativeSheets_platform !== void 0 ? _nativeSheets_platform : null;
39
41
  }
40
- function setupNativeSheet(platform, RNIOSModal) {
41
- var { ModalSheetView, ModalSheetViewMainContent } = RNIOSModal;
42
- if (platform === "ios") {
43
- nativeSheets[platform] = function(props) {
44
- var state = (0, import_useSheetOpenState.useSheetOpenState)(props);
45
- var providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state);
46
- var { open, setOpen } = state;
47
- var ref = (0, import_react.useRef)(void 0);
48
- (0, import_react.useEffect)(function() {
49
- if (open) {
50
- var _ref_current;
51
- (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.presentModal();
52
- } else {
53
- var _ref_current1;
54
- (_ref_current1 = ref.current) === null || _ref_current1 === void 0 ? void 0 : _ref_current1.dismissModal();
42
+ function setupNativeSheet(platform, Renderer) {
43
+ nativeSheets[platform] = (0, import_core.createRefComponent)(function NativeSheet(props, ref) {
44
+ var state = (0, import_useSheetOpenState.useSheetOpenState)(props, "prop-wins");
45
+ var { maxContentSize, ...sheetState } = (0, import_useSheetState.useSheetState)(props, state);
46
+ var { open, setOpen } = state;
47
+ var openRef = (0, import_react.useRef)(open);
48
+ openRef.current = open;
49
+ var [dismissed, setDismissed] = (0, import_react.useState)(!open);
50
+ var [previousOpen, setPreviousOpen] = (0, import_react.useState)(open);
51
+ if (previousOpen !== open) {
52
+ setPreviousOpen(open);
53
+ if (open) setDismissed(false);
54
+ }
55
+ var { snapPoints, snapPointsMode } = sheetState;
56
+ var points = (0, import_react.useMemo)(function() {
57
+ var authored = props.dismissOnSnapToBottom ? snapPoints.slice(0, -1) : snapPoints;
58
+ return authored.map(function(point) {
59
+ if (point === "fit" && (snapPointsMode === "fit" || snapPointsMode === "mixed")) return { type: "fit" };
60
+ var percent = snapPointsMode === "percent" || snapPointsMode === "mixed" && typeof point === "string" && point.endsWith("%");
61
+ var value = percent && typeof point === "string" ? Number(point.slice(0, -1)) : point;
62
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || percent && value > 100) {
63
+ throw new Error(`Invalid native Sheet snap point: ${String(point)}`);
55
64
  }
56
- }, [open]);
57
- function setOpenInternal(next) {
58
- var _props_onOpenChange;
59
- (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, open);
60
- setOpen(next);
61
- }
62
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetNativeSystemContext.Provider, {
63
- value: true,
64
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, {
65
- setHasScrollView: emptyFn,
66
- keyboardOccludedHeight: 0,
67
- isKeyboardVisible: false,
68
- keyboardStableFrameHeight: 0,
69
- ...providerProps,
70
- onlyShowContainer: true,
71
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetView, {
72
- ref,
73
- onModalDidDismiss: function() {
74
- return setOpenInternal(false);
75
- },
76
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetViewMainContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
77
- style: { flex: 1 },
78
- children: props.children
79
- }) })
80
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {
81
- position: "absolute",
82
- display: "none",
83
- pointerEvents: "none",
84
- width: 0,
85
- height: 0,
86
- children: props.children
87
- })]
88
- })
65
+ if (snapPointsMode === "fit") throw new Error("Native Sheet fit mode requires a fit snap point");
66
+ return {
67
+ type: percent ? "percent" : "height",
68
+ value
69
+ };
89
70
  });
90
- };
91
- }
71
+ }, [
72
+ snapPoints,
73
+ snapPointsMode,
74
+ props.dismissOnSnapToBottom
75
+ ]);
76
+ if (!points.length) throw new Error("Native Sheet requires a snap point");
77
+ var position = open && (sheetState.position < 0 || props.dismissOnSnapToBottom && sheetState.position === points.length) ? 0 : sheetState.position;
78
+ if (open && (!Number.isInteger(position) || position >= points.length)) throw new Error("Native Sheet position must select an authored snap point");
79
+ var { defaultOpen, defaultPosition, unmountChildrenWhenHidden, children, ...rendererProps } = props;
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetNativeSystemContext.Provider, {
81
+ value: true,
82
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetProvider, {
83
+ ...sheetState,
84
+ onlyShowContainer: true,
85
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Renderer, {
86
+ ...rendererProps,
87
+ ref,
88
+ unmountChildrenWhenHidden,
89
+ open,
90
+ onOpenChange: setOpen,
91
+ position,
92
+ onPositionChange: sheetState.setPosition,
93
+ snapPoints: points,
94
+ onDismiss: function() {
95
+ var _state_onNativeDismiss;
96
+ if (openRef.current) return;
97
+ setDismissed(true);
98
+ (_state_onNativeDismiss = state.onNativeDismiss) === null || _state_onNativeDismiss === void 0 ? void 0 : _state_onNativeDismiss.call(state);
99
+ },
100
+ children: unmountChildrenWhenHidden && dismissed ? null : children
101
+ })
102
+ })
103
+ });
104
+ });
92
105
  }
93
- var emptyFn = function() {};
@@ -20,76 +20,88 @@ var __copyProps = (to, from, except, desc) => {
20
20
  return to;
21
21
  };
22
22
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
- var nativeSheet_exports = {};
24
- __export(nativeSheet_exports, {
23
+ var nativeSheet_native_exports = {};
24
+ __export(nativeSheet_native_exports, {
25
25
  getNativeSheet: () => getNativeSheet,
26
26
  setupNativeSheet: () => setupNativeSheet
27
27
  });
28
- module.exports = __toCommonJS(nativeSheet_exports);
28
+ module.exports = __toCommonJS(nativeSheet_native_exports);
29
29
  var import_jsx_runtime = require("react/jsx-runtime");
30
- var import_stacks = require("@tamagui/stacks");
30
+ var import_core = require("@tamagui/core");
31
31
  var import_react = require("react");
32
32
  var import_react_native = require("react-native");
33
33
  var import_SheetContext = require("./SheetContext.native.js");
34
34
  var import_useSheetOpenState = require("./useSheetOpenState.native.js");
35
- var import_useSheetProviderProps = require("./useSheetProviderProps.native.js");
36
- var nativeSheets = { ios: null };
35
+ var import_useSheetState = require("./useSheetState.native.js");
36
+ var nativeSheets = {};
37
37
  function getNativeSheet(platform) {
38
- return nativeSheets[platform];
38
+ if (import_react_native.Platform.OS !== platform) return null;
39
+ var _nativeSheets_platform;
40
+ return (_nativeSheets_platform = nativeSheets[platform]) !== null && _nativeSheets_platform !== void 0 ? _nativeSheets_platform : null;
39
41
  }
40
- function setupNativeSheet(platform, RNIOSModal) {
41
- var { ModalSheetView, ModalSheetViewMainContent } = RNIOSModal;
42
- if (platform === "ios") {
43
- nativeSheets[platform] = function(props) {
44
- var state = (0, import_useSheetOpenState.useSheetOpenState)(props);
45
- var providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state);
46
- var { open, setOpen } = state;
47
- var ref = (0, import_react.useRef)(void 0);
48
- (0, import_react.useEffect)(function() {
49
- if (open) {
50
- var _ref_current;
51
- (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.presentModal();
52
- } else {
53
- var _ref_current1;
54
- (_ref_current1 = ref.current) === null || _ref_current1 === void 0 ? void 0 : _ref_current1.dismissModal();
42
+ function setupNativeSheet(platform, Renderer) {
43
+ nativeSheets[platform] = (0, import_core.createRefComponent)(function NativeSheet(props, ref) {
44
+ var state = (0, import_useSheetOpenState.useSheetOpenState)(props, "prop-wins");
45
+ var { maxContentSize, ...sheetState } = (0, import_useSheetState.useSheetState)(props, state);
46
+ var { open, setOpen } = state;
47
+ var openRef = (0, import_react.useRef)(open);
48
+ openRef.current = open;
49
+ var [dismissed, setDismissed] = (0, import_react.useState)(!open);
50
+ var [previousOpen, setPreviousOpen] = (0, import_react.useState)(open);
51
+ if (previousOpen !== open) {
52
+ setPreviousOpen(open);
53
+ if (open) setDismissed(false);
54
+ }
55
+ var { snapPoints, snapPointsMode } = sheetState;
56
+ var points = (0, import_react.useMemo)(function() {
57
+ var authored = props.dismissOnSnapToBottom ? snapPoints.slice(0, -1) : snapPoints;
58
+ return authored.map(function(point) {
59
+ if (point === "fit" && (snapPointsMode === "fit" || snapPointsMode === "mixed")) return { type: "fit" };
60
+ var percent = snapPointsMode === "percent" || snapPointsMode === "mixed" && typeof point === "string" && point.endsWith("%");
61
+ var value = percent && typeof point === "string" ? Number(point.slice(0, -1)) : point;
62
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || percent && value > 100) {
63
+ throw new Error(`Invalid native Sheet snap point: ${String(point)}`);
55
64
  }
56
- }, [open]);
57
- function setOpenInternal(next) {
58
- var _props_onOpenChange;
59
- (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, open);
60
- setOpen(next);
61
- }
62
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetNativeSystemContext.Provider, {
63
- value: true,
64
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, {
65
- setHasScrollView: emptyFn,
66
- keyboardOccludedHeight: 0,
67
- isKeyboardVisible: false,
68
- keyboardStableFrameHeight: 0,
69
- ...providerProps,
70
- onlyShowContainer: true,
71
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetView, {
72
- ref,
73
- onModalDidDismiss: function() {
74
- return setOpenInternal(false);
75
- },
76
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetViewMainContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
77
- style: { flex: 1 },
78
- children: props.children
79
- }) })
80
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {
81
- position: "absolute",
82
- display: "none",
83
- pointerEvents: "none",
84
- width: 0,
85
- height: 0,
86
- children: props.children
87
- })]
88
- })
65
+ if (snapPointsMode === "fit") throw new Error("Native Sheet fit mode requires a fit snap point");
66
+ return {
67
+ type: percent ? "percent" : "height",
68
+ value
69
+ };
89
70
  });
90
- };
91
- }
71
+ }, [
72
+ snapPoints,
73
+ snapPointsMode,
74
+ props.dismissOnSnapToBottom
75
+ ]);
76
+ if (!points.length) throw new Error("Native Sheet requires a snap point");
77
+ var position = open && (sheetState.position < 0 || props.dismissOnSnapToBottom && sheetState.position === points.length) ? 0 : sheetState.position;
78
+ if (open && (!Number.isInteger(position) || position >= points.length)) throw new Error("Native Sheet position must select an authored snap point");
79
+ var { defaultOpen, defaultPosition, unmountChildrenWhenHidden, children, ...rendererProps } = props;
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetNativeSystemContext.Provider, {
81
+ value: true,
82
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetProvider, {
83
+ ...sheetState,
84
+ onlyShowContainer: true,
85
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Renderer, {
86
+ ...rendererProps,
87
+ ref,
88
+ unmountChildrenWhenHidden,
89
+ open,
90
+ onOpenChange: setOpen,
91
+ position,
92
+ onPositionChange: sheetState.setPosition,
93
+ snapPoints: points,
94
+ onDismiss: function() {
95
+ var _state_onNativeDismiss;
96
+ if (openRef.current) return;
97
+ setDismissed(true);
98
+ (_state_onNativeDismiss = state.onNativeDismiss) === null || _state_onNativeDismiss === void 0 ? void 0 : _state_onNativeDismiss.call(state);
99
+ },
100
+ children: unmountChildrenWhenHidden && dismissed ? null : children
101
+ })
102
+ })
103
+ });
104
+ });
92
105
  }
93
- var emptyFn = function() {};
94
106
 
95
107
  //# sourceMappingURL=nativeSheet.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nativeSheet.native.js","names":[],"sources":["cjs/nativeSheet.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar nativeSheet_exports = {};\n__export(nativeSheet_exports, {\n getNativeSheet: () => getNativeSheet,\n setupNativeSheet: () => setupNativeSheet\n});\nmodule.exports = __toCommonJS(nativeSheet_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_useSheetOpenState = require(\"./useSheetOpenState\");\nvar import_useSheetProviderProps = require(\"./useSheetProviderProps\");\nvar nativeSheets = {\n ios: null\n};\nfunction getNativeSheet(platform) {\n return nativeSheets[platform];\n}\nfunction setupNativeSheet(platform, RNIOSModal) {\n var { ModalSheetView, ModalSheetViewMainContent } = RNIOSModal;\n if (platform === \"ios\") {\n nativeSheets[platform] = function(props) {\n var state = (0, import_useSheetOpenState.useSheetOpenState)(props);\n var providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state);\n var { open, setOpen } = state;\n var ref = (0, import_react.useRef)(void 0);\n (0, import_react.useEffect)(function() {\n if (open) {\n var _ref_current;\n (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.presentModal();\n } else {\n var _ref_current1;\n (_ref_current1 = ref.current) === null || _ref_current1 === void 0 ? void 0 : _ref_current1.dismissModal();\n }\n }, [\n open\n ]);\n function setOpenInternal(next) {\n var _props_onOpenChange;\n (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, open);\n setOpen(next);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetNativeSystemContext.Provider, {\n value: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, {\n setHasScrollView: emptyFn,\n keyboardOccludedHeight: 0,\n isKeyboardVisible: false,\n keyboardStableFrameHeight: 0,\n ...providerProps,\n onlyShowContainer: true,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetView, {\n ref,\n onModalDidDismiss: function() {\n return setOpenInternal(false);\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ModalSheetViewMainContent, {\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {\n style: {\n flex: 1\n },\n children: props.children\n })\n })\n }),\n /* for some reason select triggers wont show on native if this isn't inside the actual tree not inside implementation... */\n /* so just hiding it here for now... not great... */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.YStack, {\n position: \"absolute\",\n display: \"none\",\n pointerEvents: \"none\",\n width: 0,\n height: 0,\n children: props.children\n })\n ]\n })\n });\n };\n }\n}\nvar emptyFn = function() {\n};\n//# sourceMappingURL=nativeSheet.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB;CAC5B,sBAAsB;CACtB,wBAAwB;AAC1B,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,gBAAgB,QAAQ,iBAAiB;AAC7C,IAAI,eAAe,QAAQ,OAAO;AAClC,IAAI,sBAAsB,QAAQ,cAAc;AAChD,IAAI,sBAAsB,QAAQ,0BAAgB;AAClD,IAAI,2BAA2B,QAAQ,+BAAqB;AAC5D,IAAI,+BAA+B,QAAQ,mCAAyB;AACpE,IAAI,eAAe,EACjB,KAAK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AC/E,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,oBAAoB,MAAM;OAC9E,OAAO,EACL,MAAM,EACR;OACA,UAAU,MAAM;MAClB,CAAC,EACH,CAAC;KACH,CAAC,GAGe,iBAAC,GAAG,mBAAmB,IAAG,CAAE,cAAc,QAAQ;MAChE,UAAU;MACV,SAAS;MACT,eAAe;MACf,OAAO;MACP,QAAQ;MACR,UAAU,MAAM;KAClB,CAAC,CACH;IACF,CAAC;GACH,CAAC;EACH;CACF;AACF;AACA,IAAI,UAAU,WAAW,CACzB"}
1
+ {"version":3,"file":"nativeSheet.native.js","names":[],"sources":["cjs/nativeSheet.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar nativeSheet_native_exports = {};\n__export(nativeSheet_native_exports, {\n getNativeSheet: () => getNativeSheet,\n setupNativeSheet: () => setupNativeSheet\n});\nmodule.exports = __toCommonJS(nativeSheet_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_useSheetOpenState = require(\"./useSheetOpenState\");\nvar import_useSheetState = require(\"./useSheetState\");\nvar nativeSheets = {};\nfunction getNativeSheet(platform) {\n if (import_react_native.Platform.OS !== platform) return null;\n var _nativeSheets_platform;\n return (_nativeSheets_platform = nativeSheets[platform]) !== null && _nativeSheets_platform !== void 0 ? _nativeSheets_platform : null;\n}\nfunction setupNativeSheet(platform, Renderer) {\n nativeSheets[platform] = (0, import_core.createRefComponent)(function NativeSheet(props, ref) {\n var state = (0, import_useSheetOpenState.useSheetOpenState)(props, \"prop-wins\");\n var { maxContentSize, ...sheetState } = (0, import_useSheetState.useSheetState)(props, state);\n var { open, setOpen } = state;\n var openRef = (0, import_react.useRef)(open);\n openRef.current = open;\n var [dismissed, setDismissed] = (0, import_react.useState)(!open);\n var [previousOpen, setPreviousOpen] = (0, import_react.useState)(open);\n if (previousOpen !== open) {\n setPreviousOpen(open);\n if (open) setDismissed(false);\n }\n var { snapPoints, snapPointsMode } = sheetState;\n var points = (0, import_react.useMemo)(function() {\n var authored = props.dismissOnSnapToBottom ? snapPoints.slice(0, -1) : snapPoints;\n return authored.map(function(point) {\n if (point === \"fit\" && (snapPointsMode === \"fit\" || snapPointsMode === \"mixed\")) return {\n type: \"fit\"\n };\n var percent = snapPointsMode === \"percent\" || snapPointsMode === \"mixed\" && typeof point === \"string\" && point.endsWith(\"%\");\n var value = percent && typeof point === \"string\" ? Number(point.slice(0, -1)) : point;\n if (typeof value !== \"number\" || !Number.isFinite(value) || value < 0 || percent && value > 100) {\n throw new Error(`Invalid native Sheet snap point: ${String(point)}`);\n }\n if (snapPointsMode === \"fit\") throw new Error(\"Native Sheet fit mode requires a fit snap point\");\n return {\n type: percent ? \"percent\" : \"height\",\n value\n };\n });\n }, [\n snapPoints,\n snapPointsMode,\n props.dismissOnSnapToBottom\n ]);\n if (!points.length) throw new Error(\"Native Sheet requires a snap point\");\n var position = open && (sheetState.position < 0 || props.dismissOnSnapToBottom && sheetState.position === points.length) ? 0 : sheetState.position;\n if (open && (!Number.isInteger(position) || position >= points.length)) throw new Error(\"Native Sheet position must select an authored snap point\");\n var { defaultOpen, defaultPosition, unmountChildrenWhenHidden, children, ...rendererProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetNativeSystemContext.Provider, {\n value: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SheetContext.SheetProvider, {\n ...sheetState,\n onlyShowContainer: true,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Renderer, {\n ...rendererProps,\n ref,\n unmountChildrenWhenHidden,\n open,\n onOpenChange: setOpen,\n position,\n onPositionChange: sheetState.setPosition,\n snapPoints: points,\n onDismiss: function() {\n var _state_onNativeDismiss;\n if (openRef.current) return;\n setDismissed(true);\n (_state_onNativeDismiss = state.onNativeDismiss) === null || _state_onNativeDismiss === void 0 ? void 0 : _state_onNativeDismiss.call(state);\n },\n children: unmountChildrenWhenHidden && dismissed ? null : children\n })\n })\n });\n });\n}\n//# sourceMappingURL=nativeSheet.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF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AAI;MACJ,IAAI,QAAQ,SAAS;MACrB,aAAa,IAAI;MACjB,CAAC,yBAAyB,MAAM,qBAAqB,QAAQ,2BAA2B,KAAK,IAAI,KAAK,IAAI,uBAAuB,KAAK,KAAK;KAC7I;KACA,UAAU,6BAA6B,YAAY,OAAO;IAC5D,CAAC;GACH,CAAC;EACH,CAAC;CACH,CAAC;AACH"}
@@ -0,0 +1,27 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var stableViewportHeight_exports = {};
22
+ __export(stableViewportHeight_exports, { getStableViewportHeight: () => getStableViewportHeight });
23
+ module.exports = __toCommonJS(stableViewportHeight_exports);
24
+ var import_webViewport = require("./webViewport.cjs");
25
+ function getStableViewportHeight() {
26
+ return (0, import_webViewport.getStableLayoutViewportHeight)();
27
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var stableViewportHeight_native_exports = {};
24
+ __export(stableViewportHeight_native_exports, { getStableViewportHeight: () => getStableViewportHeight });
25
+ module.exports = __toCommonJS(stableViewportHeight_native_exports);
26
+ var import_react_native = require("react-native");
27
+ function getStableViewportHeight() {
28
+ return import_react_native.Dimensions.get("screen").height;
29
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var stableViewportHeight_native_exports = {};
24
+ __export(stableViewportHeight_native_exports, { getStableViewportHeight: () => getStableViewportHeight });
25
+ module.exports = __toCommonJS(stableViewportHeight_native_exports);
26
+ var import_react_native = require("react-native");
27
+ function getStableViewportHeight() {
28
+ return import_react_native.Dimensions.get("screen").height;
29
+ }
30
+
31
+ //# sourceMappingURL=stableViewportHeight.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stableViewportHeight.native.js","names":[],"sources":["cjs/stableViewportHeight.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar stableViewportHeight_native_exports = {};\n__export(stableViewportHeight_native_exports, {\n getStableViewportHeight: () => getStableViewportHeight\n});\nmodule.exports = __toCommonJS(stableViewportHeight_native_exports);\nvar import_react_native = require(\"react-native\");\nfunction getStableViewportHeight() {\n return import_react_native.Dimensions.get(\"screen\").height;\n}\n//# sourceMappingURL=stableViewportHeight.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sCAAsC,CAAC;AAC3C,SAAS,qCAAqC,EAC5C,+BAA+B,wBACjC,CAAC;AACD,OAAO,UAAU,aAAa,mCAAmC;AACjE,IAAI,sBAAsB,QAAQ,cAAc;AAChD,SAAS,0BAA0B;CACjC,OAAO,oBAAoB,WAAW,IAAI,QAAQ,CAAC,CAAC;AACtD"}