diff --git a/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift b/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift index a5ce7ca8..8f8c6f41 100644 --- a/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift +++ b/ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift @@ -19,10 +19,15 @@ public final class RNIModalSheetViewDelegate: UIView, RNIContentView { public enum Events: String, CaseIterable { case onModalWillPresent; case onModalDidPresent; + case onModalWillShow; case onModalDidShow; + case onModalWillHide; case onModalDidHide; + + case onModalSheetStateWillChange; + case onModalSheetStateDidChange; }; public static var propKeyPathMap: PropKeyPathMap { diff --git a/ios/RNIModalSheetView/RNIModalSheetViewManager.mm b/ios/RNIModalSheetView/RNIModalSheetViewManager.mm index 35d13027..0154ffa5 100644 --- a/ios/RNIModalSheetView/RNIModalSheetViewManager.mm +++ b/ios/RNIModalSheetView/RNIModalSheetViewManager.mm @@ -37,6 +37,9 @@ - (UIView *)view RNI_EXPORT_VIEW_EVENT(onModalWillHide, RCTBubblingEventBlock); RNI_EXPORT_VIEW_EVENT(onModalDidHide, RCTBubblingEventBlock); +RNI_EXPORT_VIEW_EVENT(onModalSheetStateWillChange, RCTBubblingEventBlock); +RNI_EXPORT_VIEW_EVENT(onModalSheetStateDidChange, RCTBubblingEventBlock); + #endif @end diff --git a/src/components/ModalSheetView/ModalSheetViewTypes.tsx b/src/components/ModalSheetView/ModalSheetViewTypes.tsx index 5ea0e2d9..32ee171f 100644 --- a/src/components/ModalSheetView/ModalSheetViewTypes.tsx +++ b/src/components/ModalSheetView/ModalSheetViewTypes.tsx @@ -44,6 +44,10 @@ export type ModalSheetViewInheritedProps = Pick; export type ModalSheetViewBaseProps = { @@ -53,5 +57,4 @@ export type ModalSheetViewBaseProps = { export type ModalSheetViewProps = PropsWithChildren< ModalSheetViewInheritedProps & ModalSheetViewBaseProps - & ViewProps >; \ No newline at end of file diff --git a/src/native_components/RNIModalSheetVIew/RNIModalSheetNativeView.ts b/src/native_components/RNIModalSheetVIew/RNIModalSheetNativeView.ts index dea1b054..6b445e92 100644 --- a/src/native_components/RNIModalSheetVIew/RNIModalSheetNativeView.ts +++ b/src/native_components/RNIModalSheetVIew/RNIModalSheetNativeView.ts @@ -6,6 +6,7 @@ import { type NativeProps as RNIModalSheetViewNativeComponentProps, } from './RNIModalSheetViewNativeComponent'; +import type { OnModalSheetStateDidChangeEvent, OnModalSheetStateWillChangeEvent } from './RNIModalSheetViewEvents'; import type { OnModalWillPresentEvent, OnModalDidPresentEvent, OnModalWillShowEvent, OnModalDidShowEvent, OnModalWillHideEvent, OnModalDidHideEvent } from '../../types/CommonModalEvents'; @@ -23,6 +24,9 @@ export type RNIModalSheetNativeViewBaseProps = RemapObject; export type RNIModalSheetNativeViewProps = diff --git a/src/native_components/RNIModalSheetVIew/RNIModalSheetViewEvents.ts b/src/native_components/RNIModalSheetVIew/RNIModalSheetViewEvents.ts index 15f4b446..5bc2655c 100644 --- a/src/native_components/RNIModalSheetVIew/RNIModalSheetViewEvents.ts +++ b/src/native_components/RNIModalSheetVIew/RNIModalSheetViewEvents.ts @@ -1,7 +1,21 @@ -import type { ViewProps } from 'react-native'; -import type { OnDidSetViewIDEventPayload } from 'react-native-ios-utilities'; - import type { BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; +// MARK: Event Objects +// ------------------- + +export type OnModalSheetStateWillChangeEventPayload = Readonly<{ +}>; + +export type OnModalSheetStateDidChangeEventPayload = Readonly<{ +}>; + +// MARK: Events +// ------------ + +export type OnModalSheetStateWillChangeEvent = + BubblingEventHandler; + +export type OnModalSheetStateDidChangeEvent = + BubblingEventHandler; diff --git a/src/native_components/RNIModalSheetVIew/RNIModalSheetViewNativeComponent.ts b/src/native_components/RNIModalSheetVIew/RNIModalSheetViewNativeComponent.ts index 28db184b..7648cfc9 100644 --- a/src/native_components/RNIModalSheetVIew/RNIModalSheetViewNativeComponent.ts +++ b/src/native_components/RNIModalSheetVIew/RNIModalSheetViewNativeComponent.ts @@ -16,6 +16,9 @@ export interface NativeProps extends ViewProps { onModalWillHide?: BubblingEventHandler<{}>; onModalDidHide?: BubblingEventHandler<{}>; + onModalSheetStateWillChange?: BubblingEventHandler<{}>; + onModalSheetStateDidChange?: BubblingEventHandler<{}>; + // value prop stubs reactChildrenCount: Int32; };