react-native-ui-lib 7.43.0-snapshot.7175 → 7.43.0-snapshot.7190

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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uilib-native",
3
- "version": "5.0.0-snapshot.7175",
3
+ "version": "5.0.0-snapshot.7190",
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.43.0-snapshot.7175",
3
+ "version": "7.43.0-snapshot.7190",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -117,12 +117,11 @@
117
117
  "react-native": "0.77.2",
118
118
  "react-native-fs": "^2.20.0",
119
119
  "react-native-gesture-handler": "2.22.1",
120
+ "react-native-gradients": "2.1.1",
120
121
  "react-native-haptic-feedback": "^1.11.0",
121
- "react-native-linear-gradient": "2.6.2",
122
122
  "react-native-mmkv": "3.2.0",
123
- "react-native-navigation": "8.1.0-rc01-snapshot.1710",
123
+ "react-native-navigation": "8.1.0-rc02",
124
124
  "react-native-reanimated": "3.16.7",
125
- "react-native-shimmer-placeholder": "^2.0.6",
126
125
  "react-native-svg": "15.11.2",
127
126
  "react-native-svg-transformer": "1.5.0",
128
127
  "react-test-renderer": "18.3.1",
@@ -131,6 +130,9 @@
131
130
  "shell-utils": "^1.0.10",
132
131
  "typescript": "5.0.4"
133
132
  },
