uilib-native 5.0.0-snapshot.7216 → 5.0.0-snapshot.7227
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/components/HighlighterOverlayView/HighlighterViewNativeComponent.js +2 -0
- package/components/HighlighterOverlayView/index.js +1 -1
- package/components/HighlighterOverlayView/index.web.d.ts +1 -1
- package/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.js +1 -1
- package/components/Keyboard/KeyboardTrackingView/KeyboardTrackingViewNativeComponent.js +2 -0
- package/components/SafeArea/SafeAreaInsetsManager.js +4 -1
- package/components/SafeArea/SafeAreaSpacerView.d.ts +2 -2
- package/components/SafeArea/SafeAreaSpacerView.js +8 -11
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/package.json +1 -1
- package/components/SafeArea/index.d.ts +0 -10
- package/components/SafeArea/index.js +0 -11
- package/specs/HighlighterViewNativeComponent.ts +0 -78
- package/specs/KeyboardTrackingViewNativeComponent.ts +0 -74
- /package/{specs → components/HighlighterOverlayView}/HighlighterViewNativeComponent.d.ts +0 -0
- /package/{specs → components/Keyboard/KeyboardTrackingView}/KeyboardTrackingViewNativeComponent.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { processColor, StyleSheet, Modal } from 'react-native';
|
|
3
3
|
// Import the Codegen specification for New Architecture
|
|
4
|
-
import HighlighterViewNativeComponent from "
|
|
4
|
+
import HighlighterViewNativeComponent from "./HighlighterViewNativeComponent";
|
|
5
5
|
const DefaultOverlayColor = 'rgba(0, 0, 0, 0.5)';
|
|
6
6
|
const HighlighterOverlayView = props => {
|
|
7
7
|
const {
|
|
@@ -19,7 +19,7 @@ export type HighlighterOverlayViewProps = {
|
|
|
19
19
|
onRequestClose?: () => void;
|
|
20
20
|
highlightFrame?: HighlightFrameType;
|
|
21
21
|
style?: ViewStyle;
|
|
22
|
-
highlightViewTag?: number;
|
|
22
|
+
highlightViewTag?: number | null;
|
|
23
23
|
children?: JSX.Element[] | JSX.Element;
|
|
24
24
|
highlightViewTagParams?: HighlightViewTagParams;
|
|
25
25
|
minimumRectSize?: Pick<HighlightFrameType, 'width' | 'height'>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import ReactNative, { NativeModules } from 'react-native';
|
|
3
3
|
// Import the Codegen specification for New Architecture
|
|
4
|
-
import KeyboardTrackingViewNativeComponent from "
|
|
4
|
+
import KeyboardTrackingViewNativeComponent from "./KeyboardTrackingViewNativeComponent";
|
|
5
5
|
const KeyboardTrackingViewTempManager = NativeModules.KeyboardTrackingViewTempManager;
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -2,7 +2,7 @@ import _isEqual from "lodash/isEqual";
|
|
|
2
2
|
import _remove from "lodash/remove";
|
|
3
3
|
import _forEach from "lodash/forEach";
|
|
4
4
|
/* eslint no-underscore-dangle: 0 */
|
|
5
|
-
import { NativeModules, DeviceEventEmitter } from 'react-native';
|
|
5
|
+
import { NativeModules, DeviceEventEmitter, Platform } from 'react-native';
|
|
6
6
|
let SafeAreaInsetsCache = null;
|
|
7
7
|
class SafeAreaInsetsManager {
|
|
8
8
|
_defaultInsets = {
|
|
@@ -45,6 +45,9 @@ class SafeAreaInsetsManager {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
setupEventListener() {
|
|
48
|
+
if (Platform.OS !== 'ios') {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
48
51
|
try {
|
|
49
52
|
// Use DeviceEventEmitter instead of NativeEventEmitter to avoid getConstants
|
|
50
53
|
DeviceEventEmitter.addListener('SafeAreaInsetsDidChangeEvent', data => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ViewStyle
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
3
|
export type SafeAreaSpacerViewProps = {
|
|
4
|
-
style?:
|
|
4
|
+
style?: ViewStyle;
|
|
5
5
|
};
|
|
6
6
|
declare const SafeAreaSpacerView: {
|
|
7
7
|
({ style }: SafeAreaSpacerViewProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useCallback, useEffect
|
|
1
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
2
|
import { View, Dimensions } from 'react-native';
|
|
3
3
|
import SafeAreaInsetsManager from "./SafeAreaInsetsManager";
|
|
4
4
|
const SafeAreaSpacerView = ({
|
|
@@ -10,7 +10,6 @@ const SafeAreaSpacerView = ({
|
|
|
10
10
|
bottom: 0,
|
|
11
11
|
right: 0
|
|
12
12
|
});
|
|
13
|
-
const [componentHeight, setComponentHeight] = useState(0);
|
|
14
13
|
const [spacerHeight, setSpacerHeight] = useState(0);
|
|
15
14
|
useEffect(() => {
|
|
16
15
|
const getSafeAreaInsets = async () => {
|
|
@@ -44,24 +43,22 @@ const SafeAreaSpacerView = ({
|
|
|
44
43
|
const {
|
|
45
44
|
y
|
|
46
45
|
} = event.nativeEvent.layout;
|
|
47
|
-
setComponentHeight(y);
|
|
48
|
-
}, []);
|
|
49
|
-
useEffect(() => {
|
|
50
46
|
const screenHeight = Dimensions.get('window').height;
|
|
51
47
|
let height = 0;
|
|
52
48
|
// Check if positioned within safe area bounds
|
|
53
|
-
if (
|
|
49
|
+
if (y < safeAreaInsets.top) {
|
|
54
50
|
height = safeAreaInsets.top;
|
|
55
|
-
} else if (
|
|
51
|
+
} else if (y > screenHeight - safeAreaInsets.bottom) {
|
|
56
52
|
height = safeAreaInsets.bottom;
|
|
57
53
|
}
|
|
58
54
|
if (height !== spacerHeight) {
|
|
59
55
|
setSpacerHeight(height);
|
|
60
56
|
}
|
|
61
|
-
}, [
|
|
62
|
-
const spacerStyle =
|
|
63
|
-
height: spacerHeight
|
|
64
|
-
|
|
57
|
+
}, [safeAreaInsets, spacerHeight]);
|
|
58
|
+
const spacerStyle = {
|
|
59
|
+
height: spacerHeight,
|
|
60
|
+
...style
|
|
61
|
+
};
|
|
65
62
|
return <View style={spacerStyle} onLayout={handleLayout} />;
|
|
66
63
|
};
|
|
67
64
|
SafeAreaSpacerView.displayName = 'SafeAreaSpacerView';
|
package/components/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import DynamicFonts, { FontExtension } from './DynamicFonts';
|
|
2
2
|
import HighlighterOverlayView from './HighlighterOverlayView';
|
|
3
|
-
import SafeAreaSpacerView from './SafeArea';
|
|
3
|
+
import SafeAreaSpacerView from './SafeArea/SafeAreaSpacerView';
|
|
4
4
|
import SafeAreaInsetsManager from './SafeArea/SafeAreaInsetsManager';
|
|
5
5
|
import Keyboard, { KeyboardTrackingViewProps, KeyboardAccessoryViewProps } from './Keyboard';
|
|
6
6
|
export { DynamicFonts, FontExtension, HighlighterOverlayView, SafeAreaSpacerView, SafeAreaInsetsManager, Keyboard, KeyboardTrackingViewProps, KeyboardAccessoryViewProps };
|
package/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import DynamicFonts, { FontExtension } from "./DynamicFonts";
|
|
2
2
|
import HighlighterOverlayView from "./HighlighterOverlayView";
|
|
3
|
-
import SafeAreaSpacerView from "./SafeArea";
|
|
3
|
+
import SafeAreaSpacerView from "./SafeArea/SafeAreaSpacerView";
|
|
4
4
|
import SafeAreaInsetsManager from "./SafeArea/SafeAreaInsetsManager";
|
|
5
5
|
import Keyboard, { KeyboardTrackingViewProps, KeyboardAccessoryViewProps } from "./Keyboard";
|
|
6
6
|
export { DynamicFonts, FontExtension, HighlighterOverlayView, SafeAreaSpacerView, SafeAreaInsetsManager, Keyboard, KeyboardTrackingViewProps, KeyboardAccessoryViewProps };
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ViewStyle, StyleProp } from 'react-native';
|
|
3
|
-
export type SafeAreaSpacerViewProps = {
|
|
4
|
-
style?: StyleProp<ViewStyle>;
|
|
5
|
-
};
|
|
6
|
-
declare const SafeAreaSpacerView: {
|
|
7
|
-
({ style }: SafeAreaSpacerViewProps): React.JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
};
|
|
10
|
-
export default SafeAreaSpacerView;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Platform } from 'react-native';
|
|
3
|
-
import SafeAreaSpacerViewIos from "./SafeAreaSpacerView";
|
|
4
|
-
const isIOS = Platform.OS === 'ios';
|
|
5
|
-
const SafeAreaSpacerView = ({
|
|
6
|
-
style
|
|
7
|
-
}) => {
|
|
8
|
-
return isIOS ? <SafeAreaSpacerViewIos style={style} /> : <View style={style} />;
|
|
9
|
-
};
|
|
10
|
-
SafeAreaSpacerView.displayName = 'SafeAreaSpacerView';
|
|
11
|
-
export default SafeAreaSpacerView;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type {ViewProps} from 'react-native';
|
|
2
|
-
// import {requireNativeComponent, type ViewProps} from 'react-native';
|
|
3
|
-
import type {Float, Int32, WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
5
|
-
|
|
6
|
-
export interface HighlightFrame {
|
|
7
|
-
x: Float;
|
|
8
|
-
y: Float;
|
|
9
|
-
width: Float;
|
|
10
|
-
height: Float;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface MinimumRectSize {
|
|
14
|
-
width: Float;
|
|
15
|
-
height: Float;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface HighlightViewTagParams {
|
|
19
|
-
paddingLeft?: WithDefault<Float, 0>;
|
|
20
|
-
paddingTop?: WithDefault<Float, 0>;
|
|
21
|
-
paddingRight?: WithDefault<Float, 0>;
|
|
22
|
-
paddingBottom?: WithDefault<Float, 0>;
|
|
23
|
-
offsetX?: WithDefault<Float, 0>;
|
|
24
|
-
offsetY?: WithDefault<Float, 0>;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface NativeProps extends ViewProps {
|
|
28
|
-
/**
|
|
29
|
-
* The frame to highlight with x, y, width, height coordinates
|
|
30
|
-
*/
|
|
31
|
-
highlightFrame?: HighlightFrame;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The overlay color (processed color int for Android)
|
|
35
|
-
*/
|
|
36
|
-
overlayColor?: WithDefault<Int32, 0>;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The border radius for the highlighted area
|
|
40
|
-
*/
|
|
41
|
-
borderRadius?: WithDefault<Float, 0>;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The stroke color (processed color int for Android)
|
|
45
|
-
*/
|
|
46
|
-
strokeColor?: WithDefault<Int32, 0>;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* The stroke width
|
|
50
|
-
*/
|
|
51
|
-
strokeWidth?: WithDefault<Float, 0>;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The React tag of the view to highlight
|
|
55
|
-
*/
|
|
56
|
-
highlightViewTag?: Int32;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Parameters for view-based highlighting including padding and offset
|
|
60
|
-
*/
|
|
61
|
-
highlightViewTagParams?: HighlightViewTagParams;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Minimum rectangle size for the highlight area
|
|
65
|
-
*/
|
|
66
|
-
minimumRectSize?: MinimumRectSize;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Inner padding for the highlight area
|
|
70
|
-
*/
|
|
71
|
-
innerPadding?: WithDefault<Float, 0>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default codegenNativeComponent<NativeProps>('HighlighterView');
|
|
75
|
-
|
|
76
|
-
// const HighlighterViewNativeComponent = requireNativeComponent<NativeProps>('HighlighterView');
|
|
77
|
-
|
|
78
|
-
// export default HighlighterViewNativeComponent;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type {ViewProps} from 'react-native';
|
|
2
|
-
// import {requireNativeComponent, type ViewProps} from 'react-native';
|
|
3
|
-
import type {Int32, WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
5
|
-
|
|
6
|
-
export interface NativeProps extends ViewProps {
|
|
7
|
-
/**
|
|
8
|
-
* Enables tracking of the keyboard when it's dismissed interactively (false by default).
|
|
9
|
-
*/
|
|
10
|
-
trackInteractive?: WithDefault<boolean, false>;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* iOS only.
|
|
14
|
-
* Show the keyboard on a negative scroll
|
|
15
|
-
*/
|
|
16
|
-
revealKeyboardInteractive?: WithDefault<boolean, false>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* iOS only.
|
|
20
|
-
* Set to false to turn off inset management and manage it yourself
|
|
21
|
-
*/
|
|
22
|
-
manageScrollView?: WithDefault<boolean, true>;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* iOS only.
|
|
26
|
-
* Set to true manageScrollView is set to true and still does not work
|
|
27
|
-
*/
|
|
28
|
-
requiresSameParentToManageScrollView?: WithDefault<boolean, false>;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* iOS only.
|
|
32
|
-
* Allow hitting sub-views that are placed beyond the view bounds
|
|
33
|
-
*/
|
|
34
|
-
allowHitsOutsideBounds?: WithDefault<boolean, false>;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Should the scrollView scroll to the focused input
|
|
38
|
-
*/
|
|
39
|
-
scrollToFocusedInput?: WithDefault<boolean, false>;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* iOS only.
|
|
43
|
-
* The scrolling behavior (NONE | SCROLL_TO_BOTTOM_INVERTED_ONLY | FIXED_OFFSET)
|
|
44
|
-
*/
|
|
45
|
-
scrollBehavior?: WithDefault<Int32, 0>;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* iOS only.
|
|
49
|
-
* Add a SafeArea view beneath the KeyboardAccessoryView
|
|
50
|
-
*/
|
|
51
|
-
addBottomView?: WithDefault<boolean, false>;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* iOS only.
|
|
55
|
-
* The bottom view's color
|
|
56
|
-
*/
|
|
57
|
-
bottomViewColor?: string;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Allow control safe area
|
|
61
|
-
*/
|
|
62
|
-
useSafeArea?: WithDefault<boolean, false>;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Whether or not to include bottom tab bar inset
|
|
66
|
-
*/
|
|
67
|
-
usesBottomTabs?: WithDefault<boolean, false>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default codegenNativeComponent<NativeProps>('KeyboardTrackingViewTemp');
|
|
71
|
-
|
|
72
|
-
// const KeyboardTrackingViewNativeComponent = requireNativeComponent<NativeProps>('KeyboardTrackingViewTemp');
|
|
73
|
-
|
|
74
|
-
// export default KeyboardTrackingViewNativeComponent;
|
|
File without changes
|
/package/{specs → components/Keyboard/KeyboardTrackingView}/KeyboardTrackingViewNativeComponent.d.ts
RENAMED
|
File without changes
|