react-rails 1.10.0 → 1.11.0

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.
@@ -347,8 +347,15 @@
347
347
  /* 4 */
348
348
  /***/ function(module, exports) {
349
349
 
350
+ /*
351
+ object-assign
352
+ (c) Sindre Sorhus
353
+ @license MIT
354
+ */
355
+
350
356
  'use strict';
351
357
  /* eslint-disable no-unused-vars */
358
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
352
359
  var hasOwnProperty = Object.prototype.hasOwnProperty;
353
360
  var propIsEnumerable = Object.prototype.propertyIsEnumerable;
354
361
 
@@ -369,7 +376,7 @@
369
376
  // Detect buggy property enumeration order in older V8 versions.
370
377
 
371
378
  // https://bugs.chromium.org/p/v8/issues/detail?id=4118
372
- var test1 = new String('abc'); // eslint-disable-line
379
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
373
380
  test1[5] = 'de';
374
381
  if (Object.getOwnPropertyNames(test1)[0] === '5') {
375
382
  return false;
@@ -398,7 +405,7 @@
398
405
  }
399
406
 
400
407
  return true;
401
- } catch (e) {
408
+ } catch (err) {
402
409
  // We don't expect any of the above to throw, but better to be safe.
403
410
  return false;
404
411
  }
@@ -418,8 +425,8 @@
418
425
  }
419
426
  }
420
427
 
421
- if (Object.getOwnPropertySymbols) {
422
- symbols = Object.getOwnPropertySymbols(from);
428
+ if (getOwnPropertySymbols) {
429
+ symbols = getOwnPropertySymbols(from);
423
430
  for (var i = 0; i < symbols.length; i++) {
424
431
  if (propIsEnumerable.call(from, symbols[i])) {
425
432
  to[symbols[i]] = from[symbols[i]];
@@ -699,17 +706,6 @@
699
706
  }
700
707
  };
701
708
 
702
- var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
703
- var Klass = this;
704
- if (Klass.instancePool.length) {
705
- var instance = Klass.instancePool.pop();
706
- Klass.call(instance, a1, a2, a3, a4, a5);
707
- return instance;
708
- } else {
709
- return new Klass(a1, a2, a3, a4, a5);
710
- }
711
- };
712
-
713
709
  var standardReleaser = function (instance) {
714
710
  var Klass = this;
715
711
  !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
@@ -749,8 +745,7 @@
749
745
  oneArgumentPooler: oneArgumentPooler,
750
746
  twoArgumentPooler: twoArgumentPooler,
751
747
  threeArgumentPooler: threeArgumentPooler,
752
- fourArgumentPooler: fourArgumentPooler,
753
- fiveArgumentPooler: fiveArgumentPooler
748
+ fourArgumentPooler: fourArgumentPooler
754
749
  };
755
750
 
756
751
  module.exports = PooledClass;
@@ -826,12 +821,18 @@
826
821
  * will remain to ensure logic does not differ in production.
827
822
  */
828
823
 
829
- function invariant(condition, format, a, b, c, d, e, f) {
830
- if (process.env.NODE_ENV !== 'production') {
824
+ var validateFormat = function validateFormat(format) {};
825
+
826
+ if (process.env.NODE_ENV !== 'production') {
827
+ validateFormat = function validateFormat(format) {
831
828
  if (format === undefined) {
832
829
  throw new Error('invariant requires an error message argument');
833
830
  }
834
- }
831
+ };
832
+ }
833
+
834
+ function invariant(condition, format, a, b, c, d, e, f) {
835
+ validateFormat(format);
835
836
 
836
837
  if (!condition) {
837
838
  var error;
@@ -3084,7 +3085,14 @@
3084
3085
  // We warn in this case but don't throw. We expect the element creation to
3085
3086
  // succeed and there will likely be errors in render.
3086
3087
  if (!validType) {
3087
- process.env.NODE_ENV !== 'production' ? warning(false, '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()) : void 0;
3088
+ if (typeof type !== 'function' && typeof type !== 'string') {
3089
+ var info = '';
3090
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
3091
+ info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
3092
+ }
3093
+ info += getDeclarationErrorAddendum();
3094
+ process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
3095
+ }
3088
3096
  }
3089
3097
 
3090
3098
  var element = ReactElement.createElement.apply(this, arguments);
@@ -4055,7 +4063,7 @@
4055
4063
 
4056
4064
  'use strict';
4057
4065
 
4058
- module.exports = '15.4.1';
4066
+ module.exports = '15.4.2';
4059
4067
 
4060
4068
  /***/ },
4061
4069
  /* 31 */
@@ -4253,6 +4261,13 @@
4253
4261
 
4254
4262
  var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
4255
4263
 
4264
+ /**
4265
+ * Check if a given node should be cached.
4266
+ */
4267
+ function shouldPrecacheNode(node, nodeID) {
4268
+ return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
4269
+ }
4270
+
4256
4271
  /**
4257
4272
  * Drill down (through composites and empty components) until we get a host or
4258
4273
  * host text component.
@@ -4318,7 +4333,7 @@
4318
4333
  }
4319
4334
  // We assume the child nodes are in the same order as the child instances.
4320
4335
  for (; childNode !== null; childNode = childNode.nextSibling) {
4321
- if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
4336
+ if (shouldPrecacheNode(childNode, childID)) {
4322
4337
  precacheNode(childInst, childNode);
4323
4338
  continue outer;
4324
4339
  }
@@ -6559,17 +6574,6 @@
6559
6574
  }
6560
6575
  };
6561
6576
 
6562
- var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
6563
- var Klass = this;
6564
- if (Klass.instancePool.length) {
6565
- var instance = Klass.instancePool.pop();
6566
- Klass.call(instance, a1, a2, a3, a4, a5);
6567
- return instance;
6568
- } else {
6569
- return new Klass(a1, a2, a3, a4, a5);
6570
- }
6571
- };
6572
-
6573
6577
  var standardReleaser = function (instance) {
6574
6578
  var Klass = this;
6575
6579
  !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
@@ -6609,8 +6613,7 @@
6609
6613
  oneArgumentPooler: oneArgumentPooler,
6610
6614
  twoArgumentPooler: twoArgumentPooler,
6611
6615
  threeArgumentPooler: threeArgumentPooler,
6612
- fourArgumentPooler: fourArgumentPooler,
6613
- fiveArgumentPooler: fiveArgumentPooler
6616
+ fourArgumentPooler: fourArgumentPooler
6614
6617
  };
6615
6618
 
6616
6619
  module.exports = PooledClass;
@@ -11428,12 +11431,18 @@
11428
11431
  } else {
11429
11432
  var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
11430
11433
  var childrenToUse = contentToUse != null ? null : props.children;
11434
+ // TODO: Validate that text is allowed as a child of this node
11431
11435
  if (contentToUse != null) {
11432
- // TODO: Validate that text is allowed as a child of this node
11433
- if (process.env.NODE_ENV !== 'production') {
11434
- setAndValidateContentChildDev.call(this, contentToUse);
11436
+ // Avoid setting textContent when the text is empty. In IE11 setting
11437
+ // textContent on a text area will cause the placeholder to not
11438
+ // show within the textarea until it has been focused and blurred again.
11439
+ // https://github.com/facebook/react/issues/6731#issuecomment-254874553
11440
+ if (contentToUse !== '') {
11441
+ if (process.env.NODE_ENV !== 'production') {
11442
+ setAndValidateContentChildDev.call(this, contentToUse);
11443
+ }
11444
+ DOMLazyTree.queueText(lazyTree, contentToUse);
11435
11445
  }
11436
- DOMLazyTree.queueText(lazyTree, contentToUse);
11437
11446
  } else if (childrenToUse != null) {
11438
11447
  var mountImages = this.mountChildren(childrenToUse, transaction, context);
11439
11448
  for (var i = 0; i < mountImages.length; i++) {
@@ -13353,7 +13362,17 @@
13353
13362
  }
13354
13363
  } else {
13355
13364
  if (props.value == null && props.defaultValue != null) {
13356
- node.defaultValue = '' + props.defaultValue;
13365
+ // In Chrome, assigning defaultValue to certain input types triggers input validation.
13366
+ // For number inputs, the display value loses trailing decimal points. For email inputs,
13367
+ // Chrome raises "The specified value <x> is not a valid email address".
13368
+ //
13369
+ // Here we check to see if the defaultValue has actually changed, avoiding these problems
13370
+ // when the user is inputting text
13371
+ //
13372
+ // https://github.com/facebook/react/issues/7253
13373
+ if (node.defaultValue !== '' + props.defaultValue) {
13374
+ node.defaultValue = '' + props.defaultValue;
13375
+ }
13357
13376
  }
13358
13377
  if (props.checked == null && props.defaultChecked != null) {
13359
13378
  node.defaultChecked = !!props.defaultChecked;
@@ -14100,9 +14119,15 @@
14100
14119
  // This is in postMount because we need access to the DOM node, which is not
14101
14120
  // available until after the component has mounted.
14102
14121
  var node = ReactDOMComponentTree.getNodeFromInstance(inst);
14122
+ var textContent = node.textContent;
14103
14123
 
14104
- // Warning: node.value may be the empty string at this point (IE11) if placeholder is set.
14105
- node.value = node.textContent; // Detach value from defaultValue
14124
+ // Only set node.value if textContent is equal to the expected
14125
+ // initial value. In IE10/IE11 there is a bug where the placeholder attribute
14126
+ // will populate textContent as well.
14127
+ // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
14128
+ if (textContent === inst._wrapperState.initialValue) {
14129
+ node.value = textContent;
14130
+ }
14106
14131
  }
14107
14132
  };
14108
14133
 
@@ -14904,7 +14929,17 @@
14904
14929
  instance = ReactEmptyComponent.create(instantiateReactComponent);
14905
14930
  } else if (typeof node === 'object') {
14906
14931
  var element = node;
14907
- !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;
14932
+ var type = element.type;
14933
+ if (typeof type !== 'function' && typeof type !== 'string') {
14934
+ var info = '';
14935
+ if (process.env.NODE_ENV !== 'production') {
14936
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
14937
+ info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
14938
+ }
14939
+ }
14940
+ info += getDeclarationErrorAddendum(element._owner);
14941
+ true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
14942
+ }
14908
14943
 
14909
14944
  // Special case string values
14910
14945
  if (typeof element.type === 'string') {
@@ -15194,7 +15229,7 @@
15194
15229
  // Since plain JS classes are defined without any special initialization
15195
15230
  // logic, we can not catch common errors early. Therefore, we have to
15196
15231
  // catch them here, at initialization time, instead.
15197
- process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
15232
+ process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
15198
15233
  process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
15199
15234
  process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
15200
15235
  process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
@@ -16198,14 +16233,11 @@
16198
16233
 
16199
16234
  'use strict';
16200
16235
 
16201
- var _prodInvariant = __webpack_require__(35),
16202
- _assign = __webpack_require__(4);
16236
+ var _prodInvariant = __webpack_require__(35);
16203
16237
 
16204
16238
  var invariant = __webpack_require__(8);
16205
16239
 
16206
16240
  var genericComponentClass = null;
16207
- // This registry keeps track of wrapper classes around host tags.
16208
- var tagToComponentClass = {};
16209
16241
  var textComponentClass = null;
16210
16242
 
16211
16243
  var ReactHostComponentInjection = {
@@ -16218,11 +16250,6 @@
16218
16250
  // rendered as props.
16219
16251
  injectTextComponentClass: function (componentClass) {
16220
16252
  textComponentClass = componentClass;
16221
- },
16222
- // This accepts a keyed object with classes as values. Each key represents a
16223
- // tag. That particular tag will use this class instead of the generic one.
16224
- injectComponentClasses: function (componentClasses) {
16225
- _assign(tagToComponentClass, componentClasses);
16226
16253
  }
16227
16254
  };
16228
16255
 
@@ -18262,10 +18289,10 @@
18262
18289
  */
18263
18290
 
18264
18291
  function getUnboundedScrollPosition(scrollable) {
18265
- if (scrollable === window) {
18292
+ if (scrollable.Window && scrollable instanceof scrollable.Window) {
18266
18293
  return {
18267
- x: window.pageXOffset || document.documentElement.scrollLeft,
18268
- y: window.pageYOffset || document.documentElement.scrollTop
18294
+ x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft,
18295
+ y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop
18269
18296
  };
18270
18297
  }
18271
18298
  return {
@@ -19014,7 +19041,9 @@
19014
19041
  * @return {boolean} Whether or not the object is a DOM node.
19015
19042
  */
19016
19043
  function isNode(object) {
19017
- return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
19044
+ var doc = object ? object.ownerDocument || object : document;
19045
+ var defaultView = doc.defaultView || window;
19046
+ return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
19018
19047
  }
19019
19048
 
19020
19049
  module.exports = isNode;
@@ -19044,15 +19073,19 @@
19044
19073
  *
19045
19074
  * The activeElement will be null only if the document or document body is not
19046
19075
  * yet defined.
19076
+ *
19077
+ * @param {?DOMDocument} doc Defaults to current document.
19078
+ * @return {?DOMElement}
19047
19079
  */
19048
- function getActiveElement() /*?DOMElement*/{
19049
- if (typeof document === 'undefined') {
19080
+ function getActiveElement(doc) /*?DOMElement*/{
19081
+ doc = doc || (typeof document !== 'undefined' ? document : undefined);
19082
+ if (typeof doc === 'undefined') {
19050
19083
  return null;
19051
19084
  }
19052
19085
  try {
19053
- return document.activeElement || document.body;
19086
+ return doc.activeElement || doc.body;
19054
19087
  } catch (e) {
19055
- return document.body;
19088
+ return doc.body;
19056
19089
  }
19057
19090
  }
19058
19091
 
@@ -21077,7 +21110,7 @@
21077
21110
 
21078
21111
  'use strict';
21079
21112
 
21080
- module.exports = '15.4.1';
21113
+ module.exports = '15.4.2';
21081
21114
 
21082
21115
  /***/ },
21083
21116
  /* 172 */
@@ -21467,15 +21500,15 @@
21467
21500
 
21468
21501
  /* WEBPACK VAR INJECTION */(function(process) {var addons = {};
21469
21502
  addons.TransitionGroup = __webpack_require__(179);
21470
- addons.CSSTransitionGroup = __webpack_require__(188);
21503
+ addons.CSSTransitionGroup = __webpack_require__(183);
21471
21504
  addons.LinkedStateMixin = __webpack_require__(193);
21472
- addons.createFragment = __webpack_require__(197);
21473
- addons.update = __webpack_require__(199);
21474
- addons.PureRenderMixin = __webpack_require__(201);
21505
+ addons.createFragment = __webpack_require__(194);
21506
+ addons.update = __webpack_require__(195);
21507
+ addons.PureRenderMixin = __webpack_require__(196);
21475
21508
 
21476
21509
  if (process.env.NODE_ENV !== "production") {
21477
- addons.TestUtils = __webpack_require__(204);
21478
- addons.Perf = __webpack_require__(205);
21510
+ addons.TestUtils = __webpack_require__(197);
21511
+ addons.Perf = __webpack_require__(198);
21479
21512
  }
21480
21513
 
21481
21514
  module.exports = addons;
@@ -21492,7 +21525,7 @@
21492
21525
  /* 180 */
21493
21526
  /***/ function(module, exports, __webpack_require__) {
21494
21527
 
21495
- /* WEBPACK VAR INJECTION */(function(process) {/**
21528
+ /**
21496
21529
  * Copyright 2013-present, Facebook, Inc.
21497
21530
  * All rights reserved.
21498
21531
  *
@@ -21513,8 +21546,7 @@
21513
21546
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
21514
21547
 
21515
21548
  var React = __webpack_require__(2);
21516
- var ReactAddonsDOMDependencies = __webpack_require__(181);
21517
- var ReactTransitionChildMapping = __webpack_require__(186);
21549
+ var ReactTransitionChildMapping = __webpack_require__(181);
21518
21550
 
21519
21551
  var emptyFunction = __webpack_require__(12);
21520
21552
 
@@ -21557,12 +21589,7 @@
21557
21589
 
21558
21590
  delete _this.currentlyTransitioningKeys[key];
21559
21591
 
21560
- var currentChildMapping;
21561
- if (process.env.NODE_ENV !== 'production') {
21562
- currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
21563
- } else {
21564
- currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
21565
- }
21592
+ var currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
21566
21593
 
21567
21594
  if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
21568
21595
  // This was removed before it had fully appeared. Remove it.
@@ -21586,12 +21613,7 @@
21586
21613
 
21587
21614
  delete _this.currentlyTransitioningKeys[key];
21588
21615
 
21589
- var currentChildMapping;
21590
- if (process.env.NODE_ENV !== 'production') {
21591
- currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
21592
- } else {
21593
- currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
21594
- }
21616
+ var currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
21595
21617
 
21596
21618
  if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
21597
21619
  // This was removed before it had fully entered. Remove it.
@@ -21618,12 +21640,7 @@
21618
21640
 
21619
21641
  delete _this.currentlyTransitioningKeys[key];
21620
21642
 
21621
- var currentChildMapping;
21622
- if (process.env.NODE_ENV !== 'production') {
21623
- currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
21624
- } else {
21625
- currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
21626
- }
21643
+ var currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
21627
21644
 
21628
21645
  if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
21629
21646
  // This entered again before it fully left. Add it again.
@@ -21654,12 +21671,7 @@
21654
21671
  };
21655
21672
 
21656
21673
  ReactTransitionGroup.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
21657
- var nextChildMapping;
21658
- if (process.env.NODE_ENV !== 'production') {
21659
- nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(this)._debugID);
21660
- } else {
21661
- nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
21662
- }
21674
+ var nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
21663
21675
  var prevChildMapping = this.state.children;
21664
21676
 
21665
21677
  this.setState({
@@ -21741,7 +21753,6 @@
21741
21753
 
21742
21754
 
21743
21755
  module.exports = ReactTransitionGroup;
21744
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
21745
21756
 
21746
21757
  /***/ },
21747
21758
  /* 181 */
@@ -21759,29 +21770,96 @@
21759
21770
 
21760
21771
  'use strict';
21761
21772
 
21762
- var ReactDOM = __webpack_require__(33);
21763
- var ReactInstanceMap = __webpack_require__(116);
21773
+ var flattenChildren = __webpack_require__(182);
21764
21774
 
21765
- exports.getReactDOM = function () {
21766
- return ReactDOM;
21767
- };
21775
+ var ReactTransitionChildMapping = {
21776
+ /**
21777
+ * Given `this.props.children`, return an object mapping key to child. Just
21778
+ * simple syntactic sugar around flattenChildren().
21779
+ *
21780
+ * @param {*} children `this.props.children`
21781
+ * @param {number=} selfDebugID Optional debugID of the current internal instance.
21782
+ * @return {object} Mapping of key to child
21783
+ */
21784
+ getChildMapping: function (children, selfDebugID) {
21785
+ if (!children) {
21786
+ return children;
21787
+ }
21768
21788
 
21769
- exports.getReactInstanceMap = function () {
21770
- return ReactInstanceMap;
21771
- };
21789
+ if (process.env.NODE_ENV !== 'production') {
21790
+ return flattenChildren(children, selfDebugID);
21791
+ }
21772
21792
 
21773
- if (process.env.NODE_ENV !== 'production') {
21774
- var ReactPerf = __webpack_require__(182);
21775
- var ReactTestUtils = __webpack_require__(183);
21793
+ return flattenChildren(children);
21794
+ },
21776
21795
 
21777
- exports.getReactPerf = function () {
21778
- return ReactPerf;
21779
- };
21796
+ /**
21797
+ * When you're adding or removing children some may be added or removed in the
21798
+ * same render pass. We want to show *both* since we want to simultaneously
21799
+ * animate elements in and out. This function takes a previous set of keys
21800
+ * and a new set of keys and merges them with its best guess of the correct
21801
+ * ordering. In the future we may expose some of the utilities in
21802
+ * ReactMultiChild to make this easy, but for now React itself does not
21803
+ * directly have this concept of the union of prevChildren and nextChildren
21804
+ * so we implement it here.
21805
+ *
21806
+ * @param {object} prev prev children as returned from
21807
+ * `ReactTransitionChildMapping.getChildMapping()`.
21808
+ * @param {object} next next children as returned from
21809
+ * `ReactTransitionChildMapping.getChildMapping()`.
21810
+ * @return {object} a key set that contains all keys in `prev` and all keys
21811
+ * in `next` in a reasonable order.
21812
+ */
21813
+ mergeChildMappings: function (prev, next) {
21814
+ prev = prev || {};
21815
+ next = next || {};
21780
21816
 
21781
- exports.getReactTestUtils = function () {
21782
- return ReactTestUtils;
21783
- };
21784
- }
21817
+ function getValueForKey(key) {
21818
+ if (next.hasOwnProperty(key)) {
21819
+ return next[key];
21820
+ } else {
21821
+ return prev[key];
21822
+ }
21823
+ }
21824
+
21825
+ // For each key of `next`, the list of keys to insert before that key in
21826
+ // the combined list
21827
+ var nextKeysPending = {};
21828
+
21829
+ var pendingKeys = [];
21830
+ for (var prevKey in prev) {
21831
+ if (next.hasOwnProperty(prevKey)) {
21832
+ if (pendingKeys.length) {
21833
+ nextKeysPending[prevKey] = pendingKeys;
21834
+ pendingKeys = [];
21835
+ }
21836
+ } else {
21837
+ pendingKeys.push(prevKey);
21838
+ }
21839
+ }
21840
+
21841
+ var i;
21842
+ var childMapping = {};
21843
+ for (var nextKey in next) {
21844
+ if (nextKeysPending.hasOwnProperty(nextKey)) {
21845
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
21846
+ var pendingNextKey = nextKeysPending[nextKey][i];
21847
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
21848
+ }
21849
+ }
21850
+ childMapping[nextKey] = getValueForKey(nextKey);
21851
+ }
21852
+
21853
+ // Finally, add the keys which didn't appear before any key in `next`
21854
+ for (i = 0; i < pendingKeys.length; i++) {
21855
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
21856
+ }
21857
+
21858
+ return childMapping;
21859
+ }
21860
+ };
21861
+
21862
+ module.exports = ReactTransitionChildMapping;
21785
21863
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
21786
21864
 
21787
21865
  /***/ },
@@ -21789,7 +21867,7 @@
21789
21867
  /***/ function(module, exports, __webpack_require__) {
21790
21868
 
21791
21869
  /* WEBPACK VAR INJECTION */(function(process) {/**
21792
- * Copyright 2016-present, Facebook, Inc.
21870
+ * Copyright 2013-present, Facebook, Inc.
21793
21871
  * All rights reserved.
21794
21872
  *
21795
21873
  * This source code is licensed under the BSD-style license found in the
@@ -21801,1010 +21879,906 @@
21801
21879
 
21802
21880
  'use strict';
21803
21881
 
21804
- var _assign = __webpack_require__(4);
21805
-
21806
- var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
21807
-
21808
- var ReactDebugTool = __webpack_require__(63);
21882
+ var KeyEscapeUtils = __webpack_require__(17);
21883
+ var traverseAllChildren = __webpack_require__(15);
21809
21884
  var warning = __webpack_require__(11);
21810
- var alreadyWarned = false;
21811
21885
 
21812
- function roundFloat(val) {
21813
- var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
21814
-
21815
- var n = Math.pow(10, base);
21816
- return Math.floor(val * n) / n;
21817
- }
21886
+ var ReactComponentTreeHook;
21818
21887
 
21819
- // Flow type definition of console.table is too strict right now, see
21820
- // https://github.com/facebook/flow/pull/2353 for updates
21821
- function consoleTable(table) {
21822
- console.table(table);
21888
+ if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
21889
+ // Temporary hack.
21890
+ // Inline requires don't work well with Jest:
21891
+ // https://github.com/facebook/react/issues/7240
21892
+ // Remove the inline requires when we don't need them anymore:
21893
+ // https://github.com/facebook/react/pull/7178
21894
+ ReactComponentTreeHook = __webpack_require__(26);
21823
21895
  }
21824
21896
 
21825
- function warnInProduction() {
21826
- if (alreadyWarned) {
21827
- return;
21828
- }
21829
- alreadyWarned = true;
21830
- if (typeof console !== 'undefined') {
21831
- console.error('ReactPerf is not supported in the production builds of React. ' + 'To collect measurements, please use the development build of React instead.');
21897
+ /**
21898
+ * @param {function} traverseContext Context passed through traversal.
21899
+ * @param {?ReactComponent} child React child component.
21900
+ * @param {!string} name String name of key path to child.
21901
+ * @param {number=} selfDebugID Optional debugID of the current internal instance.
21902
+ */
21903
+ function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
21904
+ // We found a component instance.
21905
+ if (traverseContext && typeof traverseContext === 'object') {
21906
+ var result = traverseContext;
21907
+ var keyUnique = result[name] === undefined;
21908
+ if (process.env.NODE_ENV !== 'production') {
21909
+ if (!ReactComponentTreeHook) {
21910
+ ReactComponentTreeHook = __webpack_require__(26);
21911
+ }
21912
+ if (!keyUnique) {
21913
+ process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
21914
+ }
21915
+ }
21916
+ if (keyUnique && child != null) {
21917
+ result[name] = child;
21918
+ }
21832
21919
  }
21833
21920
  }
21834
21921
 
21835
- function getLastMeasurements() {
21836
- if (!(process.env.NODE_ENV !== 'production')) {
21837
- warnInProduction();
21838
- return [];
21922
+ /**
21923
+ * Flattens children that are typically specified as `props.children`. Any null
21924
+ * children will not be included in the resulting object.
21925
+ * @return {!object} flattened children keyed by name.
21926
+ */
21927
+ function flattenChildren(children, selfDebugID) {
21928
+ if (children == null) {
21929
+ return children;
21839
21930
  }
21931
+ var result = {};
21840
21932
 
21841
- return ReactDebugTool.getFlushHistory();
21933
+ if (process.env.NODE_ENV !== 'production') {
21934
+ traverseAllChildren(children, function (traverseContext, child, name) {
21935
+ return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
21936
+ }, result);
21937
+ } else {
21938
+ traverseAllChildren(children, flattenSingleChildIntoContext, result);
21939
+ }
21940
+ return result;
21842
21941
  }
21843
21942
 
21844
- function getExclusive() {
21845
- var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
21943
+ module.exports = flattenChildren;
21944
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
21846
21945
 
21847
- if (!(process.env.NODE_ENV !== 'production')) {
21848
- warnInProduction();
21849
- return [];
21850
- }
21946
+ /***/ },
21947
+ /* 183 */
21948
+ /***/ function(module, exports, __webpack_require__) {
21851
21949
 
21852
- var aggregatedStats = {};
21853
- var affectedIDs = {};
21950
+ module.exports = __webpack_require__(184);
21854
21951
 
21855
- function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
21856
- var displayName = treeSnapshot[instanceID].displayName;
21952
+ /***/ },
21953
+ /* 184 */
21954
+ /***/ function(module, exports, __webpack_require__) {
21857
21955
 
21858
- var key = displayName;
21859
- var stats = aggregatedStats[key];
21860
- if (!stats) {
21861
- affectedIDs[key] = {};
21862
- stats = aggregatedStats[key] = {
21863
- key: key,
21864
- instanceCount: 0,
21865
- counts: {},
21866
- durations: {},
21867
- totalDuration: 0
21868
- };
21869
- }
21870
- if (!stats.durations[timerType]) {
21871
- stats.durations[timerType] = 0;
21872
- }
21873
- if (!stats.counts[timerType]) {
21874
- stats.counts[timerType] = 0;
21875
- }
21876
- affectedIDs[key][instanceID] = true;
21877
- applyUpdate(stats);
21878
- }
21956
+ /**
21957
+ * Copyright 2013-present, Facebook, Inc.
21958
+ * All rights reserved.
21959
+ *
21960
+ * This source code is licensed under the BSD-style license found in the
21961
+ * LICENSE file in the root directory of this source tree. An additional grant
21962
+ * of patent rights can be found in the PATENTS file in the same directory.
21963
+ *
21964
+ */
21879
21965
 
21880
- flushHistory.forEach(function (flush) {
21881
- var measurements = flush.measurements,
21882
- treeSnapshot = flush.treeSnapshot;
21966
+ 'use strict';
21883
21967
 
21884
- measurements.forEach(function (measurement) {
21885
- var duration = measurement.duration,
21886
- instanceID = measurement.instanceID,
21887
- timerType = measurement.timerType;
21968
+ var _assign = __webpack_require__(4);
21888
21969
 
21889
- updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
21890
- stats.totalDuration += duration;
21891
- stats.durations[timerType] += duration;
21892
- stats.counts[timerType]++;
21893
- });
21894
- });
21895
- });
21970
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21896
21971
 
21897
- return Object.keys(aggregatedStats).map(function (key) {
21898
- return _extends({}, aggregatedStats[key], {
21899
- instanceCount: Object.keys(affectedIDs[key]).length
21900
- });
21901
- }).sort(function (a, b) {
21902
- return b.totalDuration - a.totalDuration;
21903
- });
21904
- }
21972
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
21905
21973
 
21906
- function getInclusive() {
21907
- var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
21974
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
21908
21975
 
21909
- if (!(process.env.NODE_ENV !== 'production')) {
21910
- warnInProduction();
21911
- return [];
21912
- }
21976
+ var React = __webpack_require__(2);
21913
21977
 
21914
- var aggregatedStats = {};
21915
- var affectedIDs = {};
21978
+ var ReactTransitionGroup = __webpack_require__(180);
21979
+ var ReactCSSTransitionGroupChild = __webpack_require__(185);
21916
21980
 
21917
- function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
21918
- var _treeSnapshot$instanc = treeSnapshot[instanceID],
21919
- displayName = _treeSnapshot$instanc.displayName,
21920
- ownerID = _treeSnapshot$instanc.ownerID;
21981
+ function createTransitionTimeoutPropValidator(transitionType) {
21982
+ var timeoutPropName = 'transition' + transitionType + 'Timeout';
21983
+ var enabledPropName = 'transition' + transitionType;
21921
21984
 
21922
- var owner = treeSnapshot[ownerID];
21923
- var key = (owner ? owner.displayName + ' > ' : '') + displayName;
21924
- var stats = aggregatedStats[key];
21925
- if (!stats) {
21926
- affectedIDs[key] = {};
21927
- stats = aggregatedStats[key] = {
21928
- key: key,
21929
- instanceCount: 0,
21930
- inclusiveRenderDuration: 0,
21931
- renderCount: 0
21932
- };
21985
+ return function (props) {
21986
+ // If the transition is enabled
21987
+ if (props[enabledPropName]) {
21988
+ // If no timeout duration is provided
21989
+ if (props[timeoutPropName] == null) {
21990
+ return new Error(timeoutPropName + ' wasn\'t supplied to ReactCSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.');
21991
+
21992
+ // If the duration isn't a number
21993
+ } else if (typeof props[timeoutPropName] !== 'number') {
21994
+ return new Error(timeoutPropName + ' must be a number (in milliseconds)');
21995
+ }
21933
21996
  }
21934
- affectedIDs[key][instanceID] = true;
21935
- applyUpdate(stats);
21936
- }
21997
+ };
21998
+ }
21937
21999
 
21938
- var isCompositeByID = {};
21939
- flushHistory.forEach(function (flush) {
21940
- var measurements = flush.measurements;
22000
+ /**
22001
+ * An easy way to perform CSS transitions and animations when a React component
22002
+ * enters or leaves the DOM.
22003
+ * See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
22004
+ */
21941
22005
 
21942
- measurements.forEach(function (measurement) {
21943
- var instanceID = measurement.instanceID,
21944
- timerType = measurement.timerType;
22006
+ var ReactCSSTransitionGroup = function (_React$Component) {
22007
+ _inherits(ReactCSSTransitionGroup, _React$Component);
21945
22008
 
21946
- if (timerType !== 'render') {
21947
- return;
21948
- }
21949
- isCompositeByID[instanceID] = true;
21950
- });
21951
- });
22009
+ function ReactCSSTransitionGroup() {
22010
+ var _temp, _this, _ret;
21952
22011
 
21953
- flushHistory.forEach(function (flush) {
21954
- var measurements = flush.measurements,
21955
- treeSnapshot = flush.treeSnapshot;
22012
+ _classCallCheck(this, ReactCSSTransitionGroup);
21956
22013
 
21957
- measurements.forEach(function (measurement) {
21958
- var duration = measurement.duration,
21959
- instanceID = measurement.instanceID,
21960
- timerType = measurement.timerType;
22014
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
22015
+ args[_key] = arguments[_key];
22016
+ }
21961
22017
 
21962
- if (timerType !== 'render') {
21963
- return;
21964
- }
21965
- updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
21966
- stats.renderCount++;
21967
- });
21968
- var nextParentID = instanceID;
21969
- while (nextParentID) {
21970
- // As we traverse parents, only count inclusive time towards composites.
21971
- // We know something is a composite if its render() was called.
21972
- if (isCompositeByID[nextParentID]) {
21973
- updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
21974
- stats.inclusiveRenderDuration += duration;
21975
- });
21976
- }
21977
- nextParentID = treeSnapshot[nextParentID].parentID;
21978
- }
21979
- });
21980
- });
22018
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this._wrapChild = function (child) {
22019
+ // We need to provide this childFactory so that
22020
+ // ReactCSSTransitionGroupChild can receive updates to name, enter, and
22021
+ // leave while it is leaving.
22022
+ return React.createElement(ReactCSSTransitionGroupChild, {
22023
+ name: _this.props.transitionName,
22024
+ appear: _this.props.transitionAppear,
22025
+ enter: _this.props.transitionEnter,
22026
+ leave: _this.props.transitionLeave,
22027
+ appearTimeout: _this.props.transitionAppearTimeout,
22028
+ enterTimeout: _this.props.transitionEnterTimeout,
22029
+ leaveTimeout: _this.props.transitionLeaveTimeout
22030
+ }, child);
22031
+ }, _temp), _possibleConstructorReturn(_this, _ret);
22032
+ }
21981
22033
 
21982
- return Object.keys(aggregatedStats).map(function (key) {
21983
- return _extends({}, aggregatedStats[key], {
21984
- instanceCount: Object.keys(affectedIDs[key]).length
21985
- });
21986
- }).sort(function (a, b) {
21987
- return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
21988
- });
21989
- }
22034
+ ReactCSSTransitionGroup.prototype.render = function render() {
22035
+ return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
22036
+ };
21990
22037
 
21991
- function getWasted() {
21992
- var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
22038
+ return ReactCSSTransitionGroup;
22039
+ }(React.Component);
21993
22040
 
21994
- if (!(process.env.NODE_ENV !== 'production')) {
21995
- warnInProduction();
21996
- return [];
21997
- }
22041
+ ReactCSSTransitionGroup.displayName = 'ReactCSSTransitionGroup';
22042
+ ReactCSSTransitionGroup.propTypes = {
22043
+ transitionName: ReactCSSTransitionGroupChild.propTypes.name,
21998
22044
 
21999
- var aggregatedStats = {};
22000
- var affectedIDs = {};
22045
+ transitionAppear: React.PropTypes.bool,
22046
+ transitionEnter: React.PropTypes.bool,
22047
+ transitionLeave: React.PropTypes.bool,
22048
+ transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
22049
+ transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
22050
+ transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
22051
+ };
22052
+ ReactCSSTransitionGroup.defaultProps = {
22053
+ transitionAppear: false,
22054
+ transitionEnter: true,
22055
+ transitionLeave: true
22056
+ };
22001
22057
 
22002
- function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
22003
- var _treeSnapshot$instanc2 = treeSnapshot[instanceID],
22004
- displayName = _treeSnapshot$instanc2.displayName,
22005
- ownerID = _treeSnapshot$instanc2.ownerID;
22006
22058
 
22007
- var owner = treeSnapshot[ownerID];
22008
- var key = (owner ? owner.displayName + ' > ' : '') + displayName;
22009
- var stats = aggregatedStats[key];
22010
- if (!stats) {
22011
- affectedIDs[key] = {};
22012
- stats = aggregatedStats[key] = {
22013
- key: key,
22014
- instanceCount: 0,
22015
- inclusiveRenderDuration: 0,
22016
- renderCount: 0
22017
- };
22018
- }
22019
- affectedIDs[key][instanceID] = true;
22020
- applyUpdate(stats);
22021
- }
22059
+ module.exports = ReactCSSTransitionGroup;
22022
22060
 
22023
- flushHistory.forEach(function (flush) {
22024
- var measurements = flush.measurements,
22025
- treeSnapshot = flush.treeSnapshot,
22026
- operations = flush.operations;
22061
+ /***/ },
22062
+ /* 185 */
22063
+ /***/ function(module, exports, __webpack_require__) {
22027
22064
 
22028
- var isDefinitelyNotWastedByID = {};
22065
+ /**
22066
+ * Copyright 2013-present, Facebook, Inc.
22067
+ * All rights reserved.
22068
+ *
22069
+ * This source code is licensed under the BSD-style license found in the
22070
+ * LICENSE file in the root directory of this source tree. An additional grant
22071
+ * of patent rights can be found in the PATENTS file in the same directory.
22072
+ *
22073
+ */
22029
22074
 
22030
- // Find host components associated with an operation in this batch.
22031
- // Mark all components in their parent tree as definitely not wasted.
22032
- operations.forEach(function (operation) {
22033
- var instanceID = operation.instanceID;
22075
+ 'use strict';
22034
22076
 
22035
- var nextParentID = instanceID;
22036
- while (nextParentID) {
22037
- isDefinitelyNotWastedByID[nextParentID] = true;
22038
- nextParentID = treeSnapshot[nextParentID].parentID;
22039
- }
22040
- });
22077
+ var React = __webpack_require__(2);
22078
+ var ReactAddonsDOMDependencies = __webpack_require__(186);
22041
22079
 
22042
- // Find composite components that rendered in this batch.
22043
- // These are potential candidates for being wasted renders.
22044
- var renderedCompositeIDs = {};
22045
- measurements.forEach(function (measurement) {
22046
- var instanceID = measurement.instanceID,
22047
- timerType = measurement.timerType;
22080
+ var CSSCore = __webpack_require__(191);
22081
+ var ReactTransitionEvents = __webpack_require__(192);
22048
22082
 
22049
- if (timerType !== 'render') {
22050
- return;
22051
- }
22052
- renderedCompositeIDs[instanceID] = true;
22053
- });
22083
+ var onlyChild = __webpack_require__(31);
22054
22084
 
22055
- measurements.forEach(function (measurement) {
22056
- var duration = measurement.duration,
22057
- instanceID = measurement.instanceID,
22058
- timerType = measurement.timerType;
22085
+ var TICK = 17;
22059
22086
 
22060
- if (timerType !== 'render') {
22061
- return;
22087
+ var ReactCSSTransitionGroupChild = React.createClass({
22088
+ displayName: 'ReactCSSTransitionGroupChild',
22089
+
22090
+ propTypes: {
22091
+ name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
22092
+ enter: React.PropTypes.string,
22093
+ leave: React.PropTypes.string,
22094
+ active: React.PropTypes.string
22095
+ }), React.PropTypes.shape({
22096
+ enter: React.PropTypes.string,
22097
+ enterActive: React.PropTypes.string,
22098
+ leave: React.PropTypes.string,
22099
+ leaveActive: React.PropTypes.string,
22100
+ appear: React.PropTypes.string,
22101
+ appearActive: React.PropTypes.string
22102
+ })]).isRequired,
22103
+
22104
+ // Once we require timeouts to be specified, we can remove the
22105
+ // boolean flags (appear etc.) and just accept a number
22106
+ // or a bool for the timeout flags (appearTimeout etc.)
22107
+ appear: React.PropTypes.bool,
22108
+ enter: React.PropTypes.bool,
22109
+ leave: React.PropTypes.bool,
22110
+ appearTimeout: React.PropTypes.number,
22111
+ enterTimeout: React.PropTypes.number,
22112
+ leaveTimeout: React.PropTypes.number
22113
+ },
22114
+
22115
+ transition: function (animationType, finishCallback, userSpecifiedDelay) {
22116
+ var node = ReactAddonsDOMDependencies.getReactDOM().findDOMNode(this);
22117
+
22118
+ if (!node) {
22119
+ if (finishCallback) {
22120
+ finishCallback();
22062
22121
  }
22122
+ return;
22123
+ }
22063
22124
 
22064
- // If there was a DOM update below this component, or it has just been
22065
- // mounted, its render() is not considered wasted.
22066
- var updateCount = treeSnapshot[instanceID].updateCount;
22125
+ var className = this.props.name[animationType] || this.props.name + '-' + animationType;
22126
+ var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
22127
+ var timeout = null;
22067
22128
 
22068
- if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
22129
+ var endListener = function (e) {
22130
+ if (e && e.target !== node) {
22069
22131
  return;
22070
22132
  }
22071
22133
 
22072
- // We consider this render() wasted.
22073
- updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
22074
- stats.renderCount++;
22075
- });
22134
+ clearTimeout(timeout);
22076
22135
 
22077
- var nextParentID = instanceID;
22078
- while (nextParentID) {
22079
- // Any parents rendered during this batch are considered wasted
22080
- // unless we previously marked them as dirty.
22081
- var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
22082
- if (isWasted) {
22083
- updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
22084
- stats.inclusiveRenderDuration += duration;
22085
- });
22086
- }
22087
- nextParentID = treeSnapshot[nextParentID].parentID;
22088
- }
22089
- });
22090
- });
22136
+ CSSCore.removeClass(node, className);
22137
+ CSSCore.removeClass(node, activeClassName);
22091
22138
 
22092
- return Object.keys(aggregatedStats).map(function (key) {
22093
- return _extends({}, aggregatedStats[key], {
22094
- instanceCount: Object.keys(affectedIDs[key]).length
22095
- });
22096
- }).sort(function (a, b) {
22097
- return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
22098
- });
22099
- }
22139
+ ReactTransitionEvents.removeEndEventListener(node, endListener);
22100
22140
 
