react 0.14.0-beta1 → 0.14.0-beta2

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 (169) hide show
  1. package/addons.js +5 -2
  2. package/dist/JSXTransformer.js +588 -227
  3. package/dist/react-with-addons.js +3118 -2707
  4. package/dist/react-with-addons.min.js +6 -6
  5. package/dist/react.js +3713 -3317
  6. package/dist/react.min.js +6 -5
  7. package/lib/AutoFocusUtils.js +3 -3
  8. package/lib/BeforeInputEventPlugin.js +13 -13
  9. package/lib/CSSProperty.js +3 -0
  10. package/lib/CSSPropertyOperations.js +13 -13
  11. package/lib/CallbackQueue.js +4 -4
  12. package/lib/ChangeEventPlugin.js +12 -12
  13. package/lib/DOMChildrenOperations.js +10 -6
  14. package/lib/DOMProperty.js +8 -8
  15. package/lib/DOMPropertyOperations.js +9 -9
  16. package/lib/Danger.js +14 -14
  17. package/lib/DefaultEventPluginOrder.js +2 -2
  18. package/lib/EnterLeaveEventPlugin.js +5 -5
  19. package/lib/EventConstants.js +23 -1
  20. package/lib/EventPluginHub.js +11 -11
  21. package/lib/EventPluginRegistry.js +8 -8
  22. package/lib/EventPluginUtils.js +11 -11
  23. package/lib/EventPropagators.js +7 -7
  24. package/lib/FallbackCompositionState.js +3 -3
  25. package/lib/HTMLDOMPropertyConfig.js +4 -2
  26. package/lib/LinkedStateMixin.js +2 -2
  27. package/lib/LinkedValueUtils.js +8 -8
  28. package/lib/MetaMatchers.js +118 -0
  29. package/lib/OrderedMap.js +453 -0
  30. package/lib/PooledClass.js +2 -2
  31. package/lib/React.js +6 -6
  32. package/lib/ReactBrowserComponentMixin.js +4 -4
  33. package/lib/ReactBrowserEventEmitter.js +30 -7
  34. package/lib/ReactCSSTransitionGroup.js +16 -5
  35. package/lib/ReactCSSTransitionGroupChild.js +12 -11
  36. package/lib/ReactChildReconciler.js +25 -18
  37. package/lib/ReactChildren.js +6 -6
  38. package/lib/ReactClass.js +42 -42
  39. package/lib/ReactComponent.js +13 -13
  40. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  41. package/lib/ReactComponentEnvironment.js +2 -2
  42. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  43. package/lib/ReactCompositeComponent.js +38 -38
  44. package/lib/ReactDOM.js +72 -159
  45. package/lib/ReactDOMComponent.js +104 -60
  46. package/lib/ReactDOMFactories.js +177 -0
  47. package/lib/ReactDOMIDOperations.js +10 -24
  48. package/lib/ReactDOMInput.js +8 -8
  49. package/lib/ReactDOMOption.js +7 -7
  50. package/lib/ReactDOMSelect.js +8 -8
  51. package/lib/ReactDOMSelection.js +3 -3
  52. package/lib/ReactDOMServer.js +2 -2
  53. package/lib/ReactDOMTextComponent.js +11 -11
  54. package/lib/ReactDOMTextarea.js +11 -11
  55. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  56. package/lib/ReactDefaultInjection.js +24 -24
  57. package/lib/ReactDefaultPerf.js +7 -7
  58. package/lib/ReactDefaultPerfAnalysis.js +6 -9
  59. package/lib/ReactElement.js +4 -4
  60. package/lib/ReactElementValidator.js +21 -21
  61. package/lib/ReactEmptyComponent.js +4 -4
  62. package/lib/ReactEventEmitterMixin.js +1 -1
  63. package/lib/ReactEventListener.js +19 -14
  64. package/lib/ReactFragment.js +11 -11
  65. package/lib/ReactInjection.js +11 -11
  66. package/lib/ReactInputSelection.js +4 -4
  67. package/lib/ReactInstanceHandles.js +10 -11
  68. package/lib/ReactIsomorphic.js +11 -11
  69. package/lib/ReactLink.js +1 -1
  70. package/lib/ReactMarkupChecksum.js +6 -2
  71. package/lib/ReactMount.js +68 -48
  72. package/lib/ReactMultiChild.js +83 -22
  73. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  74. package/lib/ReactNativeComponent.js +3 -3
  75. package/lib/ReactNoopUpdateQueue.js +3 -3
  76. package/lib/ReactOwner.js +3 -3
  77. package/lib/ReactPerf.js +2 -2
  78. package/lib/ReactPropTransferer.js +3 -3
  79. package/lib/ReactPropTypeLocationNames.js +1 -1
  80. package/lib/ReactPropTypeLocations.js +1 -1
  81. package/lib/ReactPropTypes.js +34 -8
  82. package/lib/ReactReconcileTransaction.js +6 -6
  83. package/lib/ReactReconciler.js +12 -12
  84. package/lib/ReactRef.js +1 -1
  85. package/lib/ReactServerBatchingStrategy.js +5 -5
  86. package/lib/ReactServerRendering.js +12 -12
  87. package/lib/ReactServerRenderingTransaction.js +5 -5
  88. package/lib/ReactTestUtils.js +26 -27
  89. package/lib/ReactTransitionChildMapping.js +2 -2
  90. package/lib/ReactTransitionEvents.js +1 -1
  91. package/lib/ReactTransitionGroup.js +5 -6
  92. package/lib/ReactUpdateQueue.js +17 -17
  93. package/lib/ReactUpdates.js +14 -14
  94. package/lib/ReactWithAddons.js +14 -14
  95. package/lib/ResponderEventPlugin.js +514 -0
  96. package/lib/ResponderSyntheticEvent.js +40 -0
  97. package/lib/ResponderTouchHistoryStore.js +180 -0
  98. package/lib/SVGDOMPropertyConfig.js +1 -1
  99. package/lib/SelectEventPlugin.js +9 -9
  100. package/lib/SimpleEventPlugin.js +201 -25
  101. package/lib/SyntheticClipboardEvent.js +1 -1
  102. package/lib/SyntheticCompositionEvent.js +1 -1
  103. package/lib/SyntheticDragEvent.js +1 -1
  104. package/lib/SyntheticEvent.js +3 -3
  105. package/lib/SyntheticFocusEvent.js +1 -1
  106. package/lib/SyntheticInputEvent.js +1 -1
  107. package/lib/SyntheticKeyboardEvent.js +4 -4
  108. package/lib/SyntheticMouseEvent.js +3 -3
  109. package/lib/SyntheticTouchEvent.js +2 -2
  110. package/lib/SyntheticUIEvent.js +2 -2
  111. package/lib/SyntheticWheelEvent.js +1 -1
  112. package/lib/TapEventPlugin.js +119 -0
  113. package/lib/Transaction.js +6 -6
  114. package/lib/accumulate.js +44 -0
  115. package/lib/accumulateInto.js +2 -2
  116. package/lib/adler32.js +19 -7
  117. package/lib/cloneWithProps.js +11 -6
  118. package/lib/createHierarchyRenderer.js +85 -0
  119. package/lib/dangerousStyleValue.js +1 -1
  120. package/lib/deprecated.js +4 -4
  121. package/lib/findDOMNode.js +9 -9
  122. package/lib/flattenChildren.js +4 -4
  123. package/lib/getEventKey.js +1 -1
  124. package/lib/getTestDocument.js +28 -0
  125. package/lib/getTextContentAccessor.js +1 -1
  126. package/lib/instantiateReactComponent.js +12 -12
  127. package/lib/isEventSupported.js +1 -1
  128. package/lib/onlyChild.js +3 -3
  129. package/lib/quoteAttributeValueForBrowser.js +1 -1
  130. package/lib/reactComponentExpect.js +210 -0
  131. package/lib/renderSubtreeIntoContainer.js +1 -1
  132. package/lib/setInnerHTML.js +1 -1
  133. package/lib/setTextContent.js +3 -3
  134. package/lib/shallowCompare.js +1 -1
  135. package/lib/sliceChildren.js +51 -0
  136. package/lib/traverseAllChildren.js +14 -13
  137. package/lib/update.js +13 -13
  138. package/lib/validateDOMNesting.js +6 -6
  139. package/lib/webcomponents.js +6379 -0
  140. package/package.json +4 -6
  141. package/react.js +1 -1
  142. package/lib/CSSCore.js +0 -97
  143. package/lib/EventListener.js +0 -84
  144. package/lib/ExecutionEnvironment.js +0 -38
  145. package/lib/ReactDOMClient.js +0 -90
  146. package/lib/camelize.js +0 -32
  147. package/lib/camelizeStyleName.js +0 -40
  148. package/lib/containsNode.js +0 -55
  149. package/lib/createArrayFromMixed.js +0 -85
  150. package/lib/createNodesFromMarkup.js +0 -84
  151. package/lib/emptyFunction.js +0 -38
  152. package/lib/emptyObject.js +0 -20
  153. package/lib/focusNode.js +0 -26
  154. package/lib/getActiveElement.js +0 -29
  155. package/lib/getMarkupWrap.js +0 -93
  156. package/lib/getUnboundedScrollPosition.js +0 -38
  157. package/lib/hyphenate.js +0 -33
  158. package/lib/hyphenateStyleName.js +0 -39
  159. package/lib/invariant.js +0 -49
  160. package/lib/isNode.js +0 -23
  161. package/lib/isTextNode.js +0 -25
  162. package/lib/keyMirror.js +0 -48
  163. package/lib/keyOf.js +0 -35
  164. package/lib/mapObject.js +0 -51
  165. package/lib/performance.js +0 -23
  166. package/lib/performanceNow.js +0 -28
  167. package/lib/shallowEqual.js +0 -48
  168. package/lib/toArray.js +0 -57
  169. package/lib/warning.js +0 -57
