@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.
- package/dist/cjs/Sheet.cjs +48 -16
- package/dist/cjs/Sheet.native.cjs +46 -17
- package/dist/cjs/Sheet.native.js +46 -17
- package/dist/cjs/Sheet.native.js.map +1 -1
- package/dist/cjs/SheetDragSurface.cjs +50 -0
- package/dist/{jsx/GestureDetectorWrapper.native.js → cjs/SheetDragSurface.native.cjs} +24 -12
- package/dist/cjs/{GestureDetectorWrapper.native.js → SheetDragSurface.native.js} +25 -11
- package/dist/cjs/SheetDragSurface.native.js.map +1 -0
- package/dist/cjs/SheetImplementationCustom.cjs +41 -58
- package/dist/cjs/SheetImplementationCustom.native.cjs +43 -59
- package/dist/cjs/SheetImplementationCustom.native.js +43 -59
- package/dist/cjs/SheetImplementationCustom.native.js.map +1 -1
- package/dist/cjs/SheetScrollView.cjs +15 -3
- package/dist/cjs/SheetScrollView.native.cjs +17 -4
- package/dist/cjs/SheetScrollView.native.js +17 -4
- package/dist/cjs/SheetScrollView.native.js.map +1 -1
- package/dist/cjs/nativeSheet.cjs +3 -59
- package/dist/cjs/nativeSheet.native.cjs +70 -58
- package/dist/cjs/nativeSheet.native.js +70 -58
- package/dist/cjs/nativeSheet.native.js.map +1 -1
- package/dist/cjs/stableViewportHeight.cjs +27 -0
- package/dist/cjs/stableViewportHeight.native.cjs +29 -0
- package/dist/cjs/stableViewportHeight.native.js +31 -0
- package/dist/cjs/stableViewportHeight.native.js.map +1 -0
- package/dist/cjs/useSheetOffscreenSize.cjs +3 -1
- package/dist/cjs/useSheetOffscreenSize.native.cjs +3 -2
- package/dist/cjs/useSheetOffscreenSize.native.js +3 -2
- package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/cjs/useSheetOpenState.cjs +13 -6
- package/dist/cjs/useSheetOpenState.native.cjs +15 -5
- package/dist/cjs/useSheetOpenState.native.js +15 -5
- package/dist/cjs/useSheetOpenState.native.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.cjs +5 -94
- package/dist/cjs/useSheetProviderProps.native.cjs +5 -103
- package/dist/cjs/useSheetProviderProps.native.js +5 -103
- package/dist/cjs/useSheetProviderProps.native.js.map +1 -1
- package/dist/cjs/useSheetState.cjs +120 -0
- package/dist/cjs/useSheetState.native.cjs +131 -0
- package/dist/cjs/useSheetState.native.js +133 -0
- package/dist/cjs/useSheetState.native.js.map +1 -0
- package/dist/esm/Sheet.mjs +48 -15
- package/dist/esm/Sheet.mjs.map +1 -1
- package/dist/esm/Sheet.native.js +46 -17
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetDragSurface.mjs +25 -0
- package/dist/esm/SheetDragSurface.mjs.map +1 -0
- package/dist/esm/SheetDragSurface.native.js +34 -0
- package/dist/esm/SheetDragSurface.native.js.map +1 -0
- package/dist/esm/SheetImplementationCustom.mjs +39 -56
- package/dist/esm/SheetImplementationCustom.mjs.map +1 -1
- package/dist/esm/SheetImplementationCustom.native.js +41 -57
- package/dist/esm/SheetImplementationCustom.native.js.map +1 -1
- package/dist/esm/SheetScrollView.mjs +16 -4
- package/dist/esm/SheetScrollView.mjs.map +1 -1
- package/dist/esm/SheetScrollView.native.js +18 -5
- package/dist/esm/SheetScrollView.native.js.map +1 -1
- package/dist/esm/nativeSheet.mjs +3 -60
- package/dist/esm/nativeSheet.mjs.map +1 -1
- package/dist/esm/nativeSheet.native.js +70 -58
- package/dist/esm/nativeSheet.native.js.map +1 -1
- package/dist/esm/stableViewportHeight.mjs +8 -0
- package/dist/esm/stableViewportHeight.mjs.map +1 -0
- package/dist/esm/stableViewportHeight.native.js +8 -0
- package/dist/esm/stableViewportHeight.native.js.map +1 -0
- package/dist/esm/useKeyboardControllerSheet.native.js +0 -5
- package/dist/esm/useSheetOffscreenSize.mjs +3 -1
- package/dist/esm/useSheetOffscreenSize.mjs.map +1 -1
- package/dist/esm/useSheetOffscreenSize.native.js +3 -2
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/esm/useSheetOpenState.mjs +14 -7
- package/dist/esm/useSheetOpenState.mjs.map +1 -1
- package/dist/esm/useSheetOpenState.native.js +16 -6
- package/dist/esm/useSheetOpenState.native.js.map +1 -1
- package/dist/esm/useSheetProviderProps.mjs +5 -88
- package/dist/esm/useSheetProviderProps.mjs.map +1 -1
- package/dist/esm/useSheetProviderProps.native.js +5 -97
- package/dist/esm/useSheetProviderProps.native.js.map +1 -1
- package/dist/esm/useSheetState.mjs +95 -0
- package/dist/esm/useSheetState.mjs.map +1 -0
- package/dist/esm/useSheetState.native.js +104 -0
- package/dist/esm/useSheetState.native.js.map +1 -0
- package/dist/jsx/Sheet.mjs +48 -15
- package/dist/jsx/Sheet.mjs.map +1 -1
- package/dist/jsx/Sheet.native.cjs +46 -17
- package/dist/jsx/Sheet.native.js +46 -17
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetDragSurface.mjs +25 -0
- package/dist/jsx/SheetDragSurface.mjs.map +1 -0
- package/dist/{cjs/GestureDetectorWrapper.native.cjs → jsx/SheetDragSurface.native.cjs} +24 -10
- package/dist/jsx/{GestureDetectorWrapper.native.cjs → SheetDragSurface.native.js} +26 -10
- package/dist/jsx/SheetDragSurface.native.js.map +1 -0
- package/dist/jsx/SheetImplementationCustom.mjs +39 -56
- package/dist/jsx/SheetImplementationCustom.mjs.map +1 -1
- package/dist/jsx/SheetImplementationCustom.native.cjs +43 -59
- package/dist/jsx/SheetImplementationCustom.native.js +43 -59
- package/dist/jsx/SheetImplementationCustom.native.js.map +1 -1
- package/dist/jsx/SheetScrollView.mjs +16 -4
- package/dist/jsx/SheetScrollView.mjs.map +1 -1
- package/dist/jsx/SheetScrollView.native.cjs +17 -4
- package/dist/jsx/SheetScrollView.native.js +17 -4
- package/dist/jsx/SheetScrollView.native.js.map +1 -1
- package/dist/jsx/nativeSheet.mjs +3 -60
- package/dist/jsx/nativeSheet.mjs.map +1 -1
- package/dist/jsx/nativeSheet.native.cjs +70 -58
- package/dist/jsx/nativeSheet.native.js +70 -58
- package/dist/jsx/nativeSheet.native.js.map +1 -1
- package/dist/jsx/stableViewportHeight.mjs +8 -0
- package/dist/jsx/stableViewportHeight.mjs.map +1 -0
- package/dist/jsx/stableViewportHeight.native.cjs +29 -0
- package/dist/jsx/stableViewportHeight.native.js +31 -0
- package/dist/jsx/stableViewportHeight.native.js.map +1 -0
- package/dist/jsx/useSheetOffscreenSize.mjs +3 -1
- package/dist/jsx/useSheetOffscreenSize.mjs.map +1 -1
- package/dist/jsx/useSheetOffscreenSize.native.cjs +3 -2
- package/dist/jsx/useSheetOffscreenSize.native.js +3 -2
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/jsx/useSheetOpenState.mjs +14 -7
- package/dist/jsx/useSheetOpenState.mjs.map +1 -1
- package/dist/jsx/useSheetOpenState.native.cjs +15 -5
- package/dist/jsx/useSheetOpenState.native.js +15 -5
- package/dist/jsx/useSheetOpenState.native.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.mjs +5 -88
- package/dist/jsx/useSheetProviderProps.mjs.map +1 -1
- package/dist/jsx/useSheetProviderProps.native.cjs +5 -103
- package/dist/jsx/useSheetProviderProps.native.js +5 -103
- package/dist/jsx/useSheetProviderProps.native.js.map +1 -1
- package/dist/jsx/useSheetState.mjs +95 -0
- package/dist/jsx/useSheetState.mjs.map +1 -0
- package/dist/jsx/useSheetState.native.cjs +131 -0
- package/dist/jsx/useSheetState.native.js +133 -0
- package/dist/jsx/useSheetState.native.js.map +1 -0
- package/package.json +27 -22
- package/src/Sheet.tsx +45 -18
- package/src/SheetDragSurface.native.tsx +42 -0
- package/src/SheetDragSurface.tsx +40 -0
- package/src/SheetImplementationCustom.tsx +67 -92
- package/src/SheetScrollView.tsx +26 -4
- package/src/nativeSheet.native.tsx +110 -0
- package/src/nativeSheet.ts +16 -0
- package/src/stableViewportHeight.native.ts +9 -0
- package/src/stableViewportHeight.ts +15 -0
- package/src/types.tsx +44 -1
- package/src/useSheetOffscreenSize.tsx +3 -7
- package/src/useSheetOpenState.tsx +18 -8
- package/src/useSheetProviderProps.tsx +18 -149
- package/src/useSheetScrollViewGestures.native.ts +4 -1
- package/src/useSheetState.tsx +139 -0
- package/types/Sheet.d.ts +71 -167
- package/types/Sheet.d.ts.map +1 -1
- package/types/SheetDragSurface.d.ts +11 -0
- package/types/SheetDragSurface.d.ts.map +1 -0
- package/types/SheetDragSurface.native.d.ts +11 -0
- package/types/SheetDragSurface.native.d.ts.map +1 -0
- package/types/SheetImplementationCustom.d.ts +1 -2
- package/types/SheetImplementationCustom.d.ts.map +1 -1
- package/types/SheetScrollView.d.ts +3 -3
- package/types/SheetScrollView.d.ts.map +1 -1
- package/types/nativeSheet.d.ts +8 -9
- package/types/nativeSheet.d.ts.map +1 -1
- package/types/nativeSheet.native.d.ts +4 -0
- package/types/nativeSheet.native.d.ts.map +1 -0
- package/types/stableViewportHeight.d.ts +12 -0
- package/types/stableViewportHeight.d.ts.map +1 -0
- package/types/stableViewportHeight.native.d.ts +6 -0
- package/types/stableViewportHeight.native.d.ts.map +1 -0
- package/types/types.d.ts +34 -1
- package/types/types.d.ts.map +1 -1
- package/types/useSheetOffscreenSize.d.ts +1 -1
- package/types/useSheetOffscreenSize.d.ts.map +1 -1
- package/types/useSheetOpenState.d.ts +3 -1
- package/types/useSheetOpenState.d.ts.map +1 -1
- package/types/useSheetProviderProps.d.ts +15 -13
- package/types/useSheetProviderProps.d.ts.map +1 -1
- package/types/useSheetScrollViewGestures.native.d.ts +1 -1
- package/types/useSheetScrollViewGestures.native.d.ts.map +1 -1
- package/types/useSheetState.d.ts +26 -0
- package/types/useSheetState.d.ts.map +1 -0
- package/dist/cjs/GestureDetectorWrapper.cjs +0 -44
- package/dist/cjs/GestureDetectorWrapper.native.js.map +0 -1
- package/dist/esm/GestureDetectorWrapper.mjs +0 -25
- package/dist/esm/GestureDetectorWrapper.mjs.map +0 -1
- package/dist/esm/GestureDetectorWrapper.native.js +0 -26
- package/dist/esm/GestureDetectorWrapper.native.js.map +0 -1
- package/dist/jsx/GestureDetectorWrapper.mjs +0 -25
- package/dist/jsx/GestureDetectorWrapper.mjs.map +0 -1
- package/dist/jsx/GestureDetectorWrapper.native.js.map +0 -1
- package/src/GestureDetectorWrapper.tsx +0 -38
- package/src/nativeSheet.tsx +0 -86
- package/types/GestureDetectorWrapper.d.ts +0 -14
- package/types/GestureDetectorWrapper.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.native.js","names":[],"sources":["jsx/Sheet.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\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Sheet_exports = {};\n__export(Sheet_exports, {\n\tSheet: () => Sheet,\n\tSheetBackground: () => SheetBackground,\n\tSheetContainer: () => SheetContainer,\n\tSheetControlled: () => SheetControlled,\n\tSheetHandle: () => SheetHandle,\n\tSheetOverlay: () => SheetOverlay,\n\tSheetRoot: () => SheetRoot\n});\nmodule.exports = __toCommonJS(Sheet_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_adapt = require(\"@tamagui/adapt\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_portal = require(\"@tamagui/portal\");\nvar import_remove_scroll = require(\"@tamagui/remove-scroll\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_use_did_finish_ssr = require(\"@tamagui/use-did-finish-ssr\");\nvar import_z_index_stack = require(\"@tamagui/z-index-stack\");\nvar import_react = require(\"react\");\nvar import_react_native = require(\"react-native\");\nvar import_constants2 = require(\"./constants\");\nvar import_nativeSheet = require(\"./nativeSheet\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_SheetImplementationCustom = require(\"./SheetImplementationCustom\");\nvar import_SheetScrollView = require(\"./SheetScrollView\");\nvar import_useSheetController = require(\"./useSheetController\");\nvar import_useSheetOffscreenSize = require(\"./useSheetOffscreenSize\");\nvar import_webViewport = require(\"./webViewport\");\n__reExport(Sheet_exports, require(\"./types\"), module.exports);\nvar SheetHandleFrame = (0, import_core.styled)(import_stacks.XStack, {\n\tdisplayName: import_constants2.SHEET_HANDLE_NAME,\n\tvariants: { open: {\n\t\ttrue: { pointerEvents: \"auto\" },\n\t\tfalse: { pointerEvents: \"none\" }\n\t} }\n});\nvar SheetOverlayFrame = (0, import_core.styled)(import_stacks.YStack, {\n\tdisplayName: import_constants2.SHEET_OVERLAY_NAME,\n\tinset: 0,\n\tposition: \"absolute\",\n\tzIndex: 99999,\n\tpointerEvents: \"auto\",\n\tvariants: { open: {\n\t\ttrue: { pointerEvents: \"auto\" },\n\t\tfalse: { pointerEvents: \"none\" }\n\t} }\n});\nObject.assign(SheetOverlayFrame.staticConfig, { [import_constants2.SHEET_OVERLAY_MARKER]: true });\nvar SheetContainerFrame = (0, import_core.styled)(import_stacks.YStack, {\n\tdisplayName: import_constants2.SHEET_CONTAINER_NAME,\n\tflex: 1,\n\tposition: \"relative\",\n\tzIndex: 0,\n\twidth: \"100%\",\n\tmaxHeight: \"100%\"\n});\nvar SheetBackgroundFrame = (0, import_core.styled)(import_stacks.YStack, {\n\tdisplayName: import_constants2.SHEET_BACKGROUND_NAME,\n\tposition: \"absolute\",\n\ttop: 0,\n\tleft: 0,\n\tright: 0,\n\tzIndex: -1,\n\tpointerEvents: \"none\"\n});\nvar SheetHandle = (0, import_core.createStyledHOC)(SheetHandleFrame, function(param, forwardedRef) {\n\tvar { scope, ...props } = param;\n\tvar context = (0, import_SheetContext.useSheetContext)(scope);\n\tvar composedRef = (0, import_compose_refs.useComposedRefs)(context.handleRef, forwardedRef);\n\tvar wasDraggingRef = (0, import_react.useRef)(false);\n\t(0, import_react.useEffect)(function() {\n\t\tif (!context.scrollBridge) return;\n\t\treturn context.scrollBridge.onParentDragging(function(isDragging) {\n\t\t\tif (isDragging) wasDraggingRef.current = true;\n\t\t});\n\t}, [context.scrollBridge]);\n\tif (context.onlyShowContainer) return null;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetHandleFrame, {\n\t\tref: composedRef,\n\t\tonPressIn: function() {\n\t\t\twasDraggingRef.current = false;\n\t\t},\n\t\tonPress: function() {\n\t\t\tif (wasDraggingRef.current) {\n\t\t\t\twasDraggingRef.current = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n\t\t\tvar nextPos = (context.position + 1) % max;\n\t\t\tcontext.setPosition(nextPos);\n\t\t},\n\t\topen: context.open,\n\t\t...props\n\t});\n});\nvar SheetOverlay = (0, import_core.createStyledHOC)(SheetOverlayFrame, function(propsIn, ref) {\n\tvar { scope, ...props } = propsIn;\n\tvar context = (0, import_SheetContext.useSheetContext)(scope);\n\tvar isInOverlayLayer = (0, import_react.useContext)(import_SheetContext.SheetOverlayLayerContext);\n\tvar didWarn = (0, import_react.useRef)(false);\n\tif (context.onlyShowContainer) return null;\n\tif (!isInOverlayLayer) {\n\t\tif (process.env.NODE_ENV === \"development\" && !didWarn.current) {\n\t\t\tdidWarn.current = true;\n\t\t\tconsole.error(\"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\");\n\t\t}\n\t\treturn null;\n\t}\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetOverlayFrame, {\n\t\t...props,\n\t\tref,\n\t\tonPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.dismissOnOverlayPress ? function() {\n\t\t\tcontext.setOpen(false);\n\t\t} : void 0)\n\t});\n});\nvar SheetContainer = (0, import_core.createStyledHOC)(SheetContainerFrame, function(param, forwardedRef) {\n\tvar { scope, adjustPaddingForOffscreenContent, children, ...props } = param;\n\tvar context = (0, import_SheetContext.useSheetContext)(scope);\n\tvar { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;\n\tvar composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n\tvar offscreenSize = (0, import_useSheetOffscreenSize.useSheetOffscreenSize)(context);\n\tvar stableFrameSize = (0, import_react.useRef)(frameSize);\n\t(0, import_react.useEffect)(function() {\n\t\tif (open && frameSize) stableFrameSize.current = frameSize;\n\t}, [open, frameSize]);\n\tvar sheetContents = (0, import_react.useMemo)(function() {\n\t\tvar shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n\t\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetContainerFrame, {\n\t\t\tref: composedContentRef,\n\t\t\tflex: hasFit && open ? 0 : 1,\n\t\t\tflexBasis: hasFit ? \"auto\" : void 0,\n\t\t\theight: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,\n\t\t\tpointerEvents: open ? \"auto\" : \"none\",\n\t\t\t\"data-state\": open ? \"open\" : \"closed\",\n\t\t\t...props,\n\t\t\tchildren: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_z_index_stack.StackZIndexContext, {\n\t\t\t\tzIndex: (0, import_portal.resolveViewZIndex)(props.zIndex),\n\t\t\t\tchildren\n\t\t\t}), adjustPaddingForOffscreenContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n\t\t\t\t\"data-sheet-offscreen-pad\": true,\n\t\t\t\theight: offscreenSize,\n\t\t\t\twidth: \"100%\"\n\t\t\t})]\n\t\t});\n\t}, [\n\t\topen,\n\t\tprops,\n\t\tframeSize,\n\t\toffscreenSize,\n\t\tadjustPaddingForOffscreenContent,\n\t\thasFit\n\t]);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_remove_scroll.RemoveScroll, {\n\t\tenabled: !disableRemoveScroll && context.open,\n\t\tchildren: sheetContents\n\t});\n});\nvar SheetBackground = (0, import_core.createStyledHOC)(SheetBackgroundFrame, function(param, forwardedRef) {\n\tvar { scope, disableHideBottomOverflow, ...props } = param;\n\tvar context = (0, import_SheetContext.useSheetContext)(scope);\n\tvar bottomOverflow = import_constants.isWeb ? Math.max(context.frameSize, (0, import_webViewport.getMaxViewportHeight)()) : context.frameSize;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBackgroundFrame, {\n\t\tref: forwardedRef,\n\t\t\"data-sheet-background\": \"\",\n\t\tbottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n\t\t...props\n\t});\n});\nvar SheetRoot = (0, import_core.createRefComponent)(function SheetRoot2(props, ref) {\n\tvar hydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)();\n\tvar isAdapted = (0, import_adapt.useAdaptIsActive)();\n\tvar adaptContext = (0, import_adapt.useAdaptContext)();\n\tvar { isShowingNonSheet } = (0, import_useSheetController.useSheetController)(props.scope);\n\tvar isShowingAdaptNonSheet = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange) && !adaptContext.active && adaptContext.open;\n\tvar SheetImplementation = import_SheetImplementationCustom.SheetImplementationCustom;\n\tif (props.native && import_react_native.Platform.OS === \"ios\") {\n\t\tvar impl = (0, import_nativeSheet.getNativeSheet)(\"ios\");\n\t\tif (impl) SheetImplementation = impl;\n\t}\n\tif (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) return null;\n\tvar implementation = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetImplementation, {\n\t\tref,\n\t\t...props\n\t});\n\treturn isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptCapabilities, {\n\t\tscroll: true,\n\t\toverlay: true,\n\t\tdismiss: true,\n\t\tchildren: implementation\n\t}) : implementation;\n});\nvar sheetParts = {\n\tContainer: SheetContainer,\n\tBackground: SheetBackground,\n\tOverlay: SheetOverlay,\n\tHandle: SheetHandle,\n\tScrollView: import_SheetScrollView.SheetScrollView\n};\nvar SheetControlled = (0, import_helpers.withStaticProperties)(SheetRoot, sheetParts);\nvar Sheet = (0, import_helpers.withStaticProperties)(SheetRoot, {\n\tRoot: SheetRoot,\n\tControlled: SheetControlled,\n\tuseAnimatedPosition: import_SheetContext.useAnimatedPosition,\n\t...sheetParts\n});\n//# sourceMappingURL=Sheet.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;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM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AS;CACT,QAAQ;CACR,YAAY,uBAAuB;AACpC;AACA,IAAI,mBAAmB,GAAG,eAAe,qBAAoB,CAAE,WAAW,UAAU;AACpF,IAAI,SAAS,GAAG,eAAe,qBAAoB,CAAE,WAAW;CAC/D,MAAM;CACN,YAAY;CACZ,qBAAqB,oBAAoB;CACzC,GAAG;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"Sheet.native.js","names":[],"sources":["jsx/Sheet.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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Sheet_exports = {};\n__export(Sheet_exports, {\n Sheet: () => Sheet,\n SheetBackground: () => SheetBackground,\n SheetContainer: () => SheetContainer,\n SheetControlled: () => SheetControlled,\n SheetHandle: () => SheetHandle,\n SheetOverlay: () => SheetOverlay,\n SheetRoot: () => SheetRoot\n});\nmodule.exports = __toCommonJS(Sheet_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_adapt = require(\"@tamagui/adapt\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_portal = require(\"@tamagui/portal\");\nvar import_remove_scroll = require(\"@tamagui/remove-scroll\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_use_did_finish_ssr = require(\"@tamagui/use-did-finish-ssr\");\nvar import_z_index_stack = require(\"@tamagui/z-index-stack\");\nvar import_react = require(\"react\");\nvar import_constants2 = require(\"./constants\");\nvar import_nativeSheet = require(\"./nativeSheet\");\nvar import_SheetContext = require(\"./SheetContext\");\nvar import_SheetImplementationCustom = require(\"./SheetImplementationCustom\");\nvar import_SheetScrollView = require(\"./SheetScrollView\");\nvar import_useSheetController = require(\"./useSheetController\");\nvar import_useSheetOffscreenSize = require(\"./useSheetOffscreenSize\");\nvar import_webViewport = require(\"./webViewport\");\n__reExport(Sheet_exports, require(\"./types\"), module.exports);\nvar SheetHandleFrame = (0, import_core.styled)(import_stacks.XStack, {\n displayName: import_constants2.SHEET_HANDLE_NAME,\n // the behavior Handle ships no opacity rules; open/close aesthetics (fade in\n // when open, dim when idle) live in the copied skin. see the canonical skin.\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar SheetOverlayFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: import_constants2.SHEET_OVERLAY_NAME,\n inset: 0,\n position: \"absolute\",\n zIndex: 1e5 - 1,\n pointerEvents: \"auto\",\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nObject.assign(SheetOverlayFrame.staticConfig, {\n [import_constants2.SHEET_OVERLAY_MARKER]: true\n});\nvar SheetContainerFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: import_constants2.SHEET_CONTAINER_NAME,\n flex: 1,\n position: \"relative\",\n zIndex: 0,\n width: \"100%\"\n});\nvar SheetBackgroundFrame = (0, import_core.styled)(import_stacks.YStack, {\n displayName: import_constants2.SHEET_BACKGROUND_NAME,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: -1,\n pointerEvents: \"none\"\n});\nvar SheetHandle = (0, import_core.createStyledHOC)(SheetHandleFrame, function(param, forwardedRef) {\n var { scope, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n var composedRef = (0, import_compose_refs.useComposedRefs)(context.handleRef, forwardedRef);\n var wasDraggingRef = (0, import_react.useRef)(false);\n (0, import_react.useEffect)(function() {\n if (!context.scrollBridge) return;\n return context.scrollBridge.onParentDragging(function(isDragging) {\n if (isDragging) {\n wasDraggingRef.current = true;\n }\n });\n }, [\n context.scrollBridge\n ]);\n if (context.onlyShowContainer) {\n return null;\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetHandleFrame, {\n ref: composedRef,\n onPressIn: function() {\n wasDraggingRef.current = false;\n },\n onPress: function() {\n if (wasDraggingRef.current) {\n wasDraggingRef.current = false;\n return;\n }\n var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n var nextPos = (context.position + 1) % max;\n context.setPosition(nextPos);\n },\n open: context.open,\n ...props\n });\n});\nvar SheetOverlay = (0, import_core.createStyledHOC)(SheetOverlayFrame, function(propsIn, ref) {\n var { scope, ...props } = propsIn;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n var isInOverlayLayer = (0, import_react.useContext)(import_SheetContext.SheetOverlayLayerContext);\n var didWarn = (0, import_react.useRef)(false);\n if (context.onlyShowContainer) {\n return null;\n }\n if (!isInOverlayLayer) {\n if (process.env.NODE_ENV === \"development\" && !didWarn.current) {\n didWarn.current = true;\n console.error(\"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\");\n }\n return null;\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetOverlayFrame, {\n ...props,\n ref,\n onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.dismissOnOverlayPress ? function() {\n context.setOpen(false);\n } : void 0)\n });\n});\nvar SheetContainer = (0, import_core.createStyledHOC)(SheetContainerFrame, function(param, forwardedRef) {\n var { scope, adjustPaddingForOffscreenContent, children, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n var { hasFit, frameSize, contentRef, open } = context;\n var composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n var offscreenSize = (0, import_useSheetOffscreenSize.useSheetOffscreenSize)(context);\n var stableFrameSize = (0, import_react.useRef)(frameSize);\n (0, import_react.useEffect)(function() {\n if (open && frameSize) {\n stableFrameSize.current = frameSize;\n }\n }, [\n open,\n frameSize\n ]);\n var sheetContents = (0, import_react.useMemo)(function() {\n if (context.onlyShowContainer) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetContainerFrame, {\n ref: composedContentRef,\n flex: hasFit ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n maxHeight: hasFit ? void 0 : \"100%\",\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n onLayout: (0, import_helpers.composeEventHandlers)(props.onLayout, function(event) {\n context.setFrameSize(event.nativeEvent.layout.height);\n }),\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_z_index_stack.StackZIndexContext, {\n zIndex: (0, import_portal.resolveViewZIndex)(props.zIndex),\n children\n })\n });\n }\n var shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetContainerFrame, {\n ref: composedContentRef,\n flex: hasFit && open ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n maxHeight: \"100%\",\n height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_z_index_stack.StackZIndexContext, {\n zIndex: (0, import_portal.resolveViewZIndex)(props.zIndex),\n children\n }),\n adjustPaddingForOffscreenContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.View, {\n \"data-sheet-offscreen-pad\": true,\n height: offscreenSize,\n width: \"100%\"\n })\n ]\n });\n }, [\n open,\n props,\n frameSize,\n offscreenSize,\n adjustPaddingForOffscreenContent,\n hasFit,\n context.onlyShowContainer,\n context.setFrameSize\n ]);\n if (context.onlyShowContainer) return sheetContents;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_remove_scroll.RemoveScroll, {\n enabled: !context.disableRemoveScroll && context.open,\n children: sheetContents\n });\n});\nvar SheetBackground = (0, import_core.createStyledHOC)(SheetBackgroundFrame, function(param, forwardedRef) {\n var { scope, disableHideBottomOverflow, ...props } = param;\n var context = (0, import_SheetContext.useSheetContext)(scope);\n if (context.onlyShowContainer) return null;\n var bottomOverflow = import_constants.isWeb ? Math.max(context.frameSize, (0, import_webViewport.getMaxViewportHeight)()) : context.frameSize;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetBackgroundFrame, {\n ref: forwardedRef,\n \"data-sheet-background\": \"\",\n bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n ...props\n });\n});\nvar SheetRoot = (0, import_core.createRefComponent)(function SheetRoot2(props, ref) {\n var hydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)();\n var isAdapted = (0, import_adapt.useAdaptIsActive)();\n var adaptContext = (0, import_adapt.useAdaptContext)();\n var { isShowingNonSheet } = (0, import_useSheetController.useSheetController)(props.scope);\n var shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);\n var isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;\n var nativeImplementation = props.native === true || Array.isArray(props.native) && props.native.includes(\"ios\") ? (0, import_nativeSheet.getNativeSheet)(\"ios\") : null;\n var SheetImplementation = nativeImplementation !== null && nativeImplementation !== void 0 ? nativeImplementation : import_SheetImplementationCustom.SheetImplementationCustom;\n if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {\n return null;\n }\n var implementation = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetImplementation, {\n ref,\n ...props\n });\n return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptCapabilities, {\n scroll: true,\n overlay: true,\n dismiss: true,\n children: implementation\n }) : implementation;\n});\nvar sheetParts = {\n Container: SheetContainer,\n Background: SheetBackground,\n Overlay: SheetOverlay,\n Handle: SheetHandle,\n ScrollView: import_SheetScrollView.SheetScrollView\n};\nvar SheetControlled = (0, import_helpers.withStaticProperties)(SheetRoot, sheetParts);\nvar Sheet = (0, import_helpers.withStaticProperties)(SheetRoot, {\n Root: SheetRoot,\n Controlled: SheetControlled,\n useAnimatedPosition: import_SheetContext.useAnimatedPosition,\n ...sheetParts\n});\n//# sourceMappingURL=Sheet.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,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAA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AS,KAAK,KAAK,GAAG,mBAAmB,eAAc,CAAE,KAAK,IAAI;CAClK,IAAI,sBAAsB,yBAAyB,QAAQ,yBAAyB,KAAK,IAAI,uBAAuB,iCAAiC;CACrJ,IAAI,0BAA0B,qBAAqB,CAAC,UAAU;EAC5D,OAAO;CACT;CACA,IAAI,iBAAiC,iBAAC,GAAG,mBAAmB,IAAG,CAAE,qBAAqB;EACpF;EACA,GAAG;CACL,CAAC;CACD,OAAO,YAA4B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,aAAa,mBAAmB;EAC7F,QAAQ;EACR,SAAS;EACT,SAAS;EACT,UAAU;CACZ,CAAC,IAAI;AACP,CAAC;AACD,IAAI,aAAa;CACf,WAAW;CACX,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,YAAY,uBAAuB;AACrC;AACA,IAAI,mBAAmB,GAAG,eAAe,qBAAoB,CAAE,WAAW,UAAU;AACpF,IAAI,SAAS,GAAG,eAAe,qBAAoB,CAAE,WAAW;CAC9D,MAAM;CACN,YAAY;CACZ,qBAAqB,oBAAoB;CACzC,GAAG;AACL,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { View } from "@tamagui/core";
|
|
2
|
+
import { PanResponder } from "@tamagui/react-native-pan-responder";
|
|
3
|
+
import { useResponderEvents } from "@tamagui/react-native-use-responder-events";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
function SheetDragSurface({ panConfig, children }) {
|
|
8
|
+
const ref = React.useRef(null);
|
|
9
|
+
const panHandlers = React.useMemo(() => panConfig ? PanResponder.create(panConfig).panHandlers : void 0, [panConfig]);
|
|
10
|
+
const { onClickCapture, ...responderHandlers } = panHandlers ?? {};
|
|
11
|
+
useResponderEvents(ref, responderHandlers);
|
|
12
|
+
const domProps = { onClickCapture };
|
|
13
|
+
return /* @__PURE__ */ jsx(View, {
|
|
14
|
+
ref,
|
|
15
|
+
...domProps,
|
|
16
|
+
flex: 1,
|
|
17
|
+
flexBasis: "auto",
|
|
18
|
+
width: "100%",
|
|
19
|
+
height: "100%",
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { SheetDragSurface };
|
|
25
|
+
//# sourceMappingURL=SheetDragSurface.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetDragSurface.js","names":[],"sources":["jsx/SheetDragSurface.js"],"sourcesContent":["import { View } from \"@tamagui/core\";\nimport { PanResponder } from \"@tamagui/react-native-pan-responder\";\nimport { useResponderEvents } from \"@tamagui/react-native-use-responder-events\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction SheetDragSurface({ panConfig, children }) {\n const ref = React.useRef(null);\n const panHandlers = React.useMemo(\n () => panConfig ? PanResponder.create(panConfig).panHandlers : void 0,\n [panConfig]\n );\n const { onClickCapture, ...responderHandlers } = panHandlers ?? {};\n useResponderEvents(ref, responderHandlers);\n const domProps = { onClickCapture };\n return (\n // flexBasis auto, like the container frame: under the web style compat\n // `flex={1}` means a basis of 0, which collapses this surface inside the\n // animated wrapper (that wrapper has no height of its own in fit mode), and\n // a collapsed surface leaves the frame unmeasured and parked off-screen\n /* @__PURE__ */ jsx(View, { ref, ...domProps, flex: 1, flexBasis: \"auto\", width: \"100%\", height: \"100%\", children })\n );\n}\nexport {\n SheetDragSurface\n};\n//# sourceMappingURL=SheetDragSurface.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,iBAAiB,EAAE,WAAW,YAAY;CACjD,MAAM,MAAM,MAAM,OAAO,IAAI;CAC7B,MAAM,cAAc,MAAM,cAClB,YAAY,aAAa,OAAO,SAAS,CAAC,CAAC,cAAc,KAAK,GACpE,CAAC,SAAS,CACZ;CACA,MAAM,EAAE,gBAAgB,GAAG,sBAAsB,eAAe,CAAC;CACjE,mBAAmB,KAAK,iBAAiB;CACzC,MAAM,WAAW,EAAE,eAAe;CAClC,OAKkB,oBAAI,MAAM;EAAE;EAAK,GAAG;EAAU,MAAM;EAAG,WAAW;EAAQ,OAAO;EAAQ,QAAQ;EAAQ;CAAS,CAAC;AAEvH"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all) __defProp(target, name, {
|
|
@@ -19,29 +21,41 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
21
|
}
|
|
20
22
|
return to;
|
|
21
23
|
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
27
|
+
}) : target, mod));
|
|
22
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
-
var
|
|
24
|
-
__export(
|
|
25
|
-
module.exports = __toCommonJS(
|
|
29
|
+
var SheetDragSurface_native_exports = {};
|
|
30
|
+
__export(SheetDragSurface_native_exports, { SheetDragSurface: () => SheetDragSurface });
|
|
31
|
+
module.exports = __toCommonJS(SheetDragSurface_native_exports);
|
|
26
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var React = __toESM(require("react"), 1);
|
|
27
34
|
var import_react_native = require("react-native");
|
|
28
35
|
var import_gestureState = require("./gestureState.native.js");
|
|
29
|
-
function
|
|
30
|
-
var {
|
|
36
|
+
function SheetDragSurface(param) {
|
|
37
|
+
var { gestureHandlerEnabled, panGesture, panConfig, children } = param;
|
|
31
38
|
var { GestureDetector } = (0, import_gestureState.getGestureHandlerState)();
|
|
32
|
-
var
|
|
33
|
-
|
|
39
|
+
var panHandlers = React.useMemo(function() {
|
|
40
|
+
return panConfig ? import_react_native.PanResponder.create(panConfig).panHandlers : void 0;
|
|
41
|
+
}, [panConfig]);
|
|
42
|
+
if (gestureHandlerEnabled && panGesture && GestureDetector) {
|
|
34
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GestureDetector, {
|
|
35
|
-
gesture,
|
|
44
|
+
gesture: panGesture,
|
|
36
45
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
37
|
-
style,
|
|
46
|
+
style: { flex: 1 },
|
|
38
47
|
collapsable: false,
|
|
39
48
|
children
|
|
40
49
|
})
|
|
41
50
|
});
|
|
42
51
|
}
|
|
43
52
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
44
|
-
|
|
53
|
+
...panHandlers,
|
|
54
|
+
style: {
|
|
55
|
+
flex: 1,
|
|
56
|
+
width: "100%",
|
|
57
|
+
height: "100%"
|
|
58
|
+
},
|
|
45
59
|
children
|
|
46
60
|
});
|
|
47
61
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all) __defProp(target, name, {
|
|
@@ -19,29 +21,43 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
21
|
}
|
|
20
22
|
return to;
|
|
21
23
|
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
27
|
+
}) : target, mod));
|
|
22
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
-
var
|
|
24
|
-
__export(
|
|
25
|
-
module.exports = __toCommonJS(
|
|
29
|
+
var SheetDragSurface_native_exports = {};
|
|
30
|
+
__export(SheetDragSurface_native_exports, { SheetDragSurface: () => SheetDragSurface });
|
|
31
|
+
module.exports = __toCommonJS(SheetDragSurface_native_exports);
|
|
26
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var React = __toESM(require("react"), 1);
|
|
27
34
|
var import_react_native = require("react-native");
|
|
28
35
|
var import_gestureState = require("./gestureState.native.js");
|
|
29
|
-
function
|
|
30
|
-
var {
|
|
36
|
+
function SheetDragSurface(param) {
|
|
37
|
+
var { gestureHandlerEnabled, panGesture, panConfig, children } = param;
|
|
31
38
|
var { GestureDetector } = (0, import_gestureState.getGestureHandlerState)();
|
|
32
|
-
var
|
|
33
|
-
|
|
39
|
+
var panHandlers = React.useMemo(function() {
|
|
40
|
+
return panConfig ? import_react_native.PanResponder.create(panConfig).panHandlers : void 0;
|
|
41
|
+
}, [panConfig]);
|
|
42
|
+
if (gestureHandlerEnabled && panGesture && GestureDetector) {
|
|
34
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GestureDetector, {
|
|
35
|
-
gesture,
|
|
44
|
+
gesture: panGesture,
|
|
36
45
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
37
|
-
style,
|
|
46
|
+
style: { flex: 1 },
|
|
38
47
|
collapsable: false,
|
|
39
48
|
children
|
|
40
49
|
})
|
|
41
50
|
});
|
|
42
51
|
}
|
|
43
52
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
44
|
-
|
|
53
|
+
...panHandlers,
|
|
54
|
+
style: {
|
|
55
|
+
flex: 1,
|
|
56
|
+
width: "100%",
|
|
57
|
+
height: "100%"
|
|
58
|
+
},
|
|
45
59
|
children
|
|
46
60
|
});
|
|
47
61
|
}
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=SheetDragSurface.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetDragSurface.native.js","names":[],"sources":["jsx/SheetDragSurface.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 SheetDragSurface_native_exports = {};\n__export(SheetDragSurface_native_exports, {\n SheetDragSurface: () => SheetDragSurface\n});\nmodule.exports = __toCommonJS(SheetDragSurface_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_gestureState = require(\"./gestureState\");\nfunction SheetDragSurface(param) {\n var { gestureHandlerEnabled, panGesture, panConfig, children } = param;\n var { GestureDetector } = (0, import_gestureState.getGestureHandlerState)();\n var panHandlers = React.useMemo(function() {\n return panConfig ? import_react_native.PanResponder.create(panConfig).panHandlers : void 0;\n }, [\n panConfig\n ]);\n if (gestureHandlerEnabled && panGesture && GestureDetector) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GestureDetector, {\n gesture: panGesture,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {\n style: {\n flex: 1\n },\n collapsable: false,\n children\n })\n });\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {\n ...panHandlers,\n style: {\n flex: 1,\n width: \"100%\",\n height: \"100%\"\n },\n children\n });\n}\n//# sourceMappingURL=SheetDragSurface.native.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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}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { AnimatePresence } from "@tamagui/animate-presence";
|
|
2
|
+
import { getTransitionResolver } from "@tamagui/animation-helpers/transitionResolver";
|
|
2
3
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
4
|
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
4
5
|
import { LayoutMeasurementController, View, createRefComponent, formatDiagnostic, useAnimatedNumber, useAnimatedNumberStyle, useAnimationDriver, useDidFinishSSR, useEvent, useThemeName } from "@tamagui/core";
|
|
5
6
|
import { Portal, needsPortalRepropagation } from "@tamagui/portal";
|
|
6
7
|
import React, { useState } from "react";
|
|
7
|
-
import { Dimensions, PanResponder, View as View$1 } from "react-native-web";
|
|
8
8
|
import { ParentSheetContext, SheetInsideSheetContext } from "./contexts.mjs";
|
|
9
9
|
import { SHEET_OVERLAY_MARKER } from "./constants.mjs";
|
|
10
|
-
import { GestureDetectorWrapper } from "./GestureDetectorWrapper.mjs";
|
|
11
10
|
import { getGestureHandlerState } from "./gestureState.mjs";
|
|
11
|
+
import { SheetDragSurface } from "./SheetDragSurface.mjs";
|
|
12
|
+
import { getStableViewportHeight } from "./stableViewportHeight.mjs";
|
|
12
13
|
import { GestureSheetProvider } from "./GestureSheetContext.mjs";
|
|
13
14
|
import { resisted } from "./helpers.mjs";
|
|
14
15
|
import { getKeyboardAdjustedSheetY, getKeyboardOccludedHeight, getSheetReleasePosition } from "./keyboardAvoidance.mjs";
|
|
15
|
-
import { MIN_KEYBOARD_HEIGHT, getMaxViewportHeight,
|
|
16
|
+
import { MIN_KEYBOARD_HEIGHT, getMaxViewportHeight, getWebKeyboardResizeHeight, getWebVisualViewportOffsetTop } from "./webViewport.mjs";
|
|
16
17
|
import { SheetAnimatedPositionContext, SheetOverlayLayerContext, SheetProvider } from "./SheetContext.mjs";
|
|
17
18
|
import { useGestureHandlerPan } from "./useGestureHandlerPan.mjs";
|
|
18
19
|
import { useKeyboardControllerSheet } from "./useKeyboardControllerSheet.mjs";
|
|
@@ -32,11 +33,6 @@ const rnghRootStyleClosed = {
|
|
|
32
33
|
};
|
|
33
34
|
let sheetHiddenStyleSheet = null;
|
|
34
35
|
const sheetEscapeLayers = [];
|
|
35
|
-
const relativeDimensionTo = isWeb ? "window" : "screen";
|
|
36
|
-
function getStableViewportHeight() {
|
|
37
|
-
if (isWeb && typeof window !== "undefined") return getStableLayoutViewportHeight();
|
|
38
|
-
return Dimensions.get(relativeDimensionTo).height;
|
|
39
|
-
}
|
|
40
36
|
const SheetImplementationCustom = createRefComponent(function SheetImplementationCustom2(props, forwardedRef) {
|
|
41
37
|
const parentSheet = React.useContext(ParentSheetContext);
|
|
42
38
|
const safeAreaTopInset = useSafeAreaInsets()?.top ?? 0;
|
|
@@ -51,16 +47,18 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
51
47
|
const animationDriver = useAnimationDriver();
|
|
52
48
|
const transitionConfig = (() => {
|
|
53
49
|
if (transitionConfigProp) return transitionConfigProp;
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
const timing = (transition ? getTransitionResolver()?.resolve(transition, { animations: animationDriver.animations }) : null)?.all?.timing;
|
|
51
|
+
if (!timing) return null;
|
|
52
|
+
if (timing.kind === "timing") return {
|
|
53
|
+
type: "timing",
|
|
54
|
+
duration: timing.durationMs
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
type: "spring",
|
|
58
|
+
stiffness: timing.stiffness,
|
|
59
|
+
damping: timing.damping,
|
|
60
|
+
mass: timing.mass
|
|
61
|
+
};
|
|
64
62
|
})();
|
|
65
63
|
const [isShowingInnerSheet, setIsShowingInnerSheet] = React.useState(false);
|
|
66
64
|
const shouldHideParentSheet = !isWeb && modal && isShowingInnerSheet && needsPortalRepropagation();
|
|
@@ -274,15 +272,11 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
274
272
|
useIsomorphicLayoutEffect(() => {
|
|
275
273
|
if (hasntMeasured && screenSize && frameSize) {
|
|
276
274
|
at.current = screenSize;
|
|
277
|
-
animatedNumber.setValue(screenSize, {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
setTimeout(() => {
|
|
283
|
-
setDisableAnimation(false);
|
|
284
|
-
}, 10);
|
|
285
|
-
});
|
|
275
|
+
animatedNumber.setValue(screenSize, { type: "direct" });
|
|
276
|
+
syncAnimatedPosition(screenSize);
|
|
277
|
+
setTimeout(() => {
|
|
278
|
+
setDisableAnimation(false);
|
|
279
|
+
}, 10);
|
|
286
280
|
return;
|
|
287
281
|
}
|
|
288
282
|
if (disableAnimation) return;
|
|
@@ -316,10 +310,10 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
316
310
|
const disableDrag = props.disableDrag ?? controller?.disableDrag;
|
|
317
311
|
useThemeName();
|
|
318
312
|
const [blockPan, setBlockPan] = React.useState(false);
|
|
319
|
-
const
|
|
320
|
-
if (disableDrag) return;
|
|
321
|
-
if (!frameSize) return;
|
|
322
|
-
if (isShowingInnerSheet) return;
|
|
313
|
+
const panConfig = React.useMemo(() => {
|
|
314
|
+
if (disableDrag) return null;
|
|
315
|
+
if (!frameSize) return null;
|
|
316
|
+
if (isShowingInnerSheet) return null;
|
|
323
317
|
const minY = activePositions[0];
|
|
324
318
|
scrollBridge.paneMinY = minY;
|
|
325
319
|
let startY = at.current;
|
|
@@ -403,7 +397,7 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
403
397
|
setPosition(positionIndex);
|
|
404
398
|
animateTo(positionIndex);
|
|
405
399
|
};
|
|
406
|
-
return
|
|
400
|
+
return {
|
|
407
401
|
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
408
402
|
onPanResponderTerminationRequest: () => false,
|
|
409
403
|
onPanResponderGrant: grant,
|
|
@@ -416,7 +410,7 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
416
410
|
onPanResponderEnd: finish,
|
|
417
411
|
onPanResponderTerminate: finish,
|
|
418
412
|
onPanResponderRelease: finish
|
|
419
|
-
}
|
|
413
|
+
};
|
|
420
414
|
}, [
|
|
421
415
|
disableDrag,
|
|
422
416
|
isShowingInnerSheet,
|
|
@@ -560,16 +554,11 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
560
554
|
children: shouldHideParentSheet || !open ? null : overlayChildren
|
|
561
555
|
})
|
|
562
556
|
}),
|
|
563
|
-
snapPointsMode !== "percent" && /* @__PURE__ */ jsx(View
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
left: 0,
|
|
569
|
-
right: 0,
|
|
570
|
-
bottom: 0,
|
|
571
|
-
pointerEvents: "none"
|
|
572
|
-
},
|
|
557
|
+
snapPointsMode !== "percent" && /* @__PURE__ */ jsx(View, {
|
|
558
|
+
opacity: 0,
|
|
559
|
+
position: "absolute",
|
|
560
|
+
inset: 0,
|
|
561
|
+
pointerEvents: "none",
|
|
573
562
|
onLayout: handleMaxContentViewLayout
|
|
574
563
|
}),
|
|
575
564
|
/* @__PURE__ */ jsx(AnimatedView, {
|
|
@@ -586,17 +575,10 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
586
575
|
...applyHidden && { display: "none" },
|
|
587
576
|
...(shouldHideParentSheet || !open) && { pointerEvents: "none" }
|
|
588
577
|
}, animatedStyle],
|
|
589
|
-
children:
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}) : /* @__PURE__ */ jsx(View$1, {
|
|
594
|
-
...panResponder?.panHandlers,
|
|
595
|
-
style: {
|
|
596
|
-
flex: 1,
|
|
597
|
-
width: "100%",
|
|
598
|
-
height: "100%"
|
|
599
|
-
},
|
|
578
|
+
children: /* @__PURE__ */ jsx(SheetDragSurface, {
|
|
579
|
+
gestureHandlerEnabled,
|
|
580
|
+
panGesture,
|
|
581
|
+
panConfig,
|
|
600
582
|
children: animatedChildren
|
|
601
583
|
})
|
|
602
584
|
})
|
|
@@ -608,13 +590,14 @@ const SheetImplementationCustom = createRefComponent(function SheetImplementatio
|
|
|
608
590
|
});
|
|
609
591
|
const shouldMountChildren = unmountChildrenWhenHidden ? !isFullyClosed : true;
|
|
610
592
|
if (modal) {
|
|
593
|
+
if (!shouldMountChildren) return null;
|
|
611
594
|
const RNGHRoot = getGestureHandlerState().RootView;
|
|
612
|
-
const mountedContents =
|
|
595
|
+
const mountedContents = /* @__PURE__ */ jsx(ContainerComponent, { children: contents });
|
|
613
596
|
const modalContents = /* @__PURE__ */ jsx(Portal, {
|
|
614
597
|
stackZIndex: zIndex,
|
|
615
598
|
hidden: !isVisuallyActive,
|
|
616
599
|
...portalProps,
|
|
617
|
-
children:
|
|
600
|
+
children: RNGHRoot ? /* @__PURE__ */ jsx(RNGHRoot, {
|
|
618
601
|
style: open ? rnghRootStyleOpen : rnghRootStyleClosed,
|
|
619
602
|
children: mountedContents
|
|
620
603
|
}) : mountedContents
|