react-native-sheet2 6.1.18 → 7.12.4
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/README.md +754 -80
- package/{Sheet.podspec → Sheet2.podspec} +2 -2
- package/android/build.gradle +2 -25
- package/android/check.jks +0 -0
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewComponentDescriptor.h +12 -0
- package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewShadowNode.cpp +17 -0
- package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewShadowNode.h +36 -0
- package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewState.h +52 -0
- package/android/src/main/java/com/behavior/BottomSheetBehavior.java +84 -16
- package/android/src/main/java/com/sheet2/AppFittedSheet.kt +431 -0
- package/android/src/main/java/com/{sheet → sheet2}/BaseRNView.kt +38 -31
- package/android/src/main/java/com/sheet2/CenteredSheetDialog.kt +272 -0
- package/android/src/main/java/com/{sheet → sheet2}/CustomBottomSheetDialog.java +32 -4
- package/android/src/main/java/com/{sheet → sheet2}/DialogRootViewGroup.kt +54 -12
- package/android/src/main/java/com/sheet2/FragmentModalBottomSheet.kt +161 -0
- package/android/src/main/java/com/sheet2/InlineFooterPresenter.kt +74 -0
- package/android/src/main/java/com/sheet2/InlineSheetPresenter.kt +249 -0
- package/android/src/main/java/com/sheet2/PassThroughLayouts.kt +17 -0
- package/android/src/main/java/com/{sheet → sheet2}/SafeAreaUtils.kt +4 -5
- package/android/src/main/java/com/sheet2/Sheet2Package.kt +44 -0
- package/android/src/main/java/com/sheet2/Sheet2View.kt +5 -0
- package/android/src/main/java/com/sheet2/Sheet2ViewManager.kt +163 -0
- package/android/src/main/java/com/{sheet → sheet2}/SheetDismissEvent.kt +1 -1
- package/android/src/main/java/com/{sheet → sheet2}/SheetModule.kt +14 -3
- package/android/src/main/java/com/{sheet → sheet2}/SheetPackage.kt +2 -3
- package/android/src/main/java/com/sheet2/SheetTreeLog.kt +78 -0
- package/android/src/main/java/com/{sheet → sheet2}/utils.kt +1 -2
- package/android/src/main/jni/CMakeLists.txt +72 -0
- package/android/src/main/jni/SheetViewSpec.h +40 -0
- package/ios/FittedSheets/SheetOptions.swift +5 -0
- package/ios/FittedSheets/SheetTransition.swift +83 -4
- package/ios/FittedSheets/SheetViewController.swift +222 -24
- package/ios/HostFittedSheet.swift +440 -51
- package/ios/SheetModule.h +5 -4
- package/ios/SheetModule.mm +11 -1
- package/ios/SheetTreeLog.swift +52 -0
- package/ios/SheetView.mm +118 -31
- package/ios/SheetViewComponentDescriptor.h +24 -0
- package/ios/SheetViewShadowNode.cpp +17 -0
- package/ios/SheetViewShadowNode.h +37 -0
- package/ios/SheetViewState.h +54 -0
- package/package.json +44 -74
- package/react-native.config.js +6 -4
- package/src/FittedSheet.tsx +131 -71
- package/src/GlobalSheetView.tsx +209 -0
- package/src/NativeSheet.ts +4 -0
- package/src/PublicSheetView.tsx +2 -1
- package/src/SheetTreeLog.ts +39 -0
- package/src/SheetViewNativeComponent.ts +25 -4
- package/src/index.tsx +34 -4
- package/src/logger.ts +16 -0
- package/android/generated/java/com/facebook/react/viewmanagers/SheetViewManagerDelegate.java +0 -67
- package/android/generated/java/com/facebook/react/viewmanagers/SheetViewManagerInterface.java +0 -27
- package/android/generated/java/com/sheet/NativeSheetSpec.java +0 -78
- package/android/generated/jni/CMakeLists.txt +0 -36
- package/android/generated/jni/RNSheetViewSpec-generated.cpp +0 -50
- package/android/generated/jni/RNSheetViewSpec.h +0 -31
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ComponentDescriptors.cpp +0 -22
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ComponentDescriptors.h +0 -24
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/EventEmitters.cpp +0 -24
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/EventEmitters.h +0 -25
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/Props.cpp +0 -33
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/Props.h +0 -36
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/RNSheetViewSpecJSI-generated.cpp +0 -46
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/RNSheetViewSpecJSI.h +0 -98
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ShadowNodes.cpp +0 -17
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ShadowNodes.h +0 -32
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/States.cpp +0 -16
- package/android/generated/jni/react/renderer/components/RNSheetViewSpec/States.h +0 -29
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/android/src/main/java/com/sheet/AppFittedSheet.kt +0 -214
- package/android/src/main/java/com/sheet/FragmentModalBottomSheet.kt +0 -67
- package/android/src/main/java/com/sheet/SheetView.kt +0 -5
- package/android/src/main/java/com/sheet/SheetViewManager.kt +0 -106
- package/ios/generated/RNSheetViewSpec/ComponentDescriptors.cpp +0 -22
- package/ios/generated/RNSheetViewSpec/ComponentDescriptors.h +0 -24
- package/ios/generated/RNSheetViewSpec/EventEmitters.cpp +0 -24
- package/ios/generated/RNSheetViewSpec/EventEmitters.h +0 -25
- package/ios/generated/RNSheetViewSpec/Props.cpp +0 -33
- package/ios/generated/RNSheetViewSpec/Props.h +0 -36
- package/ios/generated/RNSheetViewSpec/RCTComponentViewHelpers.h +0 -44
- package/ios/generated/RNSheetViewSpec/RNSheetViewSpec-generated.mm +0 -60
- package/ios/generated/RNSheetViewSpec/RNSheetViewSpec.h +0 -100
- package/ios/generated/RNSheetViewSpec/ShadowNodes.cpp +0 -17
- package/ios/generated/RNSheetViewSpec/ShadowNodes.h +0 -32
- package/ios/generated/RNSheetViewSpec/States.cpp +0 -16
- package/ios/generated/RNSheetViewSpec/States.h +0 -29
- package/ios/generated/RNSheetViewSpecJSI-generated.cpp +0 -46
- package/ios/generated/RNSheetViewSpecJSI.h +0 -98
- package/lib/module/FittedSheet.js +0 -153
- package/lib/module/FittedSheet.js.map +0 -1
- package/lib/module/NativeSheet.ts +0 -17
- package/lib/module/PublicSheetView.js +0 -48
- package/lib/module/PublicSheetView.js.map +0 -1
- package/lib/module/SheetViewNativeComponent.ts +0 -31
- package/lib/module/index.js +0 -13
- package/lib/module/index.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/typescript/package.json +0 -1
- package/lib/typescript/src/FittedSheet.d.ts +0 -51
- package/lib/typescript/src/FittedSheet.d.ts.map +0 -1
- package/lib/typescript/src/NativeSheet.d.ts +0 -16
- package/lib/typescript/src/NativeSheet.d.ts.map +0 -1
- package/lib/typescript/src/PublicSheetView.d.ts +0 -12
- package/lib/typescript/src/PublicSheetView.d.ts.map +0 -1
- package/lib/typescript/src/SheetViewNativeComponent.d.ts +0 -22
- package/lib/typescript/src/SheetViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -8
- package/lib/typescript/src/index.d.ts.map +0 -1
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FittedSheetParams } from './FittedSheet';
|
|
1
|
+
import type { FittedSheetParams, SheetProps } from './FittedSheet';
|
|
2
2
|
import {
|
|
3
3
|
attachScrollViewToFittedSheet,
|
|
4
4
|
dismissFittedSheet,
|
|
@@ -8,16 +8,40 @@ import {
|
|
|
8
8
|
dismissFittedSheetsAll,
|
|
9
9
|
dismissFittedPresented,
|
|
10
10
|
} from './PublicSheetView';
|
|
11
|
+
import SheetModule from './NativeSheet';
|
|
12
|
+
import { addSheetTreeListener, getSheetTreeLog } from './SheetTreeLog';
|
|
13
|
+
import { setSheetLogsEnabled } from './logger';
|
|
11
14
|
|
|
12
|
-
import { PortalProvider } from '@gorhom/portal';
|
|
13
15
|
import type { ReactNode } from 'react';
|
|
16
|
+
import { Fragment } from 'react';
|
|
17
|
+
import {
|
|
18
|
+
GlobalSheetView,
|
|
19
|
+
presentGlobalFittedSheet,
|
|
20
|
+
dismissGlobalFittedSheet,
|
|
21
|
+
attachScrollViewToGlobalFittedSheet,
|
|
22
|
+
} from './GlobalSheetView';
|
|
14
23
|
|
|
15
|
-
export function SheetProvider(props: {
|
|
24
|
+
export function SheetProvider(props: {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
addGlobalSheetView?: boolean;
|
|
27
|
+
enableLogs?: boolean;
|
|
28
|
+
globalSheetProps?: Omit<SheetProps, 'children' | 'onSheetDismiss'>;
|
|
29
|
+
}) {
|
|
30
|
+
if (props.enableLogs !== undefined) setSheetLogsEnabled(props.enableLogs);
|
|
16
31
|
return (
|
|
17
|
-
<
|
|
32
|
+
<Fragment>
|
|
33
|
+
{props.children}
|
|
34
|
+
{!!props.addGlobalSheetView && (
|
|
35
|
+
<GlobalSheetView props={props.globalSheetProps} />
|
|
36
|
+
)}
|
|
37
|
+
</Fragment>
|
|
18
38
|
);
|
|
19
39
|
}
|
|
20
40
|
|
|
41
|
+
export function viewportSize(): { width: number; height: number } {
|
|
42
|
+
return SheetModule.viewportSize();
|
|
43
|
+
}
|
|
44
|
+
|
|
21
45
|
export {
|
|
22
46
|
PublicSheetView as FittedSheet,
|
|
23
47
|
type FittedSheetRef,
|
|
@@ -26,5 +50,11 @@ export {
|
|
|
26
50
|
dismissFittedSheetsAll,
|
|
27
51
|
dismissFittedPresented,
|
|
28
52
|
attachScrollViewToFittedSheet,
|
|
53
|
+
presentGlobalFittedSheet,
|
|
54
|
+
dismissGlobalFittedSheet,
|
|
55
|
+
attachScrollViewToGlobalFittedSheet,
|
|
56
|
+
addSheetTreeListener,
|
|
57
|
+
getSheetTreeLog,
|
|
58
|
+
setSheetLogsEnabled,
|
|
29
59
|
type FittedSheetParams,
|
|
30
60
|
};
|
package/src/logger.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import SheetModule from './NativeSheet';
|
|
2
|
+
|
|
3
|
+
let enabled = false;
|
|
4
|
+
|
|
5
|
+
export function setSheetLogsEnabled(value: boolean) {
|
|
6
|
+
enabled = value;
|
|
7
|
+
SheetModule.setLogsEnabled?.(value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function sheetLog(...args: any[]) {
|
|
11
|
+
if (enabled) console.log(...args);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function sheetWarn(...args: any[]) {
|
|
15
|
+
if (enabled) console.warn(...args);
|
|
16
|
+
}
|
package/android/generated/java/com/facebook/react/viewmanagers/SheetViewManagerDelegate.java
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.bridge.ColorPropConverter;
|
|
15
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
16
|
-
import com.facebook.react.uimanager.BaseViewManager;
|
|
17
|
-
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
18
|
-
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
19
|
-
|
|
20
|
-
public class SheetViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & SheetViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
21
|
-
public SheetViewManagerDelegate(U viewManager) {
|
|
22
|
-
super(viewManager);
|
|
23
|
-
}
|
|
24
|
-
@Override
|
|
25
|
-
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
26
|
-
switch (propName) {
|
|
27
|
-
case "dismissable":
|
|
28
|
-
mViewManager.setDismissable(view, value == null ? false : (boolean) value);
|
|
29
|
-
break;
|
|
30
|
-
case "maxWidth":
|
|
31
|
-
mViewManager.setMaxWidth(view, value == null ? 0f : ((Double) value).doubleValue());
|
|
32
|
-
break;
|
|
33
|
-
case "maxHeight":
|
|
34
|
-
mViewManager.setMaxHeight(view, value == null ? 0f : ((Double) value).doubleValue());
|
|
35
|
-
break;
|
|
36
|
-
case "minHeight":
|
|
37
|
-
mViewManager.setMinHeight(view, value == null ? 0f : ((Double) value).doubleValue());
|
|
38
|
-
break;
|
|
39
|
-
case "calculatedHeight":
|
|
40
|
-
mViewManager.setCalculatedHeight(view, value == null ? 0f : ((Double) value).doubleValue());
|
|
41
|
-
break;
|
|
42
|
-
case "topLeftRightCornerRadius":
|
|
43
|
-
mViewManager.setTopLeftRightCornerRadius(view, value == null ? 0f : ((Double) value).doubleValue());
|
|
44
|
-
break;
|
|
45
|
-
case "isSystemUILight":
|
|
46
|
-
mViewManager.setIsSystemUILight(view, value == null ? false : (boolean) value);
|
|
47
|
-
break;
|
|
48
|
-
case "passScrollViewReactTag":
|
|
49
|
-
mViewManager.setPassScrollViewReactTag(view, value == null ? null : (String) value);
|
|
50
|
-
break;
|
|
51
|
-
case "sheetBackgroundColor":
|
|
52
|
-
mViewManager.setSheetBackgroundColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
53
|
-
break;
|
|
54
|
-
default:
|
|
55
|
-
super.setProperty(view, propName, value);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@Override
|
|
60
|
-
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
|
|
61
|
-
switch (commandName) {
|
|
62
|
-
case "dismissSheet":
|
|
63
|
-
mViewManager.dismissSheet(view);
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
package/android/generated/java/com/facebook/react/viewmanagers/SheetViewManagerInterface.java
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
15
|
-
|
|
16
|
-
public interface SheetViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
17
|
-
void setDismissable(T view, boolean value);
|
|
18
|
-
void setMaxWidth(T view, double value);
|
|
19
|
-
void setMaxHeight(T view, double value);
|
|
20
|
-
void setMinHeight(T view, double value);
|
|
21
|
-
void setCalculatedHeight(T view, double value);
|
|
22
|
-
void setTopLeftRightCornerRadius(T view, double value);
|
|
23
|
-
void setIsSystemUILight(T view, boolean value);
|
|
24
|
-
void setPassScrollViewReactTag(T view, @Nullable String value);
|
|
25
|
-
void setSheetBackgroundColor(T view, @Nullable Integer value);
|
|
26
|
-
void dismissSheet(T view);
|
|
27
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.sheet;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
17
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
18
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
19
|
-
import com.facebook.react.bridge.WritableMap;
|
|
20
|
-
import com.facebook.react.common.build.ReactBuildConfig;
|
|
21
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
22
|
-
import java.util.Arrays;
|
|
23
|
-
import java.util.HashSet;
|
|
24
|
-
import java.util.Map;
|
|
25
|
-
import java.util.Set;
|
|
26
|
-
import javax.annotation.Nonnull;
|
|
27
|
-
import javax.annotation.Nullable;
|
|
28
|
-
|
|
29
|
-
public abstract class NativeSheetSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
30
|
-
public static final String NAME = "Sheet";
|
|
31
|
-
|
|
32
|
-
public NativeSheetSpec(ReactApplicationContext reactContext) {
|
|
33
|
-
super(reactContext);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@Override
|
|
37
|
-
public @Nonnull String getName() {
|
|
38
|
-
return NAME;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
protected abstract Map<String, Object> getTypedExportedConstants();
|
|
42
|
-
|
|
43
|
-
@Override
|
|
44
|
-
@DoNotStrip
|
|
45
|
-
public final @Nullable Map<String, Object> getConstants() {
|
|
46
|
-
Map<String, Object> constants = getTypedExportedConstants();
|
|
47
|
-
if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
|
|
48
|
-
Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
|
|
49
|
-
"insets"
|
|
50
|
-
));
|
|
51
|
-
Set<String> optionalFlowConstants = new HashSet<>();
|
|
52
|
-
Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
|
|
53
|
-
undeclaredConstants.removeAll(obligatoryFlowConstants);
|
|
54
|
-
undeclaredConstants.removeAll(optionalFlowConstants);
|
|
55
|
-
if (!undeclaredConstants.isEmpty()) {
|
|
56
|
-
throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
|
|
57
|
-
}
|
|
58
|
-
undeclaredConstants = obligatoryFlowConstants;
|
|
59
|
-
undeclaredConstants.removeAll(constants.keySet());
|
|
60
|
-
if (!undeclaredConstants.isEmpty()) {
|
|
61
|
-
throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return constants;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
68
|
-
@DoNotStrip
|
|
69
|
-
public abstract WritableMap viewportSize();
|
|
70
|
-
|
|
71
|
-
@ReactMethod
|
|
72
|
-
@DoNotStrip
|
|
73
|
-
public abstract void dismissAll();
|
|
74
|
-
|
|
75
|
-
@ReactMethod
|
|
76
|
-
@DoNotStrip
|
|
77
|
-
public abstract void dismissPresented();
|
|
78
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNSheetViewSpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_RNSheetViewSpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_RNSheetViewSpec PUBLIC . react/renderer/components/RNSheetViewSpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_RNSheetViewSpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_RNSheetViewSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "RNSheetViewSpec.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
static facebook::jsi::Value __hostFunction_NativeSheetSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
-
static jmethodID cachedMethodId = nullptr;
|
|
17
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ObjectKind, "getConstants", "()Ljava/util/Map;", args, count, cachedMethodId);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static facebook::jsi::Value __hostFunction_NativeSheetSpecJSI_viewportSize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
21
|
-
static jmethodID cachedMethodId = nullptr;
|
|
22
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ObjectKind, "viewportSize", "()Lcom/facebook/react/bridge/WritableMap;", args, count, cachedMethodId);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static facebook::jsi::Value __hostFunction_NativeSheetSpecJSI_dismissAll(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
26
|
-
static jmethodID cachedMethodId = nullptr;
|
|
27
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "dismissAll", "()V", args, count, cachedMethodId);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static facebook::jsi::Value __hostFunction_NativeSheetSpecJSI_dismissPresented(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
31
|
-
static jmethodID cachedMethodId = nullptr;
|
|
32
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "dismissPresented", "()V", args, count, cachedMethodId);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
NativeSheetSpecJSI::NativeSheetSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
36
|
-
: JavaTurboModule(params) {
|
|
37
|
-
methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSheetSpecJSI_getConstants};
|
|
38
|
-
methodMap_["viewportSize"] = MethodMetadata {0, __hostFunction_NativeSheetSpecJSI_viewportSize};
|
|
39
|
-
methodMap_["dismissAll"] = MethodMetadata {0, __hostFunction_NativeSheetSpecJSI_dismissAll};
|
|
40
|
-
methodMap_["dismissPresented"] = MethodMetadata {0, __hostFunction_NativeSheetSpecJSI_dismissPresented};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
std::shared_ptr<TurboModule> RNSheetViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
44
|
-
if (moduleName == "Sheet") {
|
|
45
|
-
return std::make_shared<NativeSheetSpecJSI>(params);
|
|
46
|
-
}
|
|
47
|
-
return nullptr;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
} // namespace facebook::react
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
-
#include <ReactCommon/TurboModule.h>
|
|
15
|
-
#include <jsi/jsi.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* JNI C++ class for module 'NativeSheet'
|
|
21
|
-
*/
|
|
22
|
-
class JSI_EXPORT NativeSheetSpecJSI : public JavaTurboModule {
|
|
23
|
-
public:
|
|
24
|
-
NativeSheetSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
JSI_EXPORT
|
|
29
|
-
std::shared_ptr<TurboModule> RNSheetViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
-
|
|
31
|
-
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ComponentDescriptors.cpp
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "ComponentDescriptors.h"
|
|
12
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
void RNSheetViewSpec_registerComponentDescriptorsFromCodegen(
|
|
18
|
-
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
-
registry->add(concreteComponentDescriptorProvider<SheetViewComponentDescriptor>());
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
} // namespace facebook::react
|
package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ComponentDescriptors.h
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include "ShadowNodes.h"
|
|
14
|
-
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
using SheetViewComponentDescriptor = ConcreteComponentDescriptor<SheetViewShadowNode>;
|
|
20
|
-
|
|
21
|
-
void RNSheetViewSpec_registerComponentDescriptorsFromCodegen(
|
|
22
|
-
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
-
|
|
24
|
-
} // namespace facebook::react
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "EventEmitters.h"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
namespace facebook::react {
|
|
15
|
-
|
|
16
|
-
void SheetViewEventEmitter::onSheetDismiss(OnSheetDismiss $event) const {
|
|
17
|
-
dispatchEvent("sheetDismiss", [](jsi::Runtime &runtime) {
|
|
18
|
-
auto $payload = jsi::Object(runtime);
|
|
19
|
-
|
|
20
|
-
return $payload;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
} // namespace facebook::react
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
class SheetViewEventEmitter : public ViewEventEmitter {
|
|
17
|
-
public:
|
|
18
|
-
using ViewEventEmitter::ViewEventEmitter;
|
|
19
|
-
|
|
20
|
-
struct OnSheetDismiss {
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
void onSheetDismiss(OnSheetDismiss value) const;
|
|
24
|
-
};
|
|
25
|
-
} // namespace facebook::react
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "Props.h"
|
|
12
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
-
#include <react/renderer/core/propsConversions.h>
|
|
14
|
-
|
|
15
|
-
namespace facebook::react {
|
|
16
|
-
|
|
17
|
-
SheetViewProps::SheetViewProps(
|
|
18
|
-
const PropsParserContext &context,
|
|
19
|
-
const SheetViewProps &sourceProps,
|
|
20
|
-
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
21
|
-
|
|
22
|
-
dismissable(convertRawProp(context, rawProps, "dismissable", sourceProps.dismissable, {false})),
|
|
23
|
-
maxWidth(convertRawProp(context, rawProps, "maxWidth", sourceProps.maxWidth, {0.0})),
|
|
24
|
-
maxHeight(convertRawProp(context, rawProps, "maxHeight", sourceProps.maxHeight, {0.0})),
|
|
25
|
-
minHeight(convertRawProp(context, rawProps, "minHeight", sourceProps.minHeight, {0.0})),
|
|
26
|
-
calculatedHeight(convertRawProp(context, rawProps, "calculatedHeight", sourceProps.calculatedHeight, {0.0})),
|
|
27
|
-
topLeftRightCornerRadius(convertRawProp(context, rawProps, "topLeftRightCornerRadius", sourceProps.topLeftRightCornerRadius, {0.0})),
|
|
28
|
-
isSystemUILight(convertRawProp(context, rawProps, "isSystemUILight", sourceProps.isSystemUILight, {false})),
|
|
29
|
-
passScrollViewReactTag(convertRawProp(context, rawProps, "passScrollViewReactTag", sourceProps.passScrollViewReactTag, {})),
|
|
30
|
-
sheetBackgroundColor(convertRawProp(context, rawProps, "sheetBackgroundColor", sourceProps.sheetBackgroundColor, {}))
|
|
31
|
-
{}
|
|
32
|
-
|
|
33
|
-
} // namespace facebook::react
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
-
*/
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include <react/renderer/components/view/ViewProps.h>
|
|
13
|
-
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
-
#include <react/renderer/graphics/Color.h>
|
|
15
|
-
|
|
16
|
-
namespace facebook::react {
|
|
17
|
-
|
|
18
|
-
class SheetViewProps final : public ViewProps {
|
|
19
|
-
public:
|
|
20
|
-
SheetViewProps() = default;
|
|
21
|
-
SheetViewProps(const PropsParserContext& context, const SheetViewProps &sourceProps, const RawProps &rawProps);
|
|
22
|
-
|
|
23
|
-
#pragma mark - Props
|
|
24
|
-
|
|
25
|
-
bool dismissable{false};
|
|
26
|
-
double maxWidth{0.0};
|
|
27
|
-
double maxHeight{0.0};
|
|
28
|
-
double minHeight{0.0};
|
|
29
|
-
double calculatedHeight{0.0};
|
|
30
|
-
double topLeftRightCornerRadius{0.0};
|
|
31
|
-
bool isSystemUILight{false};
|
|
32
|
-
std::string passScrollViewReactTag{};
|
|
33
|
-
SharedColor sheetBackgroundColor{};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
} // namespace facebook::react
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#include "RNSheetViewSpecJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
static jsi::Value __hostFunction_NativeSheetCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
-
return static_cast<NativeSheetCxxSpecJSI *>(&turboModule)->getConstants(
|
|
16
|
-
rt
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
static jsi::Value __hostFunction_NativeSheetCxxSpecJSI_viewportSize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
20
|
-
return static_cast<NativeSheetCxxSpecJSI *>(&turboModule)->viewportSize(
|
|
21
|
-
rt
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
static jsi::Value __hostFunction_NativeSheetCxxSpecJSI_dismissAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
25
|
-
static_cast<NativeSheetCxxSpecJSI *>(&turboModule)->dismissAll(
|
|
26
|
-
rt
|
|
27
|
-
);
|
|
28
|
-
return jsi::Value::undefined();
|
|
29
|
-
}
|
|
30
|
-
static jsi::Value __hostFunction_NativeSheetCxxSpecJSI_dismissPresented(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
31
|
-
static_cast<NativeSheetCxxSpecJSI *>(&turboModule)->dismissPresented(
|
|
32
|
-
rt
|
|
33
|
-
);
|
|
34
|
-
return jsi::Value::undefined();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
NativeSheetCxxSpecJSI::NativeSheetCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
38
|
-
: TurboModule("Sheet", jsInvoker) {
|
|
39
|
-
methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeSheetCxxSpecJSI_getConstants};
|
|
40
|
-
methodMap_["viewportSize"] = MethodMetadata {0, __hostFunction_NativeSheetCxxSpecJSI_viewportSize};
|
|
41
|
-
methodMap_["dismissAll"] = MethodMetadata {0, __hostFunction_NativeSheetCxxSpecJSI_dismissAll};
|
|
42
|
-
methodMap_["dismissPresented"] = MethodMetadata {0, __hostFunction_NativeSheetCxxSpecJSI_dismissPresented};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} // namespace facebook::react
|