зеркало из https://github.com/microsoft/reactxp.git
Revert "packages updated to point to react-16 (#294)"
This reverts commit 6675ae94a4
.
This commit is contained in:
Родитель
6675ae94a4
Коммит
6b7026749b
10
package.json
10
package.json
|
@ -10,8 +10,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@types/lodash": "^4.14.66",
|
||||
"@types/react": "^16.0.0",
|
||||
"@types/react-dom": "^15.5.5",
|
||||
"@types/react": "^15.4.1",
|
||||
"@types/react-dom": "^15.4.1",
|
||||
"assert": "^1.3.0",
|
||||
"ifvisible.js": "^1.0.6",
|
||||
"lodash": "^4.17.1",
|
||||
|
@ -21,10 +21,10 @@
|
|||
"synctasks": "^0.2.9"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.0.0",
|
||||
"react-dom": "^16.0.0",
|
||||
"react": "^15.4.1",
|
||||
"react-dom": "^15.4.1",
|
||||
"react-native": "^0.46.0",
|
||||
"react-native-windows": "^0.46.0-rc.0"
|
||||
"react-native-windows": "^0.33.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "2.6.0-dev.20170826",
|
||||
|
|
|
@ -24,7 +24,7 @@ export abstract class Alert {
|
|||
options?: Types.AlertOptions): void;
|
||||
}
|
||||
|
||||
export abstract class AnimatedComponent<P extends Types.CommonProps<any>, T> extends React.Component<P, T> {
|
||||
export abstract class AnimatedComponent<P extends Types.CommonProps, T> extends React.Component<P, T> {
|
||||
abstract setNativeProps(props: P): void;
|
||||
}
|
||||
|
||||
|
|
|
@ -448,12 +448,12 @@ export enum AccessibilityTrait {
|
|||
None
|
||||
}
|
||||
|
||||
export interface CommonStyledProps<S, T> extends CommonProps<T> {
|
||||
style?: StyleRuleSetRecursive<S>;
|
||||
export interface CommonStyledProps<T> extends CommonProps {
|
||||
style?: StyleRuleSetRecursive<T>;
|
||||
}
|
||||
|
||||
// Button
|
||||
export interface ButtonProps extends CommonStyledProps<ButtonStyleRuleSet, RX.Button>, CommonAccessibilityProps {
|
||||
export interface ButtonProps extends CommonStyledProps<ButtonStyleRuleSet>, CommonAccessibilityProps {
|
||||
title?: string;
|
||||
children?: ReactNode;
|
||||
disabled?: boolean;
|
||||
|
@ -489,7 +489,7 @@ export interface PickerPropsItem {
|
|||
label: string;
|
||||
value: string;
|
||||
}
|
||||
export interface PickerProps extends CommonProps<RX.Picker> {
|
||||
export interface PickerProps extends CommonProps {
|
||||
items: PickerPropsItem[];
|
||||
selectedValue: string;
|
||||
onValueChange: (itemValue: string, itemPosition: number) => void;
|
||||
|
@ -498,7 +498,7 @@ export interface PickerProps extends CommonProps<RX.Picker> {
|
|||
}
|
||||
|
||||
// Image
|
||||
export interface ImagePropsShared extends CommonProps<RX.Image> {
|
||||
export interface ImagePropsShared extends CommonProps {
|
||||
source: string;
|
||||
headers?: { [headerName: string]: string };
|
||||
accessibilityLabel?: string;
|
||||
|
@ -531,7 +531,7 @@ export interface AnimatedImageProps extends ImagePropsShared {
|
|||
// | I am a very |
|
||||
// | important |
|
||||
// | example |
|
||||
export interface TextPropsShared extends CommonProps<RX.Text> {
|
||||
export interface TextPropsShared extends CommonProps {
|
||||
children?: ReactNode;
|
||||
selectable?: boolean;
|
||||
numberOfLines?: number;
|
||||
|
@ -573,7 +573,7 @@ export interface AnimatedTextProps extends TextPropsShared {
|
|||
export type ViewLayerType = 'none' | 'software' | 'hardware';
|
||||
|
||||
// View
|
||||
export interface ViewPropsShared<T> extends CommonProps<T>, CommonAccessibilityProps {
|
||||
export interface ViewPropsShared extends CommonProps, CommonAccessibilityProps {
|
||||
title?: string;
|
||||
ignorePointerEvents?: boolean;
|
||||
blockPointerEvents?: boolean; // Native-only prop for disabling touches on self and all child views
|
||||
|
@ -619,11 +619,7 @@ export interface ViewPropsShared<T> extends CommonProps<T>, CommonAccessibilityP
|
|||
underlayColor?: string;
|
||||
}
|
||||
|
||||
// Interface for the ViewProps
|
||||
export interface ViewProps extends ViewPropsBase<RX.View> { }
|
||||
|
||||
// Base interface for inheritance (ScrollView and other Views sharing the same set of props)
|
||||
export interface ViewPropsBase<T> extends ViewPropsShared<T> {
|
||||
export interface ViewProps extends ViewPropsShared {
|
||||
style?: StyleRuleSetRecursive<ViewStyleRuleSet>;
|
||||
onContextMenu?: (e: React.SyntheticEvent<any>) => void;
|
||||
onStartShouldSetResponder?: (e: React.SyntheticEvent<any>) => boolean;
|
||||
|
@ -640,7 +636,7 @@ export interface ViewPropsBase<T> extends ViewPropsShared<T> {
|
|||
onResponderTerminationRequest?: (e: React.SyntheticEvent<any>) => boolean;
|
||||
}
|
||||
|
||||
export interface AnimatedViewProps extends ViewPropsShared<RX.View> {
|
||||
export interface AnimatedViewProps extends ViewPropsShared {
|
||||
style?: StyleRuleSetRecursive<AnimatedViewStyleRuleSet | ViewStyleRuleSet>;
|
||||
}
|
||||
|
||||
|
@ -715,7 +711,7 @@ export enum PreferredPanGesture {
|
|||
Vertical
|
||||
}
|
||||
|
||||
export interface GestureViewProps extends CommonStyledProps<ViewStyleRuleSet, RX.GestureView>, CommonAccessibilityProps {
|
||||
export interface GestureViewProps extends CommonStyledProps<ViewStyleRuleSet>, CommonAccessibilityProps {
|
||||
// Gestures and attributes that apply only to touch inputs
|
||||
onPinchZoom?: (gestureState: MultiTouchGestureState) => void;
|
||||
onRotate?: (gestureState: MultiTouchGestureState) => void;
|
||||
|
@ -751,7 +747,7 @@ export interface ScrollIndicatorInsets {
|
|||
}
|
||||
|
||||
// ScrollView
|
||||
export interface ScrollViewProps extends ViewPropsBase<RX.ScrollView> {
|
||||
export interface ScrollViewProps extends ViewProps {
|
||||
style?: StyleRuleSetRecursive<ScrollViewStyleRuleSet>;
|
||||
children?: ReactNode;
|
||||
|
||||
|
@ -811,7 +807,7 @@ export interface ScrollViewProps extends ViewPropsBase<RX.ScrollView> {
|
|||
}
|
||||
|
||||
// Link
|
||||
export interface LinkProps extends CommonStyledProps<LinkStyleRuleSet, RX.Link> {
|
||||
export interface LinkProps extends CommonStyledProps<LinkStyleRuleSet> {
|
||||
title?: string;
|
||||
url: string;
|
||||
children?: ReactNode;
|
||||
|
@ -828,7 +824,7 @@ export interface LinkProps extends CommonStyledProps<LinkStyleRuleSet, RX.Link>
|
|||
}
|
||||
|
||||
// TextInput
|
||||
export interface TextInputPropsShared extends CommonProps<RX.TextInput>, CommonAccessibilityProps {
|
||||
export interface TextInputPropsShared extends CommonProps, CommonAccessibilityProps {
|
||||
autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
|
||||
autoCorrect?: boolean;
|
||||
autoFocus?: boolean;
|
||||
|
@ -885,7 +881,7 @@ export interface AnimatedTextInputProps extends TextInputPropsShared {
|
|||
}
|
||||
|
||||
// ActivityIndicator
|
||||
export interface ActivityIndicatorProps extends CommonStyledProps<ActivityIndicatorStyleRuleSet, RX.ActivityIndicator> {
|
||||
export interface ActivityIndicatorProps extends CommonStyledProps<ActivityIndicatorStyleRuleSet> {
|
||||
color: string;
|
||||
size?: 'large' | 'medium' | 'small' | 'tiny';
|
||||
deferTime?: number; // Number of ms to wait before displaying
|
||||
|
@ -920,7 +916,7 @@ export enum WebViewSandboxMode {
|
|||
AllowTopNavigation = 1 << 9
|
||||
}
|
||||
|
||||
export interface WebViewProps extends CommonStyledProps<WebViewStyleRuleSet, RX.WebView> {
|
||||
export interface WebViewProps extends CommonStyledProps<WebViewStyleRuleSet> {
|
||||
url: string;
|
||||
headers?: { [key: string]: string };
|
||||
onLoad?: (e: SyntheticEvent) => void;
|
||||
|
|
|
@ -59,10 +59,10 @@ export class Button extends React.Component<Types.ButtonProps, {}> {
|
|||
touchableGetInitialState: () => RN.Touchable.State;
|
||||
touchableHandleStartShouldSetResponder: () => boolean;
|
||||
touchableHandleResponderTerminationRequest: () => boolean;
|
||||
touchableHandleResponderGrant: (e: React.SyntheticEvent<Button>) => void;
|
||||
touchableHandleResponderMove: (e: React.SyntheticEvent<Button>) => void;
|
||||
touchableHandleResponderRelease: (e: React.SyntheticEvent<Button>) => void;
|
||||
touchableHandleResponderTerminate: (e: React.SyntheticEvent<Button>) => void;
|
||||
touchableHandleResponderGrant: (e: React.SyntheticEvent<any>) => void;
|
||||
touchableHandleResponderMove: (e: React.SyntheticEvent<any>) => void;
|
||||
touchableHandleResponderRelease: (e: React.SyntheticEvent<any>) => void;
|
||||
touchableHandleResponderTerminate: (e: React.SyntheticEvent<any>) => void;
|
||||
|
||||
private _isMounted = false;
|
||||
private _hideTimeout: number|undefined;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
import React = require('react');
|
||||
import RN = require('react-native');
|
||||
|
||||
import RX = require('../common/Interfaces');
|
||||
import Types= require('../common/Types');
|
||||
|
||||
const _styles = {
|
||||
|
@ -30,7 +29,7 @@ const _styles = {
|
|||
}
|
||||
};
|
||||
|
||||
export interface ModalContainerProps extends Types.CommonProps<RX.View> {
|
||||
export interface ModalContainerProps extends Types.CommonProps {
|
||||
}
|
||||
|
||||
export class ModalContainer extends React.Component<ModalContainerProps, {}> {
|
||||
|
|
|
@ -14,7 +14,6 @@ import assert = require('assert');
|
|||
import React = require('react');
|
||||
import RN = require('react-native');
|
||||
|
||||
import RX = require('../common/Interfaces');
|
||||
import Types = require('../common/Types');
|
||||
|
||||
// Width of the "alley" around popups so they don't get too close to the boundary of the screen boundary.
|
||||
|
@ -24,7 +23,7 @@ const ALLEY_WIDTH = 2;
|
|||
// attempting a different position?
|
||||
const MIN_ANCHOR_OFFSET = 16;
|
||||
|
||||
export interface PopupContainerViewProps extends Types.CommonProps<RX.View> {
|
||||
export interface PopupContainerViewProps extends Types.CommonProps {
|
||||
activePopupOptions: Types.PopupOptions;
|
||||
anchorHandle: number;
|
||||
onDismissPopup?: () => void;
|
||||
|
|
|
@ -13,7 +13,7 @@ import RX = require('../common/Interfaces');
|
|||
|
||||
import Types = require('../common/Types');
|
||||
|
||||
export abstract class ViewBase<P extends Types.ViewPropsBase<any>, S> extends RX.ViewBase<P, S> {
|
||||
export abstract class ViewBase<P extends Types.ViewProps, S> extends RX.ViewBase<P, S> {
|
||||
private static _defaultViewStyle: Types.ViewStyleRuleSet|undefined;
|
||||
private _layoutEventValues: Types.ViewOnLayoutEvent|undefined;
|
||||
|
||||
|
|
|
@ -595,7 +595,7 @@ export var parallel: Types.Animated.ParallelFunction = function (
|
|||
};
|
||||
|
||||
// Function for creating wrapper AnimatedComponent around passed in component
|
||||
function createAnimatedComponent<PropsType extends Types.CommonProps<any>>(Component: any): any {
|
||||
function createAnimatedComponent<PropsType extends Types.CommonProps>(Component: any): any {
|
||||
var refName = 'animatedNode';
|
||||
|
||||
class AnimatedComponentGenerated extends React.Component<PropsType, void> implements RX.AnimatedComponent<PropsType, void> {
|
||||
|
@ -613,11 +613,11 @@ function createAnimatedComponent<PropsType extends Types.CommonProps<any>>(Compo
|
|||
throw 'Called setNativeProps on web AnimatedComponent';
|
||||
}
|
||||
|
||||
componentWillReceiveProps(props: Types.CommonStyledProps<Types.StyleRuleSet<Object>, RX.Animated>) {
|
||||
componentWillReceiveProps(props: Types.CommonStyledProps<Types.StyleRuleSet<Object>>) {
|
||||
this._updateStyles(props);
|
||||
}
|
||||
|
||||
private _updateStyles(props: Types.CommonStyledProps<Types.StyleRuleSet<Object>, RX.Animated>) {
|
||||
private _updateStyles(props: Types.CommonStyledProps<Types.StyleRuleSet<Object>>) {
|
||||
this._propsWithoutStyle = _.omit(props, 'style');
|
||||
|
||||
if (!props.style) {
|
||||
|
@ -672,7 +672,7 @@ function createAnimatedComponent<PropsType extends Types.CommonProps<any>>(Compo
|
|||
});
|
||||
}
|
||||
|
||||
initializeComponent(props: Types.CommonProps<any>) {
|
||||
initializeComponent(props: Types.CommonProps) {
|
||||
// Conclude the initialization setting the element.
|
||||
const element = ReactDOM.findDOMNode<HTMLElement>(this.refs[refName]);
|
||||
if (element) {
|
||||
|
@ -744,7 +744,7 @@ function createAnimatedComponent<PropsType extends Types.CommonProps<any>>(Compo
|
|||
return AnimatedComponentGenerated;
|
||||
}
|
||||
|
||||
export var Image = createAnimatedComponent(RXImage) as typeof RX.AnimatedImage;
|
||||
export var Image = createAnimatedComponent<Types.ImageProps>(RXImage) as typeof RX.AnimatedImage;
|
||||
export var Text = createAnimatedComponent(RXText) as typeof RX.AnimatedText;
|
||||
export var TextInput = createAnimatedComponent(RXTextInput) as typeof RX.AnimatedTextInput;
|
||||
export var View = createAnimatedComponent(RXView) as typeof RX.AnimatedView;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
import React = require('react');
|
||||
|
||||
import RX = require('../common/Interfaces');
|
||||
import Types = require('../common/Types');
|
||||
|
||||
const _styles = {
|
||||
|
@ -30,7 +29,7 @@ const _styles = {
|
|||
}
|
||||
};
|
||||
|
||||
export class ModalContainer extends React.Component<Types.CommonProps<RX.View>, {}> {
|
||||
export class ModalContainer extends React.Component<Types.CommonProps, {}> {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ export class ScrollView extends ViewBase<Types.ScrollViewProps, {}> implements R
|
|||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps: Types.ViewPropsBase<any>) {
|
||||
componentWillReceiveProps(newProps: Types.ScrollViewProps) {
|
||||
super.componentWillReceiveProps(newProps);
|
||||
this._onPropsChange(newProps);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import Types = require('../common/Types');
|
|||
const _layoutTimerActiveDuration = 1000;
|
||||
const _layoutTimerInactiveDuration = 10000;
|
||||
|
||||
export abstract class ViewBase<P extends Types.ViewPropsBase<any>, S> extends RX.ViewBase<P, S> {
|
||||
export abstract class ViewBase<P extends Types.ViewProps, S> extends RX.ViewBase<P, S> {
|
||||
private static _viewCheckingTimer: number|undefined;
|
||||
private static _isResizeHandlerInstalled = false;
|
||||
private static _viewCheckingList: ViewBase<Types.ViewProps, {}>[] = [];
|
||||
|
|
Загрузка…
Ссылка в новой задаче