1
1
/**
2
- * React (with addons) v0.13.2
2
+ * React (with addons) v0.13.3
3
3
*/
4
4
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
5
5
/**
@@ -4485,7 +4485,7 @@ if ("production" !== "development") {
4485
4485
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
4486
4486
console.debug(
4487
4487
'Download the React DevTools for a better development experience: ' +
4488
- 'http ://fb.me/react-devtools'
4488
+ 'https ://fb.me/react-devtools'
4489
4489
);
4490
4490
}
4491
4491
}
@@ -4512,15 +4512,15 @@ if ("production" !== "development") {
4512
4512
if (!expectedFeatures[i]) {
4513
4513
console.error(
4514
4514
'One or more ES5 shim/shams expected by React are not available: ' +
4515
- 'http ://fb.me/react-warning-polyfills'
4515
+ 'https ://fb.me/react-warning-polyfills'
4516
4516
);
4517
4517
break;
4518
4518
}
4519
4519
}
4520
4520
}
4521
4521
}
4522
4522
4523
- React.version = '0.13.2 ';
4523
+ React.version = '0.13.3 ';
4524
4524
4525
4525
module.exports = React;
4526
4526
@@ -6239,7 +6239,7 @@ var ReactClass = {
6239
6239
("production" !== "development" ? warning(
6240
6240
this instanceof Constructor,
6241
6241
'Something is calling a React component directly. Use a factory or ' +
6242
- 'JSX instead. See: http ://fb.me/react-legacyfactory'
6242
+ 'JSX instead. See: https ://fb.me/react-legacyfactory'
6243
6243
) : null);
6244
6244
}
6245
6245
@@ -6449,20 +6449,38 @@ ReactComponent.prototype.forceUpdate = function(callback) {
6449
6449
*/
6450
6450
if ("production" !== "development") {
6451
6451
var deprecatedAPIs = {
6452
- getDOMNode: 'getDOMNode',
6453
- isMounted: 'isMounted',
6454
- replaceProps: 'replaceProps',
6455
- replaceState: 'replaceState',
6456
- setProps: 'setProps'
6452
+ getDOMNode: [
6453
+ 'getDOMNode',
6454
+ 'Use React.findDOMNode(component) instead.'
6455
+ ],
6456
+ isMounted: [
6457
+ 'isMounted',
6458
+ 'Instead, make sure to clean up subscriptions and pending requests in ' +
6459
+ 'componentWillUnmount to prevent memory leaks.'
6460
+ ],
6461
+ replaceProps: [
6462
+ 'replaceProps',
6463
+ 'Instead call React.render again at the top level.'
6464
+ ],
6465
+ replaceState: [
6466
+ 'replaceState',
6467
+ 'Refactor your code to use setState instead (see ' +
6468
+ 'https://github.com/facebook/react/issues/3236).'
6469
+ ],
6470
+ setProps: [
6471
+ 'setProps',
6472
+ 'Instead call React.render again at the top level.'
6473
+ ]
6457
6474
};
6458
- var defineDeprecationWarning = function(methodName, displayName ) {
6475
+ var defineDeprecationWarning = function(methodName, info ) {
6459
6476
try {
6460
6477
Object.defineProperty(ReactComponent.prototype, methodName, {
6461
6478
get: function() {
6462
6479
("production" !== "development" ? warning(
6463
6480
false,
6464
- '%s(...) is deprecated in plain JavaScript React classes.',
6465
- displayName
6481
+ '%s(...) is deprecated in plain JavaScript React classes. %s',
6482
+ info[0],
6483
+ info[1]
6466
6484
) : null);
6467
6485
return undefined;
6468
6486
}
@@ -6856,6 +6874,7 @@ var ReactCompositeComponentMixin = {
6856
6874
this._pendingReplaceState = false;
6857
6875
this._pendingForceUpdate = false;
6858
6876
6877
+ var childContext;
6859
6878
var renderedElement;
6860
6879
6861
6880
var previouslyMounting = ReactLifeCycle.currentlyMountingInstance;
@@ -6870,7 +6889,8 @@ var ReactCompositeComponentMixin = {
6870
6889
}
6871
6890
}
6872
6891
6873
- renderedElement = this._renderValidatedComponent();
6892
+ childContext = this._getValidatedChildContext(context);
6893
+ renderedElement = this._renderValidatedComponent(childContext);
6874
6894
} finally {
6875
6895
ReactLifeCycle.currentlyMountingInstance = previouslyMounting;
6876
6896
}
@@ -6884,7 +6904,7 @@ var ReactCompositeComponentMixin = {
6884
6904
this._renderedComponent,
6885
6905
rootID,
6886
6906
transaction,
6887
- this._processChildContext (context)
6907
+ this._mergeChildContext (context, childContext )
6888
6908
);
6889
6909
if (inst.componentDidMount) {
6890
6910
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
@@ -7014,7 +7034,7 @@ var ReactCompositeComponentMixin = {
7014
7034
* @return {object}
7015
7035
* @private
7016
7036
*/
7017
- _processChildContext : function(currentContext) {
7037
+ _getValidatedChildContext : function(currentContext) {
7018
7038
var inst = this._instance;
7019
7039
var childContext = inst.getChildContext && inst.getChildContext();
7020
7040
if (childContext) {
@@ -7039,6 +7059,13 @@ var ReactCompositeComponentMixin = {
7039
7059
name
7040
7060
) : invariant(name in inst.constructor.childContextTypes));
7041
7061
}
7062
+ return childContext;
7063
+ }
7064
+ return null;
7065
+ },
7066
+
7067
+ _mergeChildContext: function(currentContext, childContext) {
7068
+ if (childContext) {
7042
7069
return assign({}, currentContext, childContext);
7043
7070
}
7044
7071
return currentContext;
@@ -7298,6 +7325,10 @@ var ReactCompositeComponentMixin = {
7298
7325
return inst.state;
7299
7326
}
7300
7327
7328
+ if (replace && queue.length === 1) {
7329
+ return queue[0];
7330
+ }
7331
+
7301
7332
var nextState = assign({}, replace ? queue[0] : inst.state);
7302
7333
for (var i = replace ? 1 : 0; i < queue.length; i++) {
7303
7334
var partial = queue[i];
@@ -7367,13 +7398,14 @@ var ReactCompositeComponentMixin = {
7367
7398
_updateRenderedComponent: function(transaction, context) {
7368
7399
var prevComponentInstance = this._renderedComponent;
7369
7400
var prevRenderedElement = prevComponentInstance._currentElement;
7370
- var nextRenderedElement = this._renderValidatedComponent();
7401
+ var childContext = this._getValidatedChildContext();
7402
+ var nextRenderedElement = this._renderValidatedComponent(childContext);
7371
7403
if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
7372
7404
ReactReconciler.receiveComponent(
7373
7405
prevComponentInstance,
7374
7406
nextRenderedElement,
7375
7407
transaction,
7376
- this._processChildContext (context)
7408
+ this._mergeChildContext (context, childContext )
7377
7409
);
7378
7410
} else {
7379
7411
// These two IDs are actually the same! But nothing should rely on that.
@@ -7389,7 +7421,7 @@ var ReactCompositeComponentMixin = {
7389
7421
this._renderedComponent,
7390
7422
thisID,
7391
7423
transaction,
7392
- this._processChildContext (context)
7424
+ this._mergeChildContext (context, childContext )
7393
7425
);
7394
7426
this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
7395
7427
}
@@ -7427,11 +7459,12 @@ var ReactCompositeComponentMixin = {
7427
7459
/**
7428
7460
* @private
7429
7461
*/
7430
- _renderValidatedComponent: function() {
7462
+ _renderValidatedComponent: function(childContext ) {
7431
7463
var renderedComponent;
7432
7464
var previousContext = ReactContext.current;
7433
- ReactContext.current = this._processChildContext(
7434
- this._currentElement._context
7465
+ ReactContext.current = this._mergeChildContext(
7466
+ this._currentElement._context,
7467
+ childContext
7435
7468
);
7436
7469
ReactCurrentOwner.current = this;
7437
7470
try {
@@ -7796,6 +7829,7 @@ var ReactDOM = mapObject({
7796
7829
7797
7830
// SVG
7798
7831
circle: 'circle',
7832
+ clipPath: 'clipPath',
7799
7833
defs: 'defs',
7800
7834
ellipse: 'ellipse',
7801
7835
g: 'g',
@@ -7945,11 +7979,13 @@ function assertValidProps(props) {
7945
7979
'Can only set one of `children` or `props.dangerouslySetInnerHTML`.'
7946
7980
) : invariant(props.children == null));
7947
7981
("production" !== "development" ? invariant(
7948
- props.dangerouslySetInnerHTML.__html != null,
7982
+ typeof props.dangerouslySetInnerHTML === 'object' &&
7983
+ '__html' in props.dangerouslySetInnerHTML,
7949
7984
'`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' +
7950
- 'Please visit http ://fb.me/react-invariant-dangerously-set-inner-html ' +
7985
+ 'Please visit https ://fb.me/react-invariant-dangerously-set-inner-html ' +
7951
7986
'for more information.'
7952
- ) : invariant(props.dangerouslySetInnerHTML.__html != null));
7987
+ ) : invariant(typeof props.dangerouslySetInnerHTML === 'object' &&
7988
+ '__html' in props.dangerouslySetInnerHTML));
7953
7989
}
7954
7990
if ("production" !== "development") {
7955
7991
("production" !== "development" ? warning(
@@ -10741,7 +10777,7 @@ function warnAndMonitorForKeyUse(message, element, parentType) {
10741
10777
10742
10778
("production" !== "development" ? warning(
10743
10779
false,
10744
- message + '%s%s See http ://fb.me/react-warning-keys for more information.',
10780
+ message + '%s%s See https ://fb.me/react-warning-keys for more information.',
10745
10781
parentOrOwnerAddendum,
10746
10782
childOwnerAddendum
10747
10783
) : null);
@@ -15256,6 +15292,7 @@ var ReactUpdates = _dereq_(100);
15256
15292
var SyntheticEvent = _dereq_(108);
15257
15293
15258
15294
var assign = _dereq_(29);
15295
+ var emptyObject = _dereq_(130);
15259
15296
15260
15297
var topLevelTypes = EventConstants.topLevelTypes;
15261
15298
@@ -15597,6 +15634,9 @@ assign(
15597
15634
);
15598
15635
15599
15636
ReactShallowRenderer.prototype.render = function(element, context) {
15637
+ if (!context) {
15638
+ context = emptyObject;
15639
+ }
15600
15640
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled();
15601
15641
this._render(element, transaction, context);
15602
15642
ReactUpdates.ReactReconcileTransaction.release(transaction);
@@ -15737,7 +15777,7 @@ for (eventType in topLevelTypes) {
15737
15777
15738
15778
module.exports = ReactTestUtils;
15739
15779
15740
- },{"100":100,"108":108,"16":16,"18":18,"21":21,"29":29,"31":31,"33":33,"43":43,"63":63,"65":65,"72":72,"73":73,"77":77}],96:[function(_dereq_,module,exports){
15780
+ },{"100":100,"108":108,"130":130," 16":16,"18":18,"21":21,"29":29,"31":31,"33":33,"43":43,"63":63,"65":65,"72":72,"73":73,"77":77}],96:[function(_dereq_,module,exports){
15741
15781
/**
15742
15782
* Copyright 2013-2015, Facebook, Inc.
15743
15783
* All rights reserved.
@@ -16782,6 +16822,7 @@ var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
16782
16822
16783
16823
var SVGDOMPropertyConfig = {
16784
16824
Properties: {
16825
+ clipPath: MUST_USE_ATTRIBUTE,
16785
16826
cx: MUST_USE_ATTRIBUTE,
16786
16827
cy: MUST_USE_ATTRIBUTE,
16787
16828
d: MUST_USE_ATTRIBUTE,
@@ -16827,6 +16868,7 @@ var SVGDOMPropertyConfig = {
16827
16868
y: MUST_USE_ATTRIBUTE
16828
16869
},
16829
16870
DOMAttributeNames: {
16871
+ clipPath: 'clip-path',
16830
16872
fillOpacity: 'fill-opacity',
16831
16873
fontFamily: 'font-family',
16832
16874
fontSize: 'font-size',
@@ -19733,6 +19775,7 @@ var shouldWrap = {
19733
19775
// Force wrapping for SVG elements because if they get created inside a <div>,
19734
19776
// they will be initialized in the wrong namespace (and will not display).
19735
19777
'circle': true,
19778
+ 'clipPath': true,
19736
19779
'defs': true,
19737
19780
'ellipse': true,
19738
19781
'g': true,
@@ -19775,6 +19818,7 @@ var markupWrap = {
19775
19818
'th': trWrap,
19776
19819
19777
19820
'circle': svgWrap,
19821
+ 'clipPath': svgWrap,
19778
19822
'defs': svgWrap,
19779
19823
'ellipse': svgWrap,
19780
19824
'g': svgWrap,
0 commit comments