react-native-nitro-modal 0.3.8-rc → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +2 -0
  2. package/android/src/main/java/com/margelo/nitro/nitromodal/BottomSheetPresenter.kt +8 -30
  3. package/android/src/main/java/com/margelo/nitro/nitromodal/HybridNitroModal.kt +0 -2
  4. package/android/src/main/java/com/margelo/nitro/nitromodal/ModalContentRoot.kt +83 -4
  5. package/android/src/main/java/com/margelo/nitro/nitromodal/ModalPresenter.kt +0 -2
  6. package/android/src/main/java/com/margelo/nitro/nitromodal/NitroModalHostView.kt +1 -3
  7. package/android/src/main/java/com/margelo/nitro/nitromodal/NitroModalViewManager.kt +0 -2
  8. package/ios/HybridNitroModal.swift +0 -1
  9. package/ios/HybridNitroModalComponent+Children.mm +59 -1
  10. package/ios/ModalConfig.swift +0 -1
  11. package/ios/NitroModalHostView.swift +0 -1
  12. package/ios/PopupViewController.swift +0 -1
  13. package/ios/SheetView.swift +0 -5
  14. package/lib/module/NitroModalView.js +0 -5
  15. package/lib/module/NitroModalView.js.map +1 -1
  16. package/lib/module/NitroModalView.web.js +0 -2
  17. package/lib/module/NitroModalView.web.js.map +1 -1
  18. package/lib/module/web/AnimatedValue.js +0 -4
  19. package/lib/module/web/AnimatedValue.js.map +1 -1
  20. package/lib/module/web/ModalConfig.js.map +1 -1
  21. package/lib/module/web/ModalController.js +0 -16
  22. package/lib/module/web/ModalController.js.map +1 -1
  23. package/lib/module/web/ModalPresenter.js +47 -3
  24. package/lib/module/web/ModalPresenter.js.map +1 -1
  25. package/lib/module/web/SheetPresenter.js +16 -17
  26. package/lib/module/web/SheetPresenter.js.map +1 -1
  27. package/lib/module/web/dom.js +0 -4
  28. package/lib/module/web/dom.js.map +1 -1
  29. package/lib/typescript/src/NitroModal.nitro.d.ts +0 -2
  30. package/lib/typescript/src/NitroModal.nitro.d.ts.map +1 -1
  31. package/lib/typescript/src/NitroModalView.d.ts.map +1 -1
  32. package/lib/typescript/src/NitroModalView.web.d.ts.map +1 -1
  33. package/lib/typescript/src/web/AnimatedValue.d.ts +0 -2
  34. package/lib/typescript/src/web/AnimatedValue.d.ts.map +1 -1
  35. package/lib/typescript/src/web/ModalConfig.d.ts +0 -1
  36. package/lib/typescript/src/web/ModalConfig.d.ts.map +1 -1
  37. package/lib/typescript/src/web/ModalController.d.ts +0 -3
  38. package/lib/typescript/src/web/ModalController.d.ts.map +1 -1
  39. package/lib/typescript/src/web/ModalPresenter.d.ts +17 -3
  40. package/lib/typescript/src/web/ModalPresenter.d.ts.map +1 -1
  41. package/lib/typescript/src/web/SheetPresenter.d.ts +1 -6
  42. package/lib/typescript/src/web/SheetPresenter.d.ts.map +1 -1
  43. package/lib/typescript/src/web/dom.d.ts +0 -2
  44. package/lib/typescript/src/web/dom.d.ts.map +1 -1
  45. package/package.json +1 -1
  46. package/src/NitroModal.nitro.ts +0 -2
  47. package/src/NitroModalView.tsx +0 -4
  48. package/src/NitroModalView.web.tsx +0 -2
  49. package/src/web/AnimatedValue.ts +0 -2
  50. package/src/web/ModalConfig.ts +0 -1
  51. package/src/web/ModalController.ts +0 -11
  52. package/src/web/ModalPresenter.ts +48 -5
  53. package/src/web/SheetPresenter.ts +17 -12
  54. 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**
