@tamagui/sheet 3.0.0-beta.924.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +68 -164
- 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 -1
- 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 +5 -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":"useSheetProviderProps.native.js","names":[],"sources":["cjs/useSheetProviderProps.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 useSheetProviderProps_exports = {};\n__export(useSheetProviderProps_exports, {\n useSheetProviderProps: () => useSheetProviderProps\n});\nmodule.exports = __toCommonJS(useSheetProviderProps_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_core = require(\"@tamagui/core\");\nvar import_use_constant = require(\"@tamagui/use-constant\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nfunction useSheetProviderProps(props, state) {\n var handleRef = import_react.default.useRef(null);\n var contentRef = import_react.default.useRef(null);\n var [frameSize, setFrameSize] = import_react.default.useState(0);\n var [maxContentSize, setMaxContentSize] = import_react.default.useState(0);\n var _props_snapPointsMode;\n var snapPointsMode = (_props_snapPointsMode = props.snapPointsMode) !== null && _props_snapPointsMode !== void 0 ? _props_snapPointsMode : \"percent\";\n var _props_snapPoints;\n var snapPointsProp = (_props_snapPoints = props.snapPoints) !== null && _props_snapPoints !== void 0 ? _props_snapPoints : snapPointsMode === \"percent\" ? [\n 80\n ] : snapPointsMode === \"constant\" ? [\n 256\n ] : [\n \"fit\"\n ];\n var hasFit = snapPointsProp[0] === \"fit\";\n var snapPoints = import_react.default.useMemo(function() {\n return props.dismissOnSnapToBottom ? [\n ...snapPointsProp,\n 0\n ] : snapPointsProp;\n }, [\n JSON.stringify(snapPointsProp),\n props.dismissOnSnapToBottom\n ]);\n var [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({\n prop: props.position,\n defaultProp: props.defaultPosition || (state.open ? 0 : -1),\n onChange: props.onPositionChange,\n strategy: \"most-recent-wins\"\n });\n var position = state.open === false ? -1 : position_;\n var { open } = state;\n var setPosition = import_react.default.useCallback(function(next) {\n if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {\n state.setOpen(false);\n } else {\n setPositionImmediate(next);\n }\n }, [\n props.dismissOnSnapToBottom,\n snapPoints.length,\n setPositionImmediate,\n state.setOpen\n ]);\n if (process.env.NODE_ENV === \"development\") {\n if (snapPointsMode === \"mixed\" && snapPoints.some(function(p) {\n if (typeof p === \"string\") {\n if (p === \"fit\") {\n return false;\n }\n if (p.endsWith(\"%\")) {\n var n = Number(p.slice(0, -1));\n return n < 0 || n > 100;\n }\n return true;\n }\n return typeof p !== \"number\" || p < 0;\n })) {\n console.warn('\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed');\n }\n if (snapPointsMode === \"mixed\" && snapPoints.indexOf(\"fit\") > 0) {\n console.warn('\\u26A0\\uFE0F Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed');\n }\n if (snapPointsMode === \"fit\" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== \"fit\")) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, there are no snap points when snapPointsMode is fit\");\n }\n if (snapPointsMode === \"constant\" && snapPoints.some(function(p) {\n return typeof p !== \"number\" || p < 0;\n })) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant\");\n }\n if (snapPointsMode === \"percent\" && snapPoints.some(function(p) {\n return typeof p !== \"number\" || p < 0 || p > 100;\n })) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent\");\n }\n }\n if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {\n setPositionImmediate(0);\n }\n var shouldSetPositionOpen = open && position < 0;\n import_react.default.useEffect(function() {\n if (shouldSetPositionOpen) {\n setPosition(0);\n }\n }, [\n setPosition,\n shouldSetPositionOpen\n ]);\n var { animationDriver } = (0, import_core.useConfiguration)();\n if (!animationDriver) {\n throw new Error(process.env.NODE_ENV === \"production\" ? `\\u274C 008` : \"Must set animations in tamagui.config.ts\");\n }\n var scrollBridge = (0, import_use_constant.useConstant)(function() {\n var parentDragListeners = /* @__PURE__ */ new Set();\n var bridge = {\n hasScrollableContent: false,\n enabled: false,\n y: 0,\n paneY: 0,\n paneMinY: 0,\n scrollStartY: -1,\n drag: function() {\n },\n release: function() {\n },\n scrollLock: false,\n isParentDragging: false,\n onParentDragging: function(cb) {\n parentDragListeners.add(cb);\n return function() {\n parentDragListeners.delete(cb);\n };\n },\n setParentDragging: function(val) {\n if (val !== bridge.isParentDragging) {\n bridge.isParentDragging = val;\n parentDragListeners.forEach(function(cb) {\n return cb(val);\n });\n }\n }\n };\n return bridge;\n });\n var disableRemoveScroll = props.disableRemoveScroll || !open || !props.modal;\n var maxSnapPoint = snapPoints[0];\n var screenSize = snapPointsMode === \"percent\" ? frameSize / ((typeof maxSnapPoint === \"number\" ? maxSnapPoint : 100) / 100) : maxContentSize;\n var _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, _props_scope;\n var providerProps = {\n screenSize,\n maxSnapPoint,\n disableRemoveScroll,\n scrollBridge,\n modal: !!props.modal,\n open: state.open,\n setOpen: state.setOpen,\n hidden: !!state.isHidden,\n contentRef,\n handleRef,\n frameSize,\n setFrameSize,\n dismissOnOverlayPress: (_props_dismissOnOverlayPress = props.dismissOnOverlayPress) !== null && _props_dismissOnOverlayPress !== void 0 ? _props_dismissOnOverlayPress : true,\n dismissOnSnapToBottom: (_props_dismissOnSnapToBottom = props.dismissOnSnapToBottom) !== null && _props_dismissOnSnapToBottom !== void 0 ? _props_dismissOnSnapToBottom : false,\n scope: (_props_scope = props.scope) !== null && _props_scope !== void 0 ? _props_scope : \"\",\n hasFit,\n position,\n snapPoints,\n snapPointsMode,\n setMaxContentSize,\n setPosition,\n setPositionImmediate,\n onlyShowContainer: false\n };\n return providerProps;\n}\n//# sourceMappingURL=useSheetProviderProps.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,M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BAAoB,OAAO,EAAE;IAC/B;GACF;GACA,mBAAmB,SAAS,KAAK;IAC/B,IAAI,QAAQ,OAAO,kBAAkB;KACnC,OAAO,mBAAmB;KAC1B,oBAAoB,QAAQ,SAAS,IAAI;MACvC,OAAO,GAAG,GAAG;KACf,CAAC;IACH;GACF;EACF;EACA,OAAO;CACT,CAAC;CACD,IAAI,sBAAsB,MAAM,uBAAuB,CAAC,QAAQ,CAAC,MAAM;CACvE,IAAI,eAAe,WAAW;CAC9B,IAAI,aAAa,mBAAmB,YAAY,cAAc,OAAO,iBAAiB,WAAW,eAAe,OAAO,OAAO;CAC9H,IAAI,8BAA8B,8BAA8B;CAChE,IAAI,gBAAgB;EAClB;EACA;EACA;EACA;EACA,OAAO,CAAC,CAAC,MAAM;EACf,MAAM,MAAM;EACZ,SAAS,MAAM;EACf,QAAQ,CAAC,CAAC,MAAM;EAChB;EACA;EACA;EACA;EACA,wBAAwB,+BAA+B,MAAM,2BAA2B,QAAQ,iCAAiC,KAAK,IAAI,+BAA+B;EACzK,wBAAwB,+BAA+B,MAAM,2BAA2B,QAAQ,iCAAiC,KAAK,IAAI,+BAA+B;EACzK,QAAQ,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,eAAe;EACzF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mBAAmB;CACrB;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"useSheetProviderProps.native.js","names":[],"sources":["cjs/useSheetProviderProps.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 useSheetProviderProps_exports = {};\n__export(useSheetProviderProps_exports, {\n useSheetProviderProps: () => useSheetProviderProps\n});\nmodule.exports = __toCommonJS(useSheetProviderProps_exports);\nvar import_core = require(\"@tamagui/core\");\nvar import_use_constant = require(\"@tamagui/use-constant\");\nvar import_useSheetState = require(\"./useSheetState\");\nfunction useSheetProviderProps(props, state) {\n var { maxContentSize, ...sheetState } = (0, import_useSheetState.useSheetState)(props, state);\n var { frameSize, snapPointsMode, snapPoints, open } = sheetState;\n var { animationDriver } = (0, import_core.useConfiguration)();\n if (!animationDriver) {\n throw new Error(process.env.NODE_ENV === \"production\" ? `\\u274C 008` : \"Must set animations in tamagui.config.ts\");\n }\n var scrollBridge = (0, import_use_constant.useConstant)(function() {\n var parentDragListeners = /* @__PURE__ */ new Set();\n var bridge = {\n hasScrollableContent: false,\n enabled: false,\n y: 0,\n paneY: 0,\n paneMinY: 0,\n scrollStartY: -1,\n drag: function() {\n },\n release: function() {\n },\n scrollLock: false,\n isParentDragging: false,\n onParentDragging: function(cb) {\n parentDragListeners.add(cb);\n return function() {\n parentDragListeners.delete(cb);\n };\n },\n setParentDragging: function(val) {\n if (val !== bridge.isParentDragging) {\n bridge.isParentDragging = val;\n parentDragListeners.forEach(function(cb) {\n return cb(val);\n });\n }\n }\n };\n return bridge;\n });\n var disableRemoveScroll = props.disableRemoveScroll || !open || !props.modal;\n var maxSnapPoint = snapPoints[0];\n var screenSize = snapPointsMode === \"percent\" ? frameSize / ((typeof maxSnapPoint === \"number\" ? maxSnapPoint : 100) / 100) : maxContentSize;\n return {\n ...sheetState,\n screenSize,\n maxSnapPoint,\n disableRemoveScroll,\n scrollBridge,\n onlyShowContainer: false\n };\n}\n//# sourceMappingURL=useSheetProviderProps.js.map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CAAE,WAAW;EACjE,IAAI,sCAAsC,IAAI,IAAI;EAClD,IAAI,SAAS;GACX,sBAAsB;GACtB,SAAS;GACT,GAAG;GACH,OAAO;GACP,UAAU;GACV,cAAc,CAAC;GACf,MAAM,WAAW,CACjB;GACA,SAAS,WAAW,CACpB;GACA,YAAY;GACZ,kBAAkB;GAClB,kBAAkB,SAAS,IAAI;IAC7B,oBAAoB,IAAI,EAAE;IAC1B,OAAO,WAAW;KAChB,oBAAoB,OAAO,EAAE;IAC/B;GACF;GACA,mBAAmB,SAAS,KAAK;IAC/B,IAAI,QAAQ,OAAO,kBAAkB;KACnC,OAAO,mBAAmB;KAC1B,oBAAoB,QAAQ,SAAS,IAAI;MACvC,OAAO,GAAG,GAAG;KACf,CAAC;IACH;GACF;EACF;EACA,OAAO;CACT,CAAC;CACD,IAAI,sBAAsB,MAAM,uBAAuB,CAAC,QAAQ,CAAC,MAAM;CACvE,IAAI,eAAe,WAAW;CAC9B,IAAI,aAAa,mBAAmB,YAAY,cAAc,OAAO,iBAAiB,WAAW,eAAe,OAAO,OAAO;CAC9H,OAAO;EACL,GAAG;EACH;EACA;EACA;EACA;EACA,mBAAmB;CACrB;AACF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var useSheetState_exports = {};
|
|
28
|
+
__export(useSheetState_exports, { useSheetState: () => useSheetState });
|
|
29
|
+
module.exports = __toCommonJS(useSheetState_exports);
|
|
30
|
+
var import_react = __toESM(require("react"), 1);
|
|
31
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
32
|
+
function useSheetState(props, state) {
|
|
33
|
+
const handleRef = import_react.default.useRef(null);
|
|
34
|
+
const contentRef = import_react.default.useRef(null);
|
|
35
|
+
const [frameSize, setFrameSize] = import_react.default.useState(0);
|
|
36
|
+
const [maxContentSize, setMaxContentSize] = import_react.default.useState(0);
|
|
37
|
+
const snapPointsMode = props.snapPointsMode ?? "percent";
|
|
38
|
+
const snapPointsProp = props.snapPoints ?? (snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"]);
|
|
39
|
+
const hasFit = snapPointsProp[0] === "fit";
|
|
40
|
+
const snapPoints = import_react.default.useMemo(() => props.dismissOnSnapToBottom ? [...snapPointsProp, 0] : snapPointsProp, [JSON.stringify(snapPointsProp), props.dismissOnSnapToBottom]);
|
|
41
|
+
const [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({
|
|
42
|
+
prop: props.position,
|
|
43
|
+
defaultProp: props.defaultPosition || (state.open ? 0 : -1),
|
|
44
|
+
onChange: props.onPositionChange,
|
|
45
|
+
strategy: state.strategy
|
|
46
|
+
});
|
|
47
|
+
const position = state.open === false ? -1 : position_;
|
|
48
|
+
const { open } = state;
|
|
49
|
+
const setPosition = import_react.default.useCallback((next) => {
|
|
50
|
+
if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {
|
|
51
|
+
state.setOpen(false);
|
|
52
|
+
} else {
|
|
53
|
+
setPositionImmediate(next);
|
|
54
|
+
}
|
|
55
|
+
}, [
|
|
56
|
+
props.dismissOnSnapToBottom,
|
|
57
|
+
snapPoints.length,
|
|
58
|
+
setPositionImmediate,
|
|
59
|
+
state.setOpen
|
|
60
|
+
]);
|
|
61
|
+
if (process.env.NODE_ENV === "development") {
|
|
62
|
+
if (snapPointsMode === "mixed" && snapPoints.some((p) => {
|
|
63
|
+
if (typeof p === "string") {
|
|
64
|
+
if (p === "fit") {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (p.endsWith("%")) {
|
|
68
|
+
const n = Number(p.slice(0, -1));
|
|
69
|
+
return n < 0 || n > 100;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return typeof p !== "number" || p < 0;
|
|
74
|
+
})) {
|
|
75
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed");
|
|
76
|
+
}
|
|
77
|
+
if (snapPointsMode === "mixed" && snapPoints.indexOf("fit") > 0) {
|
|
78
|
+
console.warn("⚠️ Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed");
|
|
79
|
+
}
|
|
80
|
+
if (snapPointsMode === "fit" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== "fit")) {
|
|
81
|
+
console.warn("⚠️ Invalid snapPoint given, there are no snap points when snapPointsMode is fit");
|
|
82
|
+
}
|
|
83
|
+
if (snapPointsMode === "constant" && snapPoints.some((p) => typeof p !== "number" || p < 0)) {
|
|
84
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant");
|
|
85
|
+
}
|
|
86
|
+
if (snapPointsMode === "percent" && snapPoints.some((p) => typeof p !== "number" || p < 0 || p > 100)) {
|
|
87
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {
|
|
91
|
+
setPositionImmediate(0);
|
|
92
|
+
}
|
|
93
|
+
const shouldSetPositionOpen = open && position < 0;
|
|
94
|
+
import_react.default.useEffect(() => {
|
|
95
|
+
if (shouldSetPositionOpen) {
|
|
96
|
+
setPosition(0);
|
|
97
|
+
}
|
|
98
|
+
}, [setPosition, shouldSetPositionOpen]);
|
|
99
|
+
return {
|
|
100
|
+
modal: !!props.modal,
|
|
101
|
+
open: state.open,
|
|
102
|
+
setOpen: state.setOpen,
|
|
103
|
+
hidden: !!state.isHidden,
|
|
104
|
+
contentRef,
|
|
105
|
+
handleRef,
|
|
106
|
+
frameSize,
|
|
107
|
+
setFrameSize,
|
|
108
|
+
maxContentSize,
|
|
109
|
+
dismissOnOverlayPress: props.dismissOnOverlayPress ?? true,
|
|
110
|
+
dismissOnSnapToBottom: props.dismissOnSnapToBottom ?? false,
|
|
111
|
+
scope: props.scope ?? "",
|
|
112
|
+
hasFit,
|
|
113
|
+
position,
|
|
114
|
+
snapPoints,
|
|
115
|
+
snapPointsMode,
|
|
116
|
+
setMaxContentSize,
|
|
117
|
+
setPosition,
|
|
118
|
+
setPositionImmediate
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
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));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useSheetState_exports = {};
|
|
30
|
+
__export(useSheetState_exports, { useSheetState: () => useSheetState });
|
|
31
|
+
module.exports = __toCommonJS(useSheetState_exports);
|
|
32
|
+
var import_react = __toESM(require("react"), 1);
|
|
33
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
34
|
+
function useSheetState(props, state) {
|
|
35
|
+
var handleRef = import_react.default.useRef(null);
|
|
36
|
+
var contentRef = import_react.default.useRef(null);
|
|
37
|
+
var [frameSize, setFrameSize] = import_react.default.useState(0);
|
|
38
|
+
var [maxContentSize, setMaxContentSize] = import_react.default.useState(0);
|
|
39
|
+
var _props_snapPointsMode;
|
|
40
|
+
var snapPointsMode = (_props_snapPointsMode = props.snapPointsMode) !== null && _props_snapPointsMode !== void 0 ? _props_snapPointsMode : "percent";
|
|
41
|
+
var _props_snapPoints;
|
|
42
|
+
var snapPointsProp = (_props_snapPoints = props.snapPoints) !== null && _props_snapPoints !== void 0 ? _props_snapPoints : snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"];
|
|
43
|
+
var hasFit = snapPointsProp[0] === "fit";
|
|
44
|
+
var snapPoints = import_react.default.useMemo(function() {
|
|
45
|
+
return props.dismissOnSnapToBottom ? [...snapPointsProp, 0] : snapPointsProp;
|
|
46
|
+
}, [JSON.stringify(snapPointsProp), props.dismissOnSnapToBottom]);
|
|
47
|
+
var [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({
|
|
48
|
+
prop: props.position,
|
|
49
|
+
defaultProp: props.defaultPosition || (state.open ? 0 : -1),
|
|
50
|
+
onChange: props.onPositionChange,
|
|
51
|
+
strategy: state.strategy
|
|
52
|
+
});
|
|
53
|
+
var position = state.open === false ? -1 : position_;
|
|
54
|
+
var { open } = state;
|
|
55
|
+
var setPosition = import_react.default.useCallback(function(next) {
|
|
56
|
+
if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {
|
|
57
|
+
state.setOpen(false);
|
|
58
|
+
} else {
|
|
59
|
+
setPositionImmediate(next);
|
|
60
|
+
}
|
|
61
|
+
}, [
|
|
62
|
+
props.dismissOnSnapToBottom,
|
|
63
|
+
snapPoints.length,
|
|
64
|
+
setPositionImmediate,
|
|
65
|
+
state.setOpen
|
|
66
|
+
]);
|
|
67
|
+
if (process.env.NODE_ENV === "development") {
|
|
68
|
+
if (snapPointsMode === "mixed" && snapPoints.some(function(p) {
|
|
69
|
+
if (typeof p === "string") {
|
|
70
|
+
if (p === "fit") {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (p.endsWith("%")) {
|
|
74
|
+
var n = Number(p.slice(0, -1));
|
|
75
|
+
return n < 0 || n > 100;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return typeof p !== "number" || p < 0;
|
|
80
|
+
})) {
|
|
81
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed");
|
|
82
|
+
}
|
|
83
|
+
if (snapPointsMode === "mixed" && snapPoints.indexOf("fit") > 0) {
|
|
84
|
+
console.warn("⚠️ Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed");
|
|
85
|
+
}
|
|
86
|
+
if (snapPointsMode === "fit" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== "fit")) {
|
|
87
|
+
console.warn("⚠️ Invalid snapPoint given, there are no snap points when snapPointsMode is fit");
|
|
88
|
+
}
|
|
89
|
+
if (snapPointsMode === "constant" && snapPoints.some(function(p) {
|
|
90
|
+
return typeof p !== "number" || p < 0;
|
|
91
|
+
})) {
|
|
92
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant");
|
|
93
|
+
}
|
|
94
|
+
if (snapPointsMode === "percent" && snapPoints.some(function(p) {
|
|
95
|
+
return typeof p !== "number" || p < 0 || p > 100;
|
|
96
|
+
})) {
|
|
97
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {
|
|
101
|
+
setPositionImmediate(0);
|
|
102
|
+
}
|
|
103
|
+
var shouldSetPositionOpen = open && position < 0;
|
|
104
|
+
import_react.default.useEffect(function() {
|
|
105
|
+
if (shouldSetPositionOpen) {
|
|
106
|
+
setPosition(0);
|
|
107
|
+
}
|
|
108
|
+
}, [setPosition, shouldSetPositionOpen]);
|
|
109
|
+
var _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, _props_scope;
|
|
110
|
+
return {
|
|
111
|
+
modal: !!props.modal,
|
|
112
|
+
open: state.open,
|
|
113
|
+
setOpen: state.setOpen,
|
|
114
|
+
hidden: !!state.isHidden,
|
|
115
|
+
contentRef,
|
|
116
|
+
handleRef,
|
|
117
|
+
frameSize,
|
|
118
|
+
setFrameSize,
|
|
119
|
+
maxContentSize,
|
|
120
|
+
dismissOnOverlayPress: (_props_dismissOnOverlayPress = props.dismissOnOverlayPress) !== null && _props_dismissOnOverlayPress !== void 0 ? _props_dismissOnOverlayPress : true,
|
|
121
|
+
dismissOnSnapToBottom: (_props_dismissOnSnapToBottom = props.dismissOnSnapToBottom) !== null && _props_dismissOnSnapToBottom !== void 0 ? _props_dismissOnSnapToBottom : false,
|
|
122
|
+
scope: (_props_scope = props.scope) !== null && _props_scope !== void 0 ? _props_scope : "",
|
|
123
|
+
hasFit,
|
|
124
|
+
position,
|
|
125
|
+
snapPoints,
|
|
126
|
+
snapPointsMode,
|
|
127
|
+
setMaxContentSize,
|
|
128
|
+
setPosition,
|
|
129
|
+
setPositionImmediate
|
|
130
|
+
};
|
|
131
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
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));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useSheetState_exports = {};
|
|
30
|
+
__export(useSheetState_exports, { useSheetState: () => useSheetState });
|
|
31
|
+
module.exports = __toCommonJS(useSheetState_exports);
|
|
32
|
+
var import_react = __toESM(require("react"), 1);
|
|
33
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
34
|
+
function useSheetState(props, state) {
|
|
35
|
+
var handleRef = import_react.default.useRef(null);
|
|
36
|
+
var contentRef = import_react.default.useRef(null);
|
|
37
|
+
var [frameSize, setFrameSize] = import_react.default.useState(0);
|
|
38
|
+
var [maxContentSize, setMaxContentSize] = import_react.default.useState(0);
|
|
39
|
+
var _props_snapPointsMode;
|
|
40
|
+
var snapPointsMode = (_props_snapPointsMode = props.snapPointsMode) !== null && _props_snapPointsMode !== void 0 ? _props_snapPointsMode : "percent";
|
|
41
|
+
var _props_snapPoints;
|
|
42
|
+
var snapPointsProp = (_props_snapPoints = props.snapPoints) !== null && _props_snapPoints !== void 0 ? _props_snapPoints : snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"];
|
|
43
|
+
var hasFit = snapPointsProp[0] === "fit";
|
|
44
|
+
var snapPoints = import_react.default.useMemo(function() {
|
|
45
|
+
return props.dismissOnSnapToBottom ? [...snapPointsProp, 0] : snapPointsProp;
|
|
46
|
+
}, [JSON.stringify(snapPointsProp), props.dismissOnSnapToBottom]);
|
|
47
|
+
var [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({
|
|
48
|
+
prop: props.position,
|
|
49
|
+
defaultProp: props.defaultPosition || (state.open ? 0 : -1),
|
|
50
|
+
onChange: props.onPositionChange,
|
|
51
|
+
strategy: state.strategy
|
|
52
|
+
});
|
|
53
|
+
var position = state.open === false ? -1 : position_;
|
|
54
|
+
var { open } = state;
|
|
55
|
+
var setPosition = import_react.default.useCallback(function(next) {
|
|
56
|
+
if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {
|
|
57
|
+
state.setOpen(false);
|
|
58
|
+
} else {
|
|
59
|
+
setPositionImmediate(next);
|
|
60
|
+
}
|
|
61
|
+
}, [
|
|
62
|
+
props.dismissOnSnapToBottom,
|
|
63
|
+
snapPoints.length,
|
|
64
|
+
setPositionImmediate,
|
|
65
|
+
state.setOpen
|
|
66
|
+
]);
|
|
67
|
+
if (process.env.NODE_ENV === "development") {
|
|
68
|
+
if (snapPointsMode === "mixed" && snapPoints.some(function(p) {
|
|
69
|
+
if (typeof p === "string") {
|
|
70
|
+
if (p === "fit") {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (p.endsWith("%")) {
|
|
74
|
+
var n = Number(p.slice(0, -1));
|
|
75
|
+
return n < 0 || n > 100;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return typeof p !== "number" || p < 0;
|
|
80
|
+
})) {
|
|
81
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed");
|
|
82
|
+
}
|
|
83
|
+
if (snapPointsMode === "mixed" && snapPoints.indexOf("fit") > 0) {
|
|
84
|
+
console.warn("⚠️ Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed");
|
|
85
|
+
}
|
|
86
|
+
if (snapPointsMode === "fit" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== "fit")) {
|
|
87
|
+
console.warn("⚠️ Invalid snapPoint given, there are no snap points when snapPointsMode is fit");
|
|
88
|
+
}
|
|
89
|
+
if (snapPointsMode === "constant" && snapPoints.some(function(p) {
|
|
90
|
+
return typeof p !== "number" || p < 0;
|
|
91
|
+
})) {
|
|
92
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant");
|
|
93
|
+
}
|
|
94
|
+
if (snapPointsMode === "percent" && snapPoints.some(function(p) {
|
|
95
|
+
return typeof p !== "number" || p < 0 || p > 100;
|
|
96
|
+
})) {
|
|
97
|
+
console.warn("⚠️ Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {
|
|
101
|
+
setPositionImmediate(0);
|
|
102
|
+
}
|
|
103
|
+
var shouldSetPositionOpen = open && position < 0;
|
|
104
|
+
import_react.default.useEffect(function() {
|
|
105
|
+
if (shouldSetPositionOpen) {
|
|
106
|
+
setPosition(0);
|
|
107
|
+
}
|
|
108
|
+
}, [setPosition, shouldSetPositionOpen]);
|
|
109
|
+
var _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, _props_scope;
|
|
110
|
+
return {
|
|
111
|
+
modal: !!props.modal,
|
|
112
|
+
open: state.open,
|
|
113
|
+
setOpen: state.setOpen,
|
|
114
|
+
hidden: !!state.isHidden,
|
|
115
|
+
contentRef,
|
|
116
|
+
handleRef,
|
|
117
|
+
frameSize,
|
|
118
|
+
setFrameSize,
|
|
119
|
+
maxContentSize,
|
|
120
|
+
dismissOnOverlayPress: (_props_dismissOnOverlayPress = props.dismissOnOverlayPress) !== null && _props_dismissOnOverlayPress !== void 0 ? _props_dismissOnOverlayPress : true,
|
|
121
|
+
dismissOnSnapToBottom: (_props_dismissOnSnapToBottom = props.dismissOnSnapToBottom) !== null && _props_dismissOnSnapToBottom !== void 0 ? _props_dismissOnSnapToBottom : false,
|
|
122
|
+
scope: (_props_scope = props.scope) !== null && _props_scope !== void 0 ? _props_scope : "",
|
|
123
|
+
hasFit,
|
|
124
|
+
position,
|
|
125
|
+
snapPoints,
|
|
126
|
+
snapPointsMode,
|
|
127
|
+
setMaxContentSize,
|
|
128
|
+
setPosition,
|
|
129
|
+
setPositionImmediate
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=useSheetState.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSheetState.native.js","names":[],"sources":["cjs/useSheetState.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 useSheetState_exports = {};\n__export(useSheetState_exports, {\n useSheetState: () => useSheetState\n});\nmodule.exports = __toCommonJS(useSheetState_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nfunction useSheetState(props, state) {\n var handleRef = import_react.default.useRef(null);\n var contentRef = import_react.default.useRef(null);\n var [frameSize, setFrameSize] = import_react.default.useState(0);\n var [maxContentSize, setMaxContentSize] = import_react.default.useState(0);\n var _props_snapPointsMode;\n var snapPointsMode = (_props_snapPointsMode = props.snapPointsMode) !== null && _props_snapPointsMode !== void 0 ? _props_snapPointsMode : \"percent\";\n var _props_snapPoints;\n var snapPointsProp = (_props_snapPoints = props.snapPoints) !== null && _props_snapPoints !== void 0 ? _props_snapPoints : snapPointsMode === \"percent\" ? [\n 80\n ] : snapPointsMode === \"constant\" ? [\n 256\n ] : [\n \"fit\"\n ];\n var hasFit = snapPointsProp[0] === \"fit\";\n var snapPoints = import_react.default.useMemo(function() {\n return props.dismissOnSnapToBottom ? [\n ...snapPointsProp,\n 0\n ] : snapPointsProp;\n }, [\n JSON.stringify(snapPointsProp),\n props.dismissOnSnapToBottom\n ]);\n var [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({\n prop: props.position,\n defaultProp: props.defaultPosition || (state.open ? 0 : -1),\n onChange: props.onPositionChange,\n strategy: state.strategy\n });\n var position = state.open === false ? -1 : position_;\n var { open } = state;\n var setPosition = import_react.default.useCallback(function(next) {\n if (props.dismissOnSnapToBottom && next === snapPoints.length - 1) {\n state.setOpen(false);\n } else {\n setPositionImmediate(next);\n }\n }, [\n props.dismissOnSnapToBottom,\n snapPoints.length,\n setPositionImmediate,\n state.setOpen\n ]);\n if (process.env.NODE_ENV === \"development\") {\n if (snapPointsMode === \"mixed\" && snapPoints.some(function(p) {\n if (typeof p === \"string\") {\n if (p === \"fit\") {\n return false;\n }\n if (p.endsWith(\"%\")) {\n var n = Number(p.slice(0, -1));\n return n < 0 || n > 100;\n }\n return true;\n }\n return typeof p !== \"number\" || p < 0;\n })) {\n console.warn('\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values, string percentages between 0-100%, or \"fit\" when snapPointsMode is mixed');\n }\n if (snapPointsMode === \"mixed\" && snapPoints.indexOf(\"fit\") > 0) {\n console.warn('\\u26A0\\uFE0F Invalid snapPoint given, \"fit\" must be the first/largest snap point when snapPointsMode is mixed');\n }\n if (snapPointsMode === \"fit\" && (snapPoints.length !== (props.dismissOnSnapToBottom ? 2 : 1) || snapPoints[0] !== \"fit\")) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, there are no snap points when snapPointsMode is fit\");\n }\n if (snapPointsMode === \"constant\" && snapPoints.some(function(p) {\n return typeof p !== \"number\" || p < 0;\n })) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be positive numeric values when snapPointsMode is constant\");\n }\n if (snapPointsMode === \"percent\" && snapPoints.some(function(p) {\n return typeof p !== \"number\" || p < 0 || p > 100;\n })) {\n console.warn(\"\\u26A0\\uFE0F Invalid snapPoint given, snapPoints must be numeric values between 0 and 100 when snapPointsMode is percent\");\n }\n }\n if (open && props.dismissOnSnapToBottom && position === snapPoints.length - 1) {\n setPositionImmediate(0);\n }\n var shouldSetPositionOpen = open && position < 0;\n import_react.default.useEffect(function() {\n if (shouldSetPositionOpen) {\n setPosition(0);\n }\n }, [\n setPosition,\n shouldSetPositionOpen\n ]);\n var _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, _props_scope;\n return {\n modal: !!props.modal,\n open: state.open,\n setOpen: state.setOpen,\n hidden: !!state.isHidden,\n contentRef,\n handleRef,\n frameSize,\n setFrameSize,\n maxContentSize,\n dismissOnOverlayPress: (_props_dismissOnOverlayPress = props.dismissOnOverlayPress) !== null && _props_dismissOnOverlayPress !== void 0 ? _props_dismissOnOverlayPress : true,\n dismissOnSnapToBottom: (_props_dismissOnSnapToBottom = props.dismissOnSnapToBottom) !== null && _props_dismissOnSnapToBottom !== void 0 ? _props_dismissOnSnapToBottom : false,\n scope: (_props_scope = props.scope) !== null && _props_scope !== void 0 ? _props_scope : \"\",\n hasFit,\n position,\n snapPoints,\n snapPointsMode,\n setMaxContentSize,\n setPosition,\n setPositionImmediate\n };\n}\n//# sourceMappingURL=useSheetState.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,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB,EAC9B,qBAAqB,cACvB,CAAC;AACD,OAAO,UAAU,aAAa,qBAAqB;AACnD,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AA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;EACA;EACA,wBAAwB,+BAA+B,MAAM,2BAA2B,QAAQ,iCAAiC,KAAK,IAAI,+BAA+B;EACzK,wBAAwB,+BAA+B,MAAM,2BAA2B,QAAQ,iCAAiC,KAAK,IAAI,+BAA+B;EACzK,QAAQ,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,eAAe;EACzF;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/dist/esm/Sheet.mjs
CHANGED
|
@@ -9,8 +9,8 @@ import { XStack, YStack } from "@tamagui/stacks";
|
|
|
9
9
|
import { useDidFinishSSR } from "@tamagui/use-did-finish-ssr";
|
|
10
10
|
import { StackZIndexContext } from "@tamagui/z-index-stack";
|
|
11
11
|
import { useContext, useEffect, useMemo, useRef } from "react";
|
|
12
|
-
import { Platform } from "react-native-web";
|
|
13
12
|
import { SHEET_BACKGROUND_NAME, SHEET_CONTAINER_NAME, SHEET_HANDLE_NAME, SHEET_OVERLAY_MARKER, SHEET_OVERLAY_NAME } from "./constants.mjs";
|
|
13
|
+
import { getNativeSheet } from "./nativeSheet.mjs";
|
|
14
14
|
import { SheetOverlayLayerContext, useAnimatedPosition, useSheetContext } from "./SheetContext.mjs";
|
|
15
15
|
import { SheetImplementationCustom } from "./SheetImplementationCustom.mjs";
|
|
16
16
|
import { SheetScrollView } from "./SheetScrollView.mjs";
|
|
@@ -32,7 +32,7 @@ const SheetOverlayFrame = styled(YStack, {
|
|
|
32
32
|
displayName: SHEET_OVERLAY_NAME,
|
|
33
33
|
inset: 0,
|
|
34
34
|
position: "absolute",
|
|
35
|
-
zIndex:
|
|
35
|
+
zIndex: 1e5 - 1,
|
|
36
36
|
pointerEvents: "auto",
|
|
37
37
|
variants: { open: {
|
|
38
38
|
true: { pointerEvents: "auto" },
|
|
@@ -45,8 +45,7 @@ const SheetContainerFrame = styled(YStack, {
|
|
|
45
45
|
flex: 1,
|
|
46
46
|
position: "relative",
|
|
47
47
|
zIndex: 0,
|
|
48
|
-
width: "100%"
|
|
49
|
-
maxHeight: "100%"
|
|
48
|
+
width: "100%"
|
|
50
49
|
});
|
|
51
50
|
const SheetBackgroundFrame = styled(YStack, {
|
|
52
51
|
displayName: SHEET_BACKGROUND_NAME,
|
|
@@ -64,10 +63,14 @@ const SheetHandle = createStyledHOC(SheetHandleFrame, ({ scope, ...props }, forw
|
|
|
64
63
|
useEffect(() => {
|
|
65
64
|
if (!context.scrollBridge) return;
|
|
66
65
|
return context.scrollBridge.onParentDragging((isDragging) => {
|
|
67
|
-
if (isDragging)
|
|
66
|
+
if (isDragging) {
|
|
67
|
+
wasDraggingRef.current = true;
|
|
68
|
+
}
|
|
68
69
|
});
|
|
69
70
|
}, [context.scrollBridge]);
|
|
70
|
-
if (context.onlyShowContainer)
|
|
71
|
+
if (context.onlyShowContainer) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
71
74
|
return /* @__PURE__ */ jsx(SheetHandleFrame, {
|
|
72
75
|
ref: composedRef,
|
|
73
76
|
onPressIn: () => {
|
|
@@ -91,7 +94,9 @@ const SheetOverlay = createStyledHOC(SheetOverlayFrame, (propsIn, ref) => {
|
|
|
91
94
|
const context = useSheetContext(scope);
|
|
92
95
|
const isInOverlayLayer = useContext(SheetOverlayLayerContext);
|
|
93
96
|
const didWarn = useRef(false);
|
|
94
|
-
if (context.onlyShowContainer)
|
|
97
|
+
if (context.onlyShowContainer) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
95
100
|
if (!isInOverlayLayer) {
|
|
96
101
|
if (process.env.NODE_ENV === "development" && !didWarn.current) {
|
|
97
102
|
didWarn.current = true;
|
|
@@ -109,19 +114,40 @@ const SheetOverlay = createStyledHOC(SheetOverlayFrame, (propsIn, ref) => {
|
|
|
109
114
|
});
|
|
110
115
|
const SheetContainer = createStyledHOC(SheetContainerFrame, ({ scope, adjustPaddingForOffscreenContent, children, ...props }, forwardedRef) => {
|
|
111
116
|
const context = useSheetContext(scope);
|
|
112
|
-
const { hasFit,
|
|
117
|
+
const { hasFit, frameSize, contentRef, open } = context;
|
|
113
118
|
const composedContentRef = useComposedRefs(forwardedRef, contentRef);
|
|
114
119
|
const offscreenSize = useSheetOffscreenSize(context);
|
|
115
120
|
const stableFrameSize = useRef(frameSize);
|
|
116
121
|
useEffect(() => {
|
|
117
|
-
if (open && frameSize)
|
|
122
|
+
if (open && frameSize) {
|
|
123
|
+
stableFrameSize.current = frameSize;
|
|
124
|
+
}
|
|
118
125
|
}, [open, frameSize]);
|
|
119
126
|
const sheetContents = useMemo(() => {
|
|
127
|
+
if (context.onlyShowContainer) {
|
|
128
|
+
return /* @__PURE__ */ jsx(SheetContainerFrame, {
|
|
129
|
+
ref: composedContentRef,
|
|
130
|
+
flex: hasFit ? 0 : 1,
|
|
131
|
+
flexBasis: hasFit ? "auto" : void 0,
|
|
132
|
+
maxHeight: hasFit ? void 0 : "100%",
|
|
133
|
+
pointerEvents: open ? "auto" : "none",
|
|
134
|
+
"data-state": open ? "open" : "closed",
|
|
135
|
+
...props,
|
|
136
|
+
onLayout: composeEventHandlers(props.onLayout, (event) => {
|
|
137
|
+
context.setFrameSize(event.nativeEvent.layout.height);
|
|
138
|
+
}),
|
|
139
|
+
children: /* @__PURE__ */ jsx(StackZIndexContext, {
|
|
140
|
+
zIndex: resolveViewZIndex(props.zIndex),
|
|
141
|
+
children
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
120
145
|
const shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;
|
|
121
146
|
return /* @__PURE__ */ jsxs(SheetContainerFrame, {
|
|
122
147
|
ref: composedContentRef,
|
|
123
148
|
flex: hasFit && open ? 0 : 1,
|
|
124
149
|
flexBasis: hasFit ? "auto" : void 0,
|
|
150
|
+
maxHeight: "100%",
|
|
125
151
|
height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,
|
|
126
152
|
pointerEvents: open ? "auto" : "none",
|
|
127
153
|
"data-state": open ? "open" : "closed",
|
|
@@ -141,15 +167,19 @@ const SheetContainer = createStyledHOC(SheetContainerFrame, ({ scope, adjustPadd
|
|
|
141
167
|
frameSize,
|
|
142
168
|
offscreenSize,
|
|
143
169
|
adjustPaddingForOffscreenContent,
|
|
144
|
-
hasFit
|
|
170
|
+
hasFit,
|
|
171
|
+
context.onlyShowContainer,
|
|
172
|
+
context.setFrameSize
|
|
145
173
|
]);
|
|
174
|
+
if (context.onlyShowContainer) return sheetContents;
|
|
146
175
|
return /* @__PURE__ */ jsx(RemoveScroll, {
|
|
147
|
-
enabled: !disableRemoveScroll && context.open,
|
|
176
|
+
enabled: !context.disableRemoveScroll && context.open,
|
|
148
177
|
children: sheetContents
|
|
149
178
|
});
|
|
150
179
|
});
|
|
151
180
|
const SheetBackground = createStyledHOC(SheetBackgroundFrame, ({ scope, disableHideBottomOverflow, ...props }, forwardedRef) => {
|
|
152
181
|
const context = useSheetContext(scope);
|
|
182
|
+
if (context.onlyShowContainer) return null;
|
|
153
183
|
const bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;
|
|
154
184
|
return /* @__PURE__ */ jsx(SheetBackgroundFrame, {
|
|
155
185
|
ref: forwardedRef,
|
|
@@ -163,10 +193,13 @@ const SheetRoot = createRefComponent(function SheetRoot2(props, ref) {
|
|
|
163
193
|
const isAdapted = useAdaptIsActive();
|
|
164
194
|
const adaptContext = useAdaptContext();
|
|
165
195
|
const { isShowingNonSheet } = useSheetController(props.scope);
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
196
|
+
const shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);
|
|
197
|
+
const isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;
|
|
198
|
+
const nativeImplementation = props.native === true || Array.isArray(props.native) && props.native.includes("ios") ? getNativeSheet("ios") : null;
|
|
199
|
+
const SheetImplementation = nativeImplementation ?? SheetImplementationCustom;
|
|
200
|
+
if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
170
203
|
const implementation = /* @__PURE__ */ jsx(SheetImplementation, {
|
|
171
204
|
ref,
|
|
172
205
|
...props
|
package/dist/esm/Sheet.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","names":[],"sources":["esm/Sheet.js"],"sourcesContent":["import { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { View, createRefComponent, createStyledHOC, styled } from \"@tamagui/core\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { resolveViewZIndex } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { XStack, YStack } from \"@tamagui/stacks\";\nimport { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport { useContext, useEffect, useMemo, useRef } from \"react\";\nimport { Platform } from \"react-native-web\";\nimport { SHEET_BACKGROUND_NAME, SHEET_CONTAINER_NAME, SHEET_HANDLE_NAME, SHEET_OVERLAY_MARKER, SHEET_OVERLAY_NAME } from \"./constants\";\nimport { SheetOverlayLayerContext, useAnimatedPosition, useSheetContext } from \"./SheetContext\";\nimport { SheetImplementationCustom } from \"./SheetImplementationCustom\";\nimport { SheetScrollView } from \"./SheetScrollView\";\nimport { useSheetController } from \"./useSheetController\";\nimport { useSheetOffscreenSize } from \"./useSheetOffscreenSize\";\nimport { getMaxViewportHeight } from \"./webViewport\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n\nexport * from \"./types\"\n\nconst SheetHandleFrame = styled(XStack, {\n\tdisplayName: SHEET_HANDLE_NAME,\n\tvariants: { open: {\n\t\ttrue: { pointerEvents: \"auto\" },\n\t\tfalse: { pointerEvents: \"none\" }\n\t} }\n});\nconst SheetOverlayFrame = styled(YStack, {\n\tdisplayName: 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, { [SHEET_OVERLAY_MARKER]: true });\nconst SheetContainerFrame = styled(YStack, {\n\tdisplayName: SHEET_CONTAINER_NAME,\n\tflex: 1,\n\tposition: \"relative\",\n\tzIndex: 0,\n\twidth: \"100%\",\n\tmaxHeight: \"100%\"\n});\nconst SheetBackgroundFrame = styled(YStack, {\n\tdisplayName: SHEET_BACKGROUND_NAME,\n\tposition: \"absolute\",\n\ttop: 0,\n\tleft: 0,\n\tright: 0,\n\tzIndex: -1,\n\tpointerEvents: \"none\"\n});\nconst SheetHandle = createStyledHOC(SheetHandleFrame, ({ scope, ...props }, forwardedRef) => {\n\tconst context = useSheetContext(scope);\n\tconst composedRef = useComposedRefs(context.handleRef, forwardedRef);\n\tconst wasDraggingRef = useRef(false);\n\tuseEffect(() => {\n\t\tif (!context.scrollBridge) return;\n\t\treturn context.scrollBridge.onParentDragging((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__ */ jsx(SheetHandleFrame, {\n\t\tref: composedRef,\n\t\tonPressIn: () => {\n\t\t\twasDraggingRef.current = false;\n\t\t},\n\t\tonPress: () => {\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\tconst max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n\t\t\tconst 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});\nconst SheetOverlay = createStyledHOC(SheetOverlayFrame, (propsIn, ref) => {\n\tconst { scope, ...props } = propsIn;\n\tconst context = useSheetContext(scope);\n\tconst isInOverlayLayer = useContext(SheetOverlayLayerContext);\n\tconst didWarn = 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__ */ jsx(SheetOverlayFrame, {\n\t\t...props,\n\t\tref,\n\t\tonPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? () => {\n\t\t\tcontext.setOpen(false);\n\t\t} : void 0)\n\t});\n});\nconst SheetContainer = createStyledHOC(SheetContainerFrame, ({ scope, adjustPaddingForOffscreenContent, children, ...props }, forwardedRef) => {\n\tconst context = useSheetContext(scope);\n\tconst { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;\n\tconst composedContentRef = useComposedRefs(forwardedRef, contentRef);\n\tconst offscreenSize = useSheetOffscreenSize(context);\n\tconst stableFrameSize = useRef(frameSize);\n\tuseEffect(() => {\n\t\tif (open && frameSize) stableFrameSize.current = frameSize;\n\t}, [open, frameSize]);\n\tconst sheetContents = useMemo(() => {\n\t\tconst shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n\t\treturn /* @__PURE__ */ 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__ */ jsx(StackZIndexContext, {\n\t\t\t\tzIndex: resolveViewZIndex(props.zIndex),\n\t\t\t\tchildren\n\t\t\t}), adjustPaddingForOffscreenContent && /* @__PURE__ */ jsx(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__ */ jsx(RemoveScroll, {\n\t\tenabled: !disableRemoveScroll && context.open,\n\t\tchildren: sheetContents\n\t});\n});\nconst SheetBackground = createStyledHOC(SheetBackgroundFrame, ({ scope, disableHideBottomOverflow, ...props }, forwardedRef) => {\n\tconst context = useSheetContext(scope);\n\tconst bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;\n\treturn /* @__PURE__ */ 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});\nconst SheetRoot = createRefComponent(function SheetRoot2(props, ref) {\n\tconst hydrated = useDidFinishSSR();\n\tconst isAdapted = useAdaptIsActive();\n\tconst adaptContext = useAdaptContext();\n\tconst { isShowingNonSheet } = useSheetController(props.scope);\n\tconst isShowingAdaptNonSheet = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange) && !adaptContext.active && adaptContext.open;\n\tlet SheetImplementation = SheetImplementationCustom;\n\tif (props.native && Platform.OS === \"ios\") {}\n\tif (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) return null;\n\tconst implementation = /* @__PURE__ */ jsx(SheetImplementation, {\n\t\tref,\n\t\t...props\n\t});\n\treturn isAdapted ? /* @__PURE__ */ jsx(AdaptCapabilities, {\n\t\tscroll: true,\n\t\toverlay: true,\n\t\tdismiss: true,\n\t\tchildren: implementation\n\t}) : implementation;\n});\nconst sheetParts = {\n\tContainer: SheetContainer,\n\tBackground: SheetBackground,\n\tOverlay: SheetOverlay,\n\tHandle: SheetHandle,\n\tScrollView: SheetScrollView\n};\nconst SheetControlled = withStaticProperties(SheetRoot, sheetParts);\nconst Sheet = withStaticProperties(SheetRoot, {\n\tRoot: SheetRoot,\n\tControlled: SheetControlled,\n\tuseAnimatedPosition,\n\t...sheetParts\n});\n\nexport { Sheet, SheetBackground, SheetContainer, SheetControlled, SheetHandle, SheetOverlay, SheetRoot };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,mBAAmB,OAAO,QAAQ;CACvC,aAAa;CACb,UAAU,EAAE,MAAM;EACjB,MAAM,EAAE,eAAe,OAAO;EAC9B,OAAO,EAAE,eAAe,OAAO;CAChC,EAAE;AACH,CAAC;AACD,MAAM,oBAAoB,OAAO,QAAQ;CACxC,aAAa;CACb,OAAO;CACP,UAAU;CACV,QAAQ;CACR,eAAe;CACf,UAAU,EAAE,MAAM;EACjB,MAAM,EAAE,eAAe,OAAO;EAC9B,OAAO,EAAE,eAAe,OAAO;CAChC,EAAE;AACH,CAAC;AACD,OAAO,OAAO,kBAAkB,cAAc,GAAG,uBAAuB,KAAK,CAAC;AAC9E,MAAM,sBAAsB,OAAO,QAAQ;CAC1C,aAAa;CACb,MAAM;CACN,UAAU;CACV,QAAQ;CACR,OAAO;CACP,WAAW;AACZ,CAAC;AACD,MAAM,uBAAuB,OAAO,QAAQ;CAC3C,aAAa;CACb,UAAU;CACV,KAAK;CACL,MAAM;CACN,OAAO;CACP,QAAQ,CAAC;CACT,eAAe;AAChB,CAAC;AACD,MAAM,cAAc,gBAAgB,mBAAmB,EAAE,OAAO,GAAG,SAAS,iBAAiB;CAC5F,MAAM,UAAU,gBAAgB,KAAK;CACrC,MAAM,cAAc,gBAAgB,QAAQ,WAAW,YAAY;CACnE,MAAM,iBAAiB,OAAO,KAAK;CACnC,gBAAgB;EACf,IAAI,CAAC,QAAQ,cAAc;EAC3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BAAsB,mBAAmB,MAAM,KAAK;CAC5D,MAAM,yBAAyB,QAAQ,aAAa,SAAS,KAAK,KAAK,aAAa,YAAY,KAAK,CAAC,aAAa,UAAU,aAAa;CAC1I,IAAI,sBAAsB;CAC1B,IAAI,MAAM,UAAU,SAAS,OAAO,OAAO,CAAC;CAC5C,IAAI,0BAA0B,qBAAqB,CAAC,UAAU,OAAO;CACrE,MAAM,iBAAiC,oBAAI,qBAAqB;EAC/D;EACA,GAAG;CACJ,CAAC;CACD,OAAO,YAA4B,oBAAI,mBAAmB;EACzD,QAAQ;EACR,SAAS;EACT,SAAS;EACT,UAAU;CACX,CAAC,IAAI;AACN,CAAC;AACD,MAAM,aAAa;CAClB,WAAW;CACX,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,YAAY;AACb;AACA,MAAM,kBAAkB,qBAAqB,WAAW,UAAU;AAClE,MAAM,QAAQ,qBAAqB,WAAW;CAC7C,MAAM;CACN,YAAY;CACZ;CACA,GAAG;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"Sheet.js","names":[],"sources":["esm/Sheet.js"],"sourcesContent":["import { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport {\n createRefComponent,\n createStyledHOC,\n styled,\n View\n} from \"@tamagui/core\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { resolveViewZIndex } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { XStack, YStack } from \"@tamagui/stacks\";\nimport { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport { useContext, useEffect, useMemo, useRef } from \"react\";\nimport {\n SHEET_BACKGROUND_NAME,\n SHEET_CONTAINER_NAME,\n SHEET_HANDLE_NAME,\n SHEET_OVERLAY_MARKER,\n SHEET_OVERLAY_NAME\n} from \"./constants\";\nimport { getNativeSheet } from \"./nativeSheet\";\nimport {\n SheetOverlayLayerContext,\n useAnimatedPosition,\n useSheetContext\n} from \"./SheetContext\";\nimport { SheetImplementationCustom } from \"./SheetImplementationCustom\";\nimport { SheetScrollView } from \"./SheetScrollView\";\nimport { useSheetController } from \"./useSheetController\";\nimport { useSheetOffscreenSize } from \"./useSheetOffscreenSize\";\nimport { getMaxViewportHeight } from \"./webViewport\";\nexport * from \"./types\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst SheetHandleFrame = styled(XStack, {\n displayName: 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});\nconst SheetOverlayFrame = styled(YStack, {\n displayName: 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, { [SHEET_OVERLAY_MARKER]: true });\nconst SheetContainerFrame = styled(YStack, {\n displayName: SHEET_CONTAINER_NAME,\n flex: 1,\n position: \"relative\",\n zIndex: 0,\n width: \"100%\"\n});\nconst SheetBackgroundFrame = styled(YStack, {\n displayName: SHEET_BACKGROUND_NAME,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: -1,\n pointerEvents: \"none\"\n});\nconst SheetHandle = createStyledHOC(\n SheetHandleFrame,\n ({ scope, ...props }, forwardedRef) => {\n const context = useSheetContext(scope);\n const composedRef = useComposedRefs(context.handleRef, forwardedRef);\n const wasDraggingRef = useRef(false);\n useEffect(() => {\n if (!context.scrollBridge) return;\n return context.scrollBridge.onParentDragging((isDragging) => {\n if (isDragging) {\n wasDraggingRef.current = true;\n }\n });\n }, [context.scrollBridge]);\n if (context.onlyShowContainer) {\n return null;\n }\n return /* @__PURE__ */ jsx(\n SheetHandleFrame,\n {\n ref: composedRef,\n onPressIn: () => {\n wasDraggingRef.current = false;\n },\n onPress: () => {\n if (wasDraggingRef.current) {\n wasDraggingRef.current = false;\n return;\n }\n const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n const nextPos = (context.position + 1) % max;\n context.setPosition(nextPos);\n },\n open: context.open,\n ...props\n }\n );\n }\n);\nconst SheetOverlay = createStyledHOC(\n SheetOverlayFrame,\n (propsIn, ref) => {\n const { scope, ...props } = propsIn;\n const context = useSheetContext(scope);\n const isInOverlayLayer = useContext(SheetOverlayLayerContext);\n const didWarn = 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(\n \"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\"\n );\n }\n return null;\n }\n return /* @__PURE__ */ jsx(\n SheetOverlayFrame,\n {\n ...props,\n ref,\n onPress: composeEventHandlers(\n props.onPress,\n context.dismissOnOverlayPress ? () => {\n context.setOpen(false);\n } : void 0\n )\n }\n );\n }\n);\nconst SheetContainer = createStyledHOC(\n SheetContainerFrame,\n ({\n scope,\n adjustPaddingForOffscreenContent,\n children,\n ...props\n }, forwardedRef) => {\n const context = useSheetContext(scope);\n const { hasFit, frameSize, contentRef, open } = context;\n const composedContentRef = useComposedRefs(forwardedRef, contentRef);\n const offscreenSize = useSheetOffscreenSize(context);\n const stableFrameSize = useRef(frameSize);\n useEffect(() => {\n if (open && frameSize) {\n stableFrameSize.current = frameSize;\n }\n }, [open, frameSize]);\n const sheetContents = useMemo(() => {\n if (context.onlyShowContainer) {\n return /* @__PURE__ */ jsx(\n SheetContainerFrame,\n {\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: composeEventHandlers(props.onLayout, (event) => {\n context.setFrameSize(event.nativeEvent.layout.height);\n }),\n children: /* @__PURE__ */ jsx(StackZIndexContext, { zIndex: resolveViewZIndex(props.zIndex), children })\n }\n );\n }\n const shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n return /* @__PURE__ */ jsxs(\n SheetContainerFrame,\n {\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__ */ jsx(StackZIndexContext, { zIndex: resolveViewZIndex(props.zIndex), children }),\n adjustPaddingForOffscreenContent && /* @__PURE__ */ jsx(View, { \"data-sheet-offscreen-pad\": true, height: offscreenSize, 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__ */ jsx(RemoveScroll, { enabled: !context.disableRemoveScroll && context.open, children: sheetContents });\n }\n);\nconst SheetBackground = createStyledHOC(\n SheetBackgroundFrame,\n ({ scope, disableHideBottomOverflow, ...props }, forwardedRef) => {\n const context = useSheetContext(scope);\n if (context.onlyShowContainer) return null;\n const bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;\n return /* @__PURE__ */ jsx(\n SheetBackgroundFrame,\n {\n ref: forwardedRef,\n \"data-sheet-background\": \"\",\n bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n ...props\n }\n );\n }\n);\nconst SheetRoot = createRefComponent(\n function SheetRoot2(props, ref) {\n const hydrated = useDidFinishSSR();\n const isAdapted = useAdaptIsActive();\n const adaptContext = useAdaptContext();\n const { isShowingNonSheet } = useSheetController(props.scope);\n const shouldUseAdapt = Boolean(\n adaptContext.open !== void 0 || adaptContext.onOpenChange\n );\n const isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;\n const nativeImplementation = props.native === true || Array.isArray(props.native) && props.native.includes(\"ios\") ? getNativeSheet(\"ios\") : null;\n const SheetImplementation = nativeImplementation ?? SheetImplementationCustom;\n if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {\n return null;\n }\n const implementation = /* @__PURE__ */ jsx(SheetImplementation, { ref, ...props });\n return isAdapted ? /* @__PURE__ */ jsx(AdaptCapabilities, { scroll: true, overlay: true, dismiss: true, children: implementation }) : implementation;\n }\n);\nconst sheetParts = {\n Container: SheetContainer,\n Background: SheetBackground,\n Overlay: SheetOverlay,\n Handle: SheetHandle,\n ScrollView: SheetScrollView\n};\nconst SheetControlled = withStaticProperties(\n SheetRoot,\n sheetParts\n);\nconst Sheet = withStaticProperties(SheetRoot, {\n Root: SheetRoot,\n Controlled: SheetControlled,\n useAnimatedPosition,\n ...sheetParts\n});\nexport {\n Sheet,\n SheetBackground,\n SheetContainer,\n SheetControlled,\n SheetHandle,\n SheetOverlay,\n SheetRoot\n};\n//# sourceMappingURL=Sheet.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,mBAAmB,OAAO,QAAQ;CACtC,aAAa;CAGb,UAAU,EACR,MAAM;EACJ,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EACL,eAAe,OACjB;CACF,EACF;AACF,CAAC;AACD,MAAM,oBAAoB,OAAO,QAAQ;CACvC,aAAa;CACb,OAAO;CACP,UAAU;CACV,QAAQ,MAAM;CACd,eAAe;CACf,UAAU,EACR,MAAM;EACJ,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EACL,eAAe,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