does.
- contentKey = 'textContent' in document.createElement('div') ?
+ contentKey = 'textContent' in document.documentElement ?
'textContent' :
'innerText';
}
@@ -17199,7 +18446,7 @@ function getTextContentAccessor() {
module.exports = getTextContentAccessor;
-},{"./ExecutionEnvironment":21}],122:[function(_dereq_,module,exports){
+},{"./ExecutionEnvironment":22}],130:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17246,7 +18493,7 @@ function getUnboundedScrollPosition(scrollable) {
module.exports = getUnboundedScrollPosition;
-},{}],123:[function(_dereq_,module,exports){
+},{}],131:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17274,6 +18521,9 @@ var _uppercasePattern = /([A-Z])/g;
* > hyphenate('backgroundColor')
* < "background-color"
*
+ * For CSS style names, use `hyphenateStyleName` instead which works properly
+ * with all vendor prefixes, including `ms`.
+ *
* @param {string} string
* @return {string}
*/
@@ -17283,7 +18533,55 @@ function hyphenate(string) {
module.exports = hyphenate;
-},{}],124:[function(_dereq_,module,exports){
+},{}],132:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule hyphenateStyleName
+ * @typechecks
+ */
+
+"use strict";
+
+var hyphenate = _dereq_("./hyphenate");
+
+var msPattern = /^ms-/;
+
+/**
+ * Hyphenates a camelcased CSS property name, for example:
+ *
+ * > hyphenate('backgroundColor')
+ * < "background-color"
+ * > hyphenate('MozTransition')
+ * < "-moz-transition"
+ * > hyphenate('msTransition')
+ * < "-ms-transition"
+ *
+ * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
+ * is converted to `-ms-`.
+ *
+ * @param {string} string
+ * @return {string}
+ */
+function hyphenateStyleName(string) {
+ return hyphenate(string).replace(msPattern, '-ms-');
+}
+
+module.exports = hyphenateStyleName;
+
+},{"./hyphenate":131}],133:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17305,7 +18603,7 @@ module.exports = hyphenate;
"use strict";
-var warning = _dereq_("./warning");
+var invariant = _dereq_("./invariant");
/**
* Validate a `componentDescriptor`. This should be exposed publicly in a follow
@@ -17316,10 +18614,10 @@ var warning = _dereq_("./warning");
*/
function isValidComponentDescriptor(descriptor) {
return (
- typeof descriptor.constructor === 'function' &&
- typeof descriptor.constructor.prototype.construct === 'function' &&
- typeof descriptor.constructor.prototype.mountComponent === 'function' &&
- typeof descriptor.constructor.prototype.receiveComponent === 'function'
+ descriptor &&
+ typeof descriptor.type === 'function' &&
+ typeof descriptor.type.prototype.mountComponent === 'function' &&
+ typeof descriptor.type.prototype.receiveComponent === 'function'
);
}
@@ -17333,29 +18631,21 @@ function isValidComponentDescriptor(descriptor) {
* @protected
*/
function instantiateReactComponent(descriptor) {
- if ("production" !== "development") {
- ("production" !== "development" ? warning(
+
+ // TODO: Make warning
+ // if (__DEV__) {
+ ("production" !== "development" ? invariant(
isValidComponentDescriptor(descriptor),
'Only React Components are valid for mounting.'
- ) : null);
- // We use the clone of a composite component instead of the original
- // instance. This allows us to warn you if you're are accessing the wrong
- // instance.
- var instance = descriptor.__realComponentInstance || descriptor;
- instance._descriptor = descriptor;
- return instance;
- }
- // In prod we don't clone, we simply use the same instance for unaffected
- // behavior. We have to keep the descriptor around for comparison later on.
- // This should ideally be accepted in the constructor of the instance but
- // since that is currently overloaded, we just manually attach it here.
- descriptor._descriptor = descriptor;
- return descriptor;
+ ) : invariant(isValidComponentDescriptor(descriptor)));
+ // }
+
+ return new descriptor.type(descriptor);
}
module.exports = instantiateReactComponent;
-},{"./warning":148}],125:[function(_dereq_,module,exports){
+},{"./invariant":134}],134:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17387,39 +18677,37 @@ module.exports = instantiateReactComponent;
* will remain to ensure logic does not differ in production.
*/
-var invariant = function(condition) {
+var invariant = function(condition, format, a, b, c, d, e, f) {
+ if ("production" !== "development") {
+ if (format === undefined) {
+ throw new Error('invariant requires an error message argument');
+ }
+ }
+
if (!condition) {
- var error = new Error(
- 'Minified exception occured; use the non-minified dev environment for ' +
- 'the full error message and additional helpful warnings.'
- );
- error.framesToPop = 1;
+ var error;
+ if (format === undefined) {
+ error = new Error(
+ 'Minified exception occurred; use the non-minified dev environment ' +
+ 'for the full error message and additional helpful warnings.'
+ );
+ } else {
+ var args = [a, b, c, d, e, f];
+ var argIndex = 0;
+ error = new Error(
+ 'Invariant Violation: ' +
+ format.replace(/%s/g, function() { return args[argIndex++]; })
+ );
+ }
+
+ error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
};
-if ("production" !== "development") {
- invariant = function(condition, format, a, b, c, d, e, f) {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
-
- if (!condition) {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- var error = new Error(
- 'Invariant Violation: ' +
- format.replace(/%s/g, function() { return args[argIndex++]; })
- );
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
- };
-}
-
module.exports = invariant;
-},{}],126:[function(_dereq_,module,exports){
+},{}],135:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17491,7 +18779,7 @@ function isEventSupported(eventNameSuffix, capture) {
module.exports = isEventSupported;
-},{"./ExecutionEnvironment":21}],127:[function(_dereq_,module,exports){
+},{"./ExecutionEnvironment":22}],136:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17526,7 +18814,7 @@ function isNode(object) {
module.exports = isNode;
-},{}],128:[function(_dereq_,module,exports){
+},{}],137:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17577,7 +18865,7 @@ function isTextInputElement(elem) {
module.exports = isTextInputElement;
-},{}],129:[function(_dereq_,module,exports){
+},{}],138:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17609,7 +18897,7 @@ function isTextNode(object) {
module.exports = isTextNode;
-},{"./isNode":127}],130:[function(_dereq_,module,exports){
+},{"./isNode":136}],139:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17655,7 +18943,7 @@ function joinClasses(className/*, ... */) {
module.exports = joinClasses;
-},{}],131:[function(_dereq_,module,exports){
+},{}],140:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17715,7 +19003,7 @@ var keyMirror = function(obj) {
module.exports = keyMirror;
-},{"./invariant":125}],132:[function(_dereq_,module,exports){
+},{"./invariant":134}],141:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17758,7 +19046,61 @@ var keyOf = function(oneKeyObj) {
module.exports = keyOf;
-},{}],133:[function(_dereq_,module,exports){
+},{}],142:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule mapObject
+ */
+
+"use strict";
+
+/**
+ * For each key/value pair, invokes callback func and constructs a resulting
+ * object which contains, for every key in obj, values that are the result of
+ * of invoking the function:
+ *
+ * func(value, key, iteration)
+ *
+ * Grepable names:
+ *
+ * function objectMap()
+ * function objMap()
+ *
+ * @param {?object} obj Object to map keys over
+ * @param {function} func Invoked for each key/val pair.
+ * @param {?*} context
+ * @return {?object} Result of mapping or null if obj is falsey
+ */
+function mapObject(obj, func, context) {
+ if (!obj) {
+ return null;
+ }
+ var i = 0;
+ var ret = {};
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ ret[key] = func.call(context, obj[key], key, i++);
+ }
+ }
+ return ret;
+}
+
+module.exports = mapObject;
+
+},{}],143:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17799,7 +19141,7 @@ function memoizeStringOnly(callback) {
module.exports = memoizeStringOnly;
-},{}],134:[function(_dereq_,module,exports){
+},{}],144:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17838,7 +19180,7 @@ var merge = function(one, two) {
module.exports = merge;
-},{"./mergeInto":136}],135:[function(_dereq_,module,exports){
+},{"./mergeInto":146}],145:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -17933,6 +19275,17 @@ var mergeHelpers = {
) : invariant(!isTerminal(arg) && !Array.isArray(arg)));
},
+ /**
+ * @param {*} arg
+ */
+ checkMergeIntoObjectArg: function(arg) {
+ ("production" !== "development" ? invariant(
+ (!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg),
+ 'Tried to merge into an object, instead got %s.',
+ arg
+ ) : invariant((!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg)));
+ },
+
/**
* Checks that a merge was not given a circular object or an object that had
* too great of depth.
@@ -17976,7 +19329,7 @@ var mergeHelpers = {
module.exports = mergeHelpers;
-},{"./invariant":125,"./keyMirror":131}],136:[function(_dereq_,module,exports){
+},{"./invariant":134,"./keyMirror":140}],146:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -18001,15 +19354,16 @@ module.exports = mergeHelpers;
var mergeHelpers = _dereq_("./mergeHelpers");
var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg;
+var checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg;
/**
* Shallow merges two structures by mutating the first parameter.
*
- * @param {object} one Object to be merged into.
+ * @param {object|function} one Object to be merged into.
* @param {?object} two Optional object with properties to merge from.
*/
function mergeInto(one, two) {
- checkMergeObjectArg(one);
+ checkMergeIntoObjectArg(one);
if (two != null) {
checkMergeObjectArg(two);
for (var key in two) {
@@ -18023,7 +19377,7 @@ function mergeInto(one, two) {
module.exports = mergeInto;
-},{"./mergeHelpers":135}],137:[function(_dereq_,module,exports){
+},{"./mergeHelpers":145}],147:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -18059,7 +19413,7 @@ var mixInto = function(constructor, methodBag) {
module.exports = mixInto;
-},{}],138:[function(_dereq_,module,exports){
+},{}],148:[function(_dereq_,module,exports){
/**
* Copyright 2014 Facebook, Inc.
*
@@ -18098,105 +19452,7 @@ function monitorCodeUse(eventName, data) {
module.exports = monitorCodeUse;
-},{"./invariant":125}],139:[function(_dereq_,module,exports){
-/**
- * Copyright 2013-2014 Facebook, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @providesModule objMap
- */
-
-"use strict";
-
-/**
- * For each key/value pair, invokes callback func and constructs a resulting
- * object which contains, for every key in obj, values that are the result of
- * of invoking the function:
- *
- * func(value, key, iteration)
- *
- * @param {?object} obj Object to map keys over
- * @param {function} func Invoked for each key/val pair.
- * @param {?*} context
- * @return {?object} Result of mapping or null if obj is falsey
- */
-function objMap(obj, func, context) {
- if (!obj) {
- return null;
- }
- var i = 0;
- var ret = {};
- for (var key in obj) {
- if (obj.hasOwnProperty(key)) {
- ret[key] = func.call(context, obj[key], key, i++);
- }
- }
- return ret;
-}
-
-module.exports = objMap;
-
-},{}],140:[function(_dereq_,module,exports){
-/**
- * Copyright 2013-2014 Facebook, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @providesModule objMapKeyVal
- */
-
-"use strict";
-
-/**
- * Behaves the same as `objMap` but invokes func with the key first, and value
- * second. Use `objMap` unless you need this special case.
- * Invokes func as:
- *
- * func(key, value, iteration)
- *
- * @param {?object} obj Object to map keys over
- * @param {!function} func Invoked for each key/val pair.
- * @param {?*} context
- * @return {?object} Result of mapping or null if obj is falsey
- */
-function objMapKeyVal(obj, func, context) {
- if (!obj) {
- return null;
- }
- var i = 0;
- var ret = {};
- for (var key in obj) {
- if (obj.hasOwnProperty(key)) {
- ret[key] = func.call(context, key, obj[key], i++);
- }
- }
- return ret;
-}
-
-module.exports = objMapKeyVal;
-
-},{}],141:[function(_dereq_,module,exports){
+},{"./invariant":134}],149:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -18216,7 +19472,7 @@ module.exports = objMapKeyVal;
*/
"use strict";
-var ReactComponent = _dereq_("./ReactComponent");
+var ReactDescriptor = _dereq_("./ReactDescriptor");
var invariant = _dereq_("./invariant");
@@ -18233,15 +19489,50 @@ var invariant = _dereq_("./invariant");
*/
function onlyChild(children) {
("production" !== "development" ? invariant(
- ReactComponent.isValidComponent(children),
+ ReactDescriptor.isValidDescriptor(children),
'onlyChild must be passed a children with exactly one child.'
- ) : invariant(ReactComponent.isValidComponent(children)));
+ ) : invariant(ReactDescriptor.isValidDescriptor(children)));
return children;
}
module.exports = onlyChild;
-},{"./ReactComponent":31,"./invariant":125}],142:[function(_dereq_,module,exports){
+},{"./ReactDescriptor":56,"./invariant":134}],150:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule performance
+ * @typechecks
+ */
+
+"use strict";
+
+var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
+
+var performance;
+
+if (ExecutionEnvironment.canUseDOM) {
+ performance =
+ window.performance ||
+ window.msPerformance ||
+ window.webkitPerformance;
+}
+
+module.exports = performance || {};
+
+},{"./ExecutionEnvironment":22}],151:[function(_dereq_,module,exports){
/**
* Copyright 2013-2014 Facebook, Inc.
*
@@ -18258,25 +19549,16 @@ module.exports = onlyChild;
* limitations under the License.
*
* @providesModule performanceNow
- * @typechecks static-only
+ * @typechecks
*/
-"use strict";
-
-var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
+var performance = _dereq_("./performance");
/**
- * Detect if we can use window.performance.now() and gracefully
- * fallback to Date.now() if it doesn't exist.
- * We need to support Firefox < 15 for now due to Facebook's webdriver
- * infrastructure.
+ * Detect if we can use `window.performance.now()` and gracefully fallback to
+ * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
+ * because of Facebook's testing infrastructure.
*/
-var performance = null;
-
-if (ExecutionEnvironment.canUseDOM) {
- performance = window.performance || window.webkitPerformance;
-}
-
if (!performance || !performance.now) {
performance = Date;
}
@@ -18285,7 +19567,94 @@ var performanceNow = performance.now.bind(performance);
module.exports = performanceNow;
-},{"./ExecutionEnvironment":21}],143:[function(_dereq_,module,exports){
+},{"./performance":150}],152:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule setInnerHTML
+ */
+
+"use strict";
+
+var ExecutionEnvironment = _dereq_("./ExecutionEnvironment");
+
+/**
+ * Set the innerHTML property of a node, ensuring that whitespace is preserved
+ * even in IE8.
+ *
+ * @param {DOMElement} node
+ * @param {string} html
+ * @internal
+ */
+var setInnerHTML = function(node, html) {
+ node.innerHTML = html;
+};
+
+if (ExecutionEnvironment.canUseDOM) {
+ // IE8: When updating a just created node with innerHTML only leading
+ // whitespace is removed. When updating an existing node with innerHTML
+ // whitespace in root TextNodes is also collapsed.
+ // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
+
+ // Feature detection; only IE8 is known to behave improperly like this.
+ var testElement = document.createElement('div');
+ testElement.innerHTML = ' ';
+ if (testElement.innerHTML === '') {
+ setInnerHTML = function(node, html) {
+ // Magic theory: IE8 supposedly differentiates between added and updated
+ // nodes when processing innerHTML, innerHTML on updated nodes suffers
+ // from worse whitespace behavior. Re-adding a node like this triggers
+ // the initial and more favorable whitespace behavior.
+ // TODO: What to do on a detached node?
+ if (node.parentNode) {
+ node.parentNode.replaceChild(node, node);
+ }
+
+ // We also implement a workaround for non-visible tags disappearing into
+ // thin air on IE8, this only happens if there is no visible text
+ // in-front of the non-visible tags. Piggyback on the whitespace fix
+ // and simply check if any non-visible tags appear in the source.
+ if (html.match(/^[ \r\n\t\f]/) ||
+ html[0] === '<' && (
+ html.indexOf('