react 0.13.3 → 0.14.0-beta1

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/README.md +5 -2
  2. package/addons.js +7 -0
  3. package/dist/JSXTransformer.js +4101 -2432
  4. package/dist/react-with-addons.js +4389 -6277
  5. package/dist/react-with-addons.min.js +6 -8
  6. package/dist/react.js +4028 -5697
  7. package/dist/react.min.js +5 -6
  8. package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +16 -5
  9. package/lib/BeforeInputEventPlugin.js +30 -118
  10. package/lib/CSSCore.js +12 -23
  11. package/lib/CSSProperty.js +4 -3
  12. package/lib/CSSPropertyOperations.js +14 -30
  13. package/lib/CallbackQueue.js +7 -10
  14. package/lib/ChangeEventPlugin.js +26 -88
  15. package/lib/ClientReactRootIndex.js +2 -2
  16. package/lib/DOMChildrenOperations.js +13 -33
  17. package/lib/DOMProperty.js +86 -147
  18. package/lib/DOMPropertyOperations.js +91 -67
  19. package/lib/Danger.js +19 -62
  20. package/lib/DefaultEventPluginOrder.js +2 -12
  21. package/lib/EnterLeaveEventPlugin.js +11 -33
  22. package/lib/EventConstants.js +2 -2
  23. package/lib/EventListener.js +11 -13
  24. package/lib/EventPluginHub.js +44 -47
  25. package/lib/EventPluginRegistry.js +18 -74
  26. package/lib/EventPluginUtils.js +33 -44
  27. package/lib/EventPropagators.js +23 -26
  28. package/lib/ExecutionEnvironment.js +4 -8
  29. package/lib/FallbackCompositionState.js +3 -3
  30. package/lib/HTMLDOMPropertyConfig.js +15 -20
  31. package/lib/LinkedStateMixin.js +3 -6
  32. package/lib/LinkedValueUtils.js +71 -89
  33. package/lib/Object.assign.js +1 -1
  34. package/lib/PooledClass.js +20 -11
  35. package/lib/React.js +9 -129
  36. package/lib/ReactBrowserComponentMixin.js +9 -2
  37. package/lib/ReactBrowserEventEmitter.js +26 -82
  38. package/lib/ReactCSSTransitionGroup.js +13 -24
  39. package/lib/ReactCSSTransitionGroupChild.js +26 -28
  40. package/lib/ReactChildReconciler.js +11 -19
  41. package/lib/ReactChildren.js +24 -31
  42. package/lib/ReactClass.js +96 -267
  43. package/lib/ReactComponent.js +28 -57
  44. package/lib/ReactComponentBrowserEnvironment.js +4 -8
  45. package/lib/ReactComponentEnvironment.js +6 -12
  46. package/lib/ReactComponentWithPureRenderMixin.js +6 -7
  47. package/lib/ReactCompositeComponent.js +115 -381
  48. package/lib/ReactCurrentOwner.js +1 -3
  49. package/lib/ReactDOM.js +4 -2
  50. package/lib/ReactDOMButton.js +16 -28
  51. package/lib/ReactDOMClient.js +90 -0
  52. package/lib/ReactDOMComponent.js +468 -156
  53. package/lib/ReactDOMIDOperations.js +25 -22
  54. package/lib/ReactDOMInput.js +79 -108
  55. package/lib/ReactDOMOption.js +58 -20
  56. package/lib/ReactDOMSelect.js +95 -83
  57. package/lib/ReactDOMSelection.js +5 -20
  58. package/lib/ReactDOMServer.js +24 -0
  59. package/lib/ReactDOMTextComponent.js +17 -18
  60. package/lib/ReactDOMTextarea.js +44 -69
  61. package/lib/ReactDefaultBatchingStrategy.js +9 -13
  62. package/lib/ReactDefaultInjection.js +20 -76
  63. package/lib/ReactDefaultPerf.js +36 -69
  64. package/lib/ReactDefaultPerfAnalysis.js +8 -14
  65. package/lib/ReactElement.js +26 -120
  66. package/lib/ReactElementValidator.js +56 -192
  67. package/lib/ReactEmptyComponent.js +7 -11
  68. package/lib/ReactErrorUtils.js +3 -3
  69. package/lib/ReactEventEmitterMixin.js +3 -13
  70. package/lib/ReactEventListener.js +58 -40
  71. package/lib/ReactFragment.js +33 -59
  72. package/lib/ReactInjection.js +1 -1
  73. package/lib/ReactInputSelection.js +14 -23
  74. package/lib/ReactInstanceHandles.js +29 -58
  75. package/lib/ReactInstanceMap.js +5 -5
  76. package/lib/ReactIsomorphic.js +70 -0
  77. package/lib/ReactLink.js +2 -4
  78. package/lib/ReactMarkupChecksum.js +5 -10
  79. package/lib/ReactMount.js +142 -285
  80. package/lib/ReactMultiChild.js +19 -45
  81. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  82. package/lib/ReactNativeComponent.js +6 -15
  83. package/lib/ReactNoopUpdateQueue.js +118 -0
  84. package/lib/ReactOwner.js +7 -24
  85. package/lib/ReactPerf.js +8 -12
  86. package/lib/ReactPropTransferer.js +4 -4
  87. package/lib/ReactPropTypeLocationNames.js +2 -2
  88. package/lib/ReactPropTypeLocations.js +1 -1
  89. package/lib/ReactPropTypes.js +41 -61
  90. package/lib/ReactReconcileTransaction.js +11 -36
  91. package/lib/ReactReconciler.js +14 -26
  92. package/lib/ReactRef.js +5 -8
  93. package/lib/ReactRootIndex.js +2 -2
  94. package/lib/ReactServerBatchingStrategy.js +23 -0
  95. package/lib/ReactServerRendering.js +20 -15
  96. package/lib/ReactServerRenderingTransaction.js +9 -34
  97. package/lib/ReactStateSetters.js +6 -6
  98. package/lib/ReactTestUtils.js +137 -190
  99. package/lib/ReactTransitionChildMapping.js +5 -7
  100. package/lib/ReactTransitionEvents.js +5 -5
  101. package/lib/ReactTransitionGroup.js +30 -52
  102. package/lib/ReactUpdateQueue.js +69 -107
  103. package/lib/ReactUpdates.js +26 -81
  104. package/lib/ReactWithAddons.js +5 -6
  105. package/lib/SVGDOMPropertyConfig.js +39 -4
  106. package/lib/SelectEventPlugin.js +31 -33
  107. package/lib/ServerReactRootIndex.js +2 -2
  108. package/lib/SimpleEventPlugin.js +138 -130
  109. package/lib/SyntheticClipboardEvent.js +5 -9
  110. package/lib/SyntheticCompositionEvent.js +4 -10
  111. package/lib/SyntheticDragEvent.js +3 -3
  112. package/lib/SyntheticEvent.js +14 -15
  113. package/lib/SyntheticFocusEvent.js +3 -3
  114. package/lib/SyntheticInputEvent.js +4 -10
  115. package/lib/SyntheticKeyboardEvent.js +6 -6
  116. package/lib/SyntheticMouseEvent.js +10 -16
  117. package/lib/SyntheticTouchEvent.js +3 -3
  118. package/lib/SyntheticUIEvent.js +5 -5
  119. package/lib/SyntheticWheelEvent.js +13 -17
  120. package/lib/Transaction.js +22 -28
  121. package/lib/ViewportMetrics.js +2 -2
  122. package/lib/accumulateInto.js +2 -5
  123. package/lib/adler32.js +2 -4
  124. package/lib/camelize.js +4 -2
  125. package/lib/camelizeStyleName.js +2 -2
  126. package/lib/cloneWithProps.js +6 -12
  127. package/lib/containsNode.js +29 -16
  128. package/lib/createArrayFromMixed.js +17 -16
  129. package/lib/createNodesFromMarkup.js +6 -8
  130. package/lib/dangerousStyleValue.js +2 -3
  131. package/lib/deprecated.js +47 -0
  132. package/lib/emptyFunction.js +10 -4
  133. package/lib/emptyObject.js +1 -1
  134. package/lib/escapeTextContentForBrowser.js +1 -1
  135. package/lib/findDOMNode.js +7 -27
  136. package/lib/flattenChildren.js +4 -10
  137. package/lib/focusNode.js +2 -3
  138. package/lib/forEachAccumulated.js +3 -3
  139. package/lib/getActiveElement.js +4 -2
  140. package/lib/getEventCharCode.js +2 -2
  141. package/lib/getEventKey.js +1 -1
  142. package/lib/getEventModifierState.js +1 -2
  143. package/lib/getEventTarget.js +1 -1
  144. package/lib/getIteratorFn.js +2 -4
  145. package/lib/getMarkupWrap.js +18 -40
  146. package/lib/getNodeForCharacterOffset.js +1 -1
  147. package/lib/getTextContentAccessor.js +2 -4
  148. package/lib/getUnboundedScrollPosition.js +1 -1
  149. package/lib/hyphenate.js +3 -1
  150. package/lib/hyphenateStyleName.js +2 -2
  151. package/lib/instantiateReactComponent.js +23 -43
  152. package/lib/invariant.js +8 -12
  153. package/lib/isEventSupported.js +7 -10
  154. package/lib/isNode.js +4 -6
  155. package/lib/isTextInputElement.js +3 -4
  156. package/lib/isTextNode.js +3 -1
  157. package/lib/joinClasses.js +3 -3
  158. package/lib/keyMirror.js +3 -6
  159. package/lib/keyOf.js +4 -3
  160. package/lib/mapObject.js +1 -1
  161. package/lib/memoizeStringOnly.js +2 -2
  162. package/lib/onlyChild.js +2 -5
  163. package/lib/performance.js +2 -5
  164. package/lib/performanceNow.js +3 -1
  165. package/lib/quoteAttributeValueForBrowser.js +1 -1
  166. package/lib/renderSubtreeIntoContainer.js +16 -0
  167. package/lib/setInnerHTML.js +11 -8
  168. package/lib/setTextContent.js +3 -3
  169. package/lib/shallowCompare.js +24 -0
  170. package/lib/shallowEqual.js +17 -11
  171. package/lib/shouldUpdateReactComponent.js +3 -64
  172. package/lib/toArray.js +8 -19
  173. package/lib/traverseAllChildren.js +23 -90
  174. package/lib/update.js +25 -85
  175. package/lib/validateDOMNesting.js +363 -0
  176. package/lib/warning.js +15 -17
  177. package/package.json +3 -3
  178. package/react.js +53 -1
  179. package/lib/LocalEventTrapMixin.js +0 -53
  180. package/lib/MobileSafariClickEventPlugin.js +0 -56
  181. package/lib/ReactContext.js +0 -74
  182. package/lib/ReactDOMForm.js +0 -47
  183. package/lib/ReactDOMIframe.js +0 -43
  184. package/lib/ReactDOMImg.js +0 -44
  185. package/lib/ReactLifeCycle.js +0 -35
  186. package/lib/ReactPutListenerQueue.js +0 -54
  187. package/lib/createFullPageComponent.js +0 -58
  188. package/lib/cx.js +0 -52
  189. package/lib/getReactRootElementInContainer.js +0 -33