22101
- function getOperations() {
22102
- var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
22141
+ // Usually this optional callback is used for informing an owner of
22142
+ // a leave animation and telling it to remove the child.
22143
+ if (finishCallback) {
22144
+ finishCallback();
22145
+ }
22146
+ };
22103
22147
 
22104
- if (!(process.env.NODE_ENV !== 'production')) {
22105
- warnInProduction();
22106
- return [];
22107
- }
22148
+ CSSCore.addClass(node, className);
22108
22149
 
22109
- var stats = [];
22110
- flushHistory.forEach(function (flush, flushIndex) {
22111
- var operations = flush.operations,
22112
- treeSnapshot = flush.treeSnapshot;
22150
+ // Need to do this to actually trigger a transition.
22151
+ this.queueClassAndNode(activeClassName, node);
22113
22152
 
22114
- operations.forEach(function (operation) {
22115
- var instanceID = operation.instanceID,
22116
- type = operation.type,
22117
- payload = operation.payload;
22118
- var _treeSnapshot$instanc3 = treeSnapshot[instanceID],
22119
- displayName = _treeSnapshot$instanc3.displayName,
22120
- ownerID = _treeSnapshot$instanc3.ownerID;
22153
+ // If the user specified a timeout delay.
22154
+ if (userSpecifiedDelay) {
22155
+ // Clean-up the animation after the specified delay
22156
+ timeout = setTimeout(endListener, userSpecifiedDelay);
22157
+ this.transitionTimeouts.push(timeout);
22158
+ } else {
22159
+ // DEPRECATED: this listener will be removed in a future version of react
22160
+ ReactTransitionEvents.addEndEventListener(node, endListener);
22161
+ }
22162
+ },
22121
22163
 
22122
- var owner = treeSnapshot[ownerID];
22123
- var key = (owner ? owner.displayName + ' > ' : '') + displayName;
22164
+ queueClassAndNode: function (className, node) {
22165
+ this.classNameAndNodeQueue.push({
22166
+ className: className,
22167
+ node: node
22168
+ });
22124
22169
 
22125
- stats.push({
22126
- flushIndex: flushIndex,
22127
- instanceID: instanceID,
22128
- key: key,
22129
- type: type,
22130
- ownerID: ownerID,
22131
- payload: payload
22170
+ if (!this.timeout) {
22171
+ this.timeout = setTimeout(this.flushClassNameAndNodeQueue, TICK);
22172
+ }
22173
+ },
22174
+
22175
+ flushClassNameAndNodeQueue: function () {
22176
+ if (this.isMounted()) {
22177
+ this.classNameAndNodeQueue.forEach(function (obj) {
22178
+ CSSCore.addClass(obj.node, obj.className);
22132
22179
  });
22133
- });
22134
- });
22135
- return stats;
22136
- }
22180
+ }
22181
+ this.classNameAndNodeQueue.length = 0;
22182
+ this.timeout = null;
22183
+ },
22137
22184
 