133
+ "resolutions": {
134
+ "react-native-svg": "15.11.2"
135
+ },
134
136
  "peerDependencies": {
135
137
  "react": ">=17.0.1",
136
138
  "react-native": ">=0.76.0",
@@ -107,7 +107,7 @@ export default class KeyboardAwareBase extends Component {
107
107
  setTimeout(() => {
108
108
  this._keyboardAwareView
109
109
  .getScrollResponder()
110
- .scrollResponderScrollNativeHandleToKeyboard(ReactNative.findNodeHandle(textInputRef),
110
+ .scrollResponderScrollNativeHandleToKeyboard(this.findNodeHandle(textInputRef),
111
111
  this.props.scrollToInputAdditionalOffset,
112
112
  true);
113
113
  }, 0);
@@ -117,6 +117,10 @@ 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
+
120
124
  _onKeyboardWillShow(event) {
121
125
  this._scrollToFocusedTextInput();
122
126
 
@@ -1,7 +1,10 @@
1
1
  export let MarqueeDirections = /*#__PURE__*/function (MarqueeDirections) {
2
2
  MarqueeDirections["RIGHT"] = "RIGHT";
3
+ //LTR
3
4
  MarqueeDirections["LEFT"] = "LEFT";
5
+ //RTL
4
6
  MarqueeDirections["UP"] = "UP";
5
- MarqueeDirections["DOWN"] = "DOWN";
7
+ //Bottom Up
8
+ MarqueeDirections["DOWN"] = "DOWN"; //Up To Bottom
6
9
  return MarqueeDirections;
7
10
  }({});
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ export interface ShimmerPlaceholderProps {
4
+ /**
5
+ * The height of the skeleton view
6
+ */
7
+ height?: number;
8
+ /**
9
+ * The width of the skeleton view
10
+ */
11
+ width?: number;
12
+ /**
13
+ * The colors of the skeleton view, the array length has to be 3
14
+ * default: [Colors.grey70, Colors.grey60, Colors.grey70]
15
+ */
16
+ colors?: string[];
17
+ /**
18
+ * Additional style to the skeleton view
19
+ */
20
+ shimmerStyle?: StyleProp<ViewStyle>;
21
+ /**
22
+ * Override container styles
23
+ */
24
+ style?: StyleProp<ViewStyle>;
25
+ }
26
+ declare const ShimmerPlaceholder: (props: ShimmerPlaceholderProps) => React.JSX.Element;
27
+ export default ShimmerPlaceholder;
@@ -0,0 +1,68 @@
1
+ import React, { useEffect, useMemo } from 'react';
2
+ import { LinearGradientPackage as LinearGradient } from "../../optionalDependencies";
3
+ import View from "../view";
4
+ import { Colors } from "../../style";
5
+ import Constants from "../../commons/Constants";
6
+ import { interpolate, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
7
+ const ANIMATION_DURATION = 1000;
8
+ const ShimmerPlaceholder = props => {
9
+ const {
10
+ height,
11
+ width = 100,
12
+ colors = [Colors.$backgroundNeutral, Colors.$backgroundNeutralMedium, Colors.$backgroundNeutral],
13
+ shimmerStyle,
14
+ style
15
+ } = props;
16
+ const translateValue = useSharedValue(-0.7);
17
+ useEffect(() => {
18
+ translateValue.value = withRepeat(withTiming(0.7, {
19
+ duration: ANIMATION_DURATION
20
+ }), -1, false);
21
+ }, [translateValue]);
22
+ const backgroundColor = useMemo(() => {
23
+ return colors[0];
24
+ }, [colors]);
25
+ const colorList = useMemo(() => {
26
+ return [{
27
+ offset: '20%',
28
+ color: colors[0],
29
+ opacity: '1'
30
+ }, {
31
+ offset: '40%',
32
+ color: colors[1],
33
+ opacity: '1'
34
+ }, {
35
+ offset: '100%',
36
+ color: colors[2],
37
+ opacity: '1'
38
+ }];
39
+ }, [colors]);
40
+ const animatedStyle = useAnimatedStyle(() => {
41
+ const translateX = interpolate(translateValue.value, [-1, 1], [-width, width], 'extend');
42
+ return {
43
+ transform: [{
44
+ translateX
45
+ }]
46
+ };
47
+ }, [width]);
48
+ const _style = useMemo(() => {
49
+ const reverseStyle = Constants.isRTL ? {
50
+ transform: [{
51
+ scaleX: -1
52
+ }]
53
+ } : undefined;
54
+ return [style, shimmerStyle, {
55
+ overflow: 'hidden'
56
+ }, reverseStyle, {
57
+ backgroundColor
58
+ }];
59
+ }, [style, shimmerStyle, backgroundColor]);
60
+ return <View height={height} width={width}
61
+ // @ts-expect-error
62
+ style={_style}>
63
+ <View width={width} reanimated style={animatedStyle}>
64
+ <LinearGradient colorList={colorList} angle={0} />
65
+ </View>
66
+ </View>;
67
+ };
68
+ export default ShimmerPlaceholder;
@@ -1,5 +1,6 @@
1
1
  import React, { Component } from 'react';
2
2
  import { Animated, StyleProp, ViewStyle, AccessibilityProps } from 'react-native';
3
+ import { ShimmerPlaceholderProps } from './ShimmerPlaceholder';
3
4
  import { AlignmentModifiers, PaddingModifiers, MarginModifiers } from '../../commons/new';
4
5
  export declare enum Template {
5
6
  LIST_ITEM = "listItem",
@@ -37,7 +38,7 @@ export interface SkeletonListProps {
37
38
  */
38
39
  renderEndContent?: () => React.ReactElement | undefined;
39
40
  }
40
- export interface SkeletonViewProps extends AccessibilityProps, AlignmentModifiers, PaddingModifiers, MarginModifiers {
41
+ export interface SkeletonViewProps extends ShimmerPlaceholderProps, AccessibilityProps, AlignmentModifiers, PaddingModifiers, MarginModifiers {
41
42
  /**
42
43
  * The content has been loaded, start fading out the skeleton and fading in the content
43
44
  */
@@ -72,19 +73,6 @@ export interface SkeletonViewProps extends AccessibilityProps, AlignmentModifier
72
73
  * This is needed because the `key` prop is not accessible.
73
74
  */
74
75
  timesKey?: string;
75
- /**
76
- * The height of the skeleton view
77
- */
78
- height?: number;
79
- /**
80
- * The width of the skeleton view
81
- */
82
- width?: number;
83
- /**
84
- * The colors of the skeleton view, the array length has to be >=2
85
- * default: [Colors.grey70, Colors.grey60, Colors.grey70]
86
- */
87
- colors?: string[];
88
76
  /**
89
77
  * The border radius of the skeleton view
90
78
  */
@@ -93,14 +81,6 @@ export interface SkeletonViewProps extends AccessibilityProps, AlignmentModifier
93
81
  * Whether the skeleton is a circle (will override the borderRadius)
94
82
  */
95
83
  circle?: boolean;
96
- /**
97
- * Additional style to the skeleton view
98
- */
99
- shimmerStyle?: StyleProp<ViewStyle>;
100
- /**
101
- * Override container styles
102
- */
103
- style?: StyleProp<ViewStyle>;
104
84
  /**
105
85
  * Used to locate this view in end-to-end tests
106
86
  */
@@ -115,7 +95,7 @@ interface SkeletonState {
115
95
  * @description: Allows showing a temporary skeleton view while your real view is loading.
116
96
  * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/SkeletonViewScreen.tsx
117
97
  * @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Skeleton/Skeleton.gif?raw=true
118
- * @notes: View requires installing the 'react-native-shimmer-placeholder' and 'react-native-linear-gradient' library
98
+ * @notes: View requires installing the 'react-native-gradients' library
119
99
  */
120
100
  declare class SkeletonView extends Component<SkeletonViewProps, SkeletonState> {
121
101
  static displayName: string;
@@ -139,8 +119,7 @@ declare class SkeletonView extends Component<SkeletonViewProps, SkeletonState> {
139
119
  circleOverride: boolean;
140
120
  style: StyleProp<ViewStyle>;
141
121
  }) => {
142
- shimmerColors: string[];
143
- isReversed: boolean;
122
+ colors: string[] | undefined;
144
123
  style: StyleProp<ViewStyle>[];
145
124
  width: number | undefined;
146
125
  height: number;
@@ -5,12 +5,11 @@ import _isUndefined from "lodash/isUndefined";
5
5
  import React, { Component } from 'react';
6
6
  import { StyleSheet, Animated, Easing } from 'react-native';
7
7
  import memoize from 'memoize-one';
8
- import { BorderRadiuses, Colors, Dividers, Spacings } from "../../style";
9
- import { createShimmerPlaceholder, LinearGradientPackage } from "../../optionalDependencies";
8
+ import { LinearGradientPackage } from "../../optionalDependencies";
9
+ import ShimmerPlaceholderTemp from "./ShimmerPlaceholder";
10
+ import { BorderRadiuses, Dividers, Spacings } from "../../style";
10
11
  import View from "../view";
11
- import { Constants } from "../../commons/new";
12
12
  import { LogService } from "../../services";
13
- const LinearGradient = LinearGradientPackage?.default;
14
13
  let ShimmerPlaceholder;
15
14
  const ANIMATION_DURATION = 400;
16
15
  export let Template = /*#__PURE__*/function (Template) {
@@ -32,7 +31,7 @@ export let ContentType = /*#__PURE__*/function (ContentType) {
32
31
  * @description: Allows showing a temporary skeleton view while your real view is loading.
33
32
  * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/SkeletonViewScreen.tsx
34
33
  * @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Skeleton/Skeleton.gif?raw=true
35
- * @notes: View requires installing the 'react-native-shimmer-placeholder' and 'react-native-linear-gradient' library
34
+ * @notes: View requires installing the 'react-native-gradients' library
36
35
  */
37
36
  class SkeletonView extends Component {
38
37
  static displayName = 'SkeletonView';
@@ -62,12 +61,10 @@ class SkeletonView extends Component {
62
61
  isAnimating: props.showContent === false,
63
62
  opacity: new Animated.Value(0)
64
63
  };
65
- if (_isUndefined(LinearGradientPackage?.default)) {
66
- LogService.error(`RNUILib SkeletonView's requires installing "react-native-linear-gradient" dependency`);
67
- } else if (_isUndefined(createShimmerPlaceholder)) {
68
- LogService.error(`RNUILib SkeletonView's requires installing "react-native-shimmer-placeholder" dependency`);
64
+ if (_isUndefined(LinearGradientPackage)) {
65
+ LogService.error(`RNUILib SkeletonView's requires installing "react-native-gradients" dependency`);
69
66
  } else if (ShimmerPlaceholder === undefined) {
70
- ShimmerPlaceholder = createShimmerPlaceholder(LinearGradient);
67
+ ShimmerPlaceholder = ShimmerPlaceholderTemp;
71
68
  }
72
69
  this.setAccessibilityProps(props.template);
73
70
  }
@@ -118,8 +115,7 @@ class SkeletonView extends Component {
118
115
  size = Math.max(width || 0, height);
119
116
  }
120
117
  return {
121
- shimmerColors: colors || [Colors.$backgroundNeutral, Colors.$backgroundNeutralMedium, Colors.$backgroundNeutral],
122
- isReversed: Constants.isRTL,
118
+ colors,
123
119
  style: [{
124
120
  borderRadius
125
121
  }, style],
@@ -265,7 +261,7 @@ class SkeletonView extends Component {
265
261
  }
266
262
  renderNothing = () => null;
267
263
  render() {
268
- if (_isUndefined(LinearGradientPackage?.default) || _isUndefined(createShimmerPlaceholder)) {
264
+ if (LinearGradientPackage === undefined) {
269
265
  return null;
270
266
  }
271
267
  const {
@@ -3,7 +3,7 @@
3
3
  "category": "status",
4
4
  "description": "Allows showing a temporary skeleton view while your real view is loading",
5
5
  "modifiers": ["margin"],
6
- "note": "Requires installing the 'react-native-shimmer-placeholder' and 'react-native-linear-gradient' libraries",
6
+ "note": "Requires installing the 'react-native-gradients' library",
7
7
  "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/SkeletonViewScreen.tsx",
8
8
  "images": ["https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Skeleton/Skeleton.gif?raw=true"],
9
9
  "props": [
@@ -40,7 +40,7 @@
40
40
  {
41
41
  "name": "colors",
42
42
  "type": "string[]",
43
- "description": "The colors of the skeleton view, the array length has to be >=2",
43
+ "description": "The colors of the skeleton view, the array length has to be 3",
44
44
  "default": "[Colors.grey70, Colors.grey60, Colors.grey70]"
45
45
  },
46
46
  {"name": "borderRadius", "type": "number", "description": "The border radius of the skeleton view"},
@@ -5,6 +5,7 @@ export let ValidationMessagePosition = /*#__PURE__*/function (ValidationMessageP
5
5
  }({});
6
6
  export let Presets = /*#__PURE__*/function (Presets) {
7
7
  Presets["DEFAULT"] = "default";
8
+ // TODO: remove
8
9
  Presets["UNDERLINE"] = "underline";
9
10
  Presets["OUTLINE"] = "outline";
10
11
  return Presets;
@@ -1,5 +1,6 @@
1
1
  export let StateTypes = /*#__PURE__*/function (StateTypes) {
2
2
  StateTypes["CURRENT"] = "current";
3
+ // default
3
4
  StateTypes["NEXT"] = "next";
4
5
  StateTypes["ERROR"] = "error";
5
6
  StateTypes["SUCCESS"] = "success";
@@ -7,11 +8,13 @@ export let StateTypes = /*#__PURE__*/function (StateTypes) {
7
8
  }({});
8
9
  export let LineTypes = /*#__PURE__*/function (LineTypes) {
9
10
  LineTypes["SOLID"] = "solid";
11
+ // default
10
12
  LineTypes["DASHED"] = "dashed";
11
13
  return LineTypes;
12
14
  }({});
13
15
  export let PointTypes = /*#__PURE__*/function (PointTypes) {
14
16
  PointTypes["BULLET"] = "bullet";
17
+ // default
15
18
  PointTypes["CIRCLE"] = "circle";
16
19
  PointTypes["OUTLINE"] = "outline";
17
20
  return PointTypes;
package/src/index.js CHANGED
@@ -2249,6 +2249,5 @@ function _WheelPicker() {
2249
2249
  };
2250
2250
  return data;
2251
2251
  }
2252
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
2253
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
2252
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
2254
2253
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,5 +1,5 @@
1
1
  let LinearGradientPackage;
2
2
  try {
3
- LinearGradientPackage = require('react-native-linear-gradient');
3
+ LinearGradientPackage = require('react-native-gradients')?.LinearGradient;
4
4
  } catch (error) {}
5
5
  export default LinearGradientPackage;
@@ -5,5 +5,4 @@ export { default as MomentPackage } from './MomentPackage';
5
5
  export { default as NetInfoPackage } from './NetInfoPackage';
6
6
  export { default as HapticFeedbackPackage } from './HapticFeedbackPackage';
7
7
  export { default as SvgPackage, SvgCssUri } from './SvgPackage';
8
- export { createShimmerPlaceholder } from './ShimmerPackage';
9
8
  export { default as LinearGradientPackage } from './LinearGradientPackage';
@@ -5,5 +5,4 @@ export { default as MomentPackage } from "./MomentPackage";
5
5
  export { default as NetInfoPackage } from "./NetInfoPackage";
6
6
  export { default as HapticFeedbackPackage } from "./HapticFeedbackPackage";
7
7
  export { default as SvgPackage, SvgCssUri } from "./SvgPackage";
8
- export { createShimmerPlaceholder } from "./ShimmerPackage";
9
8
  export { default as LinearGradientPackage } from "./LinearGradientPackage";
@@ -1,7 +1,6 @@
1
1
  export { default as NetInfoPackage } from './NetInfoPackage';
2
2
  export { default as HapticFeedbackPackage } from './HapticFeedbackPackage';
3
3
  export { default as SvgPackage } from './SvgPackage';
4
- export { createShimmerPlaceholder } from './ShimmerPackage';
5
4
  export { default as LinearGradientPackage } from './LinearGradientPackage';
6
5
  export { default as PostCssPackage } from './PostCssPackage';
7
6
  export { default as FlashListPackage } from './FlashListPackage';
@@ -1,7 +1,6 @@
1
1
  export { default as NetInfoPackage } from "./NetInfoPackage";
2
2
  export { default as HapticFeedbackPackage } from "./HapticFeedbackPackage";
3
3
  export { default as SvgPackage } from "./SvgPackage";
4
- export { createShimmerPlaceholder } from "./ShimmerPackage";
5
4
  export { default as LinearGradientPackage } from "./LinearGradientPackage";
6
5
  export { default as PostCssPackage } from "./PostCssPackage";
7
6
  export { default as FlashListPackage } from "./FlashListPackage";
@@ -1,2 +0,0 @@
1
- declare let createShimmerPlaceholder: any;
2
- export { createShimmerPlaceholder };
@@ -1,5 +0,0 @@
1
- let createShimmerPlaceholder;
2
- try {
3
- createShimmerPlaceholder = require('react-native-shimmer-placeholder').createShimmerPlaceholder;
4
- } catch (error) {}
5
- export { createShimmerPlaceholder };