react-native-ui-lib 7.44.0-snapshot.7216 → 7.44.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/babel.config.js CHANGED
@@ -1,17 +1,5 @@
1
1
  module.exports = {
2
2
  presets: ['module:@react-native/babel-preset'],
3
- env: {
4
- test: {
5
- presets: [
6
- [
7
- 'module:@react-native/babel-preset',
8
- {
9
- disableStaticViewConfigsCodegen: true
10
- }
11
- ]
12
- ]
13
- }
14
- },
15
3
  plugins: [
16
4
  'react-native-reanimated/plugin',
17
5
  [
@@ -0,0 +1,61 @@
1
+ /// <reference types="react-native/types/modules/codegen" />
2
+ import type { ViewProps } from 'react-native';
3
+ import type { Float, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
4
+ export interface HighlightFrame {
5
+ x: Float;
6
+ y: Float;
7
+ width: Float;
8
+ height: Float;
9
+ }
10
+ export interface MinimumRectSize {
11
+ width: Float;
12
+ height: Float;
13
+ }
14
+ export interface HighlightViewTagParams {
15
+ paddingLeft?: WithDefault<Float, 0>;
16
+ paddingTop?: WithDefault<Float, 0>;
17
+ paddingRight?: WithDefault<Float, 0>;
18
+ paddingBottom?: WithDefault<Float, 0>;
19
+ offsetX?: WithDefault<Float, 0>;
20
+ offsetY?: WithDefault<Float, 0>;
21
+ }
22
+ export interface NativeProps extends ViewProps {
23
+ /**
24
+ * The frame to highlight with x, y, width, height coordinates
25
+ */
26
+ highlightFrame?: HighlightFrame;
27
+ /**
28
+ * The overlay color (processed color int for Android)
29
+ */
30
+ overlayColor?: WithDefault<Int32, 0>;
31
+ /**
32
+ * The border radius for the highlighted area
33
+ */
34
+ borderRadius?: WithDefault<Float, 0>;
35
+ /**
36
+ * The stroke color (processed color int for Android)
37
+ */
38
+ strokeColor?: WithDefault<Int32, 0>;
39
+ /**
40
+ * The stroke width
41
+ */
42
+ strokeWidth?: WithDefault<Float, 0>;
43
+ /**
44
+ * The React tag of the view to highlight
45
+ */
46
+ highlightViewTag?: Int32;
47
+ /**
48
+ * Parameters for view-based highlighting including padding and offset
49
+ */
50
+ highlightViewTagParams?: HighlightViewTagParams;
51
+ /**
52
+ * Minimum rectangle size for the highlight area
53
+ */
54
+ minimumRectSize?: MinimumRectSize;
55
+ /**
56
+ * Inner padding for the highlight area
57
+ */
58
+ innerPadding?: WithDefault<Float, 0>;
59
+ }
60
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
61
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ export default codegenNativeComponent('HighlighterView');
@@ -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 "../../specs/HighlighterViewNativeComponent";
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 "../../../specs/KeyboardTrackingViewNativeComponent";
4
+ import KeyboardTrackingViewNativeComponent from "./KeyboardTrackingViewNativeComponent";
5
5
  const KeyboardTrackingViewTempManager = NativeModules.KeyboardTrackingViewTempManager;
6
6
 
7
7
  /**
@@ -0,0 +1,58 @@
1
+ /// <reference types="react-native/types/modules/codegen" />
2
+ import type { ViewProps } from 'react-native';
3
+ import type { Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
4
+ export interface NativeProps extends ViewProps {
5
+ /**
6
+ * Enables tracking of the keyboard when it's dismissed interactively (false by default).
7
+ */
8
+ trackInteractive?: WithDefault<boolean, false>;
9
+ /**
10
+ * iOS only.
11
+ * Show the keyboard on a negative scroll
12
+ */
13
+ revealKeyboardInteractive?: WithDefault<boolean, false>;
14
+ /**
15
+ * iOS only.
16
+ * Set to false to turn off inset management and manage it yourself
17
+ */
18
+ manageScrollView?: WithDefault<boolean, true>;
19
+ /**
20
+ * iOS only.
21
+ * Set to true manageScrollView is set to true and still does not work
22
+ */
23
+ requiresSameParentToManageScrollView?: WithDefault<boolean, false>;
24
+ /**
25
+ * iOS only.
26
+ * Allow hitting sub-views that are placed beyond the view bounds
27
+ */
28
+ allowHitsOutsideBounds?: WithDefault<boolean, false>;
29
+ /**
30
+ * Should the scrollView scroll to the focused input
31
+ */
32
+ scrollToFocusedInput?: WithDefault<boolean, false>;
33
+ /**
34
+ * iOS only.
35
+ * The scrolling behavior (NONE | SCROLL_TO_BOTTOM_INVERTED_ONLY | FIXED_OFFSET)
36
+ */
37
+ scrollBehavior?: WithDefault<Int32, 0>;
38
+ /**
39
+ * iOS only.
40
+ * Add a SafeArea view beneath the KeyboardAccessoryView
41
+ */
42
+ addBottomView?: WithDefault<boolean, false>;
43
+ /**
44
+ * iOS only.
45
+ * The bottom view's color
46
+ */
47
+ bottomViewColor?: string;
48
+ /**
49
+ * Allow control safe area
50
+ */
51
+ useSafeArea?: WithDefault<boolean, false>;
52
+ /**
53
+ * Whether or not to include bottom tab bar inset
54
+ */
55
+ usesBottomTabs?: WithDefault<boolean, false>;
56
+ }
57
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
58
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ export default codegenNativeComponent('KeyboardTrackingViewTemp');
@@ -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, StyleProp } from 'react-native';
2
+ import { ViewStyle } from 'react-native';
3
3
  export type SafeAreaSpacerViewProps = {
4
- style?: StyleProp<ViewStyle>;
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, useMemo } from 'react';
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 (componentHeight < safeAreaInsets.top) {
49
+ if (y < safeAreaInsets.top) {
54
50
  height = safeAreaInsets.top;
55
- } else if (componentHeight > screenHeight - safeAreaInsets.bottom) {
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
- }, [componentHeight, safeAreaInsets, spacerHeight]);
62
- const spacerStyle = useMemo(() => [{
63
- height: spacerHeight
64
- }, style], [spacerHeight, style]);
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';
@@ -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 };
@@ -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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uilib-native",
3
- "version": "5.0.0-snapshot.7216",
3
+ "version": "5.0.0-snapshot.7227",
4
4
  "homepage": "https://github.com/wix/react-native-ui-lib",
5
5
  "description": "uilib native components (separated from js components)",
6
6
  "main": "components/index",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.44.0-snapshot.7216",
3
+ "version": "7.44.0-snapshot.7227",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -56,7 +56,7 @@
56
56
  "react-native-redash": "^12.0.3",
57
57
  "semver": "^5.5.0",
58
58
  "tinycolor2": "^1.4.2",
59
- "uilib-native": "5.0.0-snapshot.7212",
59
+ "uilib-native": "4.5.1",
60
60
  "url-parse": "^1.2.0",
61
61
  "wix-react-native-text-size": "1.0.9"
62
62
  },
