@shoutem/ui 4.6.7 → 4.9.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.
- package/LICENSE +1 -1
- package/README.md +1 -2
- package/components/ActionSheet/ActionSheet.js +6 -6
- package/components/DateTimePicker.js +2 -2
- package/components/DropDownMenu/DropDownMenu.js +1 -1
- package/components/DropDownMenu/DropDownModal.js +2 -2
- package/components/EmptyListImage.js +9 -5
- package/components/FormGroup.js +0 -1
- package/components/GridRow.js +2 -2
- package/components/HorizontalPager/HorizontalPager.js +2 -2
- package/components/Icon/services/icons.js +0 -2
- package/components/Icon/services/index.js +1 -1
- package/components/Image.js +1 -1
- package/components/ImageBackground.js +1 -1
- package/components/ImageGallery/ImageGallery.android.js +1 -0
- package/components/ImageGallery/ImageGallery.ios.js +2 -1
- package/components/ImageGalleryOverlay.js +1 -1
- package/components/ImagePreview.js +2 -2
- package/components/InlineDropDownMenu/InlineDropDownMenu.js +47 -28
- package/components/InlineDropDownMenu/InlineDropDownMenuItem.js +15 -17
- package/components/ListView.js +71 -32
- package/components/LoadingIndicator.js +1 -1
- package/components/NavigationBar/NavigationBar.js +3 -7
- package/components/NavigationBar/NavigationBarAnimations.js +1 -1
- package/components/ScrollView/ScrollDriverProvider.js +23 -3
- package/components/ScrollView/ScrollView.js +10 -8
- package/components/ShareButton.js +1 -1
- package/components/Spinner.js +1 -1
- package/components/Switch.js +2 -2
- package/components/TabMenu/TabMenu.js +2 -2
- package/components/TabMenu/TabMenuItem.js +7 -4
- package/components/Text.js +2 -2
- package/components/TextInput.js +3 -3
- package/components/Tile.js +1 -1
- package/components/Touchable.js +2 -2
- package/components/TouchableNativeFeedback.js +2 -2
- package/components/TouchableOpacity.js +1 -1
- package/components/Video/Video.js +1 -1
- package/components/Video/VideoSourceReader.js +2 -1
- package/components/View.js +1 -1
- package/components/YearRangePicker/YearRangePicker.js +2 -2
- package/components/YearRangePicker/YearRangePickerButton.js +2 -2
- package/components/YearRangePicker/YearRangePickerModal.js +11 -11
- package/examples/components/Cards.js +1 -1
- package/examples/components/DropDownMenus.js +8 -8
- package/examples/components/Examples.js +1 -1
- package/examples/components/FormComponents.js +1 -1
- package/examples/components/Headers.js +1 -1
- package/examples/components/NavigationBars.js +4 -4
- package/examples/components/Rows.js +1 -1
- package/examples/components/Stage.js +1 -1
- package/examples/components/Tiles.js +1 -1
- package/examples/components/Typography.js +1 -1
- package/examples/components/Videos.js +3 -3
- package/helpers/device-selector.js +11 -3
- package/helpers/keyboard.js +2 -3
- package/html/Html.js +3 -3
- package/html/components/Image.js +1 -1
- package/html/components/SimpleHtml.js +9 -9
- package/html/elements/A.js +3 -3
- package/html/elements/Block.js +2 -2
- package/html/elements/Img.js +1 -1
- package/html/elements/Inline.js +5 -5
- package/html/elements/Text.js +2 -2
- package/html/elements/list/Ol.js +1 -1
- package/html/elements/list/Ul.js +1 -1
- package/html/elements/list/index.js +4 -4
- package/html/index.js +33 -33
- package/html/services/ElementRegistry.js +1 -1
- package/html/services/HtmlParser.js +2 -1
- package/package.json +40 -30
- package/scripts/add-native-deps.js +0 -1
- package/theme.js +10 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Children, PureComponent } from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { DriverShape, ScrollDriver } from '@shoutem/animation';
|
|
@@ -22,6 +22,11 @@ export class ScrollDriverProvider extends PureComponent {
|
|
|
22
22
|
static propTypes = {
|
|
23
23
|
children: PropTypes.node,
|
|
24
24
|
driver: DriverShape,
|
|
25
|
+
// Used to propagate animation driver changes to components who aren't
|
|
26
|
+
// children of ScrollDriver, recieves driver as argument.
|
|
27
|
+
// TODO: Rewrite for new context API.
|
|
28
|
+
onAnimationDriverChange: PropTypes.func,
|
|
29
|
+
onScroll: PropTypes.func,
|
|
25
30
|
};
|
|
26
31
|
|
|
27
32
|
constructor(props, context) {
|
|
@@ -42,19 +47,34 @@ export class ScrollDriverProvider extends PureComponent {
|
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
setupAnimationDriver(props, context) {
|
|
50
|
+
const { onAnimationDriverChange } = this.props;
|
|
51
|
+
|
|
45
52
|
if (props.driver) {
|
|
46
53
|
this.animationDriver = props.driver;
|
|
47
54
|
} else if (context.driverProvider) {
|
|
48
55
|
this.animationDriver = context.animationDriver;
|
|
49
56
|
} else if (!this.animationDriver) {
|
|
50
|
-
this.animationDriver = new ScrollDriver(
|
|
57
|
+
this.animationDriver = new ScrollDriver(
|
|
58
|
+
{ useNativeDriver: true, nativeScrollEventThrottle: 20 },
|
|
59
|
+
props.onScroll,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (onAnimationDriverChange) {
|
|
64
|
+
onAnimationDriverChange(this.animationDriver);
|
|
51
65
|
}
|
|
52
66
|
}
|
|
53
67
|
|
|
54
68
|
setAnimationDriver(driver, primaryScrollView) {
|
|
55
69
|
if (driver || !this.animationDriver || primaryScrollView) {
|
|
56
|
-
|
|
70
|
+
const { onAnimationDriverChange } = this.props;
|
|
57
71
|
const { driverProvider } = this.context;
|
|
72
|
+
|
|
73
|
+
_.assign(this.animationDriver, driver);
|
|
74
|
+
if (onAnimationDriverChange) {
|
|
75
|
+
onAnimationDriverChange(driver);
|
|
76
|
+
}
|
|
77
|
+
|
|
58
78
|
if (driverProvider) {
|
|
59
79
|
driverProvider.setAnimationDriver(driver, primaryScrollView);
|
|
60
80
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
2
3
|
import autoBindReact from 'auto-bind/react';
|
|
3
4
|
import _ from 'lodash';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
6
|
-
import { ScrollDriver, DriverShape } from '@shoutem/animation';
|
|
6
|
+
import { DriverShape, ScrollDriver } from '@shoutem/animation';
|
|
7
7
|
import { connectStyle } from '@shoutem/theme';
|
|
8
|
-
import { ScrollDriverProvider } from './ScrollDriverProvider.js';
|
|
9
8
|
import { Device } from '../../helpers';
|
|
9
|
+
import { ScrollDriverProvider } from './ScrollDriverProvider.js';
|
|
10
10
|
|
|
11
11
|
const isTabBarOnScreen = true;
|
|
12
12
|
const IPHONE_X_HOME_INDICATOR_PADDING = isTabBarOnScreen ? 0 : 34;
|
|
@@ -14,6 +14,7 @@ const IPHONE_X_HOME_INDICATOR_PADDING = isTabBarOnScreen ? 0 : 34;
|
|
|
14
14
|
class ScrollView extends PureComponent {
|
|
15
15
|
static propTypes = {
|
|
16
16
|
...Animated.ScrollView.propTypes,
|
|
17
|
+
primary: PropTypes.bool,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
static contextTypes = {
|
|
@@ -33,7 +34,11 @@ class ScrollView extends PureComponent {
|
|
|
33
34
|
autoBindReact(this);
|
|
34
35
|
|
|
35
36
|
this.animationDriver =
|
|
36
|
-
props.driver ||
|
|
37
|
+
props.driver ||
|
|
38
|
+
new ScrollDriver(
|
|
39
|
+
{ useNativeDriver: true, nativeScrollEventThrottle: 20 },
|
|
40
|
+
props.onScroll,
|
|
41
|
+
);
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
getChildContext() {
|
|
@@ -53,12 +58,9 @@ class ScrollView extends PureComponent {
|
|
|
53
58
|
|
|
54
59
|
componentDidUpdate() {
|
|
55
60
|
const { driver } = this.props;
|
|
56
|
-
const { animationDriver } = this.context;
|
|
57
61
|
|
|
58
62
|
if (driver && this.animationDriver !== driver) {
|
|
59
63
|
this.animationDriver = driver;
|
|
60
|
-
} else if (animationDriver && this.animationDriver !== animationDriver) {
|
|
61
|
-
this.animationDriver = animationDriver;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
|
|
@@ -92,7 +94,7 @@ class ScrollView extends PureComponent {
|
|
|
92
94
|
ref={this.setWrappedInstance}
|
|
93
95
|
contentContainerStyle={this.addIphoneXPadding(contentContainerStyle)}
|
|
94
96
|
{...animationDriver.scrollViewProps}
|
|
95
|
-
{...props}
|
|
97
|
+
{..._.omit(props, 'onScroll')}
|
|
96
98
|
/>
|
|
97
99
|
);
|
|
98
100
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
+
import { Platform, Share } from 'react-native';
|
|
2
3
|
import autoBindReact from 'auto-bind/react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { Share, Platform } from 'react-native';
|
|
5
5
|
import { connectStyle } from '@shoutem/theme';
|
|
6
6
|
import { Button } from './Button';
|
|
7
7
|
import { Icon } from './Icon';
|
package/components/Spinner.js
CHANGED
package/components/Switch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import autoBindReact from 'auto-bind/react';
|
|
3
1
|
import React, { PureComponent } from 'react';
|
|
4
2
|
import { TouchableWithoutFeedback } from 'react-native';
|
|
3
|
+
import autoBindReact from 'auto-bind/react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { connectAnimation, TimingDriver } from '@shoutem/animation';
|
|
6
6
|
import { connectStyle } from '@shoutem/theme';
|
|
7
7
|
import { View } from './View';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { LayoutAnimation, ScrollView } from 'react-native';
|
|
3
3
|
import autoBindReact from 'auto-bind/react';
|
|
4
4
|
import _ from 'lodash';
|
|
5
|
-
import
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
6
|
import { connectStyle } from '@shoutem/theme';
|
|
7
7
|
import { optionShape } from './const';
|
|
8
8
|
import { TabMenuItem } from './TabMenuItem';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { LayoutAnimation } from 'react-native';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import autoBindReact from 'auto-bind/react';
|
|
5
4
|
import _ from 'lodash';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
6
|
import { connectStyle } from '@shoutem/theme';
|
|
7
7
|
import { Text } from '../Text';
|
|
8
|
-
import { View } from '../View';
|
|
9
8
|
import { TouchableOpacity } from '../TouchableOpacity';
|
|
9
|
+
import { View } from '../View';
|
|
10
10
|
import { optionShape } from './const';
|
|
11
11
|
|
|
12
12
|
class TabMenuItem extends PureComponent {
|
|
@@ -33,8 +33,11 @@ class TabMenuItem extends PureComponent {
|
|
|
33
33
|
onItemPressed(item);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
handleLayout({
|
|
37
|
-
|
|
36
|
+
handleLayout({
|
|
37
|
+
nativeEvent: {
|
|
38
|
+
layout: { width },
|
|
39
|
+
},
|
|
40
|
+
}) {
|
|
38
41
|
LayoutAnimation.easeInEaseOut();
|
|
39
42
|
this.setState({ baseWidth: width });
|
|
40
43
|
}
|
package/components/Text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { Text as RNText } from 'react-native';
|
|
3
|
-
import { connectStyle } from '@shoutem/theme';
|
|
4
3
|
import { connectAnimation } from '@shoutem/animation';
|
|
4
|
+
import { connectStyle } from '@shoutem/theme';
|
|
5
5
|
|
|
6
6
|
class Text extends PureComponent {
|
|
7
7
|
render() {
|
|
@@ -20,4 +20,4 @@ const Title = connectStyle('shoutem.ui.Title')(AnimatedText);
|
|
|
20
20
|
const Subtitle = connectStyle('shoutem.ui.Subtitle')(AnimatedText);
|
|
21
21
|
const Caption = connectStyle('shoutem.ui.Caption')(AnimatedText);
|
|
22
22
|
|
|
23
|
-
export {
|
|
23
|
+
export { Caption, Heading, Subtitle, StyledText as Text, Title };
|
package/components/TextInput.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
+
import { TextInput as RNTextInput } from 'react-native';
|
|
2
3
|
import autoBindReact from 'auto-bind/react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { TextInput as RNTextInput } from 'react-native';
|
|
5
5
|
import { connectAnimation, Wiggle } from '@shoutem/animation';
|
|
6
6
|
import { connectStyle } from '@shoutem/theme';
|
|
7
7
|
import { Caption } from './Text';
|
|
@@ -61,9 +61,9 @@ class TextInput extends PureComponent {
|
|
|
61
61
|
selectionColor={selectionColor}
|
|
62
62
|
underlineColorAndroid={underlineColorAndroid}
|
|
63
63
|
style={{
|
|
64
|
-
...otherStyle,
|
|
65
64
|
...(hasBorder ? withBorder : withoutBorder),
|
|
66
|
-
...(
|
|
65
|
+
...(errorMessage ? errorBorderColor : {}),
|
|
66
|
+
...otherStyle,
|
|
67
67
|
}}
|
|
68
68
|
/>
|
|
69
69
|
</Wiggle>
|
package/components/Tile.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { View } from 'react-native';
|
|
2
|
-
import { connectStyle } from '@shoutem/theme';
|
|
3
2
|
import { connectAnimation } from '@shoutem/animation';
|
|
3
|
+
import { connectStyle } from '@shoutem/theme';
|
|
4
4
|
|
|
5
5
|
const AnimatedTile = connectAnimation(View);
|
|
6
6
|
const Tile = connectStyle('shoutem.ui.Tile')(AnimatedTile);
|
package/components/Touchable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { Platform } from 'react-native';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
4
|
import { connectStyle } from '@shoutem/theme';
|
|
5
5
|
import { TouchableNativeFeedback } from './TouchableNativeFeedback';
|
|
6
6
|
import { TouchableOpacity } from './TouchableOpacity';
|
|
@@ -21,7 +21,7 @@ class Touchable extends PureComponent {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
render() {
|
|
24
|
-
const props = this
|
|
24
|
+
const { props } = this;
|
|
25
25
|
const style = { ...props.style };
|
|
26
26
|
delete style.touchableOpacity;
|
|
27
27
|
delete style.touchableNativeFeedback;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
4
|
import { connectStyle } from '@shoutem/theme';
|
|
5
5
|
|
|
6
6
|
class TouchableNativeFeedback extends PureComponent {
|
|
@@ -13,7 +13,7 @@ class TouchableNativeFeedback extends PureComponent {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
render() {
|
|
16
|
-
const props = this
|
|
16
|
+
const { props } = this;
|
|
17
17
|
// Remove the props that are not valid
|
|
18
18
|
// style keys.
|
|
19
19
|
const style = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { View } from 'react-native';
|
|
4
3
|
import { WebView } from 'react-native-webview';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { connectAnimation } from '@shoutem/animation';
|
|
6
6
|
import { connectStyle } from '@shoutem/theme';
|
|
7
7
|
import VideoSourceReader from './VideoSourceReader';
|
package/components/View.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { View as RNView, ViewPropTypes } from 'react-native';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
4
|
import { connectAnimation } from '@shoutem/animation';
|
|
5
5
|
import { connectStyle } from '@shoutem/theme';
|
|
6
6
|
import { LinearGradient } from './LinearGradient';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import _ from 'lodash';
|
|
4
2
|
import autoBindReact from 'auto-bind/react';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { connectStyle } from '@shoutem/theme';
|
|
6
6
|
import { View } from '../View';
|
|
7
7
|
import YearPickerButton from './YearRangePickerButton';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import autoBindReact from 'auto-bind/react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import { connectStyle } from '@shoutem/theme';
|
|
6
|
-
import { TouchableOpacity } from '../TouchableOpacity';
|
|
7
6
|
import { Icon } from '../Icon';
|
|
8
7
|
import { Text } from '../Text';
|
|
8
|
+
import { TouchableOpacity } from '../TouchableOpacity';
|
|
9
9
|
|
|
10
10
|
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
|
|
11
11
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import { LayoutAnimation, Platform } from 'react-native';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import _ from 'lodash';
|
|
5
3
|
import Modal from 'react-native-modal';
|
|
6
4
|
import autoBindReact from 'auto-bind/react';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
7
|
import { connectStyle } from '@shoutem/theme';
|
|
8
|
-
import { View } from '../View';
|
|
9
|
-
import { Text } from '../Text';
|
|
10
|
-
import { Icon } from '../Icon';
|
|
11
8
|
import { Button } from '../Button';
|
|
9
|
+
import { Icon } from '../Icon';
|
|
10
|
+
import { Text } from '../Text';
|
|
12
11
|
import { TouchableOpacity } from '../TouchableOpacity';
|
|
12
|
+
import { View } from '../View';
|
|
13
13
|
|
|
14
14
|
const NUMBER_OF_ROWS = 4;
|
|
15
15
|
const YEARS_IN_ROW = 5;
|
|
@@ -160,13 +160,13 @@ class YearRangePickerModal extends PureComponent {
|
|
|
160
160
|
|
|
161
161
|
const newYears = addToEnd
|
|
162
162
|
? [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
...selectedYears,
|
|
164
|
+
..._.times(yearsToAdd, index => _.last(selectedYears) + index + 1),
|
|
165
|
+
]
|
|
166
166
|
: [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
...selectedYears,
|
|
168
|
+
..._.times(yearsToAdd, index => _.head(selectedYears) - index + -1),
|
|
169
|
+
];
|
|
170
170
|
const sortedYears = _.sortBy(newYears, item => item);
|
|
171
171
|
|
|
172
172
|
this.setState({ selectedYears: sortedYears });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Card } from '../../components/Card';
|
|
3
2
|
import { Button } from '../../components/Button';
|
|
3
|
+
import { Card } from '../../components/Card';
|
|
4
4
|
import { Icon } from '../../components/Icon';
|
|
5
5
|
import { Image } from '../../components/Image';
|
|
6
6
|
import { Caption, Subtitle } from '../../components/Text';
|
|
@@ -44,8 +44,8 @@ export class DropDownMenus extends PureComponent {
|
|
|
44
44
|
onOptionSelected={option =>
|
|
45
45
|
this.setState({ selectedOption: option })
|
|
46
46
|
}
|
|
47
|
-
titleProperty=
|
|
48
|
-
valueProperty=
|
|
47
|
+
titleProperty="name"
|
|
48
|
+
valueProperty="id"
|
|
49
49
|
/>
|
|
50
50
|
</Stage>
|
|
51
51
|
<Stage title="Dropdown (horizontal)">
|
|
@@ -56,8 +56,8 @@ export class DropDownMenus extends PureComponent {
|
|
|
56
56
|
onOptionSelected={option =>
|
|
57
57
|
this.setState({ selectedOption: option })
|
|
58
58
|
}
|
|
59
|
-
titleProperty=
|
|
60
|
-
valueProperty=
|
|
59
|
+
titleProperty="name"
|
|
60
|
+
valueProperty="id"
|
|
61
61
|
/>
|
|
62
62
|
</Stage>
|
|
63
63
|
<Stage title="Dropdown (large)">
|
|
@@ -68,8 +68,8 @@ export class DropDownMenus extends PureComponent {
|
|
|
68
68
|
onOptionSelected={option =>
|
|
69
69
|
this.setState({ selectedOption: option })
|
|
70
70
|
}
|
|
71
|
-
titleProperty=
|
|
72
|
-
valueProperty=
|
|
71
|
+
titleProperty="name"
|
|
72
|
+
valueProperty="id"
|
|
73
73
|
/>
|
|
74
74
|
</Stage>
|
|
75
75
|
<Stage title="Dropdown (inside a form group)">
|
|
@@ -82,8 +82,8 @@ export class DropDownMenus extends PureComponent {
|
|
|
82
82
|
onOptionSelected={option =>
|
|
83
83
|
this.setState({ selectedOptionForFormGroupDropdown: option })
|
|
84
84
|
}
|
|
85
|
-
titleProperty=
|
|
86
|
-
valueProperty=
|
|
85
|
+
titleProperty="name"
|
|
86
|
+
valueProperty="id"
|
|
87
87
|
/>
|
|
88
88
|
</FormGroup>
|
|
89
89
|
</Stage>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import { DropDownMenu } from '../../components/DropDownMenu';
|
|
3
2
|
import { Divider } from '../../components/Divider';
|
|
3
|
+
import { DropDownMenu } from '../../components/DropDownMenu';
|
|
4
4
|
import { Screen } from '../../components/Screen';
|
|
5
5
|
import { ScrollView } from '../../components/ScrollView';
|
|
6
6
|
import { Buttons } from './Buttons';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import { Switch } from '../../components/Switch';
|
|
3
2
|
import { FormGroup } from '../../components/FormGroup';
|
|
3
|
+
import { Switch } from '../../components/Switch';
|
|
4
4
|
import { Caption } from '../../components/Text';
|
|
5
5
|
import { TextInput } from '../../components/TextInput';
|
|
6
6
|
import { View } from '../../components/View';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Text, Caption, Subtitle, Title, Heading } from '../../components/Text';
|
|
3
2
|
import { Button } from '../../components/Button';
|
|
4
3
|
import { Icon } from '../../components/Icon';
|
|
5
4
|
import { Overlay } from '../../components/Overlay';
|
|
5
|
+
import { Caption, Heading, Subtitle, Text, Title } from '../../components/Text';
|
|
6
6
|
import { Tile } from '../../components/Tile';
|
|
7
7
|
import { View } from '../../components/View';
|
|
8
8
|
import { Stage } from './Stage';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { Dimensions } from 'react-native';
|
|
4
|
-
import
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
5
4
|
import { Button } from '../../components/Button';
|
|
6
5
|
import { DropDownMenu } from '../../components/DropDownMenu';
|
|
7
6
|
import { Icon } from '../../components/Icon';
|
|
8
7
|
import { ImageBackground } from '../../components/ImageBackground';
|
|
9
8
|
import { NavigationBar } from '../../components/NavigationBar';
|
|
10
|
-
import { Text, Title
|
|
9
|
+
import { Heading, Text, Title } from '../../components/Text';
|
|
11
10
|
import { View } from '../../components/View';
|
|
12
11
|
import {
|
|
13
|
-
NAVIGATION_HEADER_HEIGHT,
|
|
14
12
|
IPHONE_X_NOTCH_PADDING,
|
|
15
13
|
IPHONE_XR_NOTCH_PADDING,
|
|
14
|
+
NAVIGATION_HEADER_HEIGHT,
|
|
16
15
|
} from '../../const';
|
|
16
|
+
import { Device } from '../../helpers/device-selector';
|
|
17
17
|
import { Stage } from './Stage';
|
|
18
18
|
|
|
19
19
|
const window = Dimensions.get('window');
|
|
@@ -3,7 +3,7 @@ import { Button } from '../../components/Button';
|
|
|
3
3
|
import { Icon } from '../../components/Icon';
|
|
4
4
|
import { Image } from '../../components/Image';
|
|
5
5
|
import { Row } from '../../components/Row';
|
|
6
|
-
import {
|
|
6
|
+
import { Caption, Subtitle, Text } from '../../components/Text';
|
|
7
7
|
import { View } from '../../components/View';
|
|
8
8
|
import { Stage } from './Stage';
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import { Icon } from '../../components/Icon';
|
|
|
4
4
|
import { Image } from '../../components/Image';
|
|
5
5
|
import { ImageBackground } from '../../components/ImageBackground';
|
|
6
6
|
import { Overlay } from '../../components/Overlay';
|
|
7
|
-
import {
|
|
7
|
+
import { Caption, Heading, Subtitle, Text, Title } from '../../components/Text';
|
|
8
8
|
import { Tile } from '../../components/Tile';
|
|
9
9
|
import { View } from '../../components/View';
|
|
10
10
|
import { Stage } from './Stage';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Caption, Heading, Subtitle, Text, Title } from '../../components/Text';
|
|
3
3
|
import { View } from '../../components/View';
|
|
4
4
|
import { Stage } from './Stage';
|
|
5
5
|
|
|
@@ -6,21 +6,21 @@ import { Stage } from './Stage';
|
|
|
6
6
|
export function Videos() {
|
|
7
7
|
return (
|
|
8
8
|
<View styleName="vertical collapsed">
|
|
9
|
-
<Stage title=
|
|
9
|
+
<Stage title="YouTube video">
|
|
10
10
|
<Video
|
|
11
11
|
source={{ uri: 'https://www.youtube.com/embed/2zuisMXzyaI' }}
|
|
12
12
|
width={320}
|
|
13
13
|
height={180}
|
|
14
14
|
/>
|
|
15
15
|
</Stage>
|
|
16
|
-
<Stage title=
|
|
16
|
+
<Stage title="Vimeo video">
|
|
17
17
|
<Video
|
|
18
18
|
source={{ uri: 'https://vimeo.com/182267614' }}
|
|
19
19
|
width={320}
|
|
20
20
|
height={180}
|
|
21
21
|
/>
|
|
22
22
|
</Stage>
|
|
23
|
-
<Stage title=
|
|
23
|
+
<Stage title="Stream video">
|
|
24
24
|
<Video
|
|
25
25
|
source={{
|
|
26
26
|
uri:
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dimensions, Platform } from 'react-native';
|
|
2
|
+
import { hasNotch } from 'react-native-device-info';
|
|
2
3
|
import _ from 'lodash';
|
|
3
4
|
import {
|
|
4
|
-
IPHONE_X_LONG_SIDE,
|
|
5
|
-
IPHONE_XR_LONG_SIDE,
|
|
6
5
|
IPHONE_12_LONG_SIDE,
|
|
7
6
|
IPHONE_12_MAX_LONG_SIDE,
|
|
7
|
+
IPHONE_X_LONG_SIDE,
|
|
8
|
+
IPHONE_XR_LONG_SIDE,
|
|
8
9
|
} from '../const';
|
|
9
10
|
|
|
10
11
|
const { OS, isPad, isTVOS } = Platform;
|
|
@@ -30,6 +31,8 @@ const isIphoneXR =
|
|
|
30
31
|
!isTVOS &&
|
|
31
32
|
(xrDimensionsMatch || twelveDimensionsMatch || twelveMaxDimensionsMatch);
|
|
32
33
|
|
|
34
|
+
const isNotchedAndroid = OS === 'android' && hasNotch();
|
|
35
|
+
|
|
33
36
|
/**
|
|
34
37
|
* Receives settings for different devices
|
|
35
38
|
* If the device is recognized, it returns only settings for that device
|
|
@@ -48,11 +51,16 @@ function select(settings) {
|
|
|
48
51
|
return settings.iPhoneXR;
|
|
49
52
|
}
|
|
50
53
|
|
|
54
|
+
if (settings.notchedAndroid && isNotchedAndroid) {
|
|
55
|
+
return settings.notchedAndroid;
|
|
56
|
+
}
|
|
57
|
+
|
|
51
58
|
return _.get(settings, 'default');
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
export const Device = {
|
|
55
62
|
isIphoneX,
|
|
56
63
|
isIphoneXR,
|
|
64
|
+
isNotchedAndroid,
|
|
57
65
|
select,
|
|
58
66
|
};
|
package/helpers/keyboard.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Platform } from 'react-native';
|
|
2
|
-
import { getStatusBarHeight } from 'react-native-status-bar-height';
|
|
1
|
+
import { Platform, StatusBar } from 'react-native';
|
|
3
2
|
import { NAVIGATION_BAR_HEIGHT } from '../theme';
|
|
4
3
|
|
|
5
4
|
export function calculateKeyboardOffset(extraOffset = 0) {
|
|
@@ -9,7 +8,7 @@ export function calculateKeyboardOffset(extraOffset = 0) {
|
|
|
9
8
|
return resolvedOffset;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
return
|
|
11
|
+
return StatusBar.currentHeight + resolvedOffset;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
export default { calculateKeyboardOffset };
|
package/html/Html.js
CHANGED
|
@@ -5,14 +5,14 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { connectStyle } from '@shoutem/theme';
|
|
6
6
|
import { Spinner } from '../components/Spinner';
|
|
7
7
|
import { View } from '../components/View';
|
|
8
|
-
import { parseHtml } from './services/HtmlParser';
|
|
9
8
|
import {
|
|
10
|
-
|
|
9
|
+
Display,
|
|
11
10
|
getElement,
|
|
12
11
|
getElementDisplay,
|
|
13
12
|
getElementProperty,
|
|
14
|
-
|
|
13
|
+
registerElement,
|
|
15
14
|
} from './services/ElementRegistry';
|
|
15
|
+
import { parseHtml } from './services/HtmlParser';
|
|
16
16
|
|
|
17
17
|
const defaultElementSettings = {
|
|
18
18
|
display: Display.BLOCK,
|
package/html/components/Image.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
+
import { Image as RNImage } from 'react-native';
|
|
2
3
|
import autoBindReact from 'auto-bind/react';
|
|
3
4
|
import _ from 'lodash';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { Image as RNImage } from 'react-native';
|
|
6
6
|
import { Image } from '../../components/Image';
|
|
7
7
|
import { ImageBackground } from '../../components/ImageBackground';
|
|
8
8
|
import { Lightbox } from '../../components/Lightbox';
|