react-native-sheet2 6.1.19 → 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.
Files changed (110) hide show
  1. package/README.md +754 -80
  2. package/{Sheet.podspec → Sheet2.podspec} +2 -2
  3. package/android/build.gradle +2 -25
  4. package/android/check.jks +0 -0
  5. package/android/src/main/AndroidManifest.xml +1 -2
  6. package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewComponentDescriptor.h +12 -0
  7. package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewShadowNode.cpp +17 -0
  8. package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewShadowNode.h +36 -0
  9. package/android/src/main/cpp/react/renderer/components/SheetViewSpec/SheetViewState.h +52 -0
  10. package/android/src/main/java/com/behavior/BottomSheetBehavior.java +84 -16
  11. package/android/src/main/java/com/sheet2/AppFittedSheet.kt +431 -0
  12. package/android/src/main/java/com/{sheet → sheet2}/BaseRNView.kt +38 -31
  13. package/android/src/main/java/com/sheet2/CenteredSheetDialog.kt +272 -0
  14. package/android/src/main/java/com/{sheet → sheet2}/CustomBottomSheetDialog.java +32 -4
  15. package/android/src/main/java/com/{sheet → sheet2}/DialogRootViewGroup.kt +54 -12
  16. package/android/src/main/java/com/sheet2/FragmentModalBottomSheet.kt +161 -0
  17. package/android/src/main/java/com/sheet2/InlineFooterPresenter.kt +74 -0
  18. package/android/src/main/java/com/sheet2/InlineSheetPresenter.kt +249 -0
  19. package/android/src/main/java/com/sheet2/PassThroughLayouts.kt +17 -0
  20. package/android/src/main/java/com/{sheet → sheet2}/SafeAreaUtils.kt +4 -5
  21. package/android/src/main/java/com/sheet2/Sheet2Package.kt +44 -0
  22. package/android/src/main/java/com/sheet2/Sheet2View.kt +5 -0
  23. package/android/src/main/java/com/sheet2/Sheet2ViewManager.kt +163 -0
  24. package/android/src/main/java/com/{sheet → sheet2}/SheetDismissEvent.kt +1 -1
  25. package/android/src/main/java/com/{sheet → sheet2}/SheetModule.kt +14 -3
  26. package/android/src/main/java/com/{sheet → sheet2}/SheetPackage.kt +2 -3
  27. package/android/src/main/java/com/sheet2/SheetTreeLog.kt +78 -0
  28. package/android/src/main/java/com/{sheet → sheet2}/utils.kt +1 -2
  29. package/android/src/main/jni/CMakeLists.txt +72 -0
  30. package/android/src/main/jni/SheetViewSpec.h +40 -0
  31. package/ios/FittedSheets/SheetOptions.swift +5 -0
  32. package/ios/FittedSheets/SheetTransition.swift +83 -4
  33. package/ios/FittedSheets/SheetViewController.swift +222 -24
  34. package/ios/HostFittedSheet.swift +440 -51
  35. package/ios/SheetModule.h +5 -4
  36. package/ios/SheetModule.mm +11 -1
  37. package/ios/SheetTreeLog.swift +52 -0
  38. package/ios/SheetView.mm +118 -31
  39. package/ios/SheetViewComponentDescriptor.h +24 -0
  40. package/ios/SheetViewShadowNode.cpp +17 -0
  41. package/ios/SheetViewShadowNode.h +37 -0
  42. package/ios/SheetViewState.h +54 -0
  43. package/package.json +44 -74
  44. package/react-native.config.js +6 -4
  45. package/src/FittedSheet.tsx +131 -71
  46. package/src/GlobalSheetView.tsx +209 -0
  47. package/src/NativeSheet.ts +4 -0
  48. package/src/PublicSheetView.tsx +2 -1
  49. package/src/SheetTreeLog.ts +39 -0
  50. package/src/SheetViewNativeComponent.ts +25 -4
  51. package/src/index.tsx +29 -4
  52. package/src/logger.ts +16 -0
  53. package/android/generated/java/com/facebook/react/viewmanagers/SheetViewManagerDelegate.java +0 -67
  54. package/android/generated/java/com/facebook/react/viewmanagers/SheetViewManagerInterface.java +0 -27
  55. package/android/generated/java/com/sheet/NativeSheetSpec.java +0 -78
  56. package/android/generated/jni/CMakeLists.txt +0 -36
  57. package/android/generated/jni/RNSheetViewSpec-generated.cpp +0 -50
  58. package/android/generated/jni/RNSheetViewSpec.h +0 -31
  59. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ComponentDescriptors.cpp +0 -22
  60. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ComponentDescriptors.h +0 -24
  61. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/EventEmitters.cpp +0 -24
  62. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/EventEmitters.h +0 -25
  63. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/Props.cpp +0 -33
  64. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/Props.h +0 -36
  65. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/RNSheetViewSpecJSI-generated.cpp +0 -46
  66. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/RNSheetViewSpecJSI.h +0 -98
  67. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ShadowNodes.cpp +0 -17
  68. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/ShadowNodes.h +0 -32
  69. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/States.cpp +0 -16
  70. package/android/generated/jni/react/renderer/components/RNSheetViewSpec/States.h +0 -29
  71. package/android/src/main/AndroidManifestNew.xml +0 -2
  72. package/android/src/main/java/com/sheet/AppFittedSheet.kt +0 -214
  73. package/android/src/main/java/com/sheet/FragmentModalBottomSheet.kt +0 -67
  74. package/android/src/main/java/com/sheet/SheetView.kt +0 -5
  75. package/android/src/main/java/com/sheet/SheetViewManager.kt +0 -106
  76. package/ios/generated/RNSheetViewSpec/ComponentDescriptors.cpp +0 -22
  77. package/ios/generated/RNSheetViewSpec/ComponentDescriptors.h +0 -24
  78. package/ios/generated/RNSheetViewSpec/EventEmitters.cpp +0 -24
  79. package/ios/generated/RNSheetViewSpec/EventEmitters.h +0 -25
  80. package/ios/generated/RNSheetViewSpec/Props.cpp +0 -33
  81. package/ios/generated/RNSheetViewSpec/Props.h +0 -36
  82. package/ios/generated/RNSheetViewSpec/RCTComponentViewHelpers.h +0 -44
  83. package/ios/generated/RNSheetViewSpec/RNSheetViewSpec-generated.mm +0 -60
  84. package/ios/generated/RNSheetViewSpec/RNSheetViewSpec.h +0 -100
  85. package/ios/generated/RNSheetViewSpec/ShadowNodes.cpp +0 -17
  86. package/ios/generated/RNSheetViewSpec/ShadowNodes.h +0 -32
  87. package/ios/generated/RNSheetViewSpec/States.cpp +0 -16
  88. package/ios/generated/RNSheetViewSpec/States.h +0 -29
  89. package/ios/generated/RNSheetViewSpecJSI-generated.cpp +0 -46
  90. package/ios/generated/RNSheetViewSpecJSI.h +0 -98
  91. package/lib/module/FittedSheet.js +0 -153
  92. package/lib/module/FittedSheet.js.map +0 -1
  93. package/lib/module/NativeSheet.ts +0 -17
  94. package/lib/module/PublicSheetView.js +0 -48
  95. package/lib/module/PublicSheetView.js.map +0 -1
  96. package/lib/module/SheetViewNativeComponent.ts +0 -31
  97. package/lib/module/index.js +0 -17
  98. package/lib/module/index.js.map +0 -1
  99. package/lib/module/package.json +0 -1
  100. package/lib/typescript/package.json +0 -1
  101. package/lib/typescript/src/FittedSheet.d.ts +0 -51
  102. package/lib/typescript/src/FittedSheet.d.ts.map +0 -1
  103. package/lib/typescript/src/NativeSheet.d.ts +0 -16
  104. package/lib/typescript/src/NativeSheet.d.ts.map +0 -1
  105. package/lib/typescript/src/PublicSheetView.d.ts +0 -12
  106. package/lib/typescript/src/PublicSheetView.d.ts.map +0 -1
  107. package/lib/typescript/src/SheetViewNativeComponent.d.ts +0 -22
  108. package/lib/typescript/src/SheetViewNativeComponent.d.ts.map +0 -1
  109. package/lib/typescript/src/index.d.ts +0 -12
  110. 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,
