react 15.3.2 → 15.4.0-rc.4
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/dist/react-with-addons.js +3864 -21390
- package/dist/react-with-addons.min.js +3 -6
- package/dist/react.js +2639 -19486
- package/dist/react.min.js +2 -6
- package/lib/KeyEscapeUtils.js +0 -1
- package/lib/LinkedStateMixin.js +1 -3
- package/lib/PooledClass.js +3 -1
- package/lib/React.js +0 -1
- package/lib/ReactAddonsDOMDependencies.js +35 -0
- package/lib/ReactAddonsDOMDependenciesUMDShim.js +31 -0
- package/lib/ReactCSSTransitionGroup.js +60 -43
- package/lib/ReactCSSTransitionGroupChild.js +2 -3
- package/lib/ReactChildren.js +0 -1
- package/lib/ReactClass.js +38 -54
- package/lib/ReactComponent.js +0 -1
- package/lib/ReactComponentTreeDevtool.js +0 -1
- package/lib/ReactComponentTreeHook.js +84 -101
- package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +4 -7
- package/lib/ReactComponentWithPureRenderMixin.js +0 -1
- package/lib/ReactCurrentOwner.js +1 -2
- package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +5 -4
- package/lib/ReactDOMFactories.js +0 -1
- package/lib/ReactElement.js +6 -14
- package/lib/ReactElementSymbol.js +19 -0
- package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +3 -9
- package/lib/ReactElementValidator.js +1 -3
- package/lib/ReactFragment.js +0 -1
- package/lib/ReactLink.js +0 -1
- package/lib/ReactNoopUpdateQueue.js +0 -1
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +2 -12
- package/lib/ReactPropTypes.js +5 -3
- package/lib/ReactPropTypesSecret.js +1 -1
- package/lib/ReactPureComponent.js +0 -1
- package/lib/ReactStateSetters.js +0 -1
- package/lib/ReactTransitionChildMapping.js +0 -1
- package/lib/ReactTransitionEvents.js +1 -2
- package/lib/ReactTransitionGroup.js +145 -142
- package/lib/ReactUMDEntry.js +11 -6
- package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +3 -6
- package/lib/ReactVersion.js +1 -2
- package/lib/ReactWithAddons.js +15 -3
- package/lib/ReactWithAddonsUMDEntry.js +11 -6
- package/lib/canDefineProperty.js +2 -1
- package/lib/checkReactTypeSpec.js +0 -1
- package/lib/deprecated.js +0 -1
- package/lib/flattenChildren.js +0 -1
- package/lib/getIteratorFn.js +0 -1
- package/lib/onlyChild.js +0 -1
- package/lib/reactProdInvariant.js +0 -1
- package/lib/shallowCompare.js +1 -2
- package/lib/sliceChildren.js +0 -1
- package/lib/traverseAllChildren.js +11 -3
- package/lib/update.js +6 -8
- package/package.json +1 -1
- package/lib/AutoFocusUtils.js +0 -24
- package/lib/BeforeInputEventPlugin.js +0 -390
- package/lib/CSSProperty.js +0 -148
- package/lib/CSSPropertyOperations.js +0 -205
- package/lib/CallbackQueue.js +0 -106
- package/lib/ChangeEventPlugin.js +0 -325
- package/lib/DOMChildrenOperations.js +0 -194
- package/lib/DOMLazyTree.js +0 -118
- package/lib/DOMProperty.js +0 -206
- package/lib/DOMPropertyOperations.js +0 -221
- package/lib/Danger.js +0 -48
- package/lib/DefaultEventPluginOrder.js +0 -27
- package/lib/DisabledInputUtils.js +0 -50
- package/lib/EnterLeaveEventPlugin.js +0 -105
- package/lib/EventConstants.js +0 -97
- package/lib/EventPluginHub.js +0 -251
- package/lib/EventPluginRegistry.js +0 -247
- package/lib/EventPluginUtils.js +0 -229
- package/lib/EventPropagators.js +0 -137
- package/lib/FallbackCompositionState.js +0 -95
- package/lib/HTMLDOMPropertyConfig.js +0 -212
- package/lib/LinkedValueUtils.js +0 -136
- package/lib/NativeMethodsMixin.js +0 -167
- package/lib/ReactBrowserEventEmitter.js +0 -330
- package/lib/ReactChildReconciler.js +0 -154
- package/lib/ReactChildrenMutationWarningHook.js +0 -54
- package/lib/ReactComponentBrowserEnvironment.js +0 -30
- package/lib/ReactComponentEnvironment.js +0 -45
- package/lib/ReactComponentTreeTestUtils.js +0 -87
- package/lib/ReactCompositeComponent.js +0 -904
- package/lib/ReactDOM.js +0 -110
- package/lib/ReactDOMButton.js +0 -24
- package/lib/ReactDOMComponent.js +0 -1006
- package/lib/ReactDOMComponentTree.js +0 -188
- package/lib/ReactDOMContainerInfo.js +0 -33
- package/lib/ReactDOMEmptyComponent.js +0 -60
- package/lib/ReactDOMFiber.js +0 -76
- package/lib/ReactDOMIDOperations.js +0 -34
- package/lib/ReactDOMInput.js +0 -269
- package/lib/ReactDOMNullInputValuePropHook.js +0 -43
- package/lib/ReactDOMOption.js +0 -123
- package/lib/ReactDOMSelect.js +0 -201
- package/lib/ReactDOMSelection.js +0 -212
- package/lib/ReactDOMServer.js +0 -26
- package/lib/ReactDOMTextComponent.js +0 -164
- package/lib/ReactDOMTextarea.js +0 -155
- package/lib/ReactDOMTreeTraversal.js +0 -136
- package/lib/ReactDOMUnknownPropertyHook.js +0 -112
- package/lib/ReactDebugTool.js +0 -301
- package/lib/ReactDefaultBatchingStrategy.js +0 -68
- package/lib/ReactDefaultInjection.js +0 -84
- package/lib/ReactEmptyComponent.js +0 -30
- package/lib/ReactErrorUtils.js +0 -76
- package/lib/ReactEventEmitterMixin.js +0 -33
- package/lib/ReactEventListener.js +0 -157
- package/lib/ReactFeatureFlags.js +0 -22
- package/lib/ReactHostComponent.js +0 -76
- package/lib/ReactHostOperationHistoryHook.js +0 -37
- package/lib/ReactInjection.js +0 -36
- package/lib/ReactInputSelection.js +0 -124
- package/lib/ReactInstanceHandles.js +0 -302
- package/lib/ReactInstanceMap.js +0 -48
- package/lib/ReactInstrumentation.js +0 -21
- package/lib/ReactInvalidSetStateWarningHook.js +0 -36
- package/lib/ReactMarkupChecksum.js +0 -50
- package/lib/ReactMount.js +0 -534
- package/lib/ReactMultiChild.js +0 -451
- package/lib/ReactMultiChildUpdateTypes.js +0 -32
- package/lib/ReactNative.js +0 -71
- package/lib/ReactNativeAttributePayload.js +0 -371
- package/lib/ReactNativeBaseComponent.js +0 -198
- package/lib/ReactNativeBridgeEventPlugin.js +0 -60
- package/lib/ReactNativeComponentEnvironment.js +0 -31
- package/lib/ReactNativeComponentTree.js +0 -68
- package/lib/ReactNativeContainerInfo.js +0 -21
- package/lib/ReactNativeDOMIDOperations.js +0 -79
- package/lib/ReactNativeDefaultInjection.js +0 -101
- package/lib/ReactNativeEventEmitter.js +0 -191
- package/lib/ReactNativeEventPluginOrder.js +0 -16
- package/lib/ReactNativeGlobalResponderHandler.js +0 -25
- package/lib/ReactNativeMount.js +0 -193
- package/lib/ReactNativePropRegistry.js +0 -52
- package/lib/ReactNativeReconcileTransaction.js +0 -129
- package/lib/ReactNativeTagHandles.js +0 -56
- package/lib/ReactNativeTextComponent.js +0 -71
- package/lib/ReactNativeTreeTraversal.js +0 -127
- package/lib/ReactNodeTypes.js +0 -40
- package/lib/ReactNoop.js +0 -173
- package/lib/ReactOwner.js +0 -94
- package/lib/ReactPerf.js +0 -494
- package/lib/ReactReconcileTransaction.js +0 -178
- package/lib/ReactReconciler.js +0 -168
- package/lib/ReactRef.js +0 -80
- package/lib/ReactServerBatchingStrategy.js +0 -22
- package/lib/ReactServerRendering.js +0 -90
- package/lib/ReactServerRenderingTransaction.js +0 -90
- package/lib/ReactServerUpdateQueue.js +0 -141
- package/lib/ReactSimpleEmptyComponent.js +0 -37
- package/lib/ReactTestMount.js +0 -126
- package/lib/ReactTestReconcileTransaction.js +0 -121
- package/lib/ReactTestRenderer.js +0 -144
- package/lib/ReactTestUtils.js +0 -518
- package/lib/ReactUpdateQueue.js +0 -226
- package/lib/ReactUpdates.js +0 -251
- package/lib/ResponderEventPlugin.js +0 -510
- package/lib/ResponderSyntheticEvent.js +0 -39
- package/lib/ResponderTouchHistoryStore.js +0 -184
- package/lib/SVGDOMPropertyConfig.js +0 -302
- package/lib/SelectEventPlugin.js +0 -196
- package/lib/SimpleEventPlugin.js +0 -635
- package/lib/SyntheticAnimationEvent.js +0 -39
- package/lib/SyntheticClipboardEvent.js +0 -38
- package/lib/SyntheticCompositionEvent.js +0 -36
- package/lib/SyntheticDragEvent.js +0 -36
- package/lib/SyntheticEvent.js +0 -268
- package/lib/SyntheticFocusEvent.js +0 -36
- package/lib/SyntheticInputEvent.js +0 -37
- package/lib/SyntheticKeyboardEvent.js +0 -84
- package/lib/SyntheticMouseEvent.js +0 -72
- package/lib/SyntheticTouchEvent.js +0 -45
- package/lib/SyntheticTransitionEvent.js +0 -39
- package/lib/SyntheticUIEvent.js +0 -59
- package/lib/SyntheticWheelEvent.js +0 -54
- package/lib/TapEventPlugin.js +0 -110
- package/lib/TouchHistoryMath.js +0 -99
- package/lib/Transaction.js +0 -233
- package/lib/ViewportMetrics.js +0 -27
- package/lib/accumulate.js +0 -46
- package/lib/accumulateInto.js +0 -58
- package/lib/adler32.js +0 -44
- package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
- package/lib/createReactNativeComponentClass.js +0 -42
- package/lib/dangerousStyleValue.js +0 -79
- package/lib/escapeTextContentForBrowser.js +0 -123
- package/lib/findDOMNode.js +0 -60
- package/lib/findNodeHandle.js +0 -91
- package/lib/forEachAccumulated.js +0 -31
- package/lib/getEventCharCode.js +0 -50
- package/lib/getEventKey.js +0 -102
- package/lib/getEventModifierState.js +0 -43
- package/lib/getEventTarget.js +0 -35
- package/lib/getHostComponentFromComposite.js +0 -30
- package/lib/getNodeForCharacterOffset.js +0 -74
- package/lib/getTestDocument.js +0 -21
- package/lib/getTextContentAccessor.js +0 -33
- package/lib/getVendorPrefixedEventName.js +0 -101
- package/lib/instantiateReactComponent.js +0 -119
- package/lib/isEventSupported.js +0 -60
- package/lib/isTextInputElement.js +0 -51
- package/lib/quoteAttributeValueForBrowser.js +0 -26
- package/lib/reactComponentExpect.js +0 -217
- package/lib/setInnerHTML.js +0 -98
- package/lib/setTextContent.js +0 -48
- package/lib/shouldUpdateReactComponent.js +0 -42
- package/lib/validateDOMNesting.js +0 -382
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule SyntheticInputEvent
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var SyntheticEvent = require('./SyntheticEvent');
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @interface Event
|
|
18
|
-
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
|
|
19
|
-
* /#events-inputevents
|
|
20
|
-
*/
|
|
21
|
-
var InputEventInterface = {
|
|
22
|
-
data: null
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
27
|
-
* @param {string} dispatchMarker Marker identifying the event target.
|
|
28
|
-
* @param {object} nativeEvent Native browser event.
|
|
29
|
-
* @extends {SyntheticUIEvent}
|
|
30
|
-
*/
|
|
31
|
-
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
32
|
-
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
|
|
36
|
-
|
|
37
|
-
module.exports = SyntheticInputEvent;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule SyntheticKeyboardEvent
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var SyntheticUIEvent = require('./SyntheticUIEvent');
|
|
15
|
-
|
|
16
|
-
var getEventCharCode = require('./getEventCharCode');
|
|
17
|
-
var getEventKey = require('./getEventKey');
|
|
18
|
-
var getEventModifierState = require('./getEventModifierState');
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @interface KeyboardEvent
|
|
22
|
-
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
23
|
-
*/
|
|
24
|
-
var KeyboardEventInterface = {
|
|
25
|
-
key: getEventKey,
|
|
26
|
-
location: null,
|
|
27
|
-
ctrlKey: null,
|
|
28
|
-
shiftKey: null,
|
|
29
|
-
altKey: null,
|
|
30
|
-
metaKey: null,
|
|
31
|
-
repeat: null,
|
|
32
|
-
locale: null,
|
|
33
|
-
getModifierState: getEventModifierState,
|
|
34
|
-
// Legacy Interface
|
|
35
|
-
charCode: function (event) {
|
|
36
|
-
// `charCode` is the result of a KeyPress event and represents the value of
|
|
37
|
-
// the actual printable character.
|
|
38
|
-
|
|
39
|
-
// KeyPress is deprecated, but its replacement is not yet final and not
|
|
40
|
-
// implemented in any major browser. Only KeyPress has charCode.
|
|
41
|
-
if (event.type === 'keypress') {
|
|
42
|
-
return getEventCharCode(event);
|
|
43
|
-
}
|
|
44
|
-
return 0;
|
|
45
|
-
},
|
|
46
|
-
keyCode: function (event) {
|
|
47
|
-
// `keyCode` is the result of a KeyDown/Up event and represents the value of
|
|
48
|
-
// physical keyboard key.
|
|
49
|
-
|
|
50
|
-
// The actual meaning of the value depends on the users' keyboard layout
|
|
51
|
-
// which cannot be detected. Assuming that it is a US keyboard layout
|
|
52
|
-
// provides a surprisingly accurate mapping for US and European users.
|
|
53
|
-
// Due to this, it is left to the user to implement at this time.
|
|
54
|
-
if (event.type === 'keydown' || event.type === 'keyup') {
|
|
55
|
-
return event.keyCode;
|
|
56
|
-
}
|
|
57
|
-
return 0;
|
|
58
|
-
},
|
|
59
|
-
which: function (event) {
|
|
60
|
-
// `which` is an alias for either `keyCode` or `charCode` depending on the
|
|
61
|
-
// type of the event.
|
|
62
|
-
if (event.type === 'keypress') {
|
|
63
|
-
return getEventCharCode(event);
|
|
64
|
-
}
|
|
65
|
-
if (event.type === 'keydown' || event.type === 'keyup') {
|
|
66
|
-
return event.keyCode;
|
|
67
|
-
}
|
|
68
|
-
return 0;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
74
|
-
* @param {string} dispatchMarker Marker identifying the event target.
|
|
75
|
-
* @param {object} nativeEvent Native browser event.
|
|
76
|
-
* @extends {SyntheticUIEvent}
|
|
77
|
-
*/
|
|
78
|
-
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
79
|
-
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
|
|
83
|
-
|
|
84
|
-
module.exports = SyntheticKeyboardEvent;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule SyntheticMouseEvent
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var SyntheticUIEvent = require('./SyntheticUIEvent');
|
|
15
|
-
var ViewportMetrics = require('./ViewportMetrics');
|
|
16
|
-
|
|
17
|
-
var getEventModifierState = require('./getEventModifierState');
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @interface MouseEvent
|
|
21
|
-
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
22
|
-
*/
|
|
23
|
-
var MouseEventInterface = {
|
|
24
|
-
screenX: null,
|
|
25
|
-
screenY: null,
|
|
26
|
-
clientX: null,
|
|
27
|
-
clientY: null,
|
|
28
|
-
ctrlKey: null,
|
|
29
|
-
shiftKey: null,
|
|
30
|
-
altKey: null,
|
|
31
|
-
metaKey: null,
|
|
32
|
-
getModifierState: getEventModifierState,
|
|
33
|
-
button: function (event) {
|
|
34
|
-
// Webkit, Firefox, IE9+
|
|
35
|
-
// which: 1 2 3
|
|
36
|
-
// button: 0 1 2 (standard)
|
|
37
|
-
var button = event.button;
|
|
38
|
-
if ('which' in event) {
|
|
39
|
-
return button;
|
|
40
|
-
}
|
|
41
|
-
// IE<9
|
|
42
|
-
// which: undefined
|
|
43
|
-
// button: 0 0 0
|
|
44
|
-
// button: 1 4 2 (onmouseup)
|
|
45
|
-
return button === 2 ? 2 : button === 4 ? 1 : 0;
|
|
46
|
-
},
|
|
47
|
-
buttons: null,
|
|
48
|
-
relatedTarget: function (event) {
|
|
49
|
-
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
|
|
50
|
-
},
|
|
51
|
-
// "Proprietary" Interface.
|
|
52
|
-
pageX: function (event) {
|
|
53
|
-
return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
|
|
54
|
-
},
|
|
55
|
-
pageY: function (event) {
|
|
56
|
-
return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
62
|
-
* @param {string} dispatchMarker Marker identifying the event target.
|
|
63
|
-
* @param {object} nativeEvent Native browser event.
|
|
64
|
-
* @extends {SyntheticUIEvent}
|
|
65
|
-
*/
|
|
66
|
-
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
67
|
-
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
|
|
71
|
-
|
|
72
|
-
module.exports = SyntheticMouseEvent;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule SyntheticTouchEvent
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var SyntheticUIEvent = require('./SyntheticUIEvent');
|
|
15
|
-
|
|
16
|
-
var getEventModifierState = require('./getEventModifierState');
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @interface TouchEvent
|
|
20
|
-
* @see http://www.w3.org/TR/touch-events/
|
|
21
|
-
*/
|
|
22
|
-
var TouchEventInterface = {
|
|
23
|
-
touches: null,
|
|
24
|
-
targetTouches: null,
|
|
25
|
-
changedTouches: null,
|
|
26
|
-
altKey: null,
|
|
27
|
-
metaKey: null,
|
|
28
|
-
ctrlKey: null,
|
|
29
|
-
shiftKey: null,
|
|
30
|
-
getModifierState: getEventModifierState
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
35
|
-
* @param {string} dispatchMarker Marker identifying the event target.
|
|
36
|
-
* @param {object} nativeEvent Native browser event.
|
|
37
|
-
* @extends {SyntheticUIEvent}
|
|
38
|
-
*/
|
|
39
|
-
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
40
|
-
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
|
|
44
|
-
|
|
45
|
-
module.exports = SyntheticTouchEvent;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule SyntheticTransitionEvent
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var SyntheticEvent = require('./SyntheticEvent');
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @interface Event
|
|
18
|
-
* @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
|
|
19
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
|
|
20
|
-
*/
|
|
21
|
-
var TransitionEventInterface = {
|
|
22
|
-
propertyName: null,
|
|
23
|
-
elapsedTime: null,
|
|
24
|
-
pseudoElement: null
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
29
|
-
* @param {string} dispatchMarker Marker identifying the event target.
|
|
30
|
-
* @param {object} nativeEvent Native browser event.
|
|
31
|
-
* @extends {SyntheticEvent}
|
|
32
|
-
*/
|
|
33
|
-
function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
34
|
-
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
|
|
38
|
-
|
|
39
|
-
module.exports = SyntheticTransitionEvent;
|
package/lib/SyntheticUIEvent.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule SyntheticUIEvent
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var SyntheticEvent = require('./SyntheticEvent');
|
|
15
|
-
|
|
16
|
-
var getEventTarget = require('./getEventTarget');
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @interface UIEvent
|
|
20
|
-
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
21
|
-
*/
|
|
22
|
-
var UIEventInterface = {
|
|
23
|
-
view: function (event) {
|
|
24
|
-
if (event.view) {
|
|
25
|
-
return event.view;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var target = getEventTarget(event);
|
|
29
|
-
if (target.window === target) {
|
|
30
|
-
// target is a window object
|
|
31
|
-
return target;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var doc = target.ownerDocument;
|
|
35
|
-
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
|
|
36
|
-
if (doc) {
|
|
37
|
-
return doc.defaultView || doc.parentWindow;
|
|
38
|
-
} else {
|
|
39
|
-
return window;
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
detail: function (event) {
|
|
43
|
-
return event.detail || 0;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
49
|
-
* @param {string} dispatchMarker Marker identifying the event target.
|
|
50
|
-
* @param {object} nativeEvent Native browser event.
|
|
51
|
-
* @extends {SyntheticEvent}
|
|
52
|
-
*/
|
|
53
|
-
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
54
|
-
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
|
|
58
|
-
|
|
59
|
-
module.exports = SyntheticUIEvent;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule SyntheticWheelEvent
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var SyntheticMouseEvent = require('./SyntheticMouseEvent');
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @interface WheelEvent
|
|
18
|
-
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
19
|
-
*/
|
|
20
|
-
var WheelEventInterface = {
|
|
21
|
-
deltaX: function (event) {
|
|
22
|
-
return 'deltaX' in event ? event.deltaX :
|
|
23
|
-
// Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
|
|
24
|
-
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
|
25
|
-
},
|
|
26
|
-
deltaY: function (event) {
|
|
27
|
-
return 'deltaY' in event ? event.deltaY :
|
|
28
|
-
// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
|
|
29
|
-
'wheelDeltaY' in event ? -event.wheelDeltaY :
|
|
30
|
-
// Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
|
|
31
|
-
'wheelDelta' in event ? -event.wheelDelta : 0;
|
|
32
|
-
},
|
|
33
|
-
deltaZ: null,
|
|
34
|
-
|
|
35
|
-
// Browsers without "deltaMode" is reporting in raw wheel delta where one
|
|
36
|
-
// notch on the scroll is always +/- 120, roughly equivalent to pixels.
|
|
37
|
-
// A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
|
|
38
|
-
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
|
|
39
|
-
deltaMode: null
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
44
|
-
* @param {string} dispatchMarker Marker identifying the event target.
|
|
45
|
-
* @param {object} nativeEvent Native browser event.
|
|
46
|
-
* @extends {SyntheticMouseEvent}
|
|
47
|
-
*/
|
|
48
|
-
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
49
|
-
return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
|
|
53
|
-
|
|
54
|
-
module.exports = SyntheticWheelEvent;
|
package/lib/TapEventPlugin.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
* @providesModule TapEventPlugin
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var EventConstants = require('./EventConstants');
|
|
15
|
-
var EventPluginUtils = require('./EventPluginUtils');
|
|
16
|
-
var EventPropagators = require('./EventPropagators');
|
|
17
|
-
var SyntheticUIEvent = require('./SyntheticUIEvent');
|
|
18
|
-
var TouchEventUtils = require('fbjs/lib/TouchEventUtils');
|
|
19
|
-
var ViewportMetrics = require('./ViewportMetrics');
|
|
20
|
-
|
|
21
|
-
var keyOf = require('fbjs/lib/keyOf');
|
|
22
|
-
var topLevelTypes = EventConstants.topLevelTypes;
|
|
23
|
-
|
|
24
|
-
var isStartish = EventPluginUtils.isStartish;
|
|
25
|
-
var isEndish = EventPluginUtils.isEndish;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Number of pixels that are tolerated in between a `touchStart` and `touchEnd`
|
|
29
|
-
* in order to still be considered a 'tap' event.
|
|
30
|
-
*/
|
|
31
|
-
var tapMoveThreshold = 10;
|
|
32
|
-
var startCoords = { x: null, y: null };
|
|
33
|
-
|
|
34
|
-
var Axis = {
|
|
35
|
-
x: { page: 'pageX', client: 'clientX', envScroll: 'currentPageScrollLeft' },
|
|
36
|
-
y: { page: 'pageY', client: 'clientY', envScroll: 'currentPageScrollTop' }
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
function getAxisCoordOfEvent(axis, nativeEvent) {
|
|
40
|
-
var singleTouch = TouchEventUtils.extractSingleTouch(nativeEvent);
|
|
41
|
-
if (singleTouch) {
|
|
42
|
-
return singleTouch[axis.page];
|
|
43
|
-
}
|
|
44
|
-
return axis.page in nativeEvent ? nativeEvent[axis.page] : nativeEvent[axis.client] + ViewportMetrics[axis.envScroll];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function getDistance(coords, nativeEvent) {
|
|
48
|
-
var pageX = getAxisCoordOfEvent(Axis.x, nativeEvent);
|
|
49
|
-
var pageY = getAxisCoordOfEvent(Axis.y, nativeEvent);
|
|
50
|
-
return Math.pow(Math.pow(pageX - coords.x, 2) + Math.pow(pageY - coords.y, 2), 0.5);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var touchEvents = [topLevelTypes.topTouchStart, topLevelTypes.topTouchCancel, topLevelTypes.topTouchEnd, topLevelTypes.topTouchMove];
|
|
54
|
-
|
|
55
|
-
var dependencies = [topLevelTypes.topMouseDown, topLevelTypes.topMouseMove, topLevelTypes.topMouseUp].concat(touchEvents);
|
|
56
|
-
|
|
57
|
-
var eventTypes = {
|
|
58
|
-
touchTap: {
|
|
59
|
-
phasedRegistrationNames: {
|
|
60
|
-
bubbled: keyOf({ onTouchTap: null }),
|
|
61
|
-
captured: keyOf({ onTouchTapCapture: null })
|
|
62
|
-
},
|
|
63
|
-
dependencies: dependencies
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var usedTouch = false;
|
|
68
|
-
var usedTouchTime = 0;
|
|
69
|
-
var TOUCH_DELAY = 1000;
|
|
70
|
-
|
|
71
|
-
var TapEventPlugin = {
|
|
72
|
-
|
|
73
|
-
tapMoveThreshold: tapMoveThreshold,
|
|
74
|
-
|
|
75
|
-
eventTypes: eventTypes,
|
|
76
|
-
|
|
77
|
-
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
78
|
-
if (!isStartish(topLevelType) && !isEndish(topLevelType)) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
// on ios, there is a delay after touch event and synthetic
|
|
82
|
-
// mouse events, so that user can perform double tap
|
|
83
|
-
// solution: ignore mouse events following touchevent within small timeframe
|
|
84
|
-
if (touchEvents.indexOf(topLevelType) !== -1) {
|
|
85
|
-
usedTouch = true;
|
|
86
|
-
usedTouchTime = Date.now();
|
|
87
|
-
} else {
|
|
88
|
-
if (usedTouch && Date.now() - usedTouchTime < TOUCH_DELAY) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
var event = null;
|
|
93
|
-
var distance = getDistance(startCoords, nativeEvent);
|
|
94
|
-
if (isEndish(topLevelType) && distance < tapMoveThreshold) {
|
|
95
|
-
event = SyntheticUIEvent.getPooled(eventTypes.touchTap, targetInst, nativeEvent, nativeEventTarget);
|
|
96
|
-
}
|
|
97
|
-
if (isStartish(topLevelType)) {
|
|
98
|
-
startCoords.x = getAxisCoordOfEvent(Axis.x, nativeEvent);
|
|
99
|
-
startCoords.y = getAxisCoordOfEvent(Axis.y, nativeEvent);
|
|
100
|
-
} else if (isEndish(topLevelType)) {
|
|
101
|
-
startCoords.x = 0;
|
|
102
|
-
startCoords.y = 0;
|
|
103
|
-
}
|
|
104
|
-
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
105
|
-
return event;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
module.exports = TapEventPlugin;
|