react-native-sheet2 6.1.16 → 6.1.19
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/ios/SheetView.mm
CHANGED
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
#import <React/RCTConversions.h>
|
|
8
8
|
|
|
9
9
|
#import "RCTFabricComponentsPlugins.h"
|
|
10
|
+
|
|
11
|
+
#if __has_include("Sheet-Swift.h")
|
|
12
|
+
#import "Sheet-Swift.h"
|
|
13
|
+
#else
|
|
10
14
|
#import <Sheet/Sheet-Swift.h>
|
|
15
|
+
#endif
|
|
11
16
|
|
|
12
17
|
using namespace facebook::react;
|
|
13
18
|
|
|
@@ -37,12 +42,12 @@ using namespace facebook::react;
|
|
|
37
42
|
if (self = [super initWithFrame:frame]) {
|
|
38
43
|
static const auto defaultProps = std::make_shared<const SheetViewProps>();
|
|
39
44
|
_props = defaultProps;
|
|
40
|
-
|
|
45
|
+
|
|
41
46
|
_view = [[UIView alloc] init];
|
|
42
47
|
_view2 = [[HostFittedSheet alloc] init];
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
46
51
|
__weak SheetView *weakSelf = self;
|
|
47
52
|
_view2.onSheetDismiss = ^{
|
|
48
53
|
NSLog(@"😀 ---- onSheetDismiss");
|
|
@@ -51,10 +56,10 @@ using namespace facebook::react;
|
|
|
51
56
|
eventEmitter->onSheetDismiss({});
|
|
52
57
|
}
|
|
53
58
|
};
|
|
54
|
-
|
|
59
|
+
|
|
55
60
|
self.contentView = _view2;
|
|
56
61
|
}
|
|
57
|
-
|
|
62
|
+
|
|
58
63
|
return self;
|
|
59
64
|
}
|
|
60
65
|
|
|
@@ -63,7 +68,7 @@ using namespace facebook::react;
|
|
|
63
68
|
NSLog(@"😀 updateProps");
|
|
64
69
|
const auto &oldViewProps = *std::static_pointer_cast<SheetViewProps const>(_props);
|
|
65
70
|
const auto &newViewProps = *std::static_pointer_cast<SheetViewProps const>(props);
|
|
66
|
-
|
|
71
|
+
|
|
67
72
|
if (oldViewProps.maxWidth != newViewProps.maxWidth || oldViewProps.dismissable != newViewProps.dismissable || oldViewProps.topLeftRightCornerRadius != newViewProps.topLeftRightCornerRadius) {
|
|
68
73
|
[_view2 setFittedSheetParams:@{
|
|
69
74
|
@"maxWidth": @(newViewProps.maxWidth),
|
|
@@ -74,16 +79,16 @@ using namespace facebook::react;
|
|
|
74
79
|
|
|
75
80
|
auto color = RCTUIColorFromSharedColor(newViewProps.sheetBackgroundColor);
|
|
76
81
|
[_view2 setSheetBackgroundColor:color];
|
|
77
|
-
|
|
82
|
+
|
|
78
83
|
if (oldViewProps.passScrollViewReactTag != newViewProps.passScrollViewReactTag) {
|
|
79
84
|
[_view2 setPassScrollViewReactTag];
|
|
80
85
|
}
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
|
|
87
|
+
|
|
83
88
|
NSLog(@"----- %f", newViewProps.calculatedHeight);
|
|
84
89
|
[_view2 setCalculatedHeight:newViewProps.calculatedHeight];
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
|
|
91
|
+
|
|
87
92
|
[super updateProps:props oldProps:oldProps];
|
|
88
93
|
}
|
|
89
94
|
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { attachScrollViewToFittedSheet, dismissFittedSheet, presentFittedSheet, PublicSheetView, dismissFittedSheetsAll, dismissFittedPresented } from "./PublicSheetView.js";
|
|
4
|
+
import SheetModule from './NativeSheet';
|
|
4
5
|
import { PortalProvider } from '@gorhom/portal';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
export function SheetProvider(props) {
|
|
@@ -9,5 +10,8 @@ export function SheetProvider(props) {
|
|
|
9
10
|
children: props.children
|
|
10
11
|
});
|
|
11
12
|
}
|
|
13
|
+
export function viewportSize() {
|
|
14
|
+
return SheetModule.viewportSize();
|
|
15
|
+
}
|
|
12
16
|
export { PublicSheetView as FittedSheet, presentFittedSheet, dismissFittedSheet, dismissFittedSheetsAll, dismissFittedPresented, attachScrollViewToFittedSheet };
|
|
13
17
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["attachScrollViewToFittedSheet","dismissFittedSheet","presentFittedSheet","PublicSheetView","dismissFittedSheetsAll","dismissFittedPresented","PortalProvider","jsx","_jsx","SheetProvider","props","rootHostName","children","FittedSheet"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AACA,SACEA,6BAA6B,EAC7BC,kBAAkB,EAElBC,kBAAkB,EAClBC,eAAe,EACfC,sBAAsB,EACtBC,sBAAsB,QACjB,sBAAmB;
|
|
1
|
+
{"version":3,"names":["attachScrollViewToFittedSheet","dismissFittedSheet","presentFittedSheet","PublicSheetView","dismissFittedSheetsAll","dismissFittedPresented","SheetModule","PortalProvider","jsx","_jsx","SheetProvider","props","rootHostName","children","viewportSize","FittedSheet"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AACA,SACEA,6BAA6B,EAC7BC,kBAAkB,EAElBC,kBAAkB,EAClBC,eAAe,EACfC,sBAAsB,EACtBC,sBAAsB,QACjB,sBAAmB;AAC1B,OAAOC,WAAW,MAAM,eAAe;AAEvC,SAASC,cAAc,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,OAAO,SAASC,aAAaA,CAACC,KAA8B,EAAE;EAC5D,oBACEF,IAAA,CAACF,cAAc;IAACK,YAAY,EAAE,WAAY;IAAAC,QAAA,EAAEF,KAAK,CAACE;EAAQ,CAAiB,CAAC;AAEhF;AAEA,OAAO,SAASC,YAAYA,CAAA,EAAsC;EAChE,OAAOR,WAAW,CAACQ,YAAY,CAAC,CAAC;AACnC;AAEA,SACEX,eAAe,IAAIY,WAAW,EAE9Bb,kBAAkB,EAClBD,kBAAkB,EAClBG,sBAAsB,EACtBC,sBAAsB,EACtBL,6BAA6B","ignoreList":[]}
|
|
@@ -4,5 +4,9 @@ import type { ReactNode } from 'react';
|
|
|
4
4
|
export declare function SheetProvider(props: {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function viewportSize(): {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
7
11
|
export { PublicSheetView as FittedSheet, type FittedSheetRef, presentFittedSheet, dismissFittedSheet, dismissFittedSheetsAll, dismissFittedPresented, attachScrollViewToFittedSheet, type FittedSheetParams, };
|
|
8
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,KAAK,cAAc,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,6BAA6B,EAC7B,kBAAkB,EAClB,KAAK,cAAc,EACnB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAI3D;AAED,wBAAgB,YAAY,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAEhE;AAED,OAAO,EACL,eAAe,IAAI,WAAW,EAC9B,KAAK,cAAc,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,6BAA6B,EAC7B,KAAK,iBAAiB,GACvB,CAAC"}
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
dismissFittedSheetsAll,
|
|
9
9
|
dismissFittedPresented,
|
|
10
10
|
} from './PublicSheetView';
|
|
11
|
+
import SheetModule from './NativeSheet';
|
|
11
12
|
|
|
12
13
|
import { PortalProvider } from '@gorhom/portal';
|
|
13
14
|
import type { ReactNode } from 'react';
|
|
@@ -18,6 +19,10 @@ export function SheetProvider(props: { children: ReactNode }) {
|
|
|
18
19
|
);
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
export function viewportSize(): { width: number; height: number } {
|
|
23
|
+
return SheetModule.viewportSize();
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
export {
|
|
22
27
|
PublicSheetView as FittedSheet,
|
|
23
28
|
type FittedSheetRef,
|