Skip to content

Commit 0877979

Browse files
committed
Merge branch 'master' into release
2 parents d6ca6fb + 95b6022 commit 0877979

File tree

12 files changed

+315
-1210
lines changed

12 files changed

+315
-1210
lines changed

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ GEM
33
specs:
44
CFPropertyList (3.0.5)
55
rexml
6-
activesupport (6.1.7.3)
6+
activesupport (6.1.7.6)
77
concurrent-ruby (~> 1.0, >= 1.0.2)
88
i18n (>= 1.6, < 2)
99
minitest (>= 5.1)
@@ -63,10 +63,10 @@ GEM
6363
fuzzy_match (2.0.4)
6464
gh_inspector (1.1.3)
6565
httpclient (2.8.3)
66-
i18n (1.12.0)
66+
i18n (1.14.1)
6767
concurrent-ruby (~> 1.0)
6868
json (2.6.2)
69-
minitest (5.18.0)
69+
minitest (5.19.0)
7070
molinillo (0.8.0)
7171
nanaimo (0.3.0)
7272
nap (1.1.0)
@@ -85,7 +85,7 @@ GEM
8585
colored2 (~> 3.1)
8686
nanaimo (~> 0.3.0)
8787
rexml (~> 3.2.4)
88-
zeitwerk (2.6.7)
88+
zeitwerk (2.6.11)
8989

9090
PLATFORMS
9191
ruby

demo/src/screens/componentScreens/ImageScreen.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const BROKEN_URL = 'file:///Desktop/website/img/cupcake.jpg';
99
const DEFAULT_SIZE = 100;
1010

1111
const file = Assets.svgs.demo.logo;
12-
const uri = {uri: 'http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg'};
13-
const uriWithCss = {uri: 'http://thenewcode.com/assets/svg/accessibility.svg'};
12+
const uri = {uri: 'https://www.svgrepo.com/show/530581/cell-phone.svg'};
13+
// const uriWithCss = {uri: ''}; // TODO: find an example
1414
const xml = `
1515
<svg width="32" height="32" viewBox="0 0 32 32">
1616
<path
@@ -43,7 +43,7 @@ enum SizeType {
4343
enum SvgType {
4444
File = 'file',
4545
Uri = 'uri',
46-
UriWithCss = 'use_with_css',
46+
// UriWithCss = 'use_with_css',
4747
Xml = 'xml'
4848
}
4949

@@ -79,8 +79,8 @@ class ImageScreen extends Component<{}, State> {
7979
return file;
8080
case SvgType.Uri:
8181
return uri;
82-
case SvgType.UriWithCss:
83-
return uriWithCss;
82+
// case SvgType.UriWithCss:
83+
// return uriWithCss;
8484
case SvgType.Xml:
8585
default:
8686
return xml;

docs/foundation/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ In order to initialize a test driver you pass it the renderTree and the componen
2929
### Example
3030
Suppose we have a form that takes a `first name`, `last name` and an `address` and we want to test the submitting of this form. Our form component will look something like this:
3131
```jsx
32-
import {Button, TextField, View} from '@wix/wix-react-native-ui-lib';
32+
import {Button, TextField, View} from 'react-native-ui-lib/testkit';
3333

