@wavemaker/app-rn-runtime 11.10.1-rc.200 → 11.10.2-next.27741
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/basic/picture/picture.component.js +83 -7
- package/components/basic/picture/picture.component.js.map +1 -1
- package/components/basic/picture/picture.props.js +1 -0
- package/components/basic/picture/picture.props.js.map +1 -1
- package/components/basic/video/video.component.js +34 -4
- package/components/basic/video/video.component.js.map +1 -1
- package/components/basic/video/video.props.js +1 -0
- package/components/basic/video/video.props.js.map +1 -1
- package/components/basic/video/video.styles.js +13 -0
- package/components/basic/video/video.styles.js.map +1 -1
- package/components/page/page-content/page-content.component.js +4 -3
- package/components/page/page-content/page-content.component.js.map +1 -1
- package/core/fixed-view.component.js +5 -3
- package/core/fixed-view.component.js.map +1 -1
- package/npm-shrinkwrap.json +93 -87
- package/package-lock.json +93 -87
- package/package.json +2 -2
- package/runtime/App.js +2 -3
- package/runtime/App.js.map +1 -1
@@ -22,6 +22,8 @@ export class WmPictureState extends BaseComponentState {
|
|
22
22
|
_defineProperty(this, "naturalImageHeight", 0);
|
23
23
|
_defineProperty(this, "imageWidth", 0);
|
24
24
|
_defineProperty(this, "imageHeight", 0);
|
25
|
+
_defineProperty(this, "originalContainerWidth", 0);
|
26
|
+
_defineProperty(this, "originalContainerHeight", 0);
|
25
27
|
}
|
26
28
|
}
|
27
29
|
export default class WmPicture extends BaseComponent {
|
@@ -29,23 +31,32 @@ export default class WmPicture extends BaseComponent {
|
|
29
31
|
super(_props, DEFAULT_CLASS, new WmPictureProps());
|
30
32
|
_defineProperty(this, "_pictureSource", null);
|
31
33
|
_defineProperty(this, "_picturePlaceHolder", null);
|
34
|
+
// The below property will be used to track and remove the calculateImageSize listenrs of individual picturesource
|
35
|
+
_defineProperty(this, "_cleanupTracker", {});
|
32
36
|
_defineProperty(this, "onViewLayoutChange", e => {
|
37
|
+
var _this$styles, _this$styles2, _this$styles3;
|
33
38
|
let imageWidth = e.nativeEvent.layout.width;
|
34
39
|
let imageHeight = e.nativeEvent.layout.height;
|
35
40
|
if (!imageWidth && !imageHeight) {
|
36
41
|
return;
|
37
42
|
}
|
38
|
-
if (!this.styles.root.height || typeof this.styles.root.height === 'string' && !this.styles.root.height.includes('%')) {
|
43
|
+
if (!((_this$styles = this.styles) !== null && _this$styles !== void 0 && _this$styles.root.height) || typeof ((_this$styles2 = this.styles) === null || _this$styles2 === void 0 ? void 0 : _this$styles2.root.height) === 'string' && !((_this$styles3 = this.styles) !== null && _this$styles3 !== void 0 && _this$styles3.root.height.includes('%'))) {
|
39
44
|
imageHeight = 0;
|
40
45
|
}
|
41
|
-
if (
|
46
|
+
if (this.state.props.aspectRatio && !imageHeight && imageWidth) {
|
47
|
+
imageHeight = imageWidth / parseFloat(this.state.props.aspectRatio);
|
48
|
+
} else if (this.state.props.aspectRatio && !imageWidth && imageHeight) {
|
49
|
+
imageWidth = imageWidth * parseFloat(this.state.props.aspectRatio);
|
50
|
+
} else if (imageWidth && !imageHeight) {
|
42
51
|
imageHeight = imageWidth * this.state.naturalImageHeight / this.state.naturalImageWidth;
|
43
52
|
} else if (imageHeight && !imageWidth) {
|
44
53
|
imageWidth = imageHeight * this.state.naturalImageWidth / this.state.naturalImageHeight;
|
45
54
|
}
|
46
55
|
this.updateState({
|
47
56
|
imageWidth: imageWidth,
|
48
|
-
imageHeight: imageHeight
|
57
|
+
imageHeight: imageHeight,
|
58
|
+
originalContainerWidth: e.nativeEvent.layout.width,
|
59
|
+
originalContainerHeight: e.nativeEvent.layout.height
|
49
60
|
});
|
50
61
|
});
|
51
62
|
_defineProperty(this, "showImage", (imageElement, props) => {
|
@@ -63,6 +74,9 @@ export default class WmPicture extends BaseComponent {
|
|
63
74
|
if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {
|
64
75
|
return null;
|
65
76
|
}
|
77
|
+
if (this.state.props.aspectRatio) {
|
78
|
+
return imageSrc;
|
79
|
+
}
|
66
80
|
if (isNumber(imageSrc)) {
|
67
81
|
const {
|
68
82
|
width,
|
@@ -80,10 +94,30 @@ export default class WmPicture extends BaseComponent {
|
|
80
94
|
});
|
81
95
|
this.cleanup.splice(this.cleanup.indexOf(cancel), 1);
|
82
96
|
});
|
97
|
+
if (this.props.picturesource && this._cleanupTracker[this.props.picturesource]) {
|
98
|
+
this._cleanupTracker[this.props.picturesource].push(cancel);
|
99
|
+
} else if (this.props.picturesource && !this._cleanupTracker[this.props.picturesource]) {
|
100
|
+
this._cleanupTracker[this.props.picturesource] = [];
|
101
|
+
this._cleanupTracker[this.props.picturesource].push(cancel);
|
102
|
+
}
|
83
103
|
this.cleanup.push(cancel);
|
84
104
|
}
|
85
105
|
return imageSrc;
|
86
106
|
}
|
107
|
+
|
108
|
+
// Check if the image source prop is changed from previous update to remove all listeners
|
109
|
+
componentDidUpdate(prevProps, prevState, snapshot) {
|
110
|
+
if (this.state.props.picturesource !== prevProps.picturesource) {
|
111
|
+
if (prevProps.picturesource && this._cleanupTracker[prevProps.picturesource]) {
|
112
|
+
this._cleanupTracker[prevProps.picturesource].forEach(func => {
|
113
|
+
func();
|
114
|
+
});
|
115
|
+
this._cleanupTracker[prevProps.picturesource] = [];
|
116
|
+
delete this._cleanupTracker[prevProps.picturesource];
|
117
|
+
}
|
118
|
+
}
|
119
|
+
super.componentDidUpdate(prevProps, prevState);
|
120
|
+
}
|
87
121
|
onPropertyChange(name, $new, $old) {
|
88
122
|
switch (name) {
|
89
123
|
case 'picturesource':
|
@@ -129,7 +163,7 @@ export default class WmPicture extends BaseComponent {
|
|
129
163
|
} else {
|
130
164
|
source = imgSrc;
|
131
165
|
}
|
132
|
-
if (this.state.naturalImageWidth) {
|
166
|
+
if (this.state.naturalImageWidth || this.state.props.aspectRatio) {
|
133
167
|
elementToshow = /*#__PURE__*/React.createElement(Image, _extends({}, this.getTestProps('picture'), {
|
134
168
|
style: [this.styles.picture, shapeStyles.picture],
|
135
169
|
resizeMode: props.resizemode,
|
@@ -152,10 +186,52 @@ export default class WmPicture extends BaseComponent {
|
|
152
186
|
height: skeletonHeight
|
153
187
|
});
|
154
188
|
}
|
189
|
+
//TODO: remove the re calculation logic later. Keeping it as an extra safety.
|
190
|
+
calculateBasedOnAspectRatio() {
|
191
|
+
if (this.state.props.aspectRatio) {
|
192
|
+
if (this.state.originalContainerWidth) {
|
193
|
+
return {
|
194
|
+
imageHeight: this.state.originalContainerWidth / parseFloat(this.state.props.aspectRatio),
|
195
|
+
imageWidth: this.state.originalContainerWidth
|
196
|
+
};
|
197
|
+
} else if (this.state.originalContainerHeight) {
|
198
|
+
return {
|
199
|
+
imageHeight: this.state.originalContainerHeight,
|
200
|
+
imageWidth: this.state.originalContainerHeight * parseFloat(this.state.props.aspectRatio)
|
201
|
+
};
|
202
|
+
}
|
203
|
+
}
|
204
|
+
return null;
|
205
|
+
}
|
206
|
+
|
207
|
+
//TODO: remove the re calculation logic later. Keeping it as an extra safety.
|
208
|
+
calculateBasedOnNaturalDimensions() {
|
209
|
+
const isNaturalSizesExists = this.state.naturalImageHeight && this.state.naturalImageWidth;
|
210
|
+
const isContainerSizesExists = this.state.originalContainerWidth && this.state.originalContainerHeight;
|
211
|
+
if (!isNaturalSizesExists || !isContainerSizesExists) {
|
212
|
+
return null;
|
213
|
+
}
|
214
|
+
return {
|
215
|
+
imageHeight: this.state.originalContainerWidth * this.state.naturalImageHeight / this.state.naturalImageWidth,
|
216
|
+
imageWidth: this.state.originalContainerHeight * this.state.naturalImageWidth / this.state.naturalImageHeight
|
217
|
+
};
|
218
|
+
}
|
155
219
|
renderWidget(props) {
|
156
220
|
var _shapeStyles$picture4;
|
157
|
-
|
158
|
-
|
221
|
+
let imageWidth = this.state.imageWidth;
|
222
|
+
let imageHeight = this.state.imageHeight;
|
223
|
+
|
224
|
+
//TODO: remove the re calculation logic later. Keeping it as an extra safety.
|
225
|
+
const aspectDimensions = this.calculateBasedOnAspectRatio();
|
226
|
+
const naturalDimensions = this.calculateBasedOnNaturalDimensions();
|
227
|
+
if (aspectDimensions) {
|
228
|
+
const dimensions = aspectDimensions;
|
229
|
+
imageWidth = dimensions.imageWidth;
|
230
|
+
imageHeight = dimensions.imageHeight;
|
231
|
+
} else if (naturalDimensions) {
|
232
|
+
const dimensions = naturalDimensions;
|
233
|
+
imageHeight = dimensions.imageHeight;
|
234
|
+
}
|
159
235
|
const shapeStyles = this.createShape(props.shape, imageWidth);
|
160
236
|
this._pictureSource = this._pictureSource || this.loadImage(props.picturesource);
|
161
237
|
this._picturePlaceHolder = props.fastload ? this._pictureSource || this._picturePlaceHolder || this.loadImage(props.pictureplaceholder) : this._picturePlaceHolder || this.loadImage(props.pictureplaceholder);
|
@@ -164,7 +240,7 @@ export default class WmPicture extends BaseComponent {
|
|
164
240
|
if (imgSrc) {
|
165
241
|
elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);
|
166
242
|
}
|
167
|
-
return imgSrc && (this.state.naturalImageWidth || props.isSvg) ? /*#__PURE__*/React.createElement(View, {
|
243
|
+
return imgSrc && (this.state.naturalImageWidth || props.isSvg || props.aspectRatio) ? /*#__PURE__*/React.createElement(View, {
|
168
244
|
style: [{
|
169
245
|
width: imageWidth,
|
170
246
|
height: imageHeight
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Image","View","isNumber","Tappable","BaseComponent","BaseComponentState","ImageSizeEstimator","isFullPathUrl","AccessibilityWidgetType","getAccessibilityProps","WmPictureProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmPictureState","constructor","args","_defineProperty","WmPicture","props","e","imageWidth","nativeEvent","layout","width","imageHeight","height","styles","root","includes","state","naturalImageHeight","naturalImageWidth","updateState","imageElement","fastload","loadImage","image","loadAsset","imageSrc","default","resolveAssetSource","cancel","getSize","cleanup","splice","indexOf","push","onPropertyChange","name","$new","$old","_pictureSource","_picturePlaceHolder","createShape","shape","picture","borderRadius","theme","getStyle","getElementToShow","imgSrc","shapeStyles","elementToshow","source","imgStyle","resizemode","createElement","uri","_extends","getTestProps","style","resizeMode","PICTURE","renderSkeleton","_this$styles$root","_shapeStyles$root","_shapeStyles$picture","_this$styles$root2","_shapeStyles$root2","_shapeStyles$picture2","_this$styles$root3","_shapeStyles$picture3","_shapeStyles$root3","_this$styles$root4","skeletonWidth","skeletonwidth","skeletonHeight","skeletonheight","skeleton","renderWidget","_shapeStyles$picture4","picturesource","pictureplaceholder","isSvg","_background","overflow","onLayout","onViewLayoutChange","disableTouchEffect","disabletoucheffect","getTestPropsForAction","rippleColor","target","entryanimation","animation","delay","animationdelay","showImage"],"sources":["picture.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Image, LayoutChangeEvent, View } from 'react-native';\n// import { NumberProp, SvgUri } from 'react-native-svg';\nimport { isNumber, isString } from 'lodash-es';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport ImageSizeEstimator from '@wavemaker/app-rn-runtime/core/imageSizeEstimator';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmPictureProps from './picture.props';\nimport { DEFAULT_CLASS, WmPictureStyles } from './picture.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmPictureState extends BaseComponentState<WmPictureProps> {\n naturalImageWidth: number = 0;\n naturalImageHeight: number = 0;\n imageWidth: number = 0;\n imageHeight: number = 0;\n}\n\nexport default class WmPicture extends BaseComponent<WmPictureProps, WmPictureState, WmPictureStyles> {\n\n private _pictureSource = null as any;\n private _picturePlaceHolder = null as any;\n\n constructor(props: WmPictureProps) {\n super(props, DEFAULT_CLASS, new WmPictureProps());\n }\n\n loadImage(image: string | undefined) {\n if (!image || !this.loadAsset) {\n return null;\n }\n const imageSrc = this.loadAsset(image) as any;\n if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {\n return null;\n }\n if (isNumber(imageSrc)) {\n const {width, height} = Image.resolveAssetSource(imageSrc);\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n } else if (imageSrc !== null) {\n const cancel = ImageSizeEstimator.getSize(imageSrc, (width: number, height: number) => {\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n this.cleanup.splice(this.cleanup.indexOf(cancel), 1);\n });\n this.cleanup.push(cancel);\n }\n return imageSrc;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'picturesource':\n this._pictureSource = null;\n case 'pictureplaceholder':\n this._picturePlaceHolder = null;\n break;\n }\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let imageWidth = e.nativeEvent.layout.width;\n let imageHeight = e.nativeEvent.layout.height;\n if (!imageWidth && !imageHeight) {\n return;\n }\n if (!this.styles.root.height\n || (typeof this.styles.root.height === 'string'\n && !this.styles.root.height.includes('%'))) {\n imageHeight = 0;\n }\n if (imageWidth && !imageHeight) {\n imageHeight = imageWidth * this.state.naturalImageHeight / this.state.naturalImageWidth;\n } else if (imageHeight && !imageWidth) {\n imageWidth = imageHeight * this.state.naturalImageWidth / this.state.naturalImageHeight;\n }\n this.updateState({\n imageWidth: imageWidth,\n imageHeight: imageHeight\n } as WmPictureState);\n };\n\n createShape(shape: string | undefined, imageWidth?: number | string): WmPictureStyles {\n if (shape) {\n switch(shape) {\n case 'circle':\n return {\n picture: {\n borderRadius: isNumber(imageWidth) ? imageWidth / 2 : 4\n }\n } as WmPictureStyles;\n case 'rounded' :\n return (this.theme.getStyle('rounded-image') as WmPictureStyles);\n case 'thumbnail' :\n return (this.theme.getStyle('thumbnail-image') as WmPictureStyles);\n }\n }\n return {} as WmPictureStyles;\n }\n\n getElementToShow(props: WmPictureProps, imgSrc: any, shapeStyles: WmPictureStyles) {\n let elementToshow, source;\n if (imgSrc && typeof imgSrc === 'object' && typeof imgSrc?.default === 'function') {\n let imgStyle : any = {};\n if (props.resizemode === 'contain') {\n imgStyle['width'] = '100%';\n imgStyle['height'] = '100%';\n }\n elementToshow = React.createElement(imgSrc?.default, imgStyle);\n //} else if (!isWebPreviewMode() && props.isSvg) {\n // svg from uri\n // elementToshow = <SvgUri testID={this.getTestId('picture')} width={this.styles.root.width as NumberProp} height={this.styles.root.height as NumberProp} uri={imgSrc}/>;\n } else if (isFullPathUrl(imgSrc)) {\n source = {\n uri: imgSrc\n };\n } else {\n source = imgSrc;\n }\n if (this.state.naturalImageWidth) {\n elementToshow = (\n <Image\n {...this.getTestProps('picture')}\n style={[this.styles.picture, shapeStyles.picture]}\n resizeMode={props.resizemode}\n source={source}\n {...getAccessibilityProps(AccessibilityWidgetType.PICTURE, props)}\n />\n );\n }\n return elementToshow;\n }\n\n public renderSkeleton(props: WmPictureProps){\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(this.props.shape, imageWidth);\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width || shapeStyles.root?.width || shapeStyles.picture?.width || imageWidth;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || shapeStyles.root?.height || shapeStyles.picture?.height || imageHeight;\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n borderRadius: this.props.shape == 'circle' && this.styles.root?.width ? 25 : shapeStyles.picture?.borderRadius || shapeStyles.root?.borderRadius || this.styles.root?.borderRadius || 4,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n\n showImage = (imageElement: any, props: WmPictureProps) => {\n if(props.fastload){\n return imageElement;\n }\n return this.state.imageWidth ? imageElement : null\n }\n\n renderWidget(props: WmPictureProps) {\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(props.shape, imageWidth);\n this._pictureSource = this._pictureSource || this.loadImage(props.picturesource);\n this._picturePlaceHolder = props.fastload ? \n (this._pictureSource || this._picturePlaceHolder || this.loadImage(props.pictureplaceholder)) :\n (this._picturePlaceHolder || this.loadImage(props.pictureplaceholder));\n const imgSrc: any = this._pictureSource || this._picturePlaceHolder;\n let elementToshow;\n if (imgSrc) {\n elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);\n }\n return imgSrc && (this.state.naturalImageWidth || props.isSvg) ? (\n <View style={[{\n width: imageWidth,\n height: imageHeight\n }, this.styles.root, shapeStyles.root, shapeStyles.picture]}>\n {this._background}\n <View style={[{overflow: 'hidden', width: '100%',\n height: '100%'}]} onLayout={this.onViewLayoutChange}>\n <Tappable\n disableTouchEffect={this.state.props.disabletoucheffect}\n {...this.getTestPropsForAction()}\n rippleColor={this.styles.root.rippleColor}\n target={this} styles={{width: imageWidth ? null : '100%', height: imageHeight ? null : '100%'}}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={[{\n height: imageHeight,\n width: imageWidth,\n borderRadius: shapeStyles.picture?.borderRadius\n }]}>\n {this.showImage(elementToshow, props)}\n </Animatedview>\n </Tappable>\n </View>\n </View>\n ): null;\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,KAAK,EAAqBC,IAAI,QAAQ,cAAc;AAC7E;AACA,SAASC,QAAQ,QAAkB,WAAW;AAC9C,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,kBAAkB,MAAM,mDAAmD;AAClF,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAE3E,OAAO,MAAMC,cAAc,SAAST,kBA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MAAM,EAAE;MAAM,CAAC,CAAE;MAACuE,QAAQ,EAAE,IAAI,CAACC;IAAmB,gBACpDnG,KAAA,CAAAoE,aAAA,CAAChE,QAAQ,EAAAkE,QAAA;MACP8B,kBAAkB,EAAE,IAAI,CAACrE,KAAK,CAACX,KAAK,CAACiF;IAAmB,GACpD,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAChCC,WAAW,EAAE,IAAI,CAAC3E,MAAM,CAACC,IAAI,CAAC0E,WAAY;MAC1CC,MAAM,EAAE,IAAK;MAAC5E,MAAM,EAAE;QAACH,KAAK,EAAEH,UAAU,GAAG,IAAI,GAAG,MAAM;QAAEK,MAAM,EAAED,WAAW,GAAG,IAAI,GAAG;MAAM;IAAE,iBAC/F1B,KAAA,CAAAoE,aAAA,CAACvD,YAAY;MAAC4F,cAAc,EAAErF,KAAK,CAACsF,SAAU;MAACC,KAAK,EAAEvF,KAAK,CAACwF,cAAe;MAACpC,KAAK,EAAE,CAAC;QAC9E7C,MAAM,EAAED,WAAW;QACnBD,KAAK,EAAEH,UAAU;QACjBoC,YAAY,GAAAkC,qBAAA,GAAE7B,WAAW,CAACN,OAAO,cAAAmC,qBAAA,uBAAnBA,qBAAA,CAAqBlC;MACrC,CAAC;IAAE,GACA,IAAI,CAACmD,SAAS,CAAC7C,aAAa,EAAE5C,KAAK,CAC1B,CACN,CACN,CACF,CAAC,GACN,IAAI;EACT;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Image","View","isNumber","Tappable","BaseComponent","BaseComponentState","ImageSizeEstimator","isFullPathUrl","AccessibilityWidgetType","getAccessibilityProps","WmPictureProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmPictureState","constructor","args","_defineProperty","WmPicture","props","e","_this$styles","_this$styles2","_this$styles3","imageWidth","nativeEvent","layout","width","imageHeight","height","styles","root","includes","state","aspectRatio","parseFloat","naturalImageHeight","naturalImageWidth","updateState","originalContainerWidth","originalContainerHeight","imageElement","fastload","loadImage","image","loadAsset","imageSrc","default","resolveAssetSource","cancel","getSize","cleanup","splice","indexOf","picturesource","_cleanupTracker","push","componentDidUpdate","prevProps","prevState","snapshot","forEach","func","onPropertyChange","name","$new","$old","_pictureSource","_picturePlaceHolder","createShape","shape","picture","borderRadius","theme","getStyle","getElementToShow","imgSrc","shapeStyles","elementToshow","source","imgStyle","resizemode","createElement","uri","_extends","getTestProps","style","resizeMode","PICTURE","renderSkeleton","_this$styles$root","_shapeStyles$root","_shapeStyles$picture","_this$styles$root2","_shapeStyles$root2","_shapeStyles$picture2","_this$styles$root3","_shapeStyles$picture3","_shapeStyles$root3","_this$styles$root4","skeletonWidth","skeletonwidth","skeletonHeight","skeletonheight","skeleton","calculateBasedOnAspectRatio","calculateBasedOnNaturalDimensions","isNaturalSizesExists","isContainerSizesExists","renderWidget","_shapeStyles$picture4","aspectDimensions","naturalDimensions","dimensions","pictureplaceholder","isSvg","_background","overflow","onLayout","onViewLayoutChange","disableTouchEffect","disabletoucheffect","getTestPropsForAction","rippleColor","target","entryanimation","animation","delay","animationdelay","showImage"],"sources":["picture.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Image, LayoutChangeEvent, View } from 'react-native';\n// import { NumberProp, SvgUri } from 'react-native-svg';\nimport { isNumber, isString } from 'lodash-es';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport ImageSizeEstimator from '@wavemaker/app-rn-runtime/core/imageSizeEstimator';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nimport WmPictureProps from './picture.props';\nimport { DEFAULT_CLASS, WmPictureStyles } from './picture.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmPictureState extends BaseComponentState<WmPictureProps> {\n naturalImageWidth: number = 0;\n naturalImageHeight: number = 0;\n imageWidth: number = 0;\n imageHeight: number = 0;\n originalContainerWidth: number = 0;\n originalContainerHeight: number = 0;\n}\n\nexport default class WmPicture extends BaseComponent<WmPictureProps, WmPictureState, WmPictureStyles> {\n\n private _pictureSource = null as any;\n private _picturePlaceHolder = null as any;\n\n // The below property will be used to track and remove the calculateImageSize listenrs of individual picturesource\n private _cleanupTracker = {} as any\n\n constructor(props: WmPictureProps) {\n super(props, DEFAULT_CLASS, new WmPictureProps());\n }\n\n loadImage(image: string | undefined) {\n if (!image || !this.loadAsset) {\n return null;\n }\n const imageSrc = this.loadAsset(image) as any;\n if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {\n return null;\n }\n if(this.state.props.aspectRatio) {\n return imageSrc;\n }\n if (isNumber(imageSrc)) {\n const {width, height} = Image.resolveAssetSource(imageSrc);\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n } else if (imageSrc !== null) {\n const cancel = ImageSizeEstimator.getSize(imageSrc, (width: number, height: number) => {\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n this.cleanup.splice(this.cleanup.indexOf(cancel), 1);\n });\n if(this.props.picturesource && this._cleanupTracker[this.props.picturesource]) {\n this._cleanupTracker[this.props.picturesource].push(cancel)\n } else if(this.props.picturesource && !this._cleanupTracker[this.props.picturesource]) {\n this._cleanupTracker[this.props.picturesource] = [];\n this._cleanupTracker[this.props.picturesource].push(cancel)\n }\n this.cleanup.push(cancel);\n }\n return imageSrc;\n }\n\n // Check if the image source prop is changed from previous update to remove all listeners\n componentDidUpdate(prevProps: Readonly<WmPictureProps>, prevState: Readonly<WmPictureState>, snapshot?: any): void {\n if(this.state.props.picturesource !== prevProps.picturesource) {\n if(prevProps.picturesource && this._cleanupTracker[prevProps.picturesource]) {\n this._cleanupTracker[prevProps.picturesource].forEach((func: any) => {\n func();\n }); \n this._cleanupTracker[prevProps.picturesource] = []\n delete this._cleanupTracker[prevProps.picturesource] \n }\n }\n super.componentDidUpdate(prevProps, prevState)\n }\n\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'picturesource':\n this._pictureSource = null;\n case 'pictureplaceholder':\n this._picturePlaceHolder = null;\n break;\n }\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let imageWidth = e.nativeEvent.layout.width;\n let imageHeight = e.nativeEvent.layout.height;\n if (!imageWidth && !imageHeight) {\n return;\n }\n if (!this.styles?.root.height\n || (typeof this.styles?.root.height === 'string'\n && !this.styles?.root.height.includes('%'))) {\n imageHeight = 0;\n }\n if(this.state.props.aspectRatio && !imageHeight && imageWidth) {\n imageHeight = imageWidth / parseFloat(this.state.props.aspectRatio as string)\n } else if (this.state.props.aspectRatio && !imageWidth && imageHeight) {\n imageWidth = imageWidth * parseFloat(this.state.props.aspectRatio as string)\n } else if (imageWidth && !imageHeight) {\n imageHeight = imageWidth * this.state.naturalImageHeight / this.state.naturalImageWidth;\n } else if (imageHeight && !imageWidth) {\n imageWidth = imageHeight * this.state.naturalImageWidth / this.state.naturalImageHeight;\n }\n this.updateState({\n imageWidth: imageWidth,\n imageHeight: imageHeight,\n originalContainerWidth: e.nativeEvent.layout.width,\n originalContainerHeight: e.nativeEvent.layout.height\n } as WmPictureState);\n };\n\n createShape(shape: string | undefined, imageWidth?: number | string): WmPictureStyles {\n if (shape) {\n switch(shape) {\n case 'circle':\n return {\n picture: {\n borderRadius: isNumber(imageWidth) ? imageWidth / 2 : 4\n }\n } as WmPictureStyles;\n case 'rounded' :\n return (this.theme.getStyle('rounded-image') as WmPictureStyles);\n case 'thumbnail' :\n return (this.theme.getStyle('thumbnail-image') as WmPictureStyles);\n }\n }\n return {} as WmPictureStyles;\n }\n\n getElementToShow(props: WmPictureProps, imgSrc: any, shapeStyles: WmPictureStyles) {\n let elementToshow, source;\n if (imgSrc && typeof imgSrc === 'object' && typeof imgSrc?.default === 'function') {\n let imgStyle : any = {};\n if (props.resizemode === 'contain') {\n imgStyle['width'] = '100%';\n imgStyle['height'] = '100%';\n }\n elementToshow = React.createElement(imgSrc?.default, imgStyle);\n //} else if (!isWebPreviewMode() && props.isSvg) {\n // svg from uri\n // elementToshow = <SvgUri testID={this.getTestId('picture')} width={this.styles.root.width as NumberProp} height={this.styles.root.height as NumberProp} uri={imgSrc}/>;\n } else if (isFullPathUrl(imgSrc)) {\n source = {\n uri: imgSrc\n };\n } else {\n source = imgSrc;\n }\n if (this.state.naturalImageWidth || this.state.props.aspectRatio) {\n elementToshow = (\n <Image\n {...this.getTestProps('picture')}\n style={[this.styles.picture, shapeStyles.picture]}\n resizeMode={props.resizemode}\n source={source}\n {...getAccessibilityProps(AccessibilityWidgetType.PICTURE, props)}\n />\n );\n }\n return elementToshow;\n }\n\n public renderSkeleton(props: WmPictureProps){\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(this.props.shape, imageWidth);\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width || shapeStyles.root?.width || shapeStyles.picture?.width || imageWidth;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || shapeStyles.root?.height || shapeStyles.picture?.height || imageHeight;\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n borderRadius: this.props.shape == 'circle' && this.styles.root?.width ? 25 : shapeStyles.picture?.borderRadius || shapeStyles.root?.borderRadius || this.styles.root?.borderRadius || 4,\n width: skeletonWidth as DimensionValue,\n height: skeletonHeight as DimensionValue\n });\n }\n\n showImage = (imageElement: any, props: WmPictureProps) => {\n if(props.fastload){\n return imageElement;\n }\n return this.state.imageWidth ? imageElement : null\n }\n\n\n //TODO: remove the re calculation logic later. Keeping it as an extra safety. \n calculateBasedOnAspectRatio(): {imageWidth: number, imageHeight: number} | null {\n if(this.state.props.aspectRatio) {\n if(this.state.originalContainerWidth) {\n return {\n imageHeight: this.state.originalContainerWidth / parseFloat(this.state.props.aspectRatio as string),\n imageWidth: this.state.originalContainerWidth\n }\n } else if(this.state.originalContainerHeight) {\n return {\n imageHeight: this.state.originalContainerHeight, \n imageWidth: this.state.originalContainerHeight * parseFloat(this.state.props.aspectRatio as string),\n }\n }\n }\n return null\n }\n \n //TODO: remove the re calculation logic later. Keeping it as an extra safety. \n calculateBasedOnNaturalDimensions(): {imageWidth: number, imageHeight: number} | null { \n const isNaturalSizesExists = this.state.naturalImageHeight && this.state.naturalImageWidth\n const isContainerSizesExists = this.state.originalContainerWidth && this.state.originalContainerHeight\n \n if(!isNaturalSizesExists || !isContainerSizesExists) {\n return null;\n }\n return {\n imageHeight: this.state.originalContainerWidth * this.state.naturalImageHeight / this.state.naturalImageWidth,\n imageWidth: this.state.originalContainerHeight * this.state.naturalImageWidth / this.state.naturalImageHeight\n }\n }\n \n\n renderWidget(props: WmPictureProps) {\n let imageWidth = this.state.imageWidth;\n let imageHeight = this.state.imageHeight;\n\n\n //TODO: remove the re calculation logic later. Keeping it as an extra safety. \n const aspectDimensions = this.calculateBasedOnAspectRatio();\n const naturalDimensions = this.calculateBasedOnNaturalDimensions();\n if(aspectDimensions) {\n const dimensions = aspectDimensions as {imageWidth: number, imageHeight: number}\n imageWidth = dimensions.imageWidth;\n imageHeight = dimensions.imageHeight\n } else if(naturalDimensions) {\n const dimensions = naturalDimensions as {imageWidth: number, imageHeight: number}\n imageHeight = dimensions.imageHeight\n }\n \n const shapeStyles = this.createShape(props.shape, imageWidth);\n this._pictureSource = this._pictureSource || this.loadImage(props.picturesource);\n this._picturePlaceHolder = props.fastload ? \n (this._pictureSource || this._picturePlaceHolder || this.loadImage(props.pictureplaceholder)) :\n (this._picturePlaceHolder || this.loadImage(props.pictureplaceholder));\n const imgSrc: any = this._pictureSource || this._picturePlaceHolder;\n let elementToshow;\n if (imgSrc) {\n elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);\n }\n return imgSrc && (this.state.naturalImageWidth || props.isSvg || props.aspectRatio) ? (\n <View style={[{\n width: imageWidth,\n height: imageHeight\n }, this.styles.root, shapeStyles.root, shapeStyles.picture]}>\n {this._background}\n <View style={[{overflow: 'hidden', width: '100%',\n height: '100%'}]} onLayout={this.onViewLayoutChange}>\n <Tappable\n disableTouchEffect={this.state.props.disabletoucheffect}\n {...this.getTestPropsForAction()}\n rippleColor={this.styles.root.rippleColor}\n target={this} styles={{width: imageWidth ? null : '100%', height: imageHeight ? null : '100%'}}>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay} style={[{\n height: imageHeight,\n width: imageWidth,\n borderRadius: shapeStyles.picture?.borderRadius\n }]}>\n {this.showImage(elementToshow, props)}\n </Animatedview>\n </Tappable>\n </View>\n </View>\n ): null;\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,KAAK,EAAqBC,IAAI,QAAQ,cAAc;AAC7E;AACA,SAASC,QAAQ,QAAkB,WAAW;AAC9C,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,kBAAkB,MAAM,mDAAmD;AAClF,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAE3E,OAAO,MAAMC,cAAc,SAAST,kBAAkB,CAAiB;EAAAU,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,4BACzC,CAAC;IAAAA,eAAA,6BACA,CAAC;IAAAA,eAAA,qBACT,CAAC;IAAAA,eAAA,sBACA,CAAC;IAAAA,eAAA,iCACU,CAAC;IAAAA,eAAA,kCACA,CAAC;EAAA;AACrC;AAEA,eAAe,MAAMC,SAAS,SAASd,aAAa,CAAkD;EAQ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,CAAC,CAAC;MAChCC,WAAW,EAAE,IAAI,CAAC7F,MAAM,CAACC,IAAI,CAAC4F,WAAY;MAC1CC,MAAM,EAAE,IAAK;MAAC9F,MAAM,EAAE;QAACH,KAAK,EAAEH,UAAU,GAAG,IAAI,GAAG,MAAM;QAAEK,MAAM,EAAED,WAAW,GAAG,IAAI,GAAG;MAAM;IAAE,iBAC/F7B,KAAA,CAAAmF,aAAA,CAACtE,YAAY;MAACiH,cAAc,EAAE1G,KAAK,CAAC2G,SAAU;MAACC,KAAK,EAAE5G,KAAK,CAAC6G,cAAe;MAAC1C,KAAK,EAAE,CAAC;QAC9EzD,MAAM,EAAED,WAAW;QACnBD,KAAK,EAAEH,UAAU;QACjBgD,YAAY,GAAAsC,qBAAA,GAAEjC,WAAW,CAACN,OAAO,cAAAuC,qBAAA,uBAAnBA,qBAAA,CAAqBtC;MACrC,CAAC;IAAE,GACA,IAAI,CAACyD,SAAS,CAACnD,aAAa,EAAE3D,KAAK,CAC1B,CACN,CACN,CACF,CAAC,GACN,IAAI;EACT;AACF","ignoreList":[]}
|
@@ -18,6 +18,7 @@ export default class WmPictureProps extends BaseProps {
|
|
18
18
|
_defineProperty(this, "hint", undefined);
|
19
19
|
_defineProperty(this, "accessibilityrole", 'image');
|
20
20
|
_defineProperty(this, "fastload", false);
|
21
|
+
_defineProperty(this, "aspectRatio", null);
|
21
22
|
}
|
22
23
|
}
|
23
24
|
//# sourceMappingURL=picture.props.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmPictureProps","constructor","args","_defineProperty","undefined"],"sources":["picture.props.ts"],"sourcesContent":["import { AccessibilityRole, ImageResizeMode } from 'react-native';\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmPictureProps extends BaseProps {\n animation?: string = null as any;\n animationdelay?: number = null as any;\n picturesource?: string = null as any;\n pictureplaceholder?: string = null as any;\n shape?: string = null as any;\n isSvg?: string = null as any;\n resizemode?: ImageResizeMode = 'stretch' as any;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = 'image';\n fastload?: boolean = false;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,yBACC,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,6BACC,IAAI;IAAAA,eAAA,gBACjB,IAAI;IAAAA,eAAA,gBACJ,IAAI;IAAAA,eAAA,qBACU,SAAS;IAAAA,eAAA,yBACd,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,6BACCC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,OAAO;IAAAA,eAAA,mBAC1B,KAAK;EAAA;
|
1
|
+
{"version":3,"names":["BaseProps","WmPictureProps","constructor","args","_defineProperty","undefined"],"sources":["picture.props.ts"],"sourcesContent":["import { AccessibilityRole, ImageResizeMode } from 'react-native';\nimport { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmPictureProps extends BaseProps {\n animation?: string = null as any;\n animationdelay?: number = null as any;\n picturesource?: string = null as any;\n pictureplaceholder?: string = null as any;\n shape?: string = null as any;\n isSvg?: string = null as any;\n resizemode?: ImageResizeMode = 'stretch' as any;\n skeletonheight?: string = null as any;\n skeletonwidth?: string = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = 'image';\n fastload?: boolean = false;\n aspectRatio?: string | number | null = null;\n}\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC/B,IAAI;IAAAA,eAAA,yBACC,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,6BACC,IAAI;IAAAA,eAAA,gBACjB,IAAI;IAAAA,eAAA,gBACJ,IAAI;IAAAA,eAAA,qBACU,SAAS;IAAAA,eAAA,yBACd,IAAI;IAAAA,eAAA,wBACL,IAAI;IAAAA,eAAA,6BACCC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,OAAO;IAAAA,eAAA,mBAC1B,KAAK;IAAAA,eAAA,sBACa,IAAI;EAAA;AAC7C","ignoreList":[]}
|
@@ -3,7 +3,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
5
5
|
import React from 'react';
|
6
|
-
import { View, Image, TouchableWithoutFeedback } from 'react-native';
|
6
|
+
import { View, Image, TouchableWithoutFeedback, Platform, Text } from 'react-native';
|
7
7
|
import { VideoView, createVideoPlayer } from 'expo-video';
|
8
8
|
import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
|
9
9
|
import WmVideoProps from './video.props';
|
@@ -16,6 +16,7 @@ export class WmVideoState extends BaseComponentState {
|
|
16
16
|
super(...args);
|
17
17
|
_defineProperty(this, "isVideoReady", false);
|
18
18
|
_defineProperty(this, "playStarted", false);
|
19
|
+
_defineProperty(this, "videoPosterDismissed", false);
|
19
20
|
}
|
20
21
|
}
|
21
22
|
export default class WmVideo extends BaseComponent {
|
@@ -104,6 +105,12 @@ export default class WmVideo extends BaseComponent {
|
|
104
105
|
this.player.addListener('statusChange', this.playerReadyStatusChange.bind(this));
|
105
106
|
this.initializeProps();
|
106
107
|
}
|
108
|
+
onPlayIconTap() {
|
109
|
+
this.updateState({
|
110
|
+
videoPosterDismissed: true
|
111
|
+
});
|
112
|
+
this.player.play();
|
113
|
+
}
|
107
114
|
componentWillUnmount() {
|
108
115
|
super.componentWillUnmount();
|
109
116
|
this.player.removeListener('playingChange', this.playingStatusChange);
|
@@ -116,12 +123,14 @@ export default class WmVideo extends BaseComponent {
|
|
116
123
|
videoposter,
|
117
124
|
onFullscreenEnter,
|
118
125
|
onFullscreenExit,
|
119
|
-
requiresLinearPlayback
|
126
|
+
requiresLinearPlayback,
|
127
|
+
showDefaultVideoPoster
|
120
128
|
} = props;
|
121
129
|
const {
|
122
130
|
playStarted
|
123
131
|
} = this.state;
|
124
132
|
const isPlaying = playStarted || this.state.props.autoplay;
|
133
|
+
const showOverlay = !showDefaultVideoPoster && !this.state.videoPosterDismissed;
|
125
134
|
return /*#__PURE__*/React.createElement(View, {
|
126
135
|
style: this.styles.root
|
127
136
|
}, this._background, /*#__PURE__*/React.createElement(VideoView, _extends({}, getAccessibilityProps(AccessibilityWidgetType.VIDEO, props), {
|
@@ -131,14 +140,35 @@ export default class WmVideo extends BaseComponent {
|
|
131
140
|
flex: 1
|
132
141
|
},
|
133
142
|
player: this.player,
|
134
|
-
nativeControls: props.controls,
|
143
|
+
nativeControls: props.controls || showOverlay,
|
135
144
|
contentFit: 'contain',
|
136
145
|
testID: this.getTestId('video'),
|
137
146
|
allowsPictureInPicture: allowsPictureInPicture,
|
138
147
|
onFullscreenEnter: onFullscreenEnter,
|
139
148
|
onFullscreenExit: onFullscreenExit,
|
140
149
|
requiresLinearPlayback: requiresLinearPlayback
|
141
|
-
})), !isPlaying && videoposter ? this.renderVideoPoster(props) : /*#__PURE__*/React.createElement(React.Fragment, null)
|
150
|
+
})), !isPlaying && videoposter && showDefaultVideoPoster ? this.renderVideoPoster(props) : /*#__PURE__*/React.createElement(React.Fragment, null), !isPlaying && !showDefaultVideoPoster && !this.state.videoPosterDismissed ? /*#__PURE__*/React.createElement(View, {
|
151
|
+
style: this.styles.playIconContainer
|
152
|
+
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
153
|
+
style: {
|
154
|
+
width: 80,
|
155
|
+
height: 80
|
156
|
+
},
|
157
|
+
onPress: this.onPlayIconTap.bind(this)
|
158
|
+
}, Platform.OS === 'android' ? /*#__PURE__*/React.createElement(Image, _extends({}, this.getTestProps('video_play_button'), {
|
159
|
+
style: {
|
160
|
+
width: 80,
|
161
|
+
height: 80
|
162
|
+
},
|
163
|
+
resizeMode: 'contain',
|
164
|
+
source: this.getSource('resources/images/imagelists/play.png')
|
165
|
+
})) : /*#__PURE__*/React.createElement(Text, {
|
166
|
+
style: {
|
167
|
+
fontSize: 80,
|
168
|
+
fontWeight: 'bold',
|
169
|
+
color: 'white'
|
170
|
+
}
|
171
|
+
}, "\u25B6"))) : /*#__PURE__*/React.createElement(React.Fragment, null));
|
142
172
|
}
|
143
173
|
}
|
144
174
|
//# sourceMappingURL=video.component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","Image","TouchableWithoutFeedback","VideoView","createVideoPlayer","BaseComponent","BaseComponentState","WmVideoProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isFullPathUrl","createSkeleton","WmVideoState","constructor","args","_defineProperty","WmVideo","props","getSource","path","resource","loadAsset","uri","renderVideoPoster","accessibilityImageProps","accessibilitylabel","hint","accessibilityrole","createElement","onPress","player","play","_extends","getTestProps","style","position","top","bottom","left","right","width","height","resizeMode","source","videoposter","PICTURE","renderSkeleton","theme","styles","skeleton","root","playingStatusChange","isPlaying","state","playStarted","updateState","autoplay","playerReadyStatusChange","statusObj","videoReady","status","isVideoReady","initializeProps","loop","muted","showNowPlayingNotification","componentDidMount","mp4format","webmformat","videoSource","addListener","bind","componentWillUnmount","removeListener","release","renderWidget","allowsPictureInPicture","onFullscreenEnter","onFullscreenExit","requiresLinearPlayback","_background","VIDEO","flex","nativeControls","controls","contentFit","testID","getTestId","Fragment"],"sources":["video.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Image, TouchableWithoutFeedback } from 'react-native';\nimport { VideoView, createVideoPlayer } from 'expo-video';\nimport {\n BaseComponent,\n BaseComponentState,\n} from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmVideoProps from './video.props';\nimport { DEFAULT_CLASS, WmVideoStyles } from './video.styles';\nimport {\n AccessibilityWidgetType,\n getAccessibilityProps,\n} from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmVideoState extends BaseComponentState<WmVideoProps> {\n isVideoReady: boolean = false;\n playStarted: boolean = false;\n}\n\nexport default class WmVideo extends BaseComponent<\n WmVideoProps,\n WmVideoState,\n WmVideoStyles\n> {\n private player: any;\n\n constructor(props: WmVideoProps) {\n super(props, DEFAULT_CLASS, new WmVideoProps(), new WmVideoState());\n }\n\n getSource(path: string) {\n if (!path) {\n return null;\n }\n const resource = this.loadAsset && this.loadAsset(path);\n if (isFullPathUrl(resource as string)) {\n return {\n uri: resource as string,\n };\n }\n return resource || {\n uri: ''\n };\n }\n\n renderVideoPoster(props: WmVideoProps) {\n const accessibilityImageProps = {...props, \n accessibilitylabel : `${props.accessibilitylabel}_poster`,\n hint: `${props.hint}_poster`,\n accessibilityrole: `${props.accessibilityrole}_poster`,\n }\n return (\n <TouchableWithoutFeedback onPress={() => this.player.play()}>\n <Image\n {...this.getTestProps('video_poster')}\n style={{\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: '100%',\n height: '100%',\n }}\n resizeMode={'cover'}\n source={this.getSource(props.videoposter) as any}\n {...getAccessibilityProps(AccessibilityWidgetType.PICTURE, accessibilityImageProps)}\n />\n </TouchableWithoutFeedback>\n );\n }\n\n public renderSkeleton(props: WmVideoProps): React.ReactNode {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n });\n }\n\n public playingStatusChange(isPlaying: boolean) {\n if (!this.state.playStarted) {\n this.updateState({\n playStarted: this.state.props.autoplay || isPlaying,\n } as WmVideoState);\n }\n }\n\n playerReadyStatusChange(statusObj: any) {\n const videoReady = statusObj.status === 'readyToPlay'\n if (this.state.props.autoplay && videoReady) {\n this.player.play();\n }\n this.updateState({\n isVideoReady: videoReady,\n } as WmVideoState);\n }\n\n initializeProps(){\n const {\n loop,\n muted,\n showNowPlayingNotification,\n } = this.state.props\n\n this.player.muted = muted; \n this.player.loop = loop; \n this.player.showNowPlayingNotification = showNowPlayingNotification; \n }\n\n componentDidMount(): void {\n super.componentDidMount();\n const { mp4format, webmformat, autoplay } = this.state.props;\n const videoSource = this.getSource(mp4format || webmformat) ;\n\n this.player = createVideoPlayer(videoSource);\n this.player.addListener(\n 'playingChange',\n this.playingStatusChange.bind(this)\n );\n this.player.addListener(\n 'statusChange',\n this.playerReadyStatusChange.bind(this)\n );\n\n this.initializeProps()\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.player.removeListener('playingChange', this.playingStatusChange);\n this.player.removeListener('statusChange', this.playerReadyStatusChange);\n this.player.release();\n }\n\n\n renderWidget(props: WmVideoProps) {\n const {\n allowsPictureInPicture,\n videoposter,\n onFullscreenEnter,\n onFullscreenExit,\n requiresLinearPlayback\n } = props;\n\n const { playStarted } = this.state;\n const isPlaying = playStarted || this.state.props.autoplay;\n\n return (\n <View style={this.styles.root}>\n {this._background}\n <VideoView\n {...getAccessibilityProps(AccessibilityWidgetType.VIDEO, props)}\n style={{ width: '100%', height: '100%', flex: 1 }}\n player={this.player}\n nativeControls={props.controls}\n contentFit={'contain'}\n testID={this.getTestId('video')}\n allowsPictureInPicture={allowsPictureInPicture}\n onFullscreenEnter={onFullscreenEnter}\n onFullscreenExit={onFullscreenExit}\n requiresLinearPlayback={requiresLinearPlayback}\n />\n {!isPlaying && videoposter ? (\n this.renderVideoPoster(props)\n ) : (\n <></>\n )}\n </View>\n );\n }\n}"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,KAAK,EAAEC,wBAAwB,QAAQ,cAAc;AACpE,SAASC,SAAS,EAAEC,iBAAiB,QAAQ,YAAY;AACzD,SACEC,aAAa,EACbC,kBAAkB,QACb,+CAA+C;AACtD,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SACEC,uBAAuB,EACvBC,qBAAqB,QAChB,8CAA8C;AACrD,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,YAAY,SAASP,kBAAkB,CAAe;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBACzC,KAAK;IAAAA,eAAA,sBACN,KAAK;EAAA;AAC9B;AAEA,eAAe,MAAMC,OAAO,SAASZ,aAAa,CAIhD;EAGAS,WAAWA,CAACI,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAID,YAAY,CAAC,CAAC,EAAE,IAAIM,YAAY,CAAC,CAAC,CAAC;IAACG,eAAA;EACtE;EAEAG,SAASA,CAACC,IAAY,EAAE;IACtB,IAAI,CAACA,IAAI,EAAE;MACT,OAAO,IAAI;IACb;IACA,MAAMC,QAAQ,GAAG,IAAI,CAACC,SAAS,IAAI,IAAI,CAACA,SAAS,CAACF,IAAI,CAAC;IACvD,IAAIT,aAAa,CAACU,QAAkB,CAAC,EAAE;MACrC,OAAO;QACLE,GAAG,EAAEF;MACP,CAAC;IACH;IACA,OAAOA,QAAQ,IAAI;MACjBE,GAAG,EAAE;IACP,CAAC;EACH;EAEAC,iBAAiBA,CAACN,KAAmB,EAAE;IACrC,MAAMO,uBAAuB,GAAG;MAAC,GAAGP,KAAK;MAC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AA9B,KAAA,CAAA0F,QAAA,MAAI,CAEF,CAAC;EAEX;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","View","Image","TouchableWithoutFeedback","Platform","Text","VideoView","createVideoPlayer","BaseComponent","BaseComponentState","WmVideoProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isFullPathUrl","createSkeleton","WmVideoState","constructor","args","_defineProperty","WmVideo","props","getSource","path","resource","loadAsset","uri","renderVideoPoster","accessibilityImageProps","accessibilitylabel","hint","accessibilityrole","createElement","onPress","player","play","_extends","getTestProps","style","position","top","bottom","left","right","width","height","resizeMode","source","videoposter","PICTURE","renderSkeleton","theme","styles","skeleton","root","playingStatusChange","isPlaying","state","playStarted","updateState","autoplay","playerReadyStatusChange","statusObj","videoReady","status","isVideoReady","initializeProps","loop","muted","showNowPlayingNotification","componentDidMount","mp4format","webmformat","videoSource","addListener","bind","onPlayIconTap","videoPosterDismissed","componentWillUnmount","removeListener","release","renderWidget","allowsPictureInPicture","onFullscreenEnter","onFullscreenExit","requiresLinearPlayback","showDefaultVideoPoster","showOverlay","_background","VIDEO","flex","nativeControls","controls","contentFit","testID","getTestId","Fragment","playIconContainer","OS","fontSize","fontWeight","color"],"sources":["video.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Image, TouchableWithoutFeedback, Platform, Text } from 'react-native';\nimport { VideoView, createVideoPlayer } from 'expo-video';\nimport {\n BaseComponent,\n BaseComponentState,\n} from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmVideoProps from './video.props';\nimport { DEFAULT_CLASS, WmVideoStyles } from './video.styles';\nimport {\n AccessibilityWidgetType,\n getAccessibilityProps,\n} from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { isFullPathUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmVideoState extends BaseComponentState<WmVideoProps> {\n isVideoReady: boolean = false;\n playStarted: boolean = false;\n videoPosterDismissed: boolean = false;\n}\n\nexport default class WmVideo extends BaseComponent<\n WmVideoProps,\n WmVideoState,\n WmVideoStyles\n> {\n private player: any;\n\n constructor(props: WmVideoProps) {\n super(props, DEFAULT_CLASS, new WmVideoProps(), new WmVideoState());\n }\n\n getSource(path: string) {\n if (!path) {\n return null;\n }\n const resource = this.loadAsset && this.loadAsset(path);\n if (isFullPathUrl(resource as string)) {\n return {\n uri: resource as string,\n };\n }\n return resource || {\n uri: ''\n };\n }\n\n renderVideoPoster(props: WmVideoProps) {\n const accessibilityImageProps = {...props, \n accessibilitylabel : `${props.accessibilitylabel}_poster`,\n hint: `${props.hint}_poster`,\n accessibilityrole: `${props.accessibilityrole}_poster`,\n }\n return (\n <TouchableWithoutFeedback onPress={() => this.player.play()}>\n <Image\n {...this.getTestProps('video_poster')}\n style={{\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: '100%',\n height: '100%',\n }}\n resizeMode={'cover'}\n source={this.getSource(props.videoposter) as any}\n {...getAccessibilityProps(AccessibilityWidgetType.PICTURE, accessibilityImageProps)}\n />\n </TouchableWithoutFeedback>\n );\n }\n\n\n public renderSkeleton(props: WmVideoProps): React.ReactNode {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n });\n }\n\n public playingStatusChange(isPlaying: boolean) {\n if (!this.state.playStarted) {\n this.updateState({\n playStarted: this.state.props.autoplay || isPlaying,\n } as WmVideoState);\n }\n }\n\n playerReadyStatusChange(statusObj: any) {\n const videoReady = statusObj.status === 'readyToPlay'\n if (this.state.props.autoplay && videoReady) {\n this.player.play();\n }\n this.updateState({\n isVideoReady: videoReady,\n } as WmVideoState);\n }\n\n initializeProps(){\n const {\n loop,\n muted,\n showNowPlayingNotification,\n } = this.state.props\n\n this.player.muted = muted; \n this.player.loop = loop; \n this.player.showNowPlayingNotification = showNowPlayingNotification; \n }\n\n componentDidMount(): void {\n super.componentDidMount();\n const { mp4format, webmformat, autoplay } = this.state.props;\n const videoSource = this.getSource(mp4format || webmformat) ;\n\n this.player = createVideoPlayer(videoSource);\n this.player.addListener(\n 'playingChange',\n this.playingStatusChange.bind(this)\n );\n this.player.addListener(\n 'statusChange',\n this.playerReadyStatusChange.bind(this)\n ); \n this.initializeProps()\n }\n\n onPlayIconTap() {\n this.updateState({\n videoPosterDismissed: true\n } as WmVideoState)\n this.player.play()\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.player.removeListener('playingChange', this.playingStatusChange);\n this.player.removeListener('statusChange', this.playerReadyStatusChange);\n this.player.release();\n }\n\n renderWidget(props: WmVideoProps) {\n const {\n allowsPictureInPicture,\n videoposter,\n onFullscreenEnter,\n onFullscreenExit,\n requiresLinearPlayback,\n showDefaultVideoPoster\n } = props;\n\n const { playStarted } = this.state;\n const isPlaying = playStarted || this.state.props.autoplay;\n const showOverlay = !showDefaultVideoPoster && !this.state.videoPosterDismissed\n\n return (\n <View style={this.styles.root}>\n {this._background}\n <VideoView\n {...getAccessibilityProps(AccessibilityWidgetType.VIDEO, props)}\n style={{ width: '100%', height: '100%', flex: 1 }}\n player={this.player}\n nativeControls={props.controls || showOverlay}\n contentFit={'contain'}\n testID={this.getTestId('video')}\n allowsPictureInPicture={allowsPictureInPicture}\n onFullscreenEnter={onFullscreenEnter}\n onFullscreenExit={onFullscreenExit}\n requiresLinearPlayback={requiresLinearPlayback}\n />\n {!isPlaying && videoposter && showDefaultVideoPoster ? (\n this.renderVideoPoster(props)\n ) : (\n <></>\n )}\n {\n !isPlaying && !showDefaultVideoPoster && !this.state.videoPosterDismissed ? (\n <View style={this.styles.playIconContainer}>\n <TouchableWithoutFeedback style={{width: 80, height: 80 }} onPress={this.onPlayIconTap.bind(this)}>\n {Platform.OS === 'android' ? <Image\n {...this.getTestProps('video_play_button')}\n style={{\n width: 80, \n height: 80,\n }}\n resizeMode={'contain'}\n source={this.getSource('resources/images/imagelists/play.png') as any}\n /> : <Text style={{ fontSize: 80, fontWeight: 'bold', color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AO,CACrD,CACtB,CAAC,gBAEPrG,KAAA,CAAAgC,aAAA,CAAAhC,KAAA,CAAAgG,QAAA,MAAI,CAGJ,CAAC;EAEX;AACF","ignoreList":[]}
|
@@ -14,6 +14,7 @@ export default class WmVideoProps extends BaseProps {
|
|
14
14
|
_defineProperty(this, "subtitlelang", 'en');
|
15
15
|
_defineProperty(this, "subtitlesource", null);
|
16
16
|
_defineProperty(this, "videoposter", 'resources/images/imagelists/default-image.png');
|
17
|
+
_defineProperty(this, "showDefaultVideoPoster", true);
|
17
18
|
_defineProperty(this, "videopreload", 'none');
|
18
19
|
_defineProperty(this, "videosupportmessage", 'Your browser does not support the video tag.');
|
19
20
|
_defineProperty(this, "webmformat", null);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmVideoProps","constructor","args","_defineProperty","undefined"],"sources":["video.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { AccessibilityRole } from 'react-native';\nexport default class WmVideoProps extends BaseProps {\n autoplay = false;\n controls = false;\n loop = false;\n mp4format: string = null as any;\n muted = false;\n oggformat: string = null as any;\n subtitlelang = 'en';\n subtitlesource: string = null as any;\n videoposter = 'resources/images/imagelists/default-image.png';\n videopreload = 'none';\n videosupportmessage = 'Your browser does not support the video tag.';\n webmformat: string = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n onFullscreenEnter: (() => void) | null = null;\n onFullscreenExit: (() => void) | null = null;\n requiresLinearPlayback: boolean = true;\n isLive: boolean = false;\n playing: boolean = false;\n showNowPlayingNotification: boolean = false;\n allowsPictureInPicture: boolean = false;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,YAAY,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBACrC,KAAK;IAAAA,eAAA,mBACL,KAAK;IAAAA,eAAA,eACT,KAAK;IAAAA,eAAA,oBACQ,IAAI;IAAAA,eAAA,gBAChB,KAAK;IAAAA,eAAA,oBACO,IAAI;IAAAA,eAAA,uBACT,IAAI;IAAAA,eAAA,yBACM,IAAI;IAAAA,eAAA,sBACf,+CAA+C;IAAAA,eAAA,
|
1
|
+
{"version":3,"names":["BaseProps","WmVideoProps","constructor","args","_defineProperty","undefined"],"sources":["video.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { AccessibilityRole } from 'react-native';\nexport default class WmVideoProps extends BaseProps {\n autoplay = false;\n controls = false;\n loop = false;\n mp4format: string = null as any;\n muted = false;\n oggformat: string = null as any;\n subtitlelang = 'en';\n subtitlesource: string = null as any;\n videoposter = 'resources/images/imagelists/default-image.png';\n showDefaultVideoPoster = true;\n videopreload = 'none';\n videosupportmessage = 'Your browser does not support the video tag.';\n webmformat: string = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n onFullscreenEnter: (() => void) | null = null;\n onFullscreenExit: (() => void) | null = null;\n requiresLinearPlayback: boolean = true;\n isLive: boolean = false;\n playing: boolean = false;\n showNowPlayingNotification: boolean = false;\n allowsPictureInPicture: boolean = false;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,YAAY,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBACrC,KAAK;IAAAA,eAAA,mBACL,KAAK;IAAAA,eAAA,eACT,KAAK;IAAAA,eAAA,oBACQ,IAAI;IAAAA,eAAA,gBAChB,KAAK;IAAAA,eAAA,oBACO,IAAI;IAAAA,eAAA,uBACT,IAAI;IAAAA,eAAA,yBACM,IAAI;IAAAA,eAAA,sBACf,+CAA+C;IAAAA,eAAA,iCACpC,IAAI;IAAAA,eAAA,uBACd,MAAM;IAAAA,eAAA,8BACC,8CAA8C;IAAAA,eAAA,qBAC/C,IAAI;IAAAA,eAAA,6BACKC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;IAAAA,eAAA,4BAEgB,IAAI;IAAAA,eAAA,2BACL,IAAI;IAAAA,eAAA,iCACV,IAAI;IAAAA,eAAA,iBACpB,KAAK;IAAAA,eAAA,kBACJ,KAAK;IAAAA,eAAA,qCACc,KAAK;IAAAA,eAAA,iCACT,KAAK;EAAA;AAC3C","ignoreList":[]}
|
@@ -13,6 +13,19 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
13
13
|
height: 300,
|
14
14
|
width: "100%"
|
15
15
|
}
|
16
|
+
},
|
17
|
+
playIconContainer: {
|
18
|
+
position: 'absolute',
|
19
|
+
top: 0,
|
20
|
+
bottom: 0,
|
21
|
+
left: 0,
|
22
|
+
right: 0,
|
23
|
+
height: '100%',
|
24
|
+
width: '100%',
|
25
|
+
backgroundColor: 'rgba(0,0,0,0.1)',
|
26
|
+
display: 'flex',
|
27
|
+
justifyContent: 'center',
|
28
|
+
alignItems: 'center'
|
16
29
|
}
|
17
30
|
});
|
18
31
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","height","width","text","skeleton"],"sources":["video.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '../skeleton/skeleton.styles';\n\nexport type WmVideoStyles = BaseStyles & {\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-video';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = defineStyles<WmVideoStyles>({\n root: {\n height: 300,\n width : \"100%\"\n },\n text: {},\n skeleton: {\n root: {\n height: 300,\n width : \"100%\" \n }\n } as any as WmSkeletonStyles\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","height","width","text","skeleton","playIconContainer","position","top","bottom","left","right","backgroundColor","display","justifyContent","alignItems"],"sources":["video.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '../skeleton/skeleton.styles';\nimport { WmPictureStyles } from '../picture/picture.styles';\nimport { ViewStyle } from 'react-native';\n\nexport type WmVideoStyles = BaseStyles & {\n skeleton: WmSkeletonStyles;\n playIconContainer: ViewStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-video';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = defineStyles<WmVideoStyles>({\n root: {\n height: 300,\n width : \"100%\"\n },\n text: {},\n skeleton: {\n root: {\n height: 300,\n width : \"100%\" \n }\n } as any as WmSkeletonStyles,\n playIconContainer: {\n position: 'absolute', \n top: 0, \n bottom: 0, \n left: 0, \n right: 0, \n height: '100%', \n width: '100%',\n backgroundColor: 'rgba(0,0,0,0.1)',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center'\n} \n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAUxF,OAAO,MAAMC,aAAa,GAAG,WAAW;AACxCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAGL,YAAY,CAAgB;IAC9CM,IAAI,EAAE;MACFC,MAAM,EAAE,GAAG;MACXC,KAAK,EAAG;IACZ,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACNJ,IAAI,EAAE;QACFC,MAAM,EAAE,GAAG;QACXC,KAAK,EAAG;MACZ;IACJ,CAA4B;IAC5BG,iBAAiB,EAAE;MACfC,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,CAAC;MACNC,MAAM,EAAE,CAAC;MACTC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAE,CAAC;MACRT,MAAM,EAAE,MAAM;MACdC,KAAK,EAAE,MAAM;MACbS,eAAe,EAAE,iBAAiB;MAClCC,OAAO,EAAE,MAAM;MACfC,cAAc,EAAE,QAAQ;MACxBC,UAAU,EAAE;IACxB;EACI,CAAC,CAAC;EACFhB,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
|
@@ -11,6 +11,7 @@ import { DEFAULT_CLASS } from './page-content.styles';
|
|
11
11
|
import { ScrollView } from 'react-native-gesture-handler';
|
12
12
|
import WmLottie from '@wavemaker/app-rn-runtime/components/basic/lottie/lottie.component';
|
13
13
|
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
14
|
+
import { FixedViewContainer } from '@wavemaker/app-rn-runtime/core/fixed-view.component';
|
14
15
|
export class WmPageContentState extends BaseComponentState {}
|
15
16
|
export default class WmPageContent extends BaseComponent {
|
16
17
|
constructor(props) {
|
@@ -78,7 +79,7 @@ export default class WmPageContent extends BaseComponent {
|
|
78
79
|
style: {
|
79
80
|
flex: 1
|
80
81
|
}
|
81
|
-
}, /*#__PURE__*/React.createElement(ScrollView, {
|
82
|
+
}, /*#__PURE__*/React.createElement(FixedViewContainer, null, /*#__PURE__*/React.createElement(ScrollView, {
|
82
83
|
ref: this.scrollRef,
|
83
84
|
contentContainerStyle: [this.styles.root, {
|
84
85
|
backgroundColor: 'transparent'
|
@@ -88,7 +89,7 @@ export default class WmPageContent extends BaseComponent {
|
|
88
89
|
this.notify('scroll', [event]);
|
89
90
|
},
|
90
91
|
scrollEventThrottle: 48
|
91
|
-
}, props.children));
|
92
|
+
}, props.children)));
|
92
93
|
})) : /*#__PURE__*/React.createElement(View, {
|
93
94
|
style: [this.styles.root, {
|
94
95
|
backgroundColor: this._showSkeleton ? this.styles.skeleton.root.backgroundColor : this.styles.root.backgroundColor
|
@@ -107,7 +108,7 @@ export default class WmPageContent extends BaseComponent {
|
|
107
108
|
style: {
|
108
109
|
flex: 1
|
109
110
|
}
|
110
|
-
}, this._background, props.children);
|
111
|
+
}, /*#__PURE__*/React.createElement(FixedViewContainer, null, this._background, props.children));
|
111
112
|
}));
|
112
113
|
}
|
113
114
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","createRef","KeyboardAvoidingView","Platform","View","isWebPreviewMode","HideMode","BaseComponent","BaseComponentState","WmPageContentProps","DEFAULT_CLASS","ScrollView","WmLottie","SafeAreaInsetsContext","WmPageContentState","WmPageContent","constructor","props","_defineProperty","hideMode","DONOT_ADD_TO_DOM","scrollRef","subscribe","args","scrollTo","_this$scrollRef","current","scrollToEnd","position","_this$scrollRef2","x","y","Animated","renderSkeleton","skeletonanimationresource","createElement","style","width","styles","root","content","skeleton","source","loop","autoplay","speed","skeletonanimationspeed","renderWidget","showScrollbar","scrollbarColor","scrollable","height","backgroundColor","_showSkeleton","_background","Consumer","insets","top","bottom","left","right","keyboardOffset","verticalOffset","OS","behavior","undefined","keyboardVerticalOffset","flex","ref","contentContainerStyle","showsVerticalScrollIndicator","onScroll","event","notify","scrollEventThrottle","children"],"sources":["page-content.component.tsx"],"sourcesContent":["import React, { createRef, RefObject } from 'react';\nimport { KeyboardAvoidingView, Platform, View } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPageContentProps from './page-content.props';\nimport { DEFAULT_CLASS, WmPageContentStyles } from './page-content.styles';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport WmLottie from '@wavemaker/app-rn-runtime/components/basic/lottie/lottie.component';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\n\nexport class WmPageContentState extends BaseComponentState<WmPageContentProps> {\n\n}\n\nexport default class WmPageContent extends BaseComponent<WmPageContentProps, WmPageContentState, WmPageContentStyles> {\n private scrollRef: RefObject<any>;\n\n constructor(props: WmPageContentProps) {\n super(props, DEFAULT_CLASS, new WmPageContentProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.scrollRef = createRef();\n this.subscribe('scrollToPosition', (args: any) => {\n this.scrollTo(args)\n })\n\n this.subscribe('scrollToEnd', () => {\n this.scrollRef?.current.scrollToEnd();\n })\n }\n\n public scrollTo(position: {x: number, y: number}){\n this.scrollRef?.current.scrollTo({\n x: position.x,\n y: position.y,\n Animated: true\n });\n }\n\n public renderSkeleton(props: WmPageContentProps): React.ReactNode {\n if(this.props.skeletonanimationresource) {\n return <View style={[{width: '100%'}, this.styles.root]}>\n <WmLottie styles={{ content: {...this.styles.root, ...this.styles.skeleton.root} }} source={this.props.skeletonanimationresource} loop={true} autoplay={true} speed={this.props.skeletonanimationspeed}/>\n </View>\n } \n return null;\n } \n\n renderWidget(props: WmPageContentProps) {\n const showScrollbar = (this.styles.root as any).scrollbarColor != 'transparent';\n // return ((props.scrollable || isWebPreviewMode()) && !this._showSkeleton) ? (\n return (props.scrollable || isWebPreviewMode()) ? (\n <View style={{height: '100%', width: '100%', backgroundColor: this._showSkeleton && this.styles.skeleton.root.backgroundColor ? this.styles.skeleton.root.backgroundColor : this.styles.root.backgroundColor}}>\n {this._background}\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n const keyboardOffset = insets?.bottom || 0;\n const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + 100 : keyboardOffset;\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={verticalOffset}\n style={{ flex: 1 }}>\n <ScrollView \n
|
1
|
+
{"version":3,"names":["React","createRef","KeyboardAvoidingView","Platform","View","isWebPreviewMode","HideMode","BaseComponent","BaseComponentState","WmPageContentProps","DEFAULT_CLASS","ScrollView","WmLottie","SafeAreaInsetsContext","FixedViewContainer","WmPageContentState","WmPageContent","constructor","props","_defineProperty","hideMode","DONOT_ADD_TO_DOM","scrollRef","subscribe","args","scrollTo","_this$scrollRef","current","scrollToEnd","position","_this$scrollRef2","x","y","Animated","renderSkeleton","skeletonanimationresource","createElement","style","width","styles","root","content","skeleton","source","loop","autoplay","speed","skeletonanimationspeed","renderWidget","showScrollbar","scrollbarColor","scrollable","height","backgroundColor","_showSkeleton","_background","Consumer","insets","top","bottom","left","right","keyboardOffset","verticalOffset","OS","behavior","undefined","keyboardVerticalOffset","flex","ref","contentContainerStyle","showsVerticalScrollIndicator","onScroll","event","notify","scrollEventThrottle","children"],"sources":["page-content.component.tsx"],"sourcesContent":["import React, { createRef, RefObject } from 'react';\nimport { KeyboardAvoidingView, Platform, View } from 'react-native';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPageContentProps from './page-content.props';\nimport { DEFAULT_CLASS, WmPageContentStyles } from './page-content.styles';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport WmLottie from '@wavemaker/app-rn-runtime/components/basic/lottie/lottie.component';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { FixedViewContainer } from '@wavemaker/app-rn-runtime/core/fixed-view.component';\n\nexport class WmPageContentState extends BaseComponentState<WmPageContentProps> {\n\n}\n\nexport default class WmPageContent extends BaseComponent<WmPageContentProps, WmPageContentState, WmPageContentStyles> {\n private scrollRef: RefObject<any>;\n\n constructor(props: WmPageContentProps) {\n super(props, DEFAULT_CLASS, new WmPageContentProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n this.scrollRef = createRef();\n this.subscribe('scrollToPosition', (args: any) => {\n this.scrollTo(args)\n })\n\n this.subscribe('scrollToEnd', () => {\n this.scrollRef?.current.scrollToEnd();\n })\n }\n\n public scrollTo(position: {x: number, y: number}){\n this.scrollRef?.current.scrollTo({\n x: position.x,\n y: position.y,\n Animated: true\n });\n }\n\n public renderSkeleton(props: WmPageContentProps): React.ReactNode {\n if(this.props.skeletonanimationresource) {\n return <View style={[{width: '100%'}, this.styles.root]}>\n <WmLottie styles={{ content: {...this.styles.root, ...this.styles.skeleton.root} }} source={this.props.skeletonanimationresource} loop={true} autoplay={true} speed={this.props.skeletonanimationspeed}/>\n </View>\n } \n return null;\n } \n\n renderWidget(props: WmPageContentProps) {\n const showScrollbar = (this.styles.root as any).scrollbarColor != 'transparent';\n // return ((props.scrollable || isWebPreviewMode()) && !this._showSkeleton) ? (\n return (props.scrollable || isWebPreviewMode()) ? (\n <View style={{height: '100%', width: '100%', backgroundColor: this._showSkeleton && this.styles.skeleton.root.backgroundColor ? this.styles.skeleton.root.backgroundColor : this.styles.root.backgroundColor}}>\n {this._background}\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n const keyboardOffset = insets?.bottom || 0;\n const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + 100 : keyboardOffset;\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={verticalOffset}\n style={{ flex: 1 }}>\n <FixedViewContainer>\n <ScrollView \n ref={this.scrollRef}\n contentContainerStyle={[this.styles.root, {backgroundColor: 'transparent'}]}\n showsVerticalScrollIndicator={showScrollbar}\n onScroll={(event) => {this.notify('scroll', [event])}}\n scrollEventThrottle={48}>\n {props.children}\n </ScrollView>\n </FixedViewContainer>\n </KeyboardAvoidingView>\n )}}\n </SafeAreaInsetsContext.Consumer>\n </View> \n ) : (\n <View style={[this.styles.root,\n {backgroundColor: this._showSkeleton ?\n this.styles.skeleton.root.backgroundColor : \n this.styles.root.backgroundColor}]}>\n <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n const keyboardOffset = insets?.bottom || 0;\n const verticalOffset = Platform.OS === 'ios' ? keyboardOffset + 100 : keyboardOffset;\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={verticalOffset}\n style={{ flex: 1 }}>\n <FixedViewContainer>\n {this._background}\n {props.children}\n </FixedViewContainer>\n </KeyboardAvoidingView>\n )}}\n </SafeAreaInsetsContext.Consumer>\n </View>\n );\n }\n }\n "],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAmB,OAAO;AACnD,SAASC,oBAAoB,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AACnE,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAC1E,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,kBAAkB,QAAQ,qDAAqD;AAExF,OAAO,MAAMC,kBAAkB,SAASP,kBAAkB,CAAqB;AAI/E,eAAe,MAAMQ,aAAa,SAAST,aAAa,CAA8D;EAGpHU,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,kBAAkB,CAAC,CAAC,CAAC;IAACU,eAAA;IACtD,IAAI,CAACC,QAAQ,GAAGd,QAAQ,CAACe,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C,sBAAsB,EAAEJ,cAAe;QACvC1B,KAAK,EAAE;UAAE+B,IAAI,EAAE;QAAE;MAAE,gBACnBpE,KAAA,CAAAoC,aAAA,CAACtB,kBAAkB,QAChB,IAAI,CAACyC,WAAW,EAChBrC,KAAK,CAAC0D,QACW,CACA,CAAC;IACxB,CAC2B,CAC5B,CACP;EACH;AACF","ignoreList":[]}
|
@@ -12,9 +12,11 @@ export class FixedView extends React.Component {
|
|
12
12
|
_defineProperty(this, "cachedComponent", void 0);
|
13
13
|
_defineProperty(this, "id", FixedView.counter++);
|
14
14
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
|
16
|
+
// componentWillUnmount() {
|
17
|
+
// this.container.remove(this);
|
18
|
+
// }
|
19
|
+
|
18
20
|
render() {
|
19
21
|
this.cachedComponent = this.props.usememo === true && this.cachedComponent || /*#__PURE__*/React.createElement(FixedViewContext.Consumer, null, container => {
|
20
22
|
this.container = container;
|