react 0.14.0-alpha2 → 0.14.0-beta3
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/README.md +5 -2
- package/addons.js +6 -3
- package/dist/JSXTransformer.js +634 -274
- package/dist/react-with-addons.js +5350 -4954
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +4777 -4408
- package/dist/react.min.js +6 -5
- package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +15 -5
- package/lib/BeforeInputEventPlugin.js +13 -13
- package/lib/CSSProperty.js +3 -0
- package/lib/CSSPropertyOperations.js +13 -13
- package/lib/CallbackQueue.js +4 -4
- package/lib/ChangeEventPlugin.js +16 -14
- package/lib/DOMChildrenOperations.js +10 -6
- package/lib/DOMProperty.js +82 -117
- package/lib/DOMPropertyOperations.js +78 -33
- package/lib/Danger.js +14 -14
- package/lib/DefaultEventPluginOrder.js +2 -2
- package/lib/EnterLeaveEventPlugin.js +8 -8
- package/lib/EventConstants.js +23 -1
- package/lib/EventPluginHub.js +13 -13
- package/lib/EventPluginRegistry.js +8 -8
- package/lib/EventPluginUtils.js +17 -17
- package/lib/EventPropagators.js +7 -7
- package/lib/FallbackCompositionState.js +3 -3
- package/lib/HTMLDOMPropertyConfig.js +13 -3
- package/lib/LinkedStateMixin.js +2 -2
- package/lib/LinkedValueUtils.js +50 -38
- package/lib/MetaMatchers.js +118 -0
- package/lib/OrderedMap.js +453 -0
- package/lib/PooledClass.js +14 -2
- package/lib/React.js +6 -6
- package/lib/ReactBrowserComponentMixin.js +4 -4
- package/lib/ReactBrowserEventEmitter.js +30 -7
- package/lib/ReactCSSTransitionGroup.js +16 -5
- package/lib/ReactCSSTransitionGroupChild.js +20 -11
- package/lib/ReactChildReconciler.js +25 -18
- package/lib/ReactChildren.js +9 -9
- package/lib/ReactClass.js +65 -83
- package/lib/ReactComponent.js +22 -17
- package/lib/ReactComponentBrowserEnvironment.js +2 -2
- package/lib/ReactComponentEnvironment.js +2 -2
- package/lib/ReactComponentWithPureRenderMixin.js +3 -3
- package/lib/ReactCompositeComponent.js +80 -111
- package/lib/ReactDOM.js +72 -158
- package/lib/ReactDOMButton.js +15 -26
- package/lib/ReactDOMComponent.js +378 -56
- package/lib/ReactDOMFactories.js +177 -0
- package/lib/ReactDOMIDOperations.js +23 -23
- package/lib/ReactDOMInput.js +83 -99
- package/lib/ReactDOMOption.js +25 -45
- package/lib/ReactDOMSelect.js +88 -98
- package/lib/ReactDOMSelection.js +3 -3
- package/lib/ReactDOMServer.js +2 -2
- package/lib/ReactDOMTextComponent.js +11 -11
- package/lib/ReactDOMTextarea.js +48 -61
- package/lib/ReactDefaultBatchingStrategy.js +4 -4
- package/lib/ReactDefaultInjection.js +24 -71
- package/lib/ReactDefaultPerf.js +7 -7
- package/lib/ReactDefaultPerfAnalysis.js +6 -9
- package/lib/ReactElement.js +22 -83
- package/lib/ReactElementValidator.js +48 -117
- package/lib/ReactEmptyComponent.js +4 -4
- package/lib/ReactErrorUtils.js +1 -1
- package/lib/ReactEventEmitterMixin.js +3 -4
- package/lib/ReactEventListener.js +57 -12
- package/lib/ReactFragment.js +22 -17
- package/lib/ReactInjection.js +11 -11
- package/lib/ReactInputSelection.js +8 -7
- package/lib/ReactInstanceHandles.js +12 -12
- package/lib/ReactIsomorphic.js +11 -11
- package/lib/ReactLink.js +1 -1
- package/lib/ReactMarkupChecksum.js +6 -2
- package/lib/ReactMount.js +88 -88
- package/lib/ReactMultiChild.js +83 -22
- package/lib/ReactMultiChildUpdateTypes.js +2 -1
- package/lib/ReactNativeComponent.js +3 -8
- package/lib/ReactNoopUpdateQueue.js +118 -0
- package/lib/ReactOwner.js +3 -3
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +3 -3
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +49 -11
- package/lib/ReactReconcileTransaction.js +8 -8
- package/lib/ReactReconciler.js +18 -20
- package/lib/ReactRef.js +1 -1
- package/lib/ReactServerBatchingStrategy.js +23 -0
- package/lib/ReactServerRendering.js +22 -9
- package/lib/ReactServerRenderingTransaction.js +7 -7
- package/lib/ReactTestUtils.js +80 -58
- package/lib/ReactTransitionChildMapping.js +2 -2
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +5 -6
- package/lib/ReactUpdateQueue.js +61 -36
- package/lib/ReactUpdates.js +14 -17
- package/lib/ReactWithAddons.js +14 -16
- package/lib/ResponderEventPlugin.js +514 -0
- package/lib/ResponderSyntheticEvent.js +40 -0
- package/lib/ResponderTouchHistoryStore.js +180 -0
- package/lib/SVGDOMPropertyConfig.js +1 -1
- package/lib/SelectEventPlugin.js +14 -15
- package/lib/SimpleEventPlugin.js +205 -29
- package/lib/SyntheticClipboardEvent.js +3 -3
- package/lib/SyntheticCompositionEvent.js +3 -3
- package/lib/SyntheticDragEvent.js +3 -3
- package/lib/SyntheticEvent.js +9 -8
- package/lib/SyntheticFocusEvent.js +3 -3
- package/lib/SyntheticInputEvent.js +3 -3
- package/lib/SyntheticKeyboardEvent.js +6 -6
- package/lib/SyntheticMouseEvent.js +5 -5
- package/lib/SyntheticTouchEvent.js +4 -4
- package/lib/SyntheticUIEvent.js +4 -4
- package/lib/SyntheticWheelEvent.js +3 -3
- package/lib/TapEventPlugin.js +119 -0
- package/lib/Transaction.js +16 -10
- package/lib/accumulate.js +44 -0
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +19 -7
- package/lib/cloneWithProps.js +12 -7
- package/lib/createHierarchyRenderer.js +85 -0
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/deprecated.js +47 -0
- package/lib/findDOMNode.js +11 -12
- package/lib/flattenChildren.js +4 -4
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getEventCharCode.js +1 -1
- package/lib/getEventKey.js +1 -1
- package/lib/getEventModifierState.js +0 -1
- package/lib/getTestDocument.js +28 -0
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +24 -20
- package/lib/isEventSupported.js +1 -1
- package/lib/isTextInputElement.js +2 -1
- package/lib/joinClasses.js +1 -1
- package/lib/onlyChild.js +3 -3
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +210 -0
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +2 -2
- package/lib/setTextContent.js +3 -3
- package/lib/shallowCompare.js +1 -1
- package/lib/sliceChildren.js +51 -0
- package/lib/traverseAllChildren.js +15 -14
- package/lib/update.js +13 -13
- package/lib/validateDOMNesting.js +14 -6
- package/lib/webcomponents.js +6379 -0
- package/package.json +4 -6
- package/react.js +53 -1
- package/addons/CSSTransitionGroup.js +0 -1
- package/addons/LinkedStateMixin.js +0 -1
- package/addons/Perf.js +0 -1
- package/addons/PureRenderMixin.js +0 -1
- package/addons/TestUtils.js +0 -1
- package/addons/TransitionGroup.js +0 -1
- package/addons/batchedUpdates.js +0 -1
- package/addons/cloneWithProps.js +0 -1
- package/addons/createFragment.js +0 -1
- package/addons/renderSubtreeIntoContainer.js +0 -1
- package/addons/shallowCompare.js +0 -1
- package/addons/update.js +0 -1
- package/lib/CSSCore.js +0 -97
- package/lib/EventListener.js +0 -84
- package/lib/ExecutionEnvironment.js +0 -38
- package/lib/LocalEventTrapMixin.js +0 -46
- package/lib/ReactContext.js +0 -32
- package/lib/ReactDOMClient.js +0 -85
- package/lib/ReactDOMForm.js +0 -47
- package/lib/ReactDOMIframe.js +0 -43
- package/lib/ReactDOMImg.js +0 -44
- package/lib/ReactLifeCycle.js +0 -35
- package/lib/camelize.js +0 -32
- package/lib/camelizeStyleName.js +0 -40
- package/lib/containsNode.js +0 -55
- package/lib/createArrayFromMixed.js +0 -85
- package/lib/createFullPageComponent.js +0 -51
- package/lib/createNodesFromMarkup.js +0 -84
- package/lib/emptyFunction.js +0 -38
- package/lib/emptyObject.js +0 -20
- package/lib/focusNode.js +0 -26
- package/lib/getActiveElement.js +0 -29
- package/lib/getMarkupWrap.js +0 -115
- package/lib/getUnboundedScrollPosition.js +0 -38
- package/lib/hyphenate.js +0 -33
- package/lib/hyphenateStyleName.js +0 -39
- package/lib/invariant.js +0 -49
- package/lib/isNode.js +0 -23
- package/lib/isTextNode.js +0 -25
- package/lib/keyMirror.js +0 -48
- package/lib/keyOf.js +0 -35
- package/lib/mapObject.js +0 -51
- package/lib/performance.js +0 -23
- package/lib/performanceNow.js +0 -28
- package/lib/shallowEqual.js +0 -48
- package/lib/toArray.js +0 -57
- package/lib/warning.js +0 -61
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-2015, 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 ResponderSyntheticEvent
|
|
10
|
+
* @typechecks static-only
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
var SyntheticEvent = require('./SyntheticEvent');
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `touchHistory` isn't actually on the native event, but putting it in the
|
|
19
|
+
* interface will ensure that it is cleaned up when pooled/destroyed. The
|
|
20
|
+
* `ResponderEventPlugin` will populate it appropriately.
|
|
21
|
+
*/
|
|
22
|
+
var ResponderEventInterface = {
|
|
23
|
+
touchHistory: function (nativeEvent) {
|
|
24
|
+
return null; // Actually doesn't even look at the native event.
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
30
|
+
* @param {string} dispatchMarker Marker identifying the event target.
|
|
31
|
+
* @param {object} nativeEvent Native event.
|
|
32
|
+
* @extends {SyntheticEvent}
|
|
33
|
+
*/
|
|
34
|
+
function ResponderSyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
35
|
+
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
SyntheticEvent.augmentClass(ResponderSyntheticEvent, ResponderEventInterface);
|
|
39
|
+
|
|
40
|
+
module.exports = ResponderSyntheticEvent;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-2015, 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 ResponderTouchHistoryStore
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var EventPluginUtils = require('./EventPluginUtils');
|
|
15
|
+
|
|
16
|
+
var invariant = require('fbjs/lib/invariant');
|
|
17
|
+
|
|
18
|
+
var isMoveish = EventPluginUtils.isMoveish;
|
|
19
|
+
var isStartish = EventPluginUtils.isStartish;
|
|
20
|
+
var isEndish = EventPluginUtils.isEndish;
|
|
21
|
+
|
|
22
|
+
var MAX_TOUCH_BANK = 20;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Touch position/time tracking information by touchID. Typically, we'll only
|
|
26
|
+
* see IDs with a range of 1-20 (they are recycled when touches end and then
|
|
27
|
+
* start again). This data is commonly needed by many different interaction
|
|
28
|
+
* logic modules so precomputing it is very helpful to do once.
|
|
29
|
+
* Each touch object in `touchBank` is of the following form:
|
|
30
|
+
* { touchActive: boolean,
|
|
31
|
+
* startTimeStamp: number,
|
|
32
|
+
* startPageX: number,
|
|
33
|
+
* startPageY: number,
|
|
34
|
+
* currentPageX: number,
|
|
35
|
+
* currentPageY: number,
|
|
36
|
+
* currentTimeStamp: number
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
var touchHistory = {
|
|
40
|
+
touchBank: [],
|
|
41
|
+
numberActiveTouches: 0,
|
|
42
|
+
// If there is only one active touch, we remember its location. This prevents
|
|
43
|
+
// us having to loop through all of the touches all the time in the most
|
|
44
|
+
// common case.
|
|
45
|
+
indexOfSingleActiveTouch: -1,
|
|
46
|
+
mostRecentTimeStamp: 0
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var timestampForTouch = function (touch) {
|
|
50
|
+
// The legacy internal implementation provides "timeStamp", which has been
|
|
51
|
+
// renamed to "timestamp". Let both work for now while we iron it out
|
|
52
|
+
// TODO (evv): rename timeStamp to timestamp in internal code
|
|
53
|
+
return touch.timeStamp || touch.timestamp;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* TODO: Instead of making gestures recompute filtered velocity, we could
|
|
58
|
+
* include a built in velocity computation that can be reused globally.
|
|
59
|
+
* @param {Touch} touch Native touch object.
|
|
60
|
+
*/
|
|
61
|
+
var initializeTouchData = function (touch) {
|
|
62
|
+
return {
|
|
63
|
+
touchActive: true,
|
|
64
|
+
startTimeStamp: timestampForTouch(touch),
|
|
65
|
+
startPageX: touch.pageX,
|
|
66
|
+
startPageY: touch.pageY,
|
|
67
|
+
currentPageX: touch.pageX,
|
|
68
|
+
currentPageY: touch.pageY,
|
|
69
|
+
currentTimeStamp: timestampForTouch(touch),
|
|
70
|
+
previousPageX: touch.pageX,
|
|
71
|
+
previousPageY: touch.pageY,
|
|
72
|
+
previousTimeStamp: timestampForTouch(touch)
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var reinitializeTouchTrack = function (touchTrack, touch) {
|
|
77
|
+
touchTrack.touchActive = true;
|
|
78
|
+
touchTrack.startTimeStamp = timestampForTouch(touch);
|
|
79
|
+
touchTrack.startPageX = touch.pageX;
|
|
80
|
+
touchTrack.startPageY = touch.pageY;
|
|
81
|
+
touchTrack.currentPageX = touch.pageX;
|
|
82
|
+
touchTrack.currentPageY = touch.pageY;
|
|
83
|
+
touchTrack.currentTimeStamp = timestampForTouch(touch);
|
|
84
|
+
touchTrack.previousPageX = touch.pageX;
|
|
85
|
+
touchTrack.previousPageY = touch.pageY;
|
|
86
|
+
touchTrack.previousTimeStamp = timestampForTouch(touch);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var validateTouch = function (touch) {
|
|
90
|
+
var identifier = touch.identifier;
|
|
91
|
+
!(identifier != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch object is missing identifier') : invariant(false) : undefined;
|
|
92
|
+
if (identifier > MAX_TOUCH_BANK) {
|
|
93
|
+
console.warn('Touch identifier ' + identifier + ' is greater than maximum ' + 'supported ' + MAX_TOUCH_BANK + ' which causes performance issues ' + 'backfilling array locations for all of the indices.');
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
var recordStartTouchData = function (touch) {
|
|
98
|
+
var touchBank = touchHistory.touchBank;
|
|
99
|
+
var identifier = touch.identifier;
|
|
100
|
+
var touchTrack = touchBank[identifier];
|
|
101
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
102
|
+
validateTouch(touch);
|
|
103
|
+
}
|
|
104
|
+
if (touchTrack) {
|
|
105
|
+
reinitializeTouchTrack(touchTrack, touch);
|
|
106
|
+
} else {
|
|
107
|
+
touchBank[touch.identifier] = initializeTouchData(touch);
|
|
108
|
+
}
|
|
109
|
+
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var recordMoveTouchData = function (touch) {
|
|
113
|
+
var touchBank = touchHistory.touchBank;
|
|
114
|
+
var touchTrack = touchBank[touch.identifier];
|
|
115
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
116
|
+
validateTouch(touch);
|
|
117
|
+
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) : undefined;
|
|
118
|
+
}
|
|
119
|
+
touchTrack.touchActive = true;
|
|
120
|
+
touchTrack.previousPageX = touchTrack.currentPageX;
|
|
121
|
+
touchTrack.previousPageY = touchTrack.currentPageY;
|
|
122
|
+
touchTrack.previousTimeStamp = touchTrack.currentTimeStamp;
|
|
123
|
+
touchTrack.currentPageX = touch.pageX;
|
|
124
|
+
touchTrack.currentPageY = touch.pageY;
|
|
125
|
+
touchTrack.currentTimeStamp = timestampForTouch(touch);
|
|
126
|
+
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
var recordEndTouchData = function (touch) {
|
|
130
|
+
var touchBank = touchHistory.touchBank;
|
|
131
|
+
var touchTrack = touchBank[touch.identifier];
|
|
132
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
133
|
+
validateTouch(touch);
|
|
134
|
+
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) : undefined;
|
|
135
|
+
}
|
|
136
|
+
touchTrack.previousPageX = touchTrack.currentPageX;
|
|
137
|
+
touchTrack.previousPageY = touchTrack.currentPageY;
|
|
138
|
+
touchTrack.previousTimeStamp = touchTrack.currentTimeStamp;
|
|
139
|
+
touchTrack.currentPageX = touch.pageX;
|
|
140
|
+
touchTrack.currentPageY = touch.pageY;
|
|
141
|
+
touchTrack.currentTimeStamp = timestampForTouch(touch);
|
|
142
|
+
touchTrack.touchActive = false;
|
|
143
|
+
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
var ResponderTouchHistoryStore = {
|
|
147
|
+
recordTouchTrack: function (topLevelType, nativeEvent) {
|
|
148
|
+
var touchBank = touchHistory.touchBank;
|
|
149
|
+
if (isMoveish(topLevelType)) {
|
|
150
|
+
nativeEvent.changedTouches.forEach(recordMoveTouchData);
|
|
151
|
+
} else if (isStartish(topLevelType)) {
|
|
152
|
+
nativeEvent.changedTouches.forEach(recordStartTouchData);
|
|
153
|
+
touchHistory.numberActiveTouches = nativeEvent.touches.length;
|
|
154
|
+
if (touchHistory.numberActiveTouches === 1) {
|
|
155
|
+
touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier;
|
|
156
|
+
}
|
|
157
|
+
} else if (isEndish(topLevelType)) {
|
|
158
|
+
nativeEvent.changedTouches.forEach(recordEndTouchData);
|
|
159
|
+
touchHistory.numberActiveTouches = nativeEvent.touches.length;
|
|
160
|
+
if (touchHistory.numberActiveTouches === 1) {
|
|
161
|
+
for (var i = 0; i < touchBank.length; i++) {
|
|
162
|
+
var touchTrackToCheck = touchBank[i];
|
|
163
|
+
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {
|
|
164
|
+
touchHistory.indexOfSingleActiveTouch = i;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
169
|
+
var activeTouchData = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
170
|
+
var foundActive = activeTouchData != null && !!activeTouchData.touchActive;
|
|
171
|
+
!foundActive ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot find single active touch') : invariant(false) : undefined;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
touchHistory: touchHistory
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
module.exports = ResponderTouchHistoryStore;
|
package/lib/SelectEventPlugin.js
CHANGED
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var EventConstants = require(
|
|
15
|
-
var EventPropagators = require(
|
|
16
|
-
var ReactInputSelection = require(
|
|
17
|
-
var SyntheticEvent = require(
|
|
14
|
+
var EventConstants = require('./EventConstants');
|
|
15
|
+
var EventPropagators = require('./EventPropagators');
|
|
16
|
+
var ReactInputSelection = require('./ReactInputSelection');
|
|
17
|
+
var SyntheticEvent = require('./SyntheticEvent');
|
|
18
18
|
|
|
19
|
-
var getActiveElement = require(
|
|
20
|
-
var isTextInputElement = require(
|
|
21
|
-
var keyOf = require(
|
|
22
|
-
var shallowEqual = require(
|
|
19
|
+
var getActiveElement = require('fbjs/lib/getActiveElement');
|
|
20
|
+
var isTextInputElement = require('./isTextInputElement');
|
|
21
|
+
var keyOf = require('fbjs/lib/keyOf');
|
|
22
|
+
var shallowEqual = require('fbjs/lib/shallowEqual');
|
|
23
23
|
|
|
24
24
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
25
25
|
|
|
@@ -50,7 +50,7 @@ var ON_SELECT_KEY = keyOf({ onSelect: null });
|
|
|
50
50
|
* two identical selections on the same node will return identical objects.
|
|
51
51
|
*
|
|
52
52
|
* @param {DOMElement} node
|
|
53
|
-
* @
|
|
53
|
+
* @return {object}
|
|
54
54
|
*/
|
|
55
55
|
function getSelection(node) {
|
|
56
56
|
if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
|
|
@@ -83,7 +83,7 @@ function getSelection(node) {
|
|
|
83
83
|
* @param {object} nativeEvent
|
|
84
84
|
* @return {?SyntheticEvent}
|
|
85
85
|
*/
|
|
86
|
-
function constructSelectEvent(nativeEvent) {
|
|
86
|
+
function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
|
87
87
|
// Ensure we have the right element, and that the user is not dragging a
|
|
88
88
|
// selection (this matches native `select` event behavior). In HTML5, select
|
|
89
89
|
// fires only on input and textarea thus if there's no focused element we
|
|
@@ -97,7 +97,7 @@ function constructSelectEvent(nativeEvent) {
|
|
|
97
97
|
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
|
98
98
|
lastSelection = currentSelection;
|
|
99
99
|
|
|
100
|
-
var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent);
|
|
100
|
+
var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget);
|
|
101
101
|
|
|
102
102
|
syntheticEvent.type = 'select';
|
|
103
103
|
syntheticEvent.target = activeElement;
|
|
@@ -136,8 +136,7 @@ var SelectEventPlugin = {
|
|
|
136
136
|
* @return {*} An accumulation of synthetic events.
|
|
137
137
|
* @see {EventPluginHub.extractEvents}
|
|
138
138
|
*/
|
|
139
|
-
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) {
|
|
140
|
-
|
|
139
|
+
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
141
140
|
if (!hasListener) {
|
|
142
141
|
return null;
|
|
143
142
|
}
|
|
@@ -165,7 +164,7 @@ var SelectEventPlugin = {
|
|
|
165
164
|
case topLevelTypes.topContextMenu:
|
|
166
165
|
case topLevelTypes.topMouseUp:
|
|
167
166
|
mouseDown = false;
|
|
168
|
-
return constructSelectEvent(nativeEvent);
|
|
167
|
+
return constructSelectEvent(nativeEvent, nativeEventTarget);
|
|
169
168
|
|
|
170
169
|
// Chrome and IE fire non-standard event when selection is changed (and
|
|
171
170
|
// sometimes when it hasn't).
|
|
@@ -176,7 +175,7 @@ var SelectEventPlugin = {
|
|
|
176
175
|
case topLevelTypes.topSelectionChange:
|
|
177
176
|
case topLevelTypes.topKeyDown:
|
|
178
177
|
case topLevelTypes.topKeyUp:
|
|
179
|
-
return constructSelectEvent(nativeEvent);
|
|
178
|
+
return constructSelectEvent(nativeEvent, nativeEventTarget);
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
return null;
|
package/lib/SimpleEventPlugin.js
CHANGED
|
@@ -11,36 +11,54 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var EventConstants = require(
|
|
15
|
-
var EventListener = require(
|
|
16
|
-
var EventPluginUtils = require(
|
|
17
|
-
var EventPropagators = require(
|
|
18
|
-
var ReactMount = require(
|
|
19
|
-
var SyntheticClipboardEvent = require(
|
|
20
|
-
var SyntheticEvent = require(
|
|
21
|
-
var SyntheticFocusEvent = require(
|
|
22
|
-
var SyntheticKeyboardEvent = require(
|
|
23
|
-
var SyntheticMouseEvent = require(
|
|
24
|
-
var SyntheticDragEvent = require(
|
|
25
|
-
var SyntheticTouchEvent = require(
|
|
26
|
-
var SyntheticUIEvent = require(
|
|
27
|
-
var SyntheticWheelEvent = require(
|
|
14
|
+
var EventConstants = require('./EventConstants');
|
|
15
|
+
var EventListener = require('fbjs/lib/EventListener');
|
|
16
|
+
var EventPluginUtils = require('./EventPluginUtils');
|
|
17
|
+
var EventPropagators = require('./EventPropagators');
|
|
18
|
+
var ReactMount = require('./ReactMount');
|
|
19
|
+
var SyntheticClipboardEvent = require('./SyntheticClipboardEvent');
|
|
20
|
+
var SyntheticEvent = require('./SyntheticEvent');
|
|
21
|
+
var SyntheticFocusEvent = require('./SyntheticFocusEvent');
|
|
22
|
+
var SyntheticKeyboardEvent = require('./SyntheticKeyboardEvent');
|
|
23
|
+
var SyntheticMouseEvent = require('./SyntheticMouseEvent');
|
|
24
|
+
var SyntheticDragEvent = require('./SyntheticDragEvent');
|
|
25
|
+
var SyntheticTouchEvent = require('./SyntheticTouchEvent');
|
|
26
|
+
var SyntheticUIEvent = require('./SyntheticUIEvent');
|
|
27
|
+
var SyntheticWheelEvent = require('./SyntheticWheelEvent');
|
|
28
28
|
|
|
29
|
-
var emptyFunction = require(
|
|
30
|
-
var getEventCharCode = require(
|
|
31
|
-
var invariant = require(
|
|
32
|
-
var keyOf = require(
|
|
33
|
-
var warning = require(
|
|
29
|
+
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
30
|
+
var getEventCharCode = require('./getEventCharCode');
|
|
31
|
+
var invariant = require('fbjs/lib/invariant');
|
|
32
|
+
var keyOf = require('fbjs/lib/keyOf');
|
|
33
|
+
var warning = require('fbjs/lib/warning');
|
|
34
34
|
|
|
35
35
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
36
36
|
|
|
37
37
|
var eventTypes = {
|
|
38
|
+
abort: {
|
|
39
|
+
phasedRegistrationNames: {
|
|
40
|
+
bubbled: keyOf({ onAbort: true }),
|
|
41
|
+
captured: keyOf({ onAbortCapture: true })
|
|
42
|
+
}
|
|
43
|
+
},
|
|
38
44
|
blur: {
|
|
39
45
|
phasedRegistrationNames: {
|
|
40
46
|
bubbled: keyOf({ onBlur: true }),
|
|
41
47
|
captured: keyOf({ onBlurCapture: true })
|
|
42
48
|
}
|
|
43
49
|
},
|
|
50
|
+
canPlay: {
|
|
51
|
+
phasedRegistrationNames: {
|
|
52
|
+
bubbled: keyOf({ onCanPlay: true }),
|
|
53
|
+
captured: keyOf({ onCanPlayCapture: true })
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
canPlayThrough: {
|
|
57
|
+
phasedRegistrationNames: {
|
|
58
|
+
bubbled: keyOf({ onCanPlayThrough: true }),
|
|
59
|
+
captured: keyOf({ onCanPlayThroughCapture: true })
|
|
60
|
+
}
|
|
61
|
+
},
|
|
44
62
|
click: {
|
|
45
63
|
phasedRegistrationNames: {
|
|
46
64
|
bubbled: keyOf({ onClick: true }),
|
|
@@ -119,6 +137,36 @@ var eventTypes = {
|
|
|
119
137
|
captured: keyOf({ onDropCapture: true })
|
|
120
138
|
}
|
|
121
139
|
},
|
|
140
|
+
durationChange: {
|
|
141
|
+
phasedRegistrationNames: {
|
|
142
|
+
bubbled: keyOf({ onDurationChange: true }),
|
|
143
|
+
captured: keyOf({ onDurationChangeCapture: true })
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
emptied: {
|
|
147
|
+
phasedRegistrationNames: {
|
|
148
|
+
bubbled: keyOf({ onEmptied: true }),
|
|
149
|
+
captured: keyOf({ onEmptiedCapture: true })
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
encrypted: {
|
|
153
|
+
phasedRegistrationNames: {
|
|
154
|
+
bubbled: keyOf({ onEncrypted: true }),
|
|
155
|
+
captured: keyOf({ onEncryptedCapture: true })
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
ended: {
|
|
159
|
+
phasedRegistrationNames: {
|
|
160
|
+
bubbled: keyOf({ onEnded: true }),
|
|
161
|
+
captured: keyOf({ onEndedCapture: true })
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
error: {
|
|
165
|
+
phasedRegistrationNames: {
|
|
166
|
+
bubbled: keyOf({ onError: true }),
|
|
167
|
+
captured: keyOf({ onErrorCapture: true })
|
|
168
|
+
}
|
|
169
|
+
},
|
|
122
170
|
focus: {
|
|
123
171
|
phasedRegistrationNames: {
|
|
124
172
|
bubbled: keyOf({ onFocus: true }),
|
|
@@ -155,10 +203,22 @@ var eventTypes = {
|
|
|
155
203
|
captured: keyOf({ onLoadCapture: true })
|
|
156
204
|
}
|
|
157
205
|
},
|
|
158
|
-
|
|
206
|
+
loadedData: {
|
|
159
207
|
phasedRegistrationNames: {
|
|
160
|
-
bubbled: keyOf({
|
|
161
|
-
captured: keyOf({
|
|
208
|
+
bubbled: keyOf({ onLoadedData: true }),
|
|
209
|
+
captured: keyOf({ onLoadedDataCapture: true })
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
loadedMetadata: {
|
|
213
|
+
phasedRegistrationNames: {
|
|
214
|
+
bubbled: keyOf({ onLoadedMetadata: true }),
|
|
215
|
+
captured: keyOf({ onLoadedMetadataCapture: true })
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
loadStart: {
|
|
219
|
+
phasedRegistrationNames: {
|
|
220
|
+
bubbled: keyOf({ onLoadStart: true }),
|
|
221
|
+
captured: keyOf({ onLoadStartCapture: true })
|
|
162
222
|
}
|
|
163
223
|
},
|
|
164
224
|
// Note: We do not allow listening to mouseOver events. Instead, use the
|
|
@@ -199,6 +259,36 @@ var eventTypes = {
|
|
|
199
259
|
captured: keyOf({ onPasteCapture: true })
|
|
200
260
|
}
|
|
201
261
|
},
|
|
262
|
+
pause: {
|
|
263
|
+
phasedRegistrationNames: {
|
|
264
|
+
bubbled: keyOf({ onPause: true }),
|
|
265
|
+
captured: keyOf({ onPauseCapture: true })
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
play: {
|
|
269
|
+
phasedRegistrationNames: {
|
|
270
|
+
bubbled: keyOf({ onPlay: true }),
|
|
271
|
+
captured: keyOf({ onPlayCapture: true })
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
playing: {
|
|
275
|
+
phasedRegistrationNames: {
|
|
276
|
+
bubbled: keyOf({ onPlaying: true }),
|
|
277
|
+
captured: keyOf({ onPlayingCapture: true })
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
progress: {
|
|
281
|
+
phasedRegistrationNames: {
|
|
282
|
+
bubbled: keyOf({ onProgress: true }),
|
|
283
|
+
captured: keyOf({ onProgressCapture: true })
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
rateChange: {
|
|
287
|
+
phasedRegistrationNames: {
|
|
288
|
+
bubbled: keyOf({ onRateChange: true }),
|
|
289
|
+
captured: keyOf({ onRateChangeCapture: true })
|
|
290
|
+
}
|
|
291
|
+
},
|
|
202
292
|
reset: {
|
|
203
293
|
phasedRegistrationNames: {
|
|
204
294
|
bubbled: keyOf({ onReset: true }),
|
|
@@ -211,12 +301,42 @@ var eventTypes = {
|
|
|
211
301
|
captured: keyOf({ onScrollCapture: true })
|
|
212
302
|
}
|
|
213
303
|
},
|
|
304
|
+
seeked: {
|
|
305
|
+
phasedRegistrationNames: {
|
|
306
|
+
bubbled: keyOf({ onSeeked: true }),
|
|
307
|
+
captured: keyOf({ onSeekedCapture: true })
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
seeking: {
|
|
311
|
+
phasedRegistrationNames: {
|
|
312
|
+
bubbled: keyOf({ onSeeking: true }),
|
|
313
|
+
captured: keyOf({ onSeekingCapture: true })
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
stalled: {
|
|
317
|
+
phasedRegistrationNames: {
|
|
318
|
+
bubbled: keyOf({ onStalled: true }),
|
|
319
|
+
captured: keyOf({ onStalledCapture: true })
|
|
320
|
+
}
|
|
321
|
+
},
|
|
214
322
|
submit: {
|
|
215
323
|
phasedRegistrationNames: {
|
|
216
324
|
bubbled: keyOf({ onSubmit: true }),
|
|
217
325
|
captured: keyOf({ onSubmitCapture: true })
|
|
218
326
|
}
|
|
219
327
|
},
|
|
328
|
+
suspend: {
|
|
329
|
+
phasedRegistrationNames: {
|
|
330
|
+
bubbled: keyOf({ onSuspend: true }),
|
|
331
|
+
captured: keyOf({ onSuspendCapture: true })
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
timeUpdate: {
|
|
335
|
+
phasedRegistrationNames: {
|
|
336
|
+
bubbled: keyOf({ onTimeUpdate: true }),
|
|
337
|
+
captured: keyOf({ onTimeUpdateCapture: true })
|
|
338
|
+
}
|
|
339
|
+
},
|
|
220
340
|
touchCancel: {
|
|
221
341
|
phasedRegistrationNames: {
|
|
222
342
|
bubbled: keyOf({ onTouchCancel: true }),
|
|
@@ -241,6 +361,18 @@ var eventTypes = {
|
|
|
241
361
|
captured: keyOf({ onTouchStartCapture: true })
|
|
242
362
|
}
|
|
243
363
|
},
|
|
364
|
+
volumeChange: {
|
|
365
|
+
phasedRegistrationNames: {
|
|
366
|
+
bubbled: keyOf({ onVolumeChange: true }),
|
|
367
|
+
captured: keyOf({ onVolumeChangeCapture: true })
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
waiting: {
|
|
371
|
+
phasedRegistrationNames: {
|
|
372
|
+
bubbled: keyOf({ onWaiting: true }),
|
|
373
|
+
captured: keyOf({ onWaitingCapture: true })
|
|
374
|
+
}
|
|
375
|
+
},
|
|
244
376
|
wheel: {
|
|
245
377
|
phasedRegistrationNames: {
|
|
246
378
|
bubbled: keyOf({ onWheel: true }),
|
|
@@ -250,7 +382,10 @@ var eventTypes = {
|
|
|
250
382
|
};
|
|
251
383
|
|
|
252
384
|
var topLevelEventsToDispatchConfig = {
|
|
385
|
+
topAbort: eventTypes.abort,
|
|
253
386
|
topBlur: eventTypes.blur,
|
|
387
|
+
topCanPlay: eventTypes.canPlay,
|
|
388
|
+
topCanPlayThrough: eventTypes.canPlayThrough,
|
|
254
389
|
topClick: eventTypes.click,
|
|
255
390
|
topContextMenu: eventTypes.contextMenu,
|
|
256
391
|
topCopy: eventTypes.copy,
|
|
@@ -264,6 +399,10 @@ var topLevelEventsToDispatchConfig = {
|
|
|
264
399
|
topDragOver: eventTypes.dragOver,
|
|
265
400
|
topDragStart: eventTypes.dragStart,
|
|
266
401
|
topDrop: eventTypes.drop,
|
|
402
|
+
topDurationChange: eventTypes.durationChange,
|
|
403
|
+
topEmptied: eventTypes.emptied,
|
|
404
|
+
topEncrypted: eventTypes.encrypted,
|
|
405
|
+
topEnded: eventTypes.ended,
|
|
267
406
|
topError: eventTypes.error,
|
|
268
407
|
topFocus: eventTypes.focus,
|
|
269
408
|
topInput: eventTypes.input,
|
|
@@ -271,19 +410,34 @@ var topLevelEventsToDispatchConfig = {
|
|
|
271
410
|
topKeyPress: eventTypes.keyPress,
|
|
272
411
|
topKeyUp: eventTypes.keyUp,
|
|
273
412
|
topLoad: eventTypes.load,
|
|
413
|
+
topLoadedData: eventTypes.loadedData,
|
|
414
|
+
topLoadedMetadata: eventTypes.loadedMetadata,
|
|
415
|
+
topLoadStart: eventTypes.loadStart,
|
|
274
416
|
topMouseDown: eventTypes.mouseDown,
|
|
275
417
|
topMouseMove: eventTypes.mouseMove,
|
|
276
418
|
topMouseOut: eventTypes.mouseOut,
|
|
277
419
|
topMouseOver: eventTypes.mouseOver,
|
|
278
420
|
topMouseUp: eventTypes.mouseUp,
|
|
421
|
+
topPause: eventTypes.pause,
|
|
279
422
|
topPaste: eventTypes.paste,
|
|
423
|
+
topPlay: eventTypes.play,
|
|
424
|
+
topPlaying: eventTypes.playing,
|
|
425
|
+
topProgress: eventTypes.progress,
|
|
426
|
+
topRateChange: eventTypes.rateChange,
|
|
280
427
|
topReset: eventTypes.reset,
|
|
428
|
+
topSeeked: eventTypes.seeked,
|
|
429
|
+
topSeeking: eventTypes.seeking,
|
|
281
430
|
topScroll: eventTypes.scroll,
|
|
431
|
+
topStalled: eventTypes.stalled,
|
|
282
432
|
topSubmit: eventTypes.submit,
|
|
433
|
+
topSuspend: eventTypes.suspend,
|
|
434
|
+
topTimeUpdate: eventTypes.timeUpdate,
|
|
283
435
|
topTouchCancel: eventTypes.touchCancel,
|
|
284
436
|
topTouchEnd: eventTypes.touchEnd,
|
|
285
437
|
topTouchMove: eventTypes.touchMove,
|
|
286
438
|
topTouchStart: eventTypes.touchStart,
|
|
439
|
+
topVolumeChange: eventTypes.volumeChange,
|
|
440
|
+
topWaiting: eventTypes.waiting,
|
|
287
441
|
topWheel: eventTypes.wheel
|
|
288
442
|
};
|
|
289
443
|
|
|
@@ -302,14 +456,14 @@ var SimpleEventPlugin = {
|
|
|
302
456
|
* Same as the default implementation, except cancels the event when return
|
|
303
457
|
* value is false. This behavior will be disabled in a future release.
|
|
304
458
|
*
|
|
305
|
-
* @param {object} Event to be dispatched.
|
|
306
|
-
* @param {function} Application-level callback.
|
|
459
|
+
* @param {object} event Event to be dispatched.
|
|
460
|
+
* @param {function} listener Application-level callback.
|
|
307
461
|
* @param {string} domID DOM ID to pass to the callback.
|
|
308
462
|
*/
|
|
309
463
|
executeDispatch: function (event, listener, domID) {
|
|
310
464
|
var returnValue = EventPluginUtils.executeDispatch(event, listener, domID);
|
|
311
465
|
|
|
312
|
-
|
|
466
|
+
process.env.NODE_ENV !== 'production' ? warning(typeof returnValue !== 'boolean', 'Returning `false` from an event handler is deprecated and will be ' + 'ignored in a future release. Instead, manually call ' + 'e.stopPropagation() or e.preventDefault(), as appropriate.') : undefined;
|
|
313
467
|
|
|
314
468
|
if (returnValue === false) {
|
|
315
469
|
event.stopPropagation();
|
|
@@ -325,18 +479,40 @@ var SimpleEventPlugin = {
|
|
|
325
479
|
* @return {*} An accumulation of synthetic events.
|
|
326
480
|
* @see {EventPluginHub.extractEvents}
|
|
327
481
|
*/
|
|
328
|
-
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) {
|
|
482
|
+
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
329
483
|
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
|
|
330
484
|
if (!dispatchConfig) {
|
|
331
485
|
return null;
|
|
332
486
|
}
|
|
333
487
|
var EventConstructor;
|
|
334
488
|
switch (topLevelType) {
|
|
489
|
+
case topLevelTypes.topAbort:
|
|
490
|
+
case topLevelTypes.topCanPlay:
|
|
491
|
+
case topLevelTypes.topCanPlayThrough:
|
|
492
|
+
case topLevelTypes.topDurationChange:
|
|
493
|
+
case topLevelTypes.topEmptied:
|
|
494
|
+
case topLevelTypes.topEncrypted:
|
|
495
|
+
case topLevelTypes.topEnded:
|
|
496
|
+
case topLevelTypes.topError:
|
|
335
497
|
case topLevelTypes.topInput:
|
|
336
498
|
case topLevelTypes.topLoad:
|
|
337
|
-
case topLevelTypes.
|
|
499
|
+
case topLevelTypes.topLoadedData:
|
|
500
|
+
case topLevelTypes.topLoadedMetadata:
|
|
501
|
+
case topLevelTypes.topLoadStart:
|
|
502
|
+
case topLevelTypes.topPause:
|
|
503
|
+
case topLevelTypes.topPlay:
|
|
504
|
+
case topLevelTypes.topPlaying:
|
|
505
|
+
case topLevelTypes.topProgress:
|
|
506
|
+
case topLevelTypes.topRateChange:
|
|
338
507
|
case topLevelTypes.topReset:
|
|
508
|
+
case topLevelTypes.topSeeked:
|
|
509
|
+
case topLevelTypes.topSeeking:
|
|
510
|
+
case topLevelTypes.topStalled:
|
|
339
511
|
case topLevelTypes.topSubmit:
|
|
512
|
+
case topLevelTypes.topSuspend:
|
|
513
|
+
case topLevelTypes.topTimeUpdate:
|
|
514
|
+
case topLevelTypes.topVolumeChange:
|
|
515
|
+
case topLevelTypes.topWaiting:
|
|
340
516
|
// HTML Events
|
|
341
517
|
// @see http://www.w3.org/TR/html5/index.html#events-0
|
|
342
518
|
EventConstructor = SyntheticEvent;
|
|
@@ -401,8 +577,8 @@ var SimpleEventPlugin = {
|
|
|
401
577
|
EventConstructor = SyntheticClipboardEvent;
|
|
402
578
|
break;
|
|
403
579
|
}
|
|
404
|
-
|
|
405
|
-
var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent);
|
|
580
|
+
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined;
|
|
581
|
+
var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget);
|
|
406
582
|
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
407
583
|
return event;
|
|
408
584
|
},
|