22138
- function printExclusive(flushHistory) {
22139
- if (!(process.env.NODE_ENV !== 'production')) {
22140
- warnInProduction();
22141
- return;
22142
- }
22185
+ componentWillMount: function () {
22186
+ this.classNameAndNodeQueue = [];
22187
+ this.transitionTimeouts = [];
22188
+ },
22143
22189
 
22144
- var stats = getExclusive(flushHistory);
22145
- var table = stats.map(function (item) {
22146
- var key = item.key,
22147
- instanceCount = item.instanceCount,
22148
- totalDuration = item.totalDuration;
22190
+ componentWillUnmount: function () {
22191
+ if (this.timeout) {
22192
+ clearTimeout(this.timeout);
22193
+ }
22194
+ this.transitionTimeouts.forEach(function (timeout) {
22195
+ clearTimeout(timeout);
22196
+ });
22149
22197
 
22150
- var renderCount = item.counts.render || 0;
22151
- var renderDuration = item.durations.render || 0;
22152
- return {
22153
- 'Component': key,
22154
- 'Total time (ms)': roundFloat(totalDuration),
22155
- 'Instance count': instanceCount,
22156
- 'Total render time (ms)': roundFloat(renderDuration),
22157
- 'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
22158
- 'Render count': renderCount,
22159
- 'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
22160
- };
22161
- });
22162
- consoleTable(table);
22163
- }
22198
+ this.classNameAndNodeQueue.length = 0;
22199
+ },
22164
22200
 
22165
- function printInclusive(flushHistory) {
22166
- if (!(process.env.NODE_ENV !== 'production')) {
22167
- warnInProduction();
22168
- return;
22169
- }
22201
+ componentWillAppear: function (done) {
22202
+ if (this.props.appear) {
22203
+ this.transition('appear', done, this.props.appearTimeout);
22204
+ } else {
22205
+ done();
22206
+ }
22207
+ },
22170
22208
 
22171
- var stats = getInclusive(flushHistory);
22172
- var table = stats.map(function (item) {
22173
- var key = item.key,
22174
- instanceCount = item.instanceCount,
22175
- inclusiveRenderDuration = item.inclusiveRenderDuration,
22176
- renderCount = item.renderCount;
22209
+ componentWillEnter: function (done) {
22210
+ if (this.props.enter) {
22211
+ this.transition('enter', done, this.props.enterTimeout);
22212
+ } else {
22213
+ done();
22214
+ }
22215
+ },
22177
22216
 
22178
- return {
22179
- 'Owner > Component': key,
22180
- 'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
22181
- 'Instance count': instanceCount,
22182
- 'Render count': renderCount
22183
- };
22184
- });
22185
- consoleTable(table);
22186
- }
22217
+ componentWillLeave: function (done) {
22218
+ if (this.props.leave) {
22219
+ this.transition('leave', done, this.props.leaveTimeout);
22220
+ } else {
22221
+ done();
22222
+ }
22223
+ },
22187
22224
 
22188
- function printWasted(flushHistory) {
22189
- if (!(process.env.NODE_ENV !== 'production')) {
22190
- warnInProduction();
22191
- return;
22225
+ render: function () {
22226
+ return onlyChild(this.props.children);
22192
22227
  }
22228
+ });
22193
22229
 
22194
- var stats = getWasted(flushHistory);
22195
- var table = stats.map(function (item) {
22196
- var key = item.key,
22197
- instanceCount = item.instanceCount,
22198
- inclusiveRenderDuration = item.inclusiveRenderDuration,
22199
- renderCount = item.renderCount;
22230
+ module.exports = ReactCSSTransitionGroupChild;
22200
22231
 
22201
- return {
22202
- 'Owner > Component': key,
22203
- 'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
22204
- 'Instance count': instanceCount,
22205
- 'Render count': renderCount
22206
- };
22207
- });
22208
- consoleTable(table);
22209
- }
22210
-
22211
- function printOperations(flushHistory) {
22212
- if (!(process.env.NODE_ENV !== 'production')) {
22213
- warnInProduction();
22214
- return;
22215
- }
22216
-
22217
- var stats = getOperations(flushHistory);
22218
- var table = stats.map(function (stat) {
22219
- return {
22220
- 'Owner > Node': stat.key,
22221
- 'Operation': stat.type,
22222
- 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
22223
- 'Flush index': stat.flushIndex,
22224
- 'Owner Component ID': stat.ownerID,
22225
- 'DOM Component ID': stat.instanceID
22226
- };
22227
- });
22228
- consoleTable(table);
22229
- }
22230
-
22231
- var warnedAboutPrintDOM = false;
22232
- function printDOM(measurements) {
22233
- process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
22234
- warnedAboutPrintDOM = true;
22235
- return printOperations(measurements);
22236
- }
22232
+ /***/ },
22233
+ /* 186 */
22234
+ /***/ function(module, exports, __webpack_require__) {
22237
22235
 
22238
- var warnedAboutGetMeasurementsSummaryMap = false;
22239
- function getMeasurementsSummaryMap(measurements) {
22240
- process.env.NODE_ENV !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
22241
- warnedAboutGetMeasurementsSummaryMap = true;
22242
- return getWasted(measurements);
22243
- }
22236
+ /* WEBPACK VAR INJECTION */(function(process) {/**
22237
+ * Copyright 2013-present, Facebook, Inc.
22238
+ * All rights reserved.
22239
+ *
22240
+ * This source code is licensed under the BSD-style license found in the
22241
+ * LICENSE file in the root directory of this source tree. An additional grant
22242
+ * of patent rights can be found in the PATENTS file in the same directory.
22243
+ *
22244
+ */
22244
22245
 
22245
- function start() {
22246
- if (!(process.env.NODE_ENV !== 'production')) {
22247
- warnInProduction();
22248
- return;
22249
- }
22246
+ 'use strict';
22250
22247
 
22251
- ReactDebugTool.beginProfiling();
22252
- }
22248
+ var ReactDOM = __webpack_require__(33);
22253
22249
 
22254
- function stop() {
22255
- if (!(process.env.NODE_ENV !== 'production')) {
22256
- warnInProduction();
22257
- return;
22258
- }
22250
+ exports.getReactDOM = function () {
22251
+ return ReactDOM;
22252
+ };
22259
22253
 
22260
- ReactDebugTool.endProfiling();
22261
- }
22254
+ if (process.env.NODE_ENV !== 'production') {
22255
+ var ReactPerf;
22256
+ var ReactTestUtils;
22262
22257
 
22263
- function isRunning() {
22264
- if (!(process.env.NODE_ENV !== 'production')) {
22265
- warnInProduction();
22266
- return false;
22267
- }
22258
+ exports.getReactPerf = function () {
22259
+ if (!ReactPerf) {
22260
+ ReactPerf = __webpack_require__(187);
22261
+ }
22262
+ return ReactPerf;
22263
+ };
22268
22264
 
22269
- return ReactDebugTool.isProfiling();
22265
+ exports.getReactTestUtils = function () {
22266
+ if (!ReactTestUtils) {
22267
+ ReactTestUtils = __webpack_require__(188);
22268
+ }
22269
+ return ReactTestUtils;
22270
+ };
22270
22271
  }
22271
-
22272
- var ReactPerfAnalysis = {
22273
- getLastMeasurements: getLastMeasurements,
22274
- getExclusive: getExclusive,
22275
- getInclusive: getInclusive,
22276
- getWasted: getWasted,
22277
- getOperations: getOperations,
22278
- printExclusive: printExclusive,
22279
- printInclusive: printInclusive,
22280
- printWasted: printWasted,
22281
- printOperations: printOperations,
22282
- start: start,
22283
- stop: stop,
22284
- isRunning: isRunning,
22285
- // Deprecated:
22286
- printDOM: printDOM,
22287
- getMeasurementsSummaryMap: getMeasurementsSummaryMap
22288
- };
22289
-
22290
- module.exports = ReactPerfAnalysis;
22291
22272
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
22292
22273
 
22293
22274
  /***/ },
22294
- /* 183 */
22275
+ /* 187 */
22295
22276
  /***/ function(module, exports, __webpack_require__) {
22296
22277
 
22297
22278
  /* WEBPACK VAR INJECTION */(function(process) {/**
22298
- * Copyright 2013-present, Facebook, Inc.
22279
+ * Copyright 2016-present, Facebook, Inc.
22299
22280
  * All rights reserved.
22300
22281
  *
22301
22282
  * This source code is licensed under the BSD-style license found in the
22302
22283
  * LICENSE file in the root directory of this source tree. An additional grant
22303
22284
  * of patent rights can be found in the PATENTS file in the same directory.
22304
22285
  *
22286
+ *
22305
22287
  */
22306
22288
 
22307
22289
  'use strict';
22308
22290
 
22309
- var _prodInvariant = __webpack_require__(35),
22310
- _assign = __webpack_require__(4);
22291
+ var _assign = __webpack_require__(4);
22311
22292
 
22312
- var EventConstants = __webpack_require__(184);
22313
- var EventPluginHub = __webpack_require__(42);
22314
- var EventPluginRegistry = __webpack_require__(43);
22315
- var EventPropagators = __webpack_require__(41);
22316
- var React = __webpack_require__(2);
22317
- var ReactDOM = __webpack_require__(33);
22318
- var ReactDOMComponentTree = __webpack_require__(34);
22319
- var ReactBrowserEventEmitter = __webpack_require__(105);
22320
- var ReactInstanceMap = __webpack_require__(116);
22321
- var ReactUpdates = __webpack_require__(56);
22322
- var SyntheticEvent = __webpack_require__(53);
22323
- var ReactShallowRenderer = __webpack_require__(185);
22293
+ var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
22324
22294
 
22325
- var findDOMNode = __webpack_require__(172);
22326
- var invariant = __webpack_require__(8);
22295
+ var ReactDebugTool = __webpack_require__(63);
22296
+ var warning = __webpack_require__(11);
22297
+ var alreadyWarned = false;
22327
22298
 
22328
- var topLevelTypes = EventConstants.topLevelTypes;
22299
+ function roundFloat(val) {
22300
+ var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
22329
22301
 
22330
- function Event(suffix) {}
22302
+ var n = Math.pow(10, base);
22303
+ return Math.floor(val * n) / n;
22304
+ }
22331
22305
 
22332
- /**
22333
- * @class ReactTestUtils
22334
- */
22306
+ // Flow type definition of console.table is too strict right now, see
22307
+ // https://github.com/facebook/flow/pull/2353 for updates
22308
+ function consoleTable(table) {
22309
+ console.table(table);
22310
+ }
22335
22311
 
22336
- function findAllInRenderedTreeInternal(inst, test) {
22337
- if (!inst || !inst.getPublicInstance) {
22338
- return [];
22312
+ function warnInProduction() {
22313
+ if (alreadyWarned) {
22314
+ return;
22339
22315
  }
22340
- var publicInst = inst.getPublicInstance();
22341
- var ret = test(publicInst) ? [publicInst] : [];
22342
- var currentElement = inst._currentElement;
22343
- if (ReactTestUtils.isDOMComponent(publicInst)) {
22344
- var renderedChildren = inst._renderedChildren;
22345
- var key;
22346
- for (key in renderedChildren) {
22347
- if (!renderedChildren.hasOwnProperty(key)) {
22348
- continue;
22349
- }
22350
- ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
22351
- }
22352
- } else if (React.isValidElement(currentElement) && typeof currentElement.type === 'function') {
22353
- ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
22316
+ alreadyWarned = true;
22317
+ if (typeof console !== 'undefined') {
22318
+ console.error('ReactPerf is not supported in the production builds of React. ' + 'To collect measurements, please use the development build of React instead.');
22354
22319
  }
22355
- return ret;
22356
22320
  }
22357
22321
 
22358
- /**
22359
- * Utilities for making it easy to test React components.
22360
- *
22361
- * See https://facebook.github.io/react/docs/test-utils.html
22362
- *
22363
- * Todo: Support the entire DOM.scry query syntax. For now, these simple
22364
- * utilities will suffice for testing purposes.
22365
- * @lends ReactTestUtils
22366
- */
22367
- var ReactTestUtils = {
22368
- renderIntoDocument: function (element) {
22369
- var div = document.createElement('div');
22370
- // None of our tests actually require attaching the container to the
22371
- // DOM, and doing so creates a mess that we rely on test isolation to
22372
- // clean up, so we're going to stop honoring the name of this method
22373
- // (and probably rename it eventually) if no problems arise.
22374
- // document.documentElement.appendChild(div);
22375
- return ReactDOM.render(element, div);
22376
- },
22322
+ function getLastMeasurements() {
22323
+ if (!(process.env.NODE_ENV !== 'production')) {
22324
+ warnInProduction();
22325
+ return [];
22326
+ }
22377
22327
 
22378
- isElement: function (element) {
22379
- return React.isValidElement(element);
22380
- },
22328
+ return ReactDebugTool.getFlushHistory();
22329
+ }
22381
22330
 
22382
- isElementOfType: function (inst, convenienceConstructor) {
22383
- return React.isValidElement(inst) && inst.type === convenienceConstructor;
22384
- },
22331
+ function getExclusive() {
22332
+ var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
22385
22333
 
22386
- isDOMComponent: function (inst) {
22387
- return !!(inst && inst.nodeType === 1 && inst.tagName);
22388
- },
22334
+ if (!(process.env.NODE_ENV !== 'production')) {
22335
+ warnInProduction();
22336
+ return [];
22337
+ }
22389
22338
 
22390
- isDOMComponentElement: function (inst) {
22391
- return !!(inst && React.isValidElement(inst) && !!inst.tagName);
22392
- },
22339
+ var aggregatedStats = {};
22340
+ var affectedIDs = {};
22393
22341
 
22394
- isCompositeComponent: function (inst) {
22395
- if (ReactTestUtils.isDOMComponent(inst)) {
22396
- // Accessing inst.setState warns; just return false as that'll be what
22397
- // this returns when we have DOM nodes as refs directly
22398
- return false;
22399
- }
22400
- return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
22401
- },
22342
+ function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
22343
+ var displayName = treeSnapshot[instanceID].displayName;
22402
22344
 
22403
- isCompositeComponentWithType: function (inst, type) {
22404
- if (!ReactTestUtils.isCompositeComponent(inst)) {
22405
- return false;
22345
+ var key = displayName;
22346
+ var stats = aggregatedStats[key];
22347
+ if (!stats) {
22348
+ affectedIDs[key] = {};
22349
+ stats = aggregatedStats[key] = {
22350
+ key: key,
22351
+ instanceCount: 0,
22352
+ counts: {},
22353
+ durations: {},
22354
+ totalDuration: 0
22355
+ };
22406
22356
  }
22407
- var internalInstance = ReactInstanceMap.get(inst);
22408
- var constructor = internalInstance._currentElement.type;
22357
+ if (!stats.durations[timerType]) {
22358
+ stats.durations[timerType] = 0;
22359
+ }
22360
+ if (!stats.counts[timerType]) {
22361
+ stats.counts[timerType] = 0;
22362
+ }
22363
+ affectedIDs[key][instanceID] = true;
22364
+ applyUpdate(stats);
22365
+ }
22409
22366
 
22410
- return constructor === type;
22411
- },
22367
+ flushHistory.forEach(function (flush) {
22368
+ var measurements = flush.measurements,
22369
+ treeSnapshot = flush.treeSnapshot;
22412
22370
 
22413
- isCompositeComponentElement: function (inst) {
22414
- if (!React.isValidElement(inst)) {
22415
- return false;
22416
- }
22417
- // We check the prototype of the type that will get mounted, not the
22418
- // instance itself. This is a future proof way of duck typing.
22419
- var prototype = inst.type.prototype;
22420
- return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
22421
- },
22371
+ measurements.forEach(function (measurement) {
22372
+ var duration = measurement.duration,
22373
+ instanceID = measurement.instanceID,
22374
+ timerType = measurement.timerType;
22422
22375
 
22423
- isCompositeComponentElementWithType: function (inst, type) {
22424
- var internalInstance = ReactInstanceMap.get(inst);
22425
- var constructor = internalInstance._currentElement.type;
22376
+ updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
22377
+ stats.totalDuration += duration;
22378
+ stats.durations[timerType] += duration;
22379
+ stats.counts[timerType]++;
22380
+ });
22381
+ });
22382
+ });
22426
22383
 
22427
- return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
22428
- },
22384
+ return Object.keys(aggregatedStats).map(function (key) {
22385
+ return _extends({}, aggregatedStats[key], {
22386
+ instanceCount: Object.keys(affectedIDs[key]).length
22387
+ });
22388
+ }).sort(function (a, b) {
22389
+ return b.totalDuration - a.totalDuration;
22390
+ });
22391
+ }
22429
22392
 
22430
- getRenderedChildOfCompositeComponent: function (inst) {
22431
- if (!ReactTestUtils.isCompositeComponent(inst)) {
22432
- return null;
22433
- }
22434
- var internalInstance = ReactInstanceMap.get(inst);
22435
- return internalInstance._renderedComponent.getPublicInstance();
22436
- },
22393
+ function getInclusive() {
22394
+ var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
22437
22395
 
22438
- findAllInRenderedTree: function (inst, test) {
22439
- if (!inst) {
22440
- return [];
22396
+ if (!(process.env.NODE_ENV !== 'production')) {
22397
+ warnInProduction();
22398
+ return [];
22399
+ }
22400
+
22401
+ var aggregatedStats = {};
22402
+ var affectedIDs = {};
22403
+
22404
+ function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
22405
+ var _treeSnapshot$instanc = treeSnapshot[instanceID],
22406
+ displayName = _treeSnapshot$instanc.displayName,
22407
+ ownerID = _treeSnapshot$instanc.ownerID;
22408
+
22409
+ var owner = treeSnapshot[ownerID];
22410
+ var key = (owner ? owner.displayName + ' > ' : '') + displayName;
22411
+ var stats = aggregatedStats[key];
22412
+ if (!stats) {
22413
+ affectedIDs[key] = {};
22414
+ stats = aggregatedStats[key] = {
22415
+ key: key,
22416
+ instanceCount: 0,
22417
+ inclusiveRenderDuration: 0,
22418
+ renderCount: 0
22419
+ };
22441
22420
  }
22442
- !ReactTestUtils.isCompositeComponent(inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : _prodInvariant('10') : void 0;
22443
- return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
22444
- },
22421
+ affectedIDs[key][instanceID] = true;
22422
+ applyUpdate(stats);
22423
+ }
22445
22424
 
22446
- /**
22447
- * Finds all instance of components in the rendered tree that are DOM
22448
- * components with the class name matching `className`.
22449
- * @return {array} an array of all the matches.
22450
- */
22451
- scryRenderedDOMComponentsWithClass: function (root, classNames) {
22452
- return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
22453
- if (ReactTestUtils.isDOMComponent(inst)) {
22454
- var className = inst.className;
22455
- if (typeof className !== 'string') {
22456
- // SVG, probably.
22457
- className = inst.getAttribute('class') || '';
22458
- }
22459
- var classList = className.split(/\s+/);
22425
+ var isCompositeByID = {};
22426
+ flushHistory.forEach(function (flush) {
22427
+ var measurements = flush.measurements;
22460
22428
 
22461
- if (!Array.isArray(classNames)) {
22462
- !(classNames !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : _prodInvariant('11') : void 0;
22463
- classNames = classNames.split(/\s+/);
22464
- }
22465
- return classNames.every(function (name) {
22466
- return classList.indexOf(name) !== -1;
22467
- });
22429
+ measurements.forEach(function (measurement) {
22430
+ var instanceID = measurement.instanceID,
22431
+ timerType = measurement.timerType;
22432
+
22433
+ if (timerType !== 'render') {
22434
+ return;
22468
22435
  }
22469
- return false;
22436
+ isCompositeByID[instanceID] = true;
22470
22437
  });
22471
- },
22438
+ });
22472
22439
 
22473
- /**
22474
- * Like scryRenderedDOMComponentsWithClass but expects there to be one result,
22475
- * and returns that one result, or throws exception if there is any other
22476
- * number of matches besides one.
22477
- * @return {!ReactDOMComponent} The one match.
22478
- */
22479
- findRenderedDOMComponentWithClass: function (root, className) {
22480
- var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
22481
- if (all.length !== 1) {
22482
- throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
22483
- }
22484
- return all[0];
22485
- },
22440
+ flushHistory.forEach(function (flush) {
22441
+ var measurements = flush.measurements,
22442
+ treeSnapshot = flush.treeSnapshot;
22486
22443
 
22487
- /**
22488
- * Finds all instance of components in the rendered tree that are DOM
22489
- * components with the tag name matching `tagName`.
22490
- * @return {array} an array of all the matches.
22491
- */
22492
- scryRenderedDOMComponentsWithTag: function (root, tagName) {
22493
- return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
22494
- return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
22495
- });
22496
- },
22444
+ measurements.forEach(function (measurement) {
22445
+ var duration = measurement.duration,
22446
+ instanceID = measurement.instanceID,
22447
+ timerType = measurement.timerType;
22497
22448
 
22498
- /**
22499
- * Like scryRenderedDOMComponentsWithTag but expects there to be one result,
22500
- * and returns that one result, or throws exception if there is any other
22501
- * number of matches besides one.
22502
- * @return {!ReactDOMComponent} The one match.
22503
- */
22504
- findRenderedDOMComponentWithTag: function (root, tagName) {
22505
- var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
22506
- if (all.length !== 1) {
22507
- throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
22508
- }
22509
- return all[0];
22510
- },
22449
+ if (timerType !== 'render') {
22450
+ return;
22451
+ }
22452
+ updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
22453
+ stats.renderCount++;
22454
+ });
22455
+ var nextParentID = instanceID;
22456
+ while (nextParentID) {
22457
+ // As we traverse parents, only count inclusive time towards composites.
22458
+ // We know something is a composite if its render() was called.
22459
+ if (isCompositeByID[nextParentID]) {
22460
+ updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
22461
+ stats.inclusiveRenderDuration += duration;
22462
+ });
22463
+ }
22464
+ nextParentID = treeSnapshot[nextParentID].parentID;
22465
+ }
22466
+ });
22467
+ });
22511
22468
 
22512
- /**
22513
- * Finds all instances of components with type equal to `componentType`.
22514
- * @return {array} an array of all the matches.
22515
- */
22516
- scryRenderedComponentsWithType: function (root, componentType) {
22517
- return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
22518
- return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
22469
+ return Object.keys(aggregatedStats).map(function (key) {
22470
+ return _extends({}, aggregatedStats[key], {
22471
+ instanceCount: Object.keys(affectedIDs[key]).length
22519
22472
  });
22520
- },
22473
+ }).sort(function (a, b) {
22474
+ return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
22475
+ });
22476
+ }
22521
22477
 
22522
- /**
22523
- * Same as `scryRenderedComponentsWithType` but expects there to be one result
22524
- * and returns that one result, or throws exception if there is any other
22525
- * number of matches besides one.
22526
- * @return {!ReactComponent} The one match.
22527
- */
22528
- findRenderedComponentWithType: function (root, componentType) {
22529
- var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
22530
- if (all.length !== 1) {
22531
- throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
22478
+ function getWasted() {
22479
+ var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
22480
+
22481
+ if (!(process.env.NODE_ENV !== 'production')) {
22482
+ warnInProduction();
22483
+ return [];
22484
+ }
22485
+
22486
+ var aggregatedStats = {};
22487
+ var affectedIDs = {};
22488
+
22489
+ function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
22490
+ var _treeSnapshot$instanc2 = treeSnapshot[instanceID],
22491
+ displayName = _treeSnapshot$instanc2.displayName,
22492
+ ownerID = _treeSnapshot$instanc2.ownerID;
22493
+
22494
+ var owner = treeSnapshot[ownerID];
22495
+ var key = (owner ? owner.displayName + ' > ' : '') + displayName;
22496
+ var stats = aggregatedStats[key];
22497
+ if (!stats) {
22498
+ affectedIDs[key] = {};
22499
+ stats = aggregatedStats[key] = {
22500
+ key: key,
22501
+ instanceCount: 0,
22502
+ inclusiveRenderDuration: 0,
22503
+ renderCount: 0
22504
+ };
22532
22505
  }
22533
- return all[0];
22534
- },
22506
+ affectedIDs[key][instanceID] = true;
22507
+ applyUpdate(stats);
22508
+ }
22535
22509
 
22536
- /**
22537
- * Pass a mocked component module to this method to augment it with
22538
- * useful methods that allow it to be used as a dummy React component.
22539
- * Instead of rendering as usual, the component will become a simple
22540
- * <div> containing any provided children.
22541
- *
22542
- * @param {object} module the mock function object exported from a
22543
- * module that defines the component to be mocked
22544
- * @param {?string} mockTagName optional dummy root tag name to return
22545
- * from render method (overrides
22546
- * module.mockTagName if provided)
22547
- * @return {object} the ReactTestUtils object (for chaining)
22548
- */
22549
- mockComponent: function (module, mockTagName) {
22550
- mockTagName = mockTagName || module.mockTagName || 'div';
22510
+ flushHistory.forEach(function (flush) {
22511
+ var measurements = flush.measurements,
22512
+ treeSnapshot = flush.treeSnapshot,
22513
+ operations = flush.operations;
22551
22514
 
22552
- module.prototype.render.mockImplementation(function () {
22553
- return React.createElement(mockTagName, null, this.props.children);
22515
+ var isDefinitelyNotWastedByID = {};
22516
+
22517
+ // Find host components associated with an operation in this batch.
22518
+ // Mark all components in their parent tree as definitely not wasted.
22519
+ operations.forEach(function (operation) {
22520
+ var instanceID = operation.instanceID;
22521
+
22522
+ var nextParentID = instanceID;
22523
+ while (nextParentID) {
22524
+ isDefinitelyNotWastedByID[nextParentID] = true;
22525
+ nextParentID = treeSnapshot[nextParentID].parentID;
22526
+ }
22527
+ });
22528
+
22529
+ // Find composite components that rendered in this batch.
22530
+ // These are potential candidates for being wasted renders.
22531
+ var renderedCompositeIDs = {};
22532
+ measurements.forEach(function (measurement) {
22533
+ var instanceID = measurement.instanceID,
22534
+ timerType = measurement.timerType;
22535
+
22536
+ if (timerType !== 'render') {
22537
+ return;
22538
+ }
22539
+ renderedCompositeIDs[instanceID] = true;
22554
22540
  });
22555
22541
 
22556
- return this;
22557
- },
22542
+ measurements.forEach(function (measurement) {
22543
+ var duration = measurement.duration,
22544
+ instanceID = measurement.instanceID,
22545
+ timerType = measurement.timerType;
22558
22546
 
22559
- /**
22560
- * Simulates a top level event being dispatched from a raw event that occurred
22561
- * on an `Element` node.
22562
- * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
22563
- * @param {!Element} node The dom to simulate an event occurring on.
22564
- * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
22565
- */
22566
- simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
22567
- fakeNativeEvent.target = node;
22568
- ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
22569
- },
22547
+ if (timerType !== 'render') {
22548
+ return;
22549
+ }
22570
22550
 
22571
- /**
22572
- * Simulates a top level event being dispatched from a raw event that occurred
22573
- * on the `ReactDOMComponent` `comp`.
22574
- * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
22575
- * @param {!ReactDOMComponent} comp
22576
- * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
22577
- */
22578
- simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
22579
- ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
22580
- },
22551
+ // If there was a DOM update below this component, or it has just been
22552
+ // mounted, its render() is not considered wasted.
22553
+ var updateCount = treeSnapshot[instanceID].updateCount;
22581
22554
 
22582
- nativeTouchData: function (x, y) {
22583
- return {
22584
- touches: [{ pageX: x, pageY: y }]
22585
- };
22586
- },
22555
+ if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
22556
+ return;
22557
+ }
22587
22558
 
22588
- createRenderer: function () {
22589
- return new ReactShallowRenderer();
22590
- },
22559
+ // We consider this render() wasted.
22560
+ updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
22561
+ stats.renderCount++;
22562
+ });
22591
22563
 
22592
- Simulate: null,
22593
- SimulateNative: {}
22594
- };
22564
+ var nextParentID = instanceID;
22565
+ while (nextParentID) {
22566
+ // Any parents rendered during this batch are considered wasted
22567
+ // unless we previously marked them as dirty.
22568
+ var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
22569
+ if (isWasted) {
22570
+ updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
22571
+ stats.inclusiveRenderDuration += duration;
22572
+ });
22573
+ }
22574
+ nextParentID = treeSnapshot[nextParentID].parentID;
22575
+ }
22576
+ });
22577
+ });
22595
22578
 
