@shoutem/ui 5.1.0 → 5.2.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/components/ActionSheet/ActionSheet.js +15 -8
- package/components/ActionSheet/ActionSheetOption.js +7 -2
- package/components/Button.js +5 -9
- package/components/CategoryPicker/Category.js +45 -0
- package/components/CategoryPicker/CategoryPicker.js +62 -0
- package/components/CategoryPicker/index.js +1 -0
- package/components/CategoryPicker/shapes.js +7 -0
- package/components/DateTimePicker.js +4 -1
- package/components/DropDownMenu/DropDownMenu.js +20 -23
- package/components/DropDownMenu/DropDownModal.js +56 -54
- package/components/EmptyStateView.js +16 -12
- package/components/FormGroup.js +7 -1
- package/components/GridRow.js +1 -1
- package/components/HorizontalPager/HorizontalPager.js +61 -52
- package/components/HorizontalPager/Page.js +12 -7
- package/components/Icon/Icon.js +1 -1
- package/components/Image.js +4 -4
- package/components/ImageBackground.js +4 -4
- package/components/ImageGallery/ImageGallery.android.js +8 -0
- package/components/ImageGallery/ImageGallery.ios.js +8 -0
- package/components/ImageGallery/ImageGalleryBase.js +65 -48
- package/components/ImageGalleryOverlay.js +12 -7
- package/components/ImagePreview.js +19 -14
- package/components/InlineDropDownMenu/InlineDropDownMenu.js +27 -18
- package/components/InlineDropDownMenu/InlineDropDownMenuItem.js +17 -9
- package/components/InlineGallery.js +42 -35
- package/components/LinearGradient.js +15 -5
- package/components/ListView.js +1 -2
- package/components/LoadingContainer.js +1 -2
- package/components/NavigationBar/NavigationBar.js +18 -13
- package/components/NumberInput.js +32 -24
- package/components/PageIndicators.js +19 -17
- package/components/ScrollView/ScrollDriverProvider.js +20 -10
- package/components/ScrollView/ScrollView.js +15 -13
- package/components/SearchField.js +24 -18
- package/components/ShareButton.js +21 -11
- package/components/Spinner.js +1 -1
- package/components/Switch.js +19 -14
- package/components/TabMenu/TabMenu.js +12 -7
- package/components/TabMenu/TabMenuItem.js +13 -7
- package/components/TextInput.js +3 -1
- package/components/Touchable.js +19 -23
- package/components/TouchableNativeFeedback.js +15 -21
- package/components/TouchableOpacity.js +6 -12
- package/components/Video/Video.js +21 -25
- package/components/View.js +7 -9
- package/components/YearRangePicker/YearRangePicker.js +22 -17
- package/components/YearRangePicker/YearRangePickerButton.js +13 -7
- package/components/YearRangePicker/YearRangePickerModal.js +23 -16
- package/examples/components/NavigationBars.js +4 -0
- package/examples/components/Stage.js +6 -1
- package/html/Html.js +14 -8
- package/html/components/Gallery.js +9 -5
- package/html/components/Image.js +16 -16
- package/html/components/SimpleHtml.js +19 -10
- package/html/elements/A.js +11 -6
- package/html/elements/Inline.js +13 -14
- package/html/elements/Text.js +6 -0
- package/html/elements/Video.js +3 -1
- package/html/elements/list/Li.js +0 -2
- package/html/elements/list/Ol.js +4 -0
- package/html/elements/list/Ul.js +4 -0
- package/html/elements/list/prefix/Bullet.js +4 -0
- package/html/elements/list/prefix/Number.js +6 -1
- package/index.js +42 -54
- package/package.json +1 -1
- package/theme.js +51 -0
|
@@ -36,24 +36,6 @@ function getSource(sourceReader, poster) {
|
|
|
36
36
|
* @returns {*}
|
|
37
37
|
*/
|
|
38
38
|
class Video extends PureComponent {
|
|
39
|
-
static propTypes = {
|
|
40
|
-
width: PropTypes.number,
|
|
41
|
-
height: PropTypes.number,
|
|
42
|
-
// `playerParams` currently only works for Youtube
|
|
43
|
-
playerParams: PropTypes.object,
|
|
44
|
-
source: PropTypes.shape({
|
|
45
|
-
uri: PropTypes.string,
|
|
46
|
-
}),
|
|
47
|
-
style: PropTypes.object,
|
|
48
|
-
poster: PropTypes.string,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
static defaultProps = {
|
|
52
|
-
playerParams: {
|
|
53
|
-
showinfo: 0,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
39
|
constructor(props) {
|
|
58
40
|
super(props);
|
|
59
41
|
|
|
@@ -64,16 +46,10 @@ class Video extends PureComponent {
|
|
|
64
46
|
render() {
|
|
65
47
|
const { width, height, style, poster } = this.props;
|
|
66
48
|
|
|
67
|
-
// https://github.com/vimeo/player.js/issues/514
|
|
68
|
-
// Vimeo player crashes the app, if played in full screen portrait mode and if user
|
|
69
|
-
// tries to navigate back using Android hardware back button. Disableing full screen
|
|
70
|
-
// option for Vimeo until their player is fixed.
|
|
71
|
-
const isYoutubeVideo = this.sourceReader.isYouTube;
|
|
72
|
-
|
|
73
49
|
return (
|
|
74
50
|
<View style={style.container}>
|
|
75
51
|
<WebView
|
|
76
|
-
allowsFullscreenVideo
|
|
52
|
+
allowsFullscreenVideo
|
|
77
53
|
mediaPlaybackRequiresUserAction={false}
|
|
78
54
|
style={{ width, height }}
|
|
79
55
|
source={getSource(this.sourceReader, poster)}
|
|
@@ -85,6 +61,26 @@ class Video extends PureComponent {
|
|
|
85
61
|
}
|
|
86
62
|
}
|
|
87
63
|
|
|
64
|
+
Video.propTypes = {
|
|
65
|
+
style: PropTypes.object.isRequired,
|
|
66
|
+
height: PropTypes.number,
|
|
67
|
+
// `playerParams` currently only works for Youtube
|
|
68
|
+
playerParams: PropTypes.object,
|
|
69
|
+
poster: PropTypes.string,
|
|
70
|
+
source: PropTypes.shape({
|
|
71
|
+
uri: PropTypes.string,
|
|
72
|
+
}),
|
|
73
|
+
width: PropTypes.number,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
Video.defaultProps = {
|
|
77
|
+
width: undefined,
|
|
78
|
+
height: undefined,
|
|
79
|
+
playerParams: { showinfo: 0 },
|
|
80
|
+
source: undefined,
|
|
81
|
+
poster: undefined,
|
|
82
|
+
};
|
|
83
|
+
|
|
88
84
|
const AnimatedVideo = connectAnimation(Video);
|
|
89
85
|
const StyledVideo = connectStyle('shoutem.ui.Video')(AnimatedVideo);
|
|
90
86
|
|
package/components/View.js
CHANGED
|
@@ -7,25 +7,23 @@ import { LinearGradient } from './LinearGradient';
|
|
|
7
7
|
|
|
8
8
|
class View extends PureComponent {
|
|
9
9
|
render() {
|
|
10
|
-
const style =
|
|
11
|
-
|
|
10
|
+
const { children, style, ...otherProps } = this.props;
|
|
11
|
+
const { backgroundGradient, ...viewStyle } = style;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
let gradient = null;
|
|
14
|
+
if (backgroundGradient) {
|
|
14
15
|
gradient = (
|
|
15
16
|
<LinearGradient
|
|
16
17
|
styleName="fill-parent"
|
|
17
18
|
style={style.backgroundGradient}
|
|
18
19
|
/>
|
|
19
20
|
);
|
|
20
|
-
|
|
21
|
-
// This is not a valid RN View style
|
|
22
|
-
delete style.backgroundGradient;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
return (
|
|
26
|
-
<RNView {...
|
|
24
|
+
<RNView {...otherProps} style={viewStyle}>
|
|
27
25
|
{gradient}
|
|
28
|
-
{
|
|
26
|
+
{children}
|
|
29
27
|
</RNView>
|
|
30
28
|
);
|
|
31
29
|
}
|
|
@@ -33,7 +31,7 @@ class View extends PureComponent {
|
|
|
33
31
|
|
|
34
32
|
View.propTypes = {
|
|
35
33
|
...ViewPropTypes,
|
|
36
|
-
style: PropTypes.object,
|
|
34
|
+
style: PropTypes.object.isRequired,
|
|
37
35
|
};
|
|
38
36
|
|
|
39
37
|
const AnimatedView = connectAnimation(View);
|
|
@@ -25,22 +25,6 @@ function formatButtonTooltip(props) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
class YearRangePicker extends PureComponent {
|
|
28
|
-
static propTypes = {
|
|
29
|
-
onRangeConfirmed: PropTypes.func,
|
|
30
|
-
onReset: PropTypes.func,
|
|
31
|
-
resetButtonTitle: PropTypes.string,
|
|
32
|
-
confirmButtonTitle: PropTypes.string,
|
|
33
|
-
selectedYears: PropTypes.arrayOf(PropTypes.number),
|
|
34
|
-
rangeStart: PropTypes.number,
|
|
35
|
-
rangeEnd: PropTypes.number,
|
|
36
|
-
buttonPlaceholder: PropTypes.string,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
static defaultProps = {
|
|
40
|
-
selectedYears: [],
|
|
41
|
-
buttonPlaceholder: 'Year',
|
|
42
|
-
};
|
|
43
|
-
|
|
44
28
|
constructor(props) {
|
|
45
29
|
super(props);
|
|
46
30
|
|
|
@@ -48,7 +32,6 @@ class YearRangePicker extends PureComponent {
|
|
|
48
32
|
|
|
49
33
|
this.state = {
|
|
50
34
|
collapsed: false,
|
|
51
|
-
selectedYears: props.selectedYears,
|
|
52
35
|
buttonTooltip: formatButtonTooltip(props),
|
|
53
36
|
};
|
|
54
37
|
}
|
|
@@ -108,4 +91,26 @@ class YearRangePicker extends PureComponent {
|
|
|
108
91
|
}
|
|
109
92
|
}
|
|
110
93
|
|
|
94
|
+
YearRangePicker.propTypes = {
|
|
95
|
+
// Disabling as this prop is used in the formatButtonTooltip function.
|
|
96
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
97
|
+
buttonPlaceholder: PropTypes.string,
|
|
98
|
+
confirmButtonTitle: PropTypes.string,
|
|
99
|
+
rangeEnd: PropTypes.number,
|
|
100
|
+
rangeStart: PropTypes.number,
|
|
101
|
+
resetButtonTitle: PropTypes.string,
|
|
102
|
+
selectedYears: PropTypes.arrayOf(PropTypes.number),
|
|
103
|
+
onRangeConfirmed: PropTypes.func,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
YearRangePicker.defaultProps = {
|
|
107
|
+
buttonPlaceholder: 'Year',
|
|
108
|
+
confirmButtonTitle: undefined,
|
|
109
|
+
rangeEnd: undefined,
|
|
110
|
+
rangeStart: undefined,
|
|
111
|
+
resetButtonTitle: undefined,
|
|
112
|
+
selectedYears: [],
|
|
113
|
+
onRangeConfirmed: undefined,
|
|
114
|
+
};
|
|
115
|
+
|
|
111
116
|
export default connectStyle('shoutem.ui.YearRangePicker')(YearRangePicker);
|
|
@@ -10,13 +10,6 @@ import { TouchableOpacity } from '../TouchableOpacity';
|
|
|
10
10
|
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
|
|
11
11
|
|
|
12
12
|
class YearRangePickerButton extends PureComponent {
|
|
13
|
-
static propTypes = {
|
|
14
|
-
onPress: PropTypes.func,
|
|
15
|
-
tooltip: PropTypes.string,
|
|
16
|
-
collapsed: PropTypes.bool,
|
|
17
|
-
style: PropTypes.any,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
13
|
constructor(props) {
|
|
21
14
|
super(props);
|
|
22
15
|
|
|
@@ -65,6 +58,19 @@ class YearRangePickerButton extends PureComponent {
|
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
60
|
|
|
61
|
+
YearRangePickerButton.propTypes = {
|
|
62
|
+
style: PropTypes.object.isRequired,
|
|
63
|
+
collapsed: PropTypes.bool,
|
|
64
|
+
tooltip: PropTypes.string,
|
|
65
|
+
onPress: PropTypes.func,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
YearRangePickerButton.defaultProps = {
|
|
69
|
+
collapsed: undefined,
|
|
70
|
+
tooltip: undefined,
|
|
71
|
+
onPress: undefined,
|
|
72
|
+
};
|
|
73
|
+
|
|
68
74
|
export default connectStyle('shoutem.ui.YearRangePickerButton')(
|
|
69
75
|
YearRangePickerButton,
|
|
70
76
|
);
|
|
@@ -42,22 +42,6 @@ function resolveRangeTooltip(visibleYears) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
class YearRangePickerModal extends PureComponent {
|
|
45
|
-
static propTypes = {
|
|
46
|
-
onRangeConfirmed: PropTypes.func,
|
|
47
|
-
onDismiss: PropTypes.func,
|
|
48
|
-
resetButtonTitle: PropTypes.string,
|
|
49
|
-
confirmButtonTitle: PropTypes.string,
|
|
50
|
-
selectedYears: PropTypes.arrayOf(PropTypes.number),
|
|
51
|
-
rangeStart: PropTypes.number,
|
|
52
|
-
rangeEnd: PropTypes.number,
|
|
53
|
-
visible: PropTypes.bool,
|
|
54
|
-
style: PropTypes.any,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
static defaultProps = {
|
|
58
|
-
selectedYears: [],
|
|
59
|
-
};
|
|
60
|
-
|
|
61
45
|
constructor(props) {
|
|
62
46
|
super(props);
|
|
63
47
|
|
|
@@ -283,6 +267,29 @@ class YearRangePickerModal extends PureComponent {
|
|
|
283
267
|
}
|
|
284
268
|
}
|
|
285
269
|
|
|
270
|
+
YearRangePickerModal.propTypes = {
|
|
271
|
+
style: PropTypes.object.isRequired,
|
|
272
|
+
confirmButtonTitle: PropTypes.string,
|
|
273
|
+
rangeEnd: PropTypes.number,
|
|
274
|
+
rangeStart: PropTypes.number,
|
|
275
|
+
resetButtonTitle: PropTypes.string,
|
|
276
|
+
selectedYears: PropTypes.arrayOf(PropTypes.number),
|
|
277
|
+
visible: PropTypes.bool,
|
|
278
|
+
onDismiss: PropTypes.func,
|
|
279
|
+
onRangeConfirmed: PropTypes.func,
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
YearRangePickerModal.defaultProps = {
|
|
283
|
+
confirmButtonTitle: undefined,
|
|
284
|
+
rangeEnd: undefined,
|
|
285
|
+
rangeStart: undefined,
|
|
286
|
+
resetButtonTitle: undefined,
|
|
287
|
+
selectedYears: [],
|
|
288
|
+
visible: false,
|
|
289
|
+
onDismiss: undefined,
|
|
290
|
+
onRangeConfirmed: undefined,
|
|
291
|
+
};
|
|
292
|
+
|
|
286
293
|
export default connectStyle('shoutem.ui.YearRangePickerModal')(
|
|
287
294
|
YearRangePickerModal,
|
|
288
295
|
);
|
|
@@ -15,8 +15,13 @@ function Stage({ title, children }) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
Stage.propTypes = {
|
|
18
|
-
title: PropTypes.string,
|
|
19
18
|
children: PropTypes.node,
|
|
19
|
+
title: PropTypes.string,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
Stage.defaultProps = {
|
|
23
|
+
children: undefined,
|
|
24
|
+
title: undefined,
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
const styles = {
|
package/html/Html.js
CHANGED
|
@@ -19,12 +19,6 @@ const defaultElementSettings = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
class Html extends PureComponent {
|
|
22
|
-
static propTypes = {
|
|
23
|
-
body: PropTypes.string.isRequired,
|
|
24
|
-
renderElement: PropTypes.func,
|
|
25
|
-
style: PropTypes.object,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
22
|
/**
|
|
29
23
|
* Create Element class for given element tag and add it to the ElementClassMap.
|
|
30
24
|
* Use the settings to additionally describe a Element class.
|
|
@@ -88,11 +82,13 @@ class Html extends PureComponent {
|
|
|
88
82
|
* @returns {Component} The element rendered as a React Native component
|
|
89
83
|
*/
|
|
90
84
|
renderElement(element) {
|
|
85
|
+
const { renderElement } = this.props;
|
|
86
|
+
|
|
91
87
|
const elementStyle = this.getElementStyle(element);
|
|
92
88
|
let renderedElement;
|
|
93
89
|
|
|
94
|
-
if (
|
|
95
|
-
renderedElement =
|
|
90
|
+
if (renderElement) {
|
|
91
|
+
renderedElement = renderElement(
|
|
96
92
|
element,
|
|
97
93
|
elementStyle,
|
|
98
94
|
this.renderElement,
|
|
@@ -151,6 +147,16 @@ class Html extends PureComponent {
|
|
|
151
147
|
}
|
|
152
148
|
}
|
|
153
149
|
|
|
150
|
+
Html.propTypes = {
|
|
151
|
+
body: PropTypes.string.isRequired,
|
|
152
|
+
style: PropTypes.object.isRequired,
|
|
153
|
+
renderElement: PropTypes.func,
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
Html.defaultProps = {
|
|
157
|
+
renderElement: undefined,
|
|
158
|
+
};
|
|
159
|
+
|
|
154
160
|
export const ElementPropTypes = {
|
|
155
161
|
childElements: PropTypes.array,
|
|
156
162
|
renderElement: PropTypes.func,
|
|
@@ -8,11 +8,6 @@ import { InlineGallery } from '../../components/InlineGallery';
|
|
|
8
8
|
* Style interface correspond to InlineGallery from @shoutem/ui.
|
|
9
9
|
*/
|
|
10
10
|
export default class Gallery extends PureComponent {
|
|
11
|
-
static propTypes = {
|
|
12
|
-
...InlineGallery.propTypes,
|
|
13
|
-
handlePhotoPress: PropTypes.func,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
11
|
constructor(props) {
|
|
17
12
|
super(props);
|
|
18
13
|
|
|
@@ -53,3 +48,12 @@ export default class Gallery extends PureComponent {
|
|
|
53
48
|
);
|
|
54
49
|
}
|
|
55
50
|
}
|
|
51
|
+
|
|
52
|
+
Gallery.propTypes = {
|
|
53
|
+
...InlineGallery.propTypes,
|
|
54
|
+
handlePhotoPress: PropTypes.func,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
Gallery.defaultProps = {
|
|
58
|
+
handlePhotoPress: undefined,
|
|
59
|
+
};
|
package/html/components/Image.js
CHANGED
|
@@ -14,17 +14,6 @@ import { Lightbox } from '../../components/Lightbox';
|
|
|
14
14
|
* this component will determine the Image dimensions before rendering an image.
|
|
15
15
|
*/
|
|
16
16
|
export default class HtmlImage extends PureComponent {
|
|
17
|
-
static propTypes = {
|
|
18
|
-
...RNImage.propTypes,
|
|
19
|
-
lightbox: PropTypes.bool,
|
|
20
|
-
allowUpscale: PropTypes.bool,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
static defaultProps = {
|
|
24
|
-
lightbox: true,
|
|
25
|
-
allowUpscale: false,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
17
|
constructor(props) {
|
|
29
18
|
super(props);
|
|
30
19
|
|
|
@@ -46,13 +35,13 @@ export default class HtmlImage extends PureComponent {
|
|
|
46
35
|
this.setState({ width, height });
|
|
47
36
|
}
|
|
48
37
|
|
|
38
|
+
// TODO - handle properly
|
|
49
39
|
imageSizeLoadFailed() {
|
|
50
|
-
|
|
40
|
+
const {
|
|
41
|
+
source: { uri },
|
|
42
|
+
} = this.props;
|
|
51
43
|
// eslint-disable-next-line no-console
|
|
52
|
-
console.warn(
|
|
53
|
-
'Could not load image size for image: ',
|
|
54
|
-
this.props.source.uri,
|
|
55
|
-
);
|
|
44
|
+
console.warn('Could not load image size for image: ', uri);
|
|
56
45
|
}
|
|
57
46
|
|
|
58
47
|
render() {
|
|
@@ -108,3 +97,14 @@ export default class HtmlImage extends PureComponent {
|
|
|
108
97
|
);
|
|
109
98
|
}
|
|
110
99
|
}
|
|
100
|
+
|
|
101
|
+
HtmlImage.propTypes = {
|
|
102
|
+
...RNImage.propTypes,
|
|
103
|
+
allowUpscale: PropTypes.bool,
|
|
104
|
+
lightbox: PropTypes.bool,
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
HtmlImage.defaultProps = {
|
|
108
|
+
allowUpscale: false,
|
|
109
|
+
lightbox: true,
|
|
110
|
+
};
|
|
@@ -54,16 +54,6 @@ function resolveDimensions(objectToResize, style) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
class SimpleHtml extends PureComponent {
|
|
57
|
-
static propTypes = {
|
|
58
|
-
body: PropTypes.string,
|
|
59
|
-
attachments: PropTypes.array,
|
|
60
|
-
style: PropTypes.object,
|
|
61
|
-
customTagStyles: PropTypes.object,
|
|
62
|
-
customHandleLinkPress: PropTypes.func,
|
|
63
|
-
unsupportedVideoFormatMessage: PropTypes.string,
|
|
64
|
-
customAlterNode: PropTypes.func,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
57
|
constructor(props) {
|
|
68
58
|
super(props);
|
|
69
59
|
|
|
@@ -309,4 +299,23 @@ class SimpleHtml extends PureComponent {
|
|
|
309
299
|
}
|
|
310
300
|
}
|
|
311
301
|
|
|
302
|
+
SimpleHtml.propTypes = {
|
|
303
|
+
style: PropTypes.object.isRequired,
|
|
304
|
+
attachments: PropTypes.array,
|
|
305
|
+
body: PropTypes.string,
|
|
306
|
+
customAlterNode: PropTypes.func,
|
|
307
|
+
customHandleLinkPress: PropTypes.func,
|
|
308
|
+
customTagStyles: PropTypes.object,
|
|
309
|
+
unsupportedVideoFormatMessage: PropTypes.string,
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
SimpleHtml.defaultProps = {
|
|
313
|
+
attachments: undefined,
|
|
314
|
+
body: undefined,
|
|
315
|
+
customAlterNode: undefined,
|
|
316
|
+
customHandleLinkPress: undefined,
|
|
317
|
+
customTagStyles: undefined,
|
|
318
|
+
unsupportedVideoFormatMessage: undefined,
|
|
319
|
+
};
|
|
320
|
+
|
|
312
321
|
export default connectStyle('shoutem.ui.SimpleHtml')(SimpleHtml);
|
package/html/elements/A.js
CHANGED
|
@@ -9,12 +9,6 @@ import { isImg } from './Img';
|
|
|
9
9
|
import { Inline } from './Inline';
|
|
10
10
|
|
|
11
11
|
class A extends PureComponent {
|
|
12
|
-
static propTypes = {
|
|
13
|
-
...ElementPropTypes,
|
|
14
|
-
handleLinkPress: PropTypes.func,
|
|
15
|
-
href: PropTypes.string,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
12
|
constructor(props, context) {
|
|
19
13
|
super(props, context);
|
|
20
14
|
|
|
@@ -63,6 +57,17 @@ class A extends PureComponent {
|
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
59
|
|
|
60
|
+
A.propTypes = {
|
|
61
|
+
...ElementPropTypes,
|
|
62
|
+
handleLinkPress: PropTypes.func,
|
|
63
|
+
href: PropTypes.string,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
A.defaultProps = {
|
|
67
|
+
handleLinkPress: undefined,
|
|
68
|
+
href: undefined,
|
|
69
|
+
};
|
|
70
|
+
|
|
66
71
|
function openLinkPress(Component) {
|
|
67
72
|
return function(props) {
|
|
68
73
|
function handleLinkPress(href) {
|
package/html/elements/Inline.js
CHANGED
|
@@ -138,20 +138,6 @@ function renderGroupedChildren(groupedChildren, renderElement, style) {
|
|
|
138
138
|
* @constructor
|
|
139
139
|
*/
|
|
140
140
|
export class Inline extends PureComponent {
|
|
141
|
-
static defaultProps = {
|
|
142
|
-
style: {},
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
static propTypes = {
|
|
146
|
-
...ElementPropTypes,
|
|
147
|
-
onPress: PropTypes.func,
|
|
148
|
-
onLineBreak: PropTypes.func,
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
static defaultProps = {
|
|
152
|
-
onLineBreak: handleLineBreak,
|
|
153
|
-
};
|
|
154
|
-
|
|
155
141
|
render() {
|
|
156
142
|
const {
|
|
157
143
|
block,
|
|
@@ -207,6 +193,19 @@ export class Inline extends PureComponent {
|
|
|
207
193
|
}
|
|
208
194
|
}
|
|
209
195
|
|
|
196
|
+
Inline.propTypes = {
|
|
197
|
+
...ElementPropTypes,
|
|
198
|
+
style: PropTypes.object,
|
|
199
|
+
onLineBreak: PropTypes.func,
|
|
200
|
+
onPress: PropTypes.func,
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
Inline.defaultProps = {
|
|
204
|
+
style: {},
|
|
205
|
+
onLineBreak: handleLineBreak,
|
|
206
|
+
onPress: undefined,
|
|
207
|
+
};
|
|
208
|
+
|
|
210
209
|
export const InlineSettings = { display: blockDisplayIfAnyChildIsBlock };
|
|
211
210
|
|
|
212
211
|
export default combineMappers(mapElementProps)(Inline);
|
package/html/elements/Text.js
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
3
|
import { AllHtmlEntities as Entities } from 'html-entities';
|
|
4
4
|
import _ from 'lodash';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { combineMappers, ElementPropTypes, mapElementProps } from '../Html';
|
|
6
7
|
|
|
7
8
|
const html = new Entities();
|
|
@@ -57,6 +58,11 @@ export function TextElement(props) {
|
|
|
57
58
|
|
|
58
59
|
TextElement.propTypes = {
|
|
59
60
|
...ElementPropTypes,
|
|
61
|
+
style: PropTypes.object,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
TextElement.defaultProps = {
|
|
65
|
+
style: {},
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
export default combineMappers(mapElementProps)(TextElement);
|
package/html/elements/Video.js
CHANGED
|
@@ -22,11 +22,12 @@ function Video({ src, thumbnailUrl, style }) {
|
|
|
22
22
|
|
|
23
23
|
Video.propTypes = {
|
|
24
24
|
src: PropTypes.string,
|
|
25
|
-
thumbnailUrl: PropTypes.string,
|
|
26
25
|
style: PropTypes.object,
|
|
26
|
+
thumbnailUrl: PropTypes.string,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
Video.defaultProps = {
|
|
30
|
+
src: undefined,
|
|
30
31
|
style: {
|
|
31
32
|
container: {
|
|
32
33
|
alignSelf: 'stretch',
|
|
@@ -34,6 +35,7 @@ Video.defaultProps = {
|
|
|
34
35
|
alignItems: 'center',
|
|
35
36
|
},
|
|
36
37
|
},
|
|
38
|
+
thumbnailUrl: undefined,
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export default combineMappers(mapElementProps)(Video);
|
package/html/elements/list/Li.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { ElementPropTypes } from '../../Html';
|
|
4
3
|
import { Inline } from '../Inline';
|
|
5
4
|
|
|
@@ -30,7 +29,6 @@ function Li({ element, renderElement, style }) {
|
|
|
30
29
|
|
|
31
30
|
Li.propTypes = {
|
|
32
31
|
...ElementPropTypes,
|
|
33
|
-
prefix: PropTypes.element,
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
export default Li;
|
package/html/elements/list/Ol.js
CHANGED
package/html/elements/list/Ul.js
CHANGED
|
@@ -10,6 +10,11 @@ export default function NumberPrefix({ element, style }) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
NumberPrefix.propTypes = {
|
|
13
|
-
style: PropTypes.object,
|
|
14
13
|
element: PropTypes.shape({ ...ElementPropTypes }),
|
|
14
|
+
style: PropTypes.object,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
NumberPrefix.defaultProps = {
|
|
18
|
+
element: undefined,
|
|
19
|
+
style: undefined,
|
|
15
20
|
};
|