@onekeyfe/react-native-native-overlay 3.0.162-alpha.272 → 6.7.0-alpha.335

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.
@@ -48,7 +48,7 @@ internal class NativeOverlayHost private constructor(
48
48
  )
49
49
  private val backCallback = object : OnBackPressedCallback(false) {
50
50
  override fun handleOnBackPressed() {
51
- topBlockingEntry()?.let { entry ->
51
+ topBackEntry()?.let { entry ->
52
52
  if (entry.dismissOnBackPress) entry.onRequestDismiss?.invoke("back")
53
53
  }
54
54
  }
@@ -66,7 +66,7 @@ internal class NativeOverlayHost private constructor(
66
66
  * predictive back, so the dispatcher alone never runs first.
67
67
  */
68
68
  fun handleBackKey(event: KeyEvent): Boolean {
69
- val entry = topBlockingEntry() ?: return false
69
+ val entry = topBackEntry() ?: return false
70
70
  if (event.action == KeyEvent.ACTION_UP && !event.isCanceled && entry.dismissOnBackPress) {
71
71
  entry.onRequestDismiss?.invoke("back")
72
72
  }
@@ -108,14 +108,14 @@ internal class NativeOverlayHost private constructor(
108
108
  }
109
109
 
110
110
  fun onEntriesChanged() {
111
- val hasBlocking = topBlockingEntry() != null
112
- if (hasBlocking && !backCallback.isEnabled) {
111
+ val hasBackEntry = topBackEntry() != null
112
+ if (hasBackEntry && !backCallback.isEnabled) {
113
113
  // The most recently added callback wins; re-add so ours runs before
114
114
  // ReactActivity's and react-native-screens' callbacks.
115
115
  backCallback.remove()
116
116
  (activity as? ComponentActivity)?.onBackPressedDispatcher?.addCallback(backCallback)
117
117
  }
118
- backCallback.isEnabled = hasBlocking
118
+ backCallback.isEnabled = hasBackEntry
119
119
  updateAccessibility()
120
120
  }
121
121
 
@@ -133,11 +133,11 @@ internal class NativeOverlayHost private constructor(
133
133
  }
134
134
 
135
135
  /** Global overlays win; otherwise the topmost visible page overlay. */
136
- private fun topBlockingEntry(): NativeOverlayEntryRootView? =
137
- orderedEntries().lastOrNull { it.blocking && it.isShownForInput }
136
+ private fun topBackEntry(): NativeOverlayEntryRootView? =
137
+ orderedEntries().lastOrNull { (it.blocking || it.dismissOnBackPress) && it.isShownForInput }
138
138
  ?: shownPageHosts()
139
139
  .flatMap { it.shownEntries() }
140
- .lastOrNull { it.blocking }
140
+ .lastOrNull { it.blocking || it.dismissOnBackPress }
141
141
 
142
142
  private fun shownPageHosts(): List<NativeOverlayPageHostView> =
143
143
  NativeOverlayPageHostView.allHosts().filter {
@@ -0,0 +1,122 @@
1
+ package com.onekey.nativeoverlay
2
+
3
+ import android.view.KeyEvent
4
+ import android.view.View
5
+ import android.widget.FrameLayout
6
+ import androidx.activity.ComponentActivity
7
+ import com.facebook.react.bridge.BridgeReactContext
8
+ import com.facebook.react.uimanager.ThemedReactContext
9
+ import org.junit.Assert.assertEquals
10
+ import org.junit.Assert.assertFalse
11
+ import org.junit.Assert.assertTrue
12
+ import org.junit.Before
13
+ import org.junit.Test
14
+ import org.junit.runner.RunWith
15
+ import org.robolectric.Robolectric
16
+ import org.robolectric.RobolectricTestRunner
17
+ import org.robolectric.annotation.Config
18
+
19
+ @RunWith(RobolectricTestRunner::class)
20
+ @Config(sdk = [34])
21
+ class NativeOverlayBackTest {
22
+ private lateinit var activity: ComponentActivity
23
+ private lateinit var context: ThemedReactContext
24
+ private lateinit var host: NativeOverlayHost
25
+ private val dismissals = mutableListOf<String>()
26
+
27
+ @Before
28
+ fun setUp() {
29
+ activity = Robolectric.buildActivity(ComponentActivity::class.java).setup().visible().get()
30
+ val reactContext = BridgeReactContext(activity)
31
+ reactContext.onHostResume(activity)
32
+ context = ThemedReactContext(reactContext, activity, "OverlayBackTest", 1)
33
+ host = NativeOverlayHost.of(activity)
34
+ }
35
+
36
+ private fun entry(name: String, blocking: Boolean, dismissible: Boolean, order: Int = 0) =
37
+ NativeOverlayEntryRootView(context).apply {
38
+ this.blocking = blocking
39
+ dismissOnBackPress = dismissible
40
+ stackOrder = order
41
+ isShownForInput = true
42
+ onRequestDismiss = { dismissals.add("$name:$it") }
43
+ }
44
+
45
+ private fun back(action: Int = KeyEvent.ACTION_UP, flags: Int = 0) =
46
+ host.handleBackKey(KeyEvent(0L, 0L, action, KeyEvent.KEYCODE_BACK, 0, 0, 0, 0, flags))
47
+
48
+ @Test
49
+ fun dismissibleNonBlockingGlobalEntryWinsOverLowerBlocker() {
50
+ host.attach(entry("lower", true, true), NativeOverlayLevel.MODAL)
51
+ host.attach(entry("top", false, true), NativeOverlayLevel.TOAST)
52
+ assertTrue(back(KeyEvent.ACTION_DOWN))
53
+ assertEquals(emptyList<String>(), dismissals)
54
+ assertTrue(back())
55
+ assertEquals(listOf("top:back"), dismissals)
56
+ }
57
+
58
+ @Test
59
+ fun dispatcherHandlesNonBlockingEntryAndKeepsPageAccessible() {
60
+ val page = View(activity).apply { importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_YES }
61
+ activity.setContentView(page)
62
+ val top = entry("top", false, true)
63
+ host.attach(top, NativeOverlayLevel.MODAL)
64
+ activity.onBackPressedDispatcher.onBackPressed()
65
+ assertEquals(listOf("top:back"), dismissals)
66
+ assertEquals(View.IMPORTANT_FOR_ACCESSIBILITY_YES, page.importantForAccessibility)
67
+ host.detach(top)
68
+ assertFalse(back())
69
+ }
70
+
71
+ @Test
72
+ fun nonDismissibleBlockerConsumesBackWithoutClosingLowerEntry() {
73
+ host.attach(entry("lower", false, true), NativeOverlayLevel.MODAL)
74
+ host.attach(entry("lock", true, false), NativeOverlayLevel.LOCK)
75
+ assertTrue(back())
76
+ assertEquals(emptyList<String>(), dismissals)
77
+ }
78
+
79
+ @Test
80
+ fun passiveOrNotInputReadyEntriesDoNotTakeBack() {
81
+ host.attach(entry("passive", false, false), NativeOverlayLevel.TOAST)
82
+ host.attach(entry("hidden", true, true).apply { isShownForInput = false }, NativeOverlayLevel.LOCK)
83
+ assertFalse(back())
84
+ assertEquals(emptyList<String>(), dismissals)
85
+ }
86
+
87
+ @Test
88
+ fun canceledKeyUpDoesNotDismiss() {
89
+ host.attach(entry("top", false, true), NativeOverlayLevel.MODAL)
90
+ assertTrue(back(flags = KeyEvent.FLAG_CANCELED))
91
+ assertEquals(emptyList<String>(), dismissals)
92
+ }
93
+
94
+ @Test
95
+ fun dismissiblePageEntryWinsOverLowerPageBlockerAndSuspensionSkipsIt() {
96
+ val pageHost = NativeOverlayPageHostView(context).apply { hostKey = "page-back-test" }
97
+ activity.setContentView(pageHost)
98
+ val lower = entry("lower", true, true).apply { ownerKey = "owner" }
99
+ val top = entry("top", false, true, 1).apply { ownerKey = "owner" }
100
+ pageHost.attach(lower)
101
+ pageHost.attach(top)
102
+ assertTrue(back())
103
+ assertEquals(listOf("top:back"), dismissals)
104
+ pageHost.setSuspendedOwners("owner")
105
+ assertFalse(back())
106
+ pageHost.invalidateHost()
107
+ }
108
+
109
+ @Test
110
+ fun globalEntryTakesBackBeforePageEntryAndDismissalRestoresPageTarget() {
111
+ val pageHost = NativeOverlayPageHostView(context).apply { hostKey = "page-global-test" }
112
+ activity.setContentView(FrameLayout(activity).apply { addView(pageHost) })
113
+ pageHost.attach(entry("page", false, true))
114
+ val global = entry("global", false, true)
115
+ host.attach(global, NativeOverlayLevel.MODAL)
116
+ assertTrue(back())
117
+ host.detach(global)
118
+ assertTrue(back())
119
+ assertEquals(listOf("global:back", "page:back"), dismissals)
120
+ pageHost.invalidateHost()
121
+ }
122
+ }
package/docs/SPEC.md CHANGED
@@ -35,12 +35,13 @@ retains its original implementation attribution in source comments.
35
35
 
36
36
  ### Release boundary
37
37
 
38
- This branch aligns all 42 publishable workspaces to `3.0.162-alpha.272`.
39
- Publish with the existing `package-publish` workflow dispatch, `npm_dist_tag=next`
40
- and an empty `only_workspace`, which publishes and registry-verifies all 42.
41
- Do not merge either repository PR or change the `latest` tag. The app-monorepo
42
- workspace copy is removed only after this release succeeds and every target
43
- version and tarball is available. Versions already published on npm are immutable.
38
+ The earlier `3.0.162-alpha.272` release remains immutable. This branch now
39
+ includes the current main SDK baseline, with all publishable workspaces aligned
40
+ before release. Use `package-publish` with `npm_dist_tag=next` and an empty
41
+ `only_workspace` to generate a fresh `6.7.0-alpha.N` preview, publish every
42
+ workspace, and verify every registry version. Preserve `latest` and keep both
43
+ repository PRs open. App consumers pin the verified exact preview version and
44
+ refresh dependency and native locks before installed-version acceptance.
44
45
 
45
46
  ## 5.1 Purpose, scope, and non-goals
46
47
 
@@ -136,6 +137,11 @@ visible)`, `removePage(ownerKey)`.
136
137
 
137
138
  - `usePageOverlayHost()` resolves `hostKey` and `ownerKey` from navigation
138
139
  context.
140
+ - A declarative page overlay keeps `scope: 'page'` while either key is
141
+ unavailable. It does not request or present an entry until both keys are
142
+ available; becoming ready while visible requests it in the page lane.
143
+ Hiding or unmounting before readiness creates no entry or close callback.
144
+ Direct store requests still throw for missing page keys.
139
145
  - `useInPageDialog`, `useInModalDialog`, and `useInTabDialog` become aliases of
140
146
  page scope. Tab scope is removed.
141
147
 
@@ -208,6 +214,30 @@ request ─► queued ─► active ─► (enter anim) presented
208
214
  - Threads: store mutations happen on the JS thread. Native animation and layout
209
215
  run on the UI thread. Events are delivered as direct events.
210
216
 
217
+ ### Web presentation updates (OK-50653)
218
+
219
+ For an open Web overlay that keeps its portal host, changing `presentation`
220
+ between sheet and a non-sheet frame MUST preserve the mounted content subtree.
221
+ Its props and React context continue to update normally. Changing the optional
222
+ sheet handle MUST NOT move the content into a different React child slot.
223
+ Closing without `keepContentMounted` still unmounts content after exit; reopening
224
+ creates a fresh content lifecycle. Business entity changes and draft resets
225
+ remain caller-owned; the overlay does not cache or persist form values.
226
+
227
+ The stable sheet shell must not change non-sheet animation origins or keyboard
228
+ avoidance geometry. Switching away from a sheet clears any pan offset and its
229
+ backdrop opacity override, and releases an active pointer capture.
230
+
231
+ Conformance: `src/__tests__/draftRetention.web.test.ts` exercises the real Web
232
+ host, portal and store for presentation changes, live props/context/callbacks,
233
+ close/reopen, animation origins, keyboard geometry and an interrupted pan.
234
+ Chrome extension side-panel and ordinary-tab checks use synthetic content;
235
+ this correction does not claim new iOS/Android runtime verification.
236
+
237
+ These source changes require a new published package version before the app
238
+ can consume them from npm. This fix leaves package versions and lockfiles at
239
+ their existing values and does not publish a release.
240
+
211
241
  ## 5.5 Data, cache, and identity
212
242
 
213
243
  - Identity is the entry `id`: caller-provided, otherwise `overlay-<seq>`.
@@ -216,6 +246,17 @@ request ─► queued ─► active ─► (enter anim) presented
216
246
 
217
247
  ## 5.6 Platform contract
218
248
 
249
+ ### Web keyboard focus containment
250
+
251
+ The topmost active, unsuspended blocking Web entry MUST contain sequential
252
+ keyboard focus. Tab from its last tabbable child wraps to the first;
253
+ Shift+Tab from its first wraps to the last. From the entry root, focus enters
254
+ the first/last child respectively. With no tabbable children, focus stays on
255
+ the entry root. Disabled, negative-tabindex, hidden and inert subtrees are
256
+ excluded. Positive tabindex values precede ordinary DOM-order tab stops.
257
+ Non-blocking, lower, closing, suspended and parked entries MUST NOT run a
258
+ focus loop. Existing focus entry/restore and Escape policies are unchanged.
259
+
219
260
  | Concern | iOS | Android | Web |
220
261
  | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
221
262
  | Global level host | One passthrough `UIWindow` per active level per `UIWindowScene`, ordered by `windowLevel`. `lock` sits above RN Alert (2001). | One `OverlayHost` FrameLayout in `android.R.id.content` above the ReactRootView, with one child container per level. | Sibling `div[data-onekey-layer]` roots under `body`, one z-index band per level (`OVERLAY_WEB_Z_INDEX_BASE`). |
@@ -224,7 +265,7 @@ request ─► queued ─► active ─► (enter anim) presented
224
265
  | Page host | Fabric `PageOverlayHost` as the last child of the root-route screen. Custom-drawn sheet, because UIKit sheets cannot be page-scoped. | The same host inside the root-route screen. The ReactRootView already dispatches touches, so no nested RootView. | `position: absolute` host inside the root-route card. |
225
266
  | Header / tab bar coverage (page) | Covered: the host is above the tab controller and navigation bars. | Covered. | Covered. |
226
267
  | Touch passthrough (toast, debug, box-none) | `hitTest` returns nil on the window or root view. | A non-blocking entry hit-tests its React content with `TouchTargetHelper` (honoring `box-none`) and falls through to the FrameLayout sibling on a miss. | `pointer-events: none` root, `auto` per entry. |
227
- | Back / Escape | Escape via `accessibilityPerformEscape`. The interactive pop gesture is disabled while a blocking page overlay is shown. | A `Window.Callback` wrapper consumes `KEYCODE_BACK` while a blocking overlay is shown. `ReactActivity.onBackPressed` hands back to JS BackHandler (react-navigation) before the `OnBackPressedDispatcher`, and the app opts out of predictive back, so a dispatcher callback alone never runs first. The dispatcher callback is kept for the predictive-back path. The IME still gets back first to close the keyboard. | Capture-phase `keydown` that ignores IME composition. |
268
+ | Back / Escape | Escape via `accessibilityPerformEscape`. The interactive pop gesture is disabled while a blocking page overlay is shown. | A `Window.Callback` wrapper consumes `KEYCODE_BACK` for the topmost input-ready blocking or dismissible overlay. `ReactActivity.onBackPressed` hands back to JS BackHandler (react-navigation) before the `OnBackPressedDispatcher`, and the app opts out of predictive back, so a dispatcher callback alone never runs first. The dispatcher callback is kept for the predictive-back path. The IME still gets back first to close the keyboard. | Capture-phase `keydown` that ignores IME composition. |
228
269
  | Modality / accessibility | `accessibilityViewIsModal` on the blocking level window; `.screenChanged` posted on present. | `IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS` on the content below. | `inert` on the app root and lower layers, `role=dialog`, `aria-modal`, focus trap and restore. |
229
270
  | Keyboard | System sheet avoidance; `keyboardLayoutGuide` for custom presentations. The main window regains key status on dismiss. | `WindowInsetsAnimationCompat` per sheet (the app uses `adjustPan`). | `visualViewport`. |
230
271
  | Animation engine | `UIViewPropertyAnimator` + `UISpringTimingParameters(mass:stiffness:damping:)`, which maps 1:1 and supports damping ratio > 1. | `SpringAnimation` with `stiffness = k/m` and `dampingRatio`; `PathInterpolator` for timing curves. | WAAPI `element.animate`. Timing presets use `cubic-bezier`; custom springs use `linear()`. |
@@ -296,6 +337,16 @@ navigation remains a separate runtime acceptance item.
296
337
 
297
338
  Automated (P0):
298
339
 
340
+ - `src/__tests__/focusTrap.web.test.ts` mounts real Web overlays and checks
341
+ both Tab boundaries, root/empty fallback, inaccessible children, positive
342
+ tabindex order, top-entry precedence, page scope, suspension and parking.
343
+ - `src/__tests__/useOverlayController.test.ts` exercises the actual hook and
344
+ page scope providers: missing/empty keys, delayed readiness, one request,
345
+ page suspension/removal, hiding/unmounting before readiness and global scope.
346
+ - `NativeOverlayBackTest` exercises the Android host's key interceptor and
347
+ Back dispatcher with actual entry/page views: dismissible non-blockers,
348
+ blockers, input readiness, canceled key-up, global/page precedence,
349
+ suspension and blocking-only accessibility isolation.
299
350
  - `src/__tests__/pageIsolation.web.test.ts` mounts a real React portal in a
300
351
  DOM host and verifies late suspension, level ordering and restoration after
301
352
  the blocking entry is removed.
@@ -331,7 +382,10 @@ Runtime matrix, required per platform before migrating callers (P1–P3):
331
382
  - switch tab and come back: it restores;
332
383
  - remove the page: it closes with `page-removed`;
333
384
  - the native header and tab bar are covered.
334
- 5. Back/Escape reaches the topmost blocking overlay; the lock swallows it.
385
+ 5. Back/Escape reaches the topmost input-ready overlay that is blocking or
386
+ explicitly dismissible, global before page. A non-dismissible blocker
387
+ consumes Back without closing; a passive non-blocking entry passes through.
388
+ Accessibility isolation remains blocking-only. The lock swallows Back.
335
389
  6. Keyboard: an input in a global sheet, a page sheet and a secure dialog.
336
390
  7. iOS: a system picker opened from an overlay appears above it.
337
391
  8. Split view: page overlays stay in their own pane.
@@ -362,8 +416,8 @@ P3 page scope notes:
362
416
  their global sheet implementation inside the page host.
363
417
  - Android back also resolves page entries: global overlays first, then the
364
418
  topmost visible page overlay.
365
- - A page request without a resolvable host or owner falls back to global
366
- scope.
419
+ - A declarative page overlay waits for a resolvable host and owner; it never
420
+ falls back to global scope. Direct store requests require both keys.
367
421
 
368
422
  P2 sheet notes:
369
423
 
@@ -6,6 +6,7 @@ import { StyleSheet, View } from 'react-native';
6
6
  import { OverlayLevelProvider } from "./OverlayLevelContext.js";
7
7
  import { OVERLAY_LEVEL_ORDER, isBlockingLevel } from "./OverlayLevels.js";
8
8
  import { OVERLAY_OWNER_ATTRIBUTE } from "./OverlayPageHost.web.js";
9
+ import { overlayStore } from "./OverlayStore.js";
9
10
  import { useOverlayController } from "./useOverlayController.js";
10
11
  import { animateBackdrop, animateTransition } from "./web/animateTransition.js";
11
12
  import { ENTRY_ATTRIBUTE, getOverlayLayerRoot, getOverlayPageHost, registerOverlayDismissRequester, scheduleOverlayInertSync } from "./web/overlayLayers.js";
@@ -65,6 +66,16 @@ function WebOverlayEntry({
65
66
  onPresented,
66
67
  onDismissed
67
68
  };
69
+ useLayoutEffect(() => {
70
+ if (!isSheet && sheetRef.current) {
71
+ // The host now survives a presentation switch; clear any in-flight pan.
72
+ sheetRef.current.style.removeProperty('transform');
73
+ sheetRef.current.style.removeProperty('transition');
74
+ if (backdropRef.current) {
75
+ backdropRef.current.style.opacity = '1';
76
+ }
77
+ }
78
+ }, [isSheet]);
68
79
  useLayoutEffect(() => {
69
80
  const content = contentRef.current;
70
81
  if (!content) {
@@ -91,7 +102,7 @@ function WebOverlayEntry({
91
102
  backdropRef.current?.getAnimations().forEach(running => running.cancel());
92
103
  // A sheet is measured as a whole; other presentations by the children
93
104
  // of the full-window React root.
94
- const contentRoot = isSheet ? content : content.firstElementChild ?? content;
105
+ const contentRoot = isSheet ? content : sheetRef.current?.firstElementChild ?? content;
95
106
  const transition = direction === 'in' ? animation.enter : animation.exit;
96
107
  const running = [animateTransition(content, contentRoot, transition, direction), backdropRef.current ? animateBackdrop(backdropRef.current, animation.backdrop.motion, direction) : undefined].filter(item => !!item);
97
108
  void Promise.all(running.map(item => item.finished)).then(() => {
@@ -142,6 +153,40 @@ function WebOverlayEntry({
142
153
  });
143
154
  const showBackdrop = !!backdropColor || blocking;
144
155
  const cornerRadius = sheet?.cornerRadius ?? DEFAULT_SHEET_CORNER_RADIUS;
156
+ const onKeyDownCapture = event => {
157
+ const root = entryRef.current;
158
+ if (event.key !== 'Tab' || event.defaultPrevented || event.nativeEvent.isComposing || !root || !presented || parked || overlayStore.getBlockingTop()?.id !== entryId) {
159
+ return;
160
+ }
161
+ const tabbable = Array.from(root.querySelectorAll('a[href], area[href], button, input:not([type="hidden"]), select, textarea, iframe, object, embed, [tabindex], [contenteditable]:not([contenteditable="false"])')).filter(node => {
162
+ if (node.tabIndex < 0 && (node.hasAttribute('tabindex') || !node.hasAttribute('contenteditable')) || node.matches(':disabled')) {
163
+ return false;
164
+ }
165
+ for (let ancestor = node; ancestor; ancestor = ancestor.parentElement) {
166
+ const style = getComputedStyle(ancestor);
167
+ if (ancestor.inert || ancestor.hasAttribute('inert') || ancestor.hidden || ancestor.getAttribute('aria-hidden') === 'true' || style.display === 'none' || style.visibility === 'hidden') {
168
+ return false;
169
+ }
170
+ }
171
+ return true;
172
+ }).sort((a, b) => {
173
+ const aOrder = a.tabIndex > 0 ? a.tabIndex : Infinity;
174
+ const bOrder = b.tabIndex > 0 ? b.tabIndex : Infinity;
175
+ return aOrder === bOrder ? 0 : aOrder - bOrder;
176
+ });
177
+ const active = document.activeElement;
178
+ const first = tabbable[0];
179
+ const last = tabbable[tabbable.length - 1];
180
+ if (!first || active === root || !root.contains(active) || active === (event.shiftKey ? first : last)) {
181
+ event.preventDefault();
182
+ (event.shiftKey ? last : first)?.focus({
183
+ preventScroll: true
184
+ });
185
+ if (!first) root.focus({
186
+ preventScroll: true
187
+ });
188
+ }
189
+ };
145
190
  return /*#__PURE__*/_jsxs("div", {
146
191
  ref: entryRef,
147
192
  [ENTRY_ATTRIBUTE]: '',
@@ -165,6 +210,7 @@ function WebOverlayEntry({
165
210
  visibility: parked ? 'hidden' : undefined
166
211
  },
167
212
  ...ISOLATED_EVENT_HANDLERS,
213
+ onKeyDownCapture: onKeyDownCapture,
168
214
  children: [showBackdrop ? /*#__PURE__*/_jsx("div", {
169
215
  ref: backdropRef,
170
216
  "aria-hidden": true,
@@ -190,9 +236,9 @@ function WebOverlayEntry({
190
236
  inset: 0,
191
237
  pointerEvents: 'none'
192
238
  },
193
- children: sheet ? /*#__PURE__*/_jsxs("div", {
239
+ children: /*#__PURE__*/_jsxs("div", {
194
240
  ref: sheetRef,
195
- style: {
241
+ style: sheet ? {
196
242
  position: 'absolute',
197
243
  left: 0,
198
244
  right: 0,
@@ -207,8 +253,14 @@ function WebOverlayEntry({
207
253
  background: sheet.backgroundColor ? String(sheet.backgroundColor) : undefined,
208
254
  borderTopLeftRadius: cornerRadius,
209
255
  borderTopRightRadius: cornerRadius
256
+ } : {
257
+ position: 'absolute',
258
+ inset: 0,
259
+ display: 'flex',
260
+ flexDirection: 'column',
261
+ pointerEvents: 'none'
210
262
  },
211
- children: [sheet.showHandle ? /*#__PURE__*/_jsx("div", {
263
+ children: [sheet?.showHandle ? /*#__PURE__*/_jsx("div", {
212
264
  style: {
213
265
  alignSelf: 'center',
214
266
  width: 36,
@@ -219,15 +271,12 @@ function WebOverlayEntry({
219
271
  flexShrink: 0
220
272
  }
221
273
  }) : null, /*#__PURE__*/_jsx(View, {
222
- style: {
274
+ pointerEvents: sheet ? undefined : 'box-none',
275
+ style: sheet ? {
223
276
  flexShrink: 1
224
- },
277
+ } : StyleSheet.absoluteFill,
225
278
  children: children
226
279
  })]
227
- }) : /*#__PURE__*/_jsx(View, {
228
- pointerEvents: "box-none",
229
- style: StyleSheet.absoluteFill,
230
- children: children
231
280
  })
232
281
  })
233
282
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useId","useLayoutEffect","useRef","createPortal","StyleSheet","View","OverlayLevelProvider","OVERLAY_LEVEL_ORDER","isBlockingLevel","OVERLAY_OWNER_ATTRIBUTE","useOverlayController","animateBackdrop","animateTransition","ENTRY_ATTRIBUTE","getOverlayLayerRoot","getOverlayPageHost","registerOverlayDismissRequester","scheduleOverlayInertSync","useKeyboardShift","useSheetDrag","jsx","_jsx","jsxs","_jsxs","DEFAULT_BACKDROP_COLOR","DEFAULT_SHEET_MAX_HEIGHT","DEFAULT_SHEET_CORNER_RADIUS","stopPropagation","event","ISOLATED_EVENT_HANDLERS","onClick","onPointerDown","onPointerUp","onKeyDown","WebOverlayEntry","entryId","parked","stackOrder","levelOrder","presented","animation","blocking","backdropColor","dismissOnBackdropPress","onPresented","onDismissed","onRequestDismiss","sheet","zIndex","ownerKey","testID","children","sheetRef","pannedAwayRef","isSheet","entryRef","contentRef","keyboardLayerRef","backdropRef","directionRef","undefined","restoreFocusRef","callbacksRef","current","content","direction","neverEntered","document","activeElement","focus","preventScroll","getAnimations","forEach","running","cancel","contentRoot","firstElementChild","transition","enter","exit","backdrop","motion","filter","item","Promise","all","map","finished","then","catch","backdropNode","onBackdropClick","addEventListener","removeEventListener","layerRef","enabled","dismissOnPanDown","onDismissByPan","showBackdrop","cornerRadius","ref","role","tabIndex","inert","style","position","inset","pointerEvents","outline","visibility","opacity","background","left","right","bottom","height","maxHeight","display","flexDirection","overflow","touchAction","backgroundColor","String","borderTopLeftRadius","borderTopRightRadius","showHandle","alignSelf","width","marginTop","borderRadius","flexShrink","absoluteFill","OverlayView","props","level","presentation","keepContentMounted","parkedId","entry","mounted","onHostPresented","onHostDismissed","onHostRequestDismiss","scope","hostKey","pageHost","id","seq","color","dismissOnPress","value"],"sourceRoot":"../../src","sources":["OverlayView.web.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,KAAK,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AAGjE,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,oBAAoB,QAAQ,0BAAuB;AAC5D,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,oBAAiB;AACtE,SAASC,uBAAuB,QAAQ,0BAAuB;AAC/D,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,4BAAyB;AAC5E,SACEC,eAAe,EACfC,mBAAmB,EACnBC,kBA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AG,IAAI,CACnB;IACDlG,QAAQ,EAAEgG,QAAQ,GAAGhG,QAAQ,GAAGW,SAAU;IAC1CV,MAAM,EAAEA,MAAO;IAAAC,QAAA,eAEf9B,IAAA,CAACf,oBAAoB;MAACgJ,KAAK,EAAEhB,KAAM;MAAAnF,QAAA,EAAEA;IAAQ,CAAuB;EAAC,GAzBjE,OA0BW,CAAC,EAClB8F,QAAQ,IAAInI,mBAAmB,CAACwH,KAAK,CACvC,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useId","useLayoutEffect","useRef","createPortal","StyleSheet","View","OverlayLevelProvider","OVERLAY_LEVEL_ORDER","isBlockingLevel","OVERLAY_OWNER_ATTRIBUTE","overlayStore","useOverlayController","animateBackdrop","animateTransition","ENTRY_ATTRIBUTE","getOverlayLayerRoot","getOverlayPageHost","registerOverlayDismissRequester","scheduleOverlayInertSync","useKeyboardShift","useSheetDrag","jsx","_jsx","jsxs","_jsxs","DEFAULT_BACKDROP_COLOR","DEFAULT_SHEET_MAX_HEIGHT","DEFAULT_SHEET_CORNER_RADIUS","stopPropagation","event","ISOLATED_EVENT_HANDLERS","onClick","onPointerDown","onPointerUp","onKeyDown","WebOverlayEntry","entryId","parked","stackOrder","levelOrder","presented","animation","blocking","backdropColor","dismissOnBackdropPress","onPresented","onDismissed","onRequestDismiss","sheet","zIndex","ownerKey","testID","children","sheetRef","pannedAwayRef","isSheet","entryRef","contentRef","keyboardLayerRef","backdropRef","directionRef","undefined","restoreFocusRef","callbacksRef","current","style","removeProperty","opacity","content","direction","neverEntered","document","activeElement","focus","preventScroll","getAnimations","forEach","running","cancel","contentRoot","firstElementChild","transition","enter","exit","backdrop","motion","filter","item","Promise","all","map","finished","then","catch","backdropNode","onBackdropClick","addEventListener","removeEventListener","layerRef","enabled","dismissOnPanDown","onDismissByPan","showBackdrop","cornerRadius","onKeyDownCapture","root","key","defaultPrevented","nativeEvent","isComposing","getBlockingTop","id","tabbable","Array","from","querySelectorAll","node","tabIndex","hasAttribute","matches","ancestor","parentElement","getComputedStyle","inert","hidden","getAttribute","display","visibility","sort","a","b","aOrder","Infinity","bOrder","active","first","last","length","contains","shiftKey","preventDefault","ref","role","position","inset","pointerEvents","outline","background","left","right","bottom","height","maxHeight","flexDirection","overflow","touchAction","backgroundColor","String","borderTopLeftRadius","borderTopRightRadius","showHandle","alignSelf","width","marginTop","borderRadius","flexShrink","absoluteFill","OverlayView","props","level","presentation","keepContentMounted","parkedId","entry","mounted","onHostPresented","onHostDismissed","onHostRequestDismiss","scope","hostKey","pageHost","seq","color","dismissOnPress","value"],"sourceRoot":"../../src","sources":["OverlayView.web.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,KAAK,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AAGjE,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,oBAAoB,QAAQ,0BAAuB;AAC5D,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,oBAAiB;AACtE,SAASC,uBAAuB,QAAQ,0BAAuB;AAC/D,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,4BAAyB;AAC5E,SACEC,eAAe,EACfC,mBAAmB,EACnBC,kBAAkB,EAClBC,+BAA+B,EAC/BC,wBAAwB,QACnB,wBAAqB;AAC5B,SAASC,gBAAgB,QAAQ,2BAAwB;AACzD,SAASC,YAAY,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASlD,MAAMC,sBAAsB,GAAG,oBAAoB;AACnD,MAAMC,wBAAwB,GAAG,MAAM;AACvC,MAAMC,2BAA2B,GAAG,EAAE;;AAEtC;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAIC,KAAqB,IAAKA,KAAK,CAACD,eAAe,CAAC,CAAC;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QAAA,EAAEA;IAAQ,CAAuB;EAAC,GAzBjE,OA0BW,CAAC,EAClBgI,QAAQ,IAAIrK,mBAAmB,CAAC0J,KAAK,CACvC,CAAC;AACH","ignoreList":[]}
@@ -32,8 +32,7 @@ export function useOverlayController(props) {
32
32
  const pageScope = useOverlayPageScope();
33
33
  const hostKey = props.hostKey ?? pageScope.hostKey;
34
34
  const ownerKey = props.ownerKey ?? pageScope.ownerKey;
35
- // Without a host or owner there is nowhere to anchor a page overlay.
36
- const scope = props.scope === 'page' && hostKey && ownerKey ? 'page' : 'global';
35
+ const scope = props.scope ?? 'global';
37
36
  const baseId = useId();
38
37
  const cycleRef = useRef(0);
39
38
  const [entryId, setEntryId] = useState();
@@ -54,6 +53,11 @@ export function useOverlayController(props) {
54
53
  if (entryId || closedByStoreRef.current) {
55
54
  return;
56
55
  }
56
+ // Page context can become ready after the caller first opens the overlay.
57
+ // Keep the request in its page boundary instead of presenting globally.
58
+ if (scope === 'page' && (!hostKey || !ownerKey)) {
59
+ return;
60
+ }
57
61
  cycleRef.current += 1;
58
62
  const id = `overlay-view${baseId}${cycleRef.current}`;
59
63
  overlayStore.request({
@@ -80,7 +84,7 @@ export function useOverlayController(props) {
80
84
  setEntryId(id);
81
85
  // Level / strategy changes apply to the next open cycle only.
82
86
  // eslint-disable-next-line react-hooks/exhaustive-deps
83
- }, [visible, entryId]);
87
+ }, [visible, entryId, scope, hostKey, ownerKey]);
84
88
  useEffect(() => () => {
85
89
  if (entryId) {
86
90
  overlayStore.dismiss(entryId, 'system');
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useEffect","useId","useMemo","useRef","useState","useSyncExternalStore","OVERLAY_MOTION_PRESETS","resolveOverlayAnimation","useOverlayPageScope","findStatusBarOwner","overlayStore","useLatest","value","ref","current","useOverlayController","props","visible","level","strategy","priority","replaceKey","blocking","dismissOnBackPress","presentation","animation","statusBarStyle","pageScope","hostKey","ownerKey","scope","baseId","cycleRef","entryId","setEntryId","closedByStoreRef","propsRef","snapshot","subscribe","getSnapshot","entry","entries","find","e","id","queued","undefined","dismiss","request","dismissible","onRemoved","reason","onClose","finalize","resolvedAnimation","onHostPresented","onPresented","onHostDismissed","phase","getEntry","onHostRequestDismiss","handler","onRequestDismiss","mounted","presented","suspended","ownsStatusBar"],"sourceRoot":"../../src","sources":["useOverlayController.ts"],"mappings":";;AAAA,SACEA,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,oBAAoB,QACf,OAAO;AAEd,SAASC,sBAAsB,QAAQ,mCAAmC;AAC1E,SAASC,uBAAuB,QAAQ,iCAA8B;AACtE,SAASC,mBAAmB,QAAQ,uBAAoB;AACxD,SAASC,kBAAkB,EAAEC,YAAY,QAAQ,mBAAgB;AA6BjE,SAASC,SAASA,CAAIC,KAAQ,EAAE;EAC9B,MAAMC,GAAG,GAAGV,MAAM,CAACS,KAAK,CAAC;EACzBC,GAAG,CAACC,OAAO,GAAGF,KAAK;EACnB,OAAOC,GAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,oBAAoBA,CAClCC,KAAwB,EACJ;EACpB,MAAM;IACJC,OAAO;IACPC,KAAK;IACLC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,QAAQ;IACRC,kBAAkB;IAClBC,YAAY,GAAG,QAAQ;IACvBC,SAAS;IACTC;EACF,CAAC,GAAGV,KAAK;EACT,MAAMW,SAAS,GAAGnB,mBAAmB,CAAC,CAAC;EACvC,MAAMoB,OAAO,GAAGZ,KAAK,CAACY,OAAO,IAAID,SAAS,CAACC,OAAO;EAClD,MAAMC,QAAQ,GAAGb,KAAK,CAACa,QAAQ,IAAIF,SAAS,CAACE,QAAQ;EACrD;EACA,MAAMC,KAAK,GACTd,KAAK,CAACc,KAAK,KAAK,MAAM,IAAIF,OAAO,IAAIC,QAAQ,GAAG,MAAM,GAAG,QAAQ;EACnE,MAAME,MAAM,GAAG9B,KAAK,CAAC,C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,CAAC2C,QAAQ,CAACpB,OAAO,CAAC;EAChC,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,MAAM2B,oBAAoB,GAAG7D,WAAW,CACrCoD,MAAoC,IAAK;IACxC,MAAMU,OAAO,GAAGzB,QAAQ,CAACtB,OAAO,CAACgD,gBAAgB;IACjDD,OAAO,GAAGV,MAAM,CAAC;IACjB,IAAIlB,OAAO,KAAK,CAAC4B,OAAO,IAAIV,MAAM,KAAK,KAAK,CAAC,EAAE;MAC7CzC,YAAY,CAACqC,OAAO,CAACd,OAAO,EAAEkB,MAAM,CAAC;IACvC;EACF,CAAC,EACD,CAAClB,OAAO,EAAEG,QAAQ,CACpB,CAAC;EAED,OAAO;IACLI,KAAK;IACLuB,OAAO,EAAE,CAAC,CAACvB,KAAK,IAAIA,KAAK,CAACkB,KAAK,KAAK,QAAQ;IAC5CM,SAAS,EACP,CAAC,CAACxB,KAAK,IACPA,KAAK,CAACkB,KAAK,KAAK,QAAQ,KACvB5B,KAAK,KAAK,MAAM,IAAI,CAACU,KAAK,CAACyB,SAAS,CAAC;IACxCnC,KAAK;IACLoC,aAAa,EAAE,CAAC,CAACjC,OAAO,IAAIxB,kBAAkB,CAAC4B,QAAQ,CAAC,EAAEO,EAAE,KAAKX,OAAO;IACxEL,OAAO,EAAEE,KAAK,KAAK,MAAM,GAAGF,OAAO,GAAGkB,SAAS;IAC/CjB,QAAQ,EAAEC,KAAK,KAAK,MAAM,GAAGD,QAAQ,GAAGiB,SAAS;IACjDrB,SAAS,EAAE6B,iBAAiB;IAC5BC,eAAe;IACfE,eAAe;IACfG;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useEffect","useId","useMemo","useRef","useState","useSyncExternalStore","OVERLAY_MOTION_PRESETS","resolveOverlayAnimation","useOverlayPageScope","findStatusBarOwner","overlayStore","useLatest","value","ref","current","useOverlayController","props","visible","level","strategy","priority","replaceKey","blocking","dismissOnBackPress","presentation","animation","statusBarStyle","pageScope","hostKey","ownerKey","scope","baseId","cycleRef","entryId","setEntryId","closedByStoreRef","propsRef","snapshot","subscribe","getSnapshot","entry","entries","find","e","id","queued","undefined","dismiss","request","dismissible","onRemoved","reason","onClose","finalize","resolvedAnimation","onHostPresented","onPresented","onHostDismissed","phase","getEntry","onHostRequestDismiss","handler","onRequestDismiss","mounted","presented","suspended","ownsStatusBar"],"sourceRoot":"../../src","sources":["useOverlayController.ts"],"mappings":";;AAAA,SACEA,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,oBAAoB,QACf,OAAO;AAEd,SAASC,sBAAsB,QAAQ,mCAAmC;AAC1E,SAASC,uBAAuB,QAAQ,iCAA8B;AACtE,SAASC,mBAAmB,QAAQ,uBAAoB;AACxD,SAASC,kBAAkB,EAAEC,YAAY,QAAQ,mBAAgB;AA6BjE,SAASC,SAASA,CAAIC,KAAQ,EAAE;EAC9B,MAAMC,GAAG,GAAGV,MAAM,CAACS,KAAK,CAAC;EACzBC,GAAG,CAACC,OAAO,GAAGF,KAAK;EACnB,OAAOC,GAAG;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,oBAAoBA,CAClCC,KAAwB,EACJ;EACpB,MAAM;IACJC,OAAO;IACPC,KAAK;IACLC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,QAAQ;IACRC,kBAAkB;IAClBC,YAAY,GAAG,QAAQ;IACvBC,SAAS;IACTC;EACF,CAAC,GAAGV,KAAK;EACT,MAAMW,SAAS,GAAGnB,mBAAmB,CAAC,CAAC;EACvC,MAAMoB,OAAO,GAAGZ,KAAK,CAACY,OAAO,IAAID,SAAS,CAACC,OAAO;EAClD,MAAMC,QAAQ,GAAGb,KAAK,CAACa,QAAQ,IAAIF,SAAS,CAACE,QAAQ;EACrD,MAAMC,KAAK,GAAGd,KAAK,CAACc,KAAK,IAAI,QAAQ;EACrC,MAAMC,MAAM,GAAG9B,KAAK,CAA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  bottom = top + sheet.offsetHeight;
80
80
  } else {
81
- const extent = layoutExtent(contentRef.current);
81
+ const extent = layoutExtent(sheet ?? contentRef.current);
82
82
  if (extent) {
83
83
  top = origin + extent.top;
84
84
  bottom = origin + extent.bottom;
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","KEYBOARD_MARGIN","computeKeyboardShift","keyboardTop","contentTop","contentBottom","isSheet","safeTop","undefined","needed","room","Math","max","min","layoutExtent","content","root","firstElementChild","children","Array","from","filter","child","HTMLElement","length","top","map","c","offsetTop","bottom","offsetHeight","useKeyboardShift","layerRef","sheetRef","contentRef","enabled","shiftRef","viewport","globalThis","visualViewport","layer","current","update","keyboardBottom","height","covered","innerHeight","origin","parentElement","getBoundingClientRect","sheet","extent","shift","abs","style","transform","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["web/useKeyboardShift.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAGzC;AACA,OAAO,MAAMC,eAAe,GAAG,EAAE;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAC;EACnCC,WAAW;EACXC,UAAU;EACVC,aAAa;EACbC,OAAO;EACPC,OAAO,GAAG;AAOZ,CAAC,EAAU;EACT,IAAIJ,WAAW,KAAKK,SAAS,EAAE;IAC7B,OAAO,CAAC;EACV;EACA,MAAMC,MAAM,GAAGH,OAAO,GAClBD,aAAa,GAAGF,WAAW,GAC3BE,aAAa,GAAGJ,eAAe,GAAGE,WAAW;EACjD,MAAMO,IAAI,GAAGN,UAAU,GAAGG,OAAO;EACjC,OAAOI,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAACJ,MAAM,EAAEC,IAAI,CAAC,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA,SAASI,YAAYA,CACnBC,OAA2B,EACkB;EAC7C,MAAMC,IAAI,GAAGD,OAAO,EAAEE,iBAAmD;EACzE,IAAI,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AmB,CAAC,QAAQ,EAAEf,MAAM,CAAC;MAC9CL,QAAQ,CAACoB,mBAAmB,CAAC,QAAQ,EAAEf,MAAM,CAAC;MAC9CN,QAAQ,CAACK,OAAO,GAAG,CAAC;MACpBD,KAAK,CAACc,KAAK,CAACC,SAAS,GAAG,EAAE;IAC5B,CAAC;EACH,CAAC,EAAE,CAACrB,UAAU,EAAEC,OAAO,EAAE7B,OAAO,EAAE0B,QAAQ,EAAEC,QAAQ,CAAC,CAAC;AACxD","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useRef","KEYBOARD_MARGIN","computeKeyboardShift","keyboardTop","contentTop","contentBottom","isSheet","safeTop","undefined","needed","room","Math","max","min","layoutExtent","content","root","firstElementChild","children","Array","from","filter","child","HTMLElement","length","top","map","c","offsetTop","bottom","offsetHeight","useKeyboardShift","layerRef","sheetRef","contentRef","enabled","shiftRef","viewport","globalThis","visualViewport","layer","current","update","keyboardBottom","height","covered","innerHeight","origin","parentElement","getBoundingClientRect","sheet","extent","shift","abs","style","transform","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["web/useKeyboardShift.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAGzC;AACA,OAAO,MAAMC,eAAe,GAAG,EAAE;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAC;EACnCC,WAAW;EACXC,UAAU;EACVC,aAAa;EACbC,OAAO;EACPC,OAAO,GAAG;AAOZ,CAAC,EAAU;EACT,IAAIJ,WAAW,KAAKK,SAAS,EAAE;IAC7B,OAAO,CAAC;EACV;EACA,MAAMC,MAAM,GAAGH,OAAO,GAClBD,aAAa,GAAGF,WAAW,GAC3BE,aAAa,GAAGJ,eAAe,GAAGE,WAAW;EACjD,MAAMO,IAAI,GAAGN,UAAU,GAAGG,OAAO;EACjC,OAAOI,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAACJ,MAAM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AgB,CAAC,QAAQ,EAAEd,MAAM,CAAC;IAC3CL,QAAQ,CAACmB,gBAAgB,CAAC,QAAQ,EAAEd,MAAM,CAAC;IAC3CA,MAAM,CAAC,CAAC;IACR,OAAO,MAAM;MACXL,QAAQ,CAACoB,mBAAmB,CAAC,QAAQ,EAAEf,MAAM,CAAC;MAC9CL,QAAQ,CAACoB,mBAAmB,CAAC,QAAQ,EAAEf,MAAM,CAAC;MAC9CN,QAAQ,CAACK,OAAO,GAAG,CAAC;MACpBD,KAAK,CAACc,KAAK,CAACC,SAAS,GAAG,EAAE;IAC5B,CAAC;EACH,CAAC,EAAE,CAACrB,UAAU,EAAEC,OAAO,EAAE7B,OAAO,EAAE0B,QAAQ,EAAEC,QAAQ,CAAC,CAAC;AACxD","ignoreList":[]}
@@ -116,6 +116,9 @@ export function useSheetDrag({
116
116
  sheet.addEventListener('pointerup', onPointerUp);
117
117
  sheet.addEventListener('pointercancel', onPointerUp);
118
118
  return () => {
119
+ if (sheet.hasPointerCapture?.(pointerId)) {
120
+ sheet.releasePointerCapture(pointerId);
121
+ }
119
122
  sheet.removeEventListener('pointerdown', onPointerDown);
120
123
  sheet.removeEventListener('pointermove', onPointerMove);
121
124
  sheet.removeEventListener('pointerup', onPointerUp);
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","DRAG_START_THRESHOLD","DISMISS_DISTANCE_RATIO","DISMISS_VELOCITY","UPWARD_RESISTANCE","SETTLE_TRANSITION","scrolledAncestorWithin","target","sheet","node","HTMLElement","scrollTop","scrollHeight","clientHeight","parentElement","undefined","useSheetDrag","sheetRef","backdropRef","enabled","onDismissByPan","onDismissRef","current","startY","lastY","lastTime","velocity","tracking","dragging","pointerId","setOffset","offset","style","transform","backdrop","opacity","String","Math","max","offsetHeight","onPointerDown","event","button","clientY","timeStamp","onPointerMove","dy","setPointerCapture","transition","dt","onPointerUp","height","addEventListener","clickEvent","stopPropagation","preventDefault","capture","once","removeEventListener"],"sourceRoot":"../../../src","sources":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AC;IACH,CAAC;IAEDjD,KAAK,CAAC4C,gBAAgB,CAAC,aAAa,EAAEZ,aAAa,CAAC;IACpDhC,KAAK,CAAC4C,gBAAgB,CAAC,aAAa,EAAEP,aAAa,CAAC;IACpDrC,KAAK,CAAC4C,gBAAgB,CAAC,WAAW,EAAEF,WAAW,CAAC;IAChD1C,KAAK,CAAC4C,gBAAgB,CAAC,eAAe,EAAEF,WAAW,CAAC;IACpD,OAAO,MAAM;MACX1C,KAAK,CAACkD,mBAAmB,CAAC,aAAa,EAAElB,aAAa,CAAC;MACvDhC,KAAK,CAACkD,mBAAmB,CAAC,aAAa,EAAEb,aAAa,CAAC;MACvDrC,KAAK,CAACkD,mBAAmB,CAAC,WAAW,EAAER,WAAW,CAAC;MACnD1C,KAAK,CAACkD,mBAAmB,CAAC,eAAe,EAAER,WAAW,CAAC;IACzD,CAAC;EACH,CAAC,EAAE,CAACjC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,CAAC,CAAC;AACtC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useRef","DRAG_START_THRESHOLD","DISMISS_DISTANCE_RATIO","DISMISS_VELOCITY","UPWARD_RESISTANCE","SETTLE_TRANSITION","scrolledAncestorWithin","target","sheet","node","HTMLElement","scrollTop","scrollHeight","clientHeight","parentElement","undefined","useSheetDrag","sheetRef","backdropRef","enabled","onDismissByPan","onDismissRef","current","startY","lastY","lastTime","velocity","tracking","dragging","pointerId","setOffset","offset","style","transform","backdrop","opacity","String","Math","max","offsetHeight","onPointerDown","event","button","clientY","timeStamp","onPointerMove","dy","setPointerCapture","transition","dt","onPointerUp","height","addEventListener","clickEvent","stopPropagation","preventDefault","capture","once","hasPointerCapture","releasePointerCapture","removeEventListener"],"sourceRoot":"../../../src","sources":["web/useSheetDrag.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAGzC,MAAMC,oBAAoB,GAAG,CAAC;AAC9B,MAAMC,sBAAsB,GAAG,GAAG;AACl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DrC,KAAK,CAAC4C,gBAAgB,CAAC,WAAW,EAAEF,WAAW,CAAC;IAChD1C,KAAK,CAAC4C,gBAAgB,CAAC,eAAe,EAAEF,WAAW,CAAC;IACpD,OAAO,MAAM;MACX,IAAI1C,KAAK,CAACkD,iBAAiB,GAAG7B,SAAS,CAAC,EAAE;QACxCrB,KAAK,CAACmD,qBAAqB,CAAC9B,SAAS,CAAC;MACxC;MACArB,KAAK,CAACoD,mBAAmB,CAAC,aAAa,EAAEpB,aAAa,CAAC;MACvDhC,KAAK,CAACoD,mBAAmB,CAAC,aAAa,EAAEf,aAAa,CAAC;MACvDrC,KAAK,CAACoD,mBAAmB,CAAC,WAAW,EAAEV,WAAW,CAAC;MACnD1C,KAAK,CAACoD,mBAAmB,CAAC,eAAe,EAAEV,WAAW,CAAC;IACzD,CAAC;EACH,CAAC,EAAE,CAACjC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,CAAC,CAAC;AACtC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayView.web.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.web.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AA4Q5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,sCAiEnD"}
1
+ {"version":3,"file":"OverlayView.web.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.web.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAoW5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,sCAiEnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOverlayController.d.ts","sourceRoot":"","sources":["../../../src/useOverlayController.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,EACV,4BAA4B,EAC5B,iBAAiB,EAClB,M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AC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,yBAAyB,CAAC;IACrC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,oBAAoB,EAAE,CAAC,MAAM,EAAE,4BAA4B,KAAK,IAAI,CAAC;CACtE;AAQD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,iBAAiB,GACvB,kBAAkB,CAkJpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSheetDrag.d.ts","sourceRoot":"","sources":["../../../../src/web/useSheetDrag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBvC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,OAAO,EACP,cAAc,GACf,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,WAAW,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,QAwGA"}
1
+ {"version":3,"file":"useSheetDrag.d.ts","sourceRoot":"","sources":["../../../../src/web/useSheetDrag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBvC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,OAAO,EACP,cAAc,GACf,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,WAAW,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,QA2GA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-native-overlay",
3
- "version": "3.0.162-alpha.272",
3
+ "version": "6.7.0-alpha.335",
4
4
  "description": "Native and Web overlay hosts with ordered levels, page scope and Fabric measurement",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useId, useLayoutEffect, useRef } from 'react';
2
- import type { ReactNode, SyntheticEvent } from 'react';
2
+ import type { KeyboardEvent, ReactNode, SyntheticEvent } from 'react';
3
3
 
4
4
  import { createPortal } from 'react-dom';
5
5
  import { StyleSheet, View } from 'react-native';
@@ -7,6 +7,7 @@ import { StyleSheet, View } from 'react-native';
7
7
  import { OverlayLevelProvider } from './OverlayLevelContext';
8
8
  import { OVERLAY_LEVEL_ORDER, isBlockingLevel } from './OverlayLevels';
9
9
  import { OVERLAY_OWNER_ATTRIBUTE } from './OverlayPageHost.web';
10
+ import { overlayStore } from './OverlayStore';
10
11
  import { useOverlayController } from './useOverlayController';
11
12
  import { animateBackdrop, animateTransition } from './web/animateTransition';
12
13
  import {
@@ -98,6 +99,17 @@ function WebOverlayEntry({
98
99
  const callbacksRef = useRef({ onPresented, onDismissed });
99
100
  callbacksRef.current = { onPresented, onDismissed };
100
101
 
102
+ useLayoutEffect(() => {
103
+ if (!isSheet && sheetRef.current) {
104
+ // The host now survives a presentation switch; clear any in-flight pan.
105
+ sheetRef.current.style.removeProperty('transform');
106
+ sheetRef.current.style.removeProperty('transition');
107
+ if (backdropRef.current) {
108
+ backdropRef.current.style.opacity = '1';
109
+ }
110
+ }
111
+ }, [isSheet]);
112
+
101
113
  useLayoutEffect(() => {
102
114
  const content = contentRef.current;
103
115
  if (!content) {
@@ -124,7 +136,7 @@ function WebOverlayEntry({
124
136
  // of the full-window React root.
125
137
  const contentRoot = isSheet
126
138
  ? content
127
- : (content.firstElementChild as HTMLElement | null) ?? content;
139
+ : (sheetRef.current?.firstElementChild as HTMLElement | null) ?? content;
128
140
  const transition = direction === 'in' ? animation.enter : animation.exit;
129
141
  const running = [
130
142
  animateTransition(content, contentRoot, transition, direction),
@@ -192,6 +204,72 @@ function WebOverlayEntry({
192
204
  const showBackdrop = !!backdropColor || blocking;
193
205
  const cornerRadius = sheet?.cornerRadius ?? DEFAULT_SHEET_CORNER_RADIUS;
194
206
 
207
+ const onKeyDownCapture = (event: KeyboardEvent<HTMLDivElement>) => {
208
+ const root = entryRef.current;
209
+ if (
210
+ event.key !== 'Tab' ||
211
+ event.defaultPrevented ||
212
+ event.nativeEvent.isComposing ||
213
+ !root ||
214
+ !presented ||
215
+ parked ||
216
+ overlayStore.getBlockingTop()?.id !== entryId
217
+ ) {
218
+ return;
219
+ }
220
+ const tabbable = Array.from(
221
+ root.querySelectorAll<HTMLElement>(
222
+ 'a[href], area[href], button, input:not([type="hidden"]), select, textarea, iframe, object, embed, [tabindex], [contenteditable]:not([contenteditable="false"])'
223
+ )
224
+ )
225
+ .filter((node) => {
226
+ if (
227
+ (node.tabIndex < 0 &&
228
+ (node.hasAttribute('tabindex') ||
229
+ !node.hasAttribute('contenteditable'))) ||
230
+ node.matches(':disabled')
231
+ ) {
232
+ return false;
233
+ }
234
+ for (
235
+ let ancestor: HTMLElement | null = node;
236
+ ancestor;
237
+ ancestor = ancestor.parentElement
238
+ ) {
239
+ const style = getComputedStyle(ancestor);
240
+ if (
241
+ ancestor.inert ||
242
+ ancestor.hasAttribute('inert') ||
243
+ ancestor.hidden ||
244
+ ancestor.getAttribute('aria-hidden') === 'true' ||
245
+ style.display === 'none' ||
246
+ style.visibility === 'hidden'
247
+ ) {
248
+ return false;
249
+ }
250
+ }
251
+ return true;
252
+ })
253
+ .sort((a, b) => {
254
+ const aOrder = a.tabIndex > 0 ? a.tabIndex : Infinity;
255
+ const bOrder = b.tabIndex > 0 ? b.tabIndex : Infinity;
256
+ return aOrder === bOrder ? 0 : aOrder - bOrder;
257
+ });
258
+ const active = document.activeElement;
259
+ const first = tabbable[0];
260
+ const last = tabbable[tabbable.length - 1];
261
+ if (
262
+ !first ||
263
+ active === root ||
264
+ !root.contains(active) ||
265
+ active === (event.shiftKey ? first : last)
266
+ ) {
267
+ event.preventDefault();
268
+ (event.shiftKey ? last : first)?.focus({ preventScroll: true });
269
+ if (!first) root.focus({ preventScroll: true });
270
+ }
271
+ };
272
+
195
273
  return (
196
274
  <div
197
275
  ref={entryRef}
@@ -214,6 +292,7 @@ function WebOverlayEntry({
214
292
  visibility: parked ? 'hidden' : undefined,
215
293
  }}
216
294
  {...ISOLATED_EVENT_HANDLERS}
295
+ onKeyDownCapture={onKeyDownCapture}
217
296
  >
218
297
  {showBackdrop ? (
219
298
  <div
@@ -244,48 +323,58 @@ function WebOverlayEntry({
244
323
  ref={contentRef}
245
324
  style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}
246
325
  >
247
- {sheet ? (
248
- <div
249
- ref={sheetRef}
250
- style={{
251
- position: 'absolute',
252
- left: 0,
253
- right: 0,
254
- bottom: 0,
255
- height: sheet.height,
256
- maxHeight: sheet.maxHeight ?? DEFAULT_SHEET_MAX_HEIGHT,
257
- display: 'flex',
258
- flexDirection: 'column',
259
- overflow: 'hidden',
260
- pointerEvents: 'auto',
261
- touchAction: 'pan-y',
262
- background: sheet.backgroundColor
263
- ? String(sheet.backgroundColor)
264
- : undefined,
265
- borderTopLeftRadius: cornerRadius,
266
- borderTopRightRadius: cornerRadius,
267
- }}
326
+ {/* Keep both hosts and the content slot stable across presentations. */}
327
+ <div
328
+ ref={sheetRef}
329
+ style={
330
+ sheet
331
+ ? {
332
+ position: 'absolute',
333
+ left: 0,
334
+ right: 0,
335
+ bottom: 0,
336
+ height: sheet.height,
337
+ maxHeight: sheet.maxHeight ?? DEFAULT_SHEET_MAX_HEIGHT,
338
+ display: 'flex',
339
+ flexDirection: 'column',
340
+ overflow: 'hidden',
341
+ pointerEvents: 'auto',
342
+ touchAction: 'pan-y',
343
+ background: sheet.backgroundColor
344
+ ? String(sheet.backgroundColor)
345
+ : undefined,
346
+ borderTopLeftRadius: cornerRadius,
347
+ borderTopRightRadius: cornerRadius,
348
+ }
349
+ : {
350
+ position: 'absolute',
351
+ inset: 0,
352
+ display: 'flex',
353
+ flexDirection: 'column',
354
+ pointerEvents: 'none',
355
+ }
356
+ }
357
+ >
358
+ {sheet?.showHandle ? (
359
+ <div
360
+ style={{
361
+ alignSelf: 'center',
362
+ width: 36,
363
+ height: 5,
364
+ marginTop: 8,
365
+ borderRadius: 2.5,
366
+ background: 'rgba(0, 0, 0, 0.2)',
367
+ flexShrink: 0,
368
+ }}
369
+ />
370
+ ) : null}
371
+ <View
372
+ pointerEvents={sheet ? undefined : 'box-none'}
373
+ style={sheet ? { flexShrink: 1 } : StyleSheet.absoluteFill}
268
374
  >
269
- {sheet.showHandle ? (
270
- <div
271
- style={{
272
- alignSelf: 'center',
273
- width: 36,
274
- height: 5,
275
- marginTop: 8,
276
- borderRadius: 2.5,
277
- background: 'rgba(0, 0, 0, 0.2)',
278
- flexShrink: 0,
279
- }}
280
- />
281
- ) : null}
282
- <View style={{ flexShrink: 1 }}>{children}</View>
283
- </div>
284
- ) : (
285
- <View pointerEvents="box-none" style={StyleSheet.absoluteFill}>
286
375
  {children}
287
376
  </View>
288
- )}
377
+ </div>
289
378
  </div>
290
379
  </div>
291
380
  </div>
@@ -69,9 +69,7 @@ export function useOverlayController(
69
69
  const pageScope = useOverlayPageScope();
70
70
  const hostKey = props.hostKey ?? pageScope.hostKey;
71
71
  const ownerKey = props.ownerKey ?? pageScope.ownerKey;
72
- // Without a host or owner there is nowhere to anchor a page overlay.
73
- const scope =
74
- props.scope === 'page' && hostKey && ownerKey ? 'page' : 'global';
72
+ const scope = props.scope ?? 'global';
75
73
  const baseId = useId();
76
74
  const cycleRef = useRef(0);
77
75
  const [entryId, setEntryId] = useState<string | undefined>();
@@ -105,6 +103,11 @@ export function useOverlayController(
105
103
  if (entryId || closedByStoreRef.current) {
106
104
  return;
107
105
  }
106
+ // Page context can become ready after the caller first opens the overlay.
107
+ // Keep the request in its page boundary instead of presenting globally.
108
+ if (scope === 'page' && (!hostKey || !ownerKey)) {
109
+ return;
110
+ }
108
111
  cycleRef.current += 1;
109
112
  const id = `overlay-view${baseId}${cycleRef.current}`;
110
113
  overlayStore.request(
@@ -134,7 +137,7 @@ export function useOverlayController(
134
137
  setEntryId(id);
135
138
  // Level / strategy changes apply to the next open cycle only.
136
139
  // eslint-disable-next-line react-hooks/exhaustive-deps
137
- }, [visible, entryId]);
140
+ }, [visible, entryId, scope, hostKey, ownerKey]);
138
141
 
139
142
  useEffect(
140
143
  () => () => {
@@ -99,7 +99,7 @@ export function useKeyboardShift({
99
99
  top = origin + sheet.offsetTop;
100
100
  bottom = top + sheet.offsetHeight;
101
101
  } else {
102
- const extent = layoutExtent(contentRef.current);
102
+ const extent = layoutExtent(sheet ?? contentRef.current);
103
103
  if (extent) {
104
104
  top = origin + extent.top;
105
105
  bottom = origin + extent.bottom;
@@ -134,6 +134,9 @@ export function useSheetDrag({
134
134
  sheet.addEventListener('pointerup', onPointerUp);
135
135
  sheet.addEventListener('pointercancel', onPointerUp);
136
136
  return () => {
137
+ if (sheet.hasPointerCapture?.(pointerId)) {
138
+ sheet.releasePointerCapture(pointerId);
139
+ }
137
140
  sheet.removeEventListener('pointerdown', onPointerDown);
138
141
  sheet.removeEventListener('pointermove', onPointerMove);
139
142
  sheet.removeEventListener('pointerup', onPointerUp);