@@ -84,7 +84,6 @@ internal class BottomSheetPresenter(
84
84
  private var pullAnimator: ValueAnimator? = null
85
85
  private val refreshThreshold = activity.dpToPx(REFRESH_THRESHOLD_DP)
86
86
 
87
- /** The sheet rests below its lowest detent, the indicator spinning above it. */
88
87
  private var refreshing = config.refreshing ?: false
89
88
 
90
89
  /** A predictive back gesture was committed; the behavior is sliding the sheet out. */
@@ -176,7 +175,6 @@ internal class BottomSheetPresenter(
176
175
  applyAppearance()
177
176
 
178
177
  behavior.isGestureInsetBottomIgnored = true
179
- // Inline, the host view decides the width.
180
178
  if (!isInline) behavior.maxWidth = dp(MAX_WIDTH_DP)
181
179
  behavior.isHideable = true
182
180
  behavior.state = BottomSheetBehavior.STATE_HIDDEN
@@ -295,7 +293,6 @@ internal class BottomSheetPresenter(
295
293
  refreshIndicator.indeterminateTintList = config.refreshIndicatorColor?.let(ColorStateList::valueOf)
296
294
  }
297
295
 
298
- /** Recomputes detent heights and maps them onto the behavior's states. */
299
296
  private fun updateDetents() {
300
297
  val parentHeight = coordinator.height
301
298
  if (parentHeight == 0) return
@@ -443,7 +440,6 @@ internal class BottomSheetPresenter(
443
440
  }
444
441
  }
445
442
 
446
- /** Where the sheet rests below its lowest detent: held there while refreshing. */
447
443
  private fun restingPullOffset(): Float =
448
444
  if (refreshing && behavior.state == states().firstOrNull()) refreshThreshold else 0f
449
445
 
@@ -453,10 +449,6 @@ internal class BottomSheetPresenter(
453
449
  if (presented && !isDismissing) animatePullOffset(restingPullOffset())
454
450
  }
455
451
 
456
- /**
457
- * Centered in the gap a pull uncovers above the content, fading in as the
458
- * pull nears the threshold.
459
- */
460
452
  private fun layoutRefreshIndicator() {
461
453
  val size = refreshIndicator.layoutParams?.height ?: return
462
454
  refreshIndicator.translationY = (pullOffset - size) / 2
@@ -467,31 +459,18 @@ internal class BottomSheetPresenter(
467
459
  }
468
460
 
469
461
  /**
470
- * Gives up dragging the sheet down on nested scrollable content that can
471
- * still scroll up, or that scrolled during the gesture: it scrolls back to
472
- * its top, and only a new gesture collapses the sheet.
473
- *
474
- * The behavior asks the nested scroll's target whether it can scroll up,
475
- * but the target may only wrap the scroll view: a ScrollView with a
476
- * RefreshControl reports its SwipeRefreshLayout, which never scrolls
477
- * itself. The views under the finger are asked instead.
462
+ * Gives up dragging the sheet down on nested scrollable content once that
463
+ * content scrolled during the gesture: it scrolls back to its top, and only
464
+ * a new gesture collapses the sheet.
478
465
  */
479
466
  private inner class SheetBehavior : BottomSheetBehavior<FrameLayout>() {
480
467
  private var contentScrolled = false
481
468
 
482
- /** Where the gesture started, in the sheet's coordinates. */
483
- private var downX = 0f
484
- private var downY = 0f
485
-
486
469
  override fun onInterceptTouchEvent(parent: CoordinatorLayout, child: FrameLayout, event: MotionEvent): Boolean {
487
- if (event.actionMasked == MotionEvent.ACTION_DOWN) {
488
- downX = event.x - child.left - child.translationX
489
- downY = event.y - child.top - child.translationY
490
- if (state in states()) {
491
- // React may have mounted the scrollable content after the last layout
492
- // pass; laying out again re-finds it. The resting sheet doesn't move.
493
- onLayoutChild(parent, child, parent.layoutDirection)
494
- }
470
+ if (event.actionMasked == MotionEvent.ACTION_DOWN && state in states()) {
471
+ // React may have mounted the scrollable content after the last layout
472
+ // pass; laying out again re-finds it. The resting sheet doesn't move.
473
+ onLayoutChild(parent, child, parent.layoutDirection)
495
474
  }
496
475
  return super.onInterceptTouchEvent(parent, child, event)
497
476
  }
@@ -517,7 +496,7 @@ internal class BottomSheetPresenter(
517
496
  consumed: IntArray,
518
497
  type: Int,
519
498
  ) {
520
- if (dy < 0 && (contentScrolled || canScrollUpAt(child, downX, downY))) return
499
+ if (dy < 0 && contentScrolled) return
521
500
  super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed, type)
522
501
  }
523
502
 
@@ -681,7 +660,6 @@ internal class BottomSheetPresenter(
681
660
  private const val DEFAULT_CORNER_RADIUS_DP = 28f
682
661
  private const val MAX_WIDTH_DP = 640f
683
662
 
684
- /** How far below its lowest detent the sheet must be pulled to refresh. */
685
663
  private const val REFRESH_THRESHOLD_DP = 56f
686
664
  private const val REFRESH_INDICATOR_SIZE_DP = 32f
687
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 eventDispatcher
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
- eventDispatcher?.let {
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
- eventDispatcher?.let { touchDispatcher.onChildEndedNativeGesture(ev, it) }
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
- [[RCTSurfaceTouchHandler new] attachToView:touchRoot];
117
+ NitroModalTouchHandler *touchHandler = [NitroModalTouchHandler new];
118
+ touchHandler.reactParent = self;
119
+ [touchHandler attachToView:touchRoot];
62
120
  }
63
121
 
64
122
  [host nitroModalMountChild:childComponentView atIndex:index];
@@ -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)
@@ -14,7 +14,6 @@ import UIKit
14
14
  final class NitroModalHostView: UIView {
15
15
  let contentView = NitroModalContentView()
16
16
  var onWindowChange: (() -> Void)?
17
- /// The bounds or safe area changed.
18
17
  var onLayoutChange: (() -> Void)?
19
18
 
20
19
  var isInline = false {
@@ -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) {
@@ -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;;AAElB;AACA;AACA;AACA;AACA,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":[]}
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,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;IACpBI,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE;EACP,CAAC;EACDnC,OAAO,EAAE;IACP8B,QAAQ,EAAE,UAAU;IACpBK,GAAG,EAAE,CAAC;IACND,IAAI,EAAE,KAAK;IACXI,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,CAAC,EAAE;IACfC,YAAY,EAAE,GAAG;IACjBC,eAAe,EAAE,0BAA0B;IAC3ClB,aAAa,EAAE;EACjB,CAAC;EACD;EACAvB,MAAM,EAAE;IACN6B,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,CAAC;IACRK,SAAS,EAAE,YAAY;IACvBO,WAAW,EAAE,OAAO;IACpBC,WAAW,EAAE,CAAC;IACdH,YAAY,EAAE,SAAS;IACvBjB,aAAa,EAAE;EACjB,CAAC;EACDtB,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":[]}
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,MAAMyB,OAAO,GAAGzB,MAAM,CAAiB,IAAI,CAAC;EAC5C,MAAM0B,OAAO,GAAG1B,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,CAAC,EAAE;IACfC,YAAY,EAAE,GAAG;IACjBC,eAAe,EAAE,0BAA0B;IAC3ClB,aAAa,EAAE;EACjB,CAAC;EACDvB,MAAM,EAAE;IACN6B,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,CAAC;IACRK,SAAS,EAAE,YAAY;IACvBO,WAAW,EAAE,OAAO;IACpBC,WAAW,EAAE,CAAC;IACdH,YAAY,EAAE,SAAS;IACvBjB,aAAa,EAAE;EACjB,CAAC;EACDtB,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;;AAEA;;AAgBA;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;;EAEA;EACAS,GAAGA,CAACL,KAAa,EAAE;IACjB,IAAI,CAACM,IAAI,CAAC,CAAC;IACX,IAAI,CAACH,OAAO,GAAGH,KAAK;IACpB,IAAI,CAACL,KAAK,GAAG,CAAC;IACd,IAAI,CAACO,QAAQ,CAACF,KAAK,CAAC;EACtB;EAEAM,IAAIA,CAAA,EAAG;IACL,IAAI,CAACV,GAAG,GAAG,IAAI;IACf,IAAI,IAAI,CAACC,KAAK,IAAI,IAAI,EAAE;MACtBU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AG,IAAI,CAACtC,SAAS,IACjCkB,IAAI,CAAC0B,GAAG,CAACjC,QAAQ,CAAC,GAAG,IAAI,CAACX,SAAS,GAAG,EAAE;EAE5C;AACF","ignoreList":[]}
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,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,KAAK,GAAGiB,QAAQ;IAErB,IACEhB,GAAG,CAACe,OAAO,CAACiC,YAAY,KACvBhD,GAAG,CAACsB,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;;AAmCA,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,MAAM,CAACC,QAAQ,CAACN,KAAK,CAACI,kBAAkB,CAAC,GACzDG,IAAI,CAACC,KAAK,CAACR,KAAK,CAACI,kBAAkB,CAAC,GACpC,CAAC;IACLK,aAAa,EAAET,KAAK,CAACS,aAAa;IAClCC,eAAe,EAAEV,KAAK,CAACU,eAAe;IACtCC,kBAAkB,EAAEX,KAAK,CAACW,kBAAkB;IAC5CC,sBAAsB,EAAEZ,KAAK,CAACY,sBAAsB,IAAI,CAACX,QAAQ;IACjEY,cAAc,EAAEb,KAAK,CAACa,cAAc,IAAI,CAACZ,QAAQ;IACjDa,mBAAmB,EAAEd,KAAK,CAACc,mBAAmB,IAAI,CAACb,QAAQ;IAC3Dc,cAAc,EAAEf,KAAK,CAACe,cAAc;IACpCC,YAAY,EAAEhB,KAAK,CAACgB,YAAY,IAAI,CAAC,GAAGhB,KAAK,CAACgB,YAAY,GAAG,IAAI;IACjEC,WAAW,EACTZ,MAAM,CAACC,QAAQ,CAACN,KAAK,CAACiB,WAAW,CAAC,IAAIjB,KAAK,CAACiB,WAAW,GAAG,CAAC,GACvDjB,KAAK,CAACiB,WAAW,GACjB,CAAC;IACPC,WAAW,EAAElB,KAAK,CAACkB,WAAW,IAAI,IAAI;IACtCC,sBAAsB,EAAEnB,KAAK,CAACmB,sBAAsB,IAAI,IAAI;IAC5DC,gBAAgB,EAAEpB,KAAK,CAACoB,gBAAgB;IACxCC,cAAc,EAAErB,KAAK,CAACqB,cAAc;IACpCC,oBAAoB,EAAEtB,KAAK,CAACsB,oBAAoB;IAChDC,UAAU,EAAEvB,KAAK,CAACuB,UAAU,IAAI,IAAI;IACpCC,qBAAqB,EAAExB,KAAK,CAACwB,qBAAqB,IAAI;EACxD,CAAC;AACH;AAEA,OAAO,SAASC,YAAYA,CAACC,CAAc,EAAEC,CAAc,EAAW;EACpE,OAAQC,MAAM,CAACC,IAAI,CAACH,CAAC,CAAC,CAA2BI,KAAK,CAAEC,GAAG,IACzDA,GAAG,KAAK,SAAS,GACbL,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":[]}
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,MAAM,CAACC,QAAQ,CAACN,KAAK,CAACI,kBAAkB,CAAC,GACzDG,IAAI,CAACC,KAAK,CAACR,KAAK,CAACI,kBAAkB,CAAC,GACpC,CAAC;IACLK,aAAa,EAAET,KAAK,CAACS,aAAa;IAClCC,eAAe,EAAEV,KAAK,CAACU,eAAe;IACtCC,kBAAkB,EAAEX,KAAK,CAACW,kBAAkB;IAC5CC,sBAAsB,EAAEZ,KAAK,CAACY,sBAAsB,IAAI,CAACX,QAAQ;IACjEY,cAAc,EAAEb,KAAK,CAACa,cAAc,IAAI,CAACZ,QAAQ;IACjDa,mBAAmB,EAAEd,KAAK,CAACc,mBAAmB,IAAI,CAACb,QAAQ;IAC3Dc,cAAc,EAAEf,KAAK,CAACe,cAAc;IACpCC,YAAY,EAAEhB,KAAK,CAACgB,YAAY,IAAI,CAAC,GAAGhB,KAAK,CAACgB,YAAY,GAAG,IAAI;IACjEC,WAAW,EACTZ,MAAM,CAACC,QAAQ,CAACN,KAAK,CAACiB,WAAW,CAAC,IAAIjB,KAAK,CAACiB,WAAW,GAAG,CAAC,GACvDjB,KAAK,CAACiB,WAAW,GACjB,CAAC;IACPC,WAAW,EAAElB,KAAK,CAACkB,WAAW,IAAI,IAAI;IACtCC,sBAAsB,EAAEnB,KAAK,CAACmB,sBAAsB,IAAI,IAAI;IAC5DC,gBAAgB,EAAEpB,KAAK,CAACoB,gBAAgB;IACxCC,cAAc,EAAErB,KAAK,CAACqB,cAAc;IACpCC,oBAAoB,EAAEtB,KAAK,CAACsB,oBAAoB;IAChDC,UAAU,EAAEvB,KAAK,CAACuB,UAAU,IAAI,IAAI;IACpCC,qBAAqB,EAAExB,KAAK,CAACwB,qBAAqB,IAAI;EACxD,CAAC;AACH;AAEA,OAAO,SAASC,YAAYA,CAACC,CAAc,EAAEC,CAAc,EAAW;EACpE,OAAQC,MAAM,CAACC,IAAI,CAACH,CAAC,CAAC,CAA2BI,KAAK,CAAEC,GAAG,IACzDA,GAAG,KAAK,SAAS,GACbL,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 {