@@ -107,7 +107,7 @@ export default class KeyboardAwareBase extends Component {
107
107
  setTimeout(() => {
108
108
  this._keyboardAwareView
109
109
  .getScrollResponder()
110
- .scrollResponderScrollNativeHandleToKeyboard(this.findNodeHandle(textInputRef),
110
+ .scrollResponderScrollNativeHandleToKeyboard(ReactNative.findNodeHandle(textInputRef),
111
111
  this.props.scrollToInputAdditionalOffset,
112
112
  true);
113
113
  }, 0);
@@ -117,10 +117,6 @@ export default class KeyboardAwareBase extends Component {
117
117
  }
118
118
  }
119
119
 
120
- findNodeHandle(ref) {
121
- return ref.current?.getNodeHandle?.() || ref?.getNodeHandle?.() || ReactNative.findNodeHandle(ref.current || ref);
122
- }
123
-
124
120
  _onKeyboardWillShow(event) {
125
121
  this._scrollToFocusedTextInput();
126
122
 
@@ -100,7 +100,7 @@ export type FeatureHighlightProps = {
100
100
  interface State {
101
101
  fadeAnim: Animated.Value;
102
102
  contentTopPosition?: number;
103
- node?: number;
103
+ node?: number | null;
104
104
  getTarget?: () => any;
105
105
  }
106
106
  /**
@@ -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;