@lodev09/react-native-true-sheet 3.7.3 → 3.7.4-beta.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/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +0 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +29 -30
- package/android/src/main/java/com/lodev09/truesheet/core/RNScreensFragmentObserver.kt +65 -14
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetStackManager.kt +1 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +4 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +13 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.h +11 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.cpp +12 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.h +10 -0
- package/ios/TrueSheetView.mm +72 -14
- package/ios/TrueSheetViewController.h +0 -15
- package/ios/TrueSheetViewController.mm +52 -77
- package/ios/core/RNScreensEventObserver.h +43 -0
- package/ios/core/RNScreensEventObserver.mm +119 -0
- package/ios/core/TrueSheetBlurView.mm +26 -22
- package/lib/module/TrueSheet.js +15 -5
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +4 -0
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TrueSheet.tsx +15 -3
|
@@ -483,10 +483,6 @@ class TrueSheetView(private val reactContext: ThemedReactContext) :
|
|
|
483
483
|
eventDispatcher?.dispatchEvent(BackPressEvent(surfaceId, id))
|
|
484
484
|
}
|
|
485
485
|
|
|
486
|
-
override fun viewControllerDidDetectScreenDisappear() {
|
|
487
|
-
dismissAll(animated = true) {}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
486
|
override fun viewControllerDidDetectScreenDismiss() {
|
|
491
487
|
resetTranslation()
|
|
492
488
|
}
|
|
@@ -63,7 +63,6 @@ interface TrueSheetViewControllerDelegate {
|
|
|
63
63
|
fun viewControllerWillBlur()
|
|
64
64
|
fun viewControllerDidBlur()
|
|
65
65
|
fun viewControllerDidBackPress()
|
|
66
|
-
fun viewControllerDidDetectScreenDisappear()
|
|
67
66
|
fun viewControllerDidDetectScreenDismiss()
|
|
68
67
|
}
|
|
69
68
|
|
|
@@ -92,7 +91,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
|
|
|
92
91
|
private const val DEFAULT_CORNER_RADIUS = 16 // dp
|
|
93
92
|
private const val TRANSLATE_ANIMATION_DURATION = 200L
|
|
94
93
|
private const val DISMISS_DURATION = 200L
|
|
95
|
-
private const val
|
|
94
|
+
private const val SCREEN_FADE_DURATION = 150L
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
// =============================================================================
|
|
@@ -132,7 +131,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
|
|
|
132
131
|
|
|
133
132
|
private var interactionState: InteractionState = InteractionState.Idle
|
|
134
133
|
private var isDismissing = false
|
|
135
|
-
internal var
|
|
134
|
+
internal var wasHiddenByScreen = false
|
|
136
135
|
private var shouldAnimatePresent = false
|
|
137
136
|
private var isPresentAnimating = false
|
|
138
137
|
|
|
@@ -340,7 +339,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
|
|
|
340
339
|
isDismissing = false
|
|
341
340
|
isPresented = false
|
|
342
341
|
isSheetVisible = false
|
|
343
|
-
|
|
342
|
+
wasHiddenByScreen = false
|
|
344
343
|
cachedContentHeight = 0
|
|
345
344
|
cachedHeaderHeight = 0
|
|
346
345
|
isPresentAnimating = false
|
|
@@ -568,32 +567,32 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
|
|
|
568
567
|
private fun setupModalObserver() {
|
|
569
568
|
rnScreensObserver = RNScreensFragmentObserver(
|
|
570
569
|
reactContext = reactContext,
|
|
571
|
-
|
|
572
|
-
if (isPresented &&
|
|
573
|
-
|
|
574
|
-
|
|
570
|
+
onScreenPresented = {
|
|
571
|
+
if (isPresented && isTopmostSheet) {
|
|
572
|
+
if (isSheetVisible) {
|
|
573
|
+
dismissKeyboard()
|
|
574
|
+
post { hideForScreen() }
|
|
575
|
+
} else {
|
|
576
|
+
// Sheet is already hidden, just mark it
|
|
577
|
+
wasHiddenByScreen = true
|
|
578
|
+
}
|
|
575
579
|
}
|
|
576
580
|
},
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
581
|
+
onScreenWillDismiss = {
|
|
582
|
+
val hasPushedScreens = rnScreensObserver?.hasPushedScreens == true
|
|
583
|
+
if (isPresented && wasHiddenByScreen && isTopmostSheet && !hasPushedScreens) {
|
|
584
|
+
showAfterScreen()
|
|
580
585
|
delegate?.viewControllerDidDetectScreenDismiss()
|
|
581
586
|
}
|
|
582
587
|
},
|
|
583
|
-
|
|
584
|
-
if (isPresented &&
|
|
585
|
-
|
|
588
|
+
onScreenDidDismiss = {
|
|
589
|
+
if (isPresented && wasHiddenByScreen) {
|
|
590
|
+
wasHiddenByScreen = false
|
|
586
591
|
// Restore parent sheet after this sheet is restored
|
|
587
592
|
parentSheetView?.viewController?.let { parent ->
|
|
588
|
-
post { parent.
|
|
593
|
+
post { parent.showAfterScreen() }
|
|
589
594
|
}
|
|
590
595
|
}
|
|
591
|
-
},
|
|
592
|
-
onNonModalScreenPushed = {
|
|
593
|
-
// Only handle on root sheet (no parent) to trigger dismissAll
|
|
594
|
-
if (isPresented && isSheetVisible && parentSheetView == null) {
|
|
595
|
-
delegate?.viewControllerDidDetectScreenDisappear()
|
|
596
|
-
}
|
|
597
596
|
}
|
|
598
597
|
)
|
|
599
598
|
rnScreensObserver?.start()
|
|
@@ -609,29 +608,29 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
|
|
|
609
608
|
dimViews.forEach { it.visibility = if (visible) VISIBLE else INVISIBLE }
|
|
610
609
|
}
|
|
611
610
|
|
|
612
|
-
private fun
|
|
611
|
+
private fun hideForScreen() {
|
|
613
612
|
val sheet = sheetView ?: run {
|
|
614
|
-
RNLog.e(reactContext, "TrueSheet: sheetView is null in
|
|
613
|
+
RNLog.e(reactContext, "TrueSheet: sheetView is null in hideForScreen")
|
|
615
614
|
return
|
|
616
615
|
}
|
|
617
616
|
|
|
618
617
|
isSheetVisible = false
|
|
619
|
-
|
|
618
|
+
wasHiddenByScreen = true
|
|
620
619
|
|
|
621
|
-
dimViews.forEach { it.animate().alpha(0f).setDuration(
|
|
620
|
+
dimViews.forEach { it.animate().alpha(0f).setDuration(SCREEN_FADE_DURATION).start() }
|
|
622
621
|
sheet.animate()
|
|
623
622
|
.alpha(0f)
|
|
624
|
-
.setDuration(
|
|
623
|
+
.setDuration(SCREEN_FADE_DURATION)
|
|
625
624
|
.withEndAction {
|
|
626
625
|
setSheetVisibility(false)
|
|
627
626
|
}
|
|
628
627
|
.start()
|
|
629
628
|
|
|
630
629
|
// This will hide parent sheets first
|
|
631
|
-
parentSheetView?.viewController?.
|
|
630
|
+
parentSheetView?.viewController?.hideForScreen()
|
|
632
631
|
}
|
|
633
632
|
|
|
634
|
-
private fun
|
|
633
|
+
private fun showAfterScreen() {
|
|
635
634
|
isSheetVisible = true
|
|
636
635
|
setSheetVisibility(true)
|
|
637
636
|
sheetView?.alpha = 1f
|
|
@@ -643,7 +642,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
|
|
|
643
642
|
* Android may restore visibility on activity resume, so we need to hide it again.
|
|
644
643
|
*/
|
|
645
644
|
fun reapplyHiddenState() {
|
|
646
|
-
if (!
|
|
645
|
+
if (!wasHiddenByScreen) return
|
|
647
646
|
setSheetVisibility(false)
|
|
648
647
|
}
|
|
649
648
|
|
|
@@ -954,7 +953,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
|
|
|
954
953
|
// =============================================================================
|
|
955
954
|
|
|
956
955
|
private fun shouldHandleKeyboard(checkFocus: Boolean = true): Boolean {
|
|
957
|
-
if (
|
|
956
|
+
if (wasHiddenByScreen) return false
|
|
958
957
|
if (!isTopmostSheet) return false
|
|
959
958
|
if (checkFocus && !isFocusedViewWithinSheet()) return false
|
|
960
959
|
return true
|
|
@@ -7,27 +7,30 @@ import androidx.fragment.app.FragmentManager
|
|
|
7
7
|
import androidx.lifecycle.DefaultLifecycleObserver
|
|
8
8
|
import androidx.lifecycle.LifecycleOwner
|
|
9
9
|
import com.facebook.react.bridge.ReactContext
|
|
10
|
-
|
|
11
10
|
private const val RN_SCREENS_PACKAGE = "com.swmansion.rnscreens"
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
* Observes fragment lifecycle to detect react-native-screens
|
|
15
|
-
* Automatically notifies when modals are presented/dismissed.
|
|
13
|
+
* Observes fragment lifecycle to detect react-native-screens screen presentation.
|
|
14
|
+
* Automatically notifies when screens (modals or pushed) are presented/dismissed.
|
|
16
15
|
*/
|
|
17
16
|
class RNScreensFragmentObserver(
|
|
18
17
|
private val reactContext: ReactContext,
|
|
19
|
-
private val
|
|
20
|
-
private val
|
|
21
|
-
private val
|
|
22
|
-
private val onNonModalScreenPushed: () -> Unit
|
|
18
|
+
private val onScreenPresented: () -> Unit,
|
|
19
|
+
private val onScreenWillDismiss: () -> Unit,
|
|
20
|
+
private val onScreenDidDismiss: () -> Unit
|
|
23
21
|
) {
|
|
24
22
|
private var fragmentLifecycleCallback: FragmentManager.FragmentLifecycleCallbacks? = null
|
|
25
23
|
private var activityLifecycleObserver: DefaultLifecycleObserver? = null
|
|
26
24
|
private val activeModalFragments: MutableSet<Fragment> = mutableSetOf()
|
|
25
|
+
private val activePushedFragments: MutableSet<Fragment> = mutableSetOf()
|
|
27
26
|
private var isActivityInForeground = true
|
|
28
27
|
private var pendingDismissRunnable: Runnable? = null
|
|
28
|
+
private var pendingPopRunnable: Runnable? = null
|
|
29
29
|
private var isInitialized = false
|
|
30
30
|
|
|
31
|
+
val hasPushedScreens: Boolean
|
|
32
|
+
get() = activePushedFragments.isNotEmpty()
|
|
33
|
+
|
|
31
34
|
/**
|
|
32
35
|
* Start observing fragment lifecycle events.
|
|
33
36
|
*/
|
|
@@ -64,11 +67,22 @@ class RNScreensFragmentObserver(
|
|
|
64
67
|
activeModalFragments.add(f)
|
|
65
68
|
|
|
66
69
|
if (activeModalFragments.size == 1) {
|
|
67
|
-
|
|
70
|
+
onScreenPresented()
|
|
71
|
+
}
|
|
72
|
+
} else if (activeModalFragments.isEmpty() && pendingDismissRunnable == null && isNonModalScreenFragment(f)) {
|
|
73
|
+
// Check if this is a new push or just re-attaching during pop
|
|
74
|
+
val isPendingPop = pendingPopRunnable != null
|
|
75
|
+
|
|
76
|
+
if (isPendingPop) {
|
|
77
|
+
// Screen is being re-attached during pop transition, ignore it
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
activePushedFragments.add(f)
|
|
82
|
+
|
|
83
|
+
if (activePushedFragments.size == 1) {
|
|
84
|
+
onScreenPresented()
|
|
68
85
|
}
|
|
69
|
-
} else if (activeModalFragments.isEmpty() && isNonModalScreenFragment(f)) {
|
|
70
|
-
// Only trigger non-modal push when no modals are active
|
|
71
|
-
onNonModalScreenPushed()
|
|
72
86
|
}
|
|
73
87
|
}
|
|
74
88
|
|
|
@@ -86,14 +100,24 @@ class RNScreensFragmentObserver(
|
|
|
86
100
|
// Post dismiss to allow fragment attach to cancel if navigation is happening
|
|
87
101
|
schedulePendingDismiss()
|
|
88
102
|
}
|
|
103
|
+
} else if (activePushedFragments.contains(f) && f.isRemoving) {
|
|
104
|
+
activePushedFragments.remove(f)
|
|
105
|
+
|
|
106
|
+
if (activePushedFragments.isEmpty()) {
|
|
107
|
+
schedulePendingPop()
|
|
108
|
+
}
|
|
89
109
|
}
|
|
90
110
|
}
|
|
91
111
|
|
|
92
112
|
override fun onFragmentDestroyed(fm: FragmentManager, f: Fragment) {
|
|
93
113
|
super.onFragmentDestroyed(fm, f)
|
|
94
114
|
|
|
95
|
-
if (activeModalFragments.isEmpty() &&
|
|
96
|
-
|
|
115
|
+
if (activeModalFragments.isEmpty() &&
|
|
116
|
+
activePushedFragments.isEmpty() &&
|
|
117
|
+
pendingDismissRunnable == null &&
|
|
118
|
+
pendingPopRunnable == null
|
|
119
|
+
) {
|
|
120
|
+
onScreenDidDismiss()
|
|
97
121
|
}
|
|
98
122
|
}
|
|
99
123
|
}
|
|
@@ -113,6 +137,7 @@ class RNScreensFragmentObserver(
|
|
|
113
137
|
val activity = reactContext.currentActivity as? AppCompatActivity
|
|
114
138
|
|
|
115
139
|
cancelPendingDismiss()
|
|
140
|
+
cancelPendingPop()
|
|
116
141
|
|
|
117
142
|
fragmentLifecycleCallback?.let { callback ->
|
|
118
143
|
activity?.supportFragmentManager?.unregisterFragmentLifecycleCallbacks(callback)
|
|
@@ -125,6 +150,7 @@ class RNScreensFragmentObserver(
|
|
|
125
150
|
activityLifecycleObserver = null
|
|
126
151
|
|
|
127
152
|
activeModalFragments.clear()
|
|
153
|
+
activePushedFragments.clear()
|
|
128
154
|
}
|
|
129
155
|
|
|
130
156
|
private fun schedulePendingDismiss() {
|
|
@@ -136,7 +162,7 @@ class RNScreensFragmentObserver(
|
|
|
136
162
|
pendingDismissRunnable = Runnable {
|
|
137
163
|
pendingDismissRunnable = null
|
|
138
164
|
if (activeModalFragments.isEmpty()) {
|
|
139
|
-
|
|
165
|
+
onScreenWillDismiss()
|
|
140
166
|
}
|
|
141
167
|
}
|
|
142
168
|
decorView.post(pendingDismissRunnable)
|
|
@@ -152,6 +178,31 @@ class RNScreensFragmentObserver(
|
|
|
152
178
|
}
|
|
153
179
|
}
|
|
154
180
|
|
|
181
|
+
private fun schedulePendingPop() {
|
|
182
|
+
val activity = reactContext.currentActivity ?: return
|
|
183
|
+
val decorView = activity.window?.decorView ?: return
|
|
184
|
+
|
|
185
|
+
cancelPendingPop()
|
|
186
|
+
|
|
187
|
+
pendingPopRunnable = Runnable {
|
|
188
|
+
pendingPopRunnable = null
|
|
189
|
+
if (activePushedFragments.isEmpty()) {
|
|
190
|
+
onScreenWillDismiss()
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
decorView.post(pendingPopRunnable)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
private fun cancelPendingPop() {
|
|
197
|
+
val activity = reactContext.currentActivity ?: return
|
|
198
|
+
val decorView = activity.window?.decorView ?: return
|
|
199
|
+
|
|
200
|
+
pendingPopRunnable?.let {
|
|
201
|
+
decorView.removeCallbacks(it)
|
|
202
|
+
pendingPopRunnable = null
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
155
206
|
companion object {
|
|
156
207
|
/**
|
|
157
208
|
* Check if fragment is from react-native-screens.
|
|
@@ -166,7 +166,7 @@ object TrueSheetStackManager {
|
|
|
166
166
|
while (true) {
|
|
167
167
|
val parent = current.viewController.parentSheetView ?: return current
|
|
168
168
|
|
|
169
|
-
if (parent.viewController.
|
|
169
|
+
if (parent.viewController.wasHiddenByScreen) {
|
|
170
170
|
return current
|
|
171
171
|
}
|
|
172
172
|
|
package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h
CHANGED
|
@@ -18,6 +18,10 @@ class TrueSheetViewComponentDescriptor final
|
|
|
18
18
|
concreteShadowNode.adjustLayoutWithState();
|
|
19
19
|
|
|
20
20
|
ConcreteComponentDescriptor::adopt(shadowNode);
|
|
21
|
+
|
|
22
|
+
#if !defined(ANDROID)
|
|
23
|
+
concreteShadowNode.setEventDispatcher(eventDispatcher_);
|
|
24
|
+
#endif
|
|
21
25
|
}
|
|
22
26
|
};
|
|
23
27
|
|
|
@@ -45,4 +45,17 @@ void TrueSheetViewShadowNode::adjustLayoutWithState() {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
#if !defined(ANDROID)
|
|
49
|
+
void TrueSheetViewShadowNode::setEventDispatcher(
|
|
50
|
+
std::weak_ptr<const EventDispatcher> dispatcher) {
|
|
51
|
+
getStateDataMutable().setEventDispatcher(dispatcher);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
TrueSheetViewShadowNode::StateData &
|
|
55
|
+
TrueSheetViewShadowNode::getStateDataMutable() {
|
|
56
|
+
ensureUnsealed();
|
|
57
|
+
return const_cast<TrueSheetViewShadowNode::StateData &>(getStateData());
|
|
58
|
+
}
|
|
59
|
+
#endif
|
|
60
|
+
|
|
48
61
|
} // namespace facebook::react
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
namespace facebook::react {
|
|
10
10
|
|
|
11
|
+
class EventDispatcher;
|
|
12
|
+
|
|
11
13
|
JSI_EXPORT extern const char TrueSheetViewComponentName[];
|
|
12
14
|
|
|
13
15
|
/*
|
|
@@ -22,6 +24,8 @@ class JSI_EXPORT TrueSheetViewShadowNode final
|
|
|
22
24
|
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
23
25
|
|
|
24
26
|
public:
|
|
27
|
+
using StateData = ConcreteViewShadowNode::ConcreteStateData;
|
|
28
|
+
|
|
25
29
|
static ShadowNodeTraits BaseTraits() {
|
|
26
30
|
auto traits = ConcreteViewShadowNode::BaseTraits();
|
|
27
31
|
traits.set(ShadowNodeTraits::Trait::RootNodeKind);
|
|
@@ -29,6 +33,13 @@ class JSI_EXPORT TrueSheetViewShadowNode final
|
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
void adjustLayoutWithState();
|
|
36
|
+
|
|
37
|
+
#if !defined(ANDROID)
|
|
38
|
+
void setEventDispatcher(std::weak_ptr<const EventDispatcher> dispatcher);
|
|
39
|
+
|
|
40
|
+
private:
|
|
41
|
+
StateData &getStateDataMutable();
|
|
42
|
+
#endif
|
|
32
43
|
};
|
|
33
44
|
|
|
34
45
|
} // namespace facebook::react
|
|
@@ -8,4 +8,16 @@ folly::dynamic TrueSheetViewState::getDynamic() const {
|
|
|
8
8
|
}
|
|
9
9
|
#endif
|
|
10
10
|
|
|
11
|
+
#if !defined(ANDROID)
|
|
12
|
+
void TrueSheetViewState::setEventDispatcher(
|
|
13
|
+
std::weak_ptr<const EventDispatcher> dispatcher) {
|
|
14
|
+
eventDispatcher_ = dispatcher;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
std::weak_ptr<const EventDispatcher> TrueSheetViewState::getEventDispatcher()
|
|
18
|
+
const noexcept {
|
|
19
|
+
return eventDispatcher_;
|
|
20
|
+
}
|
|
21
|
+
#endif
|
|
22
|
+
|
|
11
23
|
} // namespace facebook::react
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
namespace facebook::react {
|
|
12
12
|
|
|
13
|
+
class EventDispatcher;
|
|
14
|
+
|
|
13
15
|
/*
|
|
14
16
|
* State for <TrueSheetView> component.
|
|
15
17
|
* Contains the container dimensions from native.
|
|
@@ -37,6 +39,14 @@ class TrueSheetViewState final {
|
|
|
37
39
|
return MapBufferBuilder::EMPTY();
|
|
38
40
|
}
|
|
39
41
|
#endif
|
|
42
|
+
|
|
43
|
+
#if !defined(ANDROID)
|
|
44
|
+
void setEventDispatcher(std::weak_ptr<const EventDispatcher> dispatcher);
|
|
45
|
+
std::weak_ptr<const EventDispatcher> getEventDispatcher() const noexcept;
|
|
46
|
+
|
|
47
|
+
private:
|
|
48
|
+
std::weak_ptr<const EventDispatcher> eventDispatcher_;
|
|
49
|
+
#endif
|
|
40
50
|
};
|
|
41
51
|
|
|
42
52
|
} // namespace facebook::react
|
package/ios/TrueSheetView.mm
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#import "TrueSheetFooterView.h"
|
|
15
15
|
#import "TrueSheetModule.h"
|
|
16
16
|
#import "TrueSheetViewController.h"
|
|
17
|
+
#import "core/RNScreensEventObserver.h"
|
|
17
18
|
#import "events/TrueSheetDragEvents.h"
|
|
18
19
|
#import "events/TrueSheetFocusEvents.h"
|
|
19
20
|
#import "events/TrueSheetLifecycleEvents.h"
|
|
@@ -36,7 +37,9 @@
|
|
|
36
37
|
|
|
37
38
|
using namespace facebook::react;
|
|
38
39
|
|
|
39
|
-
@interface TrueSheetView () <TrueSheetViewControllerDelegate,
|
|
40
|
+
@interface TrueSheetView () <TrueSheetViewControllerDelegate,
|
|
41
|
+
TrueSheetContainerViewDelegate,
|
|
42
|
+
RNScreensEventObserverDelegate>
|
|
40
43
|
@end
|
|
41
44
|
|
|
42
45
|
@implementation TrueSheetView {
|
|
@@ -52,6 +55,10 @@ using namespace facebook::react;
|
|
|
52
55
|
BOOL _isSheetUpdatePending;
|
|
53
56
|
BOOL _pendingLayoutUpdate;
|
|
54
57
|
BOOL _didInitiallyPresent;
|
|
58
|
+
BOOL _dismissedByNavigation;
|
|
59
|
+
BOOL _pendingNavigationRepresent;
|
|
60
|
+
BOOL _pendingMountEvent;
|
|
61
|
+
RNScreensEventObserver *_screensEventObserver;
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
#pragma mark - Initialization
|
|
@@ -75,6 +82,9 @@ using namespace facebook::react;
|
|
|
75
82
|
_initialDetentAnimated = YES;
|
|
76
83
|
_scrollable = NO;
|
|
77
84
|
_isSheetUpdatePending = NO;
|
|
85
|
+
|
|
86
|
+
_screensEventObserver = [[RNScreensEventObserver alloc] init];
|
|
87
|
+
_screensEventObserver.delegate = self;
|
|
78
88
|
}
|
|
79
89
|
return self;
|
|
80
90
|
}
|
|
@@ -89,6 +99,12 @@ using namespace facebook::react;
|
|
|
89
99
|
[TrueSheetModule registerView:self withTag:@(self.tag)];
|
|
90
100
|
}
|
|
91
101
|
|
|
102
|
+
if (_pendingNavigationRepresent && !_controller.isPresented) {
|
|
103
|
+
_pendingNavigationRepresent = NO;
|
|
104
|
+
[self presentAtIndex:_controller.activeDetentIndex animated:YES completion:nil];
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
92
108
|
if (_initialDetentIndex >= 0 && !_didInitiallyPresent) {
|
|
93
109
|
UIViewController *vc = [self findPresentingViewController];
|
|
94
110
|
|
|
@@ -104,6 +120,9 @@ using namespace facebook::react;
|
|
|
104
120
|
}
|
|
105
121
|
|
|
106
122
|
- (void)dealloc {
|
|
123
|
+
[_screensEventObserver stopObserving];
|
|
124
|
+
_screensEventObserver = nil;
|
|
125
|
+
|
|
107
126
|
if (_controller && _controller.presentingViewController) {
|
|
108
127
|
// Find the root presenting controller to dismiss the entire stack
|
|
109
128
|
UIViewController *root = _controller.presentingViewController;
|
|
@@ -114,6 +133,8 @@ using namespace facebook::react;
|
|
|
114
133
|
}
|
|
115
134
|
|
|
116
135
|
_didInitiallyPresent = NO;
|
|
136
|
+
_dismissedByNavigation = NO;
|
|
137
|
+
_pendingNavigationRepresent = NO;
|
|
117
138
|
|
|
118
139
|
_controller.delegate = nil;
|
|
119
140
|
_controller = nil;
|
|
@@ -227,6 +248,8 @@ using namespace facebook::react;
|
|
|
227
248
|
if (_controller) {
|
|
228
249
|
[self updateStateWithSize:_controller.view.frame.size];
|
|
229
250
|
}
|
|
251
|
+
|
|
252
|
+
[_screensEventObserver startObservingWithState:_state.get()->getData()];
|
|
230
253
|
}
|
|
231
254
|
|
|
232
255
|
/**
|
|
@@ -248,6 +271,12 @@ using namespace facebook::react;
|
|
|
248
271
|
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
|
|
249
272
|
[super finalizeUpdates:updateMask];
|
|
250
273
|
|
|
274
|
+
// Emit pending mount event now that eventEmitter is available
|
|
275
|
+
if (_pendingMountEvent && (updateMask & RNComponentViewUpdateMaskEventEmitter)) {
|
|
276
|
+
_pendingMountEvent = NO;
|
|
277
|
+
[TrueSheetLifecycleEvents emitMount:_eventEmitter];
|
|
278
|
+
}
|
|
279
|
+
|
|
251
280
|
if (!(updateMask & RNComponentViewUpdateMaskProps) || !_controller)
|
|
252
281
|
return;
|
|
253
282
|
|
|
@@ -281,6 +310,8 @@ using namespace facebook::react;
|
|
|
281
310
|
|
|
282
311
|
_lastStateSize = CGSizeZero;
|
|
283
312
|
_didInitiallyPresent = NO;
|
|
313
|
+
_dismissedByNavigation = NO;
|
|
314
|
+
_pendingNavigationRepresent = NO;
|
|
284
315
|
}
|
|
285
316
|
|
|
286
317
|
#pragma mark - Child Component Mounting
|
|
@@ -320,19 +351,25 @@ using namespace facebook::react;
|
|
|
320
351
|
_containerView.scrollViewPinningEnabled = _scrollable;
|
|
321
352
|
[_containerView setupContentScrollViewPinning];
|
|
322
353
|
|
|
323
|
-
|
|
354
|
+
if (_eventEmitter) {
|
|
355
|
+
[TrueSheetLifecycleEvents emitMount:_eventEmitter];
|
|
356
|
+
} else {
|
|
357
|
+
_pendingMountEvent = YES;
|
|
358
|
+
}
|
|
324
359
|
}
|
|
325
360
|
|
|
326
361
|
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index {
|
|
327
362
|
if (![childComponentView isKindOfClass:[TrueSheetContainerView class]])
|
|
328
363
|
return;
|
|
329
364
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
snapshot
|
|
334
|
-
|
|
335
|
-
|
|
365
|
+
if (_controller.isPresented) {
|
|
366
|
+
UIView *superView = _containerView.superview;
|
|
367
|
+
UIView *snapshot = [_containerView snapshotViewAfterScreenUpdates:NO];
|
|
368
|
+
if (snapshot) {
|
|
369
|
+
snapshot.frame = _containerView.frame;
|
|
370
|
+
[superView insertSubview:snapshot belowSubview:_containerView];
|
|
371
|
+
_snapshotView = snapshot;
|
|
372
|
+
}
|
|
336
373
|
}
|
|
337
374
|
|
|
338
375
|
_containerView.delegate = nil;
|
|
@@ -381,6 +418,8 @@ using namespace facebook::react;
|
|
|
381
418
|
[_controller setupSheetDetents];
|
|
382
419
|
[_controller setupActiveDetentWithIndex:index];
|
|
383
420
|
|
|
421
|
+
[_screensEventObserver capturePresenterScreenFromView:self];
|
|
422
|
+
|
|
384
423
|
[presentingViewController presentViewController:_controller
|
|
385
424
|
animated:animated
|
|
386
425
|
completion:^{
|
|
@@ -510,13 +549,20 @@ using namespace facebook::react;
|
|
|
510
549
|
}
|
|
511
550
|
|
|
512
551
|
- (void)viewControllerWillDismiss {
|
|
513
|
-
|
|
514
|
-
|
|
552
|
+
if (!_dismissedByNavigation) {
|
|
553
|
+
[TrueSheetLifecycleEvents emitWillDismiss:_eventEmitter];
|
|
554
|
+
}
|
|
515
555
|
}
|
|
516
556
|
|
|
517
557
|
- (void)viewControllerDidDismiss {
|
|
518
|
-
|
|
519
|
-
|
|
558
|
+
[_containerView cleanupKeyboardHandler];
|
|
559
|
+
if (!_dismissedByNavigation) {
|
|
560
|
+
_dismissedByNavigation = NO;
|
|
561
|
+
_pendingNavigationRepresent = NO;
|
|
562
|
+
|
|
563
|
+
_controller.activeDetentIndex = -1;
|
|
564
|
+
[TrueSheetLifecycleEvents emitDidDismiss:_eventEmitter];
|
|
565
|
+
}
|
|
520
566
|
}
|
|
521
567
|
|
|
522
568
|
- (void)viewControllerDidChangeDetent:(NSInteger)index position:(CGFloat)position detent:(CGFloat)detent {
|
|
@@ -553,8 +599,20 @@ using namespace facebook::react;
|
|
|
553
599
|
[TrueSheetFocusEvents emitDidBlur:_eventEmitter];
|
|
554
600
|
}
|
|
555
601
|
|
|
556
|
-
-
|
|
557
|
-
|
|
602
|
+
#pragma mark - RNScreensEventObserverDelegate
|
|
603
|
+
|
|
604
|
+
- (void)presenterScreenWillDisappear {
|
|
605
|
+
if (_controller.isPresented && !_controller.isBeingDismissed) {
|
|
606
|
+
_dismissedByNavigation = YES;
|
|
607
|
+
[self dismissAllAnimated:YES completion:nil];
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
- (void)presenterScreenWillAppear {
|
|
612
|
+
if (_dismissedByNavigation && !_controller.isPresented && !_controller.isBeingPresented) {
|
|
613
|
+
_dismissedByNavigation = NO;
|
|
614
|
+
_pendingNavigationRepresent = YES;
|
|
615
|
+
}
|
|
558
616
|
}
|
|
559
617
|
|
|
560
618
|
#pragma mark - Private Helpers
|
|
@@ -16,13 +16,6 @@
|
|
|
16
16
|
#define RNS_DISMISSIBLE_MODAL_PROTOCOL_AVAILABLE 0
|
|
17
17
|
#endif
|
|
18
18
|
|
|
19
|
-
#if __has_include(<RNScreens/RNSLifecycleListenerProtocol.h>)
|
|
20
|
-
#import <RNScreens/RNSLifecycleListenerProtocol.h>
|
|
21
|
-
#define RNS_LIFECYCLE_LISTENER_PROTOCOL_AVAILABLE 1
|
|
22
|
-
#else
|
|
23
|
-
#define RNS_LIFECYCLE_LISTENER_PROTOCOL_AVAILABLE 0
|
|
24
|
-
#endif
|
|
25
|
-
|
|
26
19
|
NS_ASSUME_NONNULL_BEGIN
|
|
27
20
|
|
|
28
21
|
@protocol TrueSheetViewControllerDelegate <NSObject>
|
|
@@ -46,10 +39,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
46
39
|
- (void)viewControllerWillBlur;
|
|
47
40
|
- (void)viewControllerDidBlur;
|
|
48
41
|
|
|
49
|
-
#if RNS_LIFECYCLE_LISTENER_PROTOCOL_AVAILABLE
|
|
50
|
-
- (void)viewControllerDidDetectScreenDisappear;
|
|
51
|
-
#endif
|
|
52
|
-
|
|
53
42
|
@end
|
|
54
43
|
|
|
55
44
|
@interface TrueSheetViewController : UIViewController <UISheetPresentationControllerDelegate,
|
|
@@ -57,10 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
57
46
|
#if RNS_DISMISSIBLE_MODAL_PROTOCOL_AVAILABLE
|
|
58
47
|
,
|
|
59
48
|
RNSDismissibleModalProtocol
|
|
60
|
-
#endif
|
|
61
|
-
#if RNS_LIFECYCLE_LISTENER_PROTOCOL_AVAILABLE
|
|
62
|
-
,
|
|
63
|
-
RNSLifecycleListenerProtocol
|
|
64
49
|
#endif
|
|
65
50
|
>
|
|
66
51
|
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
BOOL _isDragging;
|
|
35
35
|
BOOL _isTransitioning;
|
|
36
36
|
BOOL _isTrackingPositionFromLayout;
|
|
37
|
+
BOOL _isWillDismissEmitted;
|
|
37
38
|
|
|
38
39
|
__weak TrueSheetViewController *_parentSheetController;
|
|
39
40
|
|
|
@@ -57,11 +58,12 @@
|
|
|
57
58
|
_lastPosition = 0;
|
|
58
59
|
_isDragging = NO;
|
|
59
60
|
_isPresented = NO;
|
|
61
|
+
_isTransitioning = NO;
|
|
62
|
+
_isWillDismissEmitted = NO;
|
|
60
63
|
_pendingContentSizeChange = NO;
|
|
61
64
|
_activeDetentIndex = -1;
|
|
62
65
|
_pendingDetentIndex = -1;
|
|
63
66
|
|
|
64
|
-
_isTransitioning = NO;
|
|
65
67
|
_transitionFakeView = [UIView new];
|
|
66
68
|
_isTrackingPositionFromLayout = NO;
|
|
67
69
|
|
|
@@ -165,6 +167,9 @@
|
|
|
165
167
|
[super viewDidLoad];
|
|
166
168
|
self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
|
|
167
169
|
|
|
170
|
+
_blurView = [[TrueSheetBlurView alloc] init];
|
|
171
|
+
[_blurView addToView:self.view];
|
|
172
|
+
|
|
168
173
|
_grabberView = [[TrueSheetGrabberView alloc] init];
|
|
169
174
|
_grabberView.hidden = YES;
|
|
170
175
|
[_grabberView addToView:self.view];
|
|
@@ -237,19 +242,17 @@
|
|
|
237
242
|
return self.presentingViewController == nil || self.isBeingDismissed;
|
|
238
243
|
}
|
|
239
244
|
|
|
240
|
-
- (void)
|
|
241
|
-
|
|
245
|
+
- (void)emitWillDismissEvents {
|
|
246
|
+
if (self.isDismissing && !_isWillDismissEmitted) {
|
|
247
|
+
_isWillDismissEmitted = YES;
|
|
242
248
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
[self.delegate viewControllerWillBlur];
|
|
247
|
-
}
|
|
249
|
+
if ([self.delegate respondsToSelector:@selector(viewControllerWillBlur)]) {
|
|
250
|
+
[self.delegate viewControllerWillBlur];
|
|
251
|
+
}
|
|
248
252
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
});
|
|
253
|
+
if ([self.delegate respondsToSelector:@selector(viewControllerWillDismiss)]) {
|
|
254
|
+
[self.delegate viewControllerWillDismiss];
|
|
255
|
+
}
|
|
253
256
|
|
|
254
257
|
if (_parentSheetController) {
|
|
255
258
|
if ([_parentSheetController.delegate respondsToSelector:@selector(viewControllerWillFocus)]) {
|
|
@@ -257,16 +260,12 @@
|
|
|
257
260
|
}
|
|
258
261
|
}
|
|
259
262
|
}
|
|
260
|
-
|
|
261
|
-
[self setupTransitionTracker];
|
|
262
263
|
}
|
|
263
264
|
|
|
264
|
-
- (void)
|
|
265
|
-
[super viewDidDisappear:animated];
|
|
266
|
-
|
|
265
|
+
- (void)emitDidDismissEvents {
|
|
267
266
|
if (self.isDismissing) {
|
|
268
267
|
_isPresented = NO;
|
|
269
|
-
|
|
268
|
+
_isWillDismissEmitted = NO;
|
|
270
269
|
|
|
271
270
|
if (_parentSheetController) {
|
|
272
271
|
if ([_parentSheetController.delegate respondsToSelector:@selector(viewControllerDidFocus)]) {
|
|
@@ -285,6 +284,25 @@
|
|
|
285
284
|
}
|
|
286
285
|
}
|
|
287
286
|
|
|
287
|
+
- (void)viewWillDisappear:(BOOL)animated {
|
|
288
|
+
[super viewWillDisappear:animated];
|
|
289
|
+
|
|
290
|
+
// Dispatch to allow pan gesture to set _isDragging before checking
|
|
291
|
+
// handleTransitionTracker will emit when sheet is transitioning to dismiss
|
|
292
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
293
|
+
if (!self->_isDragging) {
|
|
294
|
+
[self emitWillDismissEvents];
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
[self setupTransitionTracker];
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
- (void)viewDidDisappear:(BOOL)animated {
|
|
302
|
+
[super viewDidDisappear:animated];
|
|
303
|
+
[self emitDidDismissEvents];
|
|
304
|
+
}
|
|
305
|
+
|
|
288
306
|
- (void)viewWillLayoutSubviews {
|
|
289
307
|
[super viewWillLayoutSubviews];
|
|
290
308
|
|
|
@@ -449,7 +467,10 @@
|
|
|
449
467
|
|
|
450
468
|
if (self.currentPosition >= self.screenHeight) {
|
|
451
469
|
CGFloat position = fmax(_lastPosition, layerPosition);
|
|
470
|
+
|
|
471
|
+
[self emitWillDismissEvents];
|
|
452
472
|
[self emitChangePositionDelegateWithPosition:position realtime:YES debug:@"transition out"];
|
|
473
|
+
|
|
453
474
|
} else {
|
|
454
475
|
CGFloat position = fmax(self.currentPosition, layerPosition);
|
|
455
476
|
[self emitChangePositionDelegateWithPosition:position realtime:YES debug:@"transition in"];
|
|
@@ -671,32 +692,6 @@
|
|
|
671
692
|
}
|
|
672
693
|
|
|
673
694
|
- (void)setupBackground {
|
|
674
|
-
#if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_1)
|
|
675
|
-
BOOL useBackgroundEffect = NO;
|
|
676
|
-
if (@available(iOS 26.1, *)) {
|
|
677
|
-
useBackgroundEffect = !self.isDesignCompatibilityMode;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
// iOS 26.1+: use native backgroundEffect when only backgroundBlur is set (no backgroundColor)
|
|
681
|
-
// Fall back to TrueSheetBlurView when blur intensity is set (not 100%) since
|
|
682
|
-
// sheet.backgroundEffect doesn't support intensity control
|
|
683
|
-
if (@available(iOS 26.1, *)) {
|
|
684
|
-
if (useBackgroundEffect) {
|
|
685
|
-
BOOL hasCustomIntensity = self.blurIntensity && [self.blurIntensity floatValue] < 100;
|
|
686
|
-
if (!self.backgroundColor && self.backgroundBlur && self.backgroundBlur.length > 0) {
|
|
687
|
-
if (hasCustomIntensity) {
|
|
688
|
-
// Clear native effect to allow custom blur view with intensity
|
|
689
|
-
self.sheet.backgroundEffect = [UIColorEffect effectWithColor:[UIColor clearColor]];
|
|
690
|
-
} else {
|
|
691
|
-
UIBlurEffectStyle style = [BlurUtil blurEffectStyleFromString:self.backgroundBlur];
|
|
692
|
-
self.sheet.backgroundEffect = [UIBlurEffect effectWithStyle:style];
|
|
693
|
-
return;
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
#endif
|
|
699
|
-
|
|
700
695
|
NSString *effectiveBackgroundBlur = self.backgroundBlur;
|
|
701
696
|
if (@available(iOS 26.0, *)) {
|
|
702
697
|
// iOS 26+ has default liquid glass effect
|
|
@@ -704,28 +699,23 @@
|
|
|
704
699
|
effectiveBackgroundBlur = @"system-material";
|
|
705
700
|
}
|
|
706
701
|
|
|
707
|
-
BOOL
|
|
702
|
+
BOOL hasBlur = effectiveBackgroundBlur && effectiveBackgroundBlur.length > 0;
|
|
708
703
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
if (effectiveBackgroundBlur && effectiveBackgroundBlur.length > 0) {
|
|
715
|
-
if (!_blurView) {
|
|
716
|
-
_blurView = [[TrueSheetBlurView alloc] init];
|
|
717
|
-
[_blurView addToView:self.view];
|
|
718
|
-
}
|
|
719
|
-
_blurView.backgroundBlur = effectiveBackgroundBlur;
|
|
720
|
-
_blurView.blurIntensity = self.blurIntensity;
|
|
721
|
-
_blurView.blurInteraction = self.blurInteraction;
|
|
722
|
-
[_blurView applyBlurEffect];
|
|
723
|
-
}
|
|
704
|
+
_blurView.backgroundBlur = hasBlur ? effectiveBackgroundBlur : nil;
|
|
705
|
+
_blurView.blurIntensity = self.blurIntensity;
|
|
706
|
+
_blurView.blurInteraction = self.blurInteraction;
|
|
707
|
+
[_blurView applyBlurEffect];
|
|
724
708
|
|
|
725
709
|
#if RNTS_IPHONE_OS_VERSION_AVAILABLE(26_1)
|
|
726
710
|
if (@available(iOS 26.1, *)) {
|
|
727
|
-
if (
|
|
728
|
-
|
|
711
|
+
if (!self.isDesignCompatibilityMode) {
|
|
712
|
+
if (self.backgroundColor) {
|
|
713
|
+
self.sheet.backgroundEffect = [UIColorEffect effectWithColor:self.backgroundColor];
|
|
714
|
+
} else if (hasBlur) {
|
|
715
|
+
self.sheet.backgroundEffect = [UIColorEffect effectWithColor:[UIColor clearColor]];
|
|
716
|
+
} else {
|
|
717
|
+
self.sheet.backgroundEffect = nil;
|
|
718
|
+
}
|
|
729
719
|
return;
|
|
730
720
|
}
|
|
731
721
|
}
|
|
@@ -799,21 +789,6 @@
|
|
|
799
789
|
}
|
|
800
790
|
}
|
|
801
791
|
|
|
802
|
-
#pragma mark - RNSLifecycleListenerProtocol
|
|
803
|
-
|
|
804
|
-
#if RNS_LIFECYCLE_LISTENER_PROTOCOL_AVAILABLE
|
|
805
|
-
|
|
806
|
-
- (void)screenWillDisappear:(UIViewController *)screen isPresenterUnmounting:(BOOL)isPresenterUnmounting {
|
|
807
|
-
// Skip if not presented, being dismissed, or if the presenter (modal) itself is being unmounted
|
|
808
|
-
if (!_isPresented || self.isBeingDismissed || isPresenterUnmounting) {
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
if ([self.delegate respondsToSelector:@selector(viewControllerDidDetectScreenDisappear)]) {
|
|
812
|
-
[self.delegate viewControllerDidDetectScreenDisappear];
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
#endif
|
|
816
|
-
|
|
817
792
|
#pragma mark - RNSDismissibleModalProtocol
|
|
818
793
|
|
|
819
794
|
#if RNS_DISMISSIBLE_MODAL_PROTOCOL_AVAILABLE
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import <UIKit/UIKit.h>
|
|
12
|
+
#import <react/renderer/components/TrueSheetSpec/TrueSheetViewState.h>
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
@class TrueSheetView;
|
|
17
|
+
|
|
18
|
+
@protocol RNScreensEventObserverDelegate <NSObject>
|
|
19
|
+
|
|
20
|
+
- (void)presenterScreenWillDisappear;
|
|
21
|
+
- (void)presenterScreenWillAppear;
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Observes react-native-screens lifecycle events via C++ EventDispatcher.
|
|
27
|
+
* Detects when the presenting screen unmounts while sheet is presented.
|
|
28
|
+
*/
|
|
29
|
+
@interface RNScreensEventObserver : NSObject
|
|
30
|
+
|
|
31
|
+
@property (nonatomic, weak) TrueSheetView<RNScreensEventObserverDelegate> *delegate;
|
|
32
|
+
|
|
33
|
+
- (void)startObservingWithState:(const facebook::react::TrueSheetViewState &)state;
|
|
34
|
+
- (void)stopObserving;
|
|
35
|
+
|
|
36
|
+
- (void)capturePresenterScreenFromView:(UIView *)view;
|
|
37
|
+
- (BOOL)shouldDismissForScreenTag:(NSInteger)screenTag;
|
|
38
|
+
|
|
39
|
+
@end
|
|
40
|
+
|
|
41
|
+
NS_ASSUME_NONNULL_END
|
|
42
|
+
|
|
43
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import "RNScreensEventObserver.h"
|
|
12
|
+
#import "TrueSheetView.h"
|
|
13
|
+
|
|
14
|
+
#import <react/renderer/core/EventDispatcher.h>
|
|
15
|
+
#import <react/renderer/core/ShadowNodeFamily.h>
|
|
16
|
+
|
|
17
|
+
using namespace facebook::react;
|
|
18
|
+
|
|
19
|
+
@implementation RNScreensEventObserver {
|
|
20
|
+
std::weak_ptr<const EventDispatcher> _eventDispatcher;
|
|
21
|
+
std::shared_ptr<const EventListener> _eventListener;
|
|
22
|
+
NSInteger _presenterScreenTag;
|
|
23
|
+
__weak UIViewController *_presenterScreenController;
|
|
24
|
+
BOOL _dismissedByNavigation;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
- (instancetype)init {
|
|
28
|
+
if (self = [super init]) {
|
|
29
|
+
_presenterScreenTag = 0;
|
|
30
|
+
_presenterScreenController = nil;
|
|
31
|
+
}
|
|
32
|
+
return self;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (void)dealloc {
|
|
36
|
+
[self stopObserving];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
- (void)startObservingWithState:(const TrueSheetViewState &)state {
|
|
40
|
+
if (!_eventDispatcher.expired()) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (auto dispatcherPtr = state.getEventDispatcher().lock()) {
|
|
45
|
+
_eventDispatcher = state.getEventDispatcher();
|
|
46
|
+
|
|
47
|
+
__weak RNScreensEventObserver *weakSelf = self;
|
|
48
|
+
|
|
49
|
+
_eventListener = std::make_shared<const EventListener>([weakSelf](const RawEvent &event) {
|
|
50
|
+
RNScreensEventObserver *strongSelf = weakSelf;
|
|
51
|
+
if (!strongSelf) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (auto family = event.shadowNodeFamily.lock()) {
|
|
56
|
+
Tag screenTag = family->getTag();
|
|
57
|
+
|
|
58
|
+
if (event.type == "topWillDisappear") {
|
|
59
|
+
if ([strongSelf shouldDismissForScreenTag:screenTag]) {
|
|
60
|
+
strongSelf->_dismissedByNavigation = YES;
|
|
61
|
+
[strongSelf.delegate presenterScreenWillDisappear];
|
|
62
|
+
}
|
|
63
|
+
} else if (event.type == "topWillAppear") {
|
|
64
|
+
if (screenTag == strongSelf->_presenterScreenTag && strongSelf->_dismissedByNavigation) {
|
|
65
|
+
strongSelf->_dismissedByNavigation = NO;
|
|
66
|
+
[strongSelf.delegate presenterScreenWillAppear];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
dispatcherPtr->addListener(_eventListener);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
- (void)stopObserving {
|
|
78
|
+
if (_eventListener) {
|
|
79
|
+
if (auto dispatcher = _eventDispatcher.lock()) {
|
|
80
|
+
dispatcher->removeListener(_eventListener);
|
|
81
|
+
}
|
|
82
|
+
_eventListener = nullptr;
|
|
83
|
+
}
|
|
84
|
+
_eventDispatcher.reset();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
- (void)capturePresenterScreenFromView:(UIView *)view {
|
|
88
|
+
_presenterScreenTag = 0;
|
|
89
|
+
_presenterScreenController = nil;
|
|
90
|
+
|
|
91
|
+
for (UIView *current = view.superview; current; current = current.superview) {
|
|
92
|
+
NSString *className = NSStringFromClass([current class]);
|
|
93
|
+
|
|
94
|
+
if ([className isEqualToString:@"RNSScreenView"]) {
|
|
95
|
+
_presenterScreenTag = current.tag;
|
|
96
|
+
for (UIResponder *r = current.nextResponder; r; r = r.nextResponder) {
|
|
97
|
+
if ([r isKindOfClass:[UIViewController class]]) {
|
|
98
|
+
_presenterScreenController = (UIViewController *)r;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
- (BOOL)shouldDismissForScreenTag:(NSInteger)screenTag {
|
|
108
|
+
if (_presenterScreenTag != screenTag) {
|
|
109
|
+
return NO;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Skip if screen is still top of nav stack (e.g. modal dismiss - sheet dismisses naturally with modal)
|
|
113
|
+
// Dismiss if a new screen was pushed or popped
|
|
114
|
+
return _presenterScreenController.navigationController.topViewController != _presenterScreenController;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@end
|
|
118
|
+
|
|
119
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -34,41 +34,45 @@
|
|
|
34
34
|
[parentView insertSubview:self atIndex:0];
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
- (void)clearAnimator {
|
|
38
|
+
if (_blurAnimator) {
|
|
39
|
+
[_blurAnimator stopAnimation:YES];
|
|
40
|
+
_blurAnimator = nil;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
- (void)applyBlurEffect {
|
|
38
45
|
self.userInteractionEnabled = self.blurInteraction;
|
|
39
46
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
if (!self.backgroundBlur || self.backgroundBlur.length == 0) {
|
|
48
|
+
[self clearAnimator];
|
|
49
|
+
self.effect = nil;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
UIBlurEffectStyle style = [BlurUtil blurEffectStyleFromString:self.backgroundBlur];
|
|
54
|
+
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:style];
|
|
55
|
+
|
|
56
|
+
CGFloat intensity =
|
|
57
|
+
(self.blurIntensity && [self.blurIntensity floatValue] >= 0) ? [self.blurIntensity floatValue] / 100.0 : 1.0;
|
|
44
58
|
|
|
59
|
+
if (intensity >= 1.0) {
|
|
60
|
+
[self clearAnimator];
|
|
61
|
+
self.effect = blurEffect;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!_blurAnimator) {
|
|
45
66
|
__weak __typeof(self) weakSelf = self;
|
|
46
67
|
_blurAnimator = [[UIViewPropertyAnimator alloc] initWithDuration:1.0
|
|
47
68
|
curve:UIViewAnimationCurveLinear
|
|
48
69
|
animations:^{
|
|
49
70
|
weakSelf.effect = blurEffect;
|
|
50
71
|
}];
|
|
51
|
-
_blurAnimator.pausesOnCompletion = YES;
|
|
52
72
|
}
|
|
53
73
|
|
|
54
|
-
|
|
55
|
-
CGFloat intensity =
|
|
56
|
-
(self.blurIntensity && [self.blurIntensity floatValue] >= 0) ? [self.blurIntensity floatValue] / 100.0 : 1.0;
|
|
74
|
+
_blurAnimator.pausesOnCompletion = YES;
|
|
57
75
|
_blurAnimator.fractionComplete = intensity;
|
|
58
76
|
}
|
|
59
77
|
|
|
60
|
-
- (void)willMoveToSuperview:(UIView *)newSuperview {
|
|
61
|
-
[super willMoveToSuperview:newSuperview];
|
|
62
|
-
|
|
63
|
-
// Clean up when removed from superview
|
|
64
|
-
if (!newSuperview) {
|
|
65
|
-
if (_blurAnimator) {
|
|
66
|
-
[_blurAnimator stopAnimation:YES];
|
|
67
|
-
_blurAnimator = nil;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
self.effect = nil;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
78
|
@end
|
package/lib/module/TrueSheet.js
CHANGED
|
@@ -27,6 +27,11 @@ export class TrueSheet extends PureComponent {
|
|
|
27
27
|
* Resolver to be called when mount event is received
|
|
28
28
|
*/
|
|
29
29
|
presentationResolver = null;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Tracks if a present operation is in progress
|
|
33
|
+
*/
|
|
34
|
+
isPresenting = false;
|
|
30
35
|
constructor(props) {
|
|
31
36
|
super(props);
|
|
32
37
|
this.nativeRef = /*#__PURE__*/createRef();
|
|
@@ -177,10 +182,13 @@ export class TrueSheet extends PureComponent {
|
|
|
177
182
|
this.props.onWillDismiss?.(event);
|
|
178
183
|
}
|
|
179
184
|
onDidDismiss(event) {
|
|
180
|
-
// Clean up native view after dismiss for lazy loading
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
// Clean up native view after dismiss for lazy loading.
|
|
186
|
+
// Skip unmount if a present is in progress to avoid race condition.
|
|
187
|
+
if (!this.isPresenting) {
|
|
188
|
+
this.setState({
|
|
189
|
+
shouldRenderNativeView: false
|
|
190
|
+
});
|
|
191
|
+
}
|
|
184
192
|
this.props.onDidDismiss?.(event);
|
|
185
193
|
}
|
|
186
194
|
onMount(event) {
|
|
@@ -223,6 +231,7 @@ export class TrueSheet extends PureComponent {
|
|
|
223
231
|
if (index < 0 || index >= detentsLength) {
|
|
224
232
|
throw new Error(`TrueSheet: present index (${index}) is out of bounds. detents array has ${detentsLength} item(s)`);
|
|
225
233
|
}
|
|
234
|
+
this.isPresenting = true;
|
|
226
235
|
|
|
227
236
|
// Lazy load: render native view if not already rendered
|
|
228
237
|
if (!this.state.shouldRenderNativeView) {
|
|
@@ -233,7 +242,8 @@ export class TrueSheet extends PureComponent {
|
|
|
233
242
|
});
|
|
234
243
|
});
|
|
235
244
|
}
|
|
236
|
-
|
|
245
|
+
await TrueSheetModule?.presentByRef(this.handle, index, animated);
|
|
246
|
+
this.isPresenting = false;
|
|
237
247
|
}
|
|
238
248
|
async resize(index) {
|
|
239
249
|
await this.present(index);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PureComponent","createRef","isValidElement","createElement","TrueSheetViewNativeComponent","TrueSheetContainerViewNativeComponent","TrueSheetContentViewNativeComponent","TrueSheetHeaderViewNativeComponent","TrueSheetFooterViewNativeComponent","TrueSheetModule","Platform","StyleSheet","findNodeHandle","processColor","jsx","_jsx","jsxs","_jsxs","LINKING_ERROR","select","ios","default","Error","TrueSheet","displayName","instances","presentationResolver","constructor","props","nativeRef","validateDetents","shouldRenderImmediately","initialDetentIndex","undefined","state","shouldRenderNativeView","onMount","bind","onWillDismiss","onDidDismiss","onWillPresent","onDidPresent","onDetentChange","onDragBegin","onDragChange","onDragEnd","onPositionChange","onWillFocus","onDidFocus","onWillBlur","onDidBlur","onBackPress","detents","length","console","warn","forEach","detent","index","detentsLength","Math","min","getInstance","name","instance","handle","nodeHandle","current","present","animated","dismiss","resize","dismissAll","registerInstance","unregisterInstance","event","setState","Promise","resolve","presentByRef","dismissByRef","componentDidMount","componentDidUpdate","prevProps","componentWillUnmount","render","backgroundColor","dismissible","draggable","grabber","grabberOptions","dimmed","initialDetentAnimated","dimmedDetentIndex","backgroundBlur","blurOptions","cornerRadius","maxHeight","scrollable","pageSizing","children","style","header","headerStyle","footer","footerStyle","insetAdjustment","rest","resolvedDetents","slice","map","containerStyle","android","styles","scrollableAndroidContainer","contentStyle","scrollableAndroidContent","ref","sheetView","color","create","zIndex","pointerEvents","position","top","left","right","bottom","flexGrow","flexBasis"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,SAAS,EAGTC,cAAc,EACdC,aAAa,QACR,OAAO;AAqBd,OAAOC,4BAA4B,MAAM,uCAAuC;AAChF,OAAOC,qCAAqC,MAAM,gDAAgD;AAClG,OAAOC,mCAAmC,MAAM,8CAA8C;AAC9F,OAAOC,kCAAkC,MAAM,6CAA6C;AAC5F,OAAOC,kCAAkC,MAAM,6CAA6C;AAE5F,OAAOC,eAAe,MAAM,kCAA+B;AAE3D,SAASC,QAAQ,EAAEC,UAAU,EAAEC,cAAc,EAAEC,YAAY,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElF,MAAMC,aAAa,GACjB,2FAA2F,GAC3FR,QAAQ,CAACS,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B,GAC/B,iDAAiD;AAEnD,IAAI,CAACZ,eAAe,EAAE;EACpB,MAAM,IAAIa,KAAK,CAACJ,aAAa,CAAC;AAChC;AAQA,OAAO,MAAMK,SAAS,SACZvB,aAAa,CAEvB;EACEwB,WAAW,GAAG,WAAW;EAIzB;AACF;AACA;EACE,OAAwBC,SAAS,GAAkC,CAAC,CAAC;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AA0B,EAAE;IAC1BS,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV,CAAC;EACDX,wBAAwB,EAAE;IACxBY,QAAQ,EAAE,CAAC;IACXC,SAAS,EAAE;EACb,CAAC;EACD3B,MAAM,EAAE;IACNoB,aAAa,EAAE;EACjB,CAAC;EACDlB,MAAM,EAAE;IACNkB,aAAa,EAAE,UAAU;IACzBC,QAAQ,EAAE,UAAU;IACpBE,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["PureComponent","createRef","isValidElement","createElement","TrueSheetViewNativeComponent","TrueSheetContainerViewNativeComponent","TrueSheetContentViewNativeComponent","TrueSheetHeaderViewNativeComponent","TrueSheetFooterViewNativeComponent","TrueSheetModule","Platform","StyleSheet","findNodeHandle","processColor","jsx","_jsx","jsxs","_jsxs","LINKING_ERROR","select","ios","default","Error","TrueSheet","displayName","instances","presentationResolver","isPresenting","constructor","props","nativeRef","validateDetents","shouldRenderImmediately","initialDetentIndex","undefined","state","shouldRenderNativeView","onMount","bind","onWillDismiss","onDidDismiss","onWillPresent","onDidPresent","onDetentChange","onDragBegin","onDragChange","onDragEnd","onPositionChange","onWillFocus","onDidFocus","onWillBlur","onDidBlur","onBackPress","detents","length","console","warn","forEach","detent","index","detentsLength","Math","min","getInstance","name","instance","handle","nodeHandle","current","present","animated","dismiss","resize","dismissAll","registerInstance","unregisterInstance","event","setState","Promise","resolve","presentByRef","dismissByRef","componentDidMount","componentDidUpdate","prevProps","componentWillUnmount","render","backgroundColor","dismissible","draggable","grabber","grabberOptions","dimmed","initialDetentAnimated","dimmedDetentIndex","backgroundBlur","blurOptions","cornerRadius","maxHeight","scrollable","pageSizing","children","style","header","headerStyle","footer","footerStyle","insetAdjustment","rest","resolvedDetents","slice","map","containerStyle","android","styles","scrollableAndroidContainer","contentStyle","scrollableAndroidContent","ref","sheetView","color","create","zIndex","pointerEvents","position","top","left","right","bottom","flexGrow","flexBasis"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,SAAS,EAGTC,cAAc,EACdC,aAAa,QACR,OAAO;AAqBd,OAAOC,4BAA4B,MAAM,uCAAuC;AAChF,OAAOC,qCAAqC,MAAM,gDAAgD;AAClG,OAAOC,mCAAmC,MAAM,8CAA8C;AAC9F,OAAOC,kCAAkC,MAAM,6CAA6C;AAC5F,OAAOC,kCAAkC,MAAM,6CAA6C;AAE5F,OAAOC,eAAe,MAAM,kCAA+B;AAE3D,SAASC,QAAQ,EAAEC,UAAU,EAAEC,cAAc,EAAEC,YAAY,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElF,MAAMC,aAAa,GACjB,2FAA2F,GAC3FR,QAAQ,CAACS,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B,GAC/B,iDAAiD;AAEnD,IAAI,CAACZ,eAAe,EAAE;EACpB,MAAM,IAAIa,KAAK,CAACJ,aAAa,CAAC;AAChC;AAQA,OAAO,MAAMK,SAAS,SACZvB,aAAa,CAEvB;EACEwB,WAAW,GAAG,WAAW;EAIzB;AACF;AACA;EACE,OAAwBC,SAAS,GAAkC,CAAC,CAAC;;EAErE;AACF;AACA;EACUC,oBAAoB,GAAwB,IAAI;;EAExD;AACF;AACA;EACUC,YAAY,GAAY,KAAK;EAErCC,WAAWA,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,SAAS,gBAAG7B,SAAS,CAAY,CAAC;IAEvC,IAAI,CAAC8B,eAAe,CAAC,CAAC;;IAEtB;IACA,MAAMC,uBAAuB,GAC3BH,KAAK,CAACI,k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ACRC,MAAM,EAAE;EACV,CAAC;EACDX,wBAAwB,EAAE;IACxBY,QAAQ,EAAE,CAAC;IACXC,SAAS,EAAE;EACb,CAAC;EACD3B,MAAM,EAAE;IACNoB,aAAa,EAAE;EACjB,CAAC;EACDlB,MAAM,EAAE;IACNkB,aAAa,EAAE,UAAU;IACzBC,QAAQ,EAAE,UAAU;IACpBE,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -14,6 +14,10 @@ export declare class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetSt
|
|
|
14
14
|
* Resolver to be called when mount event is received
|
|
15
15
|
*/
|
|
16
16
|
private presentationResolver;
|
|
17
|
+
/**
|
|
18
|
+
* Tracks if a present operation is in progress
|
|
19
|
+
*/
|
|
20
|
+
private isPresenting;
|
|
17
21
|
constructor(props: TrueSheetProps);
|
|
18
22
|
private validateDetents;
|
|
19
23
|
private static getInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheet.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EAgBb,MAAM,mBAAmB,CAAC;AAwB3B,UAAU,cAAc;IACtB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,qBAAa,SACX,SAAQ,aAAa,CAAC,cAAc,EAAE,cAAc,CACpD,YAAW,YAAY;IAEvB,WAAW,SAAe;IAE1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;IAExD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAqC;IAEtE;;OAEG;IACH,OAAO,CAAC,oBAAoB,CAA6B;
|
|
1
|
+
{"version":3,"file":"TrueSheet.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.tsx"],"names":[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AAY;IAUpB,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,WAAW;IAIN,OAAO,CAAC,KAAK,GAAE,MAAU,EAAE,QAAQ,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBnE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpC,OAAO,CAAC,QAAQ,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D,iBAAiB,IAAI,IAAI;IAIzB,kBAAkB,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI;IASnD,oBAAoB,IAAI,IAAI;IAO5B,MAAM,IAAI,SAAS;CAiHpB"}
|
package/package.json
CHANGED
package/src/TrueSheet.tsx
CHANGED
|
@@ -72,6 +72,11 @@ export class TrueSheet
|
|
|
72
72
|
*/
|
|
73
73
|
private presentationResolver: (() => void) | null = null;
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Tracks if a present operation is in progress
|
|
77
|
+
*/
|
|
78
|
+
private isPresenting: boolean = false;
|
|
79
|
+
|
|
75
80
|
constructor(props: TrueSheetProps) {
|
|
76
81
|
super(props);
|
|
77
82
|
|
|
@@ -249,8 +254,12 @@ export class TrueSheet
|
|
|
249
254
|
}
|
|
250
255
|
|
|
251
256
|
private onDidDismiss(event: DidDismissEvent): void {
|
|
252
|
-
// Clean up native view after dismiss for lazy loading
|
|
253
|
-
|
|
257
|
+
// Clean up native view after dismiss for lazy loading.
|
|
258
|
+
// Skip unmount if a present is in progress to avoid race condition.
|
|
259
|
+
if (!this.isPresenting) {
|
|
260
|
+
this.setState({ shouldRenderNativeView: false });
|
|
261
|
+
}
|
|
262
|
+
|
|
254
263
|
this.props.onDidDismiss?.(event);
|
|
255
264
|
}
|
|
256
265
|
|
|
@@ -308,6 +317,8 @@ export class TrueSheet
|
|
|
308
317
|
);
|
|
309
318
|
}
|
|
310
319
|
|
|
320
|
+
this.isPresenting = true;
|
|
321
|
+
|
|
311
322
|
// Lazy load: render native view if not already rendered
|
|
312
323
|
if (!this.state.shouldRenderNativeView) {
|
|
313
324
|
await new Promise<void>((resolve) => {
|
|
@@ -316,7 +327,8 @@ export class TrueSheet
|
|
|
316
327
|
});
|
|
317
328
|
}
|
|
318
329
|
|
|
319
|
-
|
|
330
|
+
await TrueSheetModule?.presentByRef(this.handle, index, animated);
|
|
331
|
+
this.isPresenting = false;
|
|
320
332
|
}
|
|
321
333
|
|
|
322
334
|
public async resize(index: number): Promise<void> {
|