@@ -9,13 +9,32 @@ import {
9
9
  dismissFittedPresented,
10
10
  } from './PublicSheetView';
11
11
  import SheetModule from './NativeSheet';
12
+ import { addSheetTreeListener, getSheetTreeLog } from './SheetTreeLog';
13
+ import { setSheetLogsEnabled } from './logger';
12
14
 
13
- import { PortalProvider } from '@gorhom/portal';
14
15
  import type { ReactNode } from 'react';
16
+ import { Fragment } from 'react';
17
+ import {
18
+ GlobalSheetView,
19
+ presentGlobalFittedSheet,
20
+ dismissGlobalFittedSheet,
21
+ attachScrollViewToGlobalFittedSheet,
22
+ } from './GlobalSheetView';
15
23
 
16
- export function SheetProvider(props: { children: ReactNode }) {
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);
17
31
  return (
18
- <PortalProvider rootHostName={'SheetHost'}>{props.children}</PortalProvider>
32
+ <Fragment>
33
+ {props.children}
34
+ {!!props.addGlobalSheetView && (
35
+ <GlobalSheetView props={props.globalSheetProps} />
36
+ )}
37
+ </Fragment>
19
38
  );
20
39
  }
21
40
 
@@ -31,5 +50,11 @@ export {
31
50
  dismissFittedSheetsAll,
32
51
  dismissFittedPresented,
33
52
  attachScrollViewToFittedSheet,
53
+ presentGlobalFittedSheet,
54
+ dismissGlobalFittedSheet,
55
+ attachScrollViewToGlobalFittedSheet,
56
+ addSheetTreeListener,
57
+ getSheetTreeLog,
58
+ setSheetLogsEnabled,
34
59
  type FittedSheetParams,
35
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
+ }
@@ -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
- }
@@ -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 &params)
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 &params) {
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 &params);
25
- };
26
-
27
-
28
- JSI_EXPORT
29
- std::shared_ptr<TurboModule> RNSheetViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
-
31
- } // namespace facebook::react
@@ -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
@@ -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
@@ -1,98 +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: GenerateModuleH.js
8
- */
9
-
10
- #pragma once
11
-
12
- #include <ReactCommon/TurboModule.h>
13
- #include <react/bridging/Bridging.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
- class JSI_EXPORT NativeSheetCxxSpecJSI : public TurboModule {
19
- protected:
20
- NativeSheetCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
-
22
- public:
23
- virtual jsi::Object getConstants(jsi::Runtime &rt) = 0;
24
- virtual jsi::Object viewportSize(jsi::Runtime &rt) = 0;
25
- virtual void dismissAll(jsi::Runtime &rt) = 0;
26
- virtual void dismissPresented(jsi::Runtime &rt) = 0;
27
-
28
- };
29
-
30
- template <typename T>
31
- class JSI_EXPORT NativeSheetCxxSpec : public TurboModule {
32
- public:
33
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
34
- return delegate_.create(rt, propName);
35
- }
36
-
37
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
38
- return delegate_.getPropertyNames(runtime);
39
- }
40
-
41
- static constexpr std::string_view kModuleName = "Sheet";
42
-
43
- protected:
44
- NativeSheetCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
45
- : TurboModule(std::string{NativeSheetCxxSpec::kModuleName}, jsInvoker),
46
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
47
-
48
-
49
- private:
50
- class Delegate : public NativeSheetCxxSpecJSI {
51
- public:
52
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
53
- NativeSheetCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
54
-
55
- }
56
-
57
- jsi::Object getConstants(jsi::Runtime &rt) override {
58
- static_assert(
59
- bridging::getParameterCount(&T::getConstants) == 1,
60
- "Expected getConstants(...) to have 1 parameters");
61
-
62
- return bridging::callFromJs<jsi::Object>(
63
- rt, &T::getConstants, jsInvoker_, instance_);
64
- }
65
- jsi::Object viewportSize(jsi::Runtime &rt) override {
66
- static_assert(
67
- bridging::getParameterCount(&T::viewportSize) == 1,
68
- "Expected viewportSize(...) to have 1 parameters");
69
-
70
- return bridging::callFromJs<jsi::Object>(
71
- rt, &T::viewportSize, jsInvoker_, instance_);
72
- }
73
- void dismissAll(jsi::Runtime &rt) override {
74
- static_assert(
75
- bridging::getParameterCount(&T::dismissAll) == 1,
76
- "Expected dismissAll(...) to have 1 parameters");
77
-
78
- return bridging::callFromJs<void>(
79
- rt, &T::dismissAll, jsInvoker_, instance_);
80
- }
81
- void dismissPresented(jsi::Runtime &rt) override {
82
- static_assert(
83
- bridging::getParameterCount(&T::dismissPresented) == 1,
84
- "Expected dismissPresented(...) to have 1 parameters");
85
-
86
- return bridging::callFromJs<void>(
87
- rt, &T::dismissPresented, jsInvoker_, instance_);
88
- }
89
-
90
- private:
91
- friend class NativeSheetCxxSpec;
92
- T *instance_;
93
- };
94
-
95
- Delegate delegate_;
96
- };
97
-
98
- } // namespace facebook::react