react 15.3.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 (189) hide show
  1. package/dist/react-with-addons.js +3898 -21383
  2. package/dist/react-with-addons.min.js +3 -6
  3. package/dist/react.js +2672 -19494
  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 -13
  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 +5 -2
  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/traverseAllChildren.js +11 -2
  33. package/lib/update.js +6 -7
  34. package/package.json +1 -1
  35. package/lib/AutoFocusUtils.js +0 -24
  36. package/lib/BeforeInputEventPlugin.js +0 -390
  37. package/lib/CSSProperty.js +0 -148
  38. package/lib/CSSPropertyOperations.js +0 -205
  39. package/lib/CallbackQueue.js +0 -106
  40. package/lib/ChangeEventPlugin.js +0 -325
  41. package/lib/DOMChildrenOperations.js +0 -194
  42. package/lib/DOMLazyTree.js +0 -118
  43. package/lib/DOMProperty.js +0 -206
  44. package/lib/DOMPropertyOperations.js +0 -221
  45. package/lib/Danger.js +0 -48
  46. package/lib/DefaultEventPluginOrder.js +0 -27
  47. package/lib/DisabledInputUtils.js +0 -50
  48. package/lib/EnterLeaveEventPlugin.js +0 -105
  49. package/lib/EventConstants.js +0 -97
  50. package/lib/EventPluginHub.js +0 -251
  51. package/lib/EventPluginRegistry.js +0 -247
  52. package/lib/EventPluginUtils.js +0 -229
  53. package/lib/EventPropagators.js +0 -137
  54. package/lib/FallbackCompositionState.js +0 -95
  55. package/lib/HTMLDOMPropertyConfig.js +0 -212
  56. package/lib/LinkedValueUtils.js +0 -136
  57. package/lib/NativeMethodsMixin.js +0 -167
  58. package/lib/ReactBrowserEventEmitter.js +0 -330
  59. package/lib/ReactChildReconciler.js +0 -154
  60. package/lib/ReactChildrenMutationWarningHook.js +0 -54
  61. package/lib/ReactComponentBrowserEnvironment.js +0 -30
  62. package/lib/ReactComponentEnvironment.js +0 -45
  63. package/lib/ReactComponentTreeTestUtils.js +0 -87
  64. package/lib/ReactCompositeComponent.js +0 -904
  65. package/lib/ReactDOM.js +0 -110
  66. package/lib/ReactDOMButton.js +0 -24
  67. package/lib/ReactDOMComponent.js +0 -1006
  68. package/lib/ReactDOMComponentTree.js +0 -188
  69. package/lib/ReactDOMContainerInfo.js +0 -33
  70. package/lib/ReactDOMEmptyComponent.js +0 -60
  71. package/lib/ReactDOMFiber.js +0 -76
  72. package/lib/ReactDOMIDOperations.js +0 -34
  73. package/lib/ReactDOMInput.js +0 -269
  74. package/lib/ReactDOMNullInputValuePropHook.js +0 -43
  75. package/lib/ReactDOMOption.js +0 -123
  76. package/lib/ReactDOMSelect.js +0 -201
  77. package/lib/ReactDOMSelection.js +0 -212
  78. package/lib/ReactDOMServer.js +0 -26
  79. package/lib/ReactDOMTextComponent.js +0 -164
  80. package/lib/ReactDOMTextarea.js +0 -155
  81. package/lib/ReactDOMTreeTraversal.js +0 -136
  82. package/lib/ReactDOMUnknownPropertyHook.js +0 -112
  83. package/lib/ReactDebugTool.js +0 -301
  84. package/lib/ReactDefaultBatchingStrategy.js +0 -68
  85. package/lib/ReactDefaultInjection.js +0 -84
  86. package/lib/ReactEmptyComponent.js +0 -30
  87. package/lib/ReactErrorUtils.js +0 -76
  88. package/lib/ReactEventEmitterMixin.js +0 -33
  89. package/lib/ReactEventListener.js +0 -157
  90. package/lib/ReactFeatureFlags.js +0 -22
  91. package/lib/ReactHostComponent.js +0 -76
  92. package/lib/ReactHostOperationHistoryHook.js +0 -37
  93. package/lib/ReactInjection.js +0 -36
  94. package/lib/ReactInputSelection.js +0 -124
  95. package/lib/ReactInstanceHandles.js +0 -302
  96. package/lib/ReactInstanceMap.js +0 -48
  97. package/lib/ReactInstrumentation.js +0 -21
  98. package/lib/ReactInvalidSetStateWarningHook.js +0 -36
  99. package/lib/ReactMarkupChecksum.js +0 -50
  100. package/lib/ReactMount.js +0 -534
  101. package/lib/ReactMultiChild.js +0 -451
  102. package/lib/ReactMultiChildUpdateTypes.js +0 -32
  103. package/lib/ReactNative.js +0 -71
  104. package/lib/ReactNativeAttributePayload.js +0 -371
  105. package/lib/ReactNativeBaseComponent.js +0 -198
  106. package/lib/ReactNativeBridgeEventPlugin.js +0 -60
  107. package/lib/ReactNativeComponentEnvironment.js +0 -31
  108. package/lib/ReactNativeComponentTree.js +0 -68
  109. package/lib/ReactNativeContainerInfo.js +0 -21
  110. package/lib/ReactNativeDOMIDOperations.js +0 -79
  111. package/lib/ReactNativeDefaultInjection.js +0 -101
  112. package/lib/ReactNativeEventEmitter.js +0 -191
  113. package/lib/ReactNativeEventPluginOrder.js +0 -16
  114. package/lib/ReactNativeGlobalResponderHandler.js +0 -25
  115. package/lib/ReactNativeMount.js +0 -193
  116. package/lib/ReactNativePropRegistry.js +0 -52
  117. package/lib/ReactNativeReconcileTransaction.js +0 -129
  118. package/lib/ReactNativeTagHandles.js +0 -56
  119. package/lib/ReactNativeTextComponent.js +0 -71
  120. package/lib/ReactNativeTreeTraversal.js +0 -127
  121. package/lib/ReactNodeTypes.js +0 -40
  122. package/lib/ReactNoop.js +0 -173
  123. package/lib/ReactOwner.js +0 -94
  124. package/lib/ReactPerf.js +0 -494
  125. package/lib/ReactReconcileTransaction.js +0 -178
  126. package/lib/ReactReconciler.js +0 -168
  127. package/lib/ReactRef.js +0 -80
  128. package/lib/ReactServerBatchingStrategy.js +0 -22
  129. package/lib/ReactServerRendering.js +0 -90
  130. package/lib/ReactServerRenderingTransaction.js +0 -90
  131. package/lib/ReactServerUpdateQueue.js +0 -141
  132. package/lib/ReactSimpleEmptyComponent.js +0 -37
  133. package/lib/ReactTestMount.js +0 -126
  134. package/lib/ReactTestReconcileTransaction.js +0 -121
  135. package/lib/ReactTestRenderer.js +0 -144
  136. package/lib/ReactTestUtils.js +0 -518
  137. package/lib/ReactUpdateQueue.js +0 -226
  138. package/lib/ReactUpdates.js +0 -251
  139. package/lib/ResponderEventPlugin.js +0 -510
  140. package/lib/ResponderSyntheticEvent.js +0 -39
  141. package/lib/ResponderTouchHistoryStore.js +0 -184
  142. package/lib/SVGDOMPropertyConfig.js +0 -302
  143. package/lib/SelectEventPlugin.js +0 -196
  144. package/lib/SimpleEventPlugin.js +0 -635
  145. package/lib/SyntheticAnimationEvent.js +0 -39
  146. package/lib/SyntheticClipboardEvent.js +0 -38
  147. package/lib/SyntheticCompositionEvent.js +0 -36
  148. package/lib/SyntheticDragEvent.js +0 -36
  149. package/lib/SyntheticEvent.js +0 -268
  150. package/lib/SyntheticFocusEvent.js +0 -36
  151. package/lib/SyntheticInputEvent.js +0 -37
  152. package/lib/SyntheticKeyboardEvent.js +0 -84
  153. package/lib/SyntheticMouseEvent.js +0 -72
  154. package/lib/SyntheticTouchEvent.js +0 -45
  155. package/lib/SyntheticTransitionEvent.js +0 -39
  156. package/lib/SyntheticUIEvent.js +0 -59
  157. package/lib/SyntheticWheelEvent.js +0 -54
  158. package/lib/TapEventPlugin.js +0 -110
  159. package/lib/TouchHistoryMath.js +0 -99
  160. package/lib/Transaction.js +0 -233
  161. package/lib/ViewportMetrics.js +0 -27
  162. package/lib/accumulate.js +0 -46
  163. package/lib/accumulateInto.js +0 -58
  164. package/lib/adler32.js +0 -44
  165. package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
  166. package/lib/createReactNativeComponentClass.js +0 -42
  167. package/lib/dangerousStyleValue.js +0 -79
  168. package/lib/escapeTextContentForBrowser.js +0 -123
  169. package/lib/findDOMNode.js +0 -60
  170. package/lib/findNodeHandle.js +0 -91
  171. package/lib/forEachAccumulated.js +0 -31
  172. package/lib/getEventCharCode.js +0 -50
  173. package/lib/getEventKey.js +0 -102
  174. package/lib/getEventModifierState.js +0 -43
  175. package/lib/getEventTarget.js +0 -35
  176. package/lib/getHostComponentFromComposite.js +0 -30
  177. package/lib/getNodeForCharacterOffset.js +0 -74
  178. package/lib/getTestDocument.js +0 -21
  179. package/lib/getTextContentAccessor.js +0 -33
  180. package/lib/getVendorPrefixedEventName.js +0 -101
  181. package/lib/instantiateReactComponent.js +0 -119
  182. package/lib/isEventSupported.js +0 -60
  183. package/lib/isTextInputElement.js +0 -51
  184. package/lib/quoteAttributeValueForBrowser.js +0 -26
  185. package/lib/reactComponentExpect.js +0 -217
  186. package/lib/setInnerHTML.js +0 -98
  187. package/lib/setTextContent.js +0 -48
  188. package/lib/shouldUpdateReactComponent.js +0 -42
  189. package/lib/validateDOMNesting.js +0 -382
