Skip to content

Commit 3849346

Browse files
committed
Published reactxp 1.6.0. Published updated extensions. Updated samples and extensions.
1 parent de12edc commit 3849346

File tree

20 files changed

+2925
-2162
lines changed

20 files changed

+2925
-2162
lines changed

docs/versions/version_history.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ A new version of ReactXP will be released a monthly basis (approximately), follo
1616

1717
### Version History
1818

19+
#### Version 1.6.0 of reactxp-imagesvg, reactxp-navigation, reactxp-video - _16 Mar 2019_
20+
* No new features; updated dependencies.
21+
22+
#### Version 1.6.0 of reactxp - _16 Mar 2019_
23+
* No new features; updated dependencies.
24+
1925
#### Version 1.6.0-rc.4 of reactxp - _15 Mar 2019_
2026
* #1055: Fixed crash due to incompatibilty with newly-released RN 59.
2127

extensions/imagesvg/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactxp-imagesvg",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "Plugin for ReactXP that provides support for SVG (scalable vector graphics) for all platforms",
55
"author": "ReactXP Team <reactxp@microsoft.com>",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"assert": "1.4.1",
13-
"react-native-svg": "8.0.8"
13+
"react-native-svg": "9.3.3"
1414
},
1515
"peerDependencies": {
1616
"react": "^16.4.0",
@@ -19,12 +19,12 @@
1919
"react-native-windows": "^0.54.0"
2020
},
2121
"devDependencies": {
22-
"@types/react-native": "0.57.15",
23-
"@types/node": "10.12.11",
24-
"reactxp": "1.5.0",
25-
"tslint": "5.11.0",
26-
"tslint-microsoft-contrib": "6.0.0",
27-
"typescript": "3.2.1"
22+
"@types/react-native": "0.57.40",
23+
"@types/node": "11.11.3",
24+
"reactxp": "1.6.0",
25+
"tslint": "5.14.0",
26+
"tslint-microsoft-contrib": "6.1.0",
27+
"typescript": "3.3.3333"
2828
},
2929
"types": "dist/web/PluginBase.d.ts"
3030
}

extensions/imagesvg/src/common/Types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
*/
88

99
import { Types as RXTypes } from 'reactxp';
10+
import * as React from 'react';
1011

1112
export interface ImageSvgStyle extends RXTypes.ViewStyle {
1213
}
14+
1315
export declare type ImageSvgStyleRuleSet = RXTypes.StyleRuleSet<ImageSvgStyle>;
1416