22596
- /**
22597
- * Exports:
22598
- *
22599
- * - `ReactTestUtils.Simulate.click(Element/ReactDOMComponent)`
22600
- * - `ReactTestUtils.Simulate.mouseMove(Element/ReactDOMComponent)`
22601
- * - `ReactTestUtils.Simulate.change(Element/ReactDOMComponent)`
22602
- * - ... (All keys from event plugin `eventTypes` objects)
22603
- */
22604
- function makeSimulator(eventType) {
22605
- return function (domComponentOrNode, eventData) {
22606
- var node;
22607
- !!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;
22608
- if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
22609
- node = findDOMNode(domComponentOrNode);
22610
- } else if (domComponentOrNode.tagName) {
22611
- node = domComponentOrNode;
22612
- }
22579
+ return Object.keys(aggregatedStats).map(function (key) {
22580
+ return _extends({}, aggregatedStats[key], {
22581
+ instanceCount: Object.keys(affectedIDs[key]).length
22582
+ });
22583
+ }).sort(function (a, b) {
22584
+ return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
22585
+ });
22586
+ }
22613
22587
 
22614
- var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
22588
+ function getOperations() {
22589
+ var flushHistory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLastMeasurements();
22615
22590
 
22616
- var fakeNativeEvent = new Event();
22617
- fakeNativeEvent.target = node;
22618
- fakeNativeEvent.type = eventType.toLowerCase();
22591
+ if (!(process.env.NODE_ENV !== 'production')) {
22592
+ warnInProduction();
22593
+ return [];
22594
+ }
22619
22595
 
22620
- // We don't use SyntheticEvent.getPooled in order to not have to worry about
22621
- // properly destroying any properties assigned from `eventData` upon release
22622
- var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
22623
- // Since we aren't using pooling, always persist the event. This will make
22624
- // sure it's marked and won't warn when setting additional properties.
22625
- event.persist();
22626
- _assign(event, eventData);
22596
+ var stats = [];
22597
+ flushHistory.forEach(function (flush, flushIndex) {
22598
+ var operations = flush.operations,
22599
+ treeSnapshot = flush.treeSnapshot;
22627
22600
 
22628
- if (dispatchConfig.phasedRegistrationNames) {
22629
- EventPropagators.accumulateTwoPhaseDispatches(event);
22630
- } else {
22631
- EventPropagators.accumulateDirectDispatches(event);
22632
- }
22601
+ operations.forEach(function (operation) {
22602
+ var instanceID = operation.instanceID,
22603
+ type = operation.type,
22604
+ payload = operation.payload;
22605
+ var _treeSnapshot$instanc3 = treeSnapshot[instanceID],
22606
+ displayName = _treeSnapshot$instanc3.displayName,
22607
+ ownerID = _treeSnapshot$instanc3.ownerID;
22633
22608
 
22634
- ReactUpdates.batchedUpdates(function () {
22635
- EventPluginHub.enqueueEvents(event);
22636
- EventPluginHub.processEventQueue(true);
22609
+ var owner = treeSnapshot[ownerID];
22610
+ var key = (owner ? owner.displayName + ' > ' : '') + displayName;
22611
+
22612
+ stats.push({
22613
+ flushIndex: flushIndex,
22614
+ instanceID: instanceID,
22615
+ key: key,
22616
+ type: type,
22617
+ ownerID: ownerID,
22618
+ payload: payload
22619
+ });
22637
22620
  });
22638
- };
22621
+ });
22622
+ return stats;
22639
22623
  }
22640
22624
 
22641
- function buildSimulators() {
22642
- ReactTestUtils.Simulate = {};
22625
+ function printExclusive(flushHistory) {
22626
+ if (!(process.env.NODE_ENV !== 'production')) {
22627
+ warnInProduction();
22628
+ return;
22629
+ }
22643
22630
 
22644
- var eventType;
22645
- for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
22646
- /**
22647
- * @param {!Element|ReactDOMComponent} domComponentOrNode
22648
- * @param {?object} eventData Fake event data to use in SyntheticEvent.
22649
- */
22650
- ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
22631
+ var stats = getExclusive(flushHistory);
22632
+ var table = stats.map(function (item) {
22633
+ var key = item.key,
22634
+ instanceCount = item.instanceCount,
22635
+ totalDuration = item.totalDuration;
22636
+
22637
+ var renderCount = item.counts.render || 0;
22638
+ var renderDuration = item.durations.render || 0;
22639
+ return {
22640
+ 'Component': key,
22641
+ 'Total time (ms)': roundFloat(totalDuration),
22642
+ 'Instance count': instanceCount,
22643
+ 'Total render time (ms)': roundFloat(renderDuration),
22644
+ 'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
22645
+ 'Render count': renderCount,
22646
+ 'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
22647
+ };
22648
+ });
22649
+ consoleTable(table);
22650
+ }
22651
+
22652
+ function printInclusive(flushHistory) {
22653
+ if (!(process.env.NODE_ENV !== 'production')) {
22654
+ warnInProduction();
22655
+ return;
22651
22656
  }
22657
+
22658
+ var stats = getInclusive(flushHistory);
22659
+ var table = stats.map(function (item) {
22660
+ var key = item.key,
22661
+ instanceCount = item.instanceCount,
22662
+ inclusiveRenderDuration = item.inclusiveRenderDuration,
22663
+ renderCount = item.renderCount;
22664
+
22665
+ return {
22666
+ 'Owner > Component': key,
22667
+ 'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
22668
+ 'Instance count': instanceCount,
22669
+ 'Render count': renderCount
22670
+ };
22671
+ });
22672
+ consoleTable(table);
22652
22673
  }
22653
22674
 
22654
- // Rebuild ReactTestUtils.Simulate whenever event plugins are injected
22655
- var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
22656
- EventPluginHub.injection.injectEventPluginOrder = function () {
22657
- oldInjectEventPluginOrder.apply(this, arguments);
22658
- buildSimulators();
22659
- };
22660
- var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
22661
- EventPluginHub.injection.injectEventPluginsByName = function () {
22662
- oldInjectEventPlugins.apply(this, arguments);
22663
- buildSimulators();
22664
- };
22675
+ function printWasted(flushHistory) {
22676
+ if (!(process.env.NODE_ENV !== 'production')) {
22677
+ warnInProduction();
22678
+ return;
22679
+ }
22665
22680
 
22666
- buildSimulators();
22681
+ var stats = getWasted(flushHistory);
22682
+ var table = stats.map(function (item) {
22683
+ var key = item.key,
22684
+ instanceCount = item.instanceCount,
22685
+ inclusiveRenderDuration = item.inclusiveRenderDuration,
22686
+ renderCount = item.renderCount;
22667
22687
 
22668
- /**
22669
- * Exports:
22670
- *
22671
- * - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
22672
- * - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
22673
- * - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
22674
- * - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
22675
- * - ... (All keys from `EventConstants.topLevelTypes`)
22676
- *
22677
- * Note: Top level event types are a subset of the entire set of handler types
22678
- * (which include a broader set of "synthetic" events). For example, onDragDone
22679
- * is a synthetic event. Except when testing an event plugin or React's event
22680
- * handling code specifically, you probably want to use ReactTestUtils.Simulate
22681
- * to dispatch synthetic events.
22682
- */
22688
+ return {
22689
+ 'Owner > Component': key,
22690
+ 'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
22691
+ 'Instance count': instanceCount,
22692
+ 'Render count': renderCount
22693
+ };
22694
+ });
22695
+ consoleTable(table);
22696
+ }
22697
+
22698
+ function printOperations(flushHistory) {
22699
+ if (!(process.env.NODE_ENV !== 'production')) {
22700
+ warnInProduction();
22701
+ return;
22702
+ }
22703
+
22704
+ var stats = getOperations(flushHistory);
22705
+ var table = stats.map(function (stat) {
22706
+ return {
22707
+ 'Owner > Node': stat.key,
22708
+ 'Operation': stat.type,
22709
+ 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
22710
+ 'Flush index': stat.flushIndex,
22711
+ 'Owner Component ID': stat.ownerID,
22712
+ 'DOM Component ID': stat.instanceID
22713
+ };
22714
+ });
22715
+ consoleTable(table);
22716
+ }
22683
22717
 
22684
- function makeNativeSimulator(eventType) {
22685
- return function (domComponentOrNode, nativeEventData) {
22686
- var fakeNativeEvent = new Event(eventType);
22687
- _assign(fakeNativeEvent, nativeEventData);
22688
- if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
22689
- ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
22690
- } else if (domComponentOrNode.tagName) {
22691
- // Will allow on actual dom nodes.
22692
- ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
22693
- }
22694
- };
22718
+ var warnedAboutPrintDOM = false;
22719
+ function printDOM(measurements) {
22720
+ process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
22721
+ warnedAboutPrintDOM = true;
22722
+ return printOperations(measurements);
22695
22723
  }
22696
22724
 
22697
- Object.keys(topLevelTypes).forEach(function (eventType) {
22698
- // Event type is stored as 'topClick' - we transform that to 'click'
22699
- var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
22700
- /**
22701
- * @param {!Element|ReactDOMComponent} domComponentOrNode
22702
- * @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
22703
- */
22704
- ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
22705
- });
22725
+ var warnedAboutGetMeasurementsSummaryMap = false;
22726
+ function getMeasurementsSummaryMap(measurements) {
22727
+ process.env.NODE_ENV !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
22728
+ warnedAboutGetMeasurementsSummaryMap = true;
22729
+ return getWasted(measurements);
22730
+ }
22706
22731
 
22707
- module.exports = ReactTestUtils;
22708
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
22732
+ function start() {
22733
+ if (!(process.env.NODE_ENV !== 'production')) {
22734
+ warnInProduction();
22735
+ return;
22736
+ }
22709
22737
 
22710
- /***/ },
22711
- /* 184 */
22712
- /***/ function(module, exports) {
22738
+ ReactDebugTool.beginProfiling();
22739
+ }
22713
22740
 
22714
- /**
22715
- * Copyright 2013-present, Facebook, Inc.
22716
- * All rights reserved.
22717
- *
22718
- * This source code is licensed under the BSD-style license found in the
22719
- * LICENSE file in the root directory of this source tree. An additional grant
22720
- * of patent rights can be found in the PATENTS file in the same directory.
22721
- *
22722
- */
22741
+ function stop() {
22742
+ if (!(process.env.NODE_ENV !== 'production')) {
22743
+ warnInProduction();
22744
+ return;
22745
+ }
22723
22746
 
22724
- 'use strict';
22747
+ ReactDebugTool.endProfiling();
22748
+ }
22725
22749
 
22726
- /**
22727
- * Types of raw signals from the browser caught at the top level.
22728
- */
22729
- var topLevelTypes = {
22730
- topAbort: null,
22731
- topAnimationEnd: null,
22732
- topAnimationIteration: null,
22733
- topAnimationStart: null,
22734
- topBlur: null,
22735
- topCanPlay: null,
22736
- topCanPlayThrough: null,
22737
- topChange: null,
22738
- topClick: null,
22739
- topCompositionEnd: null,
22740
- topCompositionStart: null,
22741
- topCompositionUpdate: null,
22742
- topContextMenu: null,
22743
- topCopy: null,
22744
- topCut: null,
22745
- topDoubleClick: null,
22746
- topDrag: null,
22747
- topDragEnd: null,
22748
- topDragEnter: null,
22749
- topDragExit: null,
22750
- topDragLeave: null,
22751
- topDragOver: null,
22752
- topDragStart: null,
22753
- topDrop: null,
22754
- topDurationChange: null,
22755
- topEmptied: null,
22756
- topEncrypted: null,
22757
- topEnded: null,
22758
- topError: null,
22759
- topFocus: null,
22760
- topInput: null,
22761
- topInvalid: null,
22762
- topKeyDown: null,
22763
- topKeyPress: null,
22764
- topKeyUp: null,
22765
- topLoad: null,
22766
- topLoadedData: null,
22767
- topLoadedMetadata: null,
22768
- topLoadStart: null,
22769
- topMouseDown: null,
22770
- topMouseMove: null,
22771
- topMouseOut: null,
22772
- topMouseOver: null,
22773
- topMouseUp: null,
22774
- topPaste: null,
22775
- topPause: null,
22776
- topPlay: null,
22777
- topPlaying: null,
22778
- topProgress: null,
22779
- topRateChange: null,
22780
- topReset: null,
22781
- topScroll: null,
22782
- topSeeked: null,
22783
- topSeeking: null,
22784
- topSelectionChange: null,
22785
- topStalled: null,
22786
- topSubmit: null,
22787
- topSuspend: null,
22788
- topTextInput: null,
22789
- topTimeUpdate: null,
22790
- topTouchCancel: null,
22791
- topTouchEnd: null,
22792
- topTouchMove: null,
22793
- topTouchStart: null,
22794
- topTransitionEnd: null,
22795
- topVolumeChange: null,
22796
- topWaiting: null,
22797
- topWheel: null
22798
- };
22750
+ function isRunning() {
22751
+ if (!(process.env.NODE_ENV !== 'production')) {
22752
+ warnInProduction();
22753
+ return false;
22754
+ }
22799
22755
 
22800
- var EventConstants = {
22801
- topLevelTypes: topLevelTypes
22756
+ return ReactDebugTool.isProfiling();
22757
+ }
22758
+
22759
+ var ReactPerfAnalysis = {
22760
+ getLastMeasurements: getLastMeasurements,
22761
+ getExclusive: getExclusive,
22762
+ getInclusive: getInclusive,
22763
+ getWasted: getWasted,
22764
+ getOperations: getOperations,
22765
+ printExclusive: printExclusive,
22766
+ printInclusive: printInclusive,
22767
+ printWasted: printWasted,
22768
+ printOperations: printOperations,
22769
+ start: start,
22770
+ stop: stop,
22771
+ isRunning: isRunning,
22772
+ // Deprecated:
22773
+ printDOM: printDOM,
22774
+ getMeasurementsSummaryMap: getMeasurementsSummaryMap
22802
22775
  };
22803
22776
 
22804
- module.exports = EventConstants;
22777
+ module.exports = ReactPerfAnalysis;
22778
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
22805
22779
 
22806
22780
  /***/ },
22807
- /* 185 */
22781
+ /* 188 */
22808
22782
  /***/ function(module, exports, __webpack_require__) {
22809
22783
 
22810
22784
  /* WEBPACK VAR INJECTION */(function(process) {/**
@@ -22822,436 +22796,505 @@
22822
22796
  var _prodInvariant = __webpack_require__(35),
22823
22797
  _assign = __webpack_require__(4);
22824
22798
 
22825
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22826
-
22799
+ var EventConstants = __webpack_require__(189);
22800
+ var EventPluginHub = __webpack_require__(42);
22801
+ var EventPluginRegistry = __webpack_require__(43);
22802
+ var EventPropagators = __webpack_require__(41);
22827
22803
  var React = __webpack_require__(2);
22828
- var ReactDefaultInjection = __webpack_require__(38);
22829
- var ReactCompositeComponent = __webpack_require__(119);
22830
- var ReactReconciler = __webpack_require__(59);
22804
+ var ReactDOM = __webpack_require__(33);
22805
+ var ReactDOMComponentTree = __webpack_require__(34);
22806
+ var ReactBrowserEventEmitter = __webpack_require__(105);
22807
+ var ReactInstanceMap = __webpack_require__(116);
22831
22808
  var ReactUpdates = __webpack_require__(56);
22809
+ var SyntheticEvent = __webpack_require__(53);
22810
+ var ReactShallowRenderer = __webpack_require__(190);
22832
22811
 
22833
- var emptyObject = __webpack_require__(20);
22834
- var getNextDebugID = __webpack_require__(127);
22812
+ var findDOMNode = __webpack_require__(172);
22835
22813
  var invariant = __webpack_require__(8);
22836
22814
 
22837
- var NoopInternalComponent = function () {
22838
- function NoopInternalComponent(element) {
22839
- _classCallCheck(this, NoopInternalComponent);
22815
+ var topLevelTypes = EventConstants.topLevelTypes;
22840
22816
 
22841
- this._renderedOutput = element;
22842
- this._currentElement = element;
22817
+ function Event(suffix) {}
22843
22818
 
22844
- if (process.env.NODE_ENV !== 'production') {
22845
- this._debugID = getNextDebugID();
22819
+ /**
22820
+ * @class ReactTestUtils
22821
+ */
22822
+
22823
+ function findAllInRenderedTreeInternal(inst, test) {
22824
+ if (!inst || !inst.getPublicInstance) {
22825
+ return [];
22826
+ }
22827
+ var publicInst = inst.getPublicInstance();
22828
+ var ret = test(publicInst) ? [publicInst] : [];
22829
+ var currentElement = inst._currentElement;
22830
+ if (ReactTestUtils.isDOMComponent(publicInst)) {
22831
+ var renderedChildren = inst._renderedChildren;
22832
+ var key;
22833
+ for (key in renderedChildren) {
22834
+ if (!renderedChildren.hasOwnProperty(key)) {
22835
+ continue;
22836
+ }
22837
+ ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
22846
22838
  }
22839
+ } else if (React.isValidElement(currentElement) && typeof currentElement.type === 'function') {
22840
+ ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
22847
22841
  }
22842
+ return ret;
22843
+ }
22848
22844
 
22849
- NoopInternalComponent.prototype.mountComponent = function mountComponent() {};
22850
-
22851
- NoopInternalComponent.prototype.receiveComponent = function receiveComponent(element) {
22852
- this._renderedOutput = element;
22853
- this._currentElement = element;
22854
- };
22855
-
22856
- NoopInternalComponent.prototype.unmountComponent = function unmountComponent() {};
22857
-
22858
- NoopInternalComponent.prototype.getHostNode = function getHostNode() {
22859
- return undefined;
22860
- };
22861
-
22862
- NoopInternalComponent.prototype.getPublicInstance = function getPublicInstance() {
22863
- return null;
22864
- };
22865
-
22866
- return NoopInternalComponent;
22867
- }();
22868
-
22869
- var ShallowComponentWrapper = function (element) {
22870
- // TODO: Consolidate with instantiateReactComponent
22871
- if (process.env.NODE_ENV !== 'production') {
22872
- this._debugID = getNextDebugID();
22873
- }
22845
+ /**
22846
+ * Utilities for making it easy to test React components.
22847
+ *
22848
+ * See https://facebook.github.io/react/docs/test-utils.html
22849
+ *
22850
+ * Todo: Support the entire DOM.scry query syntax. For now, these simple
22851
+ * utilities will suffice for testing purposes.
22852
+ * @lends ReactTestUtils
22853
+ */
22854
+ var ReactTestUtils = {
22855
+ renderIntoDocument: function (element) {
22856
+ var div = document.createElement('div');
22857
+ // None of our tests actually require attaching the container to the
22858
+ // DOM, and doing so creates a mess that we rely on test isolation to
22859
+ // clean up, so we're going to stop honoring the name of this method
22860
+ // (and probably rename it eventually) if no problems arise.
22861
+ // document.documentElement.appendChild(div);
22862
+ return ReactDOM.render(element, div);
22863
+ },
22874
22864
 
22875
- this.construct(element);
22876
- };
22877
- _assign(ShallowComponentWrapper.prototype, ReactCompositeComponent, {
22878
- _constructComponent: ReactCompositeComponent._constructComponentWithoutOwner,
22879
- _instantiateReactComponent: function (element) {
22880
- return new NoopInternalComponent(element);
22865
+ isElement: function (element) {
22866
+ return React.isValidElement(element);
22881
22867
  },
22882
- _replaceNodeWithMarkup: function () {},
22883
- _renderValidatedComponent: ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext
22884
- });
22885
22868
 
22886
- function _batchedRender(renderer, element, context) {
22887
- var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(true);
22888
- renderer._render(element, transaction, context);
22889
- ReactUpdates.ReactReconcileTransaction.release(transaction);
22890
- }
22869
+ isElementOfType: function (inst, convenienceConstructor) {
22870
+ return React.isValidElement(inst) && inst.type === convenienceConstructor;
22871
+ },
22891
22872
 
22892
- var ReactShallowRenderer = function () {
22893
- function ReactShallowRenderer() {
22894
- _classCallCheck(this, ReactShallowRenderer);
22873
+ isDOMComponent: function (inst) {
22874
+ return !!(inst && inst.nodeType === 1 && inst.tagName);
22875
+ },
22895
22876
 
22896
- this._instance = null;
22897
- }
22877
+ isDOMComponentElement: function (inst) {
22878
+ return !!(inst && React.isValidElement(inst) && !!inst.tagName);
22879
+ },
22898
22880
 
22899
- ReactShallowRenderer.prototype.getMountedInstance = function getMountedInstance() {
22900
- return this._instance ? this._instance._instance : null;
22901
- };
22881
+ isCompositeComponent: function (inst) {
22882
+ if (ReactTestUtils.isDOMComponent(inst)) {
22883
+ // Accessing inst.setState warns; just return false as that'll be what
22884
+ // this returns when we have DOM nodes as refs directly
22885
+ return false;
22886
+ }
22887
+ return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
22888
+ },
22902
22889
 
22903
- ReactShallowRenderer.prototype.render = function render(element, context) {
22904
- // Ensure we've done the default injections. This might not be true in the
22905
- // case of a simple test that only requires React and the TestUtils in
22906
- // conjunction with an inline-requires transform.
22907
- ReactDefaultInjection.inject();
22890
+ isCompositeComponentWithType: function (inst, type) {
22891
+ if (!ReactTestUtils.isCompositeComponent(inst)) {
22892
+ return false;
22893
+ }
22894
+ var internalInstance = ReactInstanceMap.get(inst);
22895
+ var constructor = internalInstance._currentElement.type;
22908
22896
 
22909
- !React.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : _prodInvariant('12', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : void 0;
22910
- !(typeof element.type !== 'string') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (%s). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.', element.type) : _prodInvariant('13', element.type) : void 0;
22897
+ return constructor === type;
22898
+ },
22911
22899
 
22912
- if (!context) {
22913
- context = emptyObject;
22900
+ isCompositeComponentElement: function (inst) {
22901
+ if (!React.isValidElement(inst)) {
22902
+ return false;
22914
22903
  }
22915
- ReactUpdates.batchedUpdates(_batchedRender, this, element, context);
22904
+ // We check the prototype of the type that will get mounted, not the
22905
+ // instance itself. This is a future proof way of duck typing.
22906
+ var prototype = inst.type.prototype;
22907
+ return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
22908
+ },
22916
22909
 
22917
- return this.getRenderOutput();
22918
- };
22910
+ isCompositeComponentElementWithType: function (inst, type) {
22911
+ var internalInstance = ReactInstanceMap.get(inst);
22912
+ var constructor = internalInstance._currentElement.type;
22919
22913
 
22920
- ReactShallowRenderer.prototype.getRenderOutput = function getRenderOutput() {
22921
- return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
22922
- };
22914
+ return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
22915
+ },
22923
22916
 
22924
- ReactShallowRenderer.prototype.unmount = function unmount() {
22925
- if (this._instance) {
22926
- ReactReconciler.unmountComponent(this._instance, false);
22917
+ getRenderedChildOfCompositeComponent: function (inst) {
22918
+ if (!ReactTestUtils.isCompositeComponent(inst)) {
22919
+ return null;
22927
22920
  }
22928
- };
22921
+ var internalInstance = ReactInstanceMap.get(inst);
22922
+ return internalInstance._renderedComponent.getPublicInstance();
22923
+ },
22929
22924
 
22930
- ReactShallowRenderer.prototype._render = function _render(element, transaction, context) {
22931
- if (this._instance) {
22932
- ReactReconciler.receiveComponent(this._instance, element, transaction, context);
22933
- } else {
22934
- var instance = new ShallowComponentWrapper(element);
22935
- ReactReconciler.mountComponent(instance, transaction, null, null, context, 0);
22936
- this._instance = instance;
22925
+ findAllInRenderedTree: function (inst, test) {
22926
+ if (!inst) {
22927
+ return [];
22937
22928
  }
22938
- };
22939
-
22940
- return ReactShallowRenderer;
22941
- }();
22942
-
22943
- module.exports = ReactShallowRenderer;
22944
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
22929
+ !ReactTestUtils.isCompositeComponent(inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : _prodInvariant('10') : void 0;
22930
+ return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
22931
+ },
22945
22932
 
22946
- /***/ },
22947
- /* 186 */
22948
- /***/ function(module, exports, __webpack_require__) {
22933
+ /**
22934
+ * Finds all instance of components in the rendered tree that are DOM
22935
+ * components with the class name matching `className`.
22936
+ * @return {array} an array of all the matches.
22937
+ */
22938
+ scryRenderedDOMComponentsWithClass: function (root, classNames) {
22939
+ return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
22940
+ if (ReactTestUtils.isDOMComponent(inst)) {
22941
+ var className = inst.className;
22942
+ if (typeof className !== 'string') {
22943
+ // SVG, probably.
22944
+ className = inst.getAttribute('class') || '';
22945
+ }
22946
+ var classList = className.split(/\s+/);
22949
22947
 
22950
- /* WEBPACK VAR INJECTION */(function(process) {/**
22951
- * Copyright 2013-present, Facebook, Inc.
22952
- * All rights reserved.
22953
- *
22954
- * This source code is licensed under the BSD-style license found in the
22955
- * LICENSE file in the root directory of this source tree. An additional grant
22956
- * of patent rights can be found in the PATENTS file in the same directory.
22957
- *
22958
- */
22948
+ if (!Array.isArray(classNames)) {
22949
+ !(classNames !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : _prodInvariant('11') : void 0;
22950
+ classNames = classNames.split(/\s+/);
22951
+ }
22952
+ return classNames.every(function (name) {
22953
+ return classList.indexOf(name) !== -1;
22954
+ });
22955
+ }
22956
+ return false;
22957
+ });
22958
+ },
22959
22959
 
22960
- 'use strict';
22960
+ /**
22961
+ * Like scryRenderedDOMComponentsWithClass but expects there to be one result,
22962
+ * and returns that one result, or throws exception if there is any other
22963
+ * number of matches besides one.
22964
+ * @return {!ReactDOMComponent} The one match.
22965
+ */
22966
+ findRenderedDOMComponentWithClass: function (root, className) {
22967
+ var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
22968
+ if (all.length !== 1) {
22969
+ throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
22970
+ }
22971
+ return all[0];
22972
+ },
22961
22973
 
22962
- var flattenChildren = __webpack_require__(187);
22974
+ /**
22975
+ * Finds all instance of components in the rendered tree that are DOM
22976
+ * components with the tag name matching `tagName`.
22977
+ * @return {array} an array of all the matches.
22978
+ */
22979
+ scryRenderedDOMComponentsWithTag: function (root, tagName) {
22980
+ return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
22981
+ return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
22982
+ });
22983
+ },
22963
22984
 
22964
- var ReactTransitionChildMapping = {
22965
22985
  /**
22966
- * Given `this.props.children`, return an object mapping key to child. Just
22967
- * simple syntactic sugar around flattenChildren().
22968
- *
22969
- * @param {*} children `this.props.children`
22970
- * @param {number=} selfDebugID Optional debugID of the current internal instance.
22971
- * @return {object} Mapping of key to child
22986
+ * Like scryRenderedDOMComponentsWithTag but expects there to be one result,
22987
+ * and returns that one result, or throws exception if there is any other
22988
+ * number of matches besides one.
22989
+ * @return {!ReactDOMComponent} The one match.
22972
22990
  */
22973
- getChildMapping: function (children, selfDebugID) {
22974
- if (!children) {
22975
- return children;
22991
+ findRenderedDOMComponentWithTag: function (root, tagName) {
22992
+ var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
22993
+ if (all.length !== 1) {
22994
+ throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
22976
22995
  }
22996
+ return all[0];
22997
+ },
22977
22998
 
22978
- if (process.env.NODE_ENV !== 'production') {
22979
- return flattenChildren(children, selfDebugID);
22980
- }
22999
+ /**
23000
+ * Finds all instances of components with type equal to `componentType`.
23001
+ * @return {array} an array of all the matches.
23002
+ */
23003
+ scryRenderedComponentsWithType: function (root, componentType) {
23004
+ return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
23005
+ return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
23006
+ });
23007
+ },
22981
23008
 
22982
- return flattenChildren(children);
23009
+ /**
23010
+ * Same as `scryRenderedComponentsWithType` but expects there to be one result
23011
+ * and returns that one result, or throws exception if there is any other
23012
+ * number of matches besides one.
23013
+ * @return {!ReactComponent} The one match.
23014
+ */
23015
+ findRenderedComponentWithType: function (root, componentType) {
23016
+ var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
23017
+ if (all.length !== 1) {
23018
+ throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
23019
+ }
23020
+ return all[0];
22983
23021
  },
22984
23022
 
22985
23023
  /**
22986
- * When you're adding or removing children some may be added or removed in the
22987
- * same render pass. We want to show *both* since we want to simultaneously
22988
- * animate elements in and out. This function takes a previous set of keys
22989
- * and a new set of keys and merges them with its best guess of the correct
22990
- * ordering. In the future we may expose some of the utilities in
22991
- * ReactMultiChild to make this easy, but for now React itself does not
22992
- * directly have this concept of the union of prevChildren and nextChildren
22993
- * so we implement it here.
23024
+ * Pass a mocked component module to this method to augment it with
23025
+ * useful methods that allow it to be used as a dummy React component.
23026
+ * Instead of rendering as usual, the component will become a simple
23027
+ * <div> containing any provided children.
22994
23028
  *
22995
- * @param {object} prev prev children as returned from
22996
- * `ReactTransitionChildMapping.getChildMapping()`.
22997
- * @param {object} next next children as returned from
22998
- * `ReactTransitionChildMapping.getChildMapping()`.
22999
- * @return {object} a key set that contains all keys in `prev` and all keys
23000
- * in `next` in a reasonable order.
23029
+ * @param {object} module the mock function object exported from a
23030
+ * module that defines the component to be mocked
23031
+ * @param {?string} mockTagName optional dummy root tag name to return
23032
+ * from render method (overrides
23033
+ * module.mockTagName if provided)
23034
+ * @return {object} the ReactTestUtils object (for chaining)
23001
23035
  */
23002
- mergeChildMappings: function (prev, next) {
23003
- prev = prev || {};
23004
- next = next || {};
23005
-
23006
- function getValueForKey(key) {
23007
- if (next.hasOwnProperty(key)) {
23008
- return next[key];
23009
- } else {
23010
- return prev[key];
23011
- }
23012
- }
23036
+ mockComponent: function (module, mockTagName) {
23037
+ mockTagName = mockTagName || module.mockTagName || 'div';
23013
23038
 
23014
- // For each key of `next`, the list of keys to insert before that key in
23015
- // the combined list
23016
- var nextKeysPending = {};
23039
+ module.prototype.render.mockImplementation(function () {
23040
+ return React.createElement(mockTagName, null, this.props.children);
23041
+ });
23017
23042
 
23018
- var pendingKeys = [];
23019
- for (var prevKey in prev) {
23020
- if (next.hasOwnProperty(prevKey)) {
23021
- if (pendingKeys.length) {
23022
- nextKeysPending[prevKey] = pendingKeys;
23023
- pendingKeys = [];
23024
- }
23025
- } else {
23026
- pendingKeys.push(prevKey);
23027
- }
23028
- }
23043
+ return this;
23044
+ },
23029
23045
 
23030
- var i;
23031
- var childMapping = {};
23032
- for (var nextKey in next) {
23033
- if (nextKeysPending.hasOwnProperty(nextKey)) {
23034
- for (i = 0; i < nextKeysPending[nextKey].length; i++) {
23035
- var pendingNextKey = nextKeysPending[nextKey][i];
23036
- childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
23037
- }
23038
- }
23039
- childMapping[nextKey] = getValueForKey(nextKey);
23040
- }
23046
+ /**
23047
+ * Simulates a top level event being dispatched from a raw event that occurred
23048
+ * on an `Element` node.
23049
+ * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
23050
+ * @param {!Element} node The dom to simulate an event occurring on.
23051
+ * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
23052
+ */
23053
+ simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
23054
+ fakeNativeEvent.target = node;
23055
+ ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
23056
+ },
23041
23057
 
23042
- // Finally, add the keys which didn't appear before any key in `next`
23043
- for (i = 0; i < pendingKeys.length; i++) {
23044
- childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
23045
- }
23058
+ /**
23059
+ * Simulates a top level event being dispatched from a raw event that occurred
23060
+ * on the `ReactDOMComponent` `comp`.
23061
+ * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
23062
+ * @param {!ReactDOMComponent} comp
23063
+ * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
23064
+ */
23065
+ simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
23066
+ ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
23067
+ },
23046
23068
 
23047
- return childMapping;
23048
- }
23049
- };
23069
+ nativeTouchData: function (x, y) {
23070
+ return {
23071
+ touches: [{ pageX: x, pageY: y }]
23072
+ };
23073
+ },
23050
23074
 
23051
- module.exports = ReactTransitionChildMapping;
23052
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
23075
+ createRenderer: function () {
23076
+ return new ReactShallowRenderer();
23077
+ },
23053
23078
 
23054
- /***/ },
23055
- /* 187 */
23056
- /***/ function(module, exports, __webpack_require__) {
23079
+ Simulate: null,
23080
+ SimulateNative: {}
23081
+ };
23057
23082
 
23058
- /* WEBPACK VAR INJECTION */(function(process) {/**
23059
- * Copyright 2013-present, Facebook, Inc.
23060
- * All rights reserved.
23061
- *
23062
- * This source code is licensed under the BSD-style license found in the
23063
- * LICENSE file in the root directory of this source tree. An additional grant
23064
- * of patent rights can be found in the PATENTS file in the same directory.
23083
+ /**
23084
+ * Exports:
23065
23085
  *
23066
- *
23086
+ * - `ReactTestUtils.Simulate.click(Element/ReactDOMComponent)`
23087
+ * - `ReactTestUtils.Simulate.mouseMove(Element/ReactDOMComponent)`
23088
+ * - `ReactTestUtils.Simulate.change(Element/ReactDOMComponent)`
23089
+ * - ... (All keys from event plugin `eventTypes` objects)
23067
23090
  */
23091
+ function makeSimulator(eventType) {
23092
+ return function (domComponentOrNode, eventData) {
23093
+ var node;
23094
+ !!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;
23095
+ if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
23096
+ node = findDOMNode(domComponentOrNode);
23097
+ } else if (domComponentOrNode.tagName) {
23098
+ node = domComponentOrNode;
23099
+ }
23068
23100
 
23069
- 'use strict';
23070
-
23071
- var KeyEscapeUtils = __webpack_require__(17);
23072
- var traverseAllChildren = __webpack_require__(15);
23073
- var warning = __webpack_require__(11);
23101
+ var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
23074
23102
 
23075
- var ReactComponentTreeHook;
23103
+ var fakeNativeEvent = new Event();
23104
+ fakeNativeEvent.target = node;
23105
+ fakeNativeEvent.type = eventType.toLowerCase();
23076
23106
 
23077
- if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
23078
- // Temporary hack.
23079
- // Inline requires don't work well with Jest:
23080
- // https://github.com/facebook/react/issues/7240
23081
- // Remove the inline requires when we don't need them anymore:
23082
- // https://github.com/facebook/react/pull/7178
23083
- ReactComponentTreeHook = __webpack_require__(26);
23084
- }
23107
+ // We don't use SyntheticEvent.getPooled in order to not have to worry about
23108
+ // properly destroying any properties assigned from `eventData` upon release
23109
+ var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
23110
+ // Since we aren't using pooling, always persist the event. This will make
23111
+ // sure it's marked and won't warn when setting additional properties.
23112
+ event.persist();
23113
+ _assign(event, eventData);
23085
23114
 
23086
- /**
23087
- * @param {function} traverseContext Context passed through traversal.
23088
- * @param {?ReactComponent} child React child component.
23089
- * @param {!string} name String name of key path to child.
23090
- * @param {number=} selfDebugID Optional debugID of the current internal instance.
23091
- */
23092
- function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
23093
- // We found a component instance.
23094
- if (traverseContext && typeof traverseContext === 'object') {
23095
- var result = traverseContext;
23096
- var keyUnique = result[name] === undefined;
23097
- if (process.env.NODE_ENV !== 'production') {
23098
- if (!ReactComponentTreeHook) {
23099
- ReactComponentTreeHook = __webpack_require__(26);
23100
- }
23101
- if (!keyUnique) {
23102
- process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
23103
- }
23104
- }
23105
- if (keyUnique && child != null) {
23106
- result[name] = child;
23115
+ if (dispatchConfig.phasedRegistrationNames) {
23116
+ EventPropagators.accumulateTwoPhaseDispatches(event);
23117
+ } else {
23118
+ EventPropagators.accumulateDirectDispatches(event);
23107
23119
  }
23108
- }
23120
+
23121
+ ReactUpdates.batchedUpdates(function () {
23122
+ EventPluginHub.enqueueEvents(event);
23123
+ EventPluginHub.processEventQueue(true);
23124
+ });
23125
+ };
23109
23126
  }
23110
23127
 
23111
- /**
23112
- * Flattens children that are typically specified as `props.children`. Any null
23113
- * children will not be included in the resulting object.
23114
- * @return {!object} flattened children keyed by name.
23115
- */
23116
- function flattenChildren(children, selfDebugID) {
23117
- if (children == null) {
23118
- return children;
23119
- }
23120
- var result = {};
23128
+ function buildSimulators() {
23129
+ ReactTestUtils.Simulate = {};
23121
23130
 
23122
- if (process.env.NODE_ENV !== 'production') {
23123
- traverseAllChildren(children, function (traverseContext, child, name) {
23124
- return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
23125
- }, result);
23126
- } else {
23127
- traverseAllChildren(children, flattenSingleChildIntoContext, result);
23131
+ var eventType;
23132
+ for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
23133
+ /**
23134
+ * @param {!Element|ReactDOMComponent} domComponentOrNode
23135
+ * @param {?object} eventData Fake event data to use in SyntheticEvent.
23136
+ */
23137
+ ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
23128
23138
  }
23129
- return result;
23130
23139
  }
23131
23140
 
23132
- module.exports = flattenChildren;
23133
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
23134
-
23135
- /***/ },
23136
- /* 188 */
23137
- /***/ function(module, exports, __webpack_require__) {
23138
-
23139
- module.exports = __webpack_require__(189);
23141
+ // Rebuild ReactTestUtils.Simulate whenever event plugins are injected
23142
+ var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
23143
+ EventPluginHub.injection.injectEventPluginOrder = function () {
23144
+ oldInjectEventPluginOrder.apply(this, arguments);
23145
+ buildSimulators();
23146
+ };
23147
+ var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
23148
+ EventPluginHub.injection.injectEventPluginsByName = function () {
23149
+ oldInjectEventPlugins.apply(this, arguments);
23150
+ buildSimulators();
23151
+ };
23140
23152
 
23141
- /***/ },
23142
- /* 189 */
23143
- /***/ function(module, exports, __webpack_require__) {
23153
+ buildSimulators();
23144
23154
 
23145
23155
  /**
23146
- * Copyright 2013-present, Facebook, Inc.
23147
- * All rights reserved.
23156
+ * Exports:
23148
23157
  *
23149
- * This source code is licensed under the BSD-style license found in the
23150
- * LICENSE file in the root directory of this source tree. An additional grant
23151
- * of patent rights can be found in the PATENTS file in the same directory.
23158
+ * - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
23159
+ * - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
23160
+ * - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
23161
+ * - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
23162
+ * - ... (All keys from `EventConstants.topLevelTypes`)
23152
23163
  *
23164
+ * Note: Top level event types are a subset of the entire set of handler types
23165
+ * (which include a broader set of "synthetic" events). For example, onDragDone
23166
+ * is a synthetic event. Except when testing an event plugin or React's event
23167
+ * handling code specifically, you probably want to use ReactTestUtils.Simulate
23168
+ * to dispatch synthetic events.
23153
23169
  */
23154
23170
 
23155
- 'use strict';
23156
-
23157
- var _assign = __webpack_require__(4);
23158
-
23159
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23160
-
23161
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
23162
-
23163
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
23164
-
23165
- var React = __webpack_require__(2);
23166
-
23167
- var ReactTransitionGroup = __webpack_require__(180);
23168
- var ReactCSSTransitionGroupChild = __webpack_require__(190);
23169
-
23170
- function createTransitionTimeoutPropValidator(transitionType) {
23171
- var timeoutPropName = 'transition' + transitionType + 'Timeout';
23172
- var enabledPropName = 'transition' + transitionType;
23173
-
23174
- return function (props) {
23175
- // If the transition is enabled
23176
- if (props[enabledPropName]) {
23177
- // If no timeout duration is provided
23178
- if (props[timeoutPropName] == null) {
23179
- return new Error(timeoutPropName + ' wasn\'t supplied to ReactCSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.');
23180
-
23181
- // If the duration isn't a number
23182
- } else if (typeof props[timeoutPropName] !== 'number') {
23183
- return new Error(timeoutPropName + ' must be a number (in milliseconds)');
23184
- }
23171
+ function makeNativeSimulator(eventType) {
23172
+ return function (domComponentOrNode, nativeEventData) {
23173
+ var fakeNativeEvent = new Event(eventType);
23174
+ _assign(fakeNativeEvent, nativeEventData);
23175
+ if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
23176
+ ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
23177
+ } else if (domComponentOrNode.tagName) {
23178
+ // Will allow on actual dom nodes.
23179
+ ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
23185
23180
  }
23186
23181
  };
23187
23182
  }
23188
23183
 
23189
- /**
23190
- * An easy way to perform CSS transitions and animations when a React component
23191
- * enters or leaves the DOM.
23192
- * See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
23193
- */
23194
-
23195
- var ReactCSSTransitionGroup = function (_React$Component) {
23196
- _inherits(ReactCSSTransitionGroup, _React$Component);
23197
-
23198
- function ReactCSSTransitionGroup() {
23199
- var _temp, _this, _ret;
23200
-
23201
- _classCallCheck(this, ReactCSSTransitionGroup);
23202
-
23203
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
23204
- args[_key] = arguments[_key];
23205
- }
23184
+ Object.keys(topLevelTypes).forEach(function (eventType) {
23185
+ // Event type is stored as 'topClick' - we transform that to 'click'
23186
+ var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
23187
+ /**
23188
+ * @param {!Element|ReactDOMComponent} domComponentOrNode
23189
+ * @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
23190
+ */
23191
+ ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
23192
+ });
23206
23193
 
23207
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this._wrapChild = function (child) {
23208
- // We need to provide this childFactory so that
23209
- // ReactCSSTransitionGroupChild can receive updates to name, enter, and
23210
- // leave while it is leaving.
23211
- return React.createElement(ReactCSSTransitionGroupChild, {
23212
- name: _this.props.transitionName,
23213
- appear: _this.props.transitionAppear,
23214
- enter: _this.props.transitionEnter,
23215
- leave: _this.props.transitionLeave,
23216
- appearTimeout: _this.props.transitionAppearTimeout,
23217
- enterTimeout: _this.props.transitionEnterTimeout,
23218
- leaveTimeout: _this.props.transitionLeaveTimeout
23219
- }, child);
23220
- }, _temp), _possibleConstructorReturn(_this, _ret);
23221
- }
23194
+ module.exports = ReactTestUtils;
23195
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
23222
23196
 
23223
- ReactCSSTransitionGroup.prototype.render = function render() {
23224
- return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
23225
- };
23197
+ /***/ },
23198
+ /* 189 */
23199
+ /***/ function(module, exports) {
23226
23200
 
23227
- return ReactCSSTransitionGroup;
23228
- }(React.Component);
23201
+ /**
23202
+ * Copyright 2013-present, Facebook, Inc.
23203
+ * All rights reserved.
23204
+ *
23205
+ * This source code is licensed under the BSD-style license found in the
23206
+ * LICENSE file in the root directory of this source tree. An additional grant
23207
+ * of patent rights can be found in the PATENTS file in the same directory.
23208
+ *
23209
+ */
23229
23210
 
23230
- ReactCSSTransitionGroup.displayName = 'ReactCSSTransitionGroup';
23231
- ReactCSSTransitionGroup.propTypes = {
23232
- transitionName: ReactCSSTransitionGroupChild.propTypes.name,
23211
+ 'use strict';
23233
23212
 
23234
- transitionAppear: React.PropTypes.bool,
23235
- transitionEnter: React.PropTypes.bool,
23236
- transitionLeave: React.PropTypes.bool,
23237
- transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
23238
- transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
23239
- transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
23240
- };
23241
- ReactCSSTransitionGroup.defaultProps = {
23242
- transitionAppear: false,
23243
- transitionEnter: true,
23244
- transitionLeave: true
23213
+ /**
23214
+ * Types of raw signals from the browser caught at the top level.
23215
+ */
23216
+ var topLevelTypes = {
23217
+ topAbort: null,
23218
+ topAnimationEnd: null,
23219
+ topAnimationIteration: null,
23220
+ topAnimationStart: null,
23221
+ topBlur: null,
23222
+ topCanPlay: null,
23223
+ topCanPlayThrough: null,
23224
+ topChange: null,
23225
+ topClick: null,
23226
+ topCompositionEnd: null,
23227
+ topCompositionStart: null,
23228
+ topCompositionUpdate: null,
23229
+ topContextMenu: null,
23230
+ topCopy: null,
23231
+ topCut: null,
23232
+ topDoubleClick: null,
23233
+ topDrag: null,
23234
+ topDragEnd: null,
23235
+ topDragEnter: null,
23236
+ topDragExit: null,
23237
+ topDragLeave: null,
23238
+ topDragOver: null,
23239
+ topDragStart: null,
23240
+ topDrop: null,
23241
+ topDurationChange: null,
23242
+ topEmptied: null,
23243
+ topEncrypted: null,
23244
+ topEnded: null,
23245
+ topError: null,
23246
+ topFocus: null,
23247
+ topInput: null,
23248
+ topInvalid: null,
23249
+ topKeyDown: null,
23250
+ topKeyPress: null,
23251
+ topKeyUp: null,
23252
+ topLoad: null,
23253
+ topLoadedData: null,
23254
+ topLoadedMetadata: null,
23255
+ topLoadStart: null,
23256
+ topMouseDown: null,
23257
+ topMouseMove: null,
23258
+ topMouseOut: null,
23259
+ topMouseOver: null,
23260
+ topMouseUp: null,
23261
+ topPaste: null,
23262
+ topPause: null,
23263
+ topPlay: null,
23264
+ topPlaying: null,
23265
+ topProgress: null,
23266
+ topRateChange: null,
23267
+ topReset: null,
23268
+ topScroll: null,
23269
+ topSeeked: null,
23270
+ topSeeking: null,
23271
+ topSelectionChange: null,
23272
+ topStalled: null,
23273
+ topSubmit: null,
23274
+ topSuspend: null,
23275
+ topTextInput: null,
23276
+ topTimeUpdate: null,
23277
+ topTouchCancel: null,
23278
+ topTouchEnd: null,
23279
+ topTouchMove: null,
23280
+ topTouchStart: null,
23281
+ topTransitionEnd: null,
23282
+ topVolumeChange: null,
23283
+ topWaiting: null,
23284
+ topWheel: null
23245
23285
  };
23246
23286
 
23287
+ var EventConstants = {
23288
+ topLevelTypes: topLevelTypes
23289
+ };
23247
23290
 
23248
- module.exports = ReactCSSTransitionGroup;
23291
+ module.exports = EventConstants;
23249
23292
 
23250
23293
  /***/ },
23251
23294
  /* 190 */
23252
23295
  /***/ function(module, exports, __webpack_require__) {
23253
23296
 
23254
- /**
23297
+ /* WEBPACK VAR INJECTION */(function(process) {/**
23255
23298
  * Copyright 2013-present, Facebook, Inc.
23256
23299
  * All rights reserved.
23257
23300
  *
@@ -23263,160 +23306,129 @@
23263
23306
 
23264
23307
  'use strict';
23265
23308
 
23266
- var React = __webpack_require__(2);
23267
- var ReactAddonsDOMDependencies = __webpack_require__(181);
23268
-
23269
- var CSSCore = __webpack_require__(191);
23270
- var ReactTransitionEvents = __webpack_require__(192);
23271
-
23272
- var onlyChild = __webpack_require__(31);
23309
+ var _prodInvariant = __webpack_require__(35),
23310
+ _assign = __webpack_require__(4);
23273
23311
 
23274
- var TICK = 17;
23312
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23275
23313
 
23276
- var ReactCSSTransitionGroupChild = React.createClass({
23277
- displayName: 'ReactCSSTransitionGroupChild',
23314
+ var React = __webpack_require__(2);
23315
+ var ReactDefaultInjection = __webpack_require__(38);
23316
+ var ReactCompositeComponent = __webpack_require__(119);
23317
+ var ReactReconciler = __webpack_require__(59);
23318
+ var ReactUpdates = __webpack_require__(56);
23278
23319
 
23279
- propTypes: {
23280
- name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
23281
- enter: React.PropTypes.string,
23282
- leave: React.PropTypes.string,
23283
- active: React.PropTypes.string
23284
- }), React.PropTypes.shape({
23285
- enter: React.PropTypes.string,
23286
- enterActive: React.PropTypes.string,
23287
- leave: React.PropTypes.string,
23288
- leaveActive: React.PropTypes.string,
23289
- appear: React.PropTypes.string,
23290
- appearActive: React.PropTypes.string
23291
- })]).isRequired,
23320
+ var emptyObject = __webpack_require__(20);
23321
+ var getNextDebugID = __webpack_require__(127);
23322
+ var invariant = __webpack_require__(8);
23292
23323
 
23293
- // Once we require timeouts to be specified, we can remove the
23294
- // boolean flags (appear etc.) and just accept a number
23295
- // or a bool for the timeout flags (appearTimeout etc.)
23296
- appear: React.PropTypes.bool,
23297
- enter: React.PropTypes.bool,
23298
- leave: React.PropTypes.bool,
23299
- appearTimeout: React.PropTypes.number,
23300
- enterTimeout: React.PropTypes.number,
23301
- leaveTimeout: React.PropTypes.number
23302
- },
23324
+ var NoopInternalComponent = function () {
23325
+ function NoopInternalComponent(element) {
23326
+ _classCallCheck(this, NoopInternalComponent);
23303
23327
 
23304
- transition: function (animationType, finishCallback, userSpecifiedDelay) {
23305
- var node = ReactAddonsDOMDependencies.getReactDOM().findDOMNode(this);
23328
+ this._renderedOutput = element;
23329
+ this._currentElement = element;
23306
23330
 
23307
- if (!node) {
23308
- if (finishCallback) {
23309
- finishCallback();
23310
- }
23311
- return;
23331
+ if (process.env.NODE_ENV !== 'production') {
23332
+ this._debugID = getNextDebugID();
23312
23333
  }
23334
+ }
23313
23335
 
23314
- var className = this.props.name[animationType] || this.props.name + '-' + animationType;
23315
- var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
23316
- var timeout = null;
23336
+ NoopInternalComponent.prototype.mountComponent = function mountComponent() {};
23317
23337
 
23318
- var endListener = function (e) {
23319
- if (e && e.target !== node) {
23320
- return;
23321
- }
23338
+ NoopInternalComponent.prototype.receiveComponent = function receiveComponent(element) {
23339
+ this._renderedOutput = element;
23340
+ this._currentElement = element;
23341
+ };
23322
23342
 
23323
- clearTimeout(timeout);
23343
+ NoopInternalComponent.prototype.unmountComponent = function unmountComponent() {};
23324
23344
 
23325
- CSSCore.removeClass(node, className);
23326
- CSSCore.removeClass(node, activeClassName);
23345
+ NoopInternalComponent.prototype.getHostNode = function getHostNode() {
23346
+ return undefined;
23347
+ };
23327
23348
 
23328
- ReactTransitionEvents.removeEndEventListener(node, endListener);
23349
+ NoopInternalComponent.prototype.getPublicInstance = function getPublicInstance() {
23350
+ return null;
23351
+ };
23329
23352
 
23330
- // Usually this optional callback is used for informing an owner of
23331
- // a leave animation and telling it to remove the child.
23332
- if (finishCallback) {
23333
- finishCallback();
23334
- }
23335
- };
23353
+ return NoopInternalComponent;
23354
+ }();
23336
23355
 
23337
- CSSCore.addClass(node, className);
23356
+ var ShallowComponentWrapper = function (element) {
23357
+ // TODO: Consolidate with instantiateReactComponent
23358
+ if (process.env.NODE_ENV !== 'production') {
23359
+ this._debugID = getNextDebugID();
23360
+ }
23361
+
23362
+ this.construct(element);
23363
+ };
23364
+ _assign(ShallowComponentWrapper.prototype, ReactCompositeComponent, {
23365
+ _constructComponent: ReactCompositeComponent._constructComponentWithoutOwner,
23366
+ _instantiateReactComponent: function (element) {
23367
+ return new NoopInternalComponent(element);
23368
+ },
23369
+ _replaceNodeWithMarkup: function () {},
23370
+ _renderValidatedComponent: ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext
23371
+ });
23338
23372
 
23339
- // Need to do this to actually trigger a transition.
23340
- this.queueClassAndNode(activeClassName, node);
23373
+ function _batchedRender(renderer, element, context) {
23374
+ var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(true);
23375
+ renderer._render(element, transaction, context);
23376
+ ReactUpdates.ReactReconcileTransaction.release(transaction);
23377
+ }
23341
23378
 
23342
- // If the user specified a timeout delay.
23343
- if (userSpecifiedDelay) {
23344
- // Clean-up the animation after the specified delay
23345
- timeout = setTimeout(endListener, userSpecifiedDelay);
23346
- this.transitionTimeouts.push(timeout);
23347
- } else {
23348
- // DEPRECATED: this listener will be removed in a future version of react
23349
- ReactTransitionEvents.addEndEventListener(node, endListener);
23350
- }
23351
- },
23379
+ var ReactShallowRenderer = function () {
23380
+ function ReactShallowRenderer() {
23381
+ _classCallCheck(this, ReactShallowRenderer);
23352
23382
 
23353
- queueClassAndNode: function (className, node) {
23354
- this.classNameAndNodeQueue.push({
23355
- className: className,
23356
- node: node
23357
- });
23383
+ this._instance = null;
23384
+ }
23358
23385
 
23359
- if (!this.timeout) {
23360
- this.timeout = setTimeout(this.flushClassNameAndNodeQueue, TICK);
23361
- }
23362
- },
23386
+ ReactShallowRenderer.prototype.getMountedInstance = function getMountedInstance() {
23387
+ return this._instance ? this._instance._instance : null;
23388
+ };
23363
23389
 
23364
- flushClassNameAndNodeQueue: function () {
23365
- if (this.isMounted()) {
23366
- this.classNameAndNodeQueue.forEach(function (obj) {
23367
- CSSCore.addClass(obj.node, obj.className);
23368
- });
23369
- }
23370
- this.classNameAndNodeQueue.length = 0;
23371
- this.timeout = null;
23372
- },
23390
+ ReactShallowRenderer.prototype.render = function render(element, context) {
23391
+ // Ensure we've done the default injections. This might not be true in the
23392
+ // case of a simple test that only requires React and the TestUtils in
23393
+ // conjunction with an inline-requires transform.
23394
+ ReactDefaultInjection.inject();
23373
23395
 
23374
- componentWillMount: function () {
23375
- this.classNameAndNodeQueue = [];
23376
- this.transitionTimeouts = [];
23377
- },
23396
+ !React.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : _prodInvariant('12', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : void 0;
23397
+ !(typeof element.type !== 'string') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (%s). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.', element.type) : _prodInvariant('13', element.type) : void 0;
23378
23398
 
23379
- componentWillUnmount: function () {
23380
- if (this.timeout) {
23381
- clearTimeout(this.timeout);
23399
+ if (!context) {
23400
+ context = emptyObject;
23382
23401
  }
23383
- this.transitionTimeouts.forEach(function (timeout) {
23384
- clearTimeout(timeout);
23385
- });
23402
+ ReactUpdates.batchedUpdates(_batchedRender, this, element, context);
23386
23403
 
23387
- this.classNameAndNodeQueue.length = 0;
23388
- },
23404
+ return this.getRenderOutput();
23405
+ };
23389
23406
 
23390
- componentWillAppear: function (done) {
23391
- if (this.props.appear) {
23392
- this.transition('appear', done, this.props.appearTimeout);
23393
- } else {
23394
- done();
23395
- }
23396
- },
23407
+ ReactShallowRenderer.prototype.getRenderOutput = function getRenderOutput() {
23408
+ return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
23409
+ };
23397
23410
 
23398
- componentWillEnter: function (done) {
23399
- if (this.props.enter) {
23400
- this.transition('enter', done, this.props.enterTimeout);
23401
- } else {
23402
- done();
23411
+ ReactShallowRenderer.prototype.unmount = function unmount() {
23412
+ if (this._instance) {
23413
+ ReactReconciler.unmountComponent(this._instance, false);
23403
23414
  }
23404
- },
23415
+ };
23405
23416
 
23406
- componentWillLeave: function (done) {
23407
- if (this.props.leave) {
23408
- this.transition('leave', done, this.props.leaveTimeout);
23417
+ ReactShallowRenderer.prototype._render = function _render(element, transaction, context) {
23418
+ if (this._instance) {
23419
+ ReactReconciler.receiveComponent(this._instance, element, transaction, context);
23409
23420
  } else {
23410
- done();
23421
+ var instance = new ShallowComponentWrapper(element);
23422
+ ReactReconciler.mountComponent(instance, transaction, null, null, context, 0);
23423
+ this._instance = instance;
23411
23424
  }
23412
- },
23425
+ };
23413
23426
 
23414
- render: function () {
23415
- return onlyChild(this.props.children);
23416
- }
23417
- });
23427
+ return ReactShallowRenderer;
23428
+ }();
23418
23429
 
23419
- module.exports = ReactCSSTransitionGroupChild;
23430
+ module.exports = ReactShallowRenderer;
23431
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
23420
23432
 
23421
23433
  /***/ },
23422
23434
  /* 191 */
@@ -23624,13 +23636,7 @@
23624
23636
 
23625
23637
  /***/ },
23626
23638
  /* 193 */
23627
- /***/ function(module, exports, __webpack_require__) {
23628
-
23629
- module.exports = __webpack_require__(194);
23630
-
23631
- /***/ },
23632
- /* 194 */
23633
- /***/ function(module, exports, __webpack_require__) {
23639
+ /***/ function(module, exports) {
23634
23640
 
23635
23641
  /**
23636
23642
  * Copyright 2013-present, Facebook, Inc.
@@ -23639,13 +23645,156 @@
23639
23645
  * This source code is licensed under the BSD-style license found in the
23640
23646
  * LICENSE file in the root directory of this source tree. An additional grant
23641
23647
  * of patent rights can be found in the PATENTS file in the same directory.
23642
- *
23643
23648
  */
23644
23649
 
23645
23650
  'use strict';
23646
23651
 
23647
- var ReactLink = __webpack_require__(195);
23648
- var ReactStateSetters = __webpack_require__(196);
23652
+ /**
23653
+ * ReactLink encapsulates a common pattern in which a component wants to modify
23654
+ * a prop received from its parent. ReactLink allows the parent to pass down a
23655
+ * value coupled with a callback that, when invoked, expresses an intent to
23656
+ * modify that value. For example:
23657
+ *
23658
+ * React.createClass({
23659
+ * getInitialState: function() {
23660
+ * return {value: ''};
23661
+ * },
23662
+ * render: function() {
23663
+ * var valueLink = new ReactLink(this.state.value, this._handleValueChange);
23664
+ * return <input valueLink={valueLink} />;
23665
+ * },
23666
+ * _handleValueChange: function(newValue) {
23667
+ * this.setState({value: newValue});
23668
+ * }
23669
+ * });
23670
+ *
23671
+ * We have provided some sugary mixins to make the creation and
23672
+ * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
23673
+ */
23674
+
23675
+ /**
23676
+ * Deprecated: An an easy way to express two-way binding with React.
23677
+ * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
23678
+ *
23679
+ * @param {*} value current value of the link
23680
+ * @param {function} requestChange callback to request a change
23681
+ */
23682
+ function ReactLink(value, requestChange) {
23683
+ this.value = value;
23684
+ this.requestChange = requestChange;
23685
+ }
23686
+
23687
+ /**
23688
+ * Creates a PropType that enforces the ReactLink API and optionally checks the
23689
+ * type of the value being passed inside the link. Example:
23690
+ *
23691
+ * MyComponent.propTypes = {
23692
+ * tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
23693
+ * }
23694
+ */
23695
+ function createLinkTypeChecker(linkType) {
23696
+ var shapes = {
23697
+ value: linkType === undefined ?
23698
+ React.PropTypes.any.isRequired :
23699
+ linkType.isRequired,
23700
+ requestChange: React.PropTypes.func.isRequired,
23701
+ };
23702
+ return React.PropTypes.shape(shapes);
23703
+ }
23704
+
23705
+ ReactLink.PropTypes = {
23706
+ link: createLinkTypeChecker,
23707
+ };
23708
+
23709
+ var ReactStateSetters = {
23710
+ /**
23711
+ * Returns a function that calls the provided function, and uses the result
23712
+ * of that to set the component's state.
23713
+ *
23714
+ * @param {ReactCompositeComponent} component
23715
+ * @param {function} funcReturningState Returned callback uses this to
23716
+ * determine how to update state.
23717
+ * @return {function} callback that when invoked uses funcReturningState to
23718
+ * determined the object literal to setState.
23719
+ */
23720
+ createStateSetter: function(component, funcReturningState) {
23721
+ return function(a, b, c, d, e, f) {
23722
+ var partialState = funcReturningState.call(component, a, b, c, d, e, f);
23723
+ if (partialState) {
23724
+ component.setState(partialState);
23725
+ }
23726
+ };
23727
+ },
23728
+
23729
+ /**
23730
+ * Returns a single-argument callback that can be used to update a single
23731
+ * key in the component's state.
23732
+ *
23733
+ * Note: this is memoized function, which makes it inexpensive to call.
23734
+ *
23735
+ * @param {ReactCompositeComponent} component
23736
+ * @param {string} key The key in the state that you should update.
23737
+ * @return {function} callback of 1 argument which calls setState() with
23738
+ * the provided keyName and callback argument.
23739
+ */
23740
+ createStateKeySetter: function(component, key) {
23741
+ // Memoize the setters.
23742
+ var cache = component.__keySetters || (component.__keySetters = {});
23743
+ return cache[key] || (cache[key] = createStateKeySetter(component, key));
23744
+ },
23745
+ };
23746
+
23747
+ function createStateKeySetter(component, key) {
23748
+ // Partial state is allocated outside of the function closure so it can be
23749
+ // reused with every call, avoiding memory allocation when this function
23750
+ // is called.
23751
+ var partialState = {};
23752
+ return function stateKeySetter(value) {
23753
+ partialState[key] = value;
23754
+ component.setState(partialState);
23755
+ };
23756
+ }
23757
+
23758
+ ReactStateSetters.Mixin = {
23759
+ /**
23760
+ * Returns a function that calls the provided function, and uses the result
23761
+ * of that to set the component's state.
23762
+ *
23763
+ * For example, these statements are equivalent:
23764
+ *
23765
+ * this.setState({x: 1});
23766
+ * this.createStateSetter(function(xValue) {
23767
+ * return {x: xValue};
23768
+ * })(1);
23769
+ *
23770
+ * @param {function} funcReturningState Returned callback uses this to
23771
+ * determine how to update state.
23772
+ * @return {function} callback that when invoked uses funcReturningState to
23773
+ * determined the object literal to setState.
23774
+ */
23775
+ createStateSetter: function(funcReturningState) {
23776
+ return ReactStateSetters.createStateSetter(this, funcReturningState);
23777
+ },
23778
+
23779
+ /**
23780
+ * Returns a single-argument callback that can be used to update a single
23781
+ * key in the component's state.
23782
+ *
23783
+ * For example, these statements are equivalent:
23784
+ *
23785
+ * this.setState({x: 1});
23786
+ * this.createStateKeySetter('x')(1);
23787
+ *
23788
+ * Note: this is memoized function, which makes it inexpensive to call.
23789
+ *
23790
+ * @param {string} key The key in the state that you should update.
23791
+ * @return {function} callback of 1 argument which calls setState() with
23792
+ * the provided keyName and callback argument.
23793
+ */
23794
+ createStateKeySetter: function(key) {
23795
+ return ReactStateSetters.createStateKeySetter(this, key);
23796
+ },
23797
+ };
23649
23798
 
23650
23799
  /**
23651
23800
  * A simple mixin around ReactLink.forState().
@@ -23660,284 +23809,466 @@
23660
23809
  * @param {string} key state key to update.
23661
23810
  * @return {ReactLink} ReactLink instance linking to the state.
23662
23811
  */
23663
- linkState: function (key) {
23664
- return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key));
23665
- }
23812
+ linkState: function(key) {
23813
+ return new ReactLink(
23814
+ this.state[key],
23815
+ ReactStateSetters.createStateKeySetter(this, key)
23816
+ );
23817
+ },
23666
23818
  };
23667
23819
 
23668
23820
  module.exports = LinkedStateMixin;
23669
23821
 
23822
+
23670
23823
  /***/ },
23671
- /* 195 */
23824
+ /* 194 */
23672
23825
  /***/ function(module, exports, __webpack_require__) {
23673
23826
 
23674
- /**
23675
- * Copyright 2013-present, Facebook, Inc.
23827
+ /* WEBPACK VAR INJECTION */(function(process) {/**
23828
+ * Copyright 2015-present, Facebook, Inc.
23676
23829
  * All rights reserved.
23677
23830
  *
23678
23831
  * This source code is licensed under the BSD-style license found in the
23679
23832
  * LICENSE file in the root directory of this source tree. An additional grant
23680
23833
  * of patent rights can be found in the PATENTS file in the same directory.
23681
23834
  *
23835
+ * @providesModule createReactFragment
23682
23836
  */
23683
23837
 
23684
23838
  'use strict';
23685
23839
 
23686
- /**
23687
- * ReactLink encapsulates a common pattern in which a component wants to modify
23688
- * a prop received from its parent. ReactLink allows the parent to pass down a
23689
- * value coupled with a callback that, when invoked, expresses an intent to
23690
- * modify that value. For example:
23691
- *
23692
- * React.createClass({
23693
- * getInitialState: function() {
23694
- * return {value: ''};
23695
- * },
23696
- * render: function() {
23697
- * var valueLink = new ReactLink(this.state.value, this._handleValueChange);
23698
- * return <input valueLink={valueLink} />;
23699
- * },
23700
- * _handleValueChange: function(newValue) {
23701
- * this.setState({value: newValue});
23702
- * }
23703
- * });
23704
- *
23705
- * We have provided some sugary mixins to make the creation and
23706
- * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
23707
- */
23840
+ var React = __webpack_require__(1);
23708
23841
 
23709
- var React = __webpack_require__(2);
23842
+ var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
23843
+ Symbol.for &&
23844
+ Symbol.for('react.element')) ||
23845
+ 0xeac7;
23710
23846
 
23711
- /**
23712
- * Deprecated: An an easy way to express two-way binding with React.
23713
- * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
23714
- *
23715
- * @param {*} value current value of the link
23716
- * @param {function} requestChange callback to request a change
23717
- */
23718
- function ReactLink(value, requestChange) {
23719
- this.value = value;
23720
- this.requestChange = requestChange;
23847
+ function makeEmptyFunction(arg) {
23848
+ return function () {
23849
+ return arg;
23850
+ };
23721
23851
  }
23852
+ var emptyFunction = function emptyFunction() {};
23853
+ emptyFunction.thatReturns = makeEmptyFunction;
23854
+ emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
23855
+ emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
23856
+ emptyFunction.thatReturnsNull = makeEmptyFunction(null);
23857
+ emptyFunction.thatReturnsThis = function () {
23858
+ return this;
23859
+ };
23860
+ emptyFunction.thatReturnsArgument = function (arg) {
23861
+ return arg;
23862
+ };
23722
23863
 
23723
- /**
23724
- * Creates a PropType that enforces the ReactLink API and optionally checks the
23725
- * type of the value being passed inside the link. Example:
23726
- *
23727
- * MyComponent.propTypes = {
23728
- * tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
23729
- * }
23730
- */
23731
- function createLinkTypeChecker(linkType) {
23732
- var shapes = {
23733
- value: linkType === undefined ? React.PropTypes.any.isRequired : linkType.isRequired,
23734
- requestChange: React.PropTypes.func.isRequired
23864
+ var validateFormat = function validateFormat(format) {};
23865
+
23866
+ if (process.env.NODE_ENV !== 'production') {
23867
+ validateFormat = function validateFormat(format) {
23868
+ if (format === undefined) {
23869
+ throw new Error('invariant requires an error message argument');
23870
+ }
23735
23871
  };
23736
- return React.PropTypes.shape(shapes);
23737
23872
  }
23738
23873
 
23739
- ReactLink.PropTypes = {
23740
- link: createLinkTypeChecker
23741
- };
23874
+ function invariant(condition, format, a, b, c, d, e, f) {
23875
+ validateFormat(format);
23742
23876
 
23743
- module.exports = ReactLink;
23877
+ if (!condition) {
23878
+ var error;
23879
+ if (format === undefined) {
23880
+ error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
23881
+ } else {
23882
+ var args = [a, b, c, d, e, f];
23883
+ var argIndex = 0;
23884
+ error = new Error(format.replace(/%s/g, function () {
23885
+ return args[argIndex++];
23886
+ }));
23887
+ error.name = 'Invariant Violation';
23888
+ }
23744
23889
 
23745
- /***/ },
23746
- /* 196 */
23747
- /***/ function(module, exports) {
23890
+ error.framesToPop = 1; // we don't care about invariant's own frame
23891
+ throw error;
23892
+ }
23893
+ }
23748
23894
 
23749
- /**
23750
- * Copyright 2013-present, Facebook, Inc.
23751
- * All rights reserved.
23752
- *
23753
- * This source code is licensed under the BSD-style license found in the
23754
- * LICENSE file in the root directory of this source tree. An additional grant
23755
- * of patent rights can be found in the PATENTS file in the same directory.
23756
- *
23757
- */
23895
+ var warning = emptyFunction;
23758
23896
 
23759
- 'use strict';
23897
+ if (process.env.NODE_ENV !== 'production') {
23898
+ (function () {
23899
+ var printWarning = function printWarning(format) {
23900
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
23901
+ args[_key - 1] = arguments[_key];
23902
+ }
23760
23903
 
23761
- var ReactStateSetters = {
23762
- /**
23763
- * Returns a function that calls the provided function, and uses the result
23764
- * of that to set the component's state.
23765
- *
23766
- * @param {ReactCompositeComponent} component
23767
- * @param {function} funcReturningState Returned callback uses this to
23768
- * determine how to update state.
23769
- * @return {function} callback that when invoked uses funcReturningState to
23770
- * determined the object literal to setState.
23771
- */
23772
- createStateSetter: function (component, funcReturningState) {
23773
- return function (a, b, c, d, e, f) {
23774
- var partialState = funcReturningState.call(component, a, b, c, d, e, f);
23775
- if (partialState) {
23776
- component.setState(partialState);
23904
+ var argIndex = 0;
23905
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
23906
+ return args[argIndex++];
23907
+ });
23908
+ if (typeof console !== 'undefined') {
23909
+ console.error(message);
23777
23910
  }
23911
+ try {
23912
+ // --- Welcome to debugging React ---
23913
+ // This error was thrown as a convenience so that you can use this stack
23914
+ // to find the callsite that caused this warning to fire.
23915
+ throw new Error(message);
23916
+ } catch (x) {}
23778
23917
  };
23779
- },
23780
23918
 
23781
- /**
23782
- * Returns a single-argument callback that can be used to update a single
23783
- * key in the component's state.
23784
- *
23785
- * Note: this is memoized function, which makes it inexpensive to call.
23786
- *
23787
- * @param {ReactCompositeComponent} component
23788
- * @param {string} key The key in the state that you should update.
23789
- * @return {function} callback of 1 argument which calls setState() with
23790
- * the provided keyName and callback argument.
23791
- */
23792
- createStateKeySetter: function (component, key) {
23793
- // Memoize the setters.
23794
- var cache = component.__keySetters || (component.__keySetters = {});
23795
- return cache[key] || (cache[key] = createStateKeySetter(component, key));
23919
+ warning = function warning(condition, format) {
23920
+ if (format === undefined) {
23921
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
23922
+ }
23923
+
23924
+ if (format.indexOf('Failed Composite propType: ') === 0) {
23925
+ return; // Ignore CompositeComponent proptype check.
23926
+ }
23927
+
23928
+ if (!condition) {
23929
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
23930
+ args[_key2 - 2] = arguments[_key2];
23931
+ }
23932
+
23933
+ printWarning.apply(undefined, [format].concat(args));
23934
+ }
23935
+ };
23936
+ })();
23937
+ }
23938
+
23939
+ var SEPARATOR = '.';
23940
+ var SUBSEPARATOR = ':';
23941
+
23942
+ var didWarnAboutMaps = false;
23943
+
23944
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
23945
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
23946
+
23947
+ function getIteratorFn(maybeIterable) {
23948
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
23949
+ if (typeof iteratorFn === 'function') {
23950
+ return iteratorFn;
23951
+ }
23952
+ }
23953
+
23954
+ function escape(key) {
23955
+ var escapeRegex = /[=:]/g;
23956
+ var escaperLookup = {
23957
+ '=': '=0',
23958
+ ':': '=2'
23959
+ };
23960
+ var escapedString = ('' + key).replace(escapeRegex, function(match) {
23961
+ return escaperLookup[match];
23962
+ });
23963
+
23964
+ return '$' + escapedString;
23965
+ }
23966
+
23967
+ function getComponentKey(component, index) {
23968
+ // Do some typechecking here since we call this blindly. We want to ensure
23969
+ // that we don't block potential future ES APIs.
23970
+ if (component && typeof component === 'object' && component.key != null) {
23971
+ // Explicit key
23972
+ return escape(component.key);
23973
+ }
23974
+ // Implicit key determined by the index in the set
23975
+ return index.toString(36);
23976
+ }
23977
+
23978
+ function traverseAllChildrenImpl(
23979
+ children,
23980
+ nameSoFar,
23981
+ callback,
23982
+ traverseContext
23983
+ ) {
23984
+ var type = typeof children;
23985
+
23986
+ if (type === 'undefined' || type === 'boolean') {
23987
+ // All of the above are perceived as null.
23988
+ children = null;
23989
+ }
23990
+
23991
+ if (
23992
+ children === null ||
23993
+ type === 'string' ||
23994
+ type === 'number' ||
23995
+ // The following is inlined from ReactElement. This means we can optimize
23996
+ // some checks. React Fiber also inlines this logic for similar purposes.
23997
+ (type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE)
23998
+ ) {
23999
+ callback(
24000
+ traverseContext,
24001
+ children,
24002
+ // If it's the only child, treat the name as if it was wrapped in an array
24003
+ // so that it's consistent if the number of children grows.
24004
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar
24005
+ );
24006
+ return 1;
24007
+ }
24008
+
24009
+ var child;
24010
+ var nextName;
24011
+ var subtreeCount = 0; // Count of children found in the current subtree.
24012
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
24013
+
24014
+ if (Array.isArray(children)) {
24015
+ for (var i = 0; i < children.length; i++) {
24016
+ child = children[i];
24017
+ nextName = nextNamePrefix + getComponentKey(child, i);
24018
+ subtreeCount += traverseAllChildrenImpl(
24019
+ child,
24020
+ nextName,
24021
+ callback,
24022
+ traverseContext
24023
+ );
24024
+ }
24025
+ } else {
24026
+ var iteratorFn = getIteratorFn(children);
24027
+ if (iteratorFn) {
24028
+ if (process.env.NODE_ENV !== "production") {
24029
+ // Warn about using Maps as children
24030
+ if (iteratorFn === children.entries) {
24031
+ warning(
24032
+ didWarnAboutMaps,
24033
+ 'Using Maps as children is unsupported and will likely yield ' +
24034
+ 'unexpected results. Convert it to a sequence/iterable of keyed ' +
24035
+ 'ReactElements instead.'
24036
+ );
24037
+ didWarnAboutMaps = true;
24038
+ }
24039
+ }
24040
+
24041
+ var iterator = iteratorFn.call(children);
24042
+ var step;
24043
+ var ii = 0;
24044
+ while (!(step = iterator.next()).done) {
24045
+ child = step.value;
24046
+ nextName = nextNamePrefix + getComponentKey(child, ii++);
24047
+ subtreeCount += traverseAllChildrenImpl(
24048
+ child,
24049
+ nextName,
24050
+ callback,
24051
+ traverseContext
24052
+ );
24053
+ }
24054
+ } else if (type === 'object') {
24055
+ var addendum = '';
24056
+ if (process.env.NODE_ENV !== "production") {
24057
+ addendum = ' If you meant to render a collection of children, use an array ' +
24058
+ 'instead or wrap the object using createFragment(object) from the ' +
24059
+ 'React add-ons.';
24060
+ }
24061
+ var childrenString = '' + children;
24062
+ invariant(
24063
+ false,
24064
+ 'Objects are not valid as a React child (found: %s).%s',
24065
+ childrenString === '[object Object]'
24066
+ ? 'object with keys {' + Object.keys(children).join(', ') + '}'
24067
+ : childrenString,
24068
+ addendum
24069
+ );
24070
+ }
24071
+ }
24072
+
24073
+ return subtreeCount;
24074
+ }
24075
+
24076
+ function traverseAllChildren(children, callback, traverseContext) {
24077
+ if (children == null) {
24078
+ return 0;
23796
24079
  }
23797
- };
23798
24080
 
23799
- function createStateKeySetter(component, key) {
23800
- // Partial state is allocated outside of the function closure so it can be
23801
- // reused with every call, avoiding memory allocation when this function
23802
- // is called.
23803
- var partialState = {};
23804
- return function stateKeySetter(value) {
23805
- partialState[key] = value;
23806
- component.setState(partialState);
23807
- };
24081
+ return traverseAllChildrenImpl(children, '', callback, traverseContext);
23808
24082
  }
23809
24083
 
23810
- ReactStateSetters.Mixin = {
23811
- /**
23812
- * Returns a function that calls the provided function, and uses the result
23813
- * of that to set the component's state.
23814
- *
23815
- * For example, these statements are equivalent:
23816
- *
23817
- * this.setState({x: 1});
23818
- * this.createStateSetter(function(xValue) {
23819
- * return {x: xValue};
23820
- * })(1);
23821
- *
23822
- * @param {function} funcReturningState Returned callback uses this to
23823
- * determine how to update state.
23824
- * @return {function} callback that when invoked uses funcReturningState to
23825
- * determined the object literal to setState.
23826
- */
23827
- createStateSetter: function (funcReturningState) {
23828
- return ReactStateSetters.createStateSetter(this, funcReturningState);
23829
- },
24084
+ var userProvidedKeyEscapeRegex = /\/+/g;
24085
+ function escapeUserProvidedKey(text) {
24086
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
24087
+ }
23830
24088
 
23831
- /**
23832
- * Returns a single-argument callback that can be used to update a single
23833
- * key in the component's state.
23834
- *
23835
- * For example, these statements are equivalent:
23836
- *
23837
- * this.setState({x: 1});
23838
- * this.createStateKeySetter('x')(1);
23839
- *
23840
- * Note: this is memoized function, which makes it inexpensive to call.
23841
- *
23842
- * @param {string} key The key in the state that you should update.
23843
- * @return {function} callback of 1 argument which calls setState() with
23844
- * the provided keyName and callback argument.
23845
- */
23846
- createStateKeySetter: function (key) {
23847
- return ReactStateSetters.createStateKeySetter(this, key);
23848
- }
24089
+ function cloneAndReplaceKey(oldElement, newKey) {
24090
+ return React.cloneElement(
24091
+ oldElement,
24092
+ { key: newKey },
24093
+ oldElement.props !== undefined
24094
+ ? oldElement.props.children
24095
+ : undefined
24096
+ );
23849
24097
  };
23850
24098
 
23851
- module.exports = ReactStateSetters;
23852
-
23853
- /***/ },
23854
- /* 197 */
23855
- /***/ function(module, exports, __webpack_require__) {
24099
+ var DEFAULT_POOL_SIZE = 10;
24100
+ var DEFAULT_POOLER = oneArgumentPooler;
23856
24101
 
23857
- module.exports = __webpack_require__(198).create;
24102
+ var oneArgumentPooler = function(copyFieldsFrom) {
24103
+ var Klass = this;
24104
+ if (Klass.instancePool.length) {
24105
+ var instance = Klass.instancePool.pop();
24106
+ Klass.call(instance, copyFieldsFrom);
24107
+ return instance;
24108
+ } else {
24109
+ return new Klass(copyFieldsFrom);
24110
+ }
24111
+ };
23858
24112
 
23859
- /***/ },
23860
- /* 198 */
23861
- /***/ function(module, exports, __webpack_require__) {
24113
+ var addPoolingTo = function addPoolingTo(
24114
+ CopyConstructor,
24115
+ pooler
24116
+ ) {
24117
+ // Casting as any so that flow ignores the actual implementation and trusts
24118
+ // it to match the type we declared
24119
+ var NewKlass = CopyConstructor;
24120
+ NewKlass.instancePool = [];
24121
+ NewKlass.getPooled = pooler || DEFAULT_POOLER;
24122
+ if (!NewKlass.poolSize) {
24123
+ NewKlass.poolSize = DEFAULT_POOL_SIZE;
24124
+ }
24125
+ NewKlass.release = standardReleaser;
24126
+ return NewKlass;
24127
+ };
23862
24128
 
23863
- /* WEBPACK VAR INJECTION */(function(process) {/**
23864
- * Copyright 2015-present, Facebook, Inc.
23865
- * All rights reserved.
23866
- *
23867
- * This source code is licensed under the BSD-style license found in the
23868
- * LICENSE file in the root directory of this source tree. An additional grant
23869
- * of patent rights can be found in the PATENTS file in the same directory.
23870
- *
23871
- */
24129
+ var standardReleaser = function standardReleaser(instance) {
24130
+ var Klass = this;
24131
+ invariant(
24132
+ instance instanceof Klass,
24133
+ 'Trying to release an instance into a pool of a different type.'
24134
+ );
24135
+ instance.destructor();
24136
+ if (Klass.instancePool.length < Klass.poolSize) {
24137
+ Klass.instancePool.push(instance);
24138
+ }
24139
+ };
23872
24140
 
23873
- 'use strict';
24141
+ var fourArgumentPooler = function fourArgumentPooler(a1, a2, a3, a4) {
24142
+ var Klass = this;
24143
+ if (Klass.instancePool.length) {
24144
+ var instance = Klass.instancePool.pop();
24145
+ Klass.call(instance, a1, a2, a3, a4);
24146
+ return instance;
24147
+ } else {
24148
+ return new Klass(a1, a2, a3, a4);
24149
+ }
24150
+ };
23874
24151
 
23875
- var _prodInvariant = __webpack_require__(7);
24152
+ function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
24153
+ this.result = mapResult;
24154
+ this.keyPrefix = keyPrefix;
24155
+ this.func = mapFunction;
24156
+ this.context = mapContext;
24157
+ this.count = 0;
24158
+ }
24159
+ MapBookKeeping.prototype.destructor = function() {
24160
+ this.result = null;
24161
+ this.keyPrefix = null;
24162
+ this.func = null;
24163
+ this.context = null;
24164
+ this.count = 0;
24165
+ };
24166
+ addPoolingTo(MapBookKeeping, fourArgumentPooler);
23876
24167
 
23877
- var ReactChildren = __webpack_require__(5);
23878
- var ReactElement = __webpack_require__(9);
24168
+ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
24169
+ var result = bookKeeping.result;
24170
+ var keyPrefix = bookKeeping.keyPrefix;
24171
+ var func = bookKeeping.func;
24172
+ var context = bookKeeping.context;
23879
24173
 
23880
- var emptyFunction = __webpack_require__(12);
23881
- var invariant = __webpack_require__(8);
23882
- var warning = __webpack_require__(11);
24174
+ var mappedChild = func.call(context, child, bookKeeping.count++);
24175
+ if (Array.isArray(mappedChild)) {
24176
+ mapIntoWithKeyPrefixInternal(
24177
+ mappedChild,
24178
+ result,
24179
+ childKey,
24180
+ emptyFunction.thatReturnsArgument
24181
+ );
24182
+ } else if (mappedChild != null) {
24183
+ if (React.isValidElement(mappedChild)) {
24184
+ mappedChild = cloneAndReplaceKey(
24185
+ mappedChild,
24186
+ // Keep both the (mapped) and old keys if they differ, just as
24187
+ // traverseAllChildren used to do for objects as children
24188
+ keyPrefix +
24189
+ (mappedChild.key && (!child || child.key !== mappedChild.key)
24190
+ ? escapeUserProvidedKey(mappedChild.key) + '/'
24191
+ : '') +
24192
+ childKey
24193
+ );
24194
+ }
24195
+ result.push(mappedChild);
24196
+ }
24197
+ }
23883
24198
 
23884
- /**
23885
- * We used to allow keyed objects to serve as a collection of ReactElements,
23886
- * or nested sets. This allowed us a way to explicitly key a set or fragment of
23887
- * components. This is now being replaced with an opaque data structure.
23888
- * The upgrade path is to call React.addons.createFragment({ key: value }) to
23889
- * create a keyed fragment. The resulting data structure is an array.
23890
- */
24199
+ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
24200
+ var escapedPrefix = '';
24201
+ if (prefix != null) {
24202
+ escapedPrefix = escapeUserProvidedKey(prefix) + '/';
24203
+ }
24204
+ var traverseContext = MapBookKeeping.getPooled(
24205
+ array,
24206
+ escapedPrefix,
24207
+ func,
24208
+ context
24209
+ );
24210
+ traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
24211
+ MapBookKeeping.release(traverseContext);
24212
+ }
23891
24213
 
23892
24214
  var numericPropertyRegex = /^\d+$/;
23893
24215
 
23894
24216
  var warnedAboutNumeric = false;
23895
24217
 
23896
- var ReactFragment = {
23897
- /**
23898
- * Wrap a keyed object in an opaque proxy that warns you if you access any
23899
- * of its properties.
23900
- * See https://facebook.github.io/react/docs/create-fragment.html
23901
- */
23902
- create: function (object) {
23903
- if (typeof object !== 'object' || !object || Array.isArray(object)) {
23904
- process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0;
23905
- return object;
23906
- }
23907
- if (ReactElement.isValidElement(object)) {
23908
- process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : void 0;
23909
- return object;
23910
- }
23911
-
23912
- !(object.nodeType !== 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.') : _prodInvariant('0') : void 0;
24218
+ function createReactFragment(object) {
24219
+ if (typeof object !== 'object' || !object || Array.isArray(object)) {
24220
+ warning(
24221
+ false,
24222
+ 'React.addons.createFragment only accepts a single object. Got: %s',
24223
+ object
24224
+ );
24225
+ return object;
24226
+ }
24227
+ if (React.isValidElement(object)) {
24228
+ warning(
24229
+ false,
24230
+ 'React.addons.createFragment does not accept a ReactElement ' +
24231
+ 'without a wrapper object.'
24232
+ );
24233
+ return object;
24234
+ }
23913
24235
 
23914
- var result = [];
24236
+ invariant(
24237
+ object.nodeType !== 1,
24238
+ 'React.addons.createFragment(...): Encountered an invalid child; DOM ' +
24239
+ 'elements are not valid children of React components.'
24240
+ );
23915
24241
 
23916
- for (var key in object) {
23917
- if (process.env.NODE_ENV !== 'production') {
23918
- if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
23919
- process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0;
23920
- warnedAboutNumeric = true;
23921
- }
23922
- }
23923
- ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
23924
- }
24242
+ var result = [];
23925
24243
 
23926
- return result;
24244
+ for (var key in object) {
24245
+ if (process.env.NODE_ENV !== "production") {
24246
+ if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
24247
+ warning(
24248
+ false,
24249
+ 'React.addons.createFragment(...): Child objects should have ' +
24250
+ 'non-numeric keys so ordering is preserved.'
24251
+ );
24252
+ warnedAboutNumeric = true;
24253
+ }
24254
+ }
24255
+ mapIntoWithKeyPrefixInternal(
24256
+ object[key],
24257
+ result,
24258
+ key,
24259
+ emptyFunction.thatReturnsArgument
24260
+ );
23927
24261
  }
23928
- };
23929
24262
 
23930
- module.exports = ReactFragment;
23931
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
24263
+ return result;
24264
+ }
23932
24265
 
23933
- /***/ },
23934
- /* 199 */
23935
- /***/ function(module, exports, __webpack_require__) {
24266
+ module.exports = createReactFragment;
23936
24267
 
23937
- module.exports = __webpack_require__(200);
24268
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
23938
24269
 
23939
24270
  /***/ },
23940
- /* 200 */
24271
+ /* 195 */
23941
24272
  /***/ function(module, exports, __webpack_require__) {
23942
24273
 
23943
24274
  /* WEBPACK VAR INJECTION */(function(process) {/**
@@ -23948,23 +24279,50 @@
23948
24279
  * LICENSE file in the root directory of this source tree. An additional grant
23949
24280
  * of patent rights can be found in the PATENTS file in the same directory.
23950
24281
  *
24282
+ * @providesModule update
23951
24283
  */
23952
24284
 
23953
- /* global hasOwnProperty:true */
24285
+ /* global hasOwnProperty:true */
23954
24286
 
23955
24287
  'use strict';
23956
24288
 
23957
- var _prodInvariant = __webpack_require__(7),
23958
- _assign = __webpack_require__(4);
24289
+ var NODE_ENV = process.env.NODE_ENV;
24290
+
24291
+ var invariant = function(condition, format, a, b, c, d, e, f) {
24292
+ if (NODE_ENV !== 'production') {
24293
+ if (format === undefined) {
24294
+ throw new Error('invariant requires an error message argument');
24295
+ }
24296
+ }
24297
+
24298
+ if (!condition) {
24299
+ var error;
24300
+ if (format === undefined) {
24301
+ error = new Error(
24302
+ 'Minified exception occurred; use the non-minified dev environment ' +
24303
+ 'for the full error message and additional helpful warnings.'
24304
+ );
24305
+ } else {
24306
+ var args = [a, b, c, d, e, f];
24307
+ var argIndex = 0;
24308
+ error = new Error(
24309
+ format.replace(/%s/g, function() { return args[argIndex++]; })
24310
+ );
24311
+ error.name = 'Invariant Violation';
24312
+ }
24313
+
24314
+ error.framesToPop = 1; // we don't care about invariant's own frame
24315
+ throw error;
24316
+ }
24317
+ };
23959
24318
 
23960
- var invariant = __webpack_require__(8);
23961
24319
  var hasOwnProperty = {}.hasOwnProperty;
23962
24320
 
23963
24321
  function shallowCopy(x) {
23964
24322
  if (Array.isArray(x)) {
23965
24323
  return x.concat();
23966
24324
  } else if (x && typeof x === 'object') {
23967
- return _assign(new x.constructor(), x);
24325
+ return Object.assign(new x.constructor(), x);
23968
24326
  } else {
23969
24327
  return x;
23970
24328
  }
@@ -23977,18 +24335,36 @@
23977
24335
  var COMMAND_MERGE = '$merge';
23978
24336
  var COMMAND_APPLY = '$apply';
23979
24337
 
23980
- var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
24338
+ var ALL_COMMANDS_LIST = [
24339
+ COMMAND_PUSH,
24340
+ COMMAND_UNSHIFT,
24341
+ COMMAND_SPLICE,
24342
+ COMMAND_SET,
24343
+ COMMAND_MERGE,
24344
+ COMMAND_APPLY,
24345
+ ];
23981
24346
 
23982
24347
  var ALL_COMMANDS_SET = {};
23983
24348
 
23984
- ALL_COMMANDS_LIST.forEach(function (command) {
24349
+ ALL_COMMANDS_LIST.forEach(function(command) {
23985
24350
  ALL_COMMANDS_SET[command] = true;
23986
24351
  });
23987
24352
 
23988
24353
  function invariantArrayCase(value, spec, command) {
23989
- !Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0;
24354
+ invariant(
24355
+ Array.isArray(value),
24356
+ 'update(): expected target of %s to be an array; got %s.',
24357
+ command,
24358
+ value
24359
+ );
23990
24360
  var specValue = spec[command];
23991
- !Array.isArray(specValue) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?', command, specValue) : _prodInvariant('2', command, specValue) : void 0;
24361
+ invariant(
24362
+ Array.isArray(specValue),
24363
+ 'update(): expected spec of %s to be an array; got %s. ' +
24364
+ 'Did you forget to wrap your parameter in an array?',
24365
+ command,
24366
+ specValue
24367
+ );
23992
24368
  }
23993
24369
 
23994
24370
  /**
@@ -23996,10 +24372,20 @@
23996
24372
  * See https://facebook.github.io/react/docs/update.html for details.
23997
24373
  */
23998
24374
  function update(value, spec) {
23999
- !(typeof spec === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0;
24375
+ invariant(
24376
+ typeof spec === 'object',
24377
+ 'update(): You provided a key path to update() that did not contain one ' +
24378
+ 'of %s. Did you forget to include {%s: ...}?',
24379
+ ALL_COMMANDS_LIST.join(', '),
24380
+ COMMAND_SET
24381
+ );
24000
24382
 
24001
24383
  if (hasOwnProperty.call(spec, COMMAND_SET)) {
24002
- !(Object.keys(spec).length === 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : _prodInvariant('4', COMMAND_SET) : void 0;
24384
+ invariant(
24385
+ Object.keys(spec).length === 1,
24386
+ 'Cannot have more than one key in an object with %s',
24387
+ COMMAND_SET
24388
+ );
24003
24389
 
24004
24390
  return spec[COMMAND_SET];
24005
24391
  }
@@ -24008,36 +24394,68 @@
24008
24394
 
24009
24395
  if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
24010
24396
  var mergeObj = spec[COMMAND_MERGE];
24011
- !(mergeObj && typeof mergeObj === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : _prodInvariant('5', COMMAND_MERGE, mergeObj) : void 0;
24012
- !(nextValue && typeof nextValue === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0;
24013
- _assign(nextValue, spec[COMMAND_MERGE]);
24397
+ invariant(
24398
+ mergeObj && typeof mergeObj === 'object',
24399
+ 'update(): %s expects a spec of type \'object\'; got %s',
24400
+ COMMAND_MERGE,
24401
+ mergeObj
24402
+ );
24403
+ invariant(
24404
+ nextValue && typeof nextValue === 'object',
24405
+ 'update(): %s expects a target of type \'object\'; got %s',
24406
+ COMMAND_MERGE,
24407
+ nextValue
24408
+ );
24409
+ Object.assign(nextValue, spec[COMMAND_MERGE]);
24014
24410
  }
24015
24411
 
24016
24412
  if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
24017
24413
  invariantArrayCase(value, spec, COMMAND_PUSH);
24018
- spec[COMMAND_PUSH].forEach(function (item) {
24414
+ spec[COMMAND_PUSH].forEach(function(item) {
24019
24415
  nextValue.push(item);
24020
24416
  });
24021
24417
  }
24022
24418
 
24023
24419
  if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
24024
24420
  invariantArrayCase(value, spec, COMMAND_UNSHIFT);
24025
- spec[COMMAND_UNSHIFT].forEach(function (item) {
24421
+ spec[COMMAND_UNSHIFT].forEach(function(item) {
24026
24422
  nextValue.unshift(item);
24027
24423
  });
24028
24424
  }
24029
24425
 
24030
24426
  if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
24031
- !Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : _prodInvariant('7', COMMAND_SPLICE, value) : void 0;
24032
- !Array.isArray(spec[COMMAND_SPLICE]) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
24033
- spec[COMMAND_SPLICE].forEach(function (args) {
24034
- !Array.isArray(args) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
24427
+ invariant(
24428
+ Array.isArray(value),
24429
+ 'Expected %s target to be an array; got %s',
24430
+ COMMAND_SPLICE,
24431
+ value
24432
+ );
24433
+ invariant(
24434
+ Array.isArray(spec[COMMAND_SPLICE]),
24435
+ 'update(): expected spec of %s to be an array of arrays; got %s. ' +
24436
+ 'Did you forget to wrap your parameters in an array?',
24437
+ COMMAND_SPLICE,
24438
+ spec[COMMAND_SPLICE]
24439
+ );
24440
+ spec[COMMAND_SPLICE].forEach(function(args) {
24441
+ invariant(
24442
+ Array.isArray(args),
24443
+ 'update(): expected spec of %s to be an array of arrays; got %s. ' +
24444
+ 'Did you forget to wrap your parameters in an array?',
24445
+ COMMAND_SPLICE,
24446
+ spec[COMMAND_SPLICE]
24447
+ );
24035
24448
  nextValue.splice.apply(nextValue, args);
24036
24449
  });
24037
24450
  }
24038
24451
 
24039
24452
  if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
24040
- !(typeof spec[COMMAND_APPLY] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : _prodInvariant('9', COMMAND_APPLY, spec[COMMAND_APPLY]) : void 0;
24453
+ invariant(
24454
+ typeof spec[COMMAND_APPLY] === 'function',
24455
+ 'update(): expected spec of %s to be a function; got %s.',
24456
+ COMMAND_APPLY,
24457
+ spec[COMMAND_APPLY]
24458
+ );
24041
24459
  nextValue = spec[COMMAND_APPLY](nextValue);
24042
24460
  }
24043
24461
 
@@ -24051,72 +24469,15 @@
24051
24469
  }
24052
24470
 
24053
24471
  module.exports = update;
24054
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
24055
-
24056
- /***/ },
24057
- /* 201 */
24058
- /***/ function(module, exports, __webpack_require__) {
24059
-
24060
- module.exports = __webpack_require__(202);
24061
-
24062
- /***/ },
24063
- /* 202 */
24064
- /***/ function(module, exports, __webpack_require__) {
24065
-
24066
- /**
24067
- * Copyright 2013-present, Facebook, Inc.
24068
- * All rights reserved.
24069
- *
24070
- * This source code is licensed under the BSD-style license found in the
24071
- * LICENSE file in the root directory of this source tree. An additional grant
24072
- * of patent rights can be found in the PATENTS file in the same directory.
24073
- *
24074
- */
24075
-
24076
- 'use strict';
24077
-
24078
- var shallowCompare = __webpack_require__(203);
24079
-
24080
- /**
24081
- * If your React component's render function is "pure", e.g. it will render the
24082
- * same result given the same props and state, provide this mixin for a
24083
- * considerable performance boost.
24084
- *
24085
- * Most React components have pure render functions.
24086
- *
24087
- * Example:
24088
- *
24089
- * var ReactComponentWithPureRenderMixin =
24090
- * require('ReactComponentWithPureRenderMixin');
24091
- * React.createClass({
24092
- * mixins: [ReactComponentWithPureRenderMixin],
24093
- *
24094
- * render: function() {
24095
- * return <div className={this.props.className}>foo</div>;
24096
- * }
24097
- * });
24098
- *
24099
- * Note: This only checks shallow equality for props and state. If these contain
24100
- * complex data structures this mixin may have false-negatives for deeper
24101
- * differences. Only mixin to components which have simple props and state, or
24102
- * use `forceUpdate()` when you know deep data structures have changed.
24103
- *
24104
- * See https://facebook.github.io/react/docs/pure-render-mixin.html
24105
- */
24106
- var ReactComponentWithPureRenderMixin = {
24107
- shouldComponentUpdate: function (nextProps, nextState) {
24108
- return shallowCompare(this, nextProps, nextState);
24109
- }
24110
- };
24111
24472
 
24112
- module.exports = ReactComponentWithPureRenderMixin;
24473
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
24113
24474
 
24114
24475
  /***/ },
24115
- /* 203 */
24476
+ /* 196 */
24116
24477
  /***/ function(module, exports, __webpack_require__) {
24117
24478
 
24118
24479
  /**
24119
- * Copyright 2013-present, Facebook, Inc.
24480
+ * Copyright 2015-present, Facebook, Inc.
24120
24481
  * All rights reserved.
24121
24482
  *
24122
24483
  * This source code is licensed under the BSD-style license found in the
@@ -24129,28 +24490,27 @@
24129
24490
 
24130
24491
  var shallowEqual = __webpack_require__(123);
24131
24492
 
24132
- /**
24133
- * Does a shallow comparison for props and state.
24134
- * See ReactComponentWithPureRenderMixin
24135
- * See also https://facebook.github.io/react/docs/shallow-compare.html
24136
- */
24137
- function shallowCompare(instance, nextProps, nextState) {
24138
- return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
24139
- }
24493
+ module.exports = {
24494
+ shouldComponentUpdate: function(nextProps, nextState) {
24495
+ return (
24496
+ !shallowEqual(this.props, nextProps) ||
24497
+ !shallowEqual(this.state, nextState)
24498
+ );
24499
+ },
24500
+ };
24140
24501
 
24141
- module.exports = shallowCompare;
24142
24502
 
24143
24503
  /***/ },
24144
- /* 204 */
24504
+ /* 197 */
24145
24505
  /***/ function(module, exports, __webpack_require__) {
24146
24506
 
24147
- module.exports = __webpack_require__(183);
24507
+ module.exports = __webpack_require__(188);
24148
24508
 
24149
24509
  /***/ },
24150
- /* 205 */
24510
+ /* 198 */
24151
24511
  /***/ function(module, exports, __webpack_require__) {
24152
24512
 
24153
- module.exports = __webpack_require__(182);
24513
+ module.exports = __webpack_require__(187);
24154
24514
 
24155
24515
  /***/ }
24156
24516
  /******/ ]);