@tamagui/sheet 1.110.5 → 1.111.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/SheetContext.native.js +1 -43
- package/dist/cjs/SheetContext.native.js.map +2 -2
- package/dist/cjs/SheetController.native.js +2 -23
- package/dist/cjs/SheetController.native.js.map +2 -2
- package/dist/cjs/SheetImplementationCustom.native.js +89 -158
- package/dist/cjs/SheetImplementationCustom.native.js.map +2 -2
- package/dist/cjs/SheetScrollView.native.js +7 -63
- package/dist/cjs/SheetScrollView.native.js.map +1 -1
- package/dist/cjs/createSheet.native.js +27 -82
- package/dist/cjs/createSheet.native.js.map +2 -2
- package/dist/cjs/nativeSheet.native.js +5 -39
- package/dist/cjs/nativeSheet.native.js.map +1 -1
- package/dist/cjs/useSheetOffscreenSize.native.js +1 -1
- package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/cjs/useSheetOpenState.native.js +4 -46
- package/dist/cjs/useSheetOpenState.native.js.map +2 -2
- package/dist/cjs/useSheetProviderProps.native.js +7 -59
- package/dist/cjs/useSheetProviderProps.native.js.map +2 -2
- package/dist/esm/Sheet.native.mjs +92 -0
- package/dist/esm/Sheet.native.mjs.map +1 -0
- package/dist/esm/SheetContext.native.js +1 -42
- package/dist/esm/SheetContext.native.js.map +1 -1
- package/dist/esm/SheetContext.native.mjs +6 -0
- package/dist/esm/SheetContext.native.mjs.map +1 -0
- package/dist/esm/SheetController.native.js +2 -22
- package/dist/esm/SheetController.native.js.map +2 -2
- package/dist/esm/SheetController.native.mjs +26 -0
- package/dist/esm/SheetController.native.mjs.map +1 -0
- package/dist/esm/SheetImplementationCustom.native.js +88 -156
- package/dist/esm/SheetImplementationCustom.native.js.map +2 -2
- package/dist/esm/SheetImplementationCustom.native.mjs +347 -0
- package/dist/esm/SheetImplementationCustom.native.mjs.map +1 -0
- package/dist/esm/SheetScrollView.native.js +8 -63
- package/dist/esm/SheetScrollView.native.js.map +1 -1
- package/dist/esm/SheetScrollView.native.mjs +107 -0
- package/dist/esm/SheetScrollView.native.mjs.map +1 -0
- package/dist/esm/constants.native.mjs +9 -0
- package/dist/esm/constants.native.mjs.map +1 -0
- package/dist/esm/contexts.native.mjs +7 -0
- package/dist/esm/contexts.native.mjs.map +1 -0
- package/dist/esm/createSheet.native.js +27 -82
- package/dist/esm/createSheet.native.js.map +2 -2
- package/dist/esm/createSheet.native.mjs +161 -0
- package/dist/esm/createSheet.native.mjs.map +1 -0
- package/dist/esm/helpers.native.mjs +13 -0
- package/dist/esm/helpers.native.mjs.map +1 -0
- package/dist/esm/index.native.mjs +12 -0
- package/dist/esm/index.native.mjs.map +1 -0
- package/dist/esm/nativeSheet.native.js +4 -37
- package/dist/esm/nativeSheet.native.js.map +1 -1
- package/dist/esm/nativeSheet.native.mjs +56 -0
- package/dist/esm/nativeSheet.native.mjs.map +1 -0
- package/dist/esm/types.native.mjs +2 -0
- package/dist/esm/types.native.mjs.map +1 -0
- package/dist/esm/useSheet.native.mjs +6 -0
- package/dist/esm/useSheet.native.mjs.map +1 -0
- package/dist/esm/useSheetController.native.js +2 -2
- package/dist/esm/useSheetController.native.js.map +1 -1
- package/dist/esm/useSheetController.native.mjs +15 -0
- package/dist/esm/useSheetController.native.mjs.map +1 -0
- package/dist/esm/useSheetOffscreenSize.native.js +1 -1
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/esm/useSheetOffscreenSize.native.mjs +35 -0
- package/dist/esm/useSheetOffscreenSize.native.mjs.map +1 -0
- package/dist/esm/useSheetOpenState.native.js +4 -45
- package/dist/esm/useSheetOpenState.native.js.map +2 -2
- package/dist/esm/useSheetOpenState.native.mjs +29 -0
- package/dist/esm/useSheetOpenState.native.mjs.map +1 -0
- package/dist/esm/useSheetProviderProps.native.js +7 -59
- package/dist/esm/useSheetProviderProps.native.js.map +2 -2
- package/dist/esm/useSheetProviderProps.native.mjs +103 -0
- package/dist/esm/useSheetProviderProps.native.mjs.map +1 -0
- package/dist/jsx/SheetContext.native.js +1 -42
- package/dist/jsx/SheetContext.native.js.map +1 -1
- package/dist/jsx/SheetController.native.js +2 -22
- package/dist/jsx/SheetController.native.js.map +2 -2
- package/dist/jsx/SheetImplementationCustom.native.js +88 -156
- package/dist/jsx/SheetImplementationCustom.native.js.map +2 -2
- package/dist/jsx/SheetScrollView.native.js +7 -62
- package/dist/jsx/SheetScrollView.native.js.map +1 -1
- package/dist/jsx/createSheet.native.js +27 -82
- package/dist/jsx/createSheet.native.js.map +2 -2
- package/dist/jsx/nativeSheet.native.js +4 -37
- package/dist/jsx/nativeSheet.native.js.map +1 -1
- package/dist/jsx/useSheetOffscreenSize.native.js +1 -1
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/jsx/useSheetOpenState.native.js +3 -44
- package/dist/jsx/useSheetOpenState.native.js.map +2 -2
- package/dist/jsx/useSheetProviderProps.native.js +7 -59
- package/dist/jsx/useSheetProviderProps.native.js.map +2 -2
- package/package.json +16 -16
|
@@ -21,49 +21,7 @@ __export(SheetContext_exports, {
|
|
|
21
21
|
useSheetContext: () => useSheetContext
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(SheetContext_exports);
|
|
24
|
-
var import_create_context = require("@tamagui/create-context"), import_constants = require("./constants");
|
|
25
|
-
function _array_like_to_array(arr, len) {
|
|
26
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
27
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
28
|
-
return arr2;
|
|
29
|
-
}
|
|
30
|
-
function _array_with_holes(arr) {
|
|
31
|
-
if (Array.isArray(arr)) return arr;
|
|
32
|
-
}
|
|
33
|
-
function _iterable_to_array_limit(arr, i) {
|
|
34
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
35
|
-
if (_i != null) {
|
|
36
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
37
|
-
try {
|
|
38
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
39
|
-
;
|
|
40
|
-
} catch (err) {
|
|
41
|
-
_d = !0, _e = err;
|
|
42
|
-
} finally {
|
|
43
|
-
try {
|
|
44
|
-
!_n && _i.return != null && _i.return();
|
|
45
|
-
} finally {
|
|
46
|
-
if (_d) throw _e;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return _arr;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function _non_iterable_rest() {
|
|
53
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
54
|
-
}
|
|
55
|
-
function _sliced_to_array(arr, i) {
|
|
56
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
57
|
-
}
|
|
58
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
59
|
-
if (o) {
|
|
60
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
61
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
62
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
63
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
var _createContextScope = _sliced_to_array((0, import_create_context.createContextScope)(import_constants.SHEET_NAME), 2), createSheetContext = _createContextScope[0], createSheetScope = _createContextScope[1], _createSheetContext = _sliced_to_array(createSheetContext(import_constants.SHEET_NAME, {}), 2), SheetProvider = _createSheetContext[0], useSheetContext = _createSheetContext[1];
|
|
24
|
+
var import_create_context = require("@tamagui/create-context"), import_constants = require("./constants"), [createSheetContext, createSheetScope] = (0, import_create_context.createContextScope)(import_constants.SHEET_NAME), [SheetProvider, useSheetContext] = createSheetContext(import_constants.SHEET_NAME, {});
|
|
67
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
26
|
0 && (module.exports = {
|
|
69
27
|
SheetProvider,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/sheet/src/SheetContext.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;;;;4BAAmC,oCAEnC,mBAA2B,wBAGd,CAACA,oBAAoBC,gBAAAA,QAAoBC,0CAAmBC,2BAAAA,GAE5D,CAACC,eAAeC,eAAAA,IAAmBL,mBAC9CG,6BACA,CAAC,CAAA;",
|
|
5
|
+
"names": ["createSheetContext", "createSheetScope", "createContextScope", "SHEET_NAME", "SheetProvider", "useSheetContext"]
|
|
6
6
|
}
|
|
@@ -26,29 +26,8 @@ __export(SheetController_exports, {
|
|
|
26
26
|
SheetController: () => SheetController
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(SheetController_exports);
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_core = require("@tamagui/core"), import_useSheetController = require("./useSheetController")
|
|
30
|
-
|
|
31
|
-
if (source == null) return {};
|
|
32
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
33
|
-
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
35
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
36
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
37
|
-
}
|
|
38
|
-
return target;
|
|
39
|
-
}
|
|
40
|
-
function _object_without_properties_loose(source, excluded) {
|
|
41
|
-
if (source == null) return {};
|
|
42
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
43
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
44
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
45
|
-
return target;
|
|
46
|
-
}
|
|
47
|
-
var SheetController = function(_param) {
|
|
48
|
-
var children = _param.children, onOpenChangeProp = _param.onOpenChange, value = _object_without_properties(_param, [
|
|
49
|
-
"children",
|
|
50
|
-
"onOpenChange"
|
|
51
|
-
]), onOpenChange = (0, import_core.useEvent)(onOpenChangeProp), memoValue = import_react.default.useMemo(function() {
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_core = require("@tamagui/core"), import_useSheetController = require("./useSheetController"), SheetController = function(param) {
|
|
30
|
+
var { children, onOpenChange: onOpenChangeProp, ...value } = param, onOpenChange = (0, import_core.useEvent)(onOpenChangeProp), memoValue = import_react.default.useMemo(function() {
|
|
52
31
|
return {
|
|
53
32
|
open: value.open,
|
|
54
33
|
hidden: value.hidden,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/sheet/src/SheetController.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAClB,cAAyB,0BAIzB,4BAAuC
|
|
5
|
-
"names": ["SheetController", "children", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAClB,cAAyB,0BAIzB,4BAAuC,iCAE1BA,kBAAkB,SAAA,OAAA;MAAC,EAC9BC,UACAC,cAAcC,kBACd,GAAGC,MAAAA,IAC6D,OAC1DF,mBAAeG,sBAASF,gBAAAA,GAExBG,YAAYC,aAAAA,QAAMC,QACtB,WAAA;WAAO;MACLC,MAAML,MAAMK;MACZC,QAAQN,MAAMM;MACdC,aAAaP,MAAMO;MACnBT;IACF;KACA;IAACA;IAAcE,MAAMK;IAAML,MAAMM;IAAQN,MAAMO;GAAY;AAG7D,SACE,uCAAAC,KAACC,iDAAuBC,UAAQ;IAACV,OAAOE;;;AAI5C;",
|
|
5
|
+
"names": ["SheetController", "children", "onOpenChange", "onOpenChangeProp", "value", "useEvent", "memoValue", "React", "useMemo", "open", "hidden", "disableDrag", "_jsx", "SheetControllerContext", "Provider"]
|
|
6
6
|
}
|
|
@@ -26,91 +26,18 @@ __export(SheetImplementationCustom_exports, {
|
|
|
26
26
|
SheetImplementationCustom: () => SheetImplementationCustom
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(SheetImplementationCustom_exports);
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_adapt = require("@tamagui/adapt"), import_animate_presence = require("@tamagui/animate-presence"), import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_portal = require("@tamagui/portal"), import_use_keyboard_visible = require("@tamagui/use-keyboard-visible"), import_react_native = require("react-native"), import_constants2 = require("./constants"), import_contexts = require("./contexts"), import_helpers = require("./helpers"), import_SheetContext = require("./SheetContext"), import_useSheetOpenState = require("./useSheetOpenState"), import_useSheetProviderProps = require("./useSheetProviderProps")
|
|
30
|
-
|
|
31
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
32
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
33
|
-
return arr2;
|
|
34
|
-
}
|
|
35
|
-
function _array_with_holes(arr) {
|
|
36
|
-
if (Array.isArray(arr)) return arr;
|
|
37
|
-
}
|
|
38
|
-
function _define_property(obj, key, value) {
|
|
39
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
40
|
-
value,
|
|
41
|
-
enumerable: !0,
|
|
42
|
-
configurable: !0,
|
|
43
|
-
writable: !0
|
|
44
|
-
}) : obj[key] = value, obj;
|
|
45
|
-
}
|
|
46
|
-
function _iterable_to_array_limit(arr, i) {
|
|
47
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
48
|
-
if (_i != null) {
|
|
49
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
50
|
-
try {
|
|
51
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
52
|
-
;
|
|
53
|
-
} catch (err) {
|
|
54
|
-
_d = !0, _e = err;
|
|
55
|
-
} finally {
|
|
56
|
-
try {
|
|
57
|
-
!_n && _i.return != null && _i.return();
|
|
58
|
-
} finally {
|
|
59
|
-
if (_d) throw _e;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return _arr;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function _non_iterable_rest() {
|
|
66
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67
|
-
}
|
|
68
|
-
function _object_spread(target) {
|
|
69
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
70
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
71
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
72
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
73
|
-
}))), ownKeys2.forEach(function(key) {
|
|
74
|
-
_define_property(target, key, source[key]);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
return target;
|
|
78
|
-
}
|
|
79
|
-
function ownKeys(object, enumerableOnly) {
|
|
80
|
-
var keys = Object.keys(object);
|
|
81
|
-
if (Object.getOwnPropertySymbols) {
|
|
82
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
83
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
84
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
85
|
-
})), keys.push.apply(keys, symbols);
|
|
86
|
-
}
|
|
87
|
-
return keys;
|
|
88
|
-
}
|
|
89
|
-
function _object_spread_props(target, source) {
|
|
90
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
91
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
92
|
-
}), target;
|
|
93
|
-
}
|
|
94
|
-
function _sliced_to_array(arr, i) {
|
|
95
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
96
|
-
}
|
|
97
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
98
|
-
if (o) {
|
|
99
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
100
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
101
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
102
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)(/* @__PURE__ */ import_react.default.forwardRef(function(props, forwardedRef) {
|
|
106
|
-
var parentSheet = import_react.default.useContext(import_contexts.ParentSheetContext), animation = props.animation, animationConfigProp = props.animationConfig, _props_modal = props.modal, modal = _props_modal === void 0 ? !1 : _props_modal, _props_zIndex = props.zIndex, zIndex = _props_zIndex === void 0 ? parentSheet.zIndex + 1 : _props_zIndex, _props_moveOnKeyboardChange = props.moveOnKeyboardChange, moveOnKeyboardChange = _props_moveOnKeyboardChange === void 0 ? !1 : _props_moveOnKeyboardChange, _props_unmountChildrenWhenHidden = props.unmountChildrenWhenHidden, unmountChildrenWhenHidden = _props_unmountChildrenWhenHidden === void 0 ? !1 : _props_unmountChildrenWhenHidden, portalProps = props.portalProps, tmp = props.containerComponent, ContainerComponent = tmp === void 0 ? import_react.default.Fragment : tmp, keyboardIsVisible = (0, import_use_keyboard_visible.useKeyboardVisible)(), state = (0, import_useSheetOpenState.useSheetOpenState)(props), _React_useState = _sliced_to_array(import_react.default.useState(null), 2), overlayComponent = _React_useState[0], setOverlayComponent = _React_useState[1], providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_adapt = require("@tamagui/adapt"), import_animate_presence = require("@tamagui/animate-presence"), import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_portal = require("@tamagui/portal"), import_use_keyboard_visible = require("@tamagui/use-keyboard-visible"), import_react_native = require("react-native"), import_constants2 = require("./constants"), import_contexts = require("./contexts"), import_helpers = require("./helpers"), import_SheetContext = require("./SheetContext"), import_useSheetOpenState = require("./useSheetOpenState"), import_useSheetProviderProps = require("./useSheetProviderProps"), hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)(/* @__PURE__ */ import_react.default.forwardRef(function(props, forwardedRef) {
|
|
30
|
+
var parentSheet = import_react.default.useContext(import_contexts.ParentSheetContext), { animation, animationConfig: animationConfigProp, modal = !1, zIndex = parentSheet.zIndex + 1, moveOnKeyboardChange = !1, unmountChildrenWhenHidden = !1, portalProps, containerComponent: ContainerComponent = import_react.default.Fragment } = props, keyboardIsVisible = (0, import_use_keyboard_visible.useKeyboardVisible)(), state = (0, import_useSheetOpenState.useSheetOpenState)(props), [overlayComponent, setOverlayComponent] = import_react.default.useState(null), providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
|
|
107
31
|
onOverlayComponent: setOverlayComponent
|
|
108
|
-
}),
|
|
109
|
-
var
|
|
32
|
+
}), { frameSize, setFrameSize, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps, { open, controller, isHidden } = state, sheetRef = import_react.default.useRef(null), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef), animationConfig = function() {
|
|
33
|
+
var [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [
|
|
110
34
|
animation
|
|
111
|
-
] : []
|
|
112
|
-
return animationConfigProp ?? (animationProp ?
|
|
113
|
-
|
|
35
|
+
] : [];
|
|
36
|
+
return animationConfigProp ?? (animationProp ? {
|
|
37
|
+
...(0, import_core.getConfig)().animations.animations[animationProp],
|
|
38
|
+
...animationPropConfig
|
|
39
|
+
} : null);
|
|
40
|
+
}(), [isShowingInnerSheet, setIsShowingInnerSheet] = import_react.default.useState(!1), shouldHideParentSheet = !import_constants.isWeb && modal && isShowingInnerSheet, parentSheetContext = import_react.default.useContext(import_contexts.SheetInsideSheetContext), onInnerSheet = import_react.default.useCallback(function(hasChild) {
|
|
114
41
|
setIsShowingInnerSheet(hasChild);
|
|
115
42
|
}, []), positions = import_react.default.useMemo(function() {
|
|
116
43
|
return snapPoints.map(function(point) {
|
|
@@ -121,7 +48,7 @@ var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)
|
|
|
121
48
|
frameSize,
|
|
122
49
|
snapPoints,
|
|
123
50
|
snapPointsMode
|
|
124
|
-
]), animationDriver = (0, import_core.useConfiguration)()
|
|
51
|
+
]), { animationDriver } = (0, import_core.useConfiguration)(), { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver, _animationDriver_View, AnimatedView = (_animationDriver_View = animationDriver.View) !== null && _animationDriver_View !== void 0 ? _animationDriver_View : import_core.Stack;
|
|
125
52
|
(0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
126
53
|
if (parentSheetContext && open)
|
|
127
54
|
return parentSheetContext(!0), function() {
|
|
@@ -158,15 +85,17 @@ var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)
|
|
|
158
85
|
type: "timing",
|
|
159
86
|
duration: 0
|
|
160
87
|
}, function() {
|
|
161
|
-
isHidden || (toValue = positions[position2], at.current = toValue, animatedNumber.setValue(toValue,
|
|
162
|
-
type: "spring"
|
|
163
|
-
|
|
88
|
+
isHidden || (toValue = positions[position2], at.current = toValue, animatedNumber.setValue(toValue, {
|
|
89
|
+
type: "spring",
|
|
90
|
+
...animationConfig
|
|
91
|
+
}));
|
|
164
92
|
});
|
|
165
93
|
return;
|
|
166
94
|
}
|
|
167
|
-
animatedNumber.setValue(toValue,
|
|
168
|
-
type: "spring"
|
|
169
|
-
|
|
95
|
+
animatedNumber.setValue(toValue, {
|
|
96
|
+
type: "spring",
|
|
97
|
+
...animationConfig
|
|
98
|
+
});
|
|
170
99
|
}
|
|
171
100
|
}
|
|
172
101
|
});
|
|
@@ -187,55 +116,55 @@ var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)
|
|
|
187
116
|
open,
|
|
188
117
|
position
|
|
189
118
|
]);
|
|
190
|
-
var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core.useThemeName)(),
|
|
191
|
-
|
|
119
|
+
var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core.useThemeName)(), [isDragging, setIsDragging] = import_react.default.useState(!1), panResponder = import_react.default.useMemo(function() {
|
|
120
|
+
if (disableDrag || !frameSize || isShowingInnerSheet) return;
|
|
121
|
+
var minY = positions[0];
|
|
122
|
+
scrollBridge.paneMinY = minY;
|
|
123
|
+
var startY = at.current;
|
|
124
|
+
function setPanning(val) {
|
|
192
125
|
setIsDragging(val), import_constants2.SHEET_HIDDEN_STYLESHEET && (val ? import_constants2.SHEET_HIDDEN_STYLESHEET.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : import_constants2.SHEET_HIDDEN_STYLESHEET.innerText = "");
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
var startY =
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
126
|
+
}
|
|
127
|
+
var release = function(param) {
|
|
128
|
+
var { vy, dragAt } = param;
|
|
129
|
+
isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
|
|
130
|
+
for (var at2 = dragAt + startY, end = at2 + frameSize * vy * 0.2, closestPoint = 0, dist = Number.POSITIVE_INFINITY, i = 0; i < positions.length; i++) {
|
|
131
|
+
var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
132
|
+
curDist < dist && (dist = curDist, closestPoint = i);
|
|
133
|
+
}
|
|
134
|
+
setPosition(closestPoint), animateTo(closestPoint);
|
|
135
|
+
}, finish = function(_e, state2) {
|
|
136
|
+
release({
|
|
137
|
+
vy: state2.vy,
|
|
138
|
+
dragAt: state2.dy
|
|
139
|
+
});
|
|
140
|
+
}, previouslyScrolling = !1, onMoveShouldSet = function(e, param) {
|
|
141
|
+
var { dy } = param;
|
|
142
|
+
if (e.target === providerProps.handleRef.current)
|
|
143
|
+
return !0;
|
|
144
|
+
var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
145
|
+
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp && !import_constants.isWeb ? !1 : Math.abs(dy) > 5;
|
|
146
|
+
}, grant = function() {
|
|
147
|
+
setPanning(!0), stopSpring(), startY = at.current;
|
|
148
|
+
}, isExternalDrag = !1;
|
|
149
|
+
return scrollBridge.drag = function(dy) {
|
|
150
|
+
isExternalDrag || (isExternalDrag = !0, grant());
|
|
151
|
+
var to = dy + startY;
|
|
152
|
+
animatedNumber.setValue((0, import_helpers.resisted)(to, minY), {
|
|
153
|
+
type: "direct"
|
|
154
|
+
});
|
|
155
|
+
}, scrollBridge.release = release, import_react_native.PanResponder.create({
|
|
156
|
+
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
157
|
+
onPanResponderGrant: grant,
|
|
158
|
+
onPanResponderMove: function(_e, param) {
|
|
159
|
+
var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
160
|
+
animatedNumber.setValue(to, {
|
|
223
161
|
type: "direct"
|
|
224
162
|
});
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
animatedNumber.setValue(to, {
|
|
231
|
-
type: "direct"
|
|
232
|
-
});
|
|
233
|
-
},
|
|
234
|
-
onPanResponderEnd: finish,
|
|
235
|
-
onPanResponderTerminate: finish,
|
|
236
|
-
onPanResponderRelease: finish
|
|
237
|
-
});
|
|
238
|
-
}
|
|
163
|
+
},
|
|
164
|
+
onPanResponderEnd: finish,
|
|
165
|
+
onPanResponderTerminate: finish,
|
|
166
|
+
onPanResponderRelease: finish
|
|
167
|
+
});
|
|
239
168
|
}, [
|
|
240
169
|
disableDrag,
|
|
241
170
|
isShowingInnerSheet,
|
|
@@ -287,7 +216,7 @@ var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)
|
|
|
287
216
|
position,
|
|
288
217
|
isHidden
|
|
289
218
|
]);
|
|
290
|
-
var
|
|
219
|
+
var [opacity, setOpacity] = import_react.default.useState(open ? 1 : 0);
|
|
291
220
|
open && opacity === 0 && setOpacity(1), import_react.default.useEffect(function() {
|
|
292
221
|
if (!open) {
|
|
293
222
|
var tm = setTimeout(function() {
|
|
@@ -300,9 +229,10 @@ var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)
|
|
|
300
229
|
}, [
|
|
301
230
|
open
|
|
302
231
|
]);
|
|
303
|
-
var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ?
|
|
232
|
+
var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${import_constants.isWeb ? "dvh" : "%"}` : maxSnapPoint, contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.ParentSheetContext.Provider, {
|
|
304
233
|
value: nextParentContext,
|
|
305
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider,
|
|
234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, {
|
|
235
|
+
...providerProps,
|
|
306
236
|
children: [
|
|
307
237
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, {
|
|
308
238
|
custom: {
|
|
@@ -322,38 +252,39 @@ var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)
|
|
|
322
252
|
},
|
|
323
253
|
onLayout: handleMaxContentViewLayout
|
|
324
254
|
}),
|
|
325
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AnimatedView,
|
|
326
|
-
ref
|
|
327
|
-
|
|
328
|
-
onLayout: handleAnimationViewLayout
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AnimatedView, {
|
|
256
|
+
ref,
|
|
257
|
+
...panResponder == null ? void 0 : panResponder.panHandlers,
|
|
258
|
+
onLayout: handleAnimationViewLayout,
|
|
259
|
+
...!isDragging && {
|
|
260
|
+
// @ts-ignore for CSS driver this is necessary to attach the transition
|
|
261
|
+
animation
|
|
262
|
+
},
|
|
333
263
|
// @ts-ignore
|
|
334
264
|
disableClassName: !0,
|
|
335
265
|
style: [
|
|
336
|
-
|
|
266
|
+
{
|
|
337
267
|
position: "absolute",
|
|
338
268
|
zIndex,
|
|
339
269
|
width: "100%",
|
|
340
270
|
height: forcedContentHeight,
|
|
341
271
|
minHeight: forcedContentHeight,
|
|
342
|
-
opacity
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
272
|
+
opacity,
|
|
273
|
+
...(shouldHideParentSheet || !open) && {
|
|
274
|
+
pointerEvents: "none"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
346
277
|
animatedStyle
|
|
347
278
|
],
|
|
348
279
|
children: props.children
|
|
349
|
-
})
|
|
280
|
+
})
|
|
350
281
|
]
|
|
351
|
-
})
|
|
282
|
+
})
|
|
352
283
|
}), adaptContext = import_react.default.useContext(import_adapt.AdaptParentContext), shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
|
|
353
284
|
if (modal) {
|
|
354
|
-
var modalContents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal,
|
|
355
|
-
zIndex
|
|
356
|
-
|
|
285
|
+
var modalContents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, {
|
|
286
|
+
zIndex,
|
|
287
|
+
...portalProps,
|
|
357
288
|
children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContainerComponent, {
|
|
358
289
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
|
|
359
290
|
forceClassName: !0,
|
|
@@ -364,7 +295,7 @@ var hiddenSize = 10000.1, SheetImplementationCustom = (0, import_core.themeable)
|
|
|
364
295
|
})
|
|
365
296
|
})
|
|
366
297
|
})
|
|
367
|
-
})
|
|
298
|
+
});
|
|
368
299
|
return import_constants.isWeb ? modalContents : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.SheetInsideSheetContext.Provider, {
|
|
369
300
|
value: onInnerSheet,
|
|
370
301
|
children: modalContents
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/sheet/src/SheetImplementationCustom.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAClB,eAAmC,2BACnC,0BAAgC,sCAChC,sBAAgC,kCAChC,mBAAkE,+BAClE,cAQO,0BACP,gBAAuB,4BACvB,8BAAmC,0CAOnC,sBAAyD,yBAEzDA,oBAAwC,wBACxC,kBAA4D,uBAC5D,iBAAyB,sBACzB,sBAA8B,2BAE9B,2BAAkC,gCAClC,+BAAsC
|
|
5
|
-
"names": ["import_constants", "hiddenSize", "SheetImplementationCustom", "themeable", "React", "forwardRef", "props", "forwardedRef", "parentSheet", "useContext", "ParentSheetContext", "animation", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAClB,eAAmC,2BACnC,0BAAgC,sCAChC,sBAAgC,kCAChC,mBAAkE,+BAClE,cAQO,0BACP,gBAAuB,4BACvB,8BAAmC,0CAOnC,sBAAyD,yBAEzDA,oBAAwC,wBACxC,kBAA4D,uBAC5D,iBAAyB,sBACzB,sBAA8B,2BAE9B,2BAAkC,gCAClC,+BAAsC,oCAElCC,aAAa,SAEJC,gCAA4BC,uBACvCC,6BAAAA,QAAMC,WACJ,SAAmCC,OAAOC,cAAY;AACpD,MAAMC,cAAcJ,aAAAA,QAAMK,WAAWC,kCAAAA,GAE/B,EACJC,WACAC,iBAAiBC,qBACjBC,QAAQ,IACRC,SAASP,YAAYO,SAAS,GAC9BC,uBAAuB,IACvBC,4BAA4B,IAC5BC,aACAC,oBAAoBC,qBAAqBhB,aAAAA,QAAMiB,SAAQ,IACrDf,OAEEgB,wBAAoBC,gDAAAA,GACpBC,YAA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GACN;EACT;AAEA,MAAIN,SAAS;AACX,WAAIzI,UAAU,IAAU5B,aACjBA,aAAa8F,KAAKiB,IAAI/G,YAAYR,SAAAA;AAG3C,MAAI6K,SAAS,cAAc,OAAOzI,SAAU;AAC1C,WAAO5B,aAAa8F,KAAKiB,IAAI/G,YAAY8F,KAAKiC,IAAI,GAAGnG,KAAAA,CAAAA;AAGvD,MAAM2I,OAAMzE,KAAKiB,IAAI,KAAKjB,KAAKiC,IAAI,GAAGjD,OAAOlD,KAAAA,CAAAA,CAAAA,IAAW;AACxD,SAAIkD,OAAO2F,MAAMF,IAAAA,KACfG,QAAQC,KAAK,8BAAA,GACN,KAGF7E,KAAK8E,MAAM5K,aAAauK,OAAMvK,UAAAA;AACvC;",
|
|
5
|
+
"names": ["import_constants", "hiddenSize", "SheetImplementationCustom", "themeable", "React", "forwardRef", "props", "forwardedRef", "parentSheet", "useContext", "ParentSheetContext", "animation", "animationConfig", "animationConfigProp", "modal", "zIndex", "moveOnKeyboardChange", "unmountChildrenWhenHidden", "portalProps", "containerComponent", "ContainerComponent", "Fragment", "keyboardIsVisible", "useKeyboardVisible", "state", "useSheetOpenState", "overlayComponent", "setOverlayComponent", "useState", "providerProps", "useSheetProviderProps", "onOverlayComponent", "frameSize", "setFrameSize", "snapPoints", "snapPointsMode", "hasFit", "position", "setPosition", "scrollBridge", "screenSize", "setMaxContentSize", "maxSnapPoint", "open", "controller", "isHidden", "sheetRef", "useRef", "ref", "useComposedRefs", "animationProp", "animationPropConfig", "Array", "isArray", "getConfig", "animations", "isShowingInnerSheet", "setIsShowingInnerSheet", "shouldHideParentSheet", "isWeb", "parentSheetContext", "SheetInsideSheetContext", "onInnerSheet", "useCallback", "hasChild", "positions", "useMemo", "map", "point", "getYPositions", "animationDriver", "useConfiguration", "useAnimatedNumber", "useAnimatedNumberStyle", "useAnimatedNumberReaction", "AnimatedView", "View", "Stack", "useIsomorphicLayoutEffect", "nextParentContext", "animatedNumber", "at", "value", "hostRef", "current", "paneY", "stopSpring", "stop", "onFinishAnimate", "undefined", "hasntMeasured", "animateTo", "useEvent", "toValue", "setValue", "type", "duration", "disableDrag", "themeName", "useThemeName", "isDragging", "setIsDragging", "panResponder", "minY", "paneMinY", "startY", "setPanning", "val", "SHEET_HIDDEN_STYLESHEET", "innerText", "release", "vy", "dragAt", "isExternalDrag", "previouslyScrolling", "end", "closestPoint", "dist", "Number", "POSITIVE_INFINITY", "i", "length", "curDist", "finish", "_e", "dy", "onMoveShouldSet", "e", "target", "handleRef", "isScrolled", "y", "isDraggingUp", "isNearTop", "Math", "abs", "grant", "drag", "to", "resisted", "PanResponder", "create", "onMoveShouldSetPanResponder", "onPanResponderGrant", "onPanResponderMove", "toFull", "onPanResponderEnd", "onPanResponderTerminate", "onPanResponderRelease", "handleAnimationViewLayout", "next", "min", "nativeEvent", "layout", "height", "Dimensions", "get", "handleMaxContentViewLayout", "animatedStyle", "translateY", "transform", "sizeBeforeKeyboard", "useEffect", "keyboardShowListener", "Keyboard", "addListener", "currentPlatform", "max", "endCoordinates", "keyboardDidHideListener", "remove", "opacity", "setOpacity", "tm", "setTimeout", "clearTimeout", "forcedContentHeight", "contents", "_jsx", "Provider", "_jsxs", "SheetProvider", "AnimatePresence", "custom", "style", "top", "left", "right", "bottom", "pointerEvents", "onLayout", "panHandlers", "disableClassName", "width", "minHeight", "children", "adaptContext", "AdaptParentContext", "shouldMountChildren", "Boolean", "modalContents", "Portal", "Theme", "forceClassName", "name", "mode", "endsWith", "pct", "slice", "isNaN", "console", "warn", "round"]
|
|
6
6
|
}
|
|
@@ -26,64 +26,8 @@ __export(SheetScrollView_exports, {
|
|
|
26
26
|
SheetScrollView: () => SheetScrollView
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(SheetScrollView_exports);
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_compose_refs = require("@tamagui/compose-refs"), import_scroll_view = require("@tamagui/scroll-view"), import_SheetContext = require("./SheetContext")
|
|
30
|
-
|
|
31
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
32
|
-
value,
|
|
33
|
-
enumerable: !0,
|
|
34
|
-
configurable: !0,
|
|
35
|
-
writable: !0
|
|
36
|
-
}) : obj[key] = value, obj;
|
|
37
|
-
}
|
|
38
|
-
function _object_spread(target) {
|
|
39
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
40
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
41
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
42
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
43
|
-
}))), ownKeys2.forEach(function(key) {
|
|
44
|
-
_define_property(target, key, source[key]);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return target;
|
|
48
|
-
}
|
|
49
|
-
function ownKeys(object, enumerableOnly) {
|
|
50
|
-
var keys = Object.keys(object);
|
|
51
|
-
if (Object.getOwnPropertySymbols) {
|
|
52
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
53
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
54
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
55
|
-
})), keys.push.apply(keys, symbols);
|
|
56
|
-
}
|
|
57
|
-
return keys;
|
|
58
|
-
}
|
|
59
|
-
function _object_spread_props(target, source) {
|
|
60
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
61
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
62
|
-
}), target;
|
|
63
|
-
}
|
|
64
|
-
function _object_without_properties(source, excluded) {
|
|
65
|
-
if (source == null) return {};
|
|
66
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
67
|
-
if (Object.getOwnPropertySymbols) {
|
|
68
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
69
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
70
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
71
|
-
}
|
|
72
|
-
return target;
|
|
73
|
-
}
|
|
74
|
-
function _object_without_properties_loose(source, excluded) {
|
|
75
|
-
if (source == null) return {};
|
|
76
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
77
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
78
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
79
|
-
return target;
|
|
80
|
-
}
|
|
81
|
-
var SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ */ import_react.default.forwardRef(function(_param, ref) {
|
|
82
|
-
var __scopeSheet = _param.__scopeSheet, children = _param.children, onScroll = _param.onScroll, props = _object_without_properties(_param, [
|
|
83
|
-
"__scopeSheet",
|
|
84
|
-
"children",
|
|
85
|
-
"onScroll"
|
|
86
|
-
]), context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), scrollBridge = context.scrollBridge, scrollRef = import_react.default.useRef(null), state = import_react.default.useRef({
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_compose_refs = require("@tamagui/compose-refs"), import_scroll_view = require("@tamagui/scroll-view"), import_SheetContext = require("./SheetContext"), SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ */ import_react.default.forwardRef(function(param, ref) {
|
|
30
|
+
var { __scopeSheet, children, onScroll, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge } = context, scrollRef = import_react.default.useRef(null), state = import_react.default.useRef({
|
|
87
31
|
lastPageY: 0,
|
|
88
32
|
dragAt: 0,
|
|
89
33
|
dys: [],
|
|
@@ -106,13 +50,13 @@ var SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ *
|
|
|
106
50
|
});
|
|
107
51
|
}
|
|
108
52
|
};
|
|
109
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.ScrollView,
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_view.ScrollView, {
|
|
110
54
|
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
111
55
|
flex: 1,
|
|
112
56
|
scrollEventThrottle: 8,
|
|
113
57
|
// scrollEnabled={scrollEnabled}
|
|
114
58
|
onScroll: function(e) {
|
|
115
|
-
var y = e.nativeEvent.contentOffset
|
|
59
|
+
var { y } = e.nativeEvent.contentOffset;
|
|
116
60
|
scrollBridge.y = y, y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
|
|
117
61
|
},
|
|
118
62
|
// This assures that we do not skip the "scrollBridge" values processing
|
|
@@ -158,14 +102,14 @@ var SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ *
|
|
|
158
102
|
// }
|
|
159
103
|
// }}
|
|
160
104
|
onResponderRelease: release,
|
|
161
|
-
className: "_ovs-contain"
|
|
162
|
-
|
|
105
|
+
className: "_ovs-contain",
|
|
106
|
+
...props,
|
|
163
107
|
children: import_react.default.useMemo(function() {
|
|
164
108
|
return children;
|
|
165
109
|
}, [
|
|
166
110
|
children
|
|
167
111
|
])
|
|
168
|
-
})
|
|
112
|
+
});
|
|
169
113
|
});
|
|
170
114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
171
115
|
0 && (module.exports = {
|