1517
export interface SvgCommonProps {
@@ -21,7 +23,7 @@ export interface SvgCommonProps {
2123
fillOpacity?: number;
2224
}
2325

24-
export interface ImageSvgProps extends SvgCommonProps, RXTypes.CommonStyledProps<ImageSvgStyleRuleSet> {
26+
export interface ImageSvgProps extends SvgCommonProps, RXTypes.CommonStyledProps<ImageSvgStyleRuleSet, ImageSvg> {
2527
children?: RXTypes.ReactNode;
2628
height: number;
2729
width: number;
@@ -31,12 +33,16 @@ export interface ImageSvgProps extends SvgCommonProps, RXTypes.CommonStyledProps
3133
preserveAspectRatio?: string;
3234
webShadow?: string;
3335
}
36+
3437
export interface SvgPathProps extends SvgCommonProps {
3538
d?: string;
3639
}
40+
3741
export interface SvgRectProps extends SvgCommonProps {
3842
width: number;
3943
height: number;
4044
x: number;
4145
y: number;
4246
}
47+
48+
export class ImageSvg extends React.Component<ImageSvgProps, RXTypes.Stateless> {}

extensions/navigation/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactxp-navigation",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "Plugin for ReactXP that provides a navigation framework",
55
"scripts": {
66
"build": "npm run tslint && tsc",
@@ -16,25 +16,25 @@
1616
"react"
1717
],
1818
"dependencies": {
19-
"@types/lodash": "4.14.118",
20-
"@types/node": "10.12.11",
19+
"@types/lodash": "4.14.123",
20+
"@types/node": "11.11.3",
2121
"assert": "1.4.1",
2222
"lodash": "4.17.11",
2323
"rebound": "0.1.0",
2424
"reactxp-experimental-navigation": "1.0.14"
2525
},
2626
"peerDependencies": {
2727
"react": "^16.4.0",
28-
"reactxp": "^1.5.0",
28+
"reactxp": "^1.6.0",
2929
"react-dom": "^16.4.0",
3030
"react-native": "^0.55.0",
3131
"react-native-windows": "^0.54.0"
3232
},
3333
"devDependencies": {
34-
"@types/react-native": "0.57.15",
35-
"reactxp": "^1.5.0",
36-
"tslint": "5.11.0",
37-
"typescript": "3.2.1"
34+
"@types/react-native": "0.57.40",
35+
"reactxp": "^1.6.0",
36+
"tslint": "5.14.0",
37+
"typescript": "3.3.3333"
3838
},
3939
"author": "ReactXP Team <reactxp@microsoft.com>",
4040
"license": "MIT",

extensions/navigation/src/web/Navigator.tsx

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ export class NavigatorImpl extends NavigatorBase<NavigatorState> {
126126
// Keep a map of all rendered scenes, keyed off their routeId
127127
private _renderedSceneMap: { [routeId: number]: JSX.Element } = {};
128128

129+
// References to mounted components.
130+
private _containerRef: RX.View | null;
131+
private _sceneRefs: { [sceneIndex: string]: RX.View } = {};
132+
129133
// Save a public reference to the parent navigator if one was given in props.
130134
navigatorReference: Navigator;
131135

@@ -207,7 +211,7 @@ export class NavigatorImpl extends NavigatorBase<NavigatorState> {
207211
>
208212
<View
209213
style={ _styles.transitioner }
210-
ref={ 'transitioner' }
214+
ref={ this._onMountContainer }
211215
>
212216
{ scenes }
213217
</View>
@@ -339,13 +343,19 @@ export class NavigatorImpl extends NavigatorBase<NavigatorState> {
339343
return this.state.routeStack.slice();
340344
}
341345

346+
private _onMountContainer = (comp: RX.View | null) => {
347+
this._containerRef = comp;
348+
}
349+
342350
private _updateDimensionsCache() {
343-
const transitioner = ReactDOM.findDOMNode(this.refs['transitioner']) as HTMLElement|null;
344-
if (transitioner) {
345-
this._dimensions = {
346-
width: transitioner.offsetWidth,
347-
height: transitioner.offsetHeight
348-
};
351+
if (this._containerRef) {
352+
const transitioner = ReactDOM.findDOMNode(this._containerRef) as HTMLElement | null;
353+
if (transitioner) {
354+
this._dimensions = {
355+
width: transitioner.offsetWidth,
356+
height: transitioner.offsetHeight
357+
};
358+
}
349359
}
350360
}
351361

@@ -372,18 +382,30 @@ export class NavigatorImpl extends NavigatorBase<NavigatorState> {
372382
return (
373383
<View
374384
key={ 'scene_' + this._getRouteID(route) }
375-
ref={ 'scene_' + index }
385+
ref={ (comp) => this._onMountScene(comp, index) }
376386
style={ styles }
377387
>
378388
{ this.props.renderScene(route) }
379389
</View>
380390
);
381391
}
382392

393+
private _onMountScene(comp: RX.View | null, sceneIndex: number) {
394+
const sceneId = 'scene_' + sceneIndex;
395+
396+
if (!comp) {
397+
delete this._sceneRefs[sceneId];
398+
} else {
399+
this._sceneRefs[sceneId] = comp;
400+
}
401+
}
402+
383403
// Push a scene below the others so they don't block touches sent to the presented scenes.
384404
private _disableScene(sceneIndex: number) {
385-
if (this.refs['scene_' + sceneIndex]) {
386-
this._setNativeStyles(this.refs['scene_' + sceneIndex], {
405+
const sceneId = 'scene_' + sceneIndex;
406+
407+
if (this._sceneRefs[sceneId]) {
408+
this._setNativeStyles(this._sceneRefs[sceneId], {
387409
opacity: 0,
388410
zIndex: -10
389411
});

extensions/video/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactxp-video",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "Plugin for ReactXP that provides a video player component for all platforms",
55
"author": "ReactXP Team <reactxp@microsoft.com>",
66
"license": "MIT",
@@ -9,22 +9,22 @@
99
"tslint": "tslint -p tsconfig.json -r tslint.json -r ./node_modules/tslint-microsoft-contrib --fix || true"
1010
},
1111
"dependencies": {
12-
"@types/lodash": "4.14.118",
13-
"@types/react-native": "0.57.15",
12+
"@types/lodash": "4.14.123",
13+
"@types/react-native": "0.57.40",
1414
"lodash": "4.17.11",
1515
"react-native-video": "2.3.1"
1616
},
1717
"peerDependencies": {
18-
"reactxp": "^1.5.0",
18+
"reactxp": "^1.6.0",
1919
"react-dom": "^16.4.0",
2020
"react-native": "^0.55.0",
2121
"react-native-windows": "^0.54.0"
2222
},
2323
"devDependencies": {
24-
"reactxp": "^1.5.0",
25-
"typescript": "3.2.1",
26-
"tslint": "5.11.0",
27-
"tslint-microsoft-contrib": "6.0.0"
24+
"reactxp": "^1.6.0",
25+
"typescript": "3.3.3333",
26+
"tslint": "5.14.0",
27+
"tslint-microsoft-contrib": "6.1.0"
2828
},
2929
"types": "dist/web/PluginBase.d.ts"
3030
}

extensions/video/src/common/Interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import * as RX from 'reactxp';
1212

1313
import * as Types from './Types';
1414

15-
export abstract class Video extends RX.Component<Types.VideoProps, any> {
15+
export abstract class Video extends RX.Component<Types.VideoProps, RX.Stateless> {
1616
abstract seek(position: number): void;
1717
abstract play(): void;
1818
abstract pause(): void;

extensions/video/src/common/Types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Type definitions to support the plugin.
88
*/
99

10+
import * as React from 'react';
1011
import { Types as RXTypes } from 'reactxp';
1112

1213
// Video interfaces from react-native-video
@@ -26,7 +27,7 @@ export interface VideoInfo {
2627
};
2728
}
2829

29-
export interface VideoProps extends RXTypes.CommonStyledProps<RXTypes.ViewStyleRuleSet> {
30+
export interface VideoProps extends RXTypes.CommonStyledProps<RXTypes.ViewStyleRuleSet, Video> {
3031
source: string;
3132
accessibilityLabel?: string;
3233
showControls?: boolean;
@@ -45,3 +46,5 @@ export interface VideoProps extends RXTypes.CommonStyledProps<RXTypes.ViewStyleR
4546
onLoadedData?: (info: VideoInfo) => void;
4647
onProgress?: (progress: VideoProgress) => void;
4748
}
49+
50+
export abstract class Video extends React.Component<VideoProps, RXTypes.Stateless> {}

package-lock.json

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactxp",
3-
"version": "1.6.0-rc.4",
3+
"version": "1.6.0",
44
"description": "Cross-platform abstraction layer for writing React-based applications a single time that work identically across web, React Native, and Electron distribution",
55
"author": "ReactXP Team <reactxp@microsoft.com>",
66
"license": "MIT",
@@ -12,10 +12,10 @@
1212
"tslint-release": "tslint --project tsconfig.json -r tslint.json -r ./node_modules/tslint-microsoft-contrib"
1313
},
1414
"dependencies": {
15-
"@types/lodash": "^4.14.122",
16-
"@types/react": "^16.8.7",
15+
"@types/lodash": "^4.14.123",
16+
"@types/react": "^16.8.8",
1717
"@types/react-dom": "^16.8.2",
18-
"@types/react-native": "^0.57.38",
18+
"@types/react-native": "^0.57.40",
1919
"lodash": "^4.17.11",
2020
"prop-types": "^15.7.2",
2121
"rebound": "^0.1.0",
@@ -29,10 +29,10 @@
2929
"react-native-windows": "^0.57.0-rc.5"
3030
},
3131
"devDependencies": {
32-
"tslint": "^5.13.1",
32+
"tslint": "^5.14.0",
3333
"tslint-microsoft-contrib": "^6.1.0",
3434
"tslint-react": "^3.6.0",
35-
"tsutils": "^3.8.0",
35+
"tsutils": "^3.9.1",
3636
"typescript": "^3.3.3333"
3737
},
3838
"homepage": "https://microsoft.github.io/reactxp/",

0 commit comments

Comments
 (0)