@onekeyfe/react-native-native-overlay 6.7.0-alpha.390 → 6.7.0-alpha.392
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/docs/SPEC.md
CHANGED
|
@@ -382,6 +382,10 @@ Max-width sheet (`sheet.maxWidth`, default 540):
|
|
|
382
382
|
iOS the UIKit sheet itself keeps whatever width UIKit gives it but renders
|
|
383
383
|
transparent (no background color, background effect or shadow), so the
|
|
384
384
|
surface looks the same however wide UIKit makes the sheet.
|
|
385
|
+
- Without `sheet.backgroundColor`, both the drawn content surface and its
|
|
386
|
+
bottom safe-area tail keep the native default: iOS `systemBackground` or
|
|
387
|
+
Android's theme `colorBackground`. Explicit colors, including transparent,
|
|
388
|
+
take precedence. The platform sheet remains transparent beside the surface.
|
|
385
389
|
- The side margins behave as backdrop for taps: a tap there follows
|
|
386
390
|
`dismissOnBackdropPress`, and the margins are hidden from accessibility.
|
|
387
391
|
Known divergence: on iOS and Android the platform sheet owns the drag, so a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
4
|
-
import { Pressable, StatusBar, StyleSheet, View, useWindowDimensions } from 'react-native';
|
|
4
|
+
import { Platform, PlatformColor, Pressable, StatusBar, StyleSheet, View, useWindowDimensions } from 'react-native';
|
|
5
5
|
import NativeOverlay from './NativeOverlayNativeComponent';
|
|
6
6
|
import { OverlayLevelProvider } from "./OverlayLevelContext.js";
|
|
7
7
|
import { isBlockingLevel } from "./OverlayLevels.js";
|
|
@@ -120,6 +120,7 @@ export function OverlayView(props) {
|
|
|
120
120
|
// `maxWidth` turns on the drawn surface even while it spans the whole sheet,
|
|
121
121
|
// so a width change never swaps who paints the background.
|
|
122
122
|
const hasSheetSurface = isSheet && sheet?.maxWidth !== undefined;
|
|
123
|
+
const sheetSurfaceBackgroundColor = sheet?.backgroundColor ?? PlatformColor(Platform.OS === 'ios' ? 'systemBackground' : '?android:attr/colorBackground');
|
|
123
124
|
const dismissOnBackdropPress = backdrop ? !!backdrop.dismissOnPress : false;
|
|
124
125
|
const onSheetMarginPress = useCallback(() => {
|
|
125
126
|
// The margins beside a max-width surface stand in for the backdrop.
|
|
@@ -220,11 +221,11 @@ export function OverlayView(props) {
|
|
|
220
221
|
style: [styles.sheetSurfaceTail, {
|
|
221
222
|
left: sheetInset,
|
|
222
223
|
right: sheetInset,
|
|
223
|
-
backgroundColor:
|
|
224
|
+
backgroundColor: sheetSurfaceBackgroundColor
|
|
224
225
|
}]
|
|
225
226
|
}), /*#__PURE__*/_jsx(View, {
|
|
226
227
|
style: [styles.sheetSurface, {
|
|
227
|
-
backgroundColor:
|
|
228
|
+
backgroundColor: sheetSurfaceBackgroundColor,
|
|
228
229
|
borderTopLeftRadius: sheet?.cornerRadius ?? DEFAULT_SHEET_CORNER_RADIUS,
|
|
229
230
|
borderTopRightRadius: sheet?.cornerRadius ?? DEFAULT_SHEET_CORNER_RADIUS
|
|
230
231
|
}],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","useRef","useState","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","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","
|
|
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,GAAGtB,UAAU,CAACuB,MAAM,CAAC;EAC/B;EACA;EACA;EACA;EACAC,IAAI,EAAE;IACJC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;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HkH,KAAK,EAAE,CACL7F,MAAM,CAACe,gBAAgB,EACvB;cACEV,IAAI,EAAEuD,UAAU;cAChBlD,KAAK,EAAEkD,UAAU;cACjBO,eAAe,EAAED;YACnB,CAAC;UACD,CACH,CAAC,eACF/E,IAAA,CAACR,IAAI;YACHkH,KAAK,EAAE,CACL7F,MAAM,CAACW,YAAY,EACnB;cACEwD,eAAe,EAAED,2BAA2B;cAC5C8C,mBAAmB,EACjBzF,KAAK,EAAE6E,YAAY,IAAI1G,2BAA2B;cACpDuH,oBAAoB,EAClB1F,KAAK,EAAE6E,YAAY,IAAI1G;YAC3B,CAAC,CACD;YAAAgC,QAAA,eAEFvC,IAAA,CAACL,oBAAoB;cAACoI,KAAK,EAAE/F,KAAM;cAAAO,QAAA,EAChCA;YAAQ,CACW;UAAC,CACnB,CAAC;QAAA,CACP,CAAC,gBAEHvC,IAAA,CAACL,oBAAoB;UAACoI,KAAK,EAAE/F,KAAM;UAAAO,QAAA,EAChCA;QAAQ,CACW;MACvB,CACG,CAAC,gBAEPvC,IAAA,CAACR,IAAI;QACHgH,WAAW,EAAE,KAAM;QACnBC,aAAa,EAAC,UAAU;QACxBC,KAAK,EAAE;UAAEvF,KAAK;UAAEU,MAAM;UAAE4F,UAAU,EAAE;QAAE,CAAE;QAAAlF,QAAA,eAExCvC,IAAA,CAACL,oBAAoB;UAACoI,KAAK,EAAE/F,KAAM;UAAAO,QAAA,EAChCA;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":"
|
|
1
|
+
{"version":3,"file":"OverlayView.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAuC5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,kDA4OnD"}
|
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.392",
|
|
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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
Platform,
|
|
5
|
+
PlatformColor,
|
|
4
6
|
Pressable,
|
|
5
7
|
StatusBar,
|
|
6
8
|
StyleSheet,
|
|
@@ -115,6 +117,13 @@ export function OverlayView(props: IOverlayViewProps) {
|
|
|
115
117
|
// `maxWidth` turns on the drawn surface even while it spans the whole sheet,
|
|
116
118
|
// so a width change never swaps who paints the background.
|
|
117
119
|
const hasSheetSurface = isSheet && sheet?.maxWidth !== undefined;
|
|
120
|
+
const sheetSurfaceBackgroundColor =
|
|
121
|
+
sheet?.backgroundColor ??
|
|
122
|
+
PlatformColor(
|
|
123
|
+
Platform.OS === 'ios'
|
|
124
|
+
? 'systemBackground'
|
|
125
|
+
: '?android:attr/colorBackground'
|
|
126
|
+
);
|
|
118
127
|
const dismissOnBackdropPress = backdrop ? !!backdrop.dismissOnPress : false;
|
|
119
128
|
const onSheetMarginPress = useCallback(() => {
|
|
120
129
|
// The margins beside a max-width surface stand in for the backdrop.
|
|
@@ -244,7 +253,7 @@ export function OverlayView(props: IOverlayViewProps) {
|
|
|
244
253
|
{
|
|
245
254
|
left: sheetInset,
|
|
246
255
|
right: sheetInset,
|
|
247
|
-
backgroundColor:
|
|
256
|
+
backgroundColor: sheetSurfaceBackgroundColor,
|
|
248
257
|
},
|
|
249
258
|
]}
|
|
250
259
|
/>
|
|
@@ -252,7 +261,7 @@ export function OverlayView(props: IOverlayViewProps) {
|
|
|
252
261
|
style={[
|
|
253
262
|
styles.sheetSurface,
|
|
254
263
|
{
|
|
255
|
-
backgroundColor:
|
|
264
|
+
backgroundColor: sheetSurfaceBackgroundColor,
|
|
256
265
|
borderTopLeftRadius:
|
|
257
266
|
sheet?.cornerRadius ?? DEFAULT_SHEET_CORNER_RADIUS,
|
|
258
267
|
borderTopRightRadius:
|