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

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 (40) hide show
  1. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayAnimation.kt +5 -10
  2. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayEntryRootView.kt +23 -2
  3. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayHost.kt +17 -12
  4. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayView.kt +3 -1
  5. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayBackTest.kt +295 -0
  6. package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayMotionTest.kt +101 -0
  7. package/docs/SPEC.md +164 -30
  8. package/ios/NativeOverlayContainerView.swift +20 -7
  9. package/ios/NativeOverlaySheetController.swift +35 -1
  10. package/lib/module/OverlayStore.js +13 -1
  11. package/lib/module/OverlayStore.js.map +1 -1
  12. package/lib/module/OverlayView.web.js +104 -25
  13. package/lib/module/OverlayView.web.js.map +1 -1
  14. package/lib/module/useOverlayController.js +11 -3
  15. package/lib/module/useOverlayController.js.map +1 -1
  16. package/lib/module/web/animateTransition.js +20 -12
  17. package/lib/module/web/animateTransition.js.map +1 -1
  18. package/lib/module/web/overlayLayers.js +16 -0
  19. package/lib/module/web/overlayLayers.js.map +1 -1
  20. package/lib/module/web/useKeyboardShift.js +1 -1
  21. package/lib/module/web/useKeyboardShift.js.map +1 -1
  22. package/lib/module/web/useSheetDrag.js +22 -2
  23. package/lib/module/web/useSheetDrag.js.map +1 -1
  24. package/lib/typescript/src/OverlayStore.d.ts +2 -0
  25. package/lib/typescript/src/OverlayStore.d.ts.map +1 -1
  26. package/lib/typescript/src/OverlayView.web.d.ts.map +1 -1
  27. package/lib/typescript/src/useOverlayController.d.ts.map +1 -1
  28. package/lib/typescript/src/web/animateTransition.d.ts +2 -2
  29. package/lib/typescript/src/web/animateTransition.d.ts.map +1 -1
  30. package/lib/typescript/src/web/overlayLayers.d.ts +1 -0
  31. package/lib/typescript/src/web/overlayLayers.d.ts.map +1 -1
  32. package/lib/typescript/src/web/useSheetDrag.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/OverlayStore.ts +13 -1
  35. package/src/OverlayView.web.tsx +193 -56
  36. package/src/useOverlayController.ts +11 -4
  37. package/src/web/animateTransition.ts +30 -11
  38. package/src/web/overlayLayers.ts +20 -0
  39. package/src/web/useKeyboardShift.ts +1 -1
  40. package/src/web/useSheetDrag.ts +23 -2
package/docs/SPEC.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # react-native-native-overlay SPEC
2
2
 
3
3
  Status: Implemented through the P5 caller migration in app-monorepo. Android
4
- and Web runtime checks passed there; iOS runtime, physical-device and iPad
5
- acceptance remain unverified. Packaging in app-modules is validated separately.
4
+ and Web runtime checks passed there; focused iOS 26.5 simulator and Android 16
5
+ emulator checks are recorded below. Broader iOS runtime, physical-device and
6
+ iPad acceptance remain unverified. Packaging in app-modules is validated
7
+ separately.
6
8
 
7
9
  The implementation is migrated from app-monorepo commit
8
10
  `376633bd9f1c410dbccb01fb6a0492be9a5c3f38`, package
@@ -28,19 +30,26 @@ TypeScript declarations; React Native generates the Fabric bindings at app
28
30
  build time. Publish `common/cpp`, `src`, `lib`, Android/iOS sources, podspec and
29
31
  autolinking configuration. Web consumers additionally provide `react-dom`.
30
32
 
31
- `react-native-native-sheet` remains separately published for existing consumers;
32
- its compatibility shim/deprecation is a subsequent migration step, not a
33
- silent API change in this release. Sheet behavior derived from that package
34
- retains its original implementation attribution in source comments.
33
+ `react-native-native-sheet` is retired from this repository after the App
34
+ consumer migration. Its source workspace, example dependency, and dedicated
35
+ tests are removed; sheet presentation is owned by this package and has no
36
+ dependency on the retired package. The old `NativeSheet` API is not retained as
37
+ a compatibility shim. Previously published npm versions remain unchanged, and
38
+ this repository cleanup does not publish or change package versions. Sheet
39
+ behavior derived from that package retains its original implementation
40
+ attribution in source comments.
35
41
 
36
42
  ### Release boundary