@@ -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,268 +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 if (typeof event.returnValue !== 'unknown') {
117
- // eslint-disable-line valid-typeof
118
- event.returnValue = false;
119
- }
120
- this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
121
- },
122
-
123
- stopPropagation: function () {
124
- var event = this.nativeEvent;
125
- if (!event) {
126
- return;
127
- }
128
-
129
- if (event.stopPropagation) {
130
- event.stopPropagation();
131
- } else if (typeof event.cancelBubble !== 'unknown') {
132
- // eslint-disable-line valid-typeof
133
- // The ChangeEventPlugin registers a "propertychange" event for
134
- // IE. This event does not support bubbling or cancelling, and
135
- // any references to cancelBubble throw "Member not found". A
136
- // typeof check of "unknown" circumvents this issue (and is also
137
- // IE specific).
138
- event.cancelBubble = true;
139
- }
140
-
141
- this.isPropagationStopped = emptyFunction.thatReturnsTrue;
142
- },
143
-
144
- /**
145
- * We release all dispatched `SyntheticEvent`s after each event loop, adding
146
- * them back into the pool. This allows a way to hold onto a reference that
147
- * won't be added back into the pool.
148
- */
149
- persist: function () {
150
- this.isPersistent = emptyFunction.thatReturnsTrue;
151
- },
152
-
153
- /**
154
- * Checks if this event should be released back into the pool.
155
- *
156
- * @return {boolean} True if this should not be released, false otherwise.
157
- */
158
- isPersistent: emptyFunction.thatReturnsFalse,
159
-
160
- /**
161
- * `PooledClass` looks for `destructor` on each instance it releases.
162
- */
163
- destructor: function () {
164
- var Interface = this.constructor.Interface;
165
- for (var propName in Interface) {
166
- if (process.env.NODE_ENV !== 'production') {
167
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
168
- } else {
169
- this[propName] = null;
170
- }
171
- }
172
- for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
173
- this[shouldBeReleasedProperties[i]] = null;
174
- }
175
- if (process.env.NODE_ENV !== 'production') {
176
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
177
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
178
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
179
- }
180
- }
181
-
182
- });
183
-
184
- SyntheticEvent.Interface = EventInterface;
185
-
186
- if (process.env.NODE_ENV !== 'production') {
187
- if (isProxySupported) {
188
- /*eslint-disable no-func-assign */
189
- SyntheticEvent = new Proxy(SyntheticEvent, {
190
- construct: function (target, args) {
191
- return this.apply(target, Object.create(target.prototype), args);
192
- },
193
- apply: function (constructor, that, args) {
194
- return new Proxy(constructor.apply(that, args), {
195
- set: function (target, prop, value) {
196
- if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
197
- 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;
198
- didWarnForAddedNewProperty = true;
199
- }
200
- target[prop] = value;
201
- return true;
202
- }
203
- });
204
- }
205
- });
206
- /*eslint-enable no-func-assign */
207
- }
208
- }
209
- /**
210
- * Helper to reduce boilerplate when creating subclasses.
211
- *
212
- * @param {function} Class
213
- * @param {?object} Interface
214
- */
215
- SyntheticEvent.augmentClass = function (Class, Interface) {
216
- var Super = this;
217
-
218
- var E = function () {};
219
- E.prototype = Super.prototype;
220
- var prototype = new E();
221
-
222
- _assign(prototype, Class.prototype);
223
- Class.prototype = prototype;
224
- Class.prototype.constructor = Class;
225
-
226
- Class.Interface = _assign({}, Super.Interface, Interface);
227
- Class.augmentClass = Super.augmentClass;
228
-
229
- PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
230
- };
231
-
232
- PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
233
-
234
- module.exports = SyntheticEvent;
235
-
236
- /**
237
- * Helper to nullify syntheticEvent instance properties when destructing
238
- *
239
- * @param {object} SyntheticEvent
240
- * @param {String} propName
241
- * @return {object} defineProperty object
242
- */
243
- function getPooledWarningPropertyDefinition(propName, getVal) {
244
- var isFunction = typeof getVal === 'function';
245
- return {
246
- configurable: true,
247
- set: set,
248
- get: get
249
- };
250
-
251
- function set(val) {
252
- var action = isFunction ? 'setting the method' : 'setting the property';
253
- warn(action, 'This is effectively a no-op');
254
- return val;
255
- }
256
-
257
- function get() {
258
- var action = isFunction ? 'accessing the method' : 'accessing the property';
259
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
260
- warn(action, result);
261
- return getVal;
262
- }
263
-
264
- function warn(action, result) {
265
- var warningCondition = false;
266
- 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;
267
- }
268
- }
@@ -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;