@shoutem/ui 4.7.0 → 4.9.1
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 +1 -1
- package/components/ScrollView/ScrollView.js +3 -3
- 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 +17 -4
- 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 +3 -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 +18 -9
- package/scripts/add-native-deps.js +0 -1
- package/theme.js +7 -7
|
@@ -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;
|
|
@@ -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';
|
|
@@ -19,10 +19,22 @@ class TextInput extends PureComponent {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
handleBlur() {
|
|
22
|
+
const { onBlur } = this.props;
|
|
23
|
+
|
|
24
|
+
if (onBlur) {
|
|
25
|
+
onBlur();
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
this.setState({ isFocused: false });
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
handleFocus() {
|
|
32
|
+
const { onFocus } = this.props;
|
|
33
|
+
|
|
34
|
+
if (onFocus) {
|
|
35
|
+
onFocus();
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
this.setState({ isFocused: true });
|
|
27
39
|
}
|
|
28
40
|
|
|
@@ -44,6 +56,7 @@ class TextInput extends PureComponent {
|
|
|
44
56
|
withBorder,
|
|
45
57
|
withoutBorder,
|
|
46
58
|
wiggleAnimation,
|
|
59
|
+
errorText,
|
|
47
60
|
...otherStyle
|
|
48
61
|
} = style;
|
|
49
62
|
|
|
@@ -61,14 +74,14 @@ class TextInput extends PureComponent {
|
|
|
61
74
|
selectionColor={selectionColor}
|
|
62
75
|
underlineColorAndroid={underlineColorAndroid}
|
|
63
76
|
style={{
|
|
64
|
-
...otherStyle,
|
|
65
77
|
...(hasBorder ? withBorder : withoutBorder),
|
|
66
|
-
...(
|
|
78
|
+
...(errorMessage ? errorBorderColor : {}),
|
|
79
|
+
...otherStyle,
|
|
67
80
|
}}
|
|
68
81
|
/>
|
|
69
82
|
</Wiggle>
|
|
70
83
|
{!!errorMessage && (
|
|
71
|
-
<Caption styleName="form-error sm-gutter-top">{errorMessage}</Caption>
|
|
84
|
+
<Caption styleName="form-error sm-gutter-top" style={errorText}>{errorMessage}</Caption>
|
|
72
85
|
)}
|
|
73
86
|
</View>
|
|
74
87
|
);
|
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,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dimensions, Platform } from 'react-native';
|
|
2
2
|
import { hasNotch } from 'react-native-device-info';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import {
|
|
5
|
-
IPHONE_X_LONG_SIDE,
|
|
6
|
-
IPHONE_XR_LONG_SIDE,
|
|
7
5
|
IPHONE_12_LONG_SIDE,
|
|
8
6
|
IPHONE_12_MAX_LONG_SIDE,
|
|
7
|
+
IPHONE_X_LONG_SIDE,
|
|
8
|
+
IPHONE_XR_LONG_SIDE,
|
|
9
9
|
} from '../const';
|
|
10
10
|
|
|
11
11
|
const { OS, isPad, isTVOS } = Platform;
|
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';
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Dimensions, Linking } from 'react-native';
|
|
2
|
-
import autoBindReact from 'auto-bind/react';
|
|
3
|
-
import _ from 'lodash';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
1
|
import React, { PureComponent } from 'react';
|
|
2
|
+
import { Dimensions, Linking } from 'react-native';
|
|
6
3
|
import Html from 'react-native-render-html';
|
|
4
|
+
import { iframe } from 'react-native-render-html/src/HTMLRenderers';
|
|
7
5
|
import {
|
|
8
|
-
cssStringToObject,
|
|
9
6
|
cssObjectToString,
|
|
7
|
+
cssStringToObject,
|
|
10
8
|
} from 'react-native-render-html/src/HTMLStyles';
|
|
11
|
-
import WebView from 'react-native-webview';
|
|
12
9
|
import {
|
|
13
|
-
makeTableRenderer,
|
|
14
10
|
alterNode as tableAlterNode,
|
|
15
11
|
cssRulesFromSpecs,
|
|
16
12
|
defaultTableStylesSpecs,
|
|
17
13
|
IGNORED_TAGS,
|
|
14
|
+
makeTableRenderer,
|
|
18
15
|
} from 'react-native-render-html-table-bridge';
|
|
19
|
-
import
|
|
16
|
+
import WebView from 'react-native-webview';
|
|
20
17
|
import YoutubePlayer from 'react-native-youtube-iframe';
|
|
18
|
+
import autoBindReact from 'auto-bind/react';
|
|
19
|
+
import _ from 'lodash';
|
|
20
|
+
import PropTypes from 'prop-types';
|
|
21
21
|
import { connectStyle } from '@shoutem/theme';
|
|
22
|
-
import { View } from '../../components/View';
|
|
23
22
|
import { Text } from '../../components/Text';
|
|
23
|
+
import { View } from '../../components/View';
|
|
24
24
|
import getEmptyObjectKeys from '../services/getEmptyObjectKeys';
|
|
25
25
|
import isValidVideoFormat from '../services/isValidVideoFormat';
|
|
26
26
|
import Image from './Image';
|
package/html/elements/A.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
+
import { Linking } 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 { Linking } from 'react-native';
|
|
6
6
|
import { connectStyle } from '@shoutem/theme';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { combineMappers, ElementPropTypes, mapElementProps } from '../Html';
|
|
8
|
+
import { isImg } from './Img';
|
|
9
9
|
import { Inline } from './Inline';
|
|
10
10
|
|
|
11
11
|
class A extends PureComponent {
|
package/html/elements/Block.js
CHANGED
package/html/elements/Img.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import Image from '../components/Image';
|
|
4
|
-
import {
|
|
4
|
+
import { combineMappers, ElementPropTypes, mapElementProps } from '../Html';
|
|
5
5
|
|
|
6
6
|
export function isImg(element) {
|
|
7
7
|
return _.get(element, 'tag') === 'img';
|
package/html/elements/Inline.js
CHANGED
|
@@ -4,17 +4,17 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { Text } from '../../components/Text';
|
|
5
5
|
import { TouchableOpacity } from '../../components/TouchableOpacity';
|
|
6
6
|
import { View } from '../../components/View';
|
|
7
|
-
import { Display } from '../services/ElementRegistry';
|
|
8
7
|
import {
|
|
9
|
-
isBlockElement,
|
|
10
|
-
hasBlockElement,
|
|
11
|
-
ElementPropTypes,
|
|
12
8
|
combineMappers,
|
|
9
|
+
ElementPropTypes,
|
|
10
|
+
hasBlockElement,
|
|
11
|
+
isBlockElement,
|
|
13
12
|
mapElementProps,
|
|
14
13
|
renderChildElements,
|
|
15
14
|
} from '../Html';
|
|
15
|
+
import { Display } from '../services/ElementRegistry';
|
|
16
16
|
import { isImg } from './Img';
|
|
17
|
-
import {
|
|
17
|
+
import { isText, removeWhiteSpace } from './Text';
|
|
18
18
|
|
|
19
19
|
export const blockDisplayIfAnyChildIsBlock = function(element) {
|
|
20
20
|
return hasBlockElement(element.childElements)
|