react 15.3.1-rc.2 → 15.4.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.
Files changed (190) hide show
  1. package/dist/react-with-addons.js +3961 -21387
  2. package/dist/react-with-addons.min.js +3 -6
  3. package/dist/react.js +2701 -19464
  4. package/dist/react.min.js +2 -6
  5. package/lib/LinkedStateMixin.js +1 -2
  6. package/lib/PooledClass.js +3 -0
  7. package/lib/ReactAddonsDOMDependencies.js +36 -0
  8. package/lib/ReactAddonsDOMDependenciesUMDShim.js +32 -0
  9. package/lib/ReactCSSTransitionGroup.js +60 -42
  10. package/lib/ReactCSSTransitionGroupChild.js +2 -2
  11. package/lib/ReactClass.js +38 -53
  12. package/lib/ReactComponentTreeHook.js +84 -100
  13. package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +5 -7
  14. package/lib/ReactCurrentOwner.js +1 -1
  15. package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +6 -4
  16. package/lib/ReactElement.js +6 -29
  17. package/lib/ReactElementSymbol.js +20 -0
  18. package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +4 -9
  19. package/lib/ReactElementValidator.js +1 -2
  20. package/lib/ReactPropTypeLocationNames.js +1 -0
  21. package/lib/ReactPropTypeLocations.js +2 -11
  22. package/lib/ReactPropTypes.js +30 -13
  23. package/lib/ReactPropTypesSecret.js +1 -0
  24. package/lib/ReactTransitionEvents.js +1 -1
  25. package/lib/ReactTransitionGroup.js +145 -141
  26. package/lib/ReactUMDEntry.js +11 -5
  27. package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +4 -6
  28. package/lib/ReactVersion.js +1 -1
  29. package/lib/ReactWithAddons.js +15 -2
  30. package/lib/ReactWithAddonsUMDEntry.js +11 -5
  31. package/lib/canDefineProperty.js +2 -0
  32. package/lib/onlyChild.js +1 -1
  33. package/lib/traverseAllChildren.js +11 -2
  34. package/lib/update.js +6 -7
  35. package/package.json +2 -2
  36. package/lib/AutoFocusUtils.js +0 -24
  37. package/lib/BeforeInputEventPlugin.js +0 -388
  38. package/lib/CSSProperty.js +0 -148
  39. package/lib/CSSPropertyOperations.js +0 -205
  40. package/lib/CallbackQueue.js +0 -106
  41. package/lib/ChangeEventPlugin.js +0 -325
  42. package/lib/DOMChildrenOperations.js +0 -194
  43. package/lib/DOMLazyTree.js +0 -118
  44. package/lib/DOMProperty.js +0 -206
  45. package/lib/DOMPropertyOperations.js +0 -221
  46. package/lib/Danger.js +0 -48
  47. package/lib/DefaultEventPluginOrder.js +0 -27
  48. package/lib/DisabledInputUtils.js +0 -50
  49. package/lib/EnterLeaveEventPlugin.js +0 -105
  50. package/lib/EventConstants.js +0 -97
  51. package/lib/EventPluginHub.js +0 -251
  52. package/lib/EventPluginRegistry.js +0 -247
  53. package/lib/EventPluginUtils.js +0 -229
  54. package/lib/EventPropagators.js +0 -137
  55. package/lib/FallbackCompositionState.js +0 -95
  56. package/lib/HTMLDOMPropertyConfig.js +0 -209
  57. package/lib/LinkedValueUtils.js +0 -136
  58. package/lib/NativeMethodsMixin.js +0 -167
  59. package/lib/ReactBrowserEventEmitter.js +0 -317
  60. package/lib/ReactChildReconciler.js +0 -154
  61. package/lib/ReactChildrenMutationWarningHook.js +0 -54
  62. package/lib/ReactComponentBrowserEnvironment.js +0 -30
  63. package/lib/ReactComponentEnvironment.js +0 -45
  64. package/lib/ReactComponentTreeTestUtils.js +0 -87
  65. package/lib/ReactCompositeComponent.js +0 -920
  66. package/lib/ReactDOM.js +0 -110
  67. package/lib/ReactDOMButton.js +0 -24
  68. package/lib/ReactDOMComponent.js +0 -1005
  69. package/lib/ReactDOMComponentTree.js +0 -188
  70. package/lib/ReactDOMContainerInfo.js +0 -33
  71. package/lib/ReactDOMEmptyComponent.js +0 -60
  72. package/lib/ReactDOMFiber.js +0 -78
  73. package/lib/ReactDOMIDOperations.js +0 -34
  74. package/lib/ReactDOMInput.js +0 -269
  75. package/lib/ReactDOMNullInputValuePropHook.js +0 -43
  76. package/lib/ReactDOMOption.js +0 -123
  77. package/lib/ReactDOMSelect.js +0 -201
  78. package/lib/ReactDOMSelection.js +0 -212
  79. package/lib/ReactDOMServer.js +0 -26
  80. package/lib/ReactDOMTextComponent.js +0 -164
  81. package/lib/ReactDOMTextarea.js +0 -155
  82. package/lib/ReactDOMTreeTraversal.js +0 -136
  83. package/lib/ReactDOMUnknownPropertyHook.js +0 -112
  84. package/lib/ReactDebugTool.js +0 -307
  85. package/lib/ReactDefaultBatchingStrategy.js +0 -68
  86. package/lib/ReactDefaultInjection.js +0 -84
  87. package/lib/ReactEmptyComponent.js +0 -30
  88. package/lib/ReactErrorUtils.js +0 -76
  89. package/lib/ReactEventEmitterMixin.js +0 -33
  90. package/lib/ReactEventListener.js +0 -157
  91. package/lib/ReactFeatureFlags.js +0 -22
  92. package/lib/ReactHostComponent.js +0 -76
  93. package/lib/ReactHostOperationHistoryHook.js +0 -37
  94. package/lib/ReactInjection.js +0 -36
  95. package/lib/ReactInputSelection.js +0 -124
  96. package/lib/ReactInstanceHandles.js +0 -302
  97. package/lib/ReactInstanceMap.js +0 -48
  98. package/lib/ReactInstrumentation.js +0 -21
  99. package/lib/ReactInvalidSetStateWarningHook.js +0 -36
  100. package/lib/ReactMarkupChecksum.js +0 -50
  101. package/lib/ReactMount.js +0 -495
  102. package/lib/ReactMultiChild.js +0 -451
  103. package/lib/ReactMultiChildUpdateTypes.js +0 -32
  104. package/lib/ReactNative.js +0 -71
  105. package/lib/ReactNativeAttributePayload.js +0 -371
  106. package/lib/ReactNativeBaseComponent.js +0 -198
  107. package/lib/ReactNativeBridgeEventPlugin.js +0 -60
  108. package/lib/ReactNativeComponentEnvironment.js +0 -31
  109. package/lib/ReactNativeComponentTree.js +0 -68
  110. package/lib/ReactNativeContainerInfo.js +0 -21
  111. package/lib/ReactNativeDOMIDOperations.js +0 -79
  112. package/lib/ReactNativeDefaultInjection.js +0 -101
  113. package/lib/ReactNativeEventEmitter.js +0 -191
  114. package/lib/ReactNativeEventPluginOrder.js +0 -16
  115. package/lib/ReactNativeGlobalResponderHandler.js +0 -25
  116. package/lib/ReactNativeMount.js +0 -193
  117. package/lib/ReactNativePropRegistry.js +0 -52
  118. package/lib/ReactNativeReconcileTransaction.js +0 -116
  119. package/lib/ReactNativeTagHandles.js +0 -56
  120. package/lib/ReactNativeTextComponent.js +0 -71
  121. package/lib/ReactNativeTreeTraversal.js +0 -127
  122. package/lib/ReactNodeTypes.js +0 -40
  123. package/lib/ReactNoop.js +0 -173
  124. package/lib/ReactOwner.js +0 -94
  125. package/lib/ReactPerf.js +0 -494
  126. package/lib/ReactReconcileTransaction.js +0 -178
  127. package/lib/ReactReconciler.js +0 -168
  128. package/lib/ReactRef.js +0 -80
  129. package/lib/ReactServerBatchingStrategy.js +0 -22
  130. package/lib/ReactServerRendering.js +0 -90
  131. package/lib/ReactServerRenderingTransaction.js +0 -90
  132. package/lib/ReactServerUpdateQueue.js +0 -141
  133. package/lib/ReactSimpleEmptyComponent.js +0 -37
  134. package/lib/ReactTestMount.js +0 -123
  135. package/lib/ReactTestReconcileTransaction.js +0 -108
  136. package/lib/ReactTestRenderer.js +0 -144
  137. package/lib/ReactTestUtils.js +0 -518
  138. package/lib/ReactUpdateQueue.js +0 -226
  139. package/lib/ReactUpdates.js +0 -251
  140. package/lib/ResponderEventPlugin.js +0 -510
  141. package/lib/ResponderSyntheticEvent.js +0 -39
  142. package/lib/ResponderTouchHistoryStore.js +0 -184
  143. package/lib/SVGDOMPropertyConfig.js +0 -302
  144. package/lib/SelectEventPlugin.js +0 -196
  145. package/lib/SimpleEventPlugin.js +0 -635
  146. package/lib/SyntheticAnimationEvent.js +0 -39
  147. package/lib/SyntheticClipboardEvent.js +0 -38
  148. package/lib/SyntheticCompositionEvent.js +0 -36
  149. package/lib/SyntheticDragEvent.js +0 -36
  150. package/lib/SyntheticEvent.js +0 -267
  151. package/lib/SyntheticFocusEvent.js +0 -36
  152. package/lib/SyntheticInputEvent.js +0 -37
  153. package/lib/SyntheticKeyboardEvent.js +0 -84
  154. package/lib/SyntheticMouseEvent.js +0 -72
  155. package/lib/SyntheticTouchEvent.js +0 -45
  156. package/lib/SyntheticTransitionEvent.js +0 -39
  157. package/lib/SyntheticUIEvent.js +0 -59
  158. package/lib/SyntheticWheelEvent.js +0 -54
  159. package/lib/TapEventPlugin.js +0 -110
  160. package/lib/TouchHistoryMath.js +0 -99
  161. package/lib/Transaction.js +0 -233
  162. package/lib/ViewportMetrics.js +0 -27
  163. package/lib/accumulate.js +0 -46
  164. package/lib/accumulateInto.js +0 -58
  165. package/lib/adler32.js +0 -44
  166. package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
  167. package/lib/createReactNativeComponentClass.js +0 -42
  168. package/lib/dangerousStyleValue.js +0 -79
  169. package/lib/escapeTextContentForBrowser.js +0 -122
  170. package/lib/findDOMNode.js +0 -60
  171. package/lib/findNodeHandle.js +0 -91
  172. package/lib/forEachAccumulated.js +0 -31
  173. package/lib/getEventCharCode.js +0 -50
  174. package/lib/getEventKey.js +0 -102
  175. package/lib/getEventModifierState.js +0 -43
  176. package/lib/getEventTarget.js +0 -35
  177. package/lib/getHostComponentFromComposite.js +0 -30
  178. package/lib/getNodeForCharacterOffset.js +0 -74
  179. package/lib/getTestDocument.js +0 -21
  180. package/lib/getTextContentAccessor.js +0 -33
  181. package/lib/getVendorPrefixedEventName.js +0 -101
  182. package/lib/instantiateReactComponent.js +0 -119
  183. package/lib/isEventSupported.js +0 -60
  184. package/lib/isTextInputElement.js +0 -51
  185. package/lib/quoteAttributeValueForBrowser.js +0 -26
  186. package/lib/reactComponentExpect.js +0 -217
  187. package/lib/setInnerHTML.js +0 -98
  188. package/lib/setTextContent.js +0 -48
  189. package/lib/shouldUpdateReactComponent.js +0 -42
  190. package/lib/validateDOMNesting.js +0 -369