@@ -21,9 +21,9 @@
21
21
  var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
22
22
 
23
23
  var ServerReactRootIndex = {
24
- createReactRootIndex: function() {
24
+ createReactRootIndex: function () {
25
25
  return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
26
26
  }
27
27
  };
28
28
 
29
- module.exports = ServerReactRootIndex;
29
+ module.exports = ServerReactRootIndex;
@@ -12,8 +12,10 @@
12
12
  'use strict';
13
13
 
14
14
  var EventConstants = require("./EventConstants");
15
+ var EventListener = require("./EventListener");
15
16
  var EventPluginUtils = require("./EventPluginUtils");
16
17
  var EventPropagators = require("./EventPropagators");
18
+ var ReactMount = require("./ReactMount");
17
19
  var SyntheticClipboardEvent = require("./SyntheticClipboardEvent");
18
20
  var SyntheticEvent = require("./SyntheticEvent");
19
21
  var SyntheticFocusEvent = require("./SyntheticFocusEvent");
@@ -24,8 +26,8 @@ var SyntheticTouchEvent = require("./SyntheticTouchEvent");
24
26
  var SyntheticUIEvent = require("./SyntheticUIEvent");
25
27
  var SyntheticWheelEvent = require("./SyntheticWheelEvent");
26
28
 
29
+ var emptyFunction = require("./emptyFunction");
27
30
  var getEventCharCode = require("./getEventCharCode");
28
-
29
31
  var invariant = require("./invariant");
30
32
  var keyOf = require("./keyOf");
31
33
  var warning = require("./warning");
@@ -35,260 +37,263 @@ var topLevelTypes = EventConstants.topLevelTypes;
35
37
  var eventTypes = {
36
38
  blur: {
37
39
  phasedRegistrationNames: {
38
- bubbled: keyOf({onBlur: true}),
39
- captured: keyOf({onBlurCapture: true})
40
+ bubbled: keyOf({ onBlur: true }),
41
+ captured: keyOf({ onBlurCapture: true })
40
42
  }
41
43
  },
42
44
  click: {
43
45
  phasedRegistrationNames: {
44
- bubbled: keyOf({onClick: true}),
45
- captured: keyOf({onClickCapture: true})
46
+ bubbled: keyOf({ onClick: true }),
47
+ captured: keyOf({ onClickCapture: true })
46
48
  }
47
49
  },
48
50
  contextMenu: {
49
51
  phasedRegistrationNames: {
50
- bubbled: keyOf({onContextMenu: true}),
51
- captured: keyOf({onContextMenuCapture: true})
52
+ bubbled: keyOf({ onContextMenu: true }),
53
+ captured: keyOf({ onContextMenuCapture: true })
52
54
  }
53
55
  },
54
56
  copy: {
55
57
  phasedRegistrationNames: {
56
- bubbled: keyOf({onCopy: true}),
57
- captured: keyOf({onCopyCapture: true})
58
+ bubbled: keyOf({ onCopy: true }),
59
+ captured: keyOf({ onCopyCapture: true })
58
60
  }
59
61
  },
60
62
  cut: {
61
63
  phasedRegistrationNames: {
62
- bubbled: keyOf({onCut: true}),
63
- captured: keyOf({onCutCapture: true})
64
+ bubbled: keyOf({ onCut: true }),
65
+ captured: keyOf({ onCutCapture: true })
64
66
  }
65
67
  },
66
68
  doubleClick: {
67
69
  phasedRegistrationNames: {
68
- bubbled: keyOf({onDoubleClick: true}),
69
- captured: keyOf({onDoubleClickCapture: true})
70
+ bubbled: keyOf({ onDoubleClick: true }),
71
+ captured: keyOf({ onDoubleClickCapture: true })
70
72
  }
71
73
  },
72
74
  drag: {
73
75
  phasedRegistrationNames: {
74
- bubbled: keyOf({onDrag: true}),
75
- captured: keyOf({onDragCapture: true})
76
+ bubbled: keyOf({ onDrag: true }),
77
+ captured: keyOf({ onDragCapture: true })
76
78
  }
77
79
  },
78
80
  dragEnd: {
79
81
  phasedRegistrationNames: {
80
- bubbled: keyOf({onDragEnd: true}),
81
- captured: keyOf({onDragEndCapture: true})
82
+ bubbled: keyOf({ onDragEnd: true }),
83
+ captured: keyOf({ onDragEndCapture: true })
82
84
  }
83
85
  },
84
86
  dragEnter: {
85
87
  phasedRegistrationNames: {
86
- bubbled: keyOf({onDragEnter: true}),
87
- captured: keyOf({onDragEnterCapture: true})
88
+ bubbled: keyOf({ onDragEnter: true }),
89
+ captured: keyOf({ onDragEnterCapture: true })
88
90
  }
89
91
  },
90
92
  dragExit: {
91
93
  phasedRegistrationNames: {
92
- bubbled: keyOf({onDragExit: true}),
93
- captured: keyOf({onDragExitCapture: true})
94
+ bubbled: keyOf({ onDragExit: true }),
95
+ captured: keyOf({ onDragExitCapture: true })
94
96
  }
95
97
  },
96
98
  dragLeave: {
97
99
  phasedRegistrationNames: {
98
- bubbled: keyOf({onDragLeave: true}),
99
- captured: keyOf({onDragLeaveCapture: true})
100
+ bubbled: keyOf({ onDragLeave: true }),
101
+ captured: keyOf({ onDragLeaveCapture: true })
100
102
  }
101
103
  },
102
104
  dragOver: {
103
105
  phasedRegistrationNames: {
104
- bubbled: keyOf({onDragOver: true}),
105
- captured: keyOf({onDragOverCapture: true})
106
+ bubbled: keyOf({ onDragOver: true }),
107
+ captured: keyOf({ onDragOverCapture: true })
106
108
  }
107
109
  },
108
110
  dragStart: {
109
111
  phasedRegistrationNames: {
110
- bubbled: keyOf({onDragStart: true}),
111
- captured: keyOf({onDragStartCapture: true})
112
+ bubbled: keyOf({ onDragStart: true }),
113
+ captured: keyOf({ onDragStartCapture: true })
112
114
  }
113
115
  },
114
116
  drop: {
115
117
  phasedRegistrationNames: {
116
- bubbled: keyOf({onDrop: true}),
117
- captured: keyOf({onDropCapture: true})
118
+ bubbled: keyOf({ onDrop: true }),
119
+ captured: keyOf({ onDropCapture: true })
118
120
  }
119
121
  },
120
122
  focus: {
121
123
  phasedRegistrationNames: {
122
- bubbled: keyOf({onFocus: true}),
123
- captured: keyOf({onFocusCapture: true})
124
+ bubbled: keyOf({ onFocus: true }),
125
+ captured: keyOf({ onFocusCapture: true })
124
126
  }
125
127
  },
126
128
  input: {
127
129
  phasedRegistrationNames: {
128
- bubbled: keyOf({onInput: true}),
129
- captured: keyOf({onInputCapture: true})
130
+ bubbled: keyOf({ onInput: true }),
131
+ captured: keyOf({ onInputCapture: true })
130
132
  }
131
133
  },
132
134
  keyDown: {
133
135
  phasedRegistrationNames: {
134
- bubbled: keyOf({onKeyDown: true}),
135
- captured: keyOf({onKeyDownCapture: true})
136
+ bubbled: keyOf({ onKeyDown: true }),
137
+ captured: keyOf({ onKeyDownCapture: true })
136
138
  }
137
139
  },
138
140
  keyPress: {
139
141
  phasedRegistrationNames: {
140
- bubbled: keyOf({onKeyPress: true}),
141
- captured: keyOf({onKeyPressCapture: true})
142
+ bubbled: keyOf({ onKeyPress: true }),
143
+ captured: keyOf({ onKeyPressCapture: true })
142
144
  }
143
145
  },
144
146
  keyUp: {
145
147
  phasedRegistrationNames: {
146
- bubbled: keyOf({onKeyUp: true}),
147
- captured: keyOf({onKeyUpCapture: true})
148
+ bubbled: keyOf({ onKeyUp: true }),
149
+ captured: keyOf({ onKeyUpCapture: true })
148
150
  }
149
151
  },
150
152
  load: {
151
153
  phasedRegistrationNames: {
152
- bubbled: keyOf({onLoad: true}),
153
- captured: keyOf({onLoadCapture: true})
154
+ bubbled: keyOf({ onLoad: true }),
155
+ captured: keyOf({ onLoadCapture: true })
154
156
  }
155
157
  },
156
158
  error: {
157
159
  phasedRegistrationNames: {
158
- bubbled: keyOf({onError: true}),
159
- captured: keyOf({onErrorCapture: true})
160
+ bubbled: keyOf({ onError: true }),
161
+ captured: keyOf({ onErrorCapture: true })
160
162
  }
161
163
  },
162
164
  // Note: We do not allow listening to mouseOver events. Instead, use the
163
165
  // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
164
166
  mouseDown: {
165
167
  phasedRegistrationNames: {
166
- bubbled: keyOf({onMouseDown: true}),
167
- captured: keyOf({onMouseDownCapture: true})
168
+ bubbled: keyOf({ onMouseDown: true }),
169
+ captured: keyOf({ onMouseDownCapture: true })
168
170
  }
169
171
  },
170
172
  mouseMove: {
171
173
  phasedRegistrationNames: {
172
- bubbled: keyOf({onMouseMove: true}),
173
- captured: keyOf({onMouseMoveCapture: true})
174
+ bubbled: keyOf({ onMouseMove: true }),
175
+ captured: keyOf({ onMouseMoveCapture: true })
174
176
  }
175
177
  },
176
178
  mouseOut: {
177
179
  phasedRegistrationNames: {
178
- bubbled: keyOf({onMouseOut: true}),
179
- captured: keyOf({onMouseOutCapture: true})
180
+ bubbled: keyOf({ onMouseOut: true }),
181
+ captured: keyOf({ onMouseOutCapture: true })
180
182
  }
181
183
  },
182
184
  mouseOver: {
183
185
  phasedRegistrationNames: {
184
- bubbled: keyOf({onMouseOver: true}),
185
- captured: keyOf({onMouseOverCapture: true})
186
+ bubbled: keyOf({ onMouseOver: true }),
187
+ captured: keyOf({ onMouseOverCapture: true })
186
188
  }
187
189
  },
188
190
  mouseUp: {
189
191
  phasedRegistrationNames: {
190
- bubbled: keyOf({onMouseUp: true}),
191
- captured: keyOf({onMouseUpCapture: true})
192
+ bubbled: keyOf({ onMouseUp: true }),
193
+ captured: keyOf({ onMouseUpCapture: true })
192
194
  }
193
195
  },
194
196
  paste: {
195
197
  phasedRegistrationNames: {
196
- bubbled: keyOf({onPaste: true}),
197
- captured: keyOf({onPasteCapture: true})
198
+ bubbled: keyOf({ onPaste: true }),
199
+ captured: keyOf({ onPasteCapture: true })
198
200
  }
199
201
  },
200
202
  reset: {
201
203
  phasedRegistrationNames: {
202
- bubbled: keyOf({onReset: true}),
203
- captured: keyOf({onResetCapture: true})
204
+ bubbled: keyOf({ onReset: true }),
205
+ captured: keyOf({ onResetCapture: true })
204
206
  }
205
207
  },
206
208
  scroll: {
207
209
  phasedRegistrationNames: {
208
- bubbled: keyOf({onScroll: true}),
209
- captured: keyOf({onScrollCapture: true})
210
+ bubbled: keyOf({ onScroll: true }),
211
+ captured: keyOf({ onScrollCapture: true })
210
212
  }
211
213
  },
212
214
  submit: {
213
215
  phasedRegistrationNames: {
214
- bubbled: keyOf({onSubmit: true}),
215
- captured: keyOf({onSubmitCapture: true})
216
+ bubbled: keyOf({ onSubmit: true }),
217
+ captured: keyOf({ onSubmitCapture: true })
216
218
  }
217
219
  },
218
220
  touchCancel: {
219
221
  phasedRegistrationNames: {
220
- bubbled: keyOf({onTouchCancel: true}),
221
- captured: keyOf({onTouchCancelCapture: true})
222
+ bubbled: keyOf({ onTouchCancel: true }),
223
+ captured: keyOf({ onTouchCancelCapture: true })
222
224
  }
223
225
  },
224
226
  touchEnd: {
225
227
  phasedRegistrationNames: {
226
- bubbled: keyOf({onTouchEnd: true}),
227
- captured: keyOf({onTouchEndCapture: true})
228
+ bubbled: keyOf({ onTouchEnd: true }),
229
+ captured: keyOf({ onTouchEndCapture: true })
228
230
  }
229
231
  },
230
232
  touchMove: {
231
233
  phasedRegistrationNames: {
232
- bubbled: keyOf({onTouchMove: true}),
233
- captured: keyOf({onTouchMoveCapture: true})
234
+ bubbled: keyOf({ onTouchMove: true }),
235
+ captured: keyOf({ onTouchMoveCapture: true })
234
236
  }
235
237
  },
236
238
  touchStart: {
237
239
  phasedRegistrationNames: {
238
- bubbled: keyOf({onTouchStart: true}),
239
- captured: keyOf({onTouchStartCapture: true})
240
+ bubbled: keyOf({ onTouchStart: true }),
241
+ captured: keyOf({ onTouchStartCapture: true })
240
242
  }
241
243
  },
242
244
  wheel: {
243
245
  phasedRegistrationNames: {
244
- bubbled: keyOf({onWheel: true}),
245
- captured: keyOf({onWheelCapture: true})
246
+ bubbled: keyOf({ onWheel: true }),
247
+ captured: keyOf({ onWheelCapture: true })
246
248
  }
247
249
  }
248
250
  };
249
251
 
250
252
  var topLevelEventsToDispatchConfig = {
251
- topBlur: eventTypes.blur,
252
- topClick: eventTypes.click,
253
+ topBlur: eventTypes.blur,
254
+ topClick: eventTypes.click,
253
255
  topContextMenu: eventTypes.contextMenu,
254
- topCopy: eventTypes.copy,
255
- topCut: eventTypes.cut,
256
+ topCopy: eventTypes.copy,
257
+ topCut: eventTypes.cut,
256
258
  topDoubleClick: eventTypes.doubleClick,
257
- topDrag: eventTypes.drag,
258
- topDragEnd: eventTypes.dragEnd,
259
- topDragEnter: eventTypes.dragEnter,
260
- topDragExit: eventTypes.dragExit,
261
- topDragLeave: eventTypes.dragLeave,
262
- topDragOver: eventTypes.dragOver,
263
- topDragStart: eventTypes.dragStart,
264
- topDrop: eventTypes.drop,
265
- topError: eventTypes.error,
266
- topFocus: eventTypes.focus,
267
- topInput: eventTypes.input,
268
- topKeyDown: eventTypes.keyDown,
269
- topKeyPress: eventTypes.keyPress,
270
- topKeyUp: eventTypes.keyUp,
271
- topLoad: eventTypes.load,
272
- topMouseDown: eventTypes.mouseDown,
273
- topMouseMove: eventTypes.mouseMove,
274
- topMouseOut: eventTypes.mouseOut,
275
- topMouseOver: eventTypes.mouseOver,
276
- topMouseUp: eventTypes.mouseUp,
277
- topPaste: eventTypes.paste,
278
- topReset: eventTypes.reset,
279
- topScroll: eventTypes.scroll,
280
- topSubmit: eventTypes.submit,
259
+ topDrag: eventTypes.drag,
260
+ topDragEnd: eventTypes.dragEnd,
261
+ topDragEnter: eventTypes.dragEnter,
262
+ topDragExit: eventTypes.dragExit,
263
+ topDragLeave: eventTypes.dragLeave,
264
+ topDragOver: eventTypes.dragOver,
265
+ topDragStart: eventTypes.dragStart,
266
+ topDrop: eventTypes.drop,
267
+ topError: eventTypes.error,
268
+ topFocus: eventTypes.focus,
269
+ topInput: eventTypes.input,
270
+ topKeyDown: eventTypes.keyDown,
271
+ topKeyPress: eventTypes.keyPress,
272
+ topKeyUp: eventTypes.keyUp,
273
+ topLoad: eventTypes.load,
274
+ topMouseDown: eventTypes.mouseDown,
275
+ topMouseMove: eventTypes.mouseMove,
276
+ topMouseOut: eventTypes.mouseOut,
277
+ topMouseOver: eventTypes.mouseOver,
278
+ topMouseUp: eventTypes.mouseUp,
279
+ topPaste: eventTypes.paste,
280
+ topReset: eventTypes.reset,
281
+ topScroll: eventTypes.scroll,
282
+ topSubmit: eventTypes.submit,
281
283
  topTouchCancel: eventTypes.touchCancel,
282
- topTouchEnd: eventTypes.touchEnd,
283
- topTouchMove: eventTypes.touchMove,
284
- topTouchStart: eventTypes.touchStart,
285
- topWheel: eventTypes.wheel
284
+ topTouchEnd: eventTypes.touchEnd,
285
+ topTouchMove: eventTypes.touchMove,
286
+ topTouchStart: eventTypes.touchStart,
287
+ topWheel: eventTypes.wheel
286
288
  };
287
289
 
288
290
  for (var type in topLevelEventsToDispatchConfig) {
289
291
  topLevelEventsToDispatchConfig[type].dependencies = [type];
290
292
  }
291
293
 
294
+ var ON_CLICK_KEY = keyOf({ onClick: null });
295
+ var onClickListeners = {};
296
+
292
297
  var SimpleEventPlugin = {
293
298
 
294
299
  eventTypes: eventTypes,
@@ -297,19 +302,14 @@ var SimpleEventPlugin = {
297
302
  * Same as the default implementation, except cancels the event when return
298
303
  * value is false. This behavior will be disabled in a future release.
299
304
  *
300
- * @param {object} Event to be dispatched.
301
- * @param {function} Application-level callback.
305
+ * @param {object} event Event to be dispatched.
306
+ * @param {function} listener Application-level callback.
302
307
  * @param {string} domID DOM ID to pass to the callback.
303
308
  */
304
- executeDispatch: function(event, listener, domID) {
309
+ executeDispatch: function (event, listener, domID) {
305
310
  var returnValue = EventPluginUtils.executeDispatch(event, listener, domID);
306
311
 
307
- ("production" !== process.env.NODE_ENV ? warning(
308
- typeof returnValue !== 'boolean',
309
- 'Returning `false` from an event handler is deprecated and will be ' +
310
- 'ignored in a future release. Instead, manually call ' +
311
- 'e.stopPropagation() or e.preventDefault(), as appropriate.'
312
- ) : null);
312
+ 'production' !== process.env.NODE_ENV ? 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
313
 
314
314
  if (returnValue === false) {
315
315
  event.stopPropagation();
@@ -325,11 +325,7 @@ var SimpleEventPlugin = {
325
325
  * @return {*} An accumulation of synthetic events.
326
326
  * @see {EventPluginHub.extractEvents}
327
327
  */
328
- extractEvents: function(
329
- topLevelType,
330
- topLevelTarget,
331
- topLevelTargetID,
332
- nativeEvent) {
328
+ extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
333
329
  var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
334
330
  if (!dispatchConfig) {
335
331
  return null;
@@ -352,7 +348,7 @@ var SimpleEventPlugin = {
352
348
  if (getEventCharCode(nativeEvent) === 0) {
353
349
  return null;
354
350
  }
355
- /* falls through */
351
+ /* falls through */
356
352
  case topLevelTypes.topKeyDown:
357
353
  case topLevelTypes.topKeyUp:
358
354
  EventConstructor = SyntheticKeyboardEvent;
@@ -367,7 +363,7 @@ var SimpleEventPlugin = {
367
363
  if (nativeEvent.button === 2) {
368
364
  return null;
369
365
  }
370
- /* falls through */
366
+ /* falls through */
371
367
  case topLevelTypes.topContextMenu:
372
368
  case topLevelTypes.topDoubleClick:
373
369
  case topLevelTypes.topMouseDown:
@@ -405,20 +401,32 @@ var SimpleEventPlugin = {
405
401
  EventConstructor = SyntheticClipboardEvent;
406
402
  break;
407
403
  }
408
- ("production" !== process.env.NODE_ENV ? invariant(
409
- EventConstructor,
410
- 'SimpleEventPlugin: Unhandled event type, `%s`.',
411
- topLevelType
412
- ) : invariant(EventConstructor));
413
- var event = EventConstructor.getPooled(
414
- dispatchConfig,
415
- topLevelTargetID,
416
- nativeEvent
417
- );
404
+ !EventConstructor ? 'production' !== process.env.NODE_ENV ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined;
405
+ var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget);
418
406
  EventPropagators.accumulateTwoPhaseDispatches(event);
419
407
  return event;
408
+ },
409
+
410
+ didPutListener: function (id, registrationName, listener) {
411
+ // Mobile Safari does not fire properly bubble click events on
412
+ // non-interactive elements, which means delegated click listeners do not
413
+ // fire. The workaround for this bug involves attaching an empty click
414
+ // listener on the target node.
415
+ if (registrationName === ON_CLICK_KEY) {
416
+ var node = ReactMount.getNode(id);
417
+ if (!onClickListeners[id]) {
418
+ onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
419
+ }
420
+ }
421
+ },
422
+
423
+ willDeleteListener: function (id, registrationName) {
424
+ if (registrationName === ON_CLICK_KEY) {
425
+ onClickListeners[id].remove();
426
+ delete onClickListeners[id];
427
+ }
420
428
  }
421
429
 
422
430
  };
423
431
 
424
- module.exports = SimpleEventPlugin;
432
+ module.exports = SimpleEventPlugin;