@shoutem/ui 5.3.0 → 5.4.0

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.
@@ -52,7 +52,6 @@ class EmptyListImage extends PureComponent {
52
52
  }
53
53
 
54
54
  EmptyListImage.propTypes = {
55
- ...EmptyListImage.propTypes,
56
55
  image: PropTypes.func,
57
56
  imageStyle: PropTypes.object,
58
57
  message: PropTypes.string,
@@ -1,5 +1,5 @@
1
1
  import React, { Children, PureComponent } from 'react';
2
- import { View as RNView, ViewPropTypes } from 'react-native';
2
+ import { View as RNView } from 'react-native';
3
3
  import _ from 'lodash';
4
4
  import PropTypes from 'prop-types';
5
5
  import { connectAnimation } from '@shoutem/animation';
@@ -35,7 +35,7 @@ class GridRow extends PureComponent {
35
35
  }
36
36
 
37
37
  GridRow.propTypes = {
38
- ...ViewPropTypes,
38
+ ...View.propTypes,
39
39
  columns: PropTypes.number.isRequired,
40
40
  };
41
41
 
@@ -1,6 +1,7 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import { Image as RNImage, Platform } from 'react-native';
3
3
  import autoBindReact from 'auto-bind/react';
4
+ import { ImagePropTypes } from 'deprecated-react-native-prop-types';
4
5
  import _ from 'lodash';
5
6
  import { connectAnimation } from '@shoutem/animation';
6
7
  import { connectStyle } from '@shoutem/theme';
@@ -82,7 +83,7 @@ class Image extends PureComponent {
82
83
  }
83
84
 
84
85
  Image.propTypes = {
85
- ...RNImage.propTypes,
86
+ ...ImagePropTypes,
86
87
  };
87
88
 
88
89
  const AnimatedImage = connectAnimation(Image);
@@ -1,5 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import { Text as RNText } from 'react-native';
3
+ import { TextPropTypes } from 'deprecated-react-native-prop-types';
3
4
  import { connectAnimation } from '@shoutem/animation';
4
5
  import { connectStyle } from '@shoutem/theme';
5
6
 
@@ -10,7 +11,7 @@ class Text extends PureComponent {
10
11
  }
11
12
 
12
13
  Text.propTypes = {
13
- ...RNText.propTypes,
14
+ ...TextPropTypes,
14
15
  };
15
16
 
16
17
  const AnimatedText = connectAnimation(Text);
@@ -1,6 +1,7 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import { TextInput as RNTextInput } from 'react-native';
3
3
  import autoBindReact from 'auto-bind/react';
4
+ import { TextInputPropTypes } from 'deprecated-react-native-prop-types';
4
5
  import PropTypes from 'prop-types';
5
6
  import { connectAnimation, Wiggle } from '@shoutem/animation';
6
7
  import { connectStyle } from '@shoutem/theme';
@@ -91,7 +92,7 @@ class TextInput extends PureComponent {
91
92
  }
92
93
 
93
94
  TextInput.propTypes = {
94
- ...RNTextInput.propTypes,
95
+ ...TextInputPropTypes,
95
96
  style: PropTypes.object.isRequired,
96
97
  animate: PropTypes.bool,
97
98
  errorMessage: PropTypes.string,
@@ -1,5 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
- import { View as RNView, ViewPropTypes } from 'react-native';
2
+ import { View as RNView } from 'react-native';
3
+ import { ViewPropTypes } from 'deprecated-react-native-prop-types';
3
4
  import PropTypes from 'prop-types';
4
5
  import { connectAnimation } from '@shoutem/animation';
5
6
  import { connectStyle } from '@shoutem/theme';
package/index.js CHANGED
@@ -11,6 +11,8 @@ export {
11
11
  resolveFontFamily,
12
12
  resolveFontStyle,
13
13
  resolveFontWeight,
14
+ responsiveHeight,
15
+ responsiveWidth,
14
16
  } from './theme';
15
17
 
16
18
  // Services
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoutem/ui",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "Styleable set of components for React Native applications",
5
5
  "scripts": {
6
6
  "lint": "eslint .",
@@ -16,25 +16,27 @@
16
16
  "auto-bind": "4.0.0",
17
17
  "babel-plugin-transform-decorators-legacy": "1.3.5",
18
18
  "buffer": "5.6.0",
19
+ "deprecated-react-native-prop-types": "2.3.0",
19
20
  "events": "1.1.0",
20
21
  "fs-extra": "7.0.1",
21
22
  "html-entities": "1.3.1",
22
23
  "htmlparser2": "3.10.1",
23
24
  "lodash": "4.17.21",
24
- "lottie-react-native": "5.1.3",
25
+ "lottie-ios": "3.4.0",
26
+ "lottie-react-native": "5.1.4",
25
27
  "prop-types": "15.8.1",
26
28
  "qs": "6.9.3",
27
29
  "react-native-device-info": "9.0.2",
28
30
  "react-native-lightbox": "github:shoutem/react-native-lightbox#v0.7.2",
29
31
  "react-native-linear-gradient": "2.6.2",
30
32
  "react-native-modal": "11.7.0",
31
- "react-native-photo-view": "github:shoutem/react-native-photo-view#8f88667",
33
+ "react-native-photo-view": "github:shoutem/react-native-photo-view#a296aa2",
32
34
  "react-native-render-html": "4.2.5",
33
35
  "react-native-render-html-table-bridge": "0.6.0",
34
36
  "react-native-svg": "12.3.0",
35
37
  "react-native-svg-transformer": "1.0.0",
36
38
  "react-native-transformable-image": "github:shoutem/react-native-transformable-image#v0.0.20",
37
- "react-native-webview": "11.22.7",
39
+ "react-native-webview": "11.23.0",
38
40
  "react-native-youtube-iframe": "2.2.2",
39
41
  "stream": "0.0.2",
40
42
  "tinycolor2": "1.4.1"
@@ -67,6 +69,7 @@
67
69
  },
68
70
  "nativeDependencies": [
69
71
  "@react-native-community/datetimepicker",
72
+ "lottie-ios",
70
73
  "lottie-react-native",
71
74
  "react-native-device-info",
72
75
  "react-native-linear-gradient",
package/theme.js CHANGED
@@ -48,9 +48,23 @@ export function dimensionRelativeToIphone(
48
48
  actualRefVal = window.width,
49
49
  ) {
50
50
  // 375 is iPhone width
51
+ // eslint-disable-next-line no-console
52
+ console.warn(
53
+ 'dimensionRelativeToIphone is depreacted and will be removed in next major release. Use responsiveWidth instead.',
54
+ );
51
55
  return getSizeRelativeToReference(dimension, 375, actualRefVal);
52
56
  }
53
57
 
58
+ export function responsiveWidth(dimension, actualRefVal = window.width) {
59
+ // 375 is iPhone width
60
+ return getSizeRelativeToReference(dimension, 375, actualRefVal);
61
+ }
62
+
63
+ export function responsiveHeight(dimension, actualRefVal = window.height) {
64
+ // 812 is iPhone height
65
+ return getSizeRelativeToReference(dimension, 812, actualRefVal);
66
+ }
67
+
54
68
  // 'fontWeight' and 'fontStyle' aren't always supplied for every component, so we're setting default
55
69
  // values of 'normal'.
56
70
  export function resolveFontFamily(
@@ -584,65 +598,65 @@ export default () => {
584
598
  imageSizes: {
585
599
  // NOTE: '-avatar' styles do not work with ImageBackground
586
600
  '.small-avatar': {
587
- width: dimensionRelativeToIphone(25),
588
- height: dimensionRelativeToIphone(25),
601
+ width: responsiveWidth(25),
602
+ height: responsiveWidth(25),
589
603
  borderRadius: 12.5,
590
604
  borderWidth: 0,
591
605
  },
592
606
 
593
607
  '.small': {
594
- width: dimensionRelativeToIphone(65),
595
- height: dimensionRelativeToIphone(65),
608
+ width: responsiveWidth(65),
609
+ height: responsiveWidth(65),
596
610
  },
597
611
 
598
612
  '.medium-avatar': {
599
- width: dimensionRelativeToIphone(145),
600
- height: dimensionRelativeToIphone(145),
601
- borderRadius: dimensionRelativeToIphone(72.5),
613
+ width: responsiveWidth(145),
614
+ height: responsiveWidth(145),
615
+ borderRadius: responsiveWidth(72.5),
602
616
  borderWidth: 0,
603
617
  },
604
618
 
605
619
  '.medium': {
606
- width: dimensionRelativeToIphone(145),
607
- height: dimensionRelativeToIphone(92),
620
+ width: responsiveWidth(145),
621
+ height: responsiveWidth(92),
608
622
  },
609
623
 
610
624
  '.medium-wide': {
611
- width: dimensionRelativeToIphone(180),
612
- height: dimensionRelativeToIphone(85),
625
+ width: responsiveWidth(180),
626
+ height: responsiveWidth(85),
613
627
  },
614
628
 
615
629
  '.medium-portrait': {
616
- width: dimensionRelativeToIphone(209),
617
- height: dimensionRelativeToIphone(139),
630
+ width: responsiveWidth(209),
631
+ height: responsiveWidth(139),
618
632
  },
619
633
 
620
634
  '.medium-square': {
621
- width: dimensionRelativeToIphone(145),
622
- height: dimensionRelativeToIphone(145),
635
+ width: responsiveWidth(145),
636
+ height: responsiveWidth(145),
623
637
  },
624
638
 
625
639
  // NOTE: Image resizing doesn't work correctly if both
626
640
  // dimensions are not explicitly defined, so we can't
627
641
  // use flex: 1, or alignSelf: 'stretch' here...
628
642
  '.featured': {
629
- width: dimensionRelativeToIphone(365),
630
- height: dimensionRelativeToIphone(345),
643
+ width: responsiveWidth(365),
644
+ height: responsiveWidth(345),
631
645
  },
632
646
 
633
647
  '.large': {
634
648
  width: window.width,
635
- height: dimensionRelativeToIphone(280),
649
+ height: responsiveWidth(280),
636
650
  },
637
651
 
638
652
  '.large-portrait': {
639
653
  width: window.width,
640
- height: dimensionRelativeToIphone(518),
654
+ height: responsiveWidth(518),
641
655
  },
642
656
 
643
657
  '.large-banner': {
644
658
  width: window.width,
645
- height: dimensionRelativeToIphone(200),
659
+ height: responsiveWidth(200),
646
660
  },
647
661
 
648
662
  '.large-square': {
@@ -652,12 +666,12 @@ export default () => {
652
666
 
653
667
  '.large-wide': {
654
668
  width: window.width,
655
- height: dimensionRelativeToIphone(238),
669
+ height: responsiveWidth(238),
656
670
  },
657
671
 
658
672
  '.large-ultra-wide': {
659
673
  width: window.width,
660
- height: dimensionRelativeToIphone(130),
674
+ height: responsiveWidth(130),
661
675
  },
662
676
  },
663
677
  'shoutem.ui.Image': {
@@ -1123,7 +1137,7 @@ export default () => {
1123
1137
  backgroundColor: resolveVariable('paperColor'),
1124
1138
  },
1125
1139
 
1126
- width: dimensionRelativeToIphone(180),
1140
+ width: responsiveWidth(180),
1127
1141
  flexDirection: 'column',
1128
1142
  justifyContent: 'center',
1129
1143
  alignItems: 'flex-start',
@@ -1137,7 +1151,7 @@ export default () => {
1137
1151
  'shoutem.ui.View': {
1138
1152
  '.pull-left': {
1139
1153
  marginVertical: resolveVariable('mediumGutter'),
1140
- marginLeft: -dimensionRelativeToIphone(72),
1154
+ marginLeft: -responsiveWidth(72),
1141
1155
  },
1142
1156
  },
1143
1157
 
@@ -1340,7 +1354,7 @@ export default () => {
1340
1354
  fontFamily: 'Rubik-Medium',
1341
1355
  },
1342
1356
 
1343
- width: dimensionRelativeToIphone(120),
1357
+ width: responsiveWidth(120),
1344
1358
  height: 82,
1345
1359
  flexDirection: 'column',
1346
1360
  },
@@ -2287,8 +2301,8 @@ export default () => {
2287
2301
  },
2288
2302
  video: {
2289
2303
  // 16:9 ratio covers majority of YouTube videos
2290
- width: dimensionRelativeToIphone(345),
2291
- height: dimensionRelativeToIphone(194),
2304
+ width: responsiveWidth(345),
2305
+ height: responsiveWidth(194),
2292
2306
  paddingBottom: resolveVariable('smallGutter'),
2293
2307
  },
2294
2308
  fallback: {
@@ -2565,30 +2579,30 @@ export default () => {
2565
2579
  'shoutem.ui.InlineGallery': {
2566
2580
  '.large-ultra-wide': {
2567
2581
  container: {
2568
- height: dimensionRelativeToIphone(130),
2582
+ height: responsiveWidth(130),
2569
2583
  },
2570
2584
  },
2571
2585
 
2572
2586
  '.large-banner': {
2573
2587
  container: {
2574
- height: dimensionRelativeToIphone(200),
2588
+ height: responsiveWidth(200),
2575
2589
  },
2576
2590
  },
2577
2591
 
2578
2592
  '.large-wide': {
2579
2593
  container: {
2580
- height: dimensionRelativeToIphone(238),
2594
+ height: responsiveWidth(238),
2581
2595
  },
2582
2596
  },
2583
2597
 
2584
2598
  '.large-square': {
2585
2599
  container: {
2586
- height: dimensionRelativeToIphone(375),
2600
+ height: responsiveWidth(375),
2587
2601
  },
2588
2602
  },
2589
2603
 
2590
2604
  container: {
2591
- height: dimensionRelativeToIphone(345),
2605
+ height: responsiveWidth(345),
2592
2606
  },
2593
2607
 
2594
2608
  imageContainer: {},