37
43
 
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.
44
+ The earlier `3.0.162-alpha.272` release remains immutable. This branch is
45
+ prepared at `6.7.0-9`: the repository's release validator requires all 43
46
+ publishable workspace manifests and exact internal pins to use the same
47
+ version. Publish only `@onekeyfe/react-native-native-overlay` through the
48
+ manual `package-publish` workflow with `npm_dist_tag=latest` and
49
+ `only_workspace=@onekeyfe/react-native-native-overlay`; verify that exact
50
+ registry tarball before the App pins it and refreshes its dependency and native
51
+ locks. The other workspace version changes are release metadata, not a request
52
+ to publish their packages in this run. Leave the source PR open for review.
44
53
 
45
54
  ## 5.1 Purpose, scope, and non-goals
46
55
 
@@ -85,6 +94,9 @@ Ownership:
85
94
  queues, page visibility, and back/Escape resolution.
86
95
  - **Native hosts** own drawing, hit testing, animation, keyboard, and back-key
87
96
  capture, and report lifecycle back to the store.
97
+ - Android's static host lookup holds weak Activity keys and weak host values;
98
+ an active overlay or installed back callback owns its host. The lookup does
99
+ not itself extend the lifetime of an Activity.
88
100
  - **Content** is the caller's React subtree. The overlay view stays where the
89
101
  caller rendered it. Native code reparents its content into the host, so React
90
102
  context is preserved; there is no root-siblings portal.
@@ -108,6 +120,14 @@ come only from props.
108
120
  - `dismiss(id, reason)` moves an entry to `closing`. `finalize(id)` removes it
109
121
  after the native exit animation. A closing entry that is never finalized is
110
122
  removed after 5 s.
123
+ - `reopen(id)` restores a closing entry to active, cancels its fallback timer,
124
+ and keeps its ordering, content and removal handler. A declarative
125
+ false-to-true change before exit completion uses this path; it does not
126
+ report a completed close. Hosts retarget the in-flight animation, including
127
+ cancelling the host-requested UIKit sheet dismissal when still running.
128
+ - Removing a queued entry detaches its removal handler before notifying store
129
+ subscribers or scheduling its callback. Same-tick reuse of that ID owns a
130
+ separate handler; the old removal cannot invoke or delete the new handler.
111
131
  - `dismissAll({ scope, belowLevel, reason })`, `setPageVisible(ownerKey,
112
132
  visible)`, `removePage(ownerKey)`.
113
133
  - `resolveBack(focusedHostKey?)` returns `dismiss(id)`, `block`, or `pass`.
@@ -136,6 +156,11 @@ visible)`, `removePage(ownerKey)`.
136
156
 
137
157
  - `usePageOverlayHost()` resolves `hostKey` and `ownerKey` from navigation
138
158
  context.
159
+ - A declarative page overlay keeps `scope: 'page'` while either key is
160
+ unavailable. It does not request or present an entry until both keys are
161
+ available; becoming ready while visible requests it in the page lane.
162
+ Hiding or unmounting before readiness creates no entry or close callback.
163
+ Direct store requests still throw for missing page keys.
139
164
  - `useInPageDialog`, `useInModalDialog`, and `useInTabDialog` become aliases of
140
165
  page scope. Tab scope is removed.
141
166
 
@@ -147,8 +172,20 @@ visible)`, `removePage(ownerKey)`.
147
172
  - `motion` is a preset name or a concrete `{ type: 'spring', spring: { mass, stiffness, damping, overshootClamping } }`
148
173
  or `{ type: 'timing', timing: { durationMs, easing: cubicBezier } }`.
149
174
  - Presets are resolved per platform:
150
- - Native mirrors the Reanimated driver: `quick` is a spring with m 0.1,
151
- k 100, c 20 (damping ratio ≈ 3.16).
175
+ - Native `quick` supplies spring m 0.1, k 100, c 20. The iOS sheet's
176
+ measured position and dimming response use the critically damped curve
177
+ at angular frequency `sqrt(k/m)`; UIKit reports an animator duration near
178
+ 292 ms. Android caps an overdamped spring's effective damping ratio at 1
179
+ while preserving m and k; underdamped and timing motions retain their
180
+ existing response. This rule
181
+ also applies to custom overdamped springs as a platform compatibility
182
+ inference; only the default `quick` sheet path has been measured on iOS.
183
+ Android's implementation is covered by native tests. In the consumer
184
+ shells, the default `quick` Dialog and ActionList sheet enter/exit motion
185
+ and dimming were compared over three cycles per direction on Android 16
186
+ and iOS 26.5; their normalized visible curves met the recorded parity
187
+ tolerance. This does not verify custom springs, exact cross-device
188
+ rectangles, or callback timing.
152
189
  - Web mirrors the CSS driver: `quick` is 150 ms `cubic-bezier(.25,.1,.25,1)`.