@@ -11,9 +11,9 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactCurrentOwner = require("./ReactCurrentOwner");
14
+ var ReactCurrentOwner = require('./ReactCurrentOwner');
15
15
 
16
- var assign = require("./Object.assign");
16
+ var assign = require('./Object.assign');
17
17
 
18
18
  var RESERVED_PROPS = {
19
19
  key: true,
@@ -42,7 +42,7 @@ var ReactElement = function (type, key, ref, owner, props) {
42
42
 
43
43
  this.props = props;
44
44
 
45
- if ('production' !== process.env.NODE_ENV) {
45
+ if (process.env.NODE_ENV !== 'production') {
46
46
  // The validation flag is currently mutative. We put it on
47
47
  // an external backing store so that we can freeze the whole object.
48
48
  // This can be replaced with a WeakMap once they are implemented in
@@ -134,7 +134,7 @@ ReactElement.createFactory = function (type) {
134
134
  ReactElement.cloneAndReplaceProps = function (oldElement, newProps) {
135
135
  var newElement = new ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._owner, newProps);
136
136
 
137
- if ('production' !== process.env.NODE_ENV) {
137
+ if (process.env.NODE_ENV !== 'production') {
138
138
  // If the key on the original is valid, then the clone is valid
139
139
  newElement._store.validated = oldElement._store.validated;
140
140
  }
@@ -18,15 +18,15 @@
18
18
 
19
19
  'use strict';
20
20
 
21
- var ReactElement = require("./ReactElement");
22
- var ReactFragment = require("./ReactFragment");
23
- var ReactPropTypeLocations = require("./ReactPropTypeLocations");
24
- var ReactPropTypeLocationNames = require("./ReactPropTypeLocationNames");
25
- var ReactCurrentOwner = require("./ReactCurrentOwner");
21
+ var ReactElement = require('./ReactElement');
22
+ var ReactFragment = require('./ReactFragment');
23
+ var ReactPropTypeLocations = require('./ReactPropTypeLocations');
24
+ var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
25
+ var ReactCurrentOwner = require('./ReactCurrentOwner');
26
26
 
27
- var getIteratorFn = require("./getIteratorFn");
28
- var invariant = require("./invariant");
29
- var warning = require("./warning");
27
+ var getIteratorFn = require('./getIteratorFn');
28
+ var invariant = require('fbjs/lib/invariant');
29
+ var warning = require('fbjs/lib/warning');
30
30
 
31
31
  function getDeclarationErrorAddendum() {
32
32
  if (ReactCurrentOwner.current) {
@@ -99,7 +99,7 @@ function validateExplicitKey(element, parentType) {
99
99
  // we already showed the warning
100
100
  return;
101
101
  }
102
- 'production' !== process.env.NODE_ENV ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
102
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
103
103
  }
104
104
 
105
105
  /**
@@ -120,7 +120,7 @@ function validatePropertyKey(name, element, parentType) {
120
120
  // we already showed the warning
121
121
  return;
122
122
  }
123
- 'production' !== process.env.NODE_ENV ? warning(false, 'Child objects should have non-numeric keys so ordering is preserved.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
123
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Child objects should have non-numeric keys so ordering is preserved.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
124
124
  }
125
125
 
126
126
  /**
@@ -224,19 +224,19 @@ function checkPropTypes(componentName, propTypes, props, location) {
224
224
  try {
225
225
  // This is intentionally an invariant that gets caught. It's the same
226
226
  // behavior as without this statement except with a better message.
227
- !(typeof propTypes[propName] === 'function') ? 'production' !== process.env.NODE_ENV ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
227
+ !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
228
228
  error = propTypes[propName](props, propName, componentName, location);
229
229
  } catch (ex) {
230
230
  error = ex;
231
231
  }
232
- 'production' !== process.env.NODE_ENV ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined;
232
+ process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined;
233
233
  if (error instanceof Error && !(error.message in loggedTypeFailures)) {
234
234
  // Only monitor this failure once because there tends to be a lot of the
235
235
  // same error.
236
236
  loggedTypeFailures[error.message] = true;
237
237
 
238
238
  var addendum = getDeclarationErrorAddendum();
239
- 'production' !== process.env.NODE_ENV ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined;
239
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined;
240
240
  }
241
241
  }
242
242
  }
@@ -258,7 +258,7 @@ function validatePropTypes(element) {
258
258
  checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
259
259
  }
260
260
  if (typeof componentClass.getDefaultProps === 'function') {
261
- 'production' !== process.env.NODE_ENV ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined;
261
+ process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined;
262
262
  }
263
263
  }
264
264
 
@@ -267,7 +267,7 @@ var ReactElementValidator = {
267
267
  createElement: function (type, props, children) {
268
268
  // We warn in this case but don't throw. We expect the element creation to
269
269
  // succeed and there will likely be errors in render.
270
- 'production' !== process.env.NODE_ENV ? warning(typeof type === 'string' || typeof type === 'function', 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined;
270
+ process.env.NODE_ENV !== 'production' ? warning(typeof type === 'string' || typeof type === 'function', 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined;
271
271
 
272
272
  var element = ReactElement.createElement.apply(this, arguments);
273
273
 
@@ -291,19 +291,21 @@ var ReactElementValidator = {
291
291
  // Legacy hook TODO: Warn if this is accessed
292
292
  validatedFactory.type = type;
293
293
 
294
- if ('production' !== process.env.NODE_ENV) {
294
+ if (process.env.NODE_ENV !== 'production') {
295
295
  try {
296
296
  Object.defineProperty(validatedFactory, 'type', {
297
297
  enumerable: false,
298
298
  get: function () {
299
- 'production' !== process.env.NODE_ENV ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined;
299
+ process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined;
300
300
  Object.defineProperty(this, 'type', {
301
301
  value: type
302
302
  });
303
303
  return type;
304
304
  }
305
305
  });
306
- } catch (x) {}
306
+ } catch (x) {
307
+ // IE will fail on defineProperty (es5-shim/sham too)
308
+ }
307
309
  }
308
310
 
309
311
  return validatedFactory;
@@ -320,6 +322,4 @@ var ReactElementValidator = {
320
322
 
321
323
  };
322
324
 
323
- module.exports = ReactElementValidator;
324
-
325
- // IE will fail on defineProperty (es5-shim/sham too)
325
+ module.exports = ReactElementValidator;
@@ -11,10 +11,10 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactElement = require("./ReactElement");
15
- var ReactInstanceMap = require("./ReactInstanceMap");
14
+ var ReactElement = require('./ReactElement');
15
+ var ReactInstanceMap = require('./ReactInstanceMap');
16
16
 
17
- var invariant = require("./invariant");
17
+ var invariant = require('fbjs/lib/invariant');
18
18
 
19
19
  var component;
20
20
  // This registry keeps track of the React IDs of the components that rendered to
@@ -48,7 +48,7 @@ ReactEmptyComponentType.prototype.componentWillUnmount = function () {
48
48
  deregisterNullComponentID(internalInstance._rootNodeID);
49
49
  };
50
50
  ReactEmptyComponentType.prototype.render = function () {
51
- !component ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Trying to return null from a render, but no null placeholder component ' + 'was injected.') : invariant(false) : undefined;
51
+ !component ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to return null from a render, but no null placeholder component ' + 'was injected.') : invariant(false) : undefined;
52
52
  return component();
53
53
  };
54
54
 
@@ -11,7 +11,7 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var EventPluginHub = require("./EventPluginHub");
14
+ var EventPluginHub = require('./EventPluginHub');
15
15
 
16
16
  function runEventQueueInBatch(events) {
17
17
  EventPluginHub.enqueueEvents(events);
@@ -12,16 +12,16 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var EventListener = require("./EventListener");
16
- var ExecutionEnvironment = require("./ExecutionEnvironment");
17
- var PooledClass = require("./PooledClass");
18
- var ReactInstanceHandles = require("./ReactInstanceHandles");
19
- var ReactMount = require("./ReactMount");
20
- var ReactUpdates = require("./ReactUpdates");
15
+ var EventListener = require('fbjs/lib/EventListener');
16
+ var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
17
+ var PooledClass = require('./PooledClass');
18
+ var ReactInstanceHandles = require('./ReactInstanceHandles');
19
+ var ReactMount = require('./ReactMount');
20
+ var ReactUpdates = require('./ReactUpdates');
21
21
 
22
- var assign = require("./Object.assign");
23
- var getEventTarget = require("./getEventTarget");
24
- var getUnboundedScrollPosition = require("./getUnboundedScrollPosition");
22
+ var assign = require('./Object.assign');
23
+ var getEventTarget = require('./getEventTarget');
24
+ var getUnboundedScrollPosition = require('fbjs/lib/getUnboundedScrollPosition');
25
25
 
26
26
  var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
27
27
 
@@ -59,7 +59,7 @@ assign(TopLevelCallbackBookKeeping.prototype, {
59
59
  PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
60
60
 
61
61
  function handleTopLevelImpl(bookKeeping) {
62
- if (bookKeeping.nativeEvent.path) {
62
+ if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
63
63
  // New browsers have a path attribute on native events
64
64
  handleTopLevelWithPath(bookKeeping);
65
65
  } else {
@@ -93,27 +93,32 @@ function handleTopLevelWithoutPath(bookKeeping) {
93
93
  function handleTopLevelWithPath(bookKeeping) {
94
94
  var path = bookKeeping.nativeEvent.path;
95
95
  var currentNativeTarget = path[0];
96
+ var eventsFired = 0;
96
97
  for (var i = 0; i < path.length; i++) {
97
98
  var currentPathElement = path[i];
98
- var currentPathElemenId = ReactMount.getID(currentPathElement);
99
+ var currentPathElementID = ReactMount.getID(currentPathElement);
99
100
  if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
100
101
  currentNativeTarget = path[i + 1];
101
102
  }
102
103
  if (ReactMount.isRenderedByReact(currentPathElement)) {
103
- var newRootId = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElemenId);
104
+ var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
104
105
  bookKeeping.ancestors.push(currentPathElement);
105
106
 
106
107
  var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
108
+ eventsFired++;
107
109
  ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
108
110
 
109
111
  // Jump to the root of this React render tree
110
- while (currentPathElemenId !== newRootId) {
112
+ while (currentPathElementID !== newRootID) {
111
113
  i++;
112
114
  currentPathElement = path[i];
113
- currentPathElemenId = ReactMount.getID(currentPathElement);
115
+ currentPathElementID = ReactMount.getID(currentPathElement);
114
116
  }
115
117
  }
116
118
  }
119
+ if (eventsFired === 0) {
120
+ ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
121
+ }
117
122
  }
118
123
 
119
124
  function scrollValueMonitor(cb) {
@@ -11,9 +11,9 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactElement = require("./ReactElement");
14
+ var ReactElement = require('./ReactElement');
15
15
 
16
- var warning = require("./warning");
16
+ var warning = require('fbjs/lib/warning');
17
17
 
18
18
  /**
19
19
  * We used to allow keyed objects to serve as a collection of ReactElements,
@@ -27,7 +27,7 @@ var fragmentKey;
27
27
  var didWarnKey;
28
28
  var canWarnForReactFragment;
29
29
 
30
- if ('production' !== process.env.NODE_ENV) {
30
+ if (process.env.NODE_ENV !== 'production') {
31
31
  fragmentKey = '_reactFragment';
32
32
  didWarnKey = '_reactDidWarn';
33
33
 
@@ -52,12 +52,12 @@ if ('production' !== process.env.NODE_ENV) {
52
52
  Object.defineProperty(obj, key, {
53
53
  enumerable: true,
54
54
  get: function () {
55
- 'production' !== process.env.NODE_ENV ? warning(this[didWarnKey], 'A ReactFragment is an opaque type. Accessing any of its ' + 'properties is deprecated. Pass it to one of the React.Children ' + 'helpers.') : undefined;
55
+ process.env.NODE_ENV !== 'production' ? warning(this[didWarnKey], 'A ReactFragment is an opaque type. Accessing any of its ' + 'properties is deprecated. Pass it to one of the React.Children ' + 'helpers.') : undefined;
56
56
  this[didWarnKey] = true;
57
57
  return this[fragmentKey][key];
58
58
  },
59
59
  set: function (value) {
60
- 'production' !== process.env.NODE_ENV ? warning(this[didWarnKey], 'A ReactFragment is an immutable opaque type. Mutating its ' + 'properties is deprecated.') : undefined;
60
+ process.env.NODE_ENV !== 'production' ? warning(this[didWarnKey], 'A ReactFragment is an immutable opaque type. Mutating its ' + 'properties is deprecated.') : undefined;
61
61
  this[didWarnKey] = true;
62
62
  this[fragmentKey][key] = value;
63
63
  }
@@ -83,13 +83,13 @@ var ReactFragment = {
83
83
  // Wrap a keyed object in an opaque proxy that warns you if you access any
84
84
  // of its properties.
85
85
  create: function (object) {
86
- if ('production' !== process.env.NODE_ENV) {
86
+ if (process.env.NODE_ENV !== 'production') {
87
87
  if (typeof object !== 'object' || !object || Array.isArray(object)) {
88
- 'production' !== process.env.NODE_ENV ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : undefined;
88
+ process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : undefined;
89
89
  return object;
90
90
  }
91
91
  if (ReactElement.isValidElement(object)) {
92
- 'production' !== process.env.NODE_ENV ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : undefined;
92
+ process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : undefined;
93
93
  return object;
94
94
  }
95
95
  if (canWarnForReactFragment) {
@@ -115,10 +115,10 @@ var ReactFragment = {
115
115
  // Extract the original keyed object from the fragment opaque type. Warn if
116
116
  // a plain object is passed here.
117
117
  extract: function (fragment) {
118
- if ('production' !== process.env.NODE_ENV) {
118
+ if (process.env.NODE_ENV !== 'production') {
119
119
  if (canWarnForReactFragment) {
120
120
  if (!fragment[fragmentKey]) {
121
- 'production' !== process.env.NODE_ENV ? warning(didWarnForFragment(fragment), 'Any use of a keyed object should be wrapped in ' + 'React.addons.createFragment(object) before being passed as a ' + 'child.') : undefined;
121
+ process.env.NODE_ENV !== 'production' ? warning(didWarnForFragment(fragment), 'Any use of a keyed object should be wrapped in ' + 'React.addons.createFragment(object) before being passed as a ' + 'child.') : undefined;
122
122
  return fragment;
123
123
  }
124
124
  return fragment[fragmentKey];
@@ -130,7 +130,7 @@ var ReactFragment = {
130
130
  // is a fragment-like object, warn that it should be wrapped. Ignore if we
131
131
  // can't determine what kind of object this is.
132
132
  extractIfFragment: function (fragment) {
133
- if ('production' !== process.env.NODE_ENV) {
133
+ if (process.env.NODE_ENV !== 'production') {
134
134
  if (canWarnForReactFragment) {
135
135
  // If it is the opaque type, return the keyed object.
136
136
  if (fragment[fragmentKey]) {
@@ -11,17 +11,17 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var DOMProperty = require("./DOMProperty");
15
- var EventPluginHub = require("./EventPluginHub");
16
- var ReactComponentEnvironment = require("./ReactComponentEnvironment");
17
- var ReactClass = require("./ReactClass");
18
- var ReactEmptyComponent = require("./ReactEmptyComponent");
19
- var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
20
- var ReactNativeComponent = require("./ReactNativeComponent");
21
- var ReactDOMComponent = require("./ReactDOMComponent");
22
- var ReactPerf = require("./ReactPerf");
23
- var ReactRootIndex = require("./ReactRootIndex");
24
- var ReactUpdates = require("./ReactUpdates");
14
+ var DOMProperty = require('./DOMProperty');
15
+ var EventPluginHub = require('./EventPluginHub');
16
+ var ReactComponentEnvironment = require('./ReactComponentEnvironment');
17
+ var ReactClass = require('./ReactClass');
18
+ var ReactEmptyComponent = require('./ReactEmptyComponent');
19
+ var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
20
+ var ReactNativeComponent = require('./ReactNativeComponent');
21
+ var ReactDOMComponent = require('./ReactDOMComponent');
22
+ var ReactPerf = require('./ReactPerf');
23
+ var ReactRootIndex = require('./ReactRootIndex');
24
+ var ReactUpdates = require('./ReactUpdates');
25
25
 
26
26
  var ReactInjection = {
27
27
  Component: ReactComponentEnvironment.injection,
@@ -11,11 +11,11 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactDOMSelection = require("./ReactDOMSelection");
14
+ var ReactDOMSelection = require('./ReactDOMSelection');
15
15
 
16
- var containsNode = require("./containsNode");
17
- var focusNode = require("./focusNode");
18
- var getActiveElement = require("./getActiveElement");
16
+ var containsNode = require('fbjs/lib/containsNode');
17
+ var focusNode = require('fbjs/lib/focusNode');
18
+ var getActiveElement = require('fbjs/lib/getActiveElement');
19
19
 
20
20
  function isInDocument(node) {
21
21
  return containsNode(document.documentElement, node);
@@ -12,9 +12,9 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var ReactRootIndex = require("./ReactRootIndex");
15
+ var ReactRootIndex = require('./ReactRootIndex');
16
16
 
17
- var invariant = require("./invariant");
17
+ var invariant = require('fbjs/lib/invariant');
18
18
 
19
19
  var SEPARATOR = '.';
20
20
  var SEPARATOR_LENGTH = SEPARATOR.length;
@@ -91,8 +91,8 @@ function getParentID(id) {
91
91
  * @private
92
92
  */
93
93
  function getNextDescendantID(ancestorID, destinationID) {
94
- !(isValidID(ancestorID) && isValidID(destinationID)) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
95
- !isAncestorIDOf(ancestorID, destinationID) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
94
+ !(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
95
+ !isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
96
96
  if (ancestorID === destinationID) {
97
97
  return ancestorID;
98
98
  }
@@ -134,7 +134,7 @@ function getFirstCommonAncestorID(oneID, twoID) {
134
134
  }
135
135
  }
136
136
  var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
137
- !isValidID(longestCommonID) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
137
+ !isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
138
138
  return longestCommonID;
139
139
  }
140
140
 
@@ -154,13 +154,13 @@ function getFirstCommonAncestorID(oneID, twoID) {
154
154
  function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
155
155
  start = start || '';
156
156
  stop = stop || '';
157
- !(start !== stop) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
157
+ !(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
158
158
  var traverseUp = isAncestorIDOf(stop, start);
159
- !(traverseUp || isAncestorIDOf(start, stop)) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
159
+ !(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
160
160
  // Traverse from `start` to `stop` one depth at a time.
161
161
  var depth = 0;
162
162
  var traverse = traverseUp ? getParentID : getNextDescendantID;
163
- for (var id = start;; id = traverse(id, stop)) {
163
+ for (var id = start;; /* until break */id = traverse(id, stop)) {
164
164
  var ret;
165
165
  if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
166
166
  ret = cb(id, traverseUp, arg);
@@ -169,7 +169,7 @@ function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
169
169
  // Only break //after// visiting `stop`.
170
170
  break;
171
171
  }
172
- !(depth++ < MAX_TREE_DEPTH) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
172
+ !(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
173
173
  }
174
174
  }
175
175
 
@@ -299,5 +299,4 @@ var ReactInstanceHandles = {
299
299
 
300
300
  };
301
301
 
302
- module.exports = ReactInstanceHandles;
303
- /* until break */
302
+ module.exports = ReactInstanceHandles;
@@ -11,22 +11,22 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var ReactChildren = require("./ReactChildren");
15
- var ReactComponent = require("./ReactComponent");
16
- var ReactClass = require("./ReactClass");
17
- var ReactDOM = require("./ReactDOM");
18
- var ReactElement = require("./ReactElement");
19
- var ReactElementValidator = require("./ReactElementValidator");
20
- var ReactPropTypes = require("./ReactPropTypes");
14
+ var ReactChildren = require('./ReactChildren');
15
+ var ReactComponent = require('./ReactComponent');
16
+ var ReactClass = require('./ReactClass');
17
+ var ReactDOMFactories = require('./ReactDOMFactories');
18
+ var ReactElement = require('./ReactElement');
19
+ var ReactElementValidator = require('./ReactElementValidator');
20
+ var ReactPropTypes = require('./ReactPropTypes');
21
21
 
22
- var assign = require("./Object.assign");
23
- var onlyChild = require("./onlyChild");
22
+ var assign = require('./Object.assign');
23
+ var onlyChild = require('./onlyChild');
24
24
 
25
25
  var createElement = ReactElement.createElement;
26
26
  var createFactory = ReactElement.createFactory;
27
27
  var cloneElement = ReactElement.cloneElement;
28
28
 
29
- if ('production' !== process.env.NODE_ENV) {
29
+ if (process.env.NODE_ENV !== 'production') {
30
30
  createElement = ReactElementValidator.createElement;
31
31
  createFactory = ReactElementValidator.createFactory;
32
32
  cloneElement = ReactElementValidator.cloneElement;
@@ -61,7 +61,7 @@ var React = {
61
61
 
62
62
  // This looks DOM specific but these are actually isomorphic helpers
63
63
  // since they are just generating DOM strings.
64
- DOM: ReactDOM,
64
+ DOM: ReactDOMFactories,
65
65
 
66
66
  // Hook for JSX spread, don't use this for anything else.
67
67
  __spread: assign