@onekeyfe/react-native-native-overlay 6.7.0-20 → 6.7.0-22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayBackTest.kt +8 -0
- package/docs/SPEC.md +44 -0
- package/ios/NativeOverlayContainerView.swift +6 -0
- package/ios/NativeOverlaySheetController.swift +3 -0
- package/ios/NativeOverlayWindowManager.swift +25 -0
- package/lib/module/OverlayView.js +8 -3
- package/lib/module/OverlayView.js.map +1 -1
- package/lib/module/contentSize.js +20 -0
- package/lib/module/contentSize.js.map +1 -0
- package/lib/typescript/src/OverlayPageHost.d.ts +1 -1
- package/lib/typescript/src/OverlayPageHost.d.ts.map +1 -1
- package/lib/typescript/src/OverlayPageHost.web.d.ts +1 -1
- package/lib/typescript/src/OverlayPageHost.web.d.ts.map +1 -1
- package/lib/typescript/src/OverlayPageScope.d.ts +2 -2
- package/lib/typescript/src/OverlayPageScope.d.ts.map +1 -1
- package/lib/typescript/src/OverlayView.d.ts +1 -1
- package/lib/typescript/src/OverlayView.d.ts.map +1 -1
- package/lib/typescript/src/OverlayViewTypes.d.ts +11 -0
- package/lib/typescript/src/OverlayViewTypes.d.ts.map +1 -1
- package/lib/typescript/src/contentSize.d.ts +19 -0
- package/lib/typescript/src/contentSize.d.ts.map +1 -0
- package/package.json +9 -9
- package/src/OverlayView.tsx +10 -1
- package/src/OverlayViewTypes.ts +8 -0
- package/src/contentSize.ts +21 -0
|
@@ -6,6 +6,7 @@ import android.view.View
|
|
|
6
6
|
import android.widget.FrameLayout
|
|
7
7
|
import androidx.activity.ComponentActivity
|
|
8
8
|
import com.facebook.react.bridge.BridgeReactContext
|
|
9
|
+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
|
9
10
|
import com.facebook.react.uimanager.PointerEvents
|
|
10
11
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
11
12
|
import com.facebook.react.uimanager.TouchTargetHelper
|
|
@@ -34,6 +35,13 @@ class NativeOverlayBackTest {
|
|
|
34
35
|
|
|
35
36
|
@Before
|
|
36
37
|
fun setUp() {
|
|
38
|
+
val localAccessor = Class.forName(
|
|
39
|
+
"com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsLocalAccessor"
|
|
40
|
+
).getDeclaredConstructor().newInstance()
|
|
41
|
+
ReactNativeFeatureFlags::class.java.getDeclaredField("accessor").apply {
|
|
42
|
+
isAccessible = true
|
|
43
|
+
set(null, localAccessor)
|
|
44
|
+
}
|
|
37
45
|
activity = Robolectric.buildActivity(ComponentActivity::class.java).setup().visible().get()
|
|
38
46
|
val reactContext = BridgeReactContext(activity)
|
|
39
47
|
reactContext.onHostResume(activity)
|
package/docs/SPEC.md
CHANGED
|
@@ -156,6 +156,7 @@ visible)`, `removePage(ownerKey)`.
|
|
|
156
156
|
dismissOnBackPress
|
|
157
157
|
dismissOnPanDown // sheet and toast only
|
|
158
158
|
anchor? // anchored only: a trigger ref or a window rect
|
|
159
|
+
contentSize? // native non-sheet only: content frame instead of the window size
|
|
159
160
|
onPresented onDismissRequest onDismissed(reason)
|
|
160
161
|
/>
|
|
161
162
|
```
|
|
@@ -432,6 +433,27 @@ the correction:
|
|
|
432
433
|
- Rects already in screen space (for example from native lists) need no
|
|
433
434
|
correction.
|
|
434
435
|
|
|
436
|
+
### Content size for windows about to rotate
|
|
437
|
+
|
|
438
|
+
Implemented; Android runtime-verified with OneKey's native chart fullscreen on
|
|
439
|
+
an API 36 emulator. iOS takes the same JS layout path but was not
|
|
440
|
+
runtime-verified. Non-sheet content is laid out by JS at the window size it
|
|
441
|
+
last saw (`useWindowDimensions`), and the Android content host clips the
|
|
442
|
+
content to that frame. JS hears about a rotation only after the window has
|
|
443
|
+
rotated, so until then the content keeps the previous orientation's frame and
|
|
444
|
+
is clipped to it.
|
|
445
|
+
|
|
446
|
+
- `contentSize?: { width, height }` (non-sheet presentations) replaces the
|
|
447
|
+
window size for the content frame. A caller that prepares content for the
|
|
448
|
+
window it is about to rotate into passes the rotated size, so the first
|
|
449
|
+
rotated frame shows all of it. Omitted, the content follows the window size
|
|
450
|
+
as before.
|
|
451
|
+
- The content stays anchored at the host origin. While the window has not
|
|
452
|
+
rotated yet, content larger than the window draws past its edges and takes
|
|
453
|
+
no touches there; the caller keeps it hidden until the window matches.
|
|
454
|
+
- Sheets ignore it: they size their content from the sheet geometry. Web
|
|
455
|
+
ignores it: the DOM overlay sizes itself with CSS.
|
|
456
|
+
|
|
435
457
|
### Web keyboard focus containment
|
|
436
458
|
|
|
437
459
|
The topmost active, unsuspended blocking Web entry MUST contain sequential
|
|
@@ -472,6 +494,25 @@ Known divergences:
|
|
|
472
494
|
|
|
473
495
|
## 5.7 Failure, fallback, and safety
|
|
474
496
|
|
|
497
|
+
### iOS global sheet diagnostics
|
|
498
|
+
|
|
499
|
+
Implemented in source; physical-device verification pending. Native global
|
|
500
|
+
sheets record present/completion, host dismiss/completion/teardown,
|
|
501
|
+
interactive dismiss, appearance/disappearance and unexpected disappearance
|
|
502
|
+
through dynamically resolved OneKeyLog. Missing logger class/selector is a
|
|
503
|
+
no-op and adds no package dependency. These diagnostics do not change the
|
|
504
|
+
presentation, retry, callback, cleanup, or timing contracts.
|
|
505
|
+
|
|
506
|
+
Only process-local temporary controller/presenter counters, wall time,
|
|
507
|
+
fixed stage/reason enums, and lifecycle booleans are logged. Controller addresses,
|
|
508
|
+
descriptions, entry/business identifiers, content, and arbitrary errors are
|
|
509
|
+
excluded. Weak controller keys must not extend controller lifetime. No layout
|
|
510
|
+
or per-frame events are logged. JS and native IDs are independent; timeline
|
|
511
|
+
correlation by time is approximate during concurrent operations. This host
|
|
512
|
+
belongs to main on iOS; background JS has a separate heap and is not an owner
|
|
513
|
+
of these UIKit resources. Native logger persistence is owned by the logger.
|
|
514
|
+
|
|
515
|
+
|
|
475
516
|
- A page request without host or owner keys throws `OverlayRequestError`. This
|
|
476
517
|
is a programming error; there is no silent global fallback, unlike today's
|
|
477
518
|
`Portal.Render` retry.
|
|
@@ -561,6 +602,9 @@ Automated (P0):
|
|
|
561
602
|
- page suspend, restore and removal;
|
|
562
603
|
- back resolution (global first, `block`, `pass`, focused host) and the
|
|
563
604
|
blocking top.
|
|
605
|
+
- `src/__tests__/contentSize.test.ts` covers the non-sheet content frame:
|
|
606
|
+
the window size by default, and a caller size before and after the window
|
|
607
|
+
size reaches JS.
|
|
564
608
|
- `src/__tests__/animation.test.ts` covers:
|
|
565
609
|
- the spring response in all damping regimes, overshoot clamping and settle
|
|
566
610
|
time;
|
|
@@ -574,9 +574,11 @@ final class NativeOverlayEntryView: UIView {
|
|
|
574
574
|
}
|
|
575
575
|
let controller = NativeOverlaySheetController(host: self, style: sheetStyle())
|
|
576
576
|
sheetController = controller
|
|
577
|
+
NativeOverlayDiagnostic.log("stage=present_begin controllerID=\(NativeOverlayDiagnostic.id(controller)) presenterID=\(NativeOverlayDiagnostic.id(presenter))")
|
|
577
578
|
phase = .entering
|
|
578
579
|
presenter.present(controller, animated: true) { [weak self, weak controller] in
|
|
579
580
|
guard let self, let controller, self.sheetController === controller else { return }
|
|
581
|
+
NativeOverlayDiagnostic.log("stage=present_complete controllerID=\(NativeOverlayDiagnostic.id(controller)) visible=\(self.visible) entering=\(self.phase == .entering)")
|
|
580
582
|
if self.phase == .entering {
|
|
581
583
|
self.phase = .shown
|
|
582
584
|
self.didPresent()
|
|
@@ -592,6 +594,7 @@ final class NativeOverlayEntryView: UIView {
|
|
|
592
594
|
finishDismiss(reason: "programmatic")
|
|
593
595
|
return
|
|
594
596
|
}
|
|
597
|
+
NativeOverlayDiagnostic.log("stage=dismiss_request controllerID=\(NativeOverlayDiagnostic.id(controller)) reason=programmatic presenting=\(controller.isBeingPresented) exiting=\(phase == .exiting)")
|
|
595
598
|
if controller.resumeHostDismissal() {
|
|
596
599
|
phase = .exiting
|
|
597
600
|
return
|
|
@@ -602,6 +605,7 @@ final class NativeOverlayEntryView: UIView {
|
|
|
602
605
|
controller.dismissRequestedByHost = true
|
|
603
606
|
controller.dismiss(animated: true) { [weak self, weak controller] in
|
|
604
607
|
guard let self, self.sheetController === controller, self.phase == .exiting else { return }
|
|
608
|
+
NativeOverlayDiagnostic.log("stage=dismiss_complete controllerID=\(NativeOverlayDiagnostic.id(controller)) reason=programmatic")
|
|
605
609
|
self.finishDismiss(reason: "programmatic")
|
|
606
610
|
}
|
|
607
611
|
}
|
|
@@ -612,6 +616,7 @@ final class NativeOverlayEntryView: UIView {
|
|
|
612
616
|
touchHandler.perform(NSSelectorFromString("detachFromView:"), with: controller.view)
|
|
613
617
|
}
|
|
614
618
|
stageContent()
|
|
619
|
+
NativeOverlayDiagnostic.log("stage=teardown controllerID=\(NativeOverlayDiagnostic.id(controller)) presented=\(controller.presentingViewController != nil) dismissing=\(controller.isBeingDismissed)")
|
|
615
620
|
if controller.presentingViewController != nil, !controller.isBeingDismissed {
|
|
616
621
|
controller.dismissRequestedByHost = true
|
|
617
622
|
controller.dismiss(animated: false)
|
|
@@ -705,6 +710,7 @@ extension NativeOverlayContainerView: NativeOverlaySheetHost {
|
|
|
705
710
|
|
|
706
711
|
func sheetDidDisappearUnexpectedly(_ controller: NativeOverlaySheetController) {
|
|
707
712
|
guard sheetController === controller else { return }
|
|
713
|
+
NativeOverlayDiagnostic.log("stage=unexpected_disappear controllerID=\(NativeOverlayDiagnostic.id(controller)) visible=\(visible) reason=system")
|
|
708
714
|
finishDismiss(reason: "system")
|
|
709
715
|
}
|
|
710
716
|
|
|
@@ -277,6 +277,7 @@ final class NativeOverlaySheetController: UIViewController,
|
|
|
277
277
|
|
|
278
278
|
override func viewDidAppear(_ animated: Bool) {
|
|
279
279
|
super.viewDidAppear(animated)
|
|
280
|
+
NativeOverlayDiagnostic.log("stage=did_appear controllerID=\(NativeOverlayDiagnostic.id(self)) presenterID=\(NativeOverlayDiagnostic.id(presentingViewController))")
|
|
280
281
|
stopSuppressingPresentationShadow()
|
|
281
282
|
}
|
|
282
283
|
|
|
@@ -287,6 +288,7 @@ final class NativeOverlaySheetController: UIViewController,
|
|
|
287
288
|
|
|
288
289
|
override func viewDidDisappear(_ animated: Bool) {
|
|
289
290
|
super.viewDidDisappear(animated)
|
|
291
|
+
NativeOverlayDiagnostic.log("stage=did_disappear controllerID=\(NativeOverlayDiagnostic.id(self)) presenterID=\(NativeOverlayDiagnostic.id(presentingViewController)) hostRequested=\(dismissRequestedByHost)")
|
|
290
292
|
if let backdropTap {
|
|
291
293
|
dimmingView?.removeGestureRecognizer(backdropTap)
|
|
292
294
|
}
|
|
@@ -319,6 +321,7 @@ final class NativeOverlaySheetController: UIViewController,
|
|
|
319
321
|
}
|
|
320
322
|
|
|
321
323
|
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
|
|
324
|
+
NativeOverlayDiagnostic.log("stage=interactive_dismiss controllerID=\(NativeOverlayDiagnostic.id(self)) reason=pan")
|
|
322
325
|
dismissRequestedByHost = true
|
|
323
326
|
host?.sheetDidDismissInteractively(self)
|
|
324
327
|
}
|
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import UIKit
|
|
2
|
+
import ObjectiveC
|
|
3
|
+
|
|
4
|
+
/// IDs are process-local and weakly keyed; never log controller descriptions or addresses.
|
|
5
|
+
enum NativeOverlayDiagnostic {
|
|
6
|
+
private static var nextID = 0
|
|
7
|
+
private static let controllerIDs = NSMapTable<UIViewController, NSNumber>.weakToStrongObjects()
|
|
8
|
+
|
|
9
|
+
static func id(_ controller: UIViewController?) -> Int {
|
|
10
|
+
guard let controller else { return 0 }
|
|
11
|
+
if let existing = controllerIDs.object(forKey: controller) { return existing.intValue }
|
|
12
|
+
nextID += 1
|
|
13
|
+
controllerIDs.setObject(NSNumber(value: nextID), forKey: controller)
|
|
14
|
+
return nextID
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static func log(_ details: String) {
|
|
18
|
+
guard let logClass = NSClassFromString("ReactNativeNativeLogger.OneKeyLog")
|
|
19
|
+
?? NSClassFromString("OneKeyLog"),
|
|
20
|
+
let method = class_getClassMethod(logClass, NSSelectorFromString("info::")) else { return }
|
|
21
|
+
typealias LogFunction = @convention(c) (AnyClass, Selector, NSString, NSString) -> Void
|
|
22
|
+
let log = unsafeBitCast(method_getImplementation(method), to: LogFunction.self)
|
|
23
|
+
log(logClass, NSSelectorFromString("info::"), "NativeOverlay",
|
|
24
|
+
"wallTimeMs=\(Int64(Date().timeIntervalSince1970 * 1000)) \(details)" as NSString)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
2
27
|
|
|
3
28
|
/// Levels mirror `OVERLAY_LEVEL_ORDER`. Each active level gets its own
|
|
4
29
|
/// window so that order between levels never depends on show order.
|
|
@@ -5,6 +5,7 @@ import { Platform, PlatformColor, Pressable, StatusBar, StyleSheet, View, useWin
|
|
|
5
5
|
import NativeOverlay from './NativeOverlayNativeComponent';
|
|
6
6
|
import { OverlayLevelProvider } from "./OverlayLevelContext.js";
|
|
7
7
|
import { isBlockingLevel } from "./OverlayLevels.js";
|
|
8
|
+
import { resolveContentSize } from "./contentSize.js";
|
|
8
9
|
import { resolveSheetWidth } from "./sheetWidth.js";
|
|
9
10
|
import { useOverlayController } from "./useOverlayController.js";
|
|
10
11
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -67,7 +68,8 @@ export function OverlayView(props) {
|
|
|
67
68
|
children,
|
|
68
69
|
testID,
|
|
69
70
|
windowOffsetRequest,
|
|
70
|
-
onWindowOffset
|
|
71
|
+
onWindowOffset,
|
|
72
|
+
contentSize
|
|
71
73
|
} = props;
|
|
72
74
|
// A plain sibling at the host's spot: its JS-measured origin shares the
|
|
73
75
|
// modal-relative space of the caller's measurements, while native reports
|
|
@@ -242,8 +244,11 @@ export function OverlayView(props) {
|
|
|
242
244
|
collapsable: false,
|
|
243
245
|
pointerEvents: "box-none",
|
|
244
246
|
style: {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
+
...resolveContentSize({
|
|
248
|
+
windowWidth: width,
|
|
249
|
+
windowHeight: height,
|
|
250
|
+
contentSize
|
|
251
|
+
}),
|
|
247
252
|
flexShrink: 0
|
|
248
253
|
},
|
|
249
254
|
children: /*#__PURE__*/_jsx(OverlayLevelProvider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","useRef","useState","Platform","PlatformColor","Pressable","StatusBar","StyleSheet","View","useWindowDimensions","NativeOverlay","OverlayLevelProvider","isBlockingLevel","resolveSheetWidth","useOverlayController","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_BACKDROP_COLOR","DEFAULT_SHEET_MAX_RATIO","DEFAULT_SHEET_CORNER_RADIUS","SHEET_SURFACE_TAIL_HEIGHT","REQUEST_REASONS","back","backdrop","pan","styles","create","host","position","top","left","width","sheetMarginLeft","bottom","sheetMarginRight","right","sheetSurface","borderCurve","overflow","flexGrow","sheetSurfaceTail","height","OverlayView","props","level","presentation","blocking","dismissOnBackPress","sheet","keepContentMounted","statusBarStyle","children","testID","windowOffsetRequest","onWindowOffset","offsetProbeRef","onHostWindowOrigin","event","x","nativeX","y","nativeY","nativeEvent","current","measureInWindow","isSheet","controller","entry","mounted","presented","ownsStatusBar","scope","hostKey","ownerKey","animation","onHostPresented","onHostDismissed","onHostRequestDismiss","measuredSheetHeight","setMeasuredSheetHeight","reportedSheetWidth","setReportedSheetWidth","containerWidth","sheetContainerWidth","inset","sheetInset","windowWidth","reportedWidth","maxWidth","hasSheetSurface","undefined","sheetSurfaceBackgroundColor","backgroundColor","OS","dismissOnBackdropPress","dismissOnPress","onSheetMarginPress","onSheetLayoutReport","maxSheetHeight","maxHeight","sheetHeight","Math","min","onSheetLayout","layout","animationConfig","JSON","stringify","isBlocking","onDismissed","onRequestDismiss","reason","statusBar","animated","barStyle","ref","collapsable","pointerEvents","style","visible","stackOrder","seq","backdropColor","color","sheetCornerRadius","cornerRadius","showHandle","sheetBackgroundColor","dismissOnPanDown","onPresented","hostOriginRequest","onLayout","paddingHorizontal","flexShrink","accessible","importantForAccessibility","onPress","borderTopLeftRadius","borderTopRightRadius","value"],"sourceRoot":"../../src","sources":["OverlayView.tsx"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAE9D,SACEC,QAAQ,EACRC,aAAa,EACbC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,mBAAmB,QACd,cAAc;AAErB,OAAOC,aAAa,MAAM,gCAAgC;AAC1D,SAASC,oBAAoB,QAAQ,0BAAuB;AAC5D,SAASC,eAAe,QAAQ,oBAAiB;AACjD,SAASC,iBAAiB,QAAQ,iBAAc;AAChD,SAASC,oBAAoB,QAAQ,2BAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAS9D,MAAMC,sBAAsB,GAAG,oBAAoB;AACnD,MAAMC,uBAAuB,GAAG,IAAI;AACpC,MAAMC,2BAA2B,GAAG,EAAE;AACtC;AACA,MAAMC,yBAAyB,GAAG,GAAG;AAErC,MAAMC,eAA6D,GAAG;EACpEC,IAAI,EAAE,MAAM;EACZC,QAAQ,EAAE,UAAU;EACpBC,GAAG,EAAE;AACP,CAAC;AAED,MAAMC,MAAM,
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useRef","useState","Platform","PlatformColor","Pressable","StatusBar","StyleSheet","View","useWindowDimensions","NativeOverlay","OverlayLevelProvider","isBlockingLevel","resolveContentSize","resolveSheetWidth","useOverlayController","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_BACKDROP_COLOR","DEFAULT_SHEET_MAX_RATIO","DEFAULT_SHEET_CORNER_RADIUS","SHEET_SURFACE_TAIL_HEIGHT","REQUEST_REASONS","back","backdrop","pan","styles","create","host","position","top","left","width","sheetMarginLeft","bottom","sheetMarginRight","right","sheetSurface","borderCurve","overflow","flexGrow","sheetSurfaceTail","height","OverlayView","props","level","presentation","blocking","dismissOnBackPress","sheet","keepContentMounted","statusBarStyle","children","testID","windowOffsetRequest","onWindowOffset","contentSize","offsetProbeRef","onHostWindowOrigin","event","x","nativeX","y","nativeY","nativeEvent","current","measureInWindow","isSheet","controller","entry","mounted","presented","ownsStatusBar","scope","hostKey","ownerKey","animation","onHostPresented","onHostDismissed","onHostRequestDismiss","measuredSheetHeight","setMeasuredSheetHeight","reportedSheetWidth","setReportedSheetWidth","containerWidth","sheetContainerWidth","inset","sheetInset","windowWidth","reportedWidth","maxWidth","hasSheetSurface","undefined","sheetSurfaceBackgroundColor","backgroundColor","OS","dismissOnBackdropPress","dismissOnPress","onSheetMarginPress","onSheetLayoutReport","maxSheetHeight","maxHeight","sheetHeight","Math","min","onSheetLayout","layout","animationConfig","JSON","stringify","isBlocking","onDismissed","onRequestDismiss","reason","statusBar","animated","barStyle","ref","collapsable","pointerEvents","style","visible","stackOrder","seq","backdropColor","color","sheetCornerRadius","cornerRadius","showHandle","sheetBackgroundColor","dismissOnPanDown","onPresented","hostOriginRequest","onLayout","paddingHorizontal","flexShrink","accessible","importantForAccessibility","onPress","borderTopLeftRadius","borderTopRightRadius","value","windowHeight"],"sourceRoot":"../../src","sources":["OverlayView.tsx"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAE9D,SACEC,QAAQ,EACRC,aAAa,EACbC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,mBAAmB,QACd,cAAc;AAErB,OAAOC,aAAa,MAAM,gCAAgC;AAC1D,SAASC,oBAAoB,QAAQ,0BAAuB;AAC5D,SAASC,eAAe,QAAQ,oBAAiB;AACjD,SAASC,kBAAkB,QAAQ,kBAAe;AAClD,SAASC,iBAAiB,QAAQ,iBAAc;AAChD,SAASC,oBAAoB,QAAQ,2BAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,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AExD,KAAK;YAClB8G,YAAY,EAAEpG,MAAM;YACpBc;UACF,CAAC,CAAC;UACF+E,UAAU,EAAE;QACd,CAAE;QAAAnF,QAAA,eAEFvC,IAAA,CAACN,oBAAoB;UAACsI,KAAK,EAAEhG,KAAM;UAAAO,QAAA,EAChCA;QAAQ,CACW;MAAC,CACnB;IACP,CACY,CAAC;EAAA,CAChB,CAAC;AAEP","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Non-sheet content geometry. JS lays the content out at the window size it
|
|
5
|
+
* last saw, and the native content host clips the content to that frame. Right
|
|
6
|
+
* after the window rotates, JS still holds the previous size, so a caller that
|
|
7
|
+
* prepared its content for the window it is about to rotate into passes that
|
|
8
|
+
* size instead.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveContentSize({
|
|
11
|
+
windowWidth,
|
|
12
|
+
windowHeight,
|
|
13
|
+
contentSize
|
|
14
|
+
}) {
|
|
15
|
+
return {
|
|
16
|
+
width: contentSize?.width ?? windowWidth,
|
|
17
|
+
height: contentSize?.height ?? windowHeight
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=contentSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveContentSize","windowWidth","windowHeight","contentSize","width","height"],"sourceRoot":"../../src","sources":["contentSize.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,kBAAkBA,CAAC;EACjCC,WAAW;EACXC,YAAY;EACZC;AAKF,CAAC,EAAqC;EACpC,OAAO;IACLC,KAAK,EAAED,WAAW,EAAEC,KAAK,IAAIH,WAAW;IACxCI,MAAM,EAAEF,WAAW,EAAEE,MAAM,IAAIH;EACjC,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayPageHost.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageHost.tsx"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE
|
|
1
|
+
{"version":3,"file":"OverlayPageHost.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageHost.tsx"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,+BAU/D"}
|
|
@@ -6,6 +6,6 @@ declare const OWNER_ATTRIBUTE = "data-overlay-owner";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function OverlayPageHost({ hostKey }: {
|
|
8
8
|
hostKey: string;
|
|
9
|
-
}): import("react
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
10
|
export { OWNER_ATTRIBUTE as OVERLAY_OWNER_ATTRIBUTE };
|
|
11
11
|
//# sourceMappingURL=OverlayPageHost.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayPageHost.web.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageHost.web.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,eAAe,uBAAuB,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE
|
|
1
|
+
{"version":3,"file":"OverlayPageHost.web.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageHost.web.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,eAAe,uBAAuB,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,+BAqD/D;AAED,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,CAAC"}
|
|
@@ -9,9 +9,9 @@ export declare function useOverlayPageScope(): IOverlayPageScope;
|
|
|
9
9
|
/** Provided once per root route, around its navigator and `OverlayPageHost`. */
|
|
10
10
|
export declare function OverlayPageHostScope({ hostKey, children, }: PropsWithChildren<{
|
|
11
11
|
hostKey: string;
|
|
12
|
-
}>): import("react
|
|
12
|
+
}>): import("react").JSX.Element;
|
|
13
13
|
/** Provided by each page; page overlays below it belong to `ownerKey`. */
|
|
14
14
|
export declare function OverlayPageOwnerScope({ ownerKey, children, }: PropsWithChildren<{
|
|
15
15
|
ownerKey: string;
|
|
16
|
-
}>): import("react
|
|
16
|
+
}>): import("react").JSX.Element;
|
|
17
17
|
//# sourceMappingURL=OverlayPageScope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayPageScope.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageScope.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,wBAAgB,mBAAmB,IAAI,iBAAiB,CAEvD;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAQ,GACT,EAAE,iBAAiB,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC
|
|
1
|
+
{"version":3,"file":"OverlayPageScope.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageScope.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,wBAAgB,mBAAmB,IAAI,iBAAiB,CAEvD;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAQ,GACT,EAAE,iBAAiB,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,+BAOxC;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,+BAQzC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IOverlayViewProps } from './OverlayViewTypes';
|
|
2
|
-
export declare function OverlayView(props: IOverlayViewProps): import("react
|
|
2
|
+
export declare function OverlayView(props: IOverlayViewProps): import("react").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=OverlayView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayView.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverlayView.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAuC5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,sCAoPnD"}
|
|
@@ -77,6 +77,17 @@ export interface IOverlayViewProps {
|
|
|
77
77
|
x: number;
|
|
78
78
|
y: number;
|
|
79
79
|
}) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Native only, non-sheet presentations. Lays the content out at this size
|
|
82
|
+
* instead of the window size JS last saw. The content host clips the
|
|
83
|
+
* content to that frame, and JS hears about a rotation only after the
|
|
84
|
+
* window has rotated: content prepared for the window it is about to rotate
|
|
85
|
+
* into passes the rotated size, so the first rotated frame shows all of it.
|
|
86
|
+
*/
|
|
87
|
+
contentSize?: {
|
|
88
|
+
width: number;
|
|
89
|
+
height: number;
|
|
90
|
+
};
|
|
80
91
|
/** The exit animation finished and the content unmounted. */
|
|
81
92
|
onClose?: (reason: IOverlayDismissReason) => void;
|
|
82
93
|
children?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayViewTypes.d.ts","sourceRoot":"","sources":["../../../src/OverlayViewTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK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AC;IAC7B,mCAAmC;IACnC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,KAAK,CAAC;IACpC,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAClE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5D;;;;;;OAMG;IACH,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Non-sheet content geometry. JS lays the content out at the window size it
|
|
3
|
+
* last saw, and the native content host clips the content to that frame. Right
|
|
4
|
+
* after the window rotates, JS still holds the previous size, so a caller that
|
|
5
|
+
* prepared its content for the window it is about to rotate into passes that
|
|
6
|
+
* size instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveContentSize({ windowWidth, windowHeight, contentSize, }: {
|
|
9
|
+
windowWidth: number;
|
|
10
|
+
windowHeight: number;
|
|
11
|
+
contentSize?: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
}): {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=contentSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contentSize.d.ts","sourceRoot":"","sources":["../../../src/contentSize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-overlay",
|
|
3
|
-
"version": "6.7.0-
|
|
3
|
+
"version": "6.7.0-22",
|
|
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",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"@eslint/compat": "^1.3.2",
|
|
66
66
|
"@eslint/eslintrc": "^3.3.1",
|
|
67
67
|
"@eslint/js": "^9.35.0",
|
|
68
|
-
"@react-native/babel-preset": "0.
|
|
69
|
-
"@react-native/eslint-config": "0.
|
|
68
|
+
"@react-native/babel-preset": "0.88.0",
|
|
69
|
+
"@react-native/eslint-config": "0.88.0",
|
|
70
70
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
71
71
|
"@types/jest": "^29.5.14",
|
|
72
|
-
"@types/react": "^19.
|
|
73
|
-
"@types/react-dom": "19.
|
|
72
|
+
"@types/react": "^19.3.0",
|
|
73
|
+
"@types/react-dom": "19.3.0",
|
|
74
74
|
"commitlint": "^19.8.1",
|
|
75
75
|
"del-cli": "^6.0.0",
|
|
76
76
|
"eslint": "^9.35.0",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"jest-environment-jsdom": "29.7.0",
|
|
81
81
|
"lefthook": "^2.0.3",
|
|
82
82
|
"prettier": "^2.8.8",
|
|
83
|
-
"react": "19.
|
|
84
|
-
"react-dom": "19.
|
|
85
|
-
"react-native": "0.
|
|
83
|
+
"react": "19.3.0",
|
|
84
|
+
"react-dom": "19.3.0",
|
|
85
|
+
"react-native": "patch:react-native@npm%3A0.88.0#~/.yarn/patches/react-native-npm-0.88.0-60c6201dd2.patch",
|
|
86
86
|
"react-native-builder-bob": "^0.40.13",
|
|
87
87
|
"release-it": "^19.0.4",
|
|
88
88
|
"turbo": "^2.5.6",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"useTabs": false
|
|
121
121
|
},
|
|
122
122
|
"jest": {
|
|
123
|
-
"preset": "react-native",
|
|
123
|
+
"preset": "@react-native/jest-preset",
|
|
124
124
|
"modulePathIgnorePatterns": [
|
|
125
125
|
"<rootDir>/example/node_modules",
|
|
126
126
|
"<rootDir>/lib/"
|
package/src/OverlayView.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import NativeOverlay from './NativeOverlayNativeComponent';
|
|
14
14
|
import { OverlayLevelProvider } from './OverlayLevelContext';
|
|
15
15
|
import { isBlockingLevel } from './OverlayLevels';
|
|
16
|
+
import { resolveContentSize } from './contentSize';
|
|
16
17
|
import { resolveSheetWidth } from './sheetWidth';
|
|
17
18
|
import { useOverlayController } from './useOverlayController';
|
|
18
19
|
|
|
@@ -72,6 +73,7 @@ export function OverlayView(props: IOverlayViewProps) {
|
|
|
72
73
|
testID,
|
|
73
74
|
windowOffsetRequest,
|
|
74
75
|
onWindowOffset,
|
|
76
|
+
contentSize,
|
|
75
77
|
} = props;
|
|
76
78
|
// A plain sibling at the host's spot: its JS-measured origin shares the
|
|
77
79
|
// modal-relative space of the caller's measurements, while native reports
|
|
@@ -284,7 +286,14 @@ export function OverlayView(props: IOverlayViewProps) {
|
|
|
284
286
|
<View
|
|
285
287
|
collapsable={false}
|
|
286
288
|
pointerEvents="box-none"
|
|
287
|
-
style={{
|
|
289
|
+
style={{
|
|
290
|
+
...resolveContentSize({
|
|
291
|
+
windowWidth: width,
|
|
292
|
+
windowHeight: height,
|
|
293
|
+
contentSize,
|
|
294
|
+
}),
|
|
295
|
+
flexShrink: 0,
|
|
296
|
+
}}
|
|
288
297
|
>
|
|
289
298
|
<OverlayLevelProvider value={level}>
|
|
290
299
|
{children}
|
package/src/OverlayViewTypes.ts
CHANGED
|
@@ -88,6 +88,14 @@ export interface IOverlayViewProps {
|
|
|
88
88
|
*/
|
|
89
89
|
windowOffsetRequest?: number;
|
|
90
90
|
onWindowOffset?: (offset: { x: number; y: number }) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Native only, non-sheet presentations. Lays the content out at this size
|
|
93
|
+
* instead of the window size JS last saw. The content host clips the
|
|
94
|
+
* content to that frame, and JS hears about a rotation only after the
|
|
95
|
+
* window has rotated: content prepared for the window it is about to rotate
|
|
96
|
+
* into passes the rotated size, so the first rotated frame shows all of it.
|
|
97
|
+
*/
|
|
98
|
+
contentSize?: { width: number; height: number };
|
|
91
99
|
/** The exit animation finished and the content unmounted. */
|
|
92
100
|
onClose?: (reason: IOverlayDismissReason) => void;
|
|
93
101
|
children?: ReactNode;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Non-sheet content geometry. JS lays the content out at the window size it
|
|
3
|
+
* last saw, and the native content host clips the content to that frame. Right
|
|
4
|
+
* after the window rotates, JS still holds the previous size, so a caller that
|
|
5
|
+
* prepared its content for the window it is about to rotate into passes that
|
|
6
|
+
* size instead.
|
|
7
|
+
*/
|
|
8
|
+
export function resolveContentSize({
|
|
9
|
+
windowWidth,
|
|
10
|
+
windowHeight,
|
|
11
|
+
contentSize,
|
|
12
|
+
}: {
|
|
13
|
+
windowWidth: number;
|
|
14
|
+
windowHeight: number;
|
|
15
|
+
contentSize?: { width: number; height: number };
|
|
16
|
+
}): { width: number; height: number } {
|
|
17
|
+
return {
|
|
18
|
+
width: contentSize?.width ?? windowWidth,
|
|
19
|
+
height: contentSize?.height ?? windowHeight,
|
|
20
|
+
};
|
|
21
|
+
}
|