react 0.14.8 → 15.0.0-rc.1
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/LICENSE +1 -1
- package/addons.js +2 -0
- package/dist/react-with-addons.js +4203 -4148
- package/dist/react-with-addons.min.js +7 -7
- package/dist/react.js +4159 -3850
- package/dist/react.min.js +7 -7
- package/lib/AutoFocusUtils.js +3 -15
- package/lib/BeforeInputEventPlugin.js +8 -25
- package/lib/CSSProperty.js +4 -1
- package/lib/CSSPropertyOperations.js +24 -10
- package/lib/CallbackQueue.js +13 -2
- package/lib/ChangeEventPlugin.js +58 -54
- package/lib/DOMChildrenOperations.js +93 -60
- package/lib/DOMLazyTree.js +96 -0
- package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
- package/lib/DOMProperty.js +18 -39
- package/lib/DOMPropertyOperations.js +87 -53
- package/lib/Danger.js +13 -14
- package/lib/DefaultEventPluginOrder.js +1 -1
- package/lib/EnterLeaveEventPlugin.js +24 -43
- package/lib/EventConstants.js +6 -1
- package/lib/EventPluginHub.js +22 -66
- package/lib/EventPluginRegistry.js +30 -9
- package/lib/EventPluginUtils.js +61 -36
- package/lib/EventPropagators.js +19 -17
- package/lib/FallbackCompositionState.js +1 -2
- package/lib/HTMLDOMPropertyConfig.js +69 -90
- package/lib/LinkedStateMixin.js +1 -2
- package/lib/LinkedValueUtils.js +5 -6
- package/lib/MetaMatchers.js +2 -2
- package/lib/Object.assign.js +1 -1
- package/lib/OrderedMap.js +14 -14
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +1 -13
- package/lib/ReactBrowserEventEmitter.js +16 -24
- package/lib/ReactCSSTransitionGroup.js +1 -2
- package/lib/ReactCSSTransitionGroupChild.js +1 -6
- package/lib/ReactChildReconciler.js +15 -13
- package/lib/ReactChildren.js +5 -4
- package/lib/ReactClass.js +37 -86
- package/lib/ReactComponent.js +7 -8
- package/lib/ReactComponentBrowserEnvironment.js +9 -6
- package/lib/ReactComponentEnvironment.js +4 -4
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +160 -69
- package/lib/ReactCurrentOwner.js +2 -1
- package/lib/ReactDOM.js +27 -15
- package/lib/ReactDOMButton.js +2 -2
- package/lib/ReactDOMComponent.js +188 -244
- package/lib/ReactDOMComponentFlags.js +18 -0
- package/lib/ReactDOMComponentTree.js +186 -0
- package/lib/ReactDOMContainerInfo.js +32 -0
- package/lib/ReactDOMDebugTool.js +69 -0
- package/lib/ReactDOMEmptyComponent.js +60 -0
- package/lib/ReactDOMFactories.js +1 -2
- package/lib/ReactDOMFeatureFlags.js +2 -2
- package/lib/ReactDOMIDOperations.js +5 -60
- package/lib/ReactDOMInput.js +71 -22
- package/lib/ReactDOMInstrumentation.js +16 -0
- package/lib/ReactDOMOption.js +11 -10
- package/lib/ReactDOMSVGDeprecatedAttributeDevtool.js +61 -0
- package/lib/ReactDOMSelect.js +40 -17
- package/lib/ReactDOMSelection.js +4 -4
- package/lib/ReactDOMServer.js +1 -1
- package/lib/ReactDOMTextComponent.js +84 -43
- package/lib/ReactDOMTextarea.js +36 -9
- package/lib/ReactDOMTreeTraversal.js +134 -0
- package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
- package/lib/ReactDebugTool.js +72 -0
- package/lib/ReactDefaultBatchingStrategy.js +1 -1
- package/lib/ReactDefaultInjection.js +11 -15
- package/lib/ReactDefaultPerf.js +59 -19
- package/lib/ReactDefaultPerfAnalysis.js +17 -9
- package/lib/ReactElement.js +60 -21
- package/lib/ReactElementValidator.js +8 -8
- package/lib/ReactEmptyComponent.js +8 -33
- package/lib/ReactErrorUtils.js +1 -2
- package/lib/ReactEventEmitterMixin.js +3 -8
- package/lib/ReactEventListener.js +20 -75
- package/lib/ReactFeatureFlags.js +21 -0
- package/lib/ReactFragment.js +6 -6
- package/lib/ReactInjection.js +3 -3
- package/lib/ReactInputSelection.js +4 -4
- package/lib/ReactInstanceHandles.js +10 -12
- package/lib/ReactInstanceMap.js +2 -1
- package/lib/ReactInstrumentation.js +16 -0
- package/lib/ReactInvalidSetStateWarningDevTool.js +36 -0
- package/lib/ReactIsomorphic.js +1 -1
- package/lib/ReactLink.js +2 -3
- package/lib/ReactMarkupChecksum.js +1 -1
- package/lib/ReactMount.js +87 -460
- package/lib/ReactMultiChild.js +106 -200
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +3 -3
- package/lib/ReactNodeTypes.js +37 -0
- package/lib/ReactNoopUpdateQueue.js +2 -25
- package/lib/ReactOwner.js +3 -3
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +1 -1
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +27 -3
- package/lib/ReactReconcileTransaction.js +17 -6
- package/lib/ReactReconciler.js +29 -6
- package/lib/ReactRef.js +1 -1
- package/lib/ReactServerBatchingStrategy.js +1 -2
- package/lib/ReactServerRendering.js +17 -35
- package/lib/ReactServerRenderingTransaction.js +8 -26
- package/lib/ReactSimpleEmptyComponent.js +36 -0
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +33 -24
- package/lib/ReactTransitionChildMapping.js +1 -2
- package/lib/ReactTransitionEvents.js +8 -44
- package/lib/ReactTransitionGroup.js +1 -1
- package/lib/ReactUpdateQueue.js +6 -65
- package/lib/ReactUpdates.js +26 -9
- package/lib/ReactVersion.js +2 -2
- package/lib/ReactWithAddons.js +1 -14
- package/lib/ResponderEventPlugin.js +54 -66
- package/lib/ResponderSyntheticEvent.js +1 -2
- package/lib/ResponderTouchHistoryStore.js +5 -5
- package/lib/SVGDOMPropertyConfig.js +25 -66
- package/lib/SelectEventPlugin.js +13 -18
- package/lib/SimpleEventPlugin.js +57 -17
- package/lib/SyntheticAnimationEvent.js +39 -0
- package/lib/SyntheticClipboardEvent.js +2 -3
- package/lib/SyntheticCompositionEvent.js +2 -3
- package/lib/SyntheticDragEvent.js +2 -3
- package/lib/SyntheticEvent.js +97 -17
- package/lib/SyntheticFocusEvent.js +2 -3
- package/lib/SyntheticInputEvent.js +2 -3
- package/lib/SyntheticKeyboardEvent.js +2 -3
- package/lib/SyntheticMouseEvent.js +2 -3
- package/lib/SyntheticTouchEvent.js +2 -3
- package/lib/SyntheticTransitionEvent.js +39 -0
- package/lib/SyntheticUIEvent.js +2 -3
- package/lib/SyntheticWheelEvent.js +2 -3
- package/lib/TapEventPlugin.js +3 -12
- package/lib/Transaction.js +3 -3
- package/lib/ViewportMetrics.js +1 -1
- package/lib/accumulate.js +2 -2
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +3 -2
- package/lib/canDefineProperty.js +1 -1
- package/lib/createHierarchyRenderer.js +1 -1
- package/lib/createMicrosoftUnsafeLocalFunction.js +32 -0
- package/lib/dangerousStyleValue.js +25 -3
- package/lib/deprecated.js +4 -2
- package/lib/escapeTextContentForBrowser.js +1 -1
- package/lib/findDOMNode.js +15 -8
- package/lib/flattenChildren.js +2 -2
- package/lib/forEachAccumulated.js +2 -1
- package/lib/getEventCharCode.js +2 -2
- package/lib/getEventKey.js +1 -2
- package/lib/getEventModifierState.js +1 -2
- package/lib/getEventTarget.js +8 -2
- package/lib/getIteratorFn.js +2 -2
- package/lib/getNativeComponentFromComposite.js +30 -0
- package/lib/getNodeForCharacterOffset.js +2 -1
- package/lib/getTestDocument.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/getVendorPrefixedEventName.js +101 -0
- package/lib/instantiateReactComponent.js +9 -11
- package/lib/isEventSupported.js +2 -2
- package/lib/isTextInputElement.js +2 -1
- package/lib/onlyChild.js +2 -2
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +2 -2
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +5 -14
- package/lib/setTextContent.js +1 -1
- package/lib/shallowCompare.js +1 -1
- package/lib/shouldUpdateReactComponent.js +2 -3
- package/lib/sliceChildren.js +1 -1
- package/lib/traverseAllChildren.js +8 -8
- package/lib/update.js +12 -12
- package/lib/validateDOMNesting.js +15 -11
- package/package.json +2 -2
- package/lib/ReactBrowserComponentMixin.js +0 -36
- package/lib/ReactEmptyComponentRegistry.js +0 -48
- package/lib/ReactRootIndex.js +0 -29
- package/lib/ServerReactRootIndex.js +0 -29
- package/lib/cloneWithProps.js +0 -54
- package/lib/webcomponents.js +0 -6379
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticCompositionEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -29,7 +28,7 @@ var CompositionEventInterface = {
|
|
|
29
28
|
* @extends {SyntheticUIEvent}
|
|
30
29
|
*/
|
|
31
30
|
function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
32
|
-
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
31
|
+
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticDragEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -29,7 +28,7 @@ var DragEventInterface = {
|
|
|
29
28
|
* @extends {SyntheticUIEvent}
|
|
30
29
|
*/
|
|
31
30
|
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
32
|
-
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
31
|
+
return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
|
package/lib/SyntheticEvent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -18,6 +17,11 @@ var assign = require('./Object.assign');
|
|
|
18
17
|
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
19
18
|
var warning = require('fbjs/lib/warning');
|
|
20
19
|
|
|
20
|
+
var didWarnForAddedNewProperty = false;
|
|
21
|
+
var isProxySupported = typeof Proxy === 'function';
|
|
22
|
+
|
|
23
|
+
var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
|
|
24
|
+
|
|
21
25
|
/**
|
|
22
26
|
* @interface Event
|
|
23
27
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
@@ -51,12 +55,20 @@ var EventInterface = {
|
|
|
51
55
|
* DOM interface; custom application-specific events can also subclass this.
|
|
52
56
|
*
|
|
53
57
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
54
|
-
* @param {
|
|
58
|
+
* @param {*} targetInst Marker identifying the event target.
|
|
55
59
|
* @param {object} nativeEvent Native browser event.
|
|
60
|
+
* @param {DOMEventTarget} nativeEventTarget Target node.
|
|
56
61
|
*/
|
|
57
|
-
function SyntheticEvent(dispatchConfig,
|
|
62
|
+
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
|
|
63
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
64
|
+
// these have a getter/setter for warnings
|
|
65
|
+
delete this.nativeEvent;
|
|
66
|
+
delete this.preventDefault;
|
|
67
|
+
delete this.stopPropagation;
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
this.dispatchConfig = dispatchConfig;
|
|
59
|
-
this.
|
|
71
|
+
this._targetInst = targetInst;
|
|
60
72
|
this.nativeEvent = nativeEvent;
|
|
61
73
|
|
|
62
74
|
var Interface = this.constructor.Interface;
|
|
@@ -64,6 +76,9 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
|
|
|
64
76
|
if (!Interface.hasOwnProperty(propName)) {
|
|
65
77
|
continue;
|
|
66
78
|
}
|
|
79
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
80
|
+
delete this[propName]; // this has a getter/setter for warnings
|
|
81
|
+
}
|
|
67
82
|
var normalize = Interface[propName];
|
|
68
83
|
if (normalize) {
|
|
69
84
|
this[propName] = normalize(nativeEvent);
|
|
@@ -83,6 +98,7 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
|
|
|
83
98
|
this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
|
|
84
99
|
}
|
|
85
100
|
this.isPropagationStopped = emptyFunction.thatReturnsFalse;
|
|
101
|
+
return this;
|
|
86
102
|
}
|
|
87
103
|
|
|
88
104
|
assign(SyntheticEvent.prototype, {
|
|
@@ -90,9 +106,6 @@ assign(SyntheticEvent.prototype, {
|
|
|
90
106
|
preventDefault: function () {
|
|
91
107
|
this.defaultPrevented = true;
|
|
92
108
|
var event = this.nativeEvent;
|
|
93
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
94
|
-
process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `preventDefault` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
|
|
95
|
-
}
|
|
96
109
|
if (!event) {
|
|
97
110
|
return;
|
|
98
111
|
}
|
|
@@ -107,9 +120,6 @@ assign(SyntheticEvent.prototype, {
|
|
|
107
120
|
|
|
108
121
|
stopPropagation: function () {
|
|
109
122
|
var event = this.nativeEvent;
|
|
110
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
111
|
-
process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `stopPropagation` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
|
|
112
|
-
}
|
|
113
123
|
if (!event) {
|
|
114
124
|
return;
|
|
115
125
|
}
|
|
@@ -144,17 +154,50 @@ assign(SyntheticEvent.prototype, {
|
|
|
144
154
|
destructor: function () {
|
|
145
155
|
var Interface = this.constructor.Interface;
|
|
146
156
|
for (var propName in Interface) {
|
|
147
|
-
|
|
157
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
158
|
+
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
|
|
159
|
+
} else {
|
|
160
|
+
this[propName] = null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
|
|
164
|
+
this[shouldBeReleasedProperties[i]] = null;
|
|
165
|
+
}
|
|
166
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
167
|
+
var noop = require('fbjs/lib/emptyFunction');
|
|
168
|
+
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
|
|
169
|
+
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', noop));
|
|
170
|
+
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', noop));
|
|
148
171
|
}
|
|
149
|
-
this.dispatchConfig = null;
|
|
150
|
-
this.dispatchMarker = null;
|
|
151
|
-
this.nativeEvent = null;
|
|
152
172
|
}
|
|
153
173
|
|
|
154
174
|
});
|
|
155
175
|
|
|
156
176
|
SyntheticEvent.Interface = EventInterface;
|
|
157
177
|
|
|
178
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
179
|
+
if (isProxySupported) {
|
|
180
|
+
/*eslint-disable no-func-assign */
|
|
181
|
+
SyntheticEvent = new Proxy(SyntheticEvent, {
|
|
182
|
+
construct: function (target, args) {
|
|
183
|
+
return this.apply(target, Object.create(target.prototype), args);
|
|
184
|
+
},
|
|
185
|
+
apply: function (constructor, that, args) {
|
|
186
|
+
return new Proxy(constructor.apply(that, args), {
|
|
187
|
+
set: function (target, prop, value) {
|
|
188
|
+
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
|
189
|
+
process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
|
|
190
|
+
didWarnForAddedNewProperty = true;
|
|
191
|
+
}
|
|
192
|
+
target[prop] = value;
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
/*eslint-enable no-func-assign */
|
|
199
|
+
}
|
|
200
|
+
}
|
|
158
201
|
/**
|
|
159
202
|
* Helper to reduce boilerplate when creating subclasses.
|
|
160
203
|
*
|
|
@@ -164,7 +207,10 @@ SyntheticEvent.Interface = EventInterface;
|
|
|
164
207
|
SyntheticEvent.augmentClass = function (Class, Interface) {
|
|
165
208
|
var Super = this;
|
|
166
209
|
|
|
167
|
-
var
|
|
210
|
+
var E = function () {};
|
|
211
|
+
E.prototype = Super.prototype;
|
|
212
|
+
var prototype = new E();
|
|
213
|
+
|
|
168
214
|
assign(prototype, Class.prototype);
|
|
169
215
|
Class.prototype = prototype;
|
|
170
216
|
Class.prototype.constructor = Class;
|
|
@@ -177,4 +223,38 @@ SyntheticEvent.augmentClass = function (Class, Interface) {
|
|
|
177
223
|
|
|
178
224
|
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
|
|
179
225
|
|
|
180
|
-
module.exports = SyntheticEvent;
|
|
226
|
+
module.exports = SyntheticEvent;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Helper to nullify syntheticEvent instance properties when destructing
|
|
230
|
+
*
|
|
231
|
+
* @param {object} SyntheticEvent
|
|
232
|
+
* @param {String} propName
|
|
233
|
+
* @return {object} defineProperty object
|
|
234
|
+
*/
|
|
235
|
+
function getPooledWarningPropertyDefinition(propName, getVal) {
|
|
236
|
+
var isFunction = typeof getVal === 'function';
|
|
237
|
+
return {
|
|
238
|
+
configurable: true,
|
|
239
|
+
set: set,
|
|
240
|
+
get: get
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
function set(val) {
|
|
244
|
+
var action = isFunction ? 'setting the method' : 'setting the property';
|
|
245
|
+
warn(action, 'This is effectively a no-op');
|
|
246
|
+
return val;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function get() {
|
|
250
|
+
var action = isFunction ? 'accessing the method' : 'accessing the property';
|
|
251
|
+
var result = isFunction ? 'This is a no-op function' : 'This is set to null';
|
|
252
|
+
warn(action, result);
|
|
253
|
+
return getVal;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function warn(action, result) {
|
|
257
|
+
var warningCondition = false;
|
|
258
|
+
process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticFocusEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -29,7 +28,7 @@ var FocusEventInterface = {
|
|
|
29
28
|
* @extends {SyntheticUIEvent}
|
|
30
29
|
*/
|
|
31
30
|
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
32
|
-
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
31
|
+
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticInputEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -30,7 +29,7 @@ var InputEventInterface = {
|
|
|
30
29
|
* @extends {SyntheticUIEvent}
|
|
31
30
|
*/
|
|
32
31
|
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
33
|
-
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
32
|
+
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticKeyboardEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -77,7 +76,7 @@ var KeyboardEventInterface = {
|
|
|
77
76
|
* @extends {SyntheticUIEvent}
|
|
78
77
|
*/
|
|
79
78
|
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
80
|
-
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
79
|
+
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticMouseEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -65,7 +64,7 @@ var MouseEventInterface = {
|
|
|
65
64
|
* @extends {SyntheticUIEvent}
|
|
66
65
|
*/
|
|
67
66
|
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
68
|
-
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
67
|
+
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticTouchEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -38,7 +37,7 @@ var TouchEventInterface = {
|
|
|
38
37
|
* @extends {SyntheticUIEvent}
|
|
39
38
|
*/
|
|
40
39
|
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
41
|
-
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
40
|
+
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
|
|
@@ -0,0 +1,39 @@
|
|
|
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticUIEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -52,7 +51,7 @@ var UIEventInterface = {
|
|
|
52
51
|
* @extends {SyntheticEvent}
|
|
53
52
|
*/
|
|
54
53
|
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
55
|
-
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
54
|
+
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticWheelEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -47,7 +46,7 @@ var WheelEventInterface = {
|
|
|
47
46
|
* @extends {SyntheticMouseEvent}
|
|
48
47
|
*/
|
|
49
48
|
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
50
|
-
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
49
|
+
return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
|