react-native-nitro-modal 0.3.7-rc → 1.0.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/README.md +2 -0
- package/android/src/main/java/com/margelo/nitro/nitromodal/BottomSheetPresenter.kt +0 -10
- package/android/src/main/java/com/margelo/nitro/nitromodal/HybridNitroModal.kt +0 -2
- package/android/src/main/java/com/margelo/nitro/nitromodal/ModalContentRoot.kt +83 -4
- package/android/src/main/java/com/margelo/nitro/nitromodal/ModalPresenter.kt +0 -2
- package/android/src/main/java/com/margelo/nitro/nitromodal/NitroModalHostView.kt +1 -3
- package/android/src/main/java/com/margelo/nitro/nitromodal/NitroModalViewManager.kt +0 -2
- package/ios/HybridNitroModal.swift +0 -1
- package/ios/HybridNitroModalComponent+Children.mm +59 -1
- package/ios/ModalConfig.swift +0 -1
- package/ios/NitroModalHostView.swift +0 -1
- package/ios/PopupViewController.swift +0 -1
- package/ios/SheetView.swift +0 -5
- package/lib/module/NitroModalView.js +0 -5
- package/lib/module/NitroModalView.js.map +1 -1
- package/lib/module/NitroModalView.web.js +0 -2
- package/lib/module/NitroModalView.web.js.map +1 -1
- package/lib/module/web/AnimatedValue.js +0 -4
- package/lib/module/web/AnimatedValue.js.map +1 -1
- package/lib/module/web/ModalConfig.js.map +1 -1
- package/lib/module/web/ModalController.js +0 -16
- package/lib/module/web/ModalController.js.map +1 -1
- package/lib/module/web/ModalPresenter.js +0 -1
- package/lib/module/web/ModalPresenter.js.map +1 -1
- package/lib/module/web/SheetPresenter.js +0 -17
- package/lib/module/web/SheetPresenter.js.map +1 -1
- package/lib/module/web/dom.js +0 -4
- package/lib/module/web/dom.js.map +1 -1
- package/lib/typescript/src/NitroModal.nitro.d.ts +0 -2
- package/lib/typescript/src/NitroModal.nitro.d.ts.map +1 -1
- package/lib/typescript/src/NitroModalView.d.ts.map +1 -1
- package/lib/typescript/src/NitroModalView.web.d.ts.map +1 -1
- package/lib/typescript/src/web/AnimatedValue.d.ts +0 -2
- package/lib/typescript/src/web/AnimatedValue.d.ts.map +1 -1
- package/lib/typescript/src/web/ModalConfig.d.ts +0 -1
- package/lib/typescript/src/web/ModalConfig.d.ts.map +1 -1
- package/lib/typescript/src/web/ModalController.d.ts +0 -3
- package/lib/typescript/src/web/ModalController.d.ts.map +1 -1
- package/lib/typescript/src/web/ModalPresenter.d.ts +0 -3
- package/lib/typescript/src/web/ModalPresenter.d.ts.map +1 -1
- package/lib/typescript/src/web/SheetPresenter.d.ts +0 -6
- package/lib/typescript/src/web/SheetPresenter.d.ts.map +1 -1
- package/lib/typescript/src/web/dom.d.ts +0 -2
- package/lib/typescript/src/web/dom.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NitroModal.nitro.ts +0 -2
- package/src/NitroModalView.tsx +0 -4
- package/src/NitroModalView.web.tsx +0 -2
- package/src/web/AnimatedValue.ts +0 -2
- package/src/web/ModalConfig.ts +0 -1
- package/src/web/ModalController.ts +0 -11
- package/src/web/ModalPresenter.ts +0 -3
- package/src/web/SheetPresenter.ts +0 -12
- package/src/web/dom.ts +0 -2
package/README.md
CHANGED
|
@@ -290,6 +290,8 @@ import type {
|
|
|
290
290
|
|
|
291
291
|
`<NitroModal>` mounts a zero-size placeholder in your React tree. When opened, the native side presents a real view controller (iOS) or window (Android) and hosts your React children inside it. An inline sheet instead lives in a view laid out with `style`, in your screen's own hierarchy: touches that miss the sheet go to the views behind it, and `keyboardBehavior` doesn't apply (the screen's own keyboard handling does). Children mount when the modal opens and stay mounted until the native exit animation completes, so content never disappears mid-transition. The native side also reports the exact area available to the content (accounting for rotation, keyboard and sheet size), and the content container is sized accordingly.
|
|
292
292
|
|
|
293
|
+
React still lays the children out inside the placeholder, wherever it sits in your screen, so `measure()` reports them there. Touches on a modal's content are reported in those same coordinates (the placeholder's position in its root view is added to `pageX`/`pageY`), which keeps `Pressable` working wherever you render `<NitroModal>`: below a header, inside a scroll view or inside another modal. `locationX`/`locationY` are unaffected.
|
|
294
|
+
|
|
293
295
|
## Platform notes
|
|
294
296
|
|
|
295
297
|
**iOS**
|
|
@@ -74,7 +74,6 @@ internal class BottomSheetPresenter(
|
|
|
74
74
|
private var lastDetentIndex = -1
|
|
75
75
|
private var reportedRestingTop = Int.MIN_VALUE
|
|
76
76
|
|
|
77
|
-
/** The detent a settle we started is heading for, until it arrives; -1 otherwise. */
|
|
78
77
|
private var settlingTo = -1
|
|
79
78
|
|
|
80
79
|
/** The behavior is dragging the sheet (as opposed to a nested scroll moving it). */
|
|
@@ -85,7 +84,6 @@ internal class BottomSheetPresenter(
|
|
|
85
84
|
private var pullAnimator: ValueAnimator? = null
|
|
86
85
|
private val refreshThreshold = activity.dpToPx(REFRESH_THRESHOLD_DP)
|
|
87
86
|
|
|
88
|
-
/** The sheet rests below its lowest detent, the indicator spinning above it. */
|
|
89
87
|
private var refreshing = config.refreshing ?: false
|
|
90
88
|
|
|
91
89
|
/** A predictive back gesture was committed; the behavior is sliding the sheet out. */
|
|
@@ -177,7 +175,6 @@ internal class BottomSheetPresenter(
|
|
|
177
175
|
applyAppearance()
|
|
178
176
|
|
|
179
177
|
behavior.isGestureInsetBottomIgnored = true
|
|
180
|
-
// Inline, the host view decides the width.
|
|
181
178
|
if (!isInline) behavior.maxWidth = dp(MAX_WIDTH_DP)
|
|
182
179
|
behavior.isHideable = true
|
|
183
180
|
behavior.state = BottomSheetBehavior.STATE_HIDDEN
|
|
@@ -296,7 +293,6 @@ internal class BottomSheetPresenter(
|
|
|
296
293
|
refreshIndicator.indeterminateTintList = config.refreshIndicatorColor?.let(ColorStateList::valueOf)
|
|
297
294
|
}
|
|
298
295
|
|
|
299
|
-
/** Recomputes detent heights and maps them onto the behavior's states. */
|
|
300
296
|
private fun updateDetents() {
|
|
301
297
|
val parentHeight = coordinator.height
|
|
302
298
|
if (parentHeight == 0) return
|
|
@@ -444,7 +440,6 @@ internal class BottomSheetPresenter(
|
|
|
444
440
|
}
|
|
445
441
|
}
|
|
446
442
|
|
|
447
|
-
/** Where the sheet rests below its lowest detent: held there while refreshing. */
|
|
448
443
|
private fun restingPullOffset(): Float =
|
|
449
444
|
if (refreshing && behavior.state == states().firstOrNull()) refreshThreshold else 0f
|
|
450
445
|
|
|
@@ -454,10 +449,6 @@ internal class BottomSheetPresenter(
|
|
|
454
449
|
if (presented && !isDismissing) animatePullOffset(restingPullOffset())
|
|
455
450
|
}
|
|
456
451
|
|
|
457
|
-
/**
|
|
458
|
-
* Centered in the gap a pull uncovers above the content, fading in as the
|
|
459
|
-
* pull nears the threshold.
|
|
460
|
-
*/
|
|
461
452
|
private fun layoutRefreshIndicator() {
|
|
462
453
|
val size = refreshIndicator.layoutParams?.height ?: return
|
|
463
454
|
refreshIndicator.translationY = (pullOffset - size) / 2
|
|
@@ -669,7 +660,6 @@ internal class BottomSheetPresenter(
|
|
|
669
660
|
private const val DEFAULT_CORNER_RADIUS_DP = 28f
|
|
670
661
|
private const val MAX_WIDTH_DP = 640f
|
|
671
662
|
|
|
672
|
-
/** How far below its lowest detent the sheet must be pulled to refresh. */
|
|
673
663
|
private const val REFRESH_THRESHOLD_DP = 56f
|
|
674
664
|
private const val REFRESH_INDICATOR_SIZE_DP = 32f
|
|
675
665
|
private const val BORDER_OVERHANG_DP = 8f
|
|
@@ -80,8 +80,6 @@ class HybridNitroModal(private val reactContext: ThemedReactContext) :
|
|
|
80
80
|
|
|
81
81
|
/** A present request was accepted and its `onDismiss` is still owed. */
|
|
82
82
|
private var sessionActive = false
|
|
83
|
-
|
|
84
|
-
/** `onPresent` was sent for the current session. */
|
|
85
83
|
private var presentSent = false
|
|
86
84
|
private var dismissReason = DismissReason.PROGRAMMATIC
|
|
87
85
|
private var reconcileScheduled = false
|
|
@@ -10,7 +10,9 @@ import com.facebook.react.uimanager.JSTouchDispatcher
|
|
|
10
10
|
import com.facebook.react.uimanager.RootView
|
|
11
11
|
import com.facebook.react.uimanager.RootViewUtil
|
|
12
12
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
13
|
+
import com.facebook.react.uimanager.events.Event
|
|
13
14
|
import com.facebook.react.uimanager.events.EventDispatcher
|
|
15
|
+
import com.facebook.react.uimanager.events.TouchEvent
|
|
14
16
|
import com.facebook.react.views.view.ReactViewGroup
|
|
15
17
|
|
|
16
18
|
/**
|
|
@@ -21,6 +23,10 @@ import com.facebook.react.views.view.ReactViewGroup
|
|
|
21
23
|
* forwards touch and pointer events to JS itself. Children are laid out by
|
|
22
24
|
* Fabric; [ReactViewGroup.onLayout] is a no-op.
|
|
23
25
|
*
|
|
26
|
+
* Unlike `Modal`, the children stay laid out inside the host, wherever it sits
|
|
27
|
+
* in the screen, and `measure()` reports them there. Touches are reported in
|
|
28
|
+
* those coordinates too (see [ReactCoordinatesDispatcher]).
|
|
29
|
+
*
|
|
24
30
|
* An inline sheet keeps this view inside the React root view, which already
|
|
25
31
|
* forwards its touches: then it only passes native gestures on to that root.
|
|
26
32
|
*/
|
|
@@ -29,8 +35,17 @@ internal class ModalContentRoot(private val reactContext: ThemedReactContext) :
|
|
|
29
35
|
ReactViewGroup(reactContext), RootView {
|
|
30
36
|
|
|
31
37
|
var eventDispatcher: EventDispatcher? = null
|
|
38
|
+
set(value) {
|
|
39
|
+
field = value
|
|
40
|
+
touchEventDispatcher = value?.let { ReactCoordinatesDispatcher(it) }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** [eventDispatcher], reporting touches where React laid the children out. */
|
|
44
|
+
private var touchEventDispatcher: EventDispatcher? = null
|
|
45
|
+
|
|
46
|
+
/** The modal's host view: the children's parent in the React tree. */
|
|
47
|
+
var reactParent: View? = null
|
|
32
48
|
|
|
33
|
-
/** Called when a child's laid-out bounds change. */
|
|
34
49
|
var onContentSizeChange: (() -> Unit)? = null
|
|
35
50
|
|
|
36
51
|
/** Hosted by an inline sheet, inside the React root view. */
|
|
@@ -47,7 +62,7 @@ internal class ModalContentRoot(private val reactContext: ThemedReactContext) :
|
|
|
47
62
|
|
|
48
63
|
/** Dispatches touches to JS itself: only outside the React root view. */
|
|
49
64
|
private val activeEventDispatcher: EventDispatcher?
|
|
50
|
-
get() = if (isInline) null else
|
|
65
|
+
get() = if (isInline) null else touchEventDispatcher
|
|
51
66
|
|
|
52
67
|
private val childLayoutListener =
|
|
53
68
|
OnLayoutChangeListener { _, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom ->
|
|
@@ -128,7 +143,7 @@ internal class ModalContentRoot(private val reactContext: ThemedReactContext) :
|
|
|
128
143
|
outerRootView()?.onChildStartedNativeGesture(childView, ev)
|
|
129
144
|
return
|
|
130
145
|
}
|
|
131
|
-
|
|
146
|
+
touchEventDispatcher?.let {
|
|
132
147
|
touchDispatcher.onChildStartedNativeGesture(ev, it, reactContext)
|
|
133
148
|
pointerDispatcher?.onChildStartedNativeGesture(childView, ev, it)
|
|
134
149
|
}
|
|
@@ -139,13 +154,77 @@ internal class ModalContentRoot(private val reactContext: ThemedReactContext) :
|
|
|
139
154
|
outerRootView()?.onChildEndedNativeGesture(childView, ev)
|
|
140
155
|
return
|
|
141
156
|
}
|
|
142
|
-
|
|
157
|
+
touchEventDispatcher?.let { touchDispatcher.onChildEndedNativeGesture(ev, it) }
|
|
143
158
|
pointerDispatcher?.onChildEndedNativeGesture()
|
|
144
159
|
}
|
|
145
160
|
|
|
146
161
|
/** The React root view an inline sheet lives in. */
|
|
147
162
|
private fun outerRootView(): RootView? = (parent as? View)?.let { RootViewUtil.getRootView(it) }
|
|
148
163
|
|
|
164
|
+
/**
|
|
165
|
+
* The root view that reports touches on [view]. An inline sheet's content
|
|
166
|
+
* root leaves that to the root view it lives in.
|
|
167
|
+
*/
|
|
168
|
+
private fun touchRootOf(view: View): View? {
|
|
169
|
+
var current = view.parent
|
|
170
|
+
while (current is View) {
|
|
171
|
+
if (current is RootView && !(current is ModalContentRoot && current.isInline)) return current
|
|
172
|
+
current = current.parent
|
|
173
|
+
}
|
|
174
|
+
return null
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Where the children are in React's coordinates, relative to this view, in
|
|
179
|
+
* px: the host's position in the root view that reports the host's own
|
|
180
|
+
* touches. That root's touches are relative to itself, and so is what
|
|
181
|
+
* `measure()` reports for the views in it, the host's children included.
|
|
182
|
+
*/
|
|
183
|
+
private fun getReactOffset(out: IntArray) {
|
|
184
|
+
out[0] = 0
|
|
185
|
+
out[1] = 0
|
|
186
|
+
val host = reactParent ?: return
|
|
187
|
+
val root = touchRootOf(host) ?: return
|
|
188
|
+
val hostLocation = IntArray(2)
|
|
189
|
+
host.getLocationInWindow(hostLocation)
|
|
190
|
+
root.getLocationInWindow(out)
|
|
191
|
+
out[0] = hostLocation[0] - out[0]
|
|
192
|
+
out[1] = hostLocation[1] - out[1]
|
|
193
|
+
if (root is ModalContentRoot) {
|
|
194
|
+
// A modal opened from another modal's content: that root reports its
|
|
195
|
+
// touches in React's coordinates as well.
|
|
196
|
+
root.getReactOffset(hostLocation)
|
|
197
|
+
out[0] += hostLocation[0]
|
|
198
|
+
out[1] += hostLocation[1]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Reports touches in the coordinates React measures the children in.
|
|
204
|
+
*
|
|
205
|
+
* `Pressable` measures itself on press-in and cancels the press when a move
|
|
206
|
+
* leaves that area. Reported relative to this view instead, a touch would be
|
|
207
|
+
* compared with an area as far off as the host is from its root's corner
|
|
208
|
+
* (below a header, inside a scroll view...), and a tap with the slightest
|
|
209
|
+
* finger movement would never fire `onPress`. Hit-testing is unaffected: it
|
|
210
|
+
* runs on the native views before the event gets here. Only the copy of the
|
|
211
|
+
* `MotionEvent` that the [TouchEvent] owns is moved.
|
|
212
|
+
*/
|
|
213
|
+
private inner class ReactCoordinatesDispatcher(private val target: EventDispatcher) :
|
|
214
|
+
EventDispatcher by target {
|
|
215
|
+
private val offset = IntArray(2)
|
|
216
|
+
|
|
217
|
+
override fun dispatchEvent(event: Event<*>) {
|
|
218
|
+
if (event is TouchEvent) {
|
|
219
|
+
val motionEvent = event.getMotionEvent()
|
|
220
|
+
// Like `Pressable`'s area, measured when the gesture starts.
|
|
221
|
+
if (motionEvent.actionMasked == MotionEvent.ACTION_DOWN) getReactOffset(offset)
|
|
222
|
+
motionEvent.offsetLocation(offset[0].toFloat(), offset[1].toFloat())
|
|
223
|
+
}
|
|
224
|
+
target.dispatchEvent(event)
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
149
228
|
override fun handleException(t: Throwable) {
|
|
150
229
|
reactContext.reactApplicationContext.handleException(RuntimeException(t))
|
|
151
230
|
}
|
|
@@ -59,7 +59,6 @@ internal abstract class ModalPresenter(
|
|
|
59
59
|
protected var config: ModalConfig = config
|
|
60
60
|
private set
|
|
61
61
|
|
|
62
|
-
/** Lives in [inlineHost] rather than in a window of its own. */
|
|
63
62
|
protected val isInline: Boolean
|
|
64
63
|
get() = inlineHost != null
|
|
65
64
|
|
|
@@ -206,7 +205,6 @@ internal abstract class ModalPresenter(
|
|
|
206
205
|
onConfigChanged(previous)
|
|
207
206
|
}
|
|
208
207
|
|
|
209
|
-
/** The inline host moved or resized. */
|
|
210
208
|
fun onHostLayoutChanged() {
|
|
211
209
|
if (isInline && !finished) updateInlineInsets()
|
|
212
210
|
}
|
|
@@ -18,10 +18,8 @@ import com.facebook.react.uimanager.ThemedReactContext
|
|
|
18
18
|
*/
|
|
19
19
|
@SuppressLint("ViewConstructor")
|
|
20
20
|
class NitroModalHostView(context: ThemedReactContext) : ViewGroup(context), ReactPointerEventsView {
|
|
21
|
-
internal val contentRoot = ModalContentRoot(context)
|
|
21
|
+
internal val contentRoot = ModalContentRoot(context).also { it.reactParent = this }
|
|
22
22
|
internal var onAttachedChange: ((attached: Boolean) -> Unit)? = null
|
|
23
|
-
|
|
24
|
-
/** The size or position changed. */
|
|
25
23
|
internal var onLayoutChange: (() -> Unit)? = null
|
|
26
24
|
|
|
27
25
|
internal var isInline: Boolean = false
|
|
@@ -10,8 +10,6 @@ import com.margelo.nitro.R.id.associated_hybrid_view_tag
|
|
|
10
10
|
import com.margelo.nitro.nitromodal.views.HybridNitroModalStateUpdater
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* View manager for the "NitroModal" Nitro view.
|
|
14
|
-
*
|
|
15
13
|
* Nitrogen generates a `SimpleViewManager`, which cannot have children. This
|
|
16
14
|
* is the same manager as a `ViewGroupManager`: props still flow through the
|
|
17
15
|
* generated C++ state updater, and React children are redirected into the
|
|
@@ -234,7 +234,6 @@ final class HybridNitroModal: HybridNitroModalSpec {
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
/// Slides an inline sheet up inside `view`.
|
|
238
237
|
private func startInlinePresent() {
|
|
239
238
|
// Needs its laid-out area; `hostLayoutDidChange` retries.
|
|
240
239
|
guard view.window != nil, view.bounds.width > 0, view.bounds.height > 0 else { return }
|
|
@@ -9,12 +9,68 @@
|
|
|
9
9
|
// outside the React root view, so the root's touch handler never sees it).
|
|
10
10
|
//
|
|
11
11
|
// This mirrors what React Native's own RCTModalHostViewComponentView does.
|
|
12
|
+
// Unlike `Modal`'s, the children stay laid out inside the host, wherever it
|
|
13
|
+
// sits in the screen, so the touch handler reports touches there too (see
|
|
14
|
+
// `NitroModalTouchHandler`).
|
|
12
15
|
//
|
|
13
16
|
|
|
14
17
|
#import <UIKit/UIKit.h>
|
|
18
|
+
#import <UIKit/UIGestureRecognizerSubclass.h>
|
|
15
19
|
#import <React/RCTSurfaceTouchHandler.h>
|
|
16
20
|
#import <React/RCTViewComponentView.h>
|
|
17
21
|
|
|
22
|
+
@class NitroModalTouchHandler;
|
|
23
|
+
static CGPoint NitroModalReactOrigin(UIView *reactParent);
|
|
24
|
+
|
|
25
|
+
/// Reports touches in the coordinates React measures the modal's children in.
|
|
26
|
+
///
|
|
27
|
+
/// React lays the children out inside the host, wherever the host sits in its
|
|
28
|
+
/// root view, and `measure()` reports them there. `Pressable` measures itself
|
|
29
|
+
/// on press-in and cancels the press when a move leaves that area. Reported
|
|
30
|
+
/// relative to the presented content instead, a touch would be compared with
|
|
31
|
+
/// an area as far off as the host is from its root's corner (below a header,
|
|
32
|
+
/// inside a scroll view...), and a tap with the slightest finger movement
|
|
33
|
+
/// would never fire `onPress`. Hit-testing is unaffected: `viewOriginOffset`
|
|
34
|
+
/// only moves the page coordinates sent to JS.
|
|
35
|
+
@interface NitroModalTouchHandler : RCTSurfaceTouchHandler
|
|
36
|
+
/// The modal's host: the children's parent in the React tree.
|
|
37
|
+
@property (nonatomic, weak) UIView *reactParent;
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
@implementation NitroModalTouchHandler
|
|
41
|
+
|
|
42
|
+
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
|
|
43
|
+
{
|
|
44
|
+
// Like `Pressable`'s area, measured when the gesture starts.
|
|
45
|
+
if (self.state == UIGestureRecognizerStatePossible) {
|
|
46
|
+
self.viewOriginOffset = NitroModalReactOrigin(self.reactParent);
|
|
47
|
+
}
|
|
48
|
+
[super touchesBegan:touches withEvent:event];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@end
|
|
52
|
+
|
|
53
|
+
/// The host's position in the root view that reports the host's own touches,
|
|
54
|
+
/// in that root's page coordinates: where React has the host's children.
|
|
55
|
+
static CGPoint NitroModalReactOrigin(UIView *reactParent)
|
|
56
|
+
{
|
|
57
|
+
for (UIView *view = reactParent.superview; view != nil; view = view.superview) {
|
|
58
|
+
for (UIGestureRecognizer *recognizer in view.gestureRecognizers) {
|
|
59
|
+
// An inline sheet's handler is disabled: its root view reports its touches.
|
|
60
|
+
if (!recognizer.enabled || ![recognizer isKindOfClass:[RCTSurfaceTouchHandler class]]) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
CGPoint origin = [reactParent convertPoint:CGPointZero toView:view];
|
|
64
|
+
// Opened from another modal's content, whose touches are moved as well.
|
|
65
|
+
CGPoint rootOrigin = [recognizer isKindOfClass:[NitroModalTouchHandler class]]
|
|
66
|
+
? NitroModalReactOrigin(((NitroModalTouchHandler *)recognizer).reactParent)
|
|
67
|
+
: ((RCTSurfaceTouchHandler *)recognizer).viewOriginOffset;
|
|
68
|
+
return CGPointMake(origin.x + rootOrigin.x, origin.y + rootOrigin.y);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return CGPointZero;
|
|
72
|
+
}
|
|
73
|
+
|
|
18
74
|
/// Implemented in Swift by `NitroModalHostView`. The pod does not emit an
|
|
19
75
|
/// ObjC header for its Swift code, so the methods are reached by selector.
|
|
20
76
|
@protocol NitroModalChildHost <NSObject>
|
|
@@ -58,7 +114,9 @@
|
|
|
58
114
|
}
|
|
59
115
|
if (!hasTouchHandler) {
|
|
60
116
|
// The view retains the recognizer; it goes away together with the host.
|
|
61
|
-
[
|
|
117
|
+
NitroModalTouchHandler *touchHandler = [NitroModalTouchHandler new];
|
|
118
|
+
touchHandler.reactParent = self;
|
|
119
|
+
[touchHandler attachToView:touchRoot];
|
|
62
120
|
}
|
|
63
121
|
|
|
64
122
|
[host nitroModalMountChild:childComponentView atIndex:index];
|
package/ios/ModalConfig.swift
CHANGED
|
@@ -75,7 +75,6 @@ struct ModalConfig: Equatable {
|
|
|
75
75
|
/// `HybridNitroModal`.
|
|
76
76
|
protocol ModalPresentationDelegate: AnyObject {
|
|
77
77
|
func modalPresentationDidTapBackdrop()
|
|
78
|
-
/// The user swiped the sheet down far enough to dismiss it.
|
|
79
78
|
func modalPresentationDidRequestSwipeDismiss()
|
|
80
79
|
func modalPresentationDidChangeDetent(_ index: Int)
|
|
81
80
|
func modalPresentationDidChangeContentArea(_ size: CGSize)
|
|
@@ -17,7 +17,6 @@ final class PopupViewController: UIViewController, ModalPresenting, UIViewContro
|
|
|
17
17
|
private let backdrop = BackdropView()
|
|
18
18
|
private let card = UIView()
|
|
19
19
|
private var config: ModalConfig
|
|
20
|
-
/// Portion of the view covered by the keyboard.
|
|
21
20
|
private var keyboardOverlap: CGFloat = 0
|
|
22
21
|
|
|
23
22
|
init(contentView: NitroModalContentView, config: ModalConfig) {
|
package/ios/SheetView.swift
CHANGED
|
@@ -51,7 +51,6 @@ final class SheetView: UIView, UIGestureRecognizerDelegate {
|
|
|
51
51
|
private var releaseVelocity: CGFloat = 0
|
|
52
52
|
private var reportedRestingTop: CGFloat?
|
|
53
53
|
private var refreshFeedback: UIImpactFeedbackGenerator?
|
|
54
|
-
/// The sheet rests below its lowest detent, the indicator spinning above it.
|
|
55
54
|
private var isRefreshing = false
|
|
56
55
|
|
|
57
56
|
private var lockedScrollView: UIScrollView?
|
|
@@ -245,8 +244,6 @@ final class SheetView: UIView, UIGestureRecognizerDelegate {
|
|
|
245
244
|
detents.indices.map(restingTop(for:))
|
|
246
245
|
}
|
|
247
246
|
|
|
248
|
-
/// Where the sheet settles on `detents[index]`: held below the lowest
|
|
249
|
-
/// detent while refreshing.
|
|
250
247
|
private func settledTop(for index: Int) -> CGFloat {
|
|
251
248
|
let top = restingTop(for: index)
|
|
252
249
|
guard isRefreshing, let lowest = detentTops.max(), abs(top - lowest) < 1 else { return top }
|
|
@@ -290,8 +287,6 @@ final class SheetView: UIView, UIGestureRecognizerDelegate {
|
|
|
290
287
|
reportRestingTop()
|
|
291
288
|
}
|
|
292
289
|
|
|
293
|
-
/// Centered in the gap a pull uncovers above the content, fading in as the
|
|
294
|
-
/// pull nears the threshold.
|
|
295
290
|
private func layoutRefreshIndicator(width: CGFloat, pull: CGFloat) {
|
|
296
291
|
let size = refreshIndicator.intrinsicContentSize
|
|
297
292
|
refreshIndicator.bounds = CGRect(origin: .zero, size: size)
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
let warned = false;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Platforms without an implementation render nothing. iOS and Android use
|
|
7
|
-
* `NitroModalView.native.tsx`, web uses `NitroModalView.web.tsx`.
|
|
8
|
-
*/
|
|
9
4
|
function UnsupportedNitroModalView() {
|
|
10
5
|
if (!warned) {
|
|
11
6
|
warned = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["warned","UnsupportedNitroModalView","console","warn","callback","func","NitroModalView"],"sourceRoot":"../../src","sources":["NitroModalView.tsx"],"mappings":";;AAMA,IAAIA,MAAM,GAAG,KAAK
|
|
1
|
+
{"version":3,"names":["warned","UnsupportedNitroModalView","console","warn","callback","func","NitroModalView"],"sourceRoot":"../../src","sources":["NitroModalView.tsx"],"mappings":";;AAMA,IAAIA,MAAM,GAAG,KAAK;AAElB,SAASC,yBAAyBA,CAAA,EAAG;EACnC,IAAI,CAACD,MAAM,EAAE;IACXA,MAAM,GAAG,IAAI;IACbE,OAAO,CAACC,IAAI,CACV,uEACF,CAAC;EACH;EACA,OAAO,IAAI;AACb;AAEA,OAAO,MAAMC,QAAQ,GAAKC,IAAa,IAAKA,IAA6B;AAEzE,OAAO,MAAMC,cAAc,GACzBL,yBAGC","ignoreList":[]}
|
|
@@ -135,7 +135,6 @@ const styles = {
|
|
|
135
135
|
inset: 0,
|
|
136
136
|
outline: 'none'
|
|
137
137
|
},
|
|
138
|
-
// Fills the host view; the sheet hides below its bottom edge.
|
|
139
138
|
inlineOverlay: {
|
|
140
139
|
position: 'absolute',
|
|
141
140
|
inset: 0,
|
|
@@ -172,7 +171,6 @@ const styles = {
|
|
|
172
171
|
backgroundColor: 'rgba(127, 127, 127, 0.4)',
|
|
173
172
|
pointerEvents: 'none'
|
|
174
173
|
},
|
|
175
|
-
// Sized by the presenter's border width; follows the surface's corners.
|
|
176
174
|
border: {
|
|
177
175
|
position: 'absolute',
|
|
178
176
|
inset: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useLayoutEffect","useRef","useState","Modal","View","clipOverflow","REFRESH_INDICATOR_SIZE","ModalController","jsx","_jsx","jsxs","_jsxs","callback","func","WebNitroModalView","props","hybridRef","children","isInline","mode","mounted","setMounted","controller","overlay","backdrop","surface","content","grabber","border","refreshIndicator","refreshSpinner","attach","detach","methods","update","undefined","elementsDidMount","current","elementsWillUnmount","contentDidRender","hostRef","node","hostDidChange","HTMLElement","layer","ref","tabIndex","style","styles","inlineOverlay","overflow","pointerEvents","visible","transparent","animationType","onRequestClose","handleBackPress","position","inset","outline","touchAction","left","top","boxSizing","willChange","width","height","marginLeft","borderRadius","backgroundColor","borderStyle","borderWidth","opacity","borderTopColor","NitroModalView"],"sourceRoot":"../../src","sources":["NitroModalView.web.tsx"],"mappings":";;AAAA;;AAEA,SACEA,WAAW,EACXC,eAAe,EACfC,MAAM,EACNC,QAAQ,QAGH,OAAO;AACd,SAASC,KAAK,EAAEC,IAAI,QAAwC,cAAc;AAG1E,SAASC,YAAY,EAAEC,sBAAsB,QAAQ,cAAW;AAChE,SAASC,eAAe,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASxD;AACA,OAAO,SAASC,QAAQA,CAAIC,IAAO,EAAK;EACtC,OAAOA,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACC,KAA6B,EAAE;EACxD,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGF,KAAK;EACrC,MAAMG,QAAQ,GAAGH,KAAK,CAACG,QAAQ,IAAIH,KAAK,CAACI,IAAI,KAAK,aAAa;EAC/D,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGnB,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACoB,UAAU,CAAC,GAAGpB,QAAQ,CAAC,MAAM,IAAIK,eAAe,CAACc,UAAU,CAAC,CAAC;EACpE,MAAME,OAAO,GAAGtB,MAAM,CAAiB,IAAI,CAAC;EAC5C,MAAMuB,QAAQ,GAAGvB,MAAM,CAAiB,IAAI,CAAC;EAC7C,MAAMwB,OAAO,GAAGxB,MAAM,CAAiB,IAAI,CAAC;EAC5C,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,GAAG,EAAEjB,MAAO;QAAC,mBAAW;QAACmB,KAAK,EAAEC,MAAM,CAACpB;MAAO,CAAE,CAAC;IAAA,CACnD,CAAC;EAAA,CACH,CAAC,GACJ,IAAI;EAER,IAAIV,QAAQ,EAAE;IACZ,oBACET,IAAA,CAACL,IAAI;MAACyC,GAAG,EAAEL,OAAQ;MAACO,KAAK,EAAEhC,KAAK,CAACgC,KAAM;MAACI,aAAa,EAAC,UAAU;MAAAlC,QAAA,EAC7D2B;IAAK,CACF,CAAC;EAEX;EAEA,IAAI,CAACA,KAAK,EAAE,OAAO,IAAI;EAEvB,oBACEnC,IAAA,CAACN,KAAK;IACJiD,OAAO;IACPC,WAAW;IACXC,aAAa,EAAC,MAAM;IACpBC,cAAc,EAAEjC,UAAU,CAACkC,eAAgB;IAAAvC,QAAA,EAE1C2B;EAAK,CACD,CAAC;AAEZ;AAEA,MAAMI,MAAM,GAAG;EACbzB,OAAO,EAAE;IACPkC,QAAQ,EAAE,OAAO;IACjBC,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACX,CAAC;
|
|
1
|
+
{"version":3,"names":["useCallback","useLayoutEffect","useRef","useState","Modal","View","clipOverflow","REFRESH_INDICATOR_SIZE","ModalController","jsx","_jsx","jsxs","_jsxs","callback","func","WebNitroModalView","props","hybridRef","children","isInline","mode","mounted","setMounted","controller","overlay","backdrop","surface","content","grabber","border","refreshIndicator","refreshSpinner","attach","detach","methods","update","undefined","elementsDidMount","current","elementsWillUnmount","contentDidRender","hostRef","node","hostDidChange","HTMLElement","layer","ref","tabIndex","style","styles","inlineOverlay","overflow","pointerEvents","visible","transparent","animationType","onRequestClose","handleBackPress","position","inset","outline","touchAction","left","top","boxSizing","willChange","width","height","marginLeft","borderRadius","backgroundColor","borderStyle","borderWidth","opacity","borderTopColor","NitroModalView"],"sourceRoot":"../../src","sources":["NitroModalView.web.tsx"],"mappings":";;AAAA;;AAEA,SACEA,WAAW,EACXC,eAAe,EACfC,MAAM,EACNC,QAA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,gBAAgB,EAAE;IAChB4B,QAAQ,EAAE,UAAU;IACpBI,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNG,KAAK,EAAE3D,sBAAsB;IAC7B4D,MAAM,EAAE5D,sBAAsB;IAC9BkE,OAAO,EAAE,CAAC;IACVrB,aAAa,EAAE;EACjB,CAAC;EACD;EACArB,cAAc,EAAE;IACdmC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdH,SAAS,EAAE,YAAY;IACvBK,YAAY,EAAE,KAAK;IACnBxC,MAAM,EAAE,0BAA0B;IAClC6C,cAAc,EAAE;EAClB;AACF,CAAyC;AAEzC,OAAO,MAAMC,cAAc,GAAG5D,iBAG7B","ignoreList":[]}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
/// <reference lib="dom" />
|
|
4
4
|
|
|
5
|
-
/** How an `AnimatedValue` moves to its target. */
|
|
6
|
-
|
|
7
5
|
/** Jumps to the target at once. The completion still arrives on the next frame. */
|
|
8
6
|
export const INSTANT = {
|
|
9
7
|
type: 'timing',
|
|
@@ -37,8 +35,6 @@ export class AnimatedValue {
|
|
|
37
35
|
get isAnimating() {
|
|
38
36
|
return this.run != null;
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
/** Jumps to `value`, cancelling any animation. */
|
|
42
38
|
set(value) {
|
|
43
39
|
this.stop();
|
|
44
40
|
this.current = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["INSTANT","type","duration","easing","t","MAX_FRAME_SECONDS","SPRING_STEP_SECONDS","AnimatedValue","speed","run","frame","lastTime","constructor","value","precision","onChange","current","isAnimating","set","stop","cancelAnimationFrame","animateTo","target","motion","options","velocity","undefined","now","performance","from","startTime","side","Math","sign","requestAnimationFrame","step","time","dt","min","max","done","stepTiming","stepSpring","onEnd","progress","next","omega","PI","response","stiffness","damping","dampingRatio","offset","steps","ceil","i","h","stopAtTarget","abs"],"sourceRoot":"../../../src","sources":["web/AnimatedValue.ts"],"mappings":";;AAAA;;
|
|
1
|
+
{"version":3,"names":["INSTANT","type","duration","easing","t","MAX_FRAME_SECONDS","SPRING_STEP_SECONDS","AnimatedValue","speed","run","frame","lastTime","constructor","value","precision","onChange","current","isAnimating","set","stop","cancelAnimationFrame","animateTo","target","motion","options","velocity","undefined","now","performance","from","startTime","side","Math","sign","requestAnimationFrame","step","time","dt","min","max","done","stepTiming","stepSpring","onEnd","progress","next","omega","PI","response","stiffness","damping","dampingRatio","offset","steps","ceil","i","h","stopAtTarget","abs"],"sourceRoot":"../../../src","sources":["web/AnimatedValue.ts"],"mappings":";;AAAA;;AAiBA;AACA,OAAO,MAAMA,OAAe,GAAG;EAC7BC,IAAI,EAAE,QAAQ;EACdC,QAAQ,EAAE,CAAC;EACXC,MAAM,EAAGC,CAAC,IAAKA;AACjB,CAAC;AAqBD;AACA,MAAMC,iBAAiB,GAAG,KAAK;AAC/B,MAAMC,mBAAmB,GAAG,KAAK;;AAEjC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,CAAC;EAEjBC,KAAK,GAAG,CAAC;EACTC,GAAG,GAAe,IAAI;EACtBC,KAAK,GAAkB,IAAI;EAC3BC,QAAQ,GAAG,CAAC;;EAEpB;EACAC,WAAWA,CACTC,KAAa,EACIC,SAAiB,EACjBC,QAAiC,EAClD;IAAA,KAFiBD,SAAiB,GAAjBA,SAAiB;IAAA,KACjBC,QAAiC,GAAjCA,QAAiC;IAElD,IAAI,CAACC,OAAO,GAAGH,KAAK;EACtB;EAEA,IAAIA,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACG,OAAO;EACrB;EAEA,IAAIC,WAAWA,CAAA,EAAY;IACzB,OAAO,IAAI,CAACR,GAAG,IAAI,IAAI;EACzB;EAEAS,GAAGA,CAACL,KAAa,EAAE;IACjB,IAAI,CAACM,IAAI,CAAC,CAAC;IACX,IAAI,CAACH,OAAO,GAAGH,KAAK;IACpB,IAAI,CAACL,KAAK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IAAI,KAAK,CAAC,IAAIC,IAAI,CAACC,IAAI,CAACmB,MAAM,CAAC,KAAK3C,GAAG,CAACsB,IAAI,CAAC,EAClD;MACA,OAAO,IAAI;IACb;IACA,OACEC,IAAI,CAAC0B,GAAG,CAACN,MAAM,CAAC,GAAG,IAAI,CAACtC,SAAS,IACjCkB,IAAI,CAAC0B,GAAG,CAACjC,QAAQ,CAAC,GAAG,IAAI,CAACX,SAAS,GAAG,EAAE;EAE5C;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["makeConfig","props","isInline","mode","detents","initialDetentIndex","Number","isFinite","Math","trunc","backdropColor","backdropOpacity","backdropBlurRadius","dismissOnBackdropPress","dismissOnSwipe","dismissOnBackButton","grabberVisible","cornerRadius","borderWidth","borderColor","contentBackgroundColor","keyboardBehavior","popupAnimation","pullToRefreshEnabled","refreshing","refreshIndicatorColor","isSameConfig","a","b","Object","keys","every","key","join"],"sourceRoot":"../../../src","sources":["web/ModalConfig.ts"],"mappings":";;AAQA;;
|
|
1
|
+
{"version":3,"names":["makeConfig","props","isInline","mode","detents","initialDetentIndex","Number","isFinite","Math","trunc","backdropColor","backdropOpacity","backdropBlurRadius","dismissOnBackdropPress","dismissOnSwipe","dismissOnBackButton","grabberVisible","cornerRadius","borderWidth","borderColor","contentBackgroundColor","keyboardBehavior","popupAnimation","pullToRefreshEnabled","refreshing","refreshIndicatorColor","isSameConfig","a","b","Object","keys","every","key","join"],"sourceRoot":"../../../src","sources":["web/ModalConfig.ts"],"mappings":";;AAQA;;AAkCA,OAAO,SAASA,UAAUA,CAACC,KAAsB,EAAe;EAC9D;EACA,MAAMC,QAAQ,GAAGD,KAAK,CAACC,QAAQ,IAAID,KAAK,CAACE,IAAI,KAAK,aAAa;EAC/D,OAAO;IACLA,IAAI,EAAEF,KAAK,CAACE,IAAI;IAChBD,QAAQ;IACRE,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,kBAAkB,EAAEC,MAA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CAAC,CAACvB,OAAO,CAAC6B,IAAI,CAAC,CAAC,KAAKL,CAAC,CAACxB,OAAO,CAAC6B,IAAI,CAAC,CAAC,GACrCN,CAAC,CAACK,GAAG,CAAC,KAAKJ,CAAC,CAACI,GAAG,CACtB,CAAC;AACH","ignoreList":[]}
|
|
@@ -35,7 +35,6 @@ export class ModalController {
|
|
|
35
35
|
wantsOpen = false;
|
|
36
36
|
/** A present request was accepted and its `onDismiss` is still owed. */
|
|
37
37
|
sessionActive = false;
|
|
38
|
-
/** `onPresent` was sent for the current session. */
|
|
39
38
|
presentSent = false;
|
|
40
39
|
dismissReason = 'programmatic';
|
|
41
40
|
reconcileScheduled = false;
|
|
@@ -50,9 +49,6 @@ export class ModalController {
|
|
|
50
49
|
constructor(setMounted) {
|
|
51
50
|
this.setMounted = setMounted;
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
// Host view lifecycle
|
|
55
|
-
|
|
56
52
|
attach() {
|
|
57
53
|
this.isAttached = true;
|
|
58
54
|
window.addEventListener('resize', this.handleWindowResize);
|
|
@@ -75,8 +71,6 @@ export class ModalController {
|
|
|
75
71
|
this.lastContentArea = null;
|
|
76
72
|
this.setMounted(false);
|
|
77
73
|
}
|
|
78
|
-
|
|
79
|
-
/** The host view rendered with new props. */
|
|
80
74
|
update(props) {
|
|
81
75
|
this.props = props;
|
|
82
76
|
const next = makeConfig(props);
|
|
@@ -97,8 +91,6 @@ export class ModalController {
|
|
|
97
91
|
}
|
|
98
92
|
}
|
|
99
93
|
}
|
|
100
|
-
|
|
101
|
-
/** Inline: the element the sheet fills, rendered in place. */
|
|
102
94
|
hostDidChange(host) {
|
|
103
95
|
if (host === this.host) return;
|
|
104
96
|
this.host = host;
|
|
@@ -128,9 +120,6 @@ export class ModalController {
|
|
|
128
120
|
this.requestDismiss('backButton');
|
|
129
121
|
this.reconcile();
|
|
130
122
|
};
|
|
131
|
-
|
|
132
|
-
// State machine
|
|
133
|
-
|
|
134
123
|
get isVisible() {
|
|
135
124
|
return this.phase === 'presenting' || this.phase === 'presented';
|
|
136
125
|
}
|
|
@@ -227,9 +216,6 @@ export class ModalController {
|
|
|
227
216
|
this.props?.onDismiss?.(reason);
|
|
228
217
|
}
|
|
229
218
|
}
|
|
230
|
-
|
|
231
|
-
// PresenterListener
|
|
232
|
-
|
|
233
219
|
onPresented() {
|
|
234
220
|
if (this.phase !== 'presenting') return;
|
|
235
221
|
this.phase = 'presented';
|
|
@@ -271,8 +257,6 @@ export class ModalController {
|
|
|
271
257
|
this.props?.onContentAreaChange?.(area);
|
|
272
258
|
}
|
|
273
259
|
|
|
274
|
-
// Helpers
|
|
275
|
-
|
|
276
260
|
/** Lets React size the content before the first presentation. */
|
|
277
261
|
reportEstimatedContentArea() {
|
|
278
262
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["canUseDOM","estimateViewport","inlineInsets","readSafeAreaInsets","isSameConfig","makeConfig","popupContentArea","PopupPresenter","sheetContentArea","SheetPresenter","ModalController","methods","present","requestPresent","dismiss","requestDismiss","snapToDetent","index","Number","isFinite","presenter","Math","trunc","props","config","isOpen","phase","wantsOpen","sessionActive","presentSent","dismissReason","reconcileScheduled","isAttached","elements","host","lastContentArea","constructor","setMounted","attach","window","addEventListener","handleWindowResize","detach","removeEventListener","destroy","update","next","reportEstimatedContentArea","hostDidChange","elementsDidMount","isShown","show","elementsWillUnmount","contentDidRender","handleBackPress","isVisible","onBackButtonPress","dismissOnBackButton","reconcile","scheduleReconcile","reason","queueMicrotask","startDismiss","cancelDismiss","startPresent","endSession","mode","finishDismiss","onDismiss","onPresented","onPresent","onDismissed","onBackdropPress","dismissOnBackdropPress","onSwipeDismiss","dismissOnSwipe","onDetentChange","onPullToRefresh","onContentAreaChange","width","height","area","floor","last","isInline","clientWidth","clientHeight","viewport","detents","insets"],"sourceRoot":"../../../src","sources":["web/ModalController.ts"],"mappings":";;AAAA;;AAQA,SACEA,SAAS,EACTC,gBAAgB,EAChBC,YAAY,EACZC,kBAAkB,QACb,UAAO;AACd,SAASC,YAAY,EAAEC,UAAU,QAA0B,kBAAe;AAM1E,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,qBAAkB;AACnE,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,qBAAkB;AAInE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAA8B;EAC/CC,OAAO,GAGZ;IACFC,OAAO,EAAEA,CAAA,KAAM,IAAI,CAACC,cAAc,CAAC,CAAC;IACpCC,OAAO,EAAEA,CAAA,KAAM,IAAI,CAACC,cAAc,CAAC,cAAc,CAAC;IAClDC,YAAY,EAAGC,KAAa,IAAK;MAC/B,IAAIC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,EAAE;QAC1B,IAAI,CAACG,SAAS,EAAEJ,YAAY,CAACK,IAAI,CAACC,KAAK,CAACL,KAAK,CAAC,CAAC;MACjD;IACF;EACF,CAAC;EAEOM,KAAK,GAA2B,IAAI;EACpCC,MAAM,GAAuB,IAAI;EACjCC,MAAM,GAAG,KAAK;EACdC,KAAK,GAAU,MAAM;EAC7B;EACQC,SAAS,GAAG,KAAK;EACzB;EACQC,aAAa,GAAG,KAAK;
|
|
1
|
+
{"version":3,"names":["canUseDOM","estimateViewport","inlineInsets","readSafeAreaInsets","isSameConfig","makeConfig","popupContentArea","PopupPresenter","sheetContentArea","SheetPresenter","ModalController","methods","present","requestPresent","dismiss","requestDismiss","snapToDetent","index","Number","isFinite","presenter","Math","trunc","props","config","isOpen","phase","wantsOpen","sessionActive","presentSent","dismissReason","reconcileScheduled","isAttached","elements","host","lastContentArea","constructor","setMounted","attach","window","addEventListener","handleWindowResize","detach","removeEventListener","destroy","update","next","reportEstimatedContentArea","hostDidChange","elementsDidMount","isShown","show","elementsWillUnmount","contentDidRender","handleBackPress","isVisible","onBackButtonPress","dismissOnBackButton","reconcile","scheduleReconcile","reason","queueMicrotask","startDismiss","cancelDismiss","startPresent","endSession","mode","finishDismiss","onDismiss","onPresented","onPresent","onDismissed","onBackdropPress","dismissOnBackdropPress","onSwipeDismiss","dismissOnSwipe","onDetentChange","onPullToRefresh","onContentAreaChange","width","height","area","floor","last","isInline","clientWidth","clientHeight","viewport","detents","insets"],"sourceRoot":"../../../src","sources":["web/ModalController.ts"],"mappings":";;AAAA;;AAQA,SACEA,SAAS,EACTC,gBAAgB,EAChBC,YAAY,EACZC,kBAAkB,QACb,UAAO;AACd,SAASC,YAAY,EAAEC,UAAU,QAA0B,kBAAe;AAM1E,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,qBAAkB;AACnE,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,qBAAkB;AAInE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAA8B;EAC/CC,OAAO,GAGZ;IACFC,OAAO,EAAEA,CAAA,KAAM,IAAI,CAACC,cAAc,CAAC,CAAC;IACpCC,OAAO,EAAEA,CAAA,KAAM,IAAI,CAACC,cAAc,CAAC,cAAc,CAAC;IAClDC,YAAY,EAAGC,KAAa,IAAK;MAC/B,IAAIC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,EAAE;QAC1B,IAAI,CAACG,SAAS,EAAEJ,YAAY,CAACK,IAAI,CAACC,KAAK,CAACL,KAAK,CAAC,CAAC;MACjD;IACF;EACF,CAAC;EAEOM,KAAK,GAA2B,IAAI;EACpCC,MAAM,GAAuB,IAAI;EACjCC,MAAM,GAAG,KAAK;EACdC,KAAK,GAAU,MAAM;EAC7B;EACQC,SAAS,GAAG,KAAK;EACzB;EACQC,aAAa,GAAG,KAAK;EACrBC,WAAW,GAAG,KAAK;EACnBC,aAAa,GAAkB,cAAc;EAC7CC,kBAAkB,GAAG,KAAK;EAC1BC,UAAU,GAAG,KAAK;EAClBZ,SAAS,GAA0B,IAAI;EACvCa,QAAQ,GAAyB,IAAI;EAC7C;EACQC,IAAI,GAAuB,IAAI;EAC/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