153
190
  - Converting native springs for web is opt-in (`springToCssLinear`), because
154
191
  it would slow web overlays down 4–9×.
@@ -162,6 +199,13 @@ visible)`, `removePage(ownerKey)`.
162
199
  | fullscreen | fade, `quick` | none |
163
200
  | anchored | scale 0.95 + fade from the resolved anchor placement, `popoverQuick` | fade |
164
201
 
202
+ - **Android sheet transform ownership (Implemented; Android 16 consumer-shell runtime verified):**
203
+ the overlay's enter/exit transform belongs to the sheet's CoordinatorLayout
204
+ parent. Material's IME insets callback owns the child sheet's `translationY`,
205
+ and the keyboard layer owns the IME avoidance lift. These transforms compose
206
+ while the child sheet remains the BottomSheetBehavior drag target. The
207
+ overlay must not animate the child sheet's `translationY` during IME motion.
208
+
165
209
  - Special cases the callers set explicitly:
166
210
  - App lock: `enter: none`, `exit: fade lockFade`. The web tamper check reloads
167
211
  the page if the lock fades in from opacity 0.
@@ -195,6 +239,22 @@ request ─► queued ─► active ─► (enter anim) presented
195
239
  its current value. It does not restart.
196
240
  - `onRemoved` fires exactly once per entry, even when a finalize and the
197
241
  timeout race.
242
+ - **Android exit ownership (Implemented; blocking page/global touch and global
243
+ Back runtime verified on Android 16; accessibility native-test verified,
244
+ TalkBack device verification pending):** A
245
+ blocking entry keeps ownership of touch, Back, and accessibility isolation
246
+ until its exit animation completes and the native host detaches it. During
247
+ exit, the entry consumes touches and Back without forwarding them to its
248
+ closing React content or requesting a
249
+ second dismissal. Its content is hidden from TalkBack while lower content
250
+ remains isolated. A reopen during exit restores content input and
251
+ accessibility without briefly exposing the page below. Closing non-blocking
252
+ entries pass through touch and Back to the entry below.
253
+ Consumer-shell recordings verify that page and global blocking entries keep
254
+ lower touch targets inert during their visible exit, then release them, and
255
+ that Back does not navigate beneath a closing global entry. Native tests
256
+ cover closing non-blocking entries and same-entry reopen; those paths and
257
+ TalkBack reading during exit have not been verified on device.
198
258
  - Page entries:
199
259
  - They are suspended (hidden but kept) while the owner page is covered or
200
260
  detached.
@@ -208,6 +268,30 @@ request ─► queued ─► active ─► (enter anim) presented
208
268
  - Threads: store mutations happen on the JS thread. Native animation and layout
209
269
  run on the UI thread. Events are delivered as direct events.
210
270
 
271
+ ### Web presentation updates (OK-50653)
272
+
273
+ For an open Web overlay that keeps its portal host, changing `presentation`
274
+ between sheet and a non-sheet frame MUST preserve the mounted content subtree.
275
+ Its props and React context continue to update normally. Changing the optional
276
+ sheet handle MUST NOT move the content into a different React child slot.
277
+ Closing without `keepContentMounted` still unmounts content after exit; reopening
278
+ creates a fresh content lifecycle. Business entity changes and draft resets
279
+ remain caller-owned; the overlay does not cache or persist form values.
280
+
281
+ The stable sheet shell must not change non-sheet animation origins or keyboard
282
+ avoidance geometry. Switching away from a sheet clears any pan offset and its
283
+ backdrop opacity override, and releases an active pointer capture.
284
+
285
+ Conformance: `src/__tests__/draftRetention.web.test.ts` exercises the real Web
286
+ host, portal and store for presentation changes, live props/context/callbacks,
287
+ close/reopen, animation origins, keyboard geometry and an interrupted pan.
288
+ Chrome extension side-panel and ordinary-tab checks use synthetic content;
289
+ this correction does not claim new iOS/Android runtime verification.
290
+
291
+ These source changes require a new published package version before the app
292
+ can consume them from npm. This fix leaves package versions and lockfiles at
293
+ their existing values and does not publish a release.
294
+
211
295
  ## 5.5 Data, cache, and identity
212
296
 
213
297
  - Identity is the entry `id`: caller-provided, otherwise `overlay-<seq>`.
@@ -216,6 +300,22 @@ request ─► queued ─► active ─► (enter anim) presented
216
300
 
217
301
  ## 5.6 Platform contract
218
302
 
303
+ ### Web keyboard focus containment
304
+
305
+ The topmost active, unsuspended blocking Web entry MUST contain sequential
306
+ keyboard focus. Tab from its last tabbable child wraps to the first;
307
+ Shift+Tab from its first wraps to the last. From the entry root, focus enters
308
+ the first/last child respectively. With no tabbable children, focus stays on
309
+ the entry root. Disabled, negative-tabindex, hidden and inert subtrees are
310
+ excluded. Positive tabindex values precede ordinary DOM-order tab stops.
311
+ Non-blocking, lower, closing, suspended and parked entries MUST NOT run a
312
+ focus loop. Existing focus entry/restore and Escape policies are unchanged.
313
+
314
+ A Web backdrop with `dismissOnPress: true` MUST receive pointer events even
315
+ when its entry is non-blocking. This permits a transparent outside-click
316
+ shield without modal focus or accessibility isolation. A passive backdrop on
317
+ a non-blocking entry remains pointer-transparent.
318
+
219
319
  | Concern | iOS | Android | Web |
220
320
  | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
221
321
  | 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 +324,7 @@ request ─► queued ─► active ─► (enter anim) presented
224
324
  | 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
325
  | Header / tab bar coverage (page) | Covered: the host is above the tab controller and navigation bars. | Covered. | Covered. |
226
326
  | 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. |
327
+ | 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
328
  | 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
329
  | 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
330
  | 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 +396,17 @@ navigation remains a separate runtime acceptance item.
296
396
 
297
397
  Automated (P0):
298
398
 
399
+ - `src/__tests__/focusTrap.web.test.ts` mounts real Web overlays and checks
400
+ both Tab boundaries, root/empty fallback, inaccessible children, positive
401
+ tabindex order, top-entry precedence, page scope, suspension and parking.
402
+ - `src/__tests__/useOverlayController.test.ts` exercises the actual hook and
403
+ page scope providers: missing/empty keys, delayed readiness, one request,
404
+ page suspension/removal, hiding/unmounting before readiness and global scope.
405
+ - `NativeOverlayBackTest` exercises the Android host's key interceptor and
406
+ Back dispatcher with actual entry/page views: dismissible non-blockers,
407
+ blockers, input readiness, canceled key-up, global/page precedence,
408
+ suspension and blocking-only accessibility isolation. It also checks live
409
+ host reuse, Activity isolation and rebuilding after a cleared weak value.
299
410
  - `src/__tests__/pageIsolation.web.test.ts` mounts a real React portal in a
300
411
  DOM host and verifies late suspension, level ordering and restoration after
301
412
  the blocking entry is removed.
@@ -331,7 +442,10 @@ Runtime matrix, required per platform before migrating callers (P1–P3):
331
442
  - switch tab and come back: it restores;
332
443
  - remove the page: it closes with `page-removed`;
333
444
  - the native header and tab bar are covered.
334
- 5. Back/Escape reaches the topmost blocking overlay; the lock swallows it.
445
+ 5. Back/Escape reaches the topmost input-ready overlay that is blocking or
446
+ explicitly dismissible, global before page. A non-dismissible blocker
447
+ consumes Back without closing; a passive non-blocking entry passes through.
448
+ Accessibility isolation remains blocking-only. The lock swallows Back.
335
449
  6. Keyboard: an input in a global sheet, a page sheet and a secure dialog.
336
450
  7. iOS: a system picker opened from an overlay appears above it.
337
451
  8. Split view: page overlays stay in their own pane.
@@ -362,8 +476,12 @@ P3 page scope notes:
362
476
  their global sheet implementation inside the page host.
363
477
  - Android back also resolves page entries: global overlays first, then the
364
478
  topmost visible page overlay.
365
- - A page request without a resolvable host or owner falls back to global
366
- scope.
479
+ - A declarative page overlay waits for a resolvable host and owner; it never
480
+ falls back to global scope. Direct store requests require both keys.
481
+ - On Web, a page overlay also waits for its registered DOM host while closed
482
+ with `keepContentMounted`. Registration mounts parked content in that host;
483
+ close/reopen retains the same DOM and state. Unregistration never moves page
484
+ content into a global layer.
367
485
 
368
486
  P2 sheet notes:
369
487
 
@@ -378,7 +496,11 @@ P2 sheet notes:
378
496
  overlay motion; dragging fades the backdrop; a drag to hidden reports
379
497
  `pan`.
380
498
  - Web renders a bottom surface with pointer drag (40% distance or 0.5 px/ms
381
- flick dismisses, never from scrolled content).
499
+ flick dismisses, never from scrolled content). Reopening kept content after
500
+ a pan dismissal clears the sheet transform, transition and backdrop opacity;
501
+ the next dismissal follows the normal exit path and restores focus.
502
+ Cancelling a tracked pointer resets its drag offset, transition and backdrop
503
+ without dismissing the sheet or swallowing a later click.
382
504
  - A fitted sheet measures its content with `onLayout` before presenting.
383
505
  Hidden content stays mounted inside the zero-width host (clipped on iOS,
384
506
  INVISIBLE on Android), and the host height stays auto: a fixed 0 height
@@ -475,8 +597,10 @@ P4e lock screen notes:
475
597
  interactive (OK-62416).
476
598
  - Android back is swallowed on the lock screen (blocking, not dismissible);
477
599
  it no longer reaches navigation behind the lock.
478
- - The web lock tamper check and the lock screen's body-level inert pass are
479
- unchanged; the lock layer root is a `document.body` child.
600
+ - The web lock tamper check is retained. The body-level inert pass starts
601
+ when the lock node actually mounts, covers later body portals, and restores
602
+ each node's previous inert state on unlock. The lock layer root is a
603
+ `document.body` child.
480
604
 
481
605
  P5a native popover notes:
482
606
 
@@ -484,14 +608,18 @@ P5a native popover notes:
484
608
  (`NativeSheetPresentation`); the Tamagui Popover sheet (`TMPopover.Adapt`),
485
609
  its external backdrop, z-index and back handler are gone, and
486
610
  the removed `nativeSheet` option throws. iPad / wide windows keep the 400–480 pt centered
487
- frame inside the sheet. `usingSheet={false}` still renders no panel on
488
- native (web / desktop floating panels).
611
+ frame inside the sheet. Native keeps this supported sheet presentation
612
+ even when a cross-platform caller sets `usingSheet={false}` for its web panel.
489
613
  - The native popover renders inline in the caller's tree (its contexts
490
614
  apply) instead of through the full-window portal. Every popover remains
491
615
  mounted until the exit callback (1 s fallback); content then unmounts
492
616
  unless `keepChildrenMounted`. Reopening cancels pending teardown.
493
617
  - `closePopover()` waits for exit completion; repeated requests share the
494
618
  same completion promise, and completion or unmount clears its timer.
619
+ - Percent sheet snap points set the viewport height on native and web; fit
620
+ mode keeps content measurement. Both keep the header and bottom spacing
621
+ inside the bounded surface. Native Popover and custom Toast also retain
622
+ their deferred-guide blocker while open.
495
623
  - Sheet options are package-owned. Unsupported legacy `sheetProps` keys
496
624
  and floating-panel `zIndex` / `portalProps` throw instead of being ignored.
497
625
 
@@ -501,16 +629,22 @@ P5b web popover notes:
501
629
  level; the Tamagui Popover and `PopoverContent` are gone.
502
630
  - Below `md` with `usingSheet` (the default): an overlay sheet with a
503
631
  header and a dismissing backdrop.
504
- - Otherwise: `presentation="anchored"`, non-blocking and without a backdrop.
632
+ - Otherwise: `presentation="anchored"`, non-blocking, with a transparent
633
+ dismissing backdrop for press-triggered panels. Hover panels have no backdrop.
505
634
  Floating UI (`@floating-ui/dom`) places the panel: offset, flip, shift,
506
635
  and a max height from the available space. `autoUpdate` follows scroll
507
636
  and resize.
508
- - The enter animation scales an ancestor of the panel, so the panel measures
509
- smaller while it runs. The panel is positioned again on `onPresented`.
510
- - Anchored panels close on an outside press. Presses on the trigger, on the
511
- panel, or inside an overlay ranked above it do not close it, so a nested
512
- Select or a Dialog opened from the panel keeps it open. They also close on
513
- Escape, unless `hoverable`.
637
+ - For a single positioned child, Web anchored scale/fade runs on that content,
638
+ with a local transform origin. Its full-window positioning ancestors remain
639
+ untransformed, so Floating UI uses the same coordinate space during and after
640
+ the animation. Completion positioning must not correct coordinates distorted
641
+ by the enter scale. Multi-child roots retain their shared full-window motion.
642
+ - Press-triggered anchored panels close on a backdrop press without activating
643
+ the page underneath. Presses on the panel or inside an overlay ranked above
644
+ it do not close it, so a nested Select or a Dialog opened from the panel
645
+ keeps it open. They also close on Escape, unless `hoverable`.
646
+ - Press-triggered anchored panels own a focus scope and forward caller
647
+ open/close autofocus callbacks. Hover panels never move or trap focus.
514
648
  - `hoverable` opens and closes on mouse enter / leave of the trigger and
515
649
  panel. The default close delay is 100 ms, so the pointer can cross the gap.
516
650
  - `keepChildrenMounted` maps to `keepContentMounted`. On web a closed entry
@@ -323,8 +323,17 @@ final class NativeOverlayEntryView: UIView {
323
323
  }
324
324
  if visible {
325
325
  cycleOpen = true
326
- // A sheet that is still animating out is re-presented after it finishes.
327
- if phase == .hidden || (phase == .exiting && !usesSystemSheet) {
326
+ if phase == .exiting, usesSystemSheet, let controller = sheetController,
327
+ controller.cancelHostDismissal(completion: { [weak self, weak controller] in
328
+ DispatchQueue.main.async {
329
+ guard let self, self.sheetController === controller, self.phase == .entering else { return }
330
+ self.phase = .shown
331
+ self.didPresent()
332
+ if !self.visible { self.dismissSheet() }
333
+ }
334
+ }) {
335
+ phase = .entering
336
+ } else if phase == .hidden || (phase == .exiting && !usesSystemSheet) {
328
337
  present()
329
338
  }
330
339
  } else if cycleOpen {
@@ -473,13 +482,13 @@ final class NativeOverlayEntryView: UIView {
473
482
  reportContentOffset()
474
483
  NativeOverlayWindowManager.shared.entryRemoved(from: hostWindow)
475
484
  guard let reason, cycleOpen else { return }
476
- cycleOpen = visible
477
- onDismissed?(["reason": reason])
478
- // Reopened while the exit animation ran; UIKit-initiated dismissals
479
- // ("system") are left for JS to settle instead.
485
+ // A reopen at UIKit's completion boundary keeps the same JS entry.
480
486
  if reason == "programmatic", visible, window != nil {
481
487
  present()
488
+ return
482
489
  }
490
+ cycleOpen = visible
491
+ onDismissed?(["reason": reason])
483
492
  }
484
493
 
485
494
  private func didPresent() {
@@ -568,12 +577,16 @@ final class NativeOverlayEntryView: UIView {
568
577
  finishDismiss(reason: "programmatic")
569
578
  return
570
579
  }
580
+ if controller.resumeHostDismissal() {
581
+ phase = .exiting
582
+ return
583
+ }
571
584
  // Closing mid-presentation is handled by the present completion.
572
585
  guard !controller.isBeingPresented, phase != .exiting else { return }
573
586
  phase = .exiting
574
587
  controller.dismissRequestedByHost = true
575
588
  controller.dismiss(animated: true) { [weak self, weak controller] in
576
- guard let self, self.sheetController === controller else { return }
589
+ guard let self, self.sheetController === controller, self.phase == .exiting else { return }
577
590
  self.finishDismiss(reason: "programmatic")
578
591
  }
579
592
  }
@@ -31,6 +31,7 @@ private final class NativeOverlaySheetTransitionAnimator: NSObject,
31
31
  private let presenting: Bool
32
32
  private let motion: NativeOverlayMotion
33
33
  private var animator: UIViewPropertyAnimator?
34
+ private var cancellationCompletion: (() -> Void)?
34
35
 
35
36
  init(presenting: Bool, motion: NativeOverlayMotion) {
36
37
  self.presenting = presenting
@@ -90,15 +91,32 @@ private final class NativeOverlaySheetTransitionAnimator: NSObject,
90
91
  animator.addCompletion { position in
91
92
  let completed = position == .end && !transitionContext.transitionWasCancelled
92
93
  if !completed {
94
+ sheetView.alpha = self.presenting && reduceMotion ? 0 : 1
93
95
  sheetView.transform = self.presenting ? offscreen : .identity
94
96
  sheetController.setDimmingAlpha(self.presenting ? 0 : 1)
95
97
  }
96
98
  transitionContext.completeTransition(completed)
99
+ if position == .start { self.cancellationCompletion?() }
100
+ self.cancellationCompletion = nil
97
101
  }
98
102
  self.animator = animator
99
103
  return animator
100
104
  }
101
105
 
106
+ func reverseDismissal(completion: @escaping () -> Void) -> Bool {
107
+ guard !presenting, let animator, animator.isRunning, !animator.isReversed else { return false }
108
+ cancellationCompletion = completion
109
+ animator.isReversed = true
110
+ return true
111
+ }
112
+
113
+ func resumeDismissal() -> Bool {
114
+ guard !presenting, let animator, animator.isRunning, animator.isReversed else { return false }
115
+ cancellationCompletion = nil
116
+ animator.isReversed = false
117
+ return true
118
+ }
119
+
102
120
  func animationEnded(_ transitionCompleted: Bool) {
103
121
  animator = nil
104
122
  }
@@ -119,6 +137,7 @@ final class NativeOverlaySheetController: UIViewController,
119
137
  private var dimmingView: UIView?
120
138
  private var backdropTap: UITapGestureRecognizer?
121
139
  private var heightAnimator: UIViewPropertyAnimator?
140
+ private var dismissalAnimator: NativeOverlaySheetTransitionAnimator?
122
141
  private var shadowSuppressionDisplayLink: CADisplayLink?
123
142
  /// Set while the host itself asked UIKit to dismiss.
124
143
  var dismissRequestedByHost = false
@@ -230,7 +249,22 @@ final class NativeOverlaySheetController: UIViewController,
230
249
  func animationController(
231
250
  forDismissed dismissed: UIViewController
232
251
  ) -> UIViewControllerAnimatedTransitioning? {
233
- NativeOverlaySheetTransitionAnimator(presenting: false, motion: style.exitMotion)
252
+ let animator = NativeOverlaySheetTransitionAnimator(presenting: false, motion: style.exitMotion)
253
+ dismissalAnimator = animator
254
+ return animator
255
+ }
256
+
257
+ func cancelHostDismissal(completion: @escaping () -> Void) -> Bool {
258
+ guard dismissRequestedByHost,
259
+ dismissalAnimator?.reverseDismissal(completion: completion) == true else { return false }
260
+ dismissRequestedByHost = false
261
+ return true
262
+ }
263
+
264
+ func resumeHostDismissal() -> Bool {
265
+ guard dismissalAnimator?.resumeDismissal() == true else { return false }
266
+ dismissRequestedByHost = true
267
+ return true
234
268
  }
235
269
 
236
270
  override func viewWillAppear(_ animated: Bool) {
@@ -97,6 +97,16 @@ export class OverlayStore {
97
97
  }
98
98
  }
99
99
 
100
+ /** Reverses an unfinished close without creating a new presentation cycle. */
101
+ reopen(id) {
102
+ const entry = this.shown.get(id);
103
+ if (!entry || entry.phase !== 'closing') return;
104
+ this.clearClosingTimer(id);
105
+ entry.phase = 'active';
106
+ entry.dismissReason = undefined;
107
+ this.emit();
108
+ }
109
+
100
110
  /** Removes a closing (or active) entry once its exit animation finished. */
101
111
  finalize(id) {
102
112
  const entry = this.shown.get(id);
@@ -207,7 +217,9 @@ export class OverlayStore {
207
217
  if (queuedIndex !== -1) {
208
218
  this.queued = this.queued.filter(e => e.id !== id);
209
219
  // Queued entries never rendered, so they leave without an exit animation.
210
- queueMicrotask(() => this.notifyRemoved(id, reason));
220
+ const handlers = this.handlers.get(id);
221
+ this.handlers.delete(id);
222
+ queueMicrotask(() => handlers?.onRemoved?.(reason));
211
223
  return true;
212
224
  }
213
225
  const entry = this.shown.get(id);
@@ -1 +1 @@
1
- {"version":3,"names":["OverlayRequestError","OVERLAY_LEVEL_ORDER","isBlockingLevel","DEFAULT_CLOSING_TIMEOUT_MS","laneKeyOf","entry","scope","level","hostKey","compareRenderOrder","a","b","levelDiff","seq","compareQueueOrder","priority","OverlayStore","shown","Map","queued","handlers","closingTimers","pageVisibility","listeners","Set","snapshot","entries","constructor","options","closingTimeoutMs","subscribe","listener","add","delete","getSnapshot","getEntry","id","get","find","e","request","existing","ownerKey","blocking","strategy","replaceKey","undefined","dismissible","statusBarStyle","phase","suspended","dismissReason","isOwnerHidden","set","replaceIn","canPromote","toSorted","emit","dismiss","reason","dismissWithoutEmit","finalize","clearClosingTimer","promoteQueued","notifyRemoved","dismissAll","filter","matches","belowLevel","dropped","changed","length","values","forEach","setPageVisible","visible","removePage","resolveBack","focusedHostKey","candidates","top","kind","getStatusBarOwner","findStatusBarOwner","getBlockingTop","i","queuedIndex","findIndex","queueMicrotask","setTimeout","laneKey","sameLane","targets","slice","promotedLanes","remaining","has","push","timer","clearTimeout","onRemoved","map","overlayStore"],"sourceRoot":"../../src","sources":["OverlayStore.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,oBAAiB;AACrD,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,oBAAiB;AAwBtE,MAAMC,0BAA0B,GAAG,IAAI;AAEvC,SAASC,SAASA,CAACC,KAAoB,EAAU;EAC/C,OAAOA,KAAK,CAACC,KAAK,KAAK,QAAQ,GAC3B,UAAUD,KAAK,CAACE,KAAK,EAAE,GACvB,QAAQF,KAAK,CAACG,OAAO,IAAI,EAAE,IAAIH,KAAK,CAACE,KAAK,EAAE;AAClD;AAEA,SAASE,kBAAkBA,CAACC,CAAgB,EAAEC,CAAgB,EAAU;EACtE,IAAID,CAAC,CAACJ,KAAK,KAAKK,CAAC,CAACL,KAAK,EAAE;IACvB,OAAOI,CAAC,CAACJ,KAAK,KAAK,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC;EACpC;EACA,IAAII,CAAC,CAACJ,KAAK,KAAK,MAAM,IAAII,CAAC,CAACF,OAAO,KAAKG,CAAC,CAACH,OAAO,EAAE;IACjD,OAAO,CAACE,CAAC,CAACF,OAAO,IAAI,EAAE,KAAKG,CAAC,CAACH,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;EACvD;EACA,MAAMI,SAAS,GAAGX,mBAAmB,CAACS,CAAC,CAACH,KAAK,CAAC,GAAGN,mBAAmB,CAACU,CAAC,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KAAK;IACd;EACF;EACA,OAAOyC,SAAS;AAClB;AAEA,OAAO,MAAMwD,YAAY,GAAG,IAAItF,YAAY,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["OverlayRequestError","OVERLAY_LEVEL_ORDER","isBlockingLevel","DEFAULT_CLOSING_TIMEOUT_MS","laneKeyOf","entry","scope","level","hostKey","compareRenderOrder","a","b","levelDiff","seq","compareQueueOrder","priority","OverlayStore","shown","Map","queued","handlers","closingTimers","pageVisibility","listeners","Set","snapshot","entries","constructor","options","closingTimeoutMs","subscribe","listener","add","delete","getSnapshot","getEntry","id","get","find","e","request","existing","ownerKey","blocking","strategy","replaceKey","undefined","dismissible","statusBarStyle","phase","suspended","dismissReason","isOwnerHidden","set","replaceIn","canPromote","toSorted","emit","dismiss","reason","dismissWithoutEmit","reopen","clearClosingTimer","finalize","promoteQueued","notifyRemoved","dismissAll","filter","matches","belowLevel","dropped","changed","length","values","forEach","setPageVisible","visible","removePage","resolveBack","focusedHostKey","candidates","top","kind","getStatusBarOwner","findStatusBarOwner","getBlockingTop","i","queuedIndex","findIndex","queueMicrotask","onRemoved","setTimeout","laneKey","sameLane","targets","slice","promotedLanes","remaining","has","push","timer","clearTimeout","map","overlayStore"],"sourceRoot":"../../src","sources":["OverlayStore.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,oBAAiB;AACrD,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,oBAAiB;AAwBtE,MAAMC,0BAA0B,GAAG,IAAI;AAEvC,SAASC,SAASA,CAACC,KAAoB,EAAU;EAC/C,OAAOA,KAAK,CAACC,KAAK,KAAK,QAAQ,GAC3B,UAAUD,KAAK,CAACE,KAAK,EAAE,GACvB,QAAQF,KAAK,CAACG,OAAO,IAAI,EAAE,IAAIH,KAAK,CAACE,KAAK,EAAE;AAClD;AAEA,SAASE,kBAAkBA,CAACC,CAAgB,EAAEC,CAAgB,EAAU;EACtE,IAAID,CAAC,CAACJ,KAAK,KAAKK,CAAC,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