@onekeyfe/react-native-native-overlay 6.7.0-alpha.464 → 6.7.0-alpha.475
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/main/java/com/onekey/nativeoverlay/NativeOverlayPageHostView.kt +14 -3
- package/android/src/test/java/com/onekey/nativeoverlay/NativeOverlayPageHostLayoutTest.kt +58 -0
- package/docs/SPEC.md +18 -0
- package/lib/module/OverlayView.js +11 -1
- package/lib/module/OverlayView.js.map +1 -1
- package/lib/typescript/src/OverlayView.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/OverlayView.tsx +10 -0
|
@@ -80,7 +80,7 @@ class NativeOverlayPageHostView(context: Context) : ViewGroup(context), ReactPoi
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
private var layoutScheduled = false
|
|
83
|
-
private val layoutRunnable = Runnable {
|
|
83
|
+
private val layoutRunnable: Runnable? = Runnable {
|
|
84
84
|
layoutScheduled = false
|
|
85
85
|
layoutEntries()
|
|
86
86
|
}
|
|
@@ -92,14 +92,25 @@ class NativeOverlayPageHostView(context: Context) : ViewGroup(context), ReactPoi
|
|
|
92
92
|
*/
|
|
93
93
|
override fun requestLayout() {
|
|
94
94
|
super.requestLayout()
|
|
95
|
+
// View construction can request layout before this callback is initialized.
|
|
96
|
+
val runnable = layoutRunnable ?: return
|
|
95
97
|
if (!layoutScheduled) {
|
|
96
98
|
layoutScheduled = true
|
|
97
|
-
post(
|
|
99
|
+
post(runnable)
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
private fun layoutEntries() {
|
|
102
|
-
|
|
104
|
+
if (width <= 0 || height <= 0) return
|
|
105
|
+
// Run the host's layout lifecycle to clear FORCE_LAYOUT, so later child
|
|
106
|
+
// requests can reach this host through a Fabric-managed parent.
|
|
107
|
+
// Force another pass even when attach() reuses an existing child.
|
|
108
|
+
forceLayout()
|
|
109
|
+
measure(
|
|
110
|
+
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
|
|
111
|
+
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY),
|
|
112
|
+
)
|
|
113
|
+
layout(left, top, right, bottom)
|
|
103
114
|
}
|
|
104
115
|
|
|
105
116
|
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
package com.onekey.nativeoverlay
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import android.os.Looper
|
|
5
|
+
import android.view.View
|
|
6
|
+
import androidx.activity.ComponentActivity
|
|
7
|
+
import com.facebook.react.bridge.BridgeReactContext
|
|
8
|
+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
10
|
+
import com.facebook.react.views.view.ReactViewGroup
|
|
11
|
+
import org.junit.Assert.assertEquals
|
|
12
|
+
import org.junit.Assert.assertFalse
|
|
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.Shadows
|
|
18
|
+
import org.robolectric.annotation.Config
|
|
19
|
+
import java.time.Duration
|
|
20
|
+
|
|
21
|
+
@RunWith(RobolectricTestRunner::class)
|
|
22
|
+
@Config(sdk = [34])
|
|
23
|
+
class NativeOverlayPageHostLayoutTest {
|
|
24
|
+
@Test
|
|
25
|
+
fun pageSheetTracksHeightChangesAfterAttachInsideFabricParent() {
|
|
26
|
+
ReactNativeFeatureFlagsForTests.setUp()
|
|
27
|
+
val activity = Robolectric.buildActivity(ComponentActivity::class.java).setup().visible().get()
|
|
28
|
+
val reactContext = BridgeReactContext(activity)
|
|
29
|
+
val context = ThemedReactContext(reactContext, activity, "PageHostLayoutTest", 1)
|
|
30
|
+
val parent = ReactViewGroup(context)
|
|
31
|
+
val host = NativeOverlayPageHostView(context)
|
|
32
|
+
parent.addView(host)
|
|
33
|
+
activity.setContentView(parent)
|
|
34
|
+
val widthSpec = View.MeasureSpec.makeMeasureSpec(400, View.MeasureSpec.EXACTLY)
|
|
35
|
+
val heightSpec = View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY)
|
|
36
|
+
host.measure(widthSpec, heightSpec)
|
|
37
|
+
host.layout(0, 0, 400, 1000)
|
|
38
|
+
val entry = NativeOverlayEntryRootView(context)
|
|
39
|
+
entry.configureSheet(200, 24f, Color.WHITE, false, true)
|
|
40
|
+
|
|
41
|
+
host.attach(entry)
|
|
42
|
+
Shadows.shadowOf(Looper.getMainLooper()).idleFor(Duration.ofMillis(100))
|
|
43
|
+
val sheet = entry.sheetView!!
|
|
44
|
+
assertEquals(entry.sheetHeightPx(), sheet.height)
|
|
45
|
+
assertEquals(1000 - entry.sheetHeightPx(), sheet.top)
|
|
46
|
+
|
|
47
|
+
entry.configureSheet(600, 24f, Color.WHITE, false, true)
|
|
48
|
+
Shadows.shadowOf(Looper.getMainLooper()).idleFor(Duration.ofMillis(100))
|
|
49
|
+
assertEquals(entry.sheetHeightPx(), sheet.height)
|
|
50
|
+
assertEquals(1000 - entry.sheetHeightPx(), sheet.top)
|
|
51
|
+
assertFalse(host.isLayoutRequested)
|
|
52
|
+
|
|
53
|
+
entry.configureSheet(320, 24f, Color.WHITE, false, true)
|
|
54
|
+
Shadows.shadowOf(Looper.getMainLooper()).idleFor(Duration.ofMillis(100))
|
|
55
|
+
assertEquals(entry.sheetHeightPx(), sheet.height)
|
|
56
|
+
assertEquals(1000 - entry.sheetHeightPx(), sheet.top)
|
|
57
|
+
}
|
|
58
|
+
}
|
package/docs/SPEC.md
CHANGED
|
@@ -464,6 +464,11 @@ Max-width sheet (`sheet.maxWidth`, default 540):
|
|
|
464
464
|
background.
|
|
465
465
|
- In compact windows the sheet is never wider than `maxWidth`, so the
|
|
466
466
|
max-width sheet and the full-width sheet are identical there.
|
|
467
|
+
- The drawn surface continues below the fitted content with a safe-area tail.
|
|
468
|
+
The tail renders behind the content surface and overlaps it by a small
|
|
469
|
+
amount, so the fractional boundary between the two views cannot antialias
|
|
470
|
+
into a hairline on scaled renders (Simulator windows, screenshots, screen
|
|
471
|
+
recordings).
|
|
467
472
|
|
|
468
473
|
Width changes while open (rotation, folding, window resize):
|
|
469
474
|
|
|
@@ -665,6 +670,10 @@ Automated (P0):
|
|
|
665
670
|
old-parent transition completion after the move, and reopen during exit.
|
|
666
671
|
It also covers Fabric removal of staged content and replacement of presented
|
|
667
672
|
content during a transition, including layout-listener cleanup.
|
|
673
|
+
- `NativeOverlayPageHostLayoutTest` places the Android page host below an
|
|
674
|
+
actual `ReactViewGroup` and checks a sheet at 200, 600 and 320 px after
|
|
675
|
+
attachment. Height changes MUST relayout and bottom-pin the sheet without
|
|
676
|
+
a Fabric host-size update, and leave no pending host layout flag.
|
|
668
677
|
- `src/__tests__/pageIsolation.web.test.ts` mounts a real React portal in a
|
|
669
678
|
DOM host and verifies late suspension, level ordering and restoration after
|
|
670
679
|
the blocking entry is removed.
|
|
@@ -735,6 +744,15 @@ P3 page scope notes:
|
|
|
735
744
|
- iOS page sheets are drawn by the entry (bottom-pinned content view, pan to
|
|
736
745
|
close) because UIKit sheets always cover the window. Android and Web reuse
|
|
737
746
|
their global sheet implementation inside the page host.
|
|
747
|
+
- Android page hosts MUST complete their own measure/layout lifecycle after
|
|
748
|
+
native child layout requests. This clears the pending host layout flag so
|
|
749
|
+
later descendant requests can reach the host through Fabric-managed parents.
|
|
750
|
+
Scheduling MUST remain available when View construction requests layout
|
|
751
|
+
before the callback is initialized. Fitted sheets follow settled content
|
|
752
|
+
height changes in both directions. Runtime verified in app-monorepo 6.7.0
|
|
753
|
+
with a locally rebuilt shell on a Pixel 10 Pro API 37 emulator: the referral
|
|
754
|
+
form and Apply button remain visible after loading, error text grows the
|
|
755
|
+
sheet, and clearing the error restores its height.
|
|
738
756
|
- Android back also resolves page entries: global overlays first, then the
|
|
739
757
|
topmost visible page overlay.
|
|
740
758
|
- A declarative page overlay waits for a resolvable host and owner; it never
|
|
@@ -14,6 +14,13 @@ const DEFAULT_SHEET_MAX_RATIO = 0.92;
|
|
|
14
14
|
const DEFAULT_SHEET_CORNER_RADIUS = 24;
|
|
15
15
|
// Taller than any bottom safe area; the sheet clips the rest.
|
|
16
16
|
const SHEET_SURFACE_TAIL_HEIGHT = 120;
|
|
17
|
+
// The tail is a second drawn view under the content surface. Both edges sit on
|
|
18
|
+
// the fitted sheet's fractional height, so each edge antialiases against the
|
|
19
|
+
// transparent platform sheet and their coverages do not add up to one; the
|
|
20
|
+
// seam shows as a hairline once the frame is scaled (Simulator window,
|
|
21
|
+
// screenshots, screen recordings). Pull the tail up behind the opaque surface
|
|
22
|
+
// (it renders first) so the boundary always lands on a painted pixel.
|
|
23
|
+
const SHEET_SURFACE_TAIL_OVERLAP = 2;
|
|
17
24
|
const REQUEST_REASONS = {
|
|
18
25
|
back: 'back',
|
|
19
26
|
backdrop: 'backdrop',
|
|
@@ -49,10 +56,13 @@ const styles = StyleSheet.create({
|
|
|
49
56
|
},
|
|
50
57
|
// The platform sheet extends below the content (home indicator area); the
|
|
51
58
|
// drawn surface continues into it so no backdrop shows under the content.
|
|
59
|
+
// It starts slightly above the surface bottom so the fractional boundary
|
|
60
|
+
// between the two views can never leave an unpainted row.
|
|
52
61
|
sheetSurfaceTail: {
|
|
53
62
|
position: 'absolute',
|
|
54
63
|
top: '100%',
|
|
55
|
-
height: SHEET_SURFACE_TAIL_HEIGHT
|
|
64
|
+
height: SHEET_SURFACE_TAIL_HEIGHT,
|
|
65
|
+
marginTop: -SHEET_SURFACE_TAIL_OVERLAP
|
|
56
66
|
}
|
|
57
67
|
});
|
|
58
68
|
export function OverlayView(props) {
|
|
@@ -1 +1 @@
|
|
|
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,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;
|
|
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","SHEET_SURFACE_TAIL_OVERLAP","REQUEST_REASONS","back","backdrop","pan","styles","create","host","position","top","left","width","sheetMarginLeft","bottom","sheetMarginRight","right","sheetSurface","borderCurve","overflow","flexGrow","sheetSurfaceTail","height","marginTop","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,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;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,CAAC;AAEpC,MAAMC,eAA6D,GAAG;EACpEC,IAAI,EAAE,MAAM;EACZC,QAAQ,E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CA;QAAQ,CACW;MAAC,CACnB;IACP,CACY,CAAC;EAAA,CAChB,CAAC;AAEP","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayView.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"OverlayView.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAiD5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,sCAoPnD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-overlay",
|
|
3
|
-
"version": "6.7.0-alpha.
|
|
3
|
+
"version": "6.7.0-alpha.475",
|
|
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",
|
package/src/OverlayView.tsx
CHANGED
|
@@ -29,6 +29,13 @@ const DEFAULT_SHEET_MAX_RATIO = 0.92;
|
|
|
29
29
|
const DEFAULT_SHEET_CORNER_RADIUS = 24;
|
|
30
30
|
// Taller than any bottom safe area; the sheet clips the rest.
|
|
31
31
|
const SHEET_SURFACE_TAIL_HEIGHT = 120;
|
|
32
|
+
// The tail is a second drawn view under the content surface. Both edges sit on
|
|
33
|
+
// the fitted sheet's fractional height, so each edge antialiases against the
|
|
34
|
+
// transparent platform sheet and their coverages do not add up to one; the
|
|
35
|
+
// seam shows as a hairline once the frame is scaled (Simulator window,
|
|
36
|
+
// screenshots, screen recordings). Pull the tail up behind the opaque surface
|
|
37
|
+
// (it renders first) so the boundary always lands on a painted pixel.
|
|
38
|
+
const SHEET_SURFACE_TAIL_OVERLAP = 2;
|
|
32
39
|
|
|
33
40
|
const REQUEST_REASONS: Record<string, IOverlayRequestDismissReason> = {
|
|
34
41
|
back: 'back',
|
|
@@ -52,10 +59,13 @@ const styles = StyleSheet.create({
|
|
|
52
59
|
sheetSurface: { borderCurve: 'continuous', overflow: 'hidden', flexGrow: 1 },
|
|
53
60
|
// The platform sheet extends below the content (home indicator area); the
|
|
54
61
|
// drawn surface continues into it so no backdrop shows under the content.
|
|
62
|
+
// It starts slightly above the surface bottom so the fractional boundary
|
|
63
|
+
// between the two views can never leave an unpainted row.
|
|
55
64
|
sheetSurfaceTail: {
|
|
56
65
|
position: 'absolute',
|
|
57
66
|
top: '100%',
|
|
58
67
|
height: SHEET_SURFACE_TAIL_HEIGHT,
|
|
68
|
+
marginTop: -SHEET_SURFACE_TAIL_OVERLAP,
|
|
59
69
|
},
|
|
60
70
|
});
|
|
61
71
|
|