@@ -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 SyntheticAnimationEvent
10
- */
11
-
12
- 'use strict';
13
-
14
- var SyntheticEvent = require('./SyntheticEvent');
15
-
16
- /**
17
- * @interface Event
18
- * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
19
- * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
20
- */
21
- var AnimationEventInterface = {
22
- animationName: 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 SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
34
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
35
- }
36
-
37
- SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
38
-
39
- module.exports = SyntheticAnimationEvent;
@@ -1,38 +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 SyntheticClipboardEvent
10
- */
11
-
12
- 'use strict';
13
-
14
- var SyntheticEvent = require('./SyntheticEvent');
15
-
16
- /**
17
- * @interface Event
18
- * @see http://www.w3.org/TR/clipboard-apis/
19
- */
20
- var ClipboardEventInterface = {
21
- clipboardData: function (event) {
22
- return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
23
- }
24
- };
25
-
26
- /**
27
- * @param {object} dispatchConfig Configuration used to dispatch this event.
28
- * @param {string} dispatchMarker Marker identifying the event target.
29
- * @param {object} nativeEvent Native browser event.
30
- * @extends {SyntheticUIEvent}
31
- */
32
- function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
33
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
34
- }
35
-
36
- SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
37
-
38
- module.exports = SyntheticClipboardEvent;
@@ -1,36 +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 SyntheticCompositionEvent
10
- */
11
-
12
- 'use strict';
13
-
14
- var SyntheticEvent = require('./SyntheticEvent');
15
-
16
- /**
17
- * @interface Event
18
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
19
- */
20
- var CompositionEventInterface = {
21
- data: null
22
- };
23
-
24
- /**
25
- * @param {object} dispatchConfig Configuration used to dispatch this event.
26
- * @param {string} dispatchMarker Marker identifying the event target.
27
- * @param {object} nativeEvent Native browser event.
28
- * @extends {SyntheticUIEvent}
29
- */
30
- function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
31
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
32
- }
33
-
34
- SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
35
-
36
- module.exports = SyntheticCompositionEvent;
@@ -1,36 +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 SyntheticDragEvent
10
- */
11
-
12
- 'use strict';
13
-
14
- var SyntheticMouseEvent = require('./SyntheticMouseEvent');
15
-
16
- /**
17
- * @interface DragEvent
18
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
19
- */
20
- var DragEventInterface = {
21
- dataTransfer: null
22
- };
23
-
24
- /**
25
- * @param {object} dispatchConfig Configuration used to dispatch this event.
26
- * @param {string} dispatchMarker Marker identifying the event target.
27
- * @param {object} nativeEvent Native browser event.
28
- * @extends {SyntheticUIEvent}
29
- */
30
- function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
31
- return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
32
- }
33
-
34
- SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
35
-
36
- module.exports = SyntheticDragEvent;
@@ -1,267 +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 SyntheticEvent
10
- */
11
-
12
- 'use strict';
13
-
14
- var _assign = require('object-assign');
15
-
16
- var PooledClass = require('./PooledClass');
17
-
18
- var emptyFunction = require('fbjs/lib/emptyFunction');
19
- var warning = require('fbjs/lib/warning');
20
-
21
- var didWarnForAddedNewProperty = false;
22
- var isProxySupported = typeof Proxy === 'function';
23
-
24
- var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
25
-
26
- /**
27
- * @interface Event
28
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
29
- */
30
- var EventInterface = {
31
- type: null,
32
- target: null,
33
- // currentTarget is set when dispatching; no use in copying it here
34
- currentTarget: emptyFunction.thatReturnsNull,
35
- eventPhase: null,
36
- bubbles: null,
37
- cancelable: null,
38
- timeStamp: function (event) {
39
- return event.timeStamp || Date.now();
40
- },
41
- defaultPrevented: null,
42
- isTrusted: null
43
- };
44
-
45
- /**
46
- * Synthetic events are dispatched by event plugins, typically in response to a
47
- * top-level event delegation handler.
48
- *
49
- * These systems should generally use pooling to reduce the frequency of garbage
50
- * collection. The system should check `isPersistent` to determine whether the
51
- * event should be released into the pool after being dispatched. Users that
52
- * need a persisted event should invoke `persist`.
53
- *
54
- * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
55
- * normalizing browser quirks. Subclasses do not necessarily have to implement a
56
- * DOM interface; custom application-specific events can also subclass this.
57
- *
58
- * @param {object} dispatchConfig Configuration used to dispatch this event.
59
- * @param {*} targetInst Marker identifying the event target.
60
- * @param {object} nativeEvent Native browser event.
61
- * @param {DOMEventTarget} nativeEventTarget Target node.
62
- */
63
- function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
64
- if (process.env.NODE_ENV !== 'production') {
65
- // these have a getter/setter for warnings
66
- delete this.nativeEvent;
67
- delete this.preventDefault;
68
- delete this.stopPropagation;
69
- }
70
-
71
- this.dispatchConfig = dispatchConfig;
72
- this._targetInst = targetInst;
73
- this.nativeEvent = nativeEvent;
74
-
75
- var Interface = this.constructor.Interface;
76
- for (var propName in Interface) {
77
- if (!Interface.hasOwnProperty(propName)) {
78
- continue;
79
- }
80
- if (process.env.NODE_ENV !== 'production') {
81
- delete this[propName]; // this has a getter/setter for warnings
82
- }
83
- var normalize = Interface[propName];
84
- if (normalize) {
85
- this[propName] = normalize(nativeEvent);
86
- } else {
87
- if (propName === 'target') {
88
- this.target = nativeEventTarget;
89
- } else {
90
- this[propName] = nativeEvent[propName];
91
- }
92
- }
93
- }
94
-
95
- var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
96
- if (defaultPrevented) {
97
- this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
98
- } else {
99
- this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
100
- }
101
- this.isPropagationStopped = emptyFunction.thatReturnsFalse;
102
- return this;
103
- }
104
-
105
- _assign(SyntheticEvent.prototype, {
106
-
107
- preventDefault: function () {
108
- this.defaultPrevented = true;
109
- var event = this.nativeEvent;
110
- if (!event) {
111
- return;
112
- }
113
-
114
- if (event.preventDefault) {
115
- event.preventDefault();
116
- } else {
117
- event.returnValue = false;
118
- }
119
- this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
120
- },
121
-
122
- stopPropagation: function () {
123
- var event = this.nativeEvent;
124
- if (!event) {
125
- return;
126
- }
127
-
128
- if (event.stopPropagation) {
129
- event.stopPropagation();
130
- } else if (typeof event.cancelBubble !== 'unknown') {
131
- // eslint-disable-line valid-typeof
132
- // The ChangeEventPlugin registers a "propertychange" event for
133
- // IE. This event does not support bubbling or cancelling, and
134
- // any references to cancelBubble throw "Member not found". A
135
- // typeof check of "unknown" circumvents this issue (and is also
136
- // IE specific).
137
- event.cancelBubble = true;
138
- }
139
-
140
- this.isPropagationStopped = emptyFunction.thatReturnsTrue;
141
- },
142
-
143
- /**
144
- * We release all dispatched `SyntheticEvent`s after each event loop, adding
145
- * them back into the pool. This allows a way to hold onto a reference that
146
- * won't be added back into the pool.
147
- */
148
- persist: function () {
149
- this.isPersistent = emptyFunction.thatReturnsTrue;
150
- },
151
-
152
- /**
153
- * Checks if this event should be released back into the pool.
154
- *
155
- * @return {boolean} True if this should not be released, false otherwise.
156
- */
157
- isPersistent: emptyFunction.thatReturnsFalse,
158
-
159
- /**
160
- * `PooledClass` looks for `destructor` on each instance it releases.
161
- */
162
- destructor: function () {
163
- var Interface = this.constructor.Interface;
164
- for (var propName in Interface) {
165
- if (process.env.NODE_ENV !== 'production') {
166
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
167
- } else {
168
- this[propName] = null;
169
- }
170
- }
171
- for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
172
- this[shouldBeReleasedProperties[i]] = null;
173
- }
174
- if (process.env.NODE_ENV !== 'production') {
175
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
176
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
177
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
178
- }
179
- }
180
-
181
- });
182
-
183
- SyntheticEvent.Interface = EventInterface;
184
-
185
- if (process.env.NODE_ENV !== 'production') {
186
- if (isProxySupported) {
187
- /*eslint-disable no-func-assign */
188
- SyntheticEvent = new Proxy(SyntheticEvent, {
189
- construct: function (target, args) {
190
- return this.apply(target, Object.create(target.prototype), args);
191
- },
192
- apply: function (constructor, that, args) {
193
- return new Proxy(constructor.apply(that, args), {
194
- set: function (target, prop, value) {
195
- if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
196
- 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;
197
- didWarnForAddedNewProperty = true;
198
- }
199
- target[prop] = value;
200
- return true;
201
- }
202
- });
203
- }
204
- });
205
- /*eslint-enable no-func-assign */
206
- }
207
- }
208
- /**
209
- * Helper to reduce boilerplate when creating subclasses.
210
- *
211
- * @param {function} Class
212
- * @param {?object} Interface
213
- */
214
- SyntheticEvent.augmentClass = function (Class, Interface) {
215
- var Super = this;
216
-
217
- var E = function () {};
218
- E.prototype = Super.prototype;
219
- var prototype = new E();
220
-
221
- _assign(prototype, Class.prototype);
222
- Class.prototype = prototype;
223
- Class.prototype.constructor = Class;
224
-
225
- Class.Interface = _assign({}, Super.Interface, Interface);
226
- Class.augmentClass = Super.augmentClass;
227
-
228
- PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
229
- };
230
-
231
- PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
232
-
233
- module.exports = SyntheticEvent;
234
-
235
- /**
236
- * Helper to nullify syntheticEvent instance properties when destructing
237
- *
238
- * @param {object} SyntheticEvent
239
- * @param {String} propName
240
- * @return {object} defineProperty object
241
- */
242
- function getPooledWarningPropertyDefinition(propName, getVal) {
243
- var isFunction = typeof getVal === 'function';
244
- return {
245
- configurable: true,
246
- set: set,
247
- get: get
248
- };
249
-
250
- function set(val) {
251
- var action = isFunction ? 'setting the method' : 'setting the property';
252
- warn(action, 'This is effectively a no-op');
253
- return val;
254
- }
255
-
256
- function get() {
257
- var action = isFunction ? 'accessing the method' : 'accessing the property';
258
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
259
- warn(action, result);
260
- return getVal;
261
- }
262
-
263
- function warn(action, result) {
264
- var warningCondition = false;
265
- 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;
266
- }
267
- }
@@ -1,36 +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 SyntheticFocusEvent
10
- */
11
-
12
- 'use strict';
13
-
14
- var SyntheticUIEvent = require('./SyntheticUIEvent');
15
-
16
- /**
17
- * @interface FocusEvent
18
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
19
- */
20
- var FocusEventInterface = {
21
- relatedTarget: null
22
- };
23
-
24
- /**
25
- * @param {object} dispatchConfig Configuration used to dispatch this event.
26
- * @param {string} dispatchMarker Marker identifying the event target.
27
- * @param {object} nativeEvent Native browser event.
28
- * @extends {SyntheticUIEvent}
29
- */
30
- function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
31
- return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
32
- }
33
-
34
- SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
35
-
36
- module.exports = SyntheticFocusEvent;