react-native-popover-view
Advanced tools
Comparing version 5.1.9 to 6.0.0
{ | ||
"name": "react-native-popover-view", | ||
"version": "5.1.9", | ||
"version": "6.0.0", | ||
"description": "A <Popover /> component for react-native iOS, Android, and Web", | ||
@@ -66,5 +66,6 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"prop-types": "^15.8.1", | ||
"deprecated-react-native-prop-types": "^2.3.0" | ||
} | ||
} | ||
"deprecated-react-native-prop-types": "^2.3.0", | ||
"prop-types": "^15.8.1" | ||
}, | ||
"packageManager": "yarn@4.5.3" | ||
} |
@@ -342,4 +342,3 @@ ## react-native-popover-view | ||
displayAreaInsets | object | | Insets to apply to the display area. The Popover will not be allowed to go beyond the display area minus the insets. | ||
statusBarTranslucent | bool | | For 'rn-modal' mode on Android only. Determines whether the background should go under the status bar. Passed through to RN `Modal` component, see [their docs](https://reactnative.dev/docs/modal#statusbartranslucent-1) as well. | ||
verticalOffset | number | 0 | The amount to vertically shift the popover on the screen, for use in correcting an occasional issue on Android. In certain Android configurations, you may need to apply a `verticalOffset` of `-StatusBar.currentHeight` for the popover to originate from the correct place. For shifting the popover in other situations, the `offset` prop should be used. | ||
statusBarTranslucent | bool | true | For 'rn-modal' mode on Android only. Determines whether the background should go under the status bar. Passed through to RN `Modal` component, see [their docs](https://reactnative.dev/docs/modal#statusbartranslucent-1) as well. | ||
debug | bool | false | Set this to `true` to turn on debug logging to the console. This is useful for figuring out why a Popover isn't showing. | ||
@@ -413,16 +412,2 @@ | ||
#### Android vertical positioning incorrect | ||
Depending on how your app is configured, you may need to use the following `verticalOffset` prop to correctly position the popover on Android: | ||
``` | ||
import { Platform, StatusBar, ... } from 'react-native'; | ||
... | ||
<Popover | ||
{...otherProps} | ||
verticalOffset={Platform.OS === 'android' ? -StatusBar.currentHeight : 0 } | ||
/> | ||
``` | ||
#### Error when passing a functional component to the `from` prop | ||
@@ -485,2 +470,4 @@ | ||
There's a separate package, [react-native-popover-view-test-app](https://github.com/SteffeyDev/react-native-popover-view-test-app) that can be used during development. In the package, there's a script, (`./transfer`) that you can adapt to help copy the dist files from this project to the test app while watching for changes. | ||
## <a name="credits"/>Credits | ||
@@ -487,0 +474,0 @@ |
@@ -8,2 +8,3 @@ import { Dimensions, Platform, StyleSheet } from 'react-native'; | ||
export const DEFAULT_BORDER_RADIUS = 3; | ||
export const DEFAULT_STATUS_BAR_TRANSLUCENT = true; | ||
export const POPOVER_MARGIN = 10; | ||
@@ -10,0 +11,0 @@ |
@@ -42,3 +42,2 @@ import { Animated, StyleProp, ViewStyle } from 'react-native'; | ||
offset?: number; | ||
verticalOffset?: number; | ||
displayArea?: Rect; | ||
@@ -53,2 +52,3 @@ displayAreaInsets?: Insets; | ||
arrowSize?: Size; | ||
statusBarTranslucent?: boolean; | ||
@@ -55,0 +55,0 @@ // lifecycle |
@@ -1,9 +0,9 @@ | ||
import { RefObject, ComponentClass, Component } from 'react'; | ||
import { NativeModules, findNodeHandle, StyleProp, ViewStyle, StyleSheet } from 'react-native'; | ||
import { RefObject } from 'react'; | ||
import { MeasureInWindowOnSuccessCallback, StyleProp, ViewStyle, StyleSheet } from 'react-native'; | ||
import { Placement, Point, Rect, Size } from './Types'; | ||
import { DEFAULT_ARROW_SIZE, DEFAULT_BORDER_RADIUS } from './Constants'; | ||
// Need any here to match signature of findNodeHandle | ||
// eslint-disable-next-line | ||
type RefType = RefObject<number | Component<any, any, any> | ComponentClass<any, any> | null>; | ||
type RefType = RefObject<{ | ||
measureInWindow: (callback: MeasureInWindowOnSuccessCallback) => void | ||
}>; | ||
@@ -13,5 +13,4 @@ export function getRectForRef(ref: RefType): Promise<Rect> { | ||
if (ref.current) { | ||
NativeModules.UIManager.measure( | ||
findNodeHandle(ref.current), | ||
(_1: unknown, _2: unknown, width: number, height: number, x: number, y: number) => | ||
ref.current.measureInWindow( | ||
(x: number, y: number, width: number, height: number) => | ||
resolve(new Rect(x, y, width, height)) | ||
@@ -18,0 +17,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
308372
4783
53
1
482
1
1