3434
type OnSubmitHandler = (firstName: string, lastName: string, address: string) => void;
3535
const MyForm = (props: {onSubmit: OnSubmitHandler}) => {
@@ -51,7 +51,7 @@ const MyForm = (props: {onSubmit: OnSubmitHandler}) => {
5151
#### In order to test our flow we would do the following steps:
5252
1. Import the TextField and Button driver from UI-LIB's testkit
5353
```javascript
54-
import {TextFieldDriver, ButtonDriver} from '@wix/react-native-ui-lib/testkit';
54+
import {TextFieldDriver, ButtonDriver} from 'react-native-ui-lib/testkit';
5555
```
5656
2. render our test case
5757
```javascript

expoDemo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"react-native-safe-area-context": "4.5.0",
2727
"react-native-screens": "~3.20.0",
2828
"react-native-svg": "13.4.0",
29-
"react-native-svg-transformer": "^1.0.0",
29+
"react-native-svg-transformer": "1.1.0",
3030
"react-native-ui-lib": "^7.1.0",
3131
"react-native-web": "~0.18.12",
3232
"unicorn-demo-app": "^7.1.0"

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
"devDependencies": {
5858
"@babel/cli": "^7.16.8",
59-
"@babel/core": "^7.20.0",
59+
"@babel/core": "^7.24.4",
6060
"@babel/plugin-transform-modules-commonjs": "^7.17.9",
6161
"@babel/preset-env": "^7.20.0",
6262
"@babel/preset-react": "^7.10.1",
@@ -85,19 +85,16 @@
8585
"@welldone-software/why-did-you-render": "^3.2.1",
8686
"babel-jest": "^29.2.1",
8787
"babel-plugin-lodash": "^3.3.4",
88-
"babel-plugin-module-resolver": "^4.1.0",
89-
"babel-preset-react-native": "*",
88+
"babel-plugin-module-resolver": "^5.0.0",
9089
"eslint": "8.19.0",
9190
"eslint-config-wix": "2.0.0",
9291
"eslint-plugin-react": "^7.24.0",
9392
"eslint-plugin-react-hooks": "^4.0.4",
9493
"eslint-plugin-react-native": "^4.0.0",
9594
"eslint-plugin-uilib": "file:./eslint-rules",
96-
"gh-pages": "^1.1.0",
9795
"jest": "^29.2.1",
9896
"light-date": "^1.2.0",
9997
"metro-react-native-babel-preset": "0.73.10",
100-
"mocha": "^5.0.0",
10198
"moment": "^2.24.0",
10299
"object-hash": "^3.0.0",
103100
"postcss": "^8.4.21",
@@ -112,12 +109,12 @@
112109
"react-native-gesture-handler": "2.9.0",
113110
"react-native-haptic-feedback": "^1.11.0",
114111
"react-native-linear-gradient": "2.6.2",
115-
"react-native-mmkv": "2.6.1",
112+
"react-native-mmkv": "2.11.0",
116113
"react-native-navigation": "7.32.1",
117114
"react-native-reanimated": "3.4.0",
118115
"react-native-shimmer-placeholder": "^2.0.6",
119116
"react-native-svg": "^13.7.0",
120-
"react-native-svg-transformer": "^0.14.3",
117+
"react-native-svg-transformer": "1.1.0",
121118
"react-test-renderer": "18.2.0",
122119
"reassure": "^0.4.1",
123120
"shell-utils": "^1.0.10",

scripts/deployDocs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ echo "Building docs site..."
88
(cd ./docuilib && npm run build)
99

1010
echo "Deploying docs..."
11-
(cd ./docuilib && GIT_USER=$username npm run deploy)
11+
(cd ./docuilib && GIT_USER=$username USE_SSH=true npm run deploy)
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
import _ from 'lodash';
22
import {useComponentDriver, ComponentProps} from '../../testkit/new/Component.driver';
33
import {WheelPickerDriver} from '../WheelPicker/WheelPicker.driver';
4-
import {WheelPickerItemValue} from '../WheelPicker';
54
import {SectionsWheelPickerProps} from './index';
65

7-
export const SectionsWheelPickerDriver = <T extends WheelPickerItemValue>(props: ComponentProps) => {
6+
export const SectionsWheelPickerDriver = (props: ComponentProps) => {
87
const driver = useComponentDriver(props);
9-
const sections = driver.getElement().children as SectionsWheelPickerProps<T>;
10-
const sectionsDrivers = _.map(sections, (_, index) => {
8+
const sections = driver.getElement().children as SectionsWheelPickerProps['sections'];
9+
const sectionsDrivers = _.map(sections, (section, index) => {
1110
const sectionTestID = `${props.testID}.${index}`;
1211
return WheelPickerDriver({
1312
renderTree: props.renderTree,
14-
testID: sectionTestID
13+
testID: section?.testID || sectionTestID
1514
});
1615
});
17-
18-
19-
20-
2116
return {...driver, sections, sectionsDrivers};
2217
};

src/components/tabController/TabBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ const TabBar = (props: Props) => {
219219
key={`${index}_${item.label}`}
220220
index={index}
221221
onLayout={onItemLayout}
222+
spreadItems={spreadItems}
222223
/>
223224
);
224225
});
@@ -234,7 +235,8 @@ const TabBar = (props: Props) => {
234235
backgroundColor,
235236
activeBackgroundColor,
236237
centerSelected,
237-
onItemLayout
238+
onItemLayout,
239+
spreadItems
238240
]);
239241

240242
const _indicatorTransitionStyle = useAnimatedStyle(() => {

src/components/tabController/TabBarItem.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ import {Colors, Typography, Spacings} from '../../style';
88
import Badge, {BadgeProps} from '../badge';
99
import View from '../view';
1010
import TabBarContext from './TabBarContext';
11+
import Constants from '../../commons/Constants';
12+
import type {TabControllerBarProps} from './TabBar';
1113

1214
const DEFAULT_LABEL_COLOR = Colors.$textDefault;
1315
const DEFAULT_SELECTED_LABEL_COLOR = Colors.$textPrimary;
1416

15-
export interface TabControllerItemProps {
17+
export interface TabControllerItemProps extends Pick<TabControllerBarProps, 'spreadItems'> {
1618
/**
1719
* label of the tab
1820
*/
@@ -132,6 +134,7 @@ export default function TabBarItem({
132134
testID,
133135
ignore,
134136
style,
137+
spreadItems,
135138
...props
136139
}: Props) {
137140
const {currentPage, setCurrentIndex} = useContext(TabBarContext);
@@ -193,9 +196,10 @@ export default function TabBarItem({
193196
});
194197

195198
const _style = useMemo(() => {
199+
const flex = Constants.isWeb ? (spreadItems ? 1 : undefined) : 1;
196200
const constantWidthStyle = itemWidth.current ? {flex: 0, width: itemWidth.current} : undefined;
197-
return [styles.tabItem, style, constantWidthStyle, pressStyle];
198-
}, [style]);
201+
return [styles.tabItem, {flex}, style, constantWidthStyle, pressStyle];
202+
}, [style, spreadItems]);
199203

200204
const gesture = Gesture.Tap()
201205
.maxDuration(60000)
@@ -250,7 +254,6 @@ export default function TabBarItem({
250254

251255
const styles = StyleSheet.create({
252256
tabItem: {
253-
flex: 1,
254257
flexDirection: 'row',
255258
alignItems: 'center',
256259
justifyContent: 'center',

src/incubator/Dialog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const Dialog = (props: DialogProps, ref: ForwardedRef<DialogImperativeMethods>)
5454
testID,
5555
children
5656
} = props;
57-
const {overlayBackgroundColor = Colors.rgba(Colors.$backgroundInverted, 0.3), ...otherModalProps} = modalProps;
57+
const {overlayBackgroundColor = Colors.rgba(Colors.grey10, 0.65), ...otherModalProps} = modalProps;
5858

5959
const visibility = useSharedValue(0); // value between 0 (closed) and 1 (open)
6060
const initialTranslation = useSharedValue(0);

src/testkit/new/Component.driver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {ReactTestInstance} from 'react-test-renderer';
2-
import {RenderResult} from '@testing-library/react-native';
2+
import {within} from '@testing-library/react-native';
33

44
export interface ComponentProps {
5-
renderTree: RenderResult;
5+
renderTree: ReturnType<typeof within>; // Note: This changed was asked for integration with amino. This still gives all querying functionality.
66
testID: string;
77
}
88

0 commit comments

Comments
 (0)