diff options
Diffstat (limited to 'web/src/vendor/react/react-with-addons.js')
-rw-r--r-- | web/src/vendor/react/react-with-addons.js | 6462 |
1 files changed, 3006 insertions, 3456 deletions
diff --git a/web/src/vendor/react/react-with-addons.js b/web/src/vendor/react/react-with-addons.js index b45d8205..b637678d 100644 --- a/web/src/vendor/react/react-with-addons.js +++ b/web/src/vendor/react/react-with-addons.js @@ -1,21 +1,66 @@ /** - * React (with addons) v0.11.1 + * React (with addons) v0.12.1 */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.React=e()}}(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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){ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.React=e()}}(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){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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 + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * http://www.apache.org/licenses/LICENSE-2.0 + * @providesModule ReactWithAddons + */ + +/** + * This module exists purely in the open source project, and is meant as a way + * to create a separate standalone build of React. This build has "addons", or + * functionality we've built and think might be useful but doesn't have a good + * place to live inside React core. + */ + +"use strict"; + +var LinkedStateMixin = _dereq_("./LinkedStateMixin"); +var React = _dereq_("./React"); +var ReactComponentWithPureRenderMixin = + _dereq_("./ReactComponentWithPureRenderMixin"); +var ReactCSSTransitionGroup = _dereq_("./ReactCSSTransitionGroup"); +var ReactTransitionGroup = _dereq_("./ReactTransitionGroup"); +var ReactUpdates = _dereq_("./ReactUpdates"); + +var cx = _dereq_("./cx"); +var cloneWithProps = _dereq_("./cloneWithProps"); +var update = _dereq_("./update"); + +React.addons = { + CSSTransitionGroup: ReactCSSTransitionGroup, + LinkedStateMixin: LinkedStateMixin, + PureRenderMixin: ReactComponentWithPureRenderMixin, + TransitionGroup: ReactTransitionGroup, + + batchedUpdates: ReactUpdates.batchedUpdates, + classSet: cx, + cloneWithProps: cloneWithProps, + update: update +}; + +if ("production" !== "development") { + React.addons.Perf = _dereq_("./ReactDefaultPerf"); + React.addons.TestUtils = _dereq_("./ReactTestUtils"); +} + +module.exports = React; + +},{"./LinkedStateMixin":25,"./React":31,"./ReactCSSTransitionGroup":34,"./ReactComponentWithPureRenderMixin":39,"./ReactDefaultPerf":56,"./ReactTestUtils":86,"./ReactTransitionGroup":90,"./ReactUpdates":91,"./cloneWithProps":113,"./cx":118,"./update":159}],2:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule AutoFocusMixin * @typechecks static-only @@ -35,21 +80,14 @@ var AutoFocusMixin = { module.exports = AutoFocusMixin; -},{"./focusNode":120}],2:[function(_dereq_,module,exports){ +},{"./focusNode":125}],3:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule BeforeInputEventPlugin * @typechecks static-only @@ -107,6 +145,9 @@ var eventTypes = { // Track characters inserted via keypress and composition events. var fallbackChars = null; +// Track whether we've ever handled a keypress on the space key. +var hasSpaceKeypress = false; + /** * Return whether a native keypress event is assumed to be a command. * This is required because Firefox fires `keypress` events for key commands @@ -176,7 +217,8 @@ var BeforeInputEventPlugin = { return; } - chars = String.fromCharCode(which); + hasSpaceKeypress = true; + chars = SPACEBAR_CHAR; break; case topLevelTypes.topTextInput: @@ -184,8 +226,9 @@ var BeforeInputEventPlugin = { chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled - // it at the keypress level and bail immediately. - if (chars === SPACEBAR_CHAR) { + // it at the keypress level and bail immediately. Android Chrome + // doesn't give us keycodes, so we need to blacklist it. + if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { return; } @@ -259,21 +302,14 @@ var BeforeInputEventPlugin = { module.exports = BeforeInputEventPlugin; -},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./SyntheticInputEvent":98,"./keyOf":141}],3:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./SyntheticInputEvent":101,"./keyOf":147}],4:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule CSSCore * @typechecks @@ -359,7 +395,7 @@ var CSSCore = { * * @param {DOMNode|DOMWindow} element the element to set the class on * @param {string} className the CSS className - * @returns {boolean} true if the element has the class, false if not + * @return {boolean} true if the element has the class, false if not */ hasClass: function(element, className) { ("production" !== "development" ? invariant( @@ -376,21 +412,14 @@ var CSSCore = { module.exports = CSSCore; -},{"./invariant":134}],4:[function(_dereq_,module,exports){ +},{"./invariant":140}],5:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule CSSProperty */ @@ -499,21 +528,14 @@ var CSSProperty = { module.exports = CSSProperty; -},{}],5:[function(_dereq_,module,exports){ +},{}],6:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule CSSPropertyOperations * @typechecks static-only @@ -522,15 +544,43 @@ module.exports = CSSProperty; "use strict"; var CSSProperty = _dereq_("./CSSProperty"); +var ExecutionEnvironment = _dereq_("./ExecutionEnvironment"); +var camelizeStyleName = _dereq_("./camelizeStyleName"); var dangerousStyleValue = _dereq_("./dangerousStyleValue"); var hyphenateStyleName = _dereq_("./hyphenateStyleName"); var memoizeStringOnly = _dereq_("./memoizeStringOnly"); +var warning = _dereq_("./warning"); var processStyleName = memoizeStringOnly(function(styleName) { return hyphenateStyleName(styleName); }); +var styleFloatAccessor = 'cssFloat'; +if (ExecutionEnvironment.canUseDOM) { + // IE8 only supports accessing cssFloat (standard) as styleFloat + if (document.documentElement.style.cssFloat === undefined) { + styleFloatAccessor = 'styleFloat'; + } +} + +if ("production" !== "development") { + var warnedStyleNames = {}; + + var warnHyphenatedStyleName = function(name) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + ("production" !== "development" ? warning( + false, + 'Unsupported style property ' + name + '. Did you mean ' + + camelizeStyleName(name) + '?' + ) : null); + }; +} + /** * Operations for dealing with CSS properties. */ @@ -554,6 +604,11 @@ var CSSPropertyOperations = { if (!styles.hasOwnProperty(styleName)) { continue; } + if ("production" !== "development") { + if (styleName.indexOf('-') > -1) { + warnHyphenatedStyleName(styleName); + } + } var styleValue = styles[styleName]; if (styleValue != null) { serialized += processStyleName(styleName) + ':'; @@ -576,7 +631,15 @@ var CSSPropertyOperations = { if (!styles.hasOwnProperty(styleName)) { continue; } + if ("production" !== "development") { + if (styleName.indexOf('-') > -1) { + warnHyphenatedStyleName(styleName); + } + } var styleValue = dangerousStyleValue(styleName, styles[styleName]); + if (styleName === 'float') { + styleName = styleFloatAccessor; + } if (styleValue) { style[styleName] = styleValue; } else { @@ -598,21 +661,14 @@ var CSSPropertyOperations = { module.exports = CSSPropertyOperations; -},{"./CSSProperty":4,"./dangerousStyleValue":115,"./hyphenateStyleName":132,"./memoizeStringOnly":143}],6:[function(_dereq_,module,exports){ +},{"./CSSProperty":5,"./ExecutionEnvironment":23,"./camelizeStyleName":112,"./dangerousStyleValue":119,"./hyphenateStyleName":138,"./memoizeStringOnly":149,"./warning":160}],7:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule CallbackQueue */ @@ -621,8 +677,8 @@ module.exports = CSSPropertyOperations; var PooledClass = _dereq_("./PooledClass"); +var assign = _dereq_("./Object.assign"); var invariant = _dereq_("./invariant"); -var mixInto = _dereq_("./mixInto"); /** * A specialized pseudo-event module to help keep track of components waiting to @@ -640,7 +696,7 @@ function CallbackQueue() { this._contexts = null; } -mixInto(CallbackQueue, { +assign(CallbackQueue.prototype, { /** * Enqueues a callback to be invoked when `notifyAll` is invoked. @@ -703,21 +759,14 @@ PooledClass.addPoolingTo(CallbackQueue); module.exports = CallbackQueue; -},{"./PooledClass":28,"./invariant":134,"./mixInto":147}],7:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./PooledClass":30,"./invariant":140}],8:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ChangeEventPlugin */ @@ -1092,21 +1141,14 @@ var ChangeEventPlugin = { module.exports = ChangeEventPlugin; -},{"./EventConstants":16,"./EventPluginHub":18,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactUpdates":87,"./SyntheticEvent":96,"./isEventSupported":135,"./isTextInputElement":137,"./keyOf":141}],8:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPluginHub":19,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactUpdates":91,"./SyntheticEvent":99,"./isEventSupported":141,"./isTextInputElement":143,"./keyOf":147}],9:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ClientReactRootIndex * @typechecks @@ -1124,21 +1166,14 @@ var ClientReactRootIndex = { module.exports = ClientReactRootIndex; -},{}],9:[function(_dereq_,module,exports){ +},{}],10:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule CompositionEventPlugin * @typechecks static-only @@ -1390,21 +1425,14 @@ var CompositionEventPlugin = { module.exports = CompositionEventPlugin; -},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactInputSelection":63,"./SyntheticCompositionEvent":94,"./getTextContentAccessor":129,"./keyOf":141}],10:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactInputSelection":65,"./SyntheticCompositionEvent":97,"./getTextContentAccessor":135,"./keyOf":147}],11:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DOMChildrenOperations * @typechecks static-only @@ -1512,9 +1540,9 @@ var DOMChildrenOperations = { 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a <tbody> when using tables, ' + - 'nesting <p> or <a> tags, or using non-SVG elements in an <svg> '+ - 'parent. Try inspecting the child nodes of the element with React ' + - 'ID `%s`.', + 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements '+ + 'in an <svg> parent. Try inspecting the child nodes of the element ' + + 'with React ID `%s`.', updatedIndex, parentID ) : invariant(updatedChild)); @@ -1570,21 +1598,14 @@ var DOMChildrenOperations = { module.exports = DOMChildrenOperations; -},{"./Danger":13,"./ReactMultiChildUpdateTypes":69,"./getTextContentAccessor":129,"./invariant":134}],11:[function(_dereq_,module,exports){ +},{"./Danger":14,"./ReactMultiChildUpdateTypes":72,"./getTextContentAccessor":135,"./invariant":140}],12:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DOMProperty * @typechecks static-only @@ -1596,6 +1617,10 @@ module.exports = DOMChildrenOperations; var invariant = _dereq_("./invariant"); +function checkMask(value, bitmask) { + return (value & bitmask) === bitmask; +} + var DOMPropertyInjection = { /** * Mapping from normalized, camelcased property names to a configuration that @@ -1682,19 +1707,19 @@ var DOMPropertyInjection = { var propConfig = Properties[propName]; DOMProperty.mustUseAttribute[propName] = - propConfig & DOMPropertyInjection.MUST_USE_ATTRIBUTE; + checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE); DOMProperty.mustUseProperty[propName] = - propConfig & DOMPropertyInjection.MUST_USE_PROPERTY; + checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY); DOMProperty.hasSideEffects[propName] = - propConfig & DOMPropertyInjection.HAS_SIDE_EFFECTS; + checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS); DOMProperty.hasBooleanValue[propName] = - propConfig & DOMPropertyInjection.HAS_BOOLEAN_VALUE; + checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE); DOMProperty.hasNumericValue[propName] = - propConfig & DOMPropertyInjection.HAS_NUMERIC_VALUE; + checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE); DOMProperty.hasPositiveNumericValue[propName] = - propConfig & DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE; + checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE); DOMProperty.hasOverloadedBooleanValue[propName] = - propConfig & DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE; + checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE); ("production" !== "development" ? invariant( !DOMProperty.mustUseAttribute[propName] || @@ -1870,21 +1895,14 @@ var DOMProperty = { module.exports = DOMProperty; -},{"./invariant":134}],12:[function(_dereq_,module,exports){ +},{"./invariant":140}],13:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DOMPropertyOperations * @typechecks static-only @@ -2011,10 +2029,17 @@ var DOMPropertyOperations = { } else if (shouldIgnoreValue(name, value)) { this.deleteValueForProperty(node, name); } else if (DOMProperty.mustUseAttribute[name]) { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. node.setAttribute(DOMProperty.getAttributeName[name], '' + value); } else { var propName = DOMProperty.getPropertyName[name]; - if (!DOMProperty.hasSideEffects[name] || node[propName] !== value) { + // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the + // property type before comparing; only `value` does and is string. + if (!DOMProperty.hasSideEffects[name] || + ('' + node[propName]) !== ('' + value)) { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. node[propName] = value; } } @@ -2050,7 +2075,7 @@ var DOMPropertyOperations = { propName ); if (!DOMProperty.hasSideEffects[name] || - node[propName] !== defaultValue) { + ('' + node[propName]) !== defaultValue) { node[propName] = defaultValue; } } @@ -2065,21 +2090,14 @@ var DOMPropertyOperations = { module.exports = DOMPropertyOperations; -},{"./DOMProperty":11,"./escapeTextForBrowser":118,"./memoizeStringOnly":143,"./warning":158}],13:[function(_dereq_,module,exports){ +},{"./DOMProperty":12,"./escapeTextForBrowser":123,"./memoizeStringOnly":149,"./warning":160}],14:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Danger * @typechecks static-only @@ -2128,9 +2146,10 @@ var Danger = { dangerouslyRenderMarkup: function(markupList) { ("production" !== "development" ? invariant( ExecutionEnvironment.canUseDOM, - 'dangerouslyRenderMarkup(...): Cannot render markup in a Worker ' + - 'thread. This is likely a bug in the framework. Please report ' + - 'immediately.' + 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + + 'thread. Make sure `window` and `document` are available globally ' + + 'before requiring React when unit testing or use ' + + 'React.renderToString for server rendering.' ) : invariant(ExecutionEnvironment.canUseDOM)); var nodeName; var markupByNodeName = {}; @@ -2234,8 +2253,9 @@ var Danger = { ("production" !== "development" ? invariant( ExecutionEnvironment.canUseDOM, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + - 'worker thread. This is likely a bug in the framework. Please report ' + - 'immediately.' + 'worker thread. Make sure `window` and `document` are available ' + + 'globally before requiring React when unit testing or use ' + + 'React.renderToString for server rendering.' ) : invariant(ExecutionEnvironment.canUseDOM)); ("production" !== "development" ? invariant(markup, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(markup)); ("production" !== "development" ? invariant( @@ -2254,21 +2274,14 @@ var Danger = { module.exports = Danger; -},{"./ExecutionEnvironment":22,"./createNodesFromMarkup":113,"./emptyFunction":116,"./getMarkupWrap":126,"./invariant":134}],14:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23,"./createNodesFromMarkup":117,"./emptyFunction":121,"./getMarkupWrap":132,"./invariant":140}],15:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DefaultEventPluginOrder */ @@ -2301,21 +2314,14 @@ var DefaultEventPluginOrder = [ module.exports = DefaultEventPluginOrder; -},{"./keyOf":141}],15:[function(_dereq_,module,exports){ +},{"./keyOf":147}],16:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EnterLeaveEventPlugin * @typechecks static-only @@ -2448,21 +2454,14 @@ var EnterLeaveEventPlugin = { module.exports = EnterLeaveEventPlugin; -},{"./EventConstants":16,"./EventPropagators":21,"./ReactMount":67,"./SyntheticMouseEvent":100,"./keyOf":141}],16:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPropagators":22,"./ReactMount":70,"./SyntheticMouseEvent":103,"./keyOf":147}],17:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventConstants */ @@ -2527,8 +2526,22 @@ var EventConstants = { module.exports = EventConstants; -},{"./keyMirror":140}],17:[function(_dereq_,module,exports){ +},{"./keyMirror":146}],18:[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 EventListener * @typechecks */ @@ -2601,21 +2614,14 @@ var EventListener = { module.exports = EventListener; -},{"./emptyFunction":116}],18:[function(_dereq_,module,exports){ +},{"./emptyFunction":121}],19:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPluginHub */ @@ -2625,11 +2631,9 @@ module.exports = EventListener; var EventPluginRegistry = _dereq_("./EventPluginRegistry"); var EventPluginUtils = _dereq_("./EventPluginUtils"); -var accumulate = _dereq_("./accumulate"); +var accumulateInto = _dereq_("./accumulateInto"); var forEachAccumulated = _dereq_("./forEachAccumulated"); var invariant = _dereq_("./invariant"); -var isEventSupported = _dereq_("./isEventSupported"); -var monitorCodeUse = _dereq_("./monitorCodeUse"); /** * Internal store for event listeners @@ -2763,15 +2767,6 @@ var EventPluginHub = { registrationName, typeof listener ) : invariant(!listener || typeof listener === 'function')); - if ("production" !== "development") { - // IE8 has no API for event capturing and the `onScroll` event doesn't - // bubble. - if (registrationName === 'onScroll' && - !isEventSupported('scroll', true)) { - monitorCodeUse('react_no_scroll_event'); - console.warn('This browser doesn\'t support the `onScroll` event'); - } - } var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); bankForRegistrationName[id] = listener; @@ -2840,7 +2835,7 @@ var EventPluginHub = { nativeEvent ); if (extractedEvents) { - events = accumulate(events, extractedEvents); + events = accumulateInto(events, extractedEvents); } } } @@ -2856,7 +2851,7 @@ var EventPluginHub = { */ enqueueEvents: function(events) { if (events) { - eventQueue = accumulate(eventQueue, events); + eventQueue = accumulateInto(eventQueue, events); } }, @@ -2893,21 +2888,14 @@ var EventPluginHub = { module.exports = EventPluginHub; -},{"./EventPluginRegistry":19,"./EventPluginUtils":20,"./accumulate":106,"./forEachAccumulated":121,"./invariant":134,"./isEventSupported":135,"./monitorCodeUse":148}],19:[function(_dereq_,module,exports){ +},{"./EventPluginRegistry":20,"./EventPluginUtils":21,"./accumulateInto":109,"./forEachAccumulated":126,"./invariant":140}],20:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPluginRegistry * @typechecks static-only @@ -3178,21 +3166,14 @@ var EventPluginRegistry = { module.exports = EventPluginRegistry; -},{"./invariant":134}],20:[function(_dereq_,module,exports){ +},{"./invariant":140}],21:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPluginUtils */ @@ -3404,21 +3385,14 @@ var EventPluginUtils = { module.exports = EventPluginUtils; -},{"./EventConstants":16,"./invariant":134}],21:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./invariant":140}],22:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule EventPropagators */ @@ -3428,7 +3402,7 @@ module.exports = EventPluginUtils; var EventConstants = _dereq_("./EventConstants"); var EventPluginHub = _dereq_("./EventPluginHub"); -var accumulate = _dereq_("./accumulate"); +var accumulateInto = _dereq_("./accumulateInto"); var forEachAccumulated = _dereq_("./forEachAccumulated"); var PropagationPhases = EventConstants.PropagationPhases; @@ -3459,8 +3433,9 @@ function accumulateDirectionalDispatches(domID, upwards, event) { var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured; var listener = listenerAtPhase(domID, event, phase); if (listener) { - event._dispatchListeners = accumulate(event._dispatchListeners, listener); - event._dispatchIDs = accumulate(event._dispatchIDs, domID); + event._dispatchListeners = + accumulateInto(event._dispatchListeners, listener); + event._dispatchIDs = accumulateInto(event._dispatchIDs, domID); } } @@ -3492,8 +3467,9 @@ function accumulateDispatches(id, ignoredDirection, event) { var registrationName = event.dispatchConfig.registrationName; var listener = getListener(id, registrationName); if (listener) { - event._dispatchListeners = accumulate(event._dispatchListeners, listener); - event._dispatchIDs = accumulate(event._dispatchIDs, id); + event._dispatchListeners = + accumulateInto(event._dispatchListeners, listener); + event._dispatchIDs = accumulateInto(event._dispatchIDs, id); } } } @@ -3549,21 +3525,14 @@ var EventPropagators = { module.exports = EventPropagators; -},{"./EventConstants":16,"./EventPluginHub":18,"./accumulate":106,"./forEachAccumulated":121}],22:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPluginHub":19,"./accumulateInto":109,"./forEachAccumulated":126}],23:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ExecutionEnvironment */ @@ -3601,21 +3570,14 @@ var ExecutionEnvironment = { module.exports = ExecutionEnvironment; -},{}],23:[function(_dereq_,module,exports){ +},{}],24:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule HTMLDOMPropertyConfig */ @@ -3660,6 +3622,7 @@ var HTMLDOMPropertyConfig = { * Standard Properties */ accept: null, + acceptCharset: null, accessKey: null, action: null, allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, @@ -3674,6 +3637,7 @@ var HTMLDOMPropertyConfig = { cellSpacing: null, charSet: MUST_USE_ATTRIBUTE, checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + classID: MUST_USE_ATTRIBUTE, // To set className on SVG elements, it's necessary to use .setAttribute; // this works on HTML elements too in all browsers except IE8. Conveniently, // IE8 doesn't support SVG and so we can simply use the attribute in @@ -3709,10 +3673,12 @@ var HTMLDOMPropertyConfig = { id: MUST_USE_PROPERTY, label: null, lang: null, - list: null, + list: MUST_USE_ATTRIBUTE, loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + manifest: MUST_USE_ATTRIBUTE, max: null, maxLength: MUST_USE_ATTRIBUTE, + media: MUST_USE_ATTRIBUTE, mediaGroup: null, method: null, min: null, @@ -3720,6 +3686,7 @@ var HTMLDOMPropertyConfig = { muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, name: null, noValidate: HAS_BOOLEAN_VALUE, + open: null, pattern: null, placeholder: null, poster: null, @@ -3733,18 +3700,17 @@ var HTMLDOMPropertyConfig = { rowSpan: null, sandbox: null, scope: null, - scrollLeft: MUST_USE_PROPERTY, scrolling: null, - scrollTop: MUST_USE_PROPERTY, seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, shape: null, size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE, + sizes: MUST_USE_ATTRIBUTE, span: HAS_POSITIVE_NUMERIC_VALUE, spellCheck: null, src: null, srcDoc: MUST_USE_PROPERTY, - srcSet: null, + srcSet: MUST_USE_ATTRIBUTE, start: HAS_NUMERIC_VALUE, step: null, style: null, @@ -3768,6 +3734,7 @@ var HTMLDOMPropertyConfig = { property: null // Supports OG in meta tags }, DOMAttributeNames: { + acceptCharset: 'accept-charset', className: 'class', htmlFor: 'for', httpEquiv: 'http-equiv' @@ -3789,21 +3756,14 @@ var HTMLDOMPropertyConfig = { module.exports = HTMLDOMPropertyConfig; -},{"./DOMProperty":11,"./ExecutionEnvironment":22}],24:[function(_dereq_,module,exports){ +},{"./DOMProperty":12,"./ExecutionEnvironment":23}],25:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule LinkedStateMixin * @typechecks static-only @@ -3837,21 +3797,14 @@ var LinkedStateMixin = { module.exports = LinkedStateMixin; -},{"./ReactLink":65,"./ReactStateSetters":81}],25:[function(_dereq_,module,exports){ +},{"./ReactLink":68,"./ReactStateSetters":85}],26:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule LinkedValueUtils * @typechecks static-only @@ -3998,21 +3951,14 @@ var LinkedValueUtils = { module.exports = LinkedValueUtils; -},{"./ReactPropTypes":75,"./invariant":134}],26:[function(_dereq_,module,exports){ +},{"./ReactPropTypes":79,"./invariant":140}],27:[function(_dereq_,module,exports){ /** - * Copyright 2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule LocalEventTrapMixin */ @@ -4021,7 +3967,7 @@ module.exports = LinkedValueUtils; var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter"); -var accumulate = _dereq_("./accumulate"); +var accumulateInto = _dereq_("./accumulateInto"); var forEachAccumulated = _dereq_("./forEachAccumulated"); var invariant = _dereq_("./invariant"); @@ -4037,7 +3983,8 @@ var LocalEventTrapMixin = { handlerBaseName, this.getDOMNode() ); - this._localEventListeners = accumulate(this._localEventListeners, listener); + this._localEventListeners = + accumulateInto(this._localEventListeners, listener); }, // trapCapturedEvent would look nearly identical. We don't implement that @@ -4052,21 +3999,14 @@ var LocalEventTrapMixin = { module.exports = LocalEventTrapMixin; -},{"./ReactBrowserEventEmitter":31,"./accumulate":106,"./forEachAccumulated":121,"./invariant":134}],27:[function(_dereq_,module,exports){ +},{"./ReactBrowserEventEmitter":33,"./accumulateInto":109,"./forEachAccumulated":126,"./invariant":140}],28:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule MobileSafariClickEventPlugin * @typechecks static-only @@ -4117,21 +4057,61 @@ var MobileSafariClickEventPlugin = { module.exports = MobileSafariClickEventPlugin; -},{"./EventConstants":16,"./emptyFunction":116}],28:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./emptyFunction":121}],29:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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 + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * http://www.apache.org/licenses/LICENSE-2.0 + * @providesModule Object.assign + */ + +// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign + +function assign(target, sources) { + if (target == null) { + throw new TypeError('Object.assign target cannot be null or undefined'); + } + + var to = Object(target); + var hasOwnProperty = Object.prototype.hasOwnProperty; + + for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { + var nextSource = arguments[nextIndex]; + if (nextSource == null) { + continue; + } + + var from = Object(nextSource); + + // We don't currently support accessors nor proxies. Therefore this + // copy cannot throw. If we ever supported this then we must handle + // exceptions and side-effects. We don't support symbols so they won't + // be transferred. + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + } + + return to; +}; + +module.exports = assign; + +},{}],30:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule PooledClass */ @@ -4238,21 +4218,14 @@ var PooledClass = { module.exports = PooledClass; -},{"./invariant":134}],29:[function(_dereq_,module,exports){ +},{"./invariant":140}],31:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule React */ @@ -4266,11 +4239,13 @@ var ReactComponent = _dereq_("./ReactComponent"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); var ReactContext = _dereq_("./ReactContext"); var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); +var ReactElementValidator = _dereq_("./ReactElementValidator"); var ReactDOM = _dereq_("./ReactDOM"); var ReactDOMComponent = _dereq_("./ReactDOMComponent"); var ReactDefaultInjection = _dereq_("./ReactDefaultInjection"); var ReactInstanceHandles = _dereq_("./ReactInstanceHandles"); +var ReactLegacyElement = _dereq_("./ReactLegacyElement"); var ReactMount = _dereq_("./ReactMount"); var ReactMultiChild = _dereq_("./ReactMultiChild"); var ReactPerf = _dereq_("./ReactPerf"); @@ -4278,10 +4253,30 @@ var ReactPropTypes = _dereq_("./ReactPropTypes"); var ReactServerRendering = _dereq_("./ReactServerRendering"); var ReactTextComponent = _dereq_("./ReactTextComponent"); +var assign = _dereq_("./Object.assign"); +var deprecated = _dereq_("./deprecated"); var onlyChild = _dereq_("./onlyChild"); ReactDefaultInjection.inject(); +var createElement = ReactElement.createElement; +var createFactory = ReactElement.createFactory; + +if ("production" !== "development") { + createElement = ReactElementValidator.createElement; + createFactory = ReactElementValidator.createFactory; +} + +// TODO: Drop legacy elements once classes no longer export these factories +createElement = ReactLegacyElement.wrapCreateElement( + createElement +); +createFactory = ReactLegacyElement.wrapCreateFactory( + createFactory +); + +var render = ReactPerf.measure('React', 'render', ReactMount.render); + var React = { Children: { map: ReactChildren.map, @@ -4295,25 +4290,58 @@ var React = { EventPluginUtils.useTouchEvents = shouldUseTouch; }, createClass: ReactCompositeComponent.createClass, - createDescriptor: function(type, props, children) { - var args = Array.prototype.slice.call(arguments, 1); - return type.apply(null, args); - }, + createElement: createElement, + createFactory: createFactory, constructAndRenderComponent: ReactMount.constructAndRenderComponent, constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID, - renderComponent: ReactPerf.measure( + render: render, + renderToString: ReactServerRendering.renderToString, + renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup, + unmountComponentAtNode: ReactMount.unmountComponentAtNode, + isValidClass: ReactLegacyElement.isValidClass, + isValidElement: ReactElement.isValidElement, + withContext: ReactContext.withContext, + + // Hook for JSX spread, don't use this for anything else. + __spread: assign, + + // Deprecations (remove for 0.13) + renderComponent: deprecated( 'React', 'renderComponent', - ReactMount.renderComponent + 'render', + this, + render ), - renderComponentToString: ReactServerRendering.renderComponentToString, - renderComponentToStaticMarkup: - ReactServerRendering.renderComponentToStaticMarkup, - unmountComponentAtNode: ReactMount.unmountComponentAtNode, - isValidClass: ReactDescriptor.isValidFactory, - isValidComponent: ReactDescriptor.isValidDescriptor, - withContext: ReactContext.withContext, - __internals: { + renderComponentToString: deprecated( + 'React', + 'renderComponentToString', + 'renderToString', + this, + ReactServerRendering.renderToString + ), + renderComponentToStaticMarkup: deprecated( + 'React', + 'renderComponentToStaticMarkup', + 'renderToStaticMarkup', + this, + ReactServerRendering.renderToStaticMarkup + ), + isValidComponent: deprecated( + 'React', + 'isValidComponent', + 'isValidElement', + this, + ReactElement.isValidElement + ) +}; + +// Inject the runtime into a devtools global hook regardless of browser. +// Allows for debugging when the hook is injected on the page. +if ( + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ Component: ReactComponent, CurrentOwner: ReactCurrentOwner, DOMComponent: ReactDOMComponent, @@ -4322,18 +4350,23 @@ var React = { Mount: ReactMount, MultiChild: ReactMultiChild, TextComponent: ReactTextComponent - } -}; + }); +} if ("production" !== "development") { var ExecutionEnvironment = _dereq_("./ExecutionEnvironment"); - if (ExecutionEnvironment.canUseDOM && - window.top === window.self && - navigator.userAgent.indexOf('Chrome') > -1) { - console.debug( - 'Download the React DevTools for a better development experience: ' + - 'http://fb.me/react-devtools' - ); + if (ExecutionEnvironment.canUseDOM && window.top === window.self) { + + // If we're in Chrome, look for the devtools marker and provide a download + // link if not installed. + if (navigator.userAgent.indexOf('Chrome') > -1) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + console.debug( + 'Download the React DevTools for a better development experience: ' + + 'http://fb.me/react-devtools' + ); + } + } var expectedFeatures = [ // shims @@ -4353,7 +4386,7 @@ if ("production" !== "development") { Object.freeze ]; - for (var i in expectedFeatures) { + for (var i = 0; i < expectedFeatures.length; i++) { if (!expectedFeatures[i]) { console.error( 'One or more ES5 shim/shams expected by React are not available: ' + @@ -4367,25 +4400,18 @@ if ("production" !== "development") { // Version exists only in the open-source version of React, not in Facebook's // internal version. -React.version = '0.11.1'; +React.version = '0.12.1'; module.exports = React; -},{"./DOMPropertyOperations":12,"./EventPluginUtils":20,"./ExecutionEnvironment":22,"./ReactChildren":34,"./ReactComponent":35,"./ReactCompositeComponent":38,"./ReactContext":39,"./ReactCurrentOwner":40,"./ReactDOM":41,"./ReactDOMComponent":43,"./ReactDefaultInjection":53,"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactMount":67,"./ReactMultiChild":68,"./ReactPerf":71,"./ReactPropTypes":75,"./ReactServerRendering":79,"./ReactTextComponent":83,"./onlyChild":149}],30:[function(_dereq_,module,exports){ +},{"./DOMPropertyOperations":13,"./EventPluginUtils":21,"./ExecutionEnvironment":23,"./Object.assign":29,"./ReactChildren":36,"./ReactComponent":37,"./ReactCompositeComponent":40,"./ReactContext":41,"./ReactCurrentOwner":42,"./ReactDOM":43,"./ReactDOMComponent":45,"./ReactDefaultInjection":55,"./ReactElement":58,"./ReactElementValidator":59,"./ReactInstanceHandles":66,"./ReactLegacyElement":67,"./ReactMount":70,"./ReactMultiChild":71,"./ReactPerf":75,"./ReactPropTypes":79,"./ReactServerRendering":83,"./ReactTextComponent":87,"./deprecated":120,"./onlyChild":151}],32:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactBrowserComponentMixin */ @@ -4419,21 +4445,14 @@ var ReactBrowserComponentMixin = { module.exports = ReactBrowserComponentMixin; -},{"./ReactEmptyComponent":58,"./ReactMount":67,"./invariant":134}],31:[function(_dereq_,module,exports){ +},{"./ReactEmptyComponent":60,"./ReactMount":70,"./invariant":140}],33:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactBrowserEventEmitter * @typechecks static-only @@ -4447,8 +4466,8 @@ var EventPluginRegistry = _dereq_("./EventPluginRegistry"); var ReactEventEmitterMixin = _dereq_("./ReactEventEmitterMixin"); var ViewportMetrics = _dereq_("./ViewportMetrics"); +var assign = _dereq_("./Object.assign"); var isEventSupported = _dereq_("./isEventSupported"); -var merge = _dereq_("./merge"); /** * Summary of `ReactBrowserEventEmitter` event handling: @@ -4577,7 +4596,7 @@ function getListeningForDocument(mountAt) { * * @internal */ -var ReactBrowserEventEmitter = merge(ReactEventEmitterMixin, { +var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { /** * Injectable event backend @@ -4781,21 +4800,14 @@ var ReactBrowserEventEmitter = merge(ReactEventEmitterMixin, { module.exports = ReactBrowserEventEmitter; -},{"./EventConstants":16,"./EventPluginHub":18,"./EventPluginRegistry":19,"./ReactEventEmitterMixin":60,"./ViewportMetrics":105,"./isEventSupported":135,"./merge":144}],32:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPluginHub":19,"./EventPluginRegistry":20,"./Object.assign":29,"./ReactEventEmitterMixin":62,"./ViewportMetrics":108,"./isEventSupported":141}],34:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks * @providesModule ReactCSSTransitionGroup @@ -4805,8 +4817,14 @@ module.exports = ReactBrowserEventEmitter; var React = _dereq_("./React"); -var ReactTransitionGroup = _dereq_("./ReactTransitionGroup"); -var ReactCSSTransitionGroupChild = _dereq_("./ReactCSSTransitionGroupChild"); +var assign = _dereq_("./Object.assign"); + +var ReactTransitionGroup = React.createFactory( + _dereq_("./ReactTransitionGroup") +); +var ReactCSSTransitionGroupChild = React.createFactory( + _dereq_("./ReactCSSTransitionGroupChild") +); var ReactCSSTransitionGroup = React.createClass({ displayName: 'ReactCSSTransitionGroup', @@ -4839,10 +4857,9 @@ var ReactCSSTransitionGroup = React.createClass({ }, render: function() { - return this.transferPropsTo( + return ( ReactTransitionGroup( - {childFactory: this._wrapChild}, - this.props.children + assign({}, this.props, {childFactory: this._wrapChild}) ) ); } @@ -4850,21 +4867,14 @@ var ReactCSSTransitionGroup = React.createClass({ module.exports = ReactCSSTransitionGroup; -},{"./React":29,"./ReactCSSTransitionGroupChild":33,"./ReactTransitionGroup":86}],33:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./React":31,"./ReactCSSTransitionGroupChild":35,"./ReactTransitionGroup":90}],35:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks * @providesModule ReactCSSTransitionGroupChild @@ -4909,7 +4919,10 @@ var ReactCSSTransitionGroupChild = React.createClass({ var activeClassName = className + '-active'; var noEventTimeout = null; - var endListener = function() { + var endListener = function(e) { + if (e && e.target !== node) { + return; + } if ("production" !== "development") { clearTimeout(noEventTimeout); } @@ -4987,21 +5000,14 @@ var ReactCSSTransitionGroupChild = React.createClass({ module.exports = ReactCSSTransitionGroupChild; -},{"./CSSCore":3,"./React":29,"./ReactTransitionEvents":85,"./onlyChild":149}],34:[function(_dereq_,module,exports){ +},{"./CSSCore":4,"./React":31,"./ReactTransitionEvents":89,"./onlyChild":151}],36:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactChildren */ @@ -5142,34 +5148,27 @@ var ReactChildren = { module.exports = ReactChildren; -},{"./PooledClass":28,"./traverseAllChildren":156,"./warning":158}],35:[function(_dereq_,module,exports){ +},{"./PooledClass":30,"./traverseAllChildren":158,"./warning":160}],37:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactComponent */ "use strict"; -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); var ReactOwner = _dereq_("./ReactOwner"); var ReactUpdates = _dereq_("./ReactUpdates"); +var assign = _dereq_("./Object.assign"); var invariant = _dereq_("./invariant"); var keyMirror = _dereq_("./keyMirror"); -var merge = _dereq_("./merge"); /** * Every React component is in one of these life cycles. @@ -5292,11 +5291,11 @@ var ReactComponent = { * @public */ setProps: function(partialProps, callback) { - // Merge with the pending descriptor if it exists, otherwise with existing - // descriptor props. - var descriptor = this._pendingDescriptor || this._descriptor; + // Merge with the pending element if it exists, otherwise with existing + // element props. + var element = this._pendingElement || this._currentElement; this.replaceProps( - merge(descriptor.props, partialProps), + assign({}, element.props, partialProps), callback ); }, @@ -5322,10 +5321,10 @@ var ReactComponent = { '`render` method to pass the correct value as props to the component ' + 'where it is created.' ) : invariant(this._mountDepth === 0)); - // This is a deoptimized path. We optimize for always having a descriptor. - // This creates an extra internal descriptor. - this._pendingDescriptor = ReactDescriptor.cloneAndReplaceProps( - this._pendingDescriptor || this._descriptor, + // This is a deoptimized path. We optimize for always having a element. + // This creates an extra internal element. + this._pendingElement = ReactElement.cloneAndReplaceProps( + this._pendingElement || this._currentElement, props ); ReactUpdates.enqueueUpdate(this, callback); @@ -5340,12 +5339,12 @@ var ReactComponent = { * @internal */ _setPropsInternal: function(partialProps, callback) { - // This is a deoptimized path. We optimize for always having a descriptor. - // This creates an extra internal descriptor. - var descriptor = this._pendingDescriptor || this._descriptor; - this._pendingDescriptor = ReactDescriptor.cloneAndReplaceProps( - descriptor, - merge(descriptor.props, partialProps) + // This is a deoptimized path. We optimize for always having a element. + // This creates an extra internal element. + var element = this._pendingElement || this._currentElement; + this._pendingElement = ReactElement.cloneAndReplaceProps( + element, + assign({}, element.props, partialProps) ); ReactUpdates.enqueueUpdate(this, callback); }, @@ -5356,19 +5355,19 @@ var ReactComponent = { * Subclasses that override this method should make sure to invoke * `ReactComponent.Mixin.construct.call(this, ...)`. * - * @param {ReactDescriptor} descriptor + * @param {ReactElement} element * @internal */ - construct: function(descriptor) { + construct: function(element) { // This is the public exposed props object after it has been processed - // with default props. The descriptor's props represents the true internal + // with default props. The element's props represents the true internal // state of the props. - this.props = descriptor.props; + this.props = element.props; // Record the component responsible for creating this component. - // This is accessible through the descriptor but we maintain an extra + // This is accessible through the element but we maintain an extra // field for compatibility with devtools and as a way to make an // incremental update. TODO: Consider deprecating this field. - this._owner = descriptor._owner; + this._owner = element._owner; // All components start unmounted. this._lifeCycleState = ComponentLifeCycle.UNMOUNTED; @@ -5376,10 +5375,10 @@ var ReactComponent = { // See ReactUpdates. this._pendingCallbacks = null; - // We keep the old descriptor and a reference to the pending descriptor + // We keep the old element and a reference to the pending element // to track updates. - this._descriptor = descriptor; - this._pendingDescriptor = null; + this._currentElement = element; + this._pendingElement = null; }, /** @@ -5404,10 +5403,10 @@ var ReactComponent = { 'single component instance in multiple places.', rootID ) : invariant(!this.isMounted())); - var props = this._descriptor.props; - if (props.ref != null) { - var owner = this._descriptor._owner; - ReactOwner.addComponentAsRefTo(this, props.ref, owner); + var ref = this._currentElement.ref; + if (ref != null) { + var owner = this._currentElement._owner; + ReactOwner.addComponentAsRefTo(this, ref, owner); } this._rootNodeID = rootID; this._lifeCycleState = ComponentLifeCycle.MOUNTED; @@ -5430,9 +5429,9 @@ var ReactComponent = { this.isMounted(), 'unmountComponent(): Can only unmount a mounted component.' ) : invariant(this.isMounted())); - var props = this.props; - if (props.ref != null) { - ReactOwner.removeComponentAsRefFrom(this, props.ref, this._owner); + var ref = this._currentElement.ref; + if (ref != null) { + ReactOwner.removeComponentAsRefFrom(this, ref, this._owner); } unmountIDFromEnvironment(this._rootNodeID); this._rootNodeID = null; @@ -5450,49 +5449,49 @@ var ReactComponent = { * @param {ReactReconcileTransaction} transaction * @internal */ - receiveComponent: function(nextDescriptor, transaction) { + receiveComponent: function(nextElement, transaction) { ("production" !== "development" ? invariant( this.isMounted(), 'receiveComponent(...): Can only update a mounted component.' ) : invariant(this.isMounted())); - this._pendingDescriptor = nextDescriptor; + this._pendingElement = nextElement; this.performUpdateIfNecessary(transaction); }, /** - * If `_pendingDescriptor` is set, update the component. + * If `_pendingElement` is set, update the component. * * @param {ReactReconcileTransaction} transaction * @internal */ performUpdateIfNecessary: function(transaction) { - if (this._pendingDescriptor == null) { + if (this._pendingElement == null) { return; } - var prevDescriptor = this._descriptor; - var nextDescriptor = this._pendingDescriptor; - this._descriptor = nextDescriptor; - this.props = nextDescriptor.props; - this._owner = nextDescriptor._owner; - this._pendingDescriptor = null; - this.updateComponent(transaction, prevDescriptor); + var prevElement = this._currentElement; + var nextElement = this._pendingElement; + this._currentElement = nextElement; + this.props = nextElement.props; + this._owner = nextElement._owner; + this._pendingElement = null; + this.updateComponent(transaction, prevElement); }, /** * Updates the component's currently mounted representation. * * @param {ReactReconcileTransaction} transaction - * @param {object} prevDescriptor + * @param {object} prevElement * @internal */ - updateComponent: function(transaction, prevDescriptor) { - var nextDescriptor = this._descriptor; + updateComponent: function(transaction, prevElement) { + var nextElement = this._currentElement; // If either the owner or a `ref` has changed, make sure the newest owner // has stored a reference to `this`, and the previous owner (if different) - // has forgotten the reference to `this`. We use the descriptor instead + // has forgotten the reference to `this`. We use the element instead // of the public this.props because the post processing cannot determine - // a ref. The ref conceptually lives on the descriptor. + // a ref. The ref conceptually lives on the element. // TODO: Should this even be possible? The owner cannot change because // it's forbidden by shouldUpdateReactComponent. The ref can change @@ -5500,19 +5499,19 @@ var ReactComponent = { // is made. It probably belongs where the key checking and // instantiateReactComponent is done. - if (nextDescriptor._owner !== prevDescriptor._owner || - nextDescriptor.props.ref !== prevDescriptor.props.ref) { - if (prevDescriptor.props.ref != null) { + if (nextElement._owner !== prevElement._owner || + nextElement.ref !== prevElement.ref) { + if (prevElement.ref != null) { ReactOwner.removeComponentAsRefFrom( - this, prevDescriptor.props.ref, prevDescriptor._owner + this, prevElement.ref, prevElement._owner ); } // Correct, even if the owner is the same, and only the ref has changed. - if (nextDescriptor.props.ref != null) { + if (nextElement.ref != null) { ReactOwner.addComponentAsRefTo( this, - nextDescriptor.props.ref, - nextDescriptor._owner + nextElement.ref, + nextElement._owner ); } } @@ -5526,7 +5525,7 @@ var ReactComponent = { * @param {boolean} shouldReuseMarkup If true, do not insert markup * @final * @internal - * @see {ReactMount.renderComponent} + * @see {ReactMount.render} */ mountComponentIntoNode: function(rootID, container, shouldReuseMarkup) { var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(); @@ -5590,21 +5589,14 @@ var ReactComponent = { module.exports = ReactComponent; -},{"./ReactDescriptor":56,"./ReactOwner":70,"./ReactUpdates":87,"./invariant":134,"./keyMirror":140,"./merge":144}],36:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./ReactElement":58,"./ReactOwner":74,"./ReactUpdates":91,"./invariant":140,"./keyMirror":146}],38:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactComponentBrowserEnvironment */ @@ -5717,21 +5709,14 @@ var ReactComponentBrowserEnvironment = { module.exports = ReactComponentBrowserEnvironment; -},{"./ReactDOMIDOperations":45,"./ReactMarkupChecksum":66,"./ReactMount":67,"./ReactPerf":71,"./ReactReconcileTransaction":77,"./getReactRootElementInContainer":128,"./invariant":134,"./setInnerHTML":152}],37:[function(_dereq_,module,exports){ +},{"./ReactDOMIDOperations":47,"./ReactMarkupChecksum":69,"./ReactMount":70,"./ReactPerf":75,"./ReactReconcileTransaction":81,"./getReactRootElementInContainer":134,"./invariant":140,"./setInnerHTML":154}],39:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactComponentWithPureRenderMixin */ @@ -5773,21 +5758,14 @@ var ReactComponentWithPureRenderMixin = { module.exports = ReactComponentWithPureRenderMixin; -},{"./shallowEqual":153}],38:[function(_dereq_,module,exports){ +},{"./shallowEqual":155}],40:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactCompositeComponent */ @@ -5797,10 +5775,11 @@ module.exports = ReactComponentWithPureRenderMixin; var ReactComponent = _dereq_("./ReactComponent"); var ReactContext = _dereq_("./ReactContext"); var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); -var ReactDescriptor = _dereq_("./ReactDescriptor"); -var ReactDescriptorValidator = _dereq_("./ReactDescriptorValidator"); +var ReactElement = _dereq_("./ReactElement"); +var ReactElementValidator = _dereq_("./ReactElementValidator"); var ReactEmptyComponent = _dereq_("./ReactEmptyComponent"); var ReactErrorUtils = _dereq_("./ReactErrorUtils"); +var ReactLegacyElement = _dereq_("./ReactLegacyElement"); var ReactOwner = _dereq_("./ReactOwner"); var ReactPerf = _dereq_("./ReactPerf"); var ReactPropTransferer = _dereq_("./ReactPropTransferer"); @@ -5808,16 +5787,18 @@ var ReactPropTypeLocations = _dereq_("./ReactPropTypeLocations"); var ReactPropTypeLocationNames = _dereq_("./ReactPropTypeLocationNames"); var ReactUpdates = _dereq_("./ReactUpdates"); +var assign = _dereq_("./Object.assign"); var instantiateReactComponent = _dereq_("./instantiateReactComponent"); var invariant = _dereq_("./invariant"); var keyMirror = _dereq_("./keyMirror"); -var merge = _dereq_("./merge"); -var mixInto = _dereq_("./mixInto"); +var keyOf = _dereq_("./keyOf"); var monitorCodeUse = _dereq_("./monitorCodeUse"); var mapObject = _dereq_("./mapObject"); var shouldUpdateReactComponent = _dereq_("./shouldUpdateReactComponent"); var warning = _dereq_("./warning"); +var MIXINS_KEY = keyOf({mixins: null}); + /** * Policies that describe methods in `ReactCompositeComponentInterface`. */ @@ -6121,7 +6102,8 @@ var RESERVED_SPEC_KEYS = { childContextTypes, ReactPropTypeLocations.childContext ); - Constructor.childContextTypes = merge( + Constructor.childContextTypes = assign( + {}, Constructor.childContextTypes, childContextTypes ); @@ -6132,7 +6114,11 @@ var RESERVED_SPEC_KEYS = { contextTypes, ReactPropTypeLocations.context ); - Constructor.contextTypes = merge(Constructor.contextTypes, contextTypes); + Constructor.contextTypes = assign( + {}, + Constructor.contextTypes, + contextTypes + ); }, /** * Special case getDefaultProps which should move into statics but requires @@ -6154,7 +6140,11 @@ var RESERVED_SPEC_KEYS = { propTypes, ReactPropTypeLocations.prop ); - Constructor.propTypes = merge(Constructor.propTypes, propTypes); + Constructor.propTypes = assign( + {}, + Constructor.propTypes, + propTypes + ); }, statics: function(Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); @@ -6223,11 +6213,12 @@ function validateLifeCycleOnReplaceState(instance) { 'replaceState(...): Can only update a mounted or mounting component.' ) : invariant(instance.isMounted() || compositeLifeCycleState === CompositeLifeCycle.MOUNTING)); - ("production" !== "development" ? invariant(compositeLifeCycleState !== CompositeLifeCycle.RECEIVING_STATE, + ("production" !== "development" ? invariant( + ReactCurrentOwner.current == null, 'replaceState(...): Cannot update during an existing state transition ' + - '(such as within `render`). This could potentially cause an infinite ' + - 'loop so it is forbidden.' - ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.RECEIVING_STATE)); + '(such as within `render`). Render methods should be a pure function ' + + 'of props and state.' + ) : invariant(ReactCurrentOwner.current == null)); ("production" !== "development" ? invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING, 'replaceState(...): Cannot update while unmounting component. This ' + 'usually means you called setState() on an unmounted component.' @@ -6235,28 +6226,45 @@ function validateLifeCycleOnReplaceState(instance) { } /** - * Custom version of `mixInto` which handles policy validation and reserved + * Mixin helper which handles policy validation and reserved * specification keys when building `ReactCompositeComponent` classses. */ function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + return; + } + ("production" !== "development" ? invariant( - !ReactDescriptor.isValidFactory(spec), + !ReactLegacyElement.isValidFactory(spec), 'ReactCompositeComponent: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.' - ) : invariant(!ReactDescriptor.isValidFactory(spec))); + ) : invariant(!ReactLegacyElement.isValidFactory(spec))); ("production" !== "development" ? invariant( - !ReactDescriptor.isValidDescriptor(spec), + !ReactElement.isValidElement(spec), 'ReactCompositeComponent: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.' - ) : invariant(!ReactDescriptor.isValidDescriptor(spec))); + ) : invariant(!ReactElement.isValidElement(spec))); var proto = Constructor.prototype; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + for (var name in spec) { - var property = spec[name]; if (!spec.hasOwnProperty(name)) { continue; } + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above + continue; + } + + var property = spec[name]; validateMethodOverride(proto, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { @@ -6334,23 +6342,25 @@ function mixStaticSpecIntoComponent(Constructor, statics) { continue; } + var isReserved = name in RESERVED_SPEC_KEYS; + ("production" !== "development" ? invariant( + !isReserved, + 'ReactCompositeComponent: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ) : invariant(!isReserved)); + var isInherited = name in Constructor; - var result = property; - if (isInherited) { - var existingProperty = Constructor[name]; - var existingType = typeof existingProperty; - var propertyType = typeof property; - ("production" !== "development" ? invariant( - existingType === 'function' && propertyType === 'function', - 'ReactCompositeComponent: You are attempting to define ' + - '`%s` on your component more than once, but that is only supported ' + - 'for functions, which are chained together. This conflict may be ' + - 'due to a mixin.', - name - ) : invariant(existingType === 'function' && propertyType === 'function')); - result = createChainedFunction(existingProperty, property); - } - Constructor[name] = result; + ("production" !== "development" ? invariant( + !isInherited, + 'ReactCompositeComponent: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ) : invariant(!isInherited)); + Constructor[name] = property; } } @@ -6371,7 +6381,10 @@ function mergeObjectsWithNoDuplicateKeys(one, two) { ("production" !== "development" ? invariant( one[key] === undefined, 'mergeObjectsWithNoDuplicateKeys(): ' + - 'Tried to merge two objects with the same key: %s', + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', key ) : invariant(one[key] === undefined)); one[key] = value; @@ -6427,19 +6440,19 @@ function createChainedFunction(one, two) { * Top Row: ReactComponent.ComponentLifeCycle * Low Row: ReactComponent.CompositeLifeCycle * - * +-------+------------------------------------------------------+--------+ - * | UN | MOUNTED | UN | - * |MOUNTED| | MOUNTED| - * +-------+------------------------------------------------------+--------+ - * | ^--------+ +------+ +------+ +------+ +--------^ | - * | | | | | | | | | | | | - * | 0--|MOUNTING|-0-|RECEIV|-0-|RECEIV|-0-|RECEIV|-0-| UN |--->0 | - * | | | |PROPS | | PROPS| | STATE| |MOUNTING| | - * | | | | | | | | | | | | - * | | | | | | | | | | | | - * | +--------+ +------+ +------+ +------+ +--------+ | - * | | | | - * +-------+------------------------------------------------------+--------+ + * +-------+---------------------------------+--------+ + * | UN | MOUNTED | UN | + * |MOUNTED| | MOUNTED| + * +-------+---------------------------------+--------+ + * | ^--------+ +-------+ +--------^ | + * | | | | | | | | + * | 0--|MOUNTING|-0-|RECEIVE|-0-| UN |--->0 | + * | | | |PROPS | |MOUNTING| | + * | | | | | | | | + * | | | | | | | | + * | +--------+ +-------+ +--------+ | + * | | | | + * +-------+---------------------------------+--------+ */ var CompositeLifeCycle = keyMirror({ /** @@ -6456,12 +6469,7 @@ var CompositeLifeCycle = keyMirror({ * Components that are mounted and receiving new props respond to state * changes differently. */ - RECEIVING_PROPS: null, - /** - * Components that are mounted and receiving new state are guarded against - * additional state changes. - */ - RECEIVING_STATE: null + RECEIVING_PROPS: null }); /** @@ -6472,11 +6480,11 @@ var ReactCompositeComponentMixin = { /** * Base constructor for all composite component. * - * @param {ReactDescriptor} descriptor + * @param {ReactElement} element * @final * @internal */ - construct: function(descriptor) { + construct: function(element) { // Children can be either an array or more than one argument ReactComponent.Mixin.construct.apply(this, arguments); ReactOwner.Mixin.construct.apply(this, arguments); @@ -6485,7 +6493,7 @@ var ReactCompositeComponentMixin = { this._pendingState = null; // This is the public post-processed context. The real context and pending - // context lives on the descriptor. + // context lives on the element. this.context = null; this._compositeLifeCycleState = null; @@ -6528,7 +6536,7 @@ var ReactCompositeComponentMixin = { this._bindAutoBindMethods(); } - this.context = this._processContext(this._descriptor._context); + this.context = this._processContext(this._currentElement._context); this.props = this._processProps(this.props); this.state = this.getInitialState ? this.getInitialState() : null; @@ -6552,7 +6560,8 @@ var ReactCompositeComponentMixin = { } this._renderedComponent = instantiateReactComponent( - this._renderValidatedComponent() + this._renderValidatedComponent(), + this._currentElement.type // The wrapping type ); // Done with mounting, `setState` will now trigger UI changes. @@ -6624,7 +6633,7 @@ var ReactCompositeComponentMixin = { } // Merge with `_pendingState` if it exists, otherwise with existing state. this.replaceState( - merge(this._pendingState || this.state, partialState), + assign({}, this._pendingState || this.state, partialState), callback ); }, @@ -6712,7 +6721,7 @@ var ReactCompositeComponentMixin = { name ) : invariant(name in this.constructor.childContextTypes)); } - return merge(currentContext, childContext); + return assign({}, currentContext, childContext); } return currentContext; }, @@ -6727,25 +6736,13 @@ var ReactCompositeComponentMixin = { * @private */ _processProps: function(newProps) { - var defaultProps = this.constructor.defaultProps; - var props; - if (defaultProps) { - props = merge(newProps); - for (var propName in defaultProps) { - if (typeof props[propName] === 'undefined') { - props[propName] = defaultProps[propName]; - } - } - } else { - props = newProps; - } if ("production" !== "development") { var propTypes = this.constructor.propTypes; if (propTypes) { - this._checkPropTypes(propTypes, props, ReactPropTypeLocations.prop); + this._checkPropTypes(propTypes, newProps, ReactPropTypeLocations.prop); } } - return props; + return newProps; }, /** @@ -6757,7 +6754,7 @@ var ReactCompositeComponentMixin = { * @private */ _checkPropTypes: function(propTypes, props, location) { - // TODO: Stop validating prop types here and only use the descriptor + // TODO: Stop validating prop types here and only use the element // validation. var componentName = this.constructor.displayName; for (var propName in propTypes) { @@ -6776,7 +6773,7 @@ var ReactCompositeComponentMixin = { }, /** - * If any of `_pendingDescriptor`, `_pendingState`, or `_pendingForceUpdate` + * If any of `_pendingElement`, `_pendingState`, or `_pendingForceUpdate` * is set, update the component. * * @param {ReactReconcileTransaction} transaction @@ -6791,7 +6788,7 @@ var ReactCompositeComponentMixin = { return; } - if (this._pendingDescriptor == null && + if (this._pendingElement == null && this._pendingState == null && !this._pendingForceUpdate) { return; @@ -6799,12 +6796,12 @@ var ReactCompositeComponentMixin = { var nextContext = this.context; var nextProps = this.props; - var nextDescriptor = this._descriptor; - if (this._pendingDescriptor != null) { - nextDescriptor = this._pendingDescriptor; - nextContext = this._processContext(nextDescriptor._context); - nextProps = this._processProps(nextDescriptor.props); - this._pendingDescriptor = null; + var nextElement = this._currentElement; + if (this._pendingElement != null) { + nextElement = this._pendingElement; + nextContext = this._processContext(nextElement._context); + nextProps = this._processProps(nextElement.props); + this._pendingElement = null; this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_PROPS; if (this.componentWillReceiveProps) { @@ -6812,51 +6809,47 @@ var ReactCompositeComponentMixin = { } } - this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_STATE; + this._compositeLifeCycleState = null; var nextState = this._pendingState || this.state; this._pendingState = null; - try { - var shouldUpdate = - this._pendingForceUpdate || - !this.shouldComponentUpdate || - this.shouldComponentUpdate(nextProps, nextState, nextContext); - - if ("production" !== "development") { - if (typeof shouldUpdate === "undefined") { - console.warn( - (this.constructor.displayName || 'ReactCompositeComponent') + - '.shouldComponentUpdate(): Returned undefined instead of a ' + - 'boolean value. Make sure to return true or false.' - ); - } - } + var shouldUpdate = + this._pendingForceUpdate || + !this.shouldComponentUpdate || + this.shouldComponentUpdate(nextProps, nextState, nextContext); - if (shouldUpdate) { - this._pendingForceUpdate = false; - // Will set `this.props`, `this.state` and `this.context`. - this._performComponentUpdate( - nextDescriptor, - nextProps, - nextState, - nextContext, - transaction + if ("production" !== "development") { + if (typeof shouldUpdate === "undefined") { + console.warn( + (this.constructor.displayName || 'ReactCompositeComponent') + + '.shouldComponentUpdate(): Returned undefined instead of a ' + + 'boolean value. Make sure to return true or false.' ); - } else { - // If it's determined that a component should not update, we still want - // to set props and state. - this._descriptor = nextDescriptor; - this.props = nextProps; - this.state = nextState; - this.context = nextContext; - - // Owner cannot change because shouldUpdateReactComponent doesn't allow - // it. TODO: Remove this._owner completely. - this._owner = nextDescriptor._owner; } - } finally { - this._compositeLifeCycleState = null; + } + + if (shouldUpdate) { + this._pendingForceUpdate = false; + // Will set `this.props`, `this.state` and `this.context`. + this._performComponentUpdate( + nextElement, + nextProps, + nextState, + nextContext, + transaction + ); + } else { + // If it's determined that a component should not update, we still want + // to set props and state. + this._currentElement = nextElement; + this.props = nextProps; + this.state = nextState; + this.context = nextContext; + + // Owner cannot change because shouldUpdateReactComponent doesn't allow + // it. TODO: Remove this._owner completely. + this._owner = nextElement._owner; } }, @@ -6864,7 +6857,7 @@ var ReactCompositeComponentMixin = { * Merges new props and state, notifies delegate methods of update and * performs update. * - * @param {ReactDescriptor} nextDescriptor Next descriptor + * @param {ReactElement} nextElement Next element * @param {object} nextProps Next public object to set as properties. * @param {?object} nextState Next object to set as state. * @param {?object} nextContext Next public object to set as context. @@ -6872,13 +6865,13 @@ var ReactCompositeComponentMixin = { * @private */ _performComponentUpdate: function( - nextDescriptor, + nextElement, nextProps, nextState, nextContext, transaction ) { - var prevDescriptor = this._descriptor; + var prevElement = this._currentElement; var prevProps = this.props; var prevState = this.state; var prevContext = this.context; @@ -6887,18 +6880,18 @@ var ReactCompositeComponentMixin = { this.componentWillUpdate(nextProps, nextState, nextContext); } - this._descriptor = nextDescriptor; + this._currentElement = nextElement; this.props = nextProps; this.state = nextState; this.context = nextContext; // Owner cannot change because shouldUpdateReactComponent doesn't allow // it. TODO: Remove this._owner completely. - this._owner = nextDescriptor._owner; + this._owner = nextElement._owner; this.updateComponent( transaction, - prevDescriptor + prevElement ); if (this.componentDidUpdate) { @@ -6909,22 +6902,22 @@ var ReactCompositeComponentMixin = { } }, - receiveComponent: function(nextDescriptor, transaction) { - if (nextDescriptor === this._descriptor && - nextDescriptor._owner != null) { - // Since descriptors are immutable after the owner is rendered, + receiveComponent: function(nextElement, transaction) { + if (nextElement === this._currentElement && + nextElement._owner != null) { + // Since elements are immutable after the owner is rendered, // we can do a cheap identity compare here to determine if this is a // superfluous reconcile. It's possible for state to be mutable but such // change should trigger an update of the owner which would recreate - // the descriptor. We explicitly check for the existence of an owner since - // it's possible for a descriptor created outside a composite to be + // the element. We explicitly check for the existence of an owner since + // it's possible for a element created outside a composite to be // deeply mutated and reused. return; } ReactComponent.Mixin.receiveComponent.call( this, - nextDescriptor, + nextElement, transaction ); }, @@ -6936,31 +6929,34 @@ var ReactCompositeComponentMixin = { * Sophisticated clients may wish to override this. * * @param {ReactReconcileTransaction} transaction - * @param {ReactDescriptor} prevDescriptor + * @param {ReactElement} prevElement * @internal * @overridable */ updateComponent: ReactPerf.measure( 'ReactCompositeComponent', 'updateComponent', - function(transaction, prevParentDescriptor) { + function(transaction, prevParentElement) { ReactComponent.Mixin.updateComponent.call( this, transaction, - prevParentDescriptor + prevParentElement ); var prevComponentInstance = this._renderedComponent; - var prevDescriptor = prevComponentInstance._descriptor; - var nextDescriptor = this._renderValidatedComponent(); - if (shouldUpdateReactComponent(prevDescriptor, nextDescriptor)) { - prevComponentInstance.receiveComponent(nextDescriptor, transaction); + var prevElement = prevComponentInstance._currentElement; + var nextElement = this._renderValidatedComponent(); + if (shouldUpdateReactComponent(prevElement, nextElement)) { + prevComponentInstance.receiveComponent(nextElement, transaction); } else { // These two IDs are actually the same! But nothing should rely on that. var thisID = this._rootNodeID; var prevComponentID = prevComponentInstance._rootNodeID; prevComponentInstance.unmountComponent(); - this._renderedComponent = instantiateReactComponent(nextDescriptor); + this._renderedComponent = instantiateReactComponent( + nextElement, + this._currentElement.type + ); var nextMarkup = this._renderedComponent.mountComponent( thisID, transaction, @@ -6998,12 +6994,12 @@ var ReactCompositeComponentMixin = { ) : invariant(this.isMounted() || compositeLifeCycleState === CompositeLifeCycle.MOUNTING)); ("production" !== "development" ? invariant( - compositeLifeCycleState !== CompositeLifeCycle.RECEIVING_STATE && - compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING, + compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING && + ReactCurrentOwner.current == null, 'forceUpdate(...): Cannot force an update while unmounting component ' + - 'or during an existing state transition (such as within `render`).' - ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.RECEIVING_STATE && - compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING)); + 'or within a `render` function.' + ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING && + ReactCurrentOwner.current == null)); this._pendingForceUpdate = true; ReactUpdates.enqueueUpdate(this, callback); }, @@ -7018,7 +7014,7 @@ var ReactCompositeComponentMixin = { var renderedComponent; var previousContext = ReactContext.current; ReactContext.current = this._processChildContext( - this._descriptor._context + this._currentElement._context ); ReactCurrentOwner.current = this; try { @@ -7034,11 +7030,11 @@ var ReactCompositeComponentMixin = { ReactCurrentOwner.current = null; } ("production" !== "development" ? invariant( - ReactDescriptor.isValidDescriptor(renderedComponent), + ReactElement.isValidElement(renderedComponent), '%s.render(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.constructor.displayName || 'ReactCompositeComponent' - ) : invariant(ReactDescriptor.isValidDescriptor(renderedComponent))); + ) : invariant(ReactElement.isValidElement(renderedComponent))); return renderedComponent; } ), @@ -7067,16 +7063,14 @@ var ReactCompositeComponentMixin = { */ _bindAutoBindMethod: function(method) { var component = this; - var boundMethod = function() { - return method.apply(component, arguments); - }; + var boundMethod = method.bind(component); if ("production" !== "development") { boundMethod.__reactBoundContext = component; boundMethod.__reactBoundMethod = method; boundMethod.__reactBoundArguments = null; var componentName = component.constructor.displayName; var _bind = boundMethod.bind; - boundMethod.bind = function(newThis ) {var args=Array.prototype.slice.call(arguments,1); + boundMethod.bind = function(newThis ) {for (var args=[],$__0=1,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); // User is trying to bind() an autobound method; we effectively will // ignore the value of "this" that the user is trying to use, so // let's warn. @@ -7107,10 +7101,13 @@ var ReactCompositeComponentMixin = { }; var ReactCompositeComponentBase = function() {}; -mixInto(ReactCompositeComponentBase, ReactComponent.Mixin); -mixInto(ReactCompositeComponentBase, ReactOwner.Mixin); -mixInto(ReactCompositeComponentBase, ReactPropTransferer.Mixin); -mixInto(ReactCompositeComponentBase, ReactCompositeComponentMixin); +assign( + ReactCompositeComponentBase.prototype, + ReactComponent.Mixin, + ReactOwner.Mixin, + ReactPropTransferer.Mixin, + ReactCompositeComponentMixin +); /** * Module for creating composite components. @@ -7134,8 +7131,10 @@ var ReactCompositeComponent = { * @public */ createClass: function(spec) { - var Constructor = function(props, owner) { - this.construct(props, owner); + var Constructor = function(props) { + // This constructor is overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. This will later be used + // by the stand-alone class implementation. }; Constructor.prototype = new ReactCompositeComponentBase(); Constructor.prototype.constructor = Constructor; @@ -7178,17 +7177,14 @@ var ReactCompositeComponent = { } } - var descriptorFactory = ReactDescriptor.createFactory(Constructor); - if ("production" !== "development") { - return ReactDescriptorValidator.createFactory( - descriptorFactory, - Constructor.propTypes, - Constructor.contextTypes + return ReactLegacyElement.wrapFactory( + ReactElementValidator.createFactory(Constructor) ); } - - return descriptorFactory; + return ReactLegacyElement.wrapFactory( + ReactElement.createFactory(Constructor) + ); }, injection: { @@ -7200,28 +7196,21 @@ var ReactCompositeComponent = { module.exports = ReactCompositeComponent; -},{"./ReactComponent":35,"./ReactContext":39,"./ReactCurrentOwner":40,"./ReactDescriptor":56,"./ReactDescriptorValidator":57,"./ReactEmptyComponent":58,"./ReactErrorUtils":59,"./ReactOwner":70,"./ReactPerf":71,"./ReactPropTransferer":72,"./ReactPropTypeLocationNames":73,"./ReactPropTypeLocations":74,"./ReactUpdates":87,"./instantiateReactComponent":133,"./invariant":134,"./keyMirror":140,"./mapObject":142,"./merge":144,"./mixInto":147,"./monitorCodeUse":148,"./shouldUpdateReactComponent":154,"./warning":158}],39:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./ReactComponent":37,"./ReactContext":41,"./ReactCurrentOwner":42,"./ReactElement":58,"./ReactElementValidator":59,"./ReactEmptyComponent":60,"./ReactErrorUtils":61,"./ReactLegacyElement":67,"./ReactOwner":74,"./ReactPerf":75,"./ReactPropTransferer":76,"./ReactPropTypeLocationNames":77,"./ReactPropTypeLocations":78,"./ReactUpdates":91,"./instantiateReactComponent":139,"./invariant":140,"./keyMirror":146,"./keyOf":147,"./mapObject":148,"./monitorCodeUse":150,"./shouldUpdateReactComponent":156,"./warning":160}],41:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactContext */ "use strict"; -var merge = _dereq_("./merge"); +var assign = _dereq_("./Object.assign"); /** * Keeps track of the current context. @@ -7243,7 +7232,7 @@ var ReactContext = { * A typical use case might look like * * render: function() { - * var children = ReactContext.withContext({foo: 'foo'} () => ( + * var children = ReactContext.withContext({foo: 'foo'}, () => ( * * )); * return <div>{children}</div>; @@ -7256,7 +7245,7 @@ var ReactContext = { withContext: function(newContext, scopedCallback) { var result; var previousContext = ReactContext.current; - ReactContext.current = merge(previousContext, newContext); + ReactContext.current = assign({}, previousContext, newContext); try { result = scopedCallback(); } finally { @@ -7269,21 +7258,14 @@ var ReactContext = { module.exports = ReactContext; -},{"./merge":144}],40:[function(_dereq_,module,exports){ +},{"./Object.assign":29}],42:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactCurrentOwner */ @@ -7310,21 +7292,14 @@ var ReactCurrentOwner = { module.exports = ReactCurrentOwner; -},{}],41:[function(_dereq_,module,exports){ +},{}],43:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOM * @typechecks static-only @@ -7332,45 +7307,27 @@ module.exports = ReactCurrentOwner; "use strict"; -var ReactDescriptor = _dereq_("./ReactDescriptor"); -var ReactDescriptorValidator = _dereq_("./ReactDescriptorValidator"); -var ReactDOMComponent = _dereq_("./ReactDOMComponent"); +var ReactElement = _dereq_("./ReactElement"); +var ReactElementValidator = _dereq_("./ReactElementValidator"); +var ReactLegacyElement = _dereq_("./ReactLegacyElement"); -var mergeInto = _dereq_("./mergeInto"); var mapObject = _dereq_("./mapObject"); /** - * Creates a new React class that is idempotent and capable of containing other - * React components. It accepts event listeners and DOM properties that are - * valid according to `DOMProperty`. - * - * - Event listeners: `onClick`, `onMouseDown`, etc. - * - DOM properties: `className`, `name`, `title`, etc. - * - * The `style` property functions differently from the DOM API. It accepts an - * object mapping of style properties to values. + * Create a factory that creates HTML tag elements. * - * @param {boolean} omitClose True if the close tag should be omitted. * @param {string} tag Tag name (e.g. `div`). * @private */ -function createDOMComponentClass(omitClose, tag) { - var Constructor = function(descriptor) { - this.construct(descriptor); - }; - Constructor.prototype = new ReactDOMComponent(tag, omitClose); - Constructor.prototype.constructor = Constructor; - Constructor.displayName = tag; - - var ConvenienceConstructor = ReactDescriptor.createFactory(Constructor); - +function createDOMFactory(tag) { if ("production" !== "development") { - return ReactDescriptorValidator.createFactory( - ConvenienceConstructor + return ReactLegacyElement.markNonLegacyFactory( + ReactElementValidator.createFactory(tag) ); } - - return ConvenienceConstructor; + return ReactLegacyElement.markNonLegacyFactory( + ReactElement.createFactory(tag) + ); } /** @@ -7380,162 +7337,150 @@ function createDOMComponentClass(omitClose, tag) { * @public */ var ReactDOM = mapObject({ - a: false, - abbr: false, - address: false, - area: true, - article: false, - aside: false, - audio: false, - b: false, - base: true, - bdi: false, - bdo: false, - big: false, - blockquote: false, - body: false, - br: true, - button: false, - canvas: false, - caption: false, - cite: false, - code: false, - col: true, - colgroup: false, - data: false, - datalist: false, - dd: false, - del: false, - details: false, - dfn: false, - div: false, - dl: false, - dt: false, - em: false, - embed: true, - fieldset: false, - figcaption: false, - figure: false, - footer: false, - form: false, // NOTE: Injected, see `ReactDOMForm`. - h1: false, - h2: false, - h3: false, - h4: false, - h5: false, - h6: false, - head: false, - header: false, - hr: true, - html: false, - i: false, - iframe: false, - img: true, - input: true, - ins: false, - kbd: false, - keygen: true, - label: false, - legend: false, - li: false, - link: true, - main: false, - map: false, - mark: false, - menu: false, - menuitem: false, // NOTE: Close tag should be omitted, but causes problems. - meta: true, - meter: false, - nav: false, - noscript: false, - object: false, - ol: false, - optgroup: false, - option: false, - output: false, - p: false, - param: true, - pre: false, - progress: false, - q: false, - rp: false, - rt: false, - ruby: false, - s: false, - samp: false, - script: false, - section: false, - select: false, - small: false, - source: true, - span: false, - strong: false, - style: false, - sub: false, - summary: false, - sup: false, - table: false, - tbody: false, - td: false, - textarea: false, // NOTE: Injected, see `ReactDOMTextarea`. - tfoot: false, - th: false, - thead: false, - time: false, - title: false, - tr: false, - track: true, - u: false, - ul: false, - 'var': false, - video: false, - wbr: true, + a: 'a', + abbr: 'abbr', + address: 'address', + area: 'area', + article: 'article', + aside: 'aside', + audio: 'audio', + b: 'b', + base: 'base', + bdi: 'bdi', + bdo: 'bdo', + big: 'big', + blockquote: 'blockquote', + body: 'body', + br: 'br', + button: 'button', + canvas: 'canvas', + caption: 'caption', + cite: 'cite', + code: 'code', + col: 'col', + colgroup: 'colgroup', + data: 'data', + datalist: 'datalist', + dd: 'dd', + del: 'del', + details: 'details', + dfn: 'dfn', + dialog: 'dialog', + div: 'div', + dl: 'dl', + dt: 'dt', + em: 'em', + embed: 'embed', + fieldset: 'fieldset', + figcaption: 'figcaption', + figure: 'figure', + footer: 'footer', + form: 'form', + h1: 'h1', + h2: 'h2', + h3: 'h3', + h4: 'h4', + h5: 'h5', + h6: 'h6', + head: 'head', + header: 'header', + hr: 'hr', + html: 'html', + i: 'i', + iframe: 'iframe', + img: 'img', + input: 'input', + ins: 'ins', + kbd: 'kbd', + keygen: 'keygen', + label: 'label', + legend: 'legend', + li: 'li', + link: 'link', + main: 'main', + map: 'map', + mark: 'mark', + menu: 'menu', + menuitem: 'menuitem', + meta: 'meta', + meter: 'meter', + nav: 'nav', + noscript: 'noscript', + object: 'object', + ol: 'ol', + optgroup: 'optgroup', + option: 'option', + output: 'output', + p: 'p', + param: 'param', + picture: 'picture', + pre: 'pre', + progress: 'progress', + q: 'q', + rp: 'rp', + rt: 'rt', + ruby: 'ruby', + s: 's', + samp: 'samp', + script: 'script', + section: 'section', + select: 'select', + small: 'small', + source: 'source', + span: 'span', + strong: 'strong', + style: 'style', + sub: 'sub', + summary: 'summary', + sup: 'sup', + table: 'table', + tbody: 'tbody', + td: 'td', + textarea: 'textarea', + tfoot: 'tfoot', + th: 'th', + thead: 'thead', + time: 'time', + title: 'title', + tr: 'tr', + track: 'track', + u: 'u', + ul: 'ul', + 'var': 'var', + video: 'video', + wbr: 'wbr', // SVG - circle: false, - defs: false, - ellipse: false, - g: false, - line: false, - linearGradient: false, - mask: false, - path: false, - pattern: false, - polygon: false, - polyline: false, - radialGradient: false, - rect: false, - stop: false, - svg: false, - text: false, - tspan: false -}, createDOMComponentClass); - -var injection = { - injectComponentClasses: function(componentClasses) { - mergeInto(ReactDOM, componentClasses); - } -}; - -ReactDOM.injection = injection; + circle: 'circle', + defs: 'defs', + ellipse: 'ellipse', + g: 'g', + line: 'line', + linearGradient: 'linearGradient', + mask: 'mask', + path: 'path', + pattern: 'pattern', + polygon: 'polygon', + polyline: 'polyline', + radialGradient: 'radialGradient', + rect: 'rect', + stop: 'stop', + svg: 'svg', + text: 'text', + tspan: 'tspan' + +}, createDOMFactory); module.exports = ReactDOM; -},{"./ReactDOMComponent":43,"./ReactDescriptor":56,"./ReactDescriptorValidator":57,"./mapObject":142,"./mergeInto":146}],42:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./ReactElementValidator":59,"./ReactLegacyElement":67,"./mapObject":148}],44:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMButton */ @@ -7545,12 +7490,13 @@ module.exports = ReactDOM; var AutoFocusMixin = _dereq_("./AutoFocusMixin"); var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var ReactDOM = _dereq_("./ReactDOM"); var keyMirror = _dereq_("./keyMirror"); -// Store a reference to the <button> `ReactDOMComponent`. -var button = ReactDOM.button; +// Store a reference to the <button> `ReactDOMComponent`. TODO: use string +var button = ReactElement.createFactory(ReactDOM.button.type); var mouseListenerNames = keyMirror({ onClick: true, @@ -7592,21 +7538,14 @@ var ReactDOMButton = ReactCompositeComponent.createClass({ module.exports = ReactDOMButton; -},{"./AutoFocusMixin":1,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./keyMirror":140}],43:[function(_dereq_,module,exports){ +},{"./AutoFocusMixin":2,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":58,"./keyMirror":146}],45:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMComponent * @typechecks static-only @@ -7624,11 +7563,12 @@ var ReactMount = _dereq_("./ReactMount"); var ReactMultiChild = _dereq_("./ReactMultiChild"); var ReactPerf = _dereq_("./ReactPerf"); +var assign = _dereq_("./Object.assign"); var escapeTextForBrowser = _dereq_("./escapeTextForBrowser"); var invariant = _dereq_("./invariant"); +var isEventSupported = _dereq_("./isEventSupported"); var keyOf = _dereq_("./keyOf"); -var merge = _dereq_("./merge"); -var mixInto = _dereq_("./mixInto"); +var monitorCodeUse = _dereq_("./monitorCodeUse"); var deleteListener = ReactBrowserEventEmitter.deleteListener; var listenTo = ReactBrowserEventEmitter.listenTo; @@ -7653,6 +7593,16 @@ function assertValidProps(props) { props.children == null || props.dangerouslySetInnerHTML == null, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.' ) : invariant(props.children == null || props.dangerouslySetInnerHTML == null)); + if ("production" !== "development") { + if (props.contentEditable && props.children != null) { + console.warn( + 'A component is `contentEditable` and contains `children` managed by ' + + 'React. It is now your responsibility to guarantee that none of those '+ + 'nodes are unexpectedly modified or duplicated. This is probably not ' + + 'intentional.' + ); + } + } ("production" !== "development" ? invariant( props.style == null || typeof props.style === 'object', 'The `style` prop expects a mapping from style properties to values, ' + @@ -7661,6 +7611,15 @@ function assertValidProps(props) { } function putListener(id, registrationName, listener, transaction) { + if ("production" !== "development") { + // IE8 has no API for event capturing and the `onScroll` event doesn't + // bubble. + if (registrationName === 'onScroll' && + !isEventSupported('scroll', true)) { + monitorCodeUse('react_no_scroll_event'); + console.warn('This browser doesn\'t support the `onScroll` event'); + } + } var container = ReactMount.findReactContainerForID(id); if (container) { var doc = container.nodeType === ELEMENT_NODE_TYPE ? @@ -7675,18 +7634,66 @@ function putListener(id, registrationName, listener, transaction) { ); } +// For HTML, certain tags should omit their close tag. We keep a whitelist for +// those special cased tags. + +var omittedCloseTags = { + 'area': true, + 'base': true, + 'br': true, + 'col': true, + 'embed': true, + 'hr': true, + 'img': true, + 'input': true, + 'keygen': true, + 'link': true, + 'meta': true, + 'param': true, + 'source': true, + 'track': true, + 'wbr': true + // NOTE: menuitem's close tag should be omitted, but that causes problems. +}; + +// We accept any tag to be rendered but since this gets injected into abitrary +// HTML, we want to make sure that it's a safe tag. +// http://www.w3.org/TR/REC-xml/#NT-Name + +var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset +var validatedTagCache = {}; +var hasOwnProperty = {}.hasOwnProperty; + +function validateDangerousTag(tag) { + if (!hasOwnProperty.call(validatedTagCache, tag)) { + ("production" !== "development" ? invariant(VALID_TAG_REGEX.test(tag), 'Invalid tag: %s', tag) : invariant(VALID_TAG_REGEX.test(tag))); + validatedTagCache[tag] = true; + } +} /** + * Creates a new React class that is idempotent and capable of containing other + * React components. It accepts event listeners and DOM properties that are + * valid according to `DOMProperty`. + * + * - Event listeners: `onClick`, `onMouseDown`, etc. + * - DOM properties: `className`, `name`, `title`, etc. + * + * The `style` property functions differently from the DOM API. It accepts an + * object mapping of style properties to values. + * * @constructor ReactDOMComponent * @extends ReactComponent * @extends ReactMultiChild */ -function ReactDOMComponent(tag, omitClose) { - this._tagOpen = '<' + tag; - this._tagClose = omitClose ? '' : '</' + tag + '>'; +function ReactDOMComponent(tag) { + validateDangerousTag(tag); + this._tag = tag; this.tagName = tag.toUpperCase(); } +ReactDOMComponent.displayName = 'ReactDOMComponent'; + ReactDOMComponent.Mixin = { /** @@ -7710,10 +7717,11 @@ ReactDOMComponent.Mixin = { mountDepth ); assertValidProps(this.props); + var closeTag = omittedCloseTags[this._tag] ? '' : '</' + this._tag + '>'; return ( this._createOpenTagMarkupAndPutListeners(transaction) + this._createContentMarkup(transaction) + - this._tagClose + closeTag ); } ), @@ -7732,7 +7740,7 @@ ReactDOMComponent.Mixin = { */ _createOpenTagMarkupAndPutListeners: function(transaction) { var props = this.props; - var ret = this._tagOpen; + var ret = '<' + this._tag; for (var propKey in props) { if (!props.hasOwnProperty(propKey)) { @@ -7747,7 +7755,7 @@ ReactDOMComponent.Mixin = { } else { if (propKey === STYLE) { if (propValue) { - propValue = props.style = merge(props.style); + propValue = props.style = assign({}, props.style); } propValue = CSSPropertyOperations.createMarkupForStyles(propValue); } @@ -7800,22 +7808,22 @@ ReactDOMComponent.Mixin = { return ''; }, - receiveComponent: function(nextDescriptor, transaction) { - if (nextDescriptor === this._descriptor && - nextDescriptor._owner != null) { - // Since descriptors are immutable after the owner is rendered, + receiveComponent: function(nextElement, transaction) { + if (nextElement === this._currentElement && + nextElement._owner != null) { + // Since elements are immutable after the owner is rendered, // we can do a cheap identity compare here to determine if this is a // superfluous reconcile. It's possible for state to be mutable but such // change should trigger an update of the owner which would recreate - // the descriptor. We explicitly check for the existence of an owner since - // it's possible for a descriptor created outside a composite to be + // the element. We explicitly check for the existence of an owner since + // it's possible for a element created outside a composite to be // deeply mutated and reused. return; } ReactComponent.Mixin.receiveComponent.call( this, - nextDescriptor, + nextElement, transaction ); }, @@ -7825,22 +7833,22 @@ ReactDOMComponent.Mixin = { * attached to the DOM. Reconciles the root DOM node, then recurses. * * @param {ReactReconcileTransaction} transaction - * @param {ReactDescriptor} prevDescriptor + * @param {ReactElement} prevElement * @internal * @overridable */ updateComponent: ReactPerf.measure( 'ReactDOMComponent', 'updateComponent', - function(transaction, prevDescriptor) { - assertValidProps(this._descriptor.props); + function(transaction, prevElement) { + assertValidProps(this._currentElement.props); ReactComponent.Mixin.updateComponent.call( this, transaction, - prevDescriptor + prevElement ); - this._updateDOMProperties(prevDescriptor.props, transaction); - this._updateDOMChildren(prevDescriptor.props, transaction); + this._updateDOMProperties(prevElement.props, transaction); + this._updateDOMChildren(prevElement.props, transaction); } ), @@ -7896,7 +7904,7 @@ ReactDOMComponent.Mixin = { } if (propKey === STYLE) { if (nextProp) { - nextProp = nextProps.style = merge(nextProp); + nextProp = nextProps.style = assign({}, nextProp); } if (lastProp) { // Unset styles on `lastProp` but not on `nextProp`. @@ -8005,28 +8013,24 @@ ReactDOMComponent.Mixin = { }; -mixInto(ReactDOMComponent, ReactComponent.Mixin); -mixInto(ReactDOMComponent, ReactDOMComponent.Mixin); -mixInto(ReactDOMComponent, ReactMultiChild.Mixin); -mixInto(ReactDOMComponent, ReactBrowserComponentMixin); +assign( + ReactDOMComponent.prototype, + ReactComponent.Mixin, + ReactDOMComponent.Mixin, + ReactMultiChild.Mixin, + ReactBrowserComponentMixin +); module.exports = ReactDOMComponent; -},{"./CSSPropertyOperations":5,"./DOMProperty":11,"./DOMPropertyOperations":12,"./ReactBrowserComponentMixin":30,"./ReactBrowserEventEmitter":31,"./ReactComponent":35,"./ReactMount":67,"./ReactMultiChild":68,"./ReactPerf":71,"./escapeTextForBrowser":118,"./invariant":134,"./keyOf":141,"./merge":144,"./mixInto":147}],44:[function(_dereq_,module,exports){ +},{"./CSSPropertyOperations":6,"./DOMProperty":12,"./DOMPropertyOperations":13,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactBrowserEventEmitter":33,"./ReactComponent":37,"./ReactMount":70,"./ReactMultiChild":71,"./ReactPerf":75,"./escapeTextForBrowser":123,"./invariant":140,"./isEventSupported":141,"./keyOf":147,"./monitorCodeUse":150}],46:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMForm */ @@ -8037,10 +8041,11 @@ var EventConstants = _dereq_("./EventConstants"); var LocalEventTrapMixin = _dereq_("./LocalEventTrapMixin"); var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var ReactDOM = _dereq_("./ReactDOM"); -// Store a reference to the <form> `ReactDOMComponent`. -var form = ReactDOM.form; +// Store a reference to the <form> `ReactDOMComponent`. TODO: use string +var form = ReactElement.createFactory(ReactDOM.form.type); /** * Since onSubmit doesn't bubble OR capture on the top level in IE8, we need @@ -8057,7 +8062,7 @@ var ReactDOMForm = ReactCompositeComponent.createClass({ // TODO: Instead of using `ReactDOM` directly, we should use JSX. However, // `jshint` fails to parse JSX so in order for linting to work in the open // source repo, we need to just use `ReactDOM.form`. - return this.transferPropsTo(form(null, this.props.children)); + return form(this.props); }, componentDidMount: function() { @@ -8068,21 +8073,14 @@ var ReactDOMForm = ReactCompositeComponent.createClass({ module.exports = ReactDOMForm; -},{"./EventConstants":16,"./LocalEventTrapMixin":26,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41}],45:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./LocalEventTrapMixin":27,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":58}],47:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMIDOperations * @typechecks static-only @@ -8259,21 +8257,14 @@ var ReactDOMIDOperations = { module.exports = ReactDOMIDOperations; -},{"./CSSPropertyOperations":5,"./DOMChildrenOperations":10,"./DOMPropertyOperations":12,"./ReactMount":67,"./ReactPerf":71,"./invariant":134,"./setInnerHTML":152}],46:[function(_dereq_,module,exports){ +},{"./CSSPropertyOperations":6,"./DOMChildrenOperations":11,"./DOMPropertyOperations":13,"./ReactMount":70,"./ReactPerf":75,"./invariant":140,"./setInnerHTML":154}],48:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMImg */ @@ -8284,10 +8275,11 @@ var EventConstants = _dereq_("./EventConstants"); var LocalEventTrapMixin = _dereq_("./LocalEventTrapMixin"); var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var ReactDOM = _dereq_("./ReactDOM"); -// Store a reference to the <img> `ReactDOMComponent`. -var img = ReactDOM.img; +// Store a reference to the <img> `ReactDOMComponent`. TODO: use string +var img = ReactElement.createFactory(ReactDOM.img.type); /** * Since onLoad doesn't bubble OR capture on the top level in IE8, we need to @@ -8313,21 +8305,14 @@ var ReactDOMImg = ReactCompositeComponent.createClass({ module.exports = ReactDOMImg; -},{"./EventConstants":16,"./LocalEventTrapMixin":26,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41}],47:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./LocalEventTrapMixin":27,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":58}],49:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMInput */ @@ -8339,17 +8324,26 @@ var DOMPropertyOperations = _dereq_("./DOMPropertyOperations"); var LinkedValueUtils = _dereq_("./LinkedValueUtils"); var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var ReactDOM = _dereq_("./ReactDOM"); var ReactMount = _dereq_("./ReactMount"); +var ReactUpdates = _dereq_("./ReactUpdates"); +var assign = _dereq_("./Object.assign"); var invariant = _dereq_("./invariant"); -var merge = _dereq_("./merge"); -// Store a reference to the <input> `ReactDOMComponent`. -var input = ReactDOM.input; +// Store a reference to the <input> `ReactDOMComponent`. TODO: use string +var input = ReactElement.createFactory(ReactDOM.input.type); var instancesByReactID = {}; +function forceUpdateIfMounted() { + /*jshint validthis:true */ + if (this.isMounted()) { + this.forceUpdate(); + } +} + /** * Implements an <input> native component that allows setting these optional * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. @@ -8374,28 +8368,23 @@ var ReactDOMInput = ReactCompositeComponent.createClass({ getInitialState: function() { var defaultValue = this.props.defaultValue; return { - checked: this.props.defaultChecked || false, - value: defaultValue != null ? defaultValue : null + initialChecked: this.props.defaultChecked || false, + initialValue: defaultValue != null ? defaultValue : null }; }, - shouldComponentUpdate: function() { - // Defer any updates to this component during the `onChange` handler. - return !this._isChanging; - }, - render: function() { // Clone `this.props` so we don't mutate the input. - var props = merge(this.props); + var props = assign({}, this.props); props.defaultChecked = null; props.defaultValue = null; var value = LinkedValueUtils.getValue(this); - props.value = value != null ? value : this.state.value; + props.value = value != null ? value : this.state.initialValue; var checked = LinkedValueUtils.getChecked(this); - props.checked = checked != null ? checked : this.state.checked; + props.checked = checked != null ? checked : this.state.initialChecked; props.onChange = this._handleChange; @@ -8435,14 +8424,12 @@ var ReactDOMInput = ReactCompositeComponent.createClass({ var returnValue; var onChange = LinkedValueUtils.getOnChange(this); if (onChange) { - this._isChanging = true; returnValue = onChange.call(this, event); - this._isChanging = false; } - this.setState({ - checked: event.target.checked, - value: event.target.value - }); + // Here we use asap to wait until all updates have propagated, which + // is important when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + ReactUpdates.asap(forceUpdateIfMounted, this); var name = this.props.name; if (this.props.type === 'radio' && name != null) { @@ -8480,13 +8467,10 @@ var ReactDOMInput = ReactCompositeComponent.createClass({ 'ReactDOMInput: Unknown radio button ID %s.', otherID ) : invariant(otherInstance)); - // In some cases, this will actually change the `checked` state value. - // In other cases, there's no change but this forces a reconcile upon - // which componentDidUpdate will reset the DOM property to whatever it - // should be. - otherInstance.setState({ - checked: false - }); + // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + ReactUpdates.asap(forceUpdateIfMounted, otherInstance); } } @@ -8497,21 +8481,14 @@ var ReactDOMInput = ReactCompositeComponent.createClass({ module.exports = ReactDOMInput; -},{"./AutoFocusMixin":1,"./DOMPropertyOperations":12,"./LinkedValueUtils":25,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./ReactMount":67,"./invariant":134,"./merge":144}],48:[function(_dereq_,module,exports){ +},{"./AutoFocusMixin":2,"./DOMPropertyOperations":13,"./LinkedValueUtils":26,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":58,"./ReactMount":70,"./ReactUpdates":91,"./invariant":140}],50:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMOption */ @@ -8520,12 +8497,13 @@ module.exports = ReactDOMInput; var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var ReactDOM = _dereq_("./ReactDOM"); var warning = _dereq_("./warning"); -// Store a reference to the <option> `ReactDOMComponent`. -var option = ReactDOM.option; +// Store a reference to the <option> `ReactDOMComponent`. TODO: use string +var option = ReactElement.createFactory(ReactDOM.option.type); /** * Implements an <option> native component that warns when `selected` is set. @@ -8554,21 +8532,14 @@ var ReactDOMOption = ReactCompositeComponent.createClass({ module.exports = ReactDOMOption; -},{"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./warning":158}],49:[function(_dereq_,module,exports){ +},{"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":58,"./warning":160}],51:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMSelect */ @@ -8579,12 +8550,22 @@ var AutoFocusMixin = _dereq_("./AutoFocusMixin"); var LinkedValueUtils = _dereq_("./LinkedValueUtils"); var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var ReactDOM = _dereq_("./ReactDOM"); +var ReactUpdates = _dereq_("./ReactUpdates"); -var merge = _dereq_("./merge"); +var assign = _dereq_("./Object.assign"); -// Store a reference to the <select> `ReactDOMComponent`. -var select = ReactDOM.select; +// Store a reference to the <select> `ReactDOMComponent`. TODO: use string +var select = ReactElement.createFactory(ReactDOM.select.type); + +function updateWithPendingValueIfMounted() { + /*jshint validthis:true */ + if (this.isMounted()) { + this.setState({value: this._pendingValue}); + this._pendingValue = 0; + } +} /** * Validation function for `value` and `defaultValue`. @@ -8671,6 +8652,10 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({ return {value: this.props.defaultValue || (this.props.multiple ? [] : '')}; }, + componentWillMount: function() { + this._pendingValue = null; + }, + componentWillReceiveProps: function(nextProps) { if (!this.props.multiple && nextProps.multiple) { this.setState({value: [this.state.value]}); @@ -8679,14 +8664,9 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({ } }, - shouldComponentUpdate: function() { - // Defer any updates to this component during the `onChange` handler. - return !this._isChanging; - }, - render: function() { // Clone `this.props` so we don't mutate the input. - var props = merge(this.props); + var props = assign({}, this.props); props.onChange = this._handleChange; props.value = null; @@ -8711,9 +8691,7 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({ var returnValue; var onChange = LinkedValueUtils.getOnChange(this); if (onChange) { - this._isChanging = true; returnValue = onChange.call(this, event); - this._isChanging = false; } var selectedValue; @@ -8729,7 +8707,8 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({ selectedValue = event.target.value; } - this.setState({value: selectedValue}); + this._pendingValue = selectedValue; + ReactUpdates.asap(updateWithPendingValueIfMounted, this); return returnValue; } @@ -8737,21 +8716,14 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({ module.exports = ReactDOMSelect; -},{"./AutoFocusMixin":1,"./LinkedValueUtils":25,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./merge":144}],50:[function(_dereq_,module,exports){ +},{"./AutoFocusMixin":2,"./LinkedValueUtils":26,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":58,"./ReactUpdates":91}],52:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMSelection */ @@ -8810,9 +8782,9 @@ function getIEOffsets(node) { * @return {?object} */ function getModernOffsets(node) { - var selection = window.getSelection(); + var selection = window.getSelection && window.getSelection(); - if (selection.rangeCount === 0) { + if (!selection || selection.rangeCount === 0) { return null; } @@ -8854,7 +8826,6 @@ function getModernOffsets(node) { detectionRange.setStart(anchorNode, anchorOffset); detectionRange.setEnd(focusNode, focusOffset); var isBackward = detectionRange.collapsed; - detectionRange.detach(); return { start: isBackward ? end : start, @@ -8901,8 +8872,11 @@ function setIEOffsets(node, offsets) { * @param {object} offsets */ function setModernOffsets(node, offsets) { - var selection = window.getSelection(); + if (!window.getSelection) { + return; + } + var selection = window.getSelection(); var length = node[getTextContentAccessor()].length; var start = Math.min(offsets.start, length); var end = typeof offsets.end === 'undefined' ? @@ -8931,8 +8905,6 @@ function setModernOffsets(node, offsets) { range.setEnd(endMarker.node, endMarker.offset); selection.addRange(range); } - - range.detach(); } } @@ -8953,21 +8925,14 @@ var ReactDOMSelection = { module.exports = ReactDOMSelection; -},{"./ExecutionEnvironment":22,"./getNodeForCharacterOffset":127,"./getTextContentAccessor":129}],51:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23,"./getNodeForCharacterOffset":133,"./getTextContentAccessor":135}],53:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDOMTextarea */ @@ -8979,15 +8944,24 @@ var DOMPropertyOperations = _dereq_("./DOMPropertyOperations"); var LinkedValueUtils = _dereq_("./LinkedValueUtils"); var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var ReactDOM = _dereq_("./ReactDOM"); +var ReactUpdates = _dereq_("./ReactUpdates"); +var assign = _dereq_("./Object.assign"); var invariant = _dereq_("./invariant"); -var merge = _dereq_("./merge"); var warning = _dereq_("./warning"); -// Store a reference to the <textarea> `ReactDOMComponent`. -var textarea = ReactDOM.textarea; +// Store a reference to the <textarea> `ReactDOMComponent`. TODO: use string +var textarea = ReactElement.createFactory(ReactDOM.textarea.type); + +function forceUpdateIfMounted() { + /*jshint validthis:true */ + if (this.isMounted()) { + this.forceUpdate(); + } +} /** * Implements a <textarea> native component that allows setting `value`, and @@ -9048,14 +9022,9 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({ }; }, - shouldComponentUpdate: function() { - // Defer any updates to this component during the `onChange` handler. - return !this._isChanging; - }, - render: function() { // Clone `this.props` so we don't mutate the input. - var props = merge(this.props); + var props = assign({}, this.props); ("production" !== "development" ? invariant( props.dangerouslySetInnerHTML == null, @@ -9085,11 +9054,9 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({ var returnValue; var onChange = LinkedValueUtils.getOnChange(this); if (onChange) { - this._isChanging = true; returnValue = onChange.call(this, event); - this._isChanging = false; } - this.setState({value: event.target.value}); + ReactUpdates.asap(forceUpdateIfMounted, this); return returnValue; } @@ -9097,21 +9064,14 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({ module.exports = ReactDOMTextarea; -},{"./AutoFocusMixin":1,"./DOMPropertyOperations":12,"./LinkedValueUtils":25,"./ReactBrowserComponentMixin":30,"./ReactCompositeComponent":38,"./ReactDOM":41,"./invariant":134,"./merge":144,"./warning":158}],52:[function(_dereq_,module,exports){ +},{"./AutoFocusMixin":2,"./DOMPropertyOperations":13,"./LinkedValueUtils":26,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":58,"./ReactUpdates":91,"./invariant":140,"./warning":160}],54:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDefaultBatchingStrategy */ @@ -9121,8 +9081,8 @@ module.exports = ReactDOMTextarea; var ReactUpdates = _dereq_("./ReactUpdates"); var Transaction = _dereq_("./Transaction"); +var assign = _dereq_("./Object.assign"); var emptyFunction = _dereq_("./emptyFunction"); -var mixInto = _dereq_("./mixInto"); var RESET_BATCHED_UPDATES = { initialize: emptyFunction, @@ -9142,12 +9102,15 @@ function ReactDefaultBatchingStrategyTransaction() { this.reinitializeTransaction(); } -mixInto(ReactDefaultBatchingStrategyTransaction, Transaction.Mixin); -mixInto(ReactDefaultBatchingStrategyTransaction, { - getTransactionWrappers: function() { - return TRANSACTION_WRAPPERS; +assign( + ReactDefaultBatchingStrategyTransaction.prototype, + Transaction.Mixin, + { + getTransactionWrappers: function() { + return TRANSACTION_WRAPPERS; + } } -}); +); var transaction = new ReactDefaultBatchingStrategyTransaction(); @@ -9174,21 +9137,14 @@ var ReactDefaultBatchingStrategy = { module.exports = ReactDefaultBatchingStrategy; -},{"./ReactUpdates":87,"./Transaction":104,"./emptyFunction":116,"./mixInto":147}],53:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./ReactUpdates":91,"./Transaction":107,"./emptyFunction":121}],55:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDefaultInjection */ @@ -9208,7 +9164,7 @@ var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactComponentBrowserEnvironment = _dereq_("./ReactComponentBrowserEnvironment"); var ReactDefaultBatchingStrategy = _dereq_("./ReactDefaultBatchingStrategy"); -var ReactDOM = _dereq_("./ReactDOM"); +var ReactDOMComponent = _dereq_("./ReactDOMComponent"); var ReactDOMButton = _dereq_("./ReactDOMButton"); var ReactDOMForm = _dereq_("./ReactDOMForm"); var ReactDOMImg = _dereq_("./ReactDOMImg"); @@ -9253,18 +9209,22 @@ function inject() { BeforeInputEventPlugin: BeforeInputEventPlugin }); - ReactInjection.DOM.injectComponentClasses({ - button: ReactDOMButton, - form: ReactDOMForm, - img: ReactDOMImg, - input: ReactDOMInput, - option: ReactDOMOption, - select: ReactDOMSelect, - textarea: ReactDOMTextarea, - - html: createFullPageComponent(ReactDOM.html), - head: createFullPageComponent(ReactDOM.head), - body: createFullPageComponent(ReactDOM.body) + ReactInjection.NativeComponent.injectGenericComponentClass( + ReactDOMComponent + ); + + ReactInjection.NativeComponent.injectComponentClasses({ + 'button': ReactDOMButton, + 'form': ReactDOMForm, + 'img': ReactDOMImg, + 'input': ReactDOMInput, + 'option': ReactDOMOption, + 'select': ReactDOMSelect, + 'textarea': ReactDOMTextarea, + + 'html': createFullPageComponent('html'), + 'head': createFullPageComponent('head'), + 'body': createFullPageComponent('body') }); // This needs to happen after createFullPageComponent() otherwise the mixin @@ -9274,7 +9234,7 @@ function inject() { ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig); - ReactInjection.EmptyComponent.injectEmptyComponent(ReactDOM.noscript); + ReactInjection.EmptyComponent.injectEmptyComponent('noscript'); ReactInjection.Updates.injectReconcileTransaction( ReactComponentBrowserEnvironment.ReactReconcileTransaction @@ -9304,21 +9264,14 @@ module.exports = { inject: inject }; -},{"./BeforeInputEventPlugin":2,"./ChangeEventPlugin":7,"./ClientReactRootIndex":8,"./CompositionEventPlugin":9,"./DefaultEventPluginOrder":14,"./EnterLeaveEventPlugin":15,"./ExecutionEnvironment":22,"./HTMLDOMPropertyConfig":23,"./MobileSafariClickEventPlugin":27,"./ReactBrowserComponentMixin":30,"./ReactComponentBrowserEnvironment":36,"./ReactDOM":41,"./ReactDOMButton":42,"./ReactDOMForm":44,"./ReactDOMImg":46,"./ReactDOMInput":47,"./ReactDOMOption":48,"./ReactDOMSelect":49,"./ReactDOMTextarea":51,"./ReactDefaultBatchingStrategy":52,"./ReactDefaultPerf":54,"./ReactEventListener":61,"./ReactInjection":62,"./ReactInstanceHandles":64,"./ReactMount":67,"./SVGDOMPropertyConfig":89,"./SelectEventPlugin":90,"./ServerReactRootIndex":91,"./SimpleEventPlugin":92,"./createFullPageComponent":112}],54:[function(_dereq_,module,exports){ +},{"./BeforeInputEventPlugin":3,"./ChangeEventPlugin":8,"./ClientReactRootIndex":9,"./CompositionEventPlugin":10,"./DefaultEventPluginOrder":15,"./EnterLeaveEventPlugin":16,"./ExecutionEnvironment":23,"./HTMLDOMPropertyConfig":24,"./MobileSafariClickEventPlugin":28,"./ReactBrowserComponentMixin":32,"./ReactComponentBrowserEnvironment":38,"./ReactDOMButton":44,"./ReactDOMComponent":45,"./ReactDOMForm":46,"./ReactDOMImg":48,"./ReactDOMInput":49,"./ReactDOMOption":50,"./ReactDOMSelect":51,"./ReactDOMTextarea":53,"./ReactDefaultBatchingStrategy":54,"./ReactDefaultPerf":56,"./ReactEventListener":63,"./ReactInjection":64,"./ReactInstanceHandles":66,"./ReactMount":70,"./SVGDOMPropertyConfig":92,"./SelectEventPlugin":93,"./ServerReactRootIndex":94,"./SimpleEventPlugin":95,"./createFullPageComponent":116}],56:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDefaultPerf * @typechecks static-only @@ -9397,19 +9350,23 @@ var ReactDefaultPerf = { ); }, - printWasted: function(measurements) { - measurements = measurements || ReactDefaultPerf._allMeasurements; + getMeasurementsSummaryMap: function(measurements) { var summary = ReactDefaultPerfAnalysis.getInclusiveSummary( measurements, true ); - console.table(summary.map(function(item) { + return summary.map(function(item) { return { 'Owner > component': item.componentName, 'Wasted time (ms)': item.time, 'Instances': item.count }; - })); + }); + }, + + printWasted: function(measurements) { + measurements = measurements || ReactDefaultPerf._allMeasurements; + console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements)); console.log( 'Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms' @@ -9447,7 +9404,7 @@ var ReactDefaultPerf = { }, measure: function(moduleName, fnName, func) { - return function() {var args=Array.prototype.slice.call(arguments,0); + return function() {for (var args=[],$__0=0,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); var totalTime; var rv; var start; @@ -9567,26 +9524,19 @@ var ReactDefaultPerf = { module.exports = ReactDefaultPerf; -},{"./DOMProperty":11,"./ReactDefaultPerfAnalysis":55,"./ReactMount":67,"./ReactPerf":71,"./performanceNow":151}],55:[function(_dereq_,module,exports){ +},{"./DOMProperty":12,"./ReactDefaultPerfAnalysis":57,"./ReactMount":70,"./ReactPerf":75,"./performanceNow":153}],57:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactDefaultPerfAnalysis */ -var merge = _dereq_("./merge"); +var assign = _dereq_("./Object.assign"); // Don't try to save users less than 1.2ms (a number I made up) var DONT_CARE_THRESHOLD = 1.2; @@ -9641,7 +9591,11 @@ function getExclusiveSummary(measurements) { for (var i = 0; i < measurements.length; i++) { var measurement = measurements[i]; - var allIDs = merge(measurement.exclusive, measurement.inclusive); + var allIDs = assign( + {}, + measurement.exclusive, + measurement.inclusive + ); for (var id in allIDs) { displayName = measurement.displayNames[id].current; @@ -9689,7 +9643,11 @@ function getInclusiveSummary(measurements, onlyClean) { for (var i = 0; i < measurements.length; i++) { var measurement = measurements[i]; - var allIDs = merge(measurement.exclusive, measurement.inclusive); + var allIDs = assign( + {}, + measurement.exclusive, + measurement.inclusive + ); var cleanComponents; if (onlyClean) { @@ -9744,11 +9702,11 @@ function getUnchangedComponents(measurement) { // the amount of time it took to render the entire subtree. var cleanComponents = {}; var dirtyLeafIDs = Object.keys(measurement.writes); - var allIDs = merge(measurement.exclusive, measurement.inclusive); + var allIDs = assign({}, measurement.exclusive, measurement.inclusive); for (var id in allIDs) { var isDirty = false; - // For each component that rendered, see if a component that triggerd + // For each component that rendered, see if a component that triggered // a DOM op is in its subtree. for (var i = 0; i < dirtyLeafIDs.length; i++) { if (dirtyLeafIDs[i].indexOf(id) === 0) { @@ -9772,23 +9730,16 @@ var ReactDefaultPerfAnalysis = { module.exports = ReactDefaultPerfAnalysis; -},{"./merge":144}],56:[function(_dereq_,module,exports){ +},{"./Object.assign":29}],58:[function(_dereq_,module,exports){ /** - * Copyright 2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactDescriptor + * @providesModule ReactElement */ "use strict"; @@ -9796,9 +9747,13 @@ module.exports = ReactDefaultPerfAnalysis; var ReactContext = _dereq_("./ReactContext"); var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); -var merge = _dereq_("./merge"); var warning = _dereq_("./warning"); +var RESERVED_PROPS = { + key: true, + ref: true +}; + /** * Warn for mutations. * @@ -9840,7 +9795,7 @@ var useMutationMembrane = false; * Warn for mutations. * * @internal - * @param {object} descriptor + * @param {object} element */ function defineMutationMembrane(prototype) { try { @@ -9857,161 +9812,145 @@ function defineMutationMembrane(prototype) { } /** - * Transfer static properties from the source to the target. Functions are - * rebound to have this reflect the original source. - */ -function proxyStaticMethods(target, source) { - if (typeof source !== 'function') { - return; - } - for (var key in source) { - if (source.hasOwnProperty(key)) { - var value = source[key]; - if (typeof value === 'function') { - var bound = value.bind(source); - // Copy any properties defined on the function, such as `isRequired` on - // a PropTypes validator. (mergeInto refuses to work on functions.) - for (var k in value) { - if (value.hasOwnProperty(k)) { - bound[k] = value[k]; - } - } - target[key] = bound; - } else { - target[key] = value; - } - } - } -} - -/** - * Base constructor for all React descriptors. This is only used to make this + * Base constructor for all React elements. This is only used to make this * work with a dynamic instanceof check. Nothing should live on this prototype. * * @param {*} type + * @param {string|object} ref + * @param {*} key + * @param {*} props * @internal */ -var ReactDescriptor = function() {}; +var ReactElement = function(type, key, ref, owner, context, props) { + // Built-in properties that belong on the element + this.type = type; + this.key = key; + this.ref = ref; -if ("production" !== "development") { - defineMutationMembrane(ReactDescriptor.prototype); -} - -ReactDescriptor.createFactory = function(type) { - - var descriptorPrototype = Object.create(ReactDescriptor.prototype); - - var factory = function(props, children) { - // For consistency we currently allocate a new object for every descriptor. - // This protects the descriptor from being mutated by the original props - // object being mutated. It also protects the original props object from - // being mutated by children arguments and default props. This behavior - // comes with a performance cost and could be deprecated in the future. - // It could also be optimized with a smarter JSX transform. - if (props == null) { - props = {}; - } else if (typeof props === 'object') { - props = merge(props); - } - - // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - var childrenLength = arguments.length - 1; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 1]; - } - props.children = childArray; + // Record the component responsible for creating this element. + this._owner = owner; + + // TODO: Deprecate withContext, and then the context becomes accessible + // through the owner. + this._context = context; + + if ("production" !== "development") { + // The validation flag and props are currently mutative. We put them on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + this._store = { validated: false, props: props }; + + // We're not allowed to set props directly on the object so we early + // return and rely on the prototype membrane to forward to the backing + // store. + if (useMutationMembrane) { + Object.freeze(this); + return; } + } + + this.props = props; +}; + +// We intentionally don't expose the function on the constructor property. +// ReactElement should be indistinguishable from a plain object. +ReactElement.prototype = { + _isReactElement: true +}; - // Initialize the descriptor object - var descriptor = Object.create(descriptorPrototype); +if ("production" !== "development") { + defineMutationMembrane(ReactElement.prototype); +} + +ReactElement.createElement = function(type, config, children) { + var propName; - // Record the component responsible for creating this descriptor. - descriptor._owner = ReactCurrentOwner.current; + // Reserved names are extracted + var props = {}; - // TODO: Deprecate withContext, and then the context becomes accessible - // through the owner. - descriptor._context = ReactContext.current; + var key = null; + var ref = null; + if (config != null) { + ref = config.ref === undefined ? null : config.ref; if ("production" !== "development") { - // The validation flag and props are currently mutative. We put them on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - descriptor._store = { validated: false, props: props }; - - // We're not allowed to set props directly on the object so we early - // return and rely on the prototype membrane to forward to the backing - // store. - if (useMutationMembrane) { - Object.freeze(descriptor); - return descriptor; + ("production" !== "development" ? warning( + config.key !== null, + 'createElement(...): Encountered component with a `key` of null. In ' + + 'a future version, this will be treated as equivalent to the string ' + + '\'null\'; instead, provide an explicit key or use undefined.' + ) : null); + } + // TODO: Change this back to `config.key === undefined` + key = config.key == null ? null : '' + config.key; + // Remaining properties are added to a new props object + for (propName in config) { + if (config.hasOwnProperty(propName) && + !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; } } + } - descriptor.props = props; - return descriptor; - }; + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + + // Resolve default props + if (type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (typeof props[propName] === 'undefined') { + props[propName] = defaultProps[propName]; + } + } + } - // Currently we expose the prototype of the descriptor so that - // <Foo /> instanceof Foo works. This is controversial pattern. - factory.prototype = descriptorPrototype; + return new ReactElement( + type, + key, + ref, + ReactCurrentOwner.current, + ReactContext.current, + props + ); +}; +ReactElement.createFactory = function(type) { + var factory = ReactElement.createElement.bind(null, type); // Expose the type on the factory and the prototype so that it can be - // easily accessed on descriptors. E.g. <Foo />.type === Foo.type and for - // static methods like <Foo />.type.staticMethod(); - // This should not be named constructor since this may not be the function - // that created the descriptor, and it may not even be a constructor. + // easily accessed on elements. E.g. <Foo />.type === Foo.type. + // This should not be named `constructor` since this may not be the function + // that created the element, and it may not even be a constructor. factory.type = type; - descriptorPrototype.type = type; - - proxyStaticMethods(factory, type); - - // Expose a unique constructor on the prototype is that this works with type - // systems that compare constructor properties: <Foo />.constructor === Foo - // This may be controversial since it requires a known factory function. - descriptorPrototype.constructor = factory; - return factory; - }; -ReactDescriptor.cloneAndReplaceProps = function(oldDescriptor, newProps) { - var newDescriptor = Object.create(oldDescriptor.constructor.prototype); - // It's important that this property order matches the hidden class of the - // original descriptor to maintain perf. - newDescriptor._owner = oldDescriptor._owner; - newDescriptor._context = oldDescriptor._context; +ReactElement.cloneAndReplaceProps = function(oldElement, newProps) { + var newElement = new ReactElement( + oldElement.type, + oldElement.key, + oldElement.ref, + oldElement._owner, + oldElement._context, + newProps + ); if ("production" !== "development") { - newDescriptor._store = { - validated: oldDescriptor._store.validated, - props: newProps - }; - if (useMutationMembrane) { - Object.freeze(newDescriptor); - return newDescriptor; - } + // If the key on the original is valid, then the clone is valid + newElement._store.validated = oldElement._store.validated; } - - newDescriptor.props = newProps; - return newDescriptor; -}; - -/** - * Checks if a value is a valid descriptor constructor. - * - * @param {*} - * @return {boolean} - * @public - */ -ReactDescriptor.isValidFactory = function(factory) { - return typeof factory === 'function' && - factory.prototype instanceof ReactDescriptor; + return newElement; }; /** @@ -10019,41 +9958,44 @@ ReactDescriptor.isValidFactory = function(factory) { * @return {boolean} True if `object` is a valid component. * @final */ -ReactDescriptor.isValidDescriptor = function(object) { - return object instanceof ReactDescriptor; +ReactElement.isValidElement = function(object) { + // ReactTestUtils is often used outside of beforeEach where as React is + // within it. This leads to two different instances of React on the same + // page. To identify a element from a different React instance we use + // a flag instead of an instanceof check. + var isElement = !!(object && object._isReactElement); + // if (isElement && !(object instanceof ReactElement)) { + // This is an indicator that you're using multiple versions of React at the + // same time. This will screw with ownership and stuff. Fix it, please. + // TODO: We could possibly warn here. + // } + return isElement; }; -module.exports = ReactDescriptor; +module.exports = ReactElement; -},{"./ReactContext":39,"./ReactCurrentOwner":40,"./merge":144,"./warning":158}],57:[function(_dereq_,module,exports){ +},{"./ReactContext":41,"./ReactCurrentOwner":42,"./warning":160}],59:[function(_dereq_,module,exports){ /** - * Copyright 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 + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactDescriptorValidator + * @providesModule ReactElementValidator */ /** - * ReactDescriptorValidator provides a wrapper around a descriptor factory - * which validates the props passed to the descriptor. This is intended to be + * ReactElementValidator provides a wrapper around a element factory + * which validates the props passed to the element. This is intended to be * used only in DEV and could be replaced by a static type checker for languages * that support it. */ "use strict"; -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); var ReactPropTypeLocations = _dereq_("./ReactPropTypeLocations"); var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); @@ -10096,7 +10038,7 @@ function getCurrentOwnerDisplayName() { * @param {*} parentType component's parent's type. */ function validateExplicitKey(component, parentType) { - if (component._store.validated || component.props.key != null) { + if (component._store.validated || component.key != null) { return; } component._store.validated = true; @@ -10202,11 +10144,11 @@ function validateChildKeys(component, parentType) { if (Array.isArray(component)) { for (var i = 0; i < component.length; i++) { var child = component[i]; - if (ReactDescriptor.isValidDescriptor(child)) { + if (ReactElement.isValidElement(child)) { validateExplicitKey(child, parentType); } } - } else if (ReactDescriptor.isValidDescriptor(component)) { + } else if (ReactElement.isValidElement(component)) { // This component was passed in a valid location. component._store.validated = true; } else if (component && typeof component === 'object') { @@ -10252,85 +10194,70 @@ function checkPropTypes(componentName, propTypes, props, location) { } } -var ReactDescriptorValidator = { +var ReactElementValidator = { - /** - * Wraps a descriptor factory function in another function which validates - * the props and context of the descriptor and warns about any failed type - * checks. - * - * @param {function} factory The original descriptor factory - * @param {object?} propTypes A prop type definition set - * @param {object?} contextTypes A context type definition set - * @return {object} The component descriptor, which may be invalid. - * @private - */ - createFactory: function(factory, propTypes, contextTypes) { - var validatedFactory = function(props, children) { - var descriptor = factory.apply(this, arguments); + createElement: function(type, props, children) { + var element = ReactElement.createElement.apply(this, arguments); - for (var i = 1; i < arguments.length; i++) { - validateChildKeys(arguments[i], descriptor.type); - } - - var name = descriptor.type.displayName; - if (propTypes) { - checkPropTypes( - name, - propTypes, - descriptor.props, - ReactPropTypeLocations.prop - ); - } - if (contextTypes) { - checkPropTypes( - name, - contextTypes, - descriptor._context, - ReactPropTypeLocations.context - ); - } - return descriptor; - }; + // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + if (element == null) { + return element; + } - validatedFactory.prototype = factory.prototype; - validatedFactory.type = factory.type; + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } - // Copy static properties - for (var key in factory) { - if (factory.hasOwnProperty(key)) { - validatedFactory[key] = factory[key]; - } + var name = type.displayName; + if (type.propTypes) { + checkPropTypes( + name, + type.propTypes, + element.props, + ReactPropTypeLocations.prop + ); } + if (type.contextTypes) { + checkPropTypes( + name, + type.contextTypes, + element._context, + ReactPropTypeLocations.context + ); + } + return element; + }, + createFactory: function(type) { + var validatedFactory = ReactElementValidator.createElement.bind( + null, + type + ); + validatedFactory.type = type; return validatedFactory; } }; -module.exports = ReactDescriptorValidator; +module.exports = ReactElementValidator; -},{"./ReactCurrentOwner":40,"./ReactDescriptor":56,"./ReactPropTypeLocations":74,"./monitorCodeUse":148}],58:[function(_dereq_,module,exports){ +},{"./ReactCurrentOwner":42,"./ReactElement":58,"./ReactPropTypeLocations":78,"./monitorCodeUse":150}],60:[function(_dereq_,module,exports){ /** - * Copyright 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 + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactEmptyComponent */ "use strict"; +var ReactElement = _dereq_("./ReactElement"); + var invariant = _dereq_("./invariant"); var component; @@ -10340,7 +10267,7 @@ var nullComponentIdsRegistry = {}; var ReactEmptyComponentInjection = { injectEmptyComponent: function(emptyComponent) { - component = emptyComponent; + component = ReactElement.createFactory(emptyComponent); } }; @@ -10390,21 +10317,14 @@ var ReactEmptyComponent = { module.exports = ReactEmptyComponent; -},{"./invariant":134}],59:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./invariant":140}],61:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactErrorUtils * @typechecks @@ -10429,21 +10349,14 @@ var ReactErrorUtils = { module.exports = ReactErrorUtils; -},{}],60:[function(_dereq_,module,exports){ +},{}],62:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactEventEmitterMixin */ @@ -10486,21 +10399,14 @@ var ReactEventEmitterMixin = { module.exports = ReactEventEmitterMixin; -},{"./EventPluginHub":18}],61:[function(_dereq_,module,exports){ +},{"./EventPluginHub":19}],63:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactEventListener * @typechecks static-only @@ -10515,9 +10421,9 @@ var ReactInstanceHandles = _dereq_("./ReactInstanceHandles"); var ReactMount = _dereq_("./ReactMount"); var ReactUpdates = _dereq_("./ReactUpdates"); +var assign = _dereq_("./Object.assign"); var getEventTarget = _dereq_("./getEventTarget"); var getUnboundedScrollPosition = _dereq_("./getUnboundedScrollPosition"); -var mixInto = _dereq_("./mixInto"); /** * Finds the parent React component of `node`. @@ -10543,7 +10449,7 @@ function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) { this.nativeEvent = nativeEvent; this.ancestors = []; } -mixInto(TopLevelCallbackBookKeeping, { +assign(TopLevelCallbackBookKeeping.prototype, { destructor: function() { this.topLevelType = null; this.nativeEvent = null; @@ -10677,21 +10583,14 @@ var ReactEventListener = { module.exports = ReactEventListener; -},{"./EventListener":17,"./ExecutionEnvironment":22,"./PooledClass":28,"./ReactInstanceHandles":64,"./ReactMount":67,"./ReactUpdates":87,"./getEventTarget":125,"./getUnboundedScrollPosition":130,"./mixInto":147}],62:[function(_dereq_,module,exports){ +},{"./EventListener":18,"./ExecutionEnvironment":23,"./Object.assign":29,"./PooledClass":30,"./ReactInstanceHandles":66,"./ReactMount":70,"./ReactUpdates":91,"./getEventTarget":131,"./getUnboundedScrollPosition":136}],64:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactInjection */ @@ -10702,9 +10601,9 @@ var DOMProperty = _dereq_("./DOMProperty"); var EventPluginHub = _dereq_("./EventPluginHub"); var ReactComponent = _dereq_("./ReactComponent"); var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); -var ReactDOM = _dereq_("./ReactDOM"); var ReactEmptyComponent = _dereq_("./ReactEmptyComponent"); var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter"); +var ReactNativeComponent = _dereq_("./ReactNativeComponent"); var ReactPerf = _dereq_("./ReactPerf"); var ReactRootIndex = _dereq_("./ReactRootIndex"); var ReactUpdates = _dereq_("./ReactUpdates"); @@ -10715,8 +10614,8 @@ var ReactInjection = { DOMProperty: DOMProperty.injection, EmptyComponent: ReactEmptyComponent.injection, EventPluginHub: EventPluginHub.injection, - DOM: ReactDOM.injection, EventEmitter: ReactBrowserEventEmitter.injection, + NativeComponent: ReactNativeComponent.injection, Perf: ReactPerf.injection, RootIndex: ReactRootIndex.injection, Updates: ReactUpdates.injection @@ -10724,21 +10623,14 @@ var ReactInjection = { module.exports = ReactInjection; -},{"./DOMProperty":11,"./EventPluginHub":18,"./ReactBrowserEventEmitter":31,"./ReactComponent":35,"./ReactCompositeComponent":38,"./ReactDOM":41,"./ReactEmptyComponent":58,"./ReactPerf":71,"./ReactRootIndex":78,"./ReactUpdates":87}],63:[function(_dereq_,module,exports){ +},{"./DOMProperty":12,"./EventPluginHub":19,"./ReactBrowserEventEmitter":33,"./ReactComponent":37,"./ReactCompositeComponent":40,"./ReactEmptyComponent":60,"./ReactNativeComponent":73,"./ReactPerf":75,"./ReactRootIndex":82,"./ReactUpdates":91}],65:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactInputSelection */ @@ -10867,21 +10759,14 @@ var ReactInputSelection = { module.exports = ReactInputSelection; -},{"./ReactDOMSelection":50,"./containsNode":109,"./focusNode":120,"./getActiveElement":122}],64:[function(_dereq_,module,exports){ +},{"./ReactDOMSelection":52,"./containsNode":114,"./focusNode":125,"./getActiveElement":127}],66:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactInstanceHandles * @typechecks static-only @@ -11207,21 +11092,259 @@ var ReactInstanceHandles = { module.exports = ReactInstanceHandles; -},{"./ReactRootIndex":78,"./invariant":134}],65:[function(_dereq_,module,exports){ +},{"./ReactRootIndex":82,"./invariant":140}],67:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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 + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * http://www.apache.org/licenses/LICENSE-2.0 + * @providesModule ReactLegacyElement + */ + +"use strict"; + +var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); + +var invariant = _dereq_("./invariant"); +var monitorCodeUse = _dereq_("./monitorCodeUse"); +var warning = _dereq_("./warning"); + +var legacyFactoryLogs = {}; +function warnForLegacyFactoryCall() { + if (!ReactLegacyElementFactory._isLegacyCallWarningEnabled) { + return; + } + var owner = ReactCurrentOwner.current; + var name = owner && owner.constructor ? owner.constructor.displayName : ''; + if (!name) { + name = 'Something'; + } + if (legacyFactoryLogs.hasOwnProperty(name)) { + return; + } + legacyFactoryLogs[name] = true; + ("production" !== "development" ? warning( + false, + name + ' is calling a React component directly. ' + + 'Use a factory or JSX instead. See: http://fb.me/react-legacyfactory' + ) : null); + monitorCodeUse('react_legacy_factory_call', { version: 3, name: name }); +} + +function warnForPlainFunctionType(type) { + var isReactClass = + type.prototype && + typeof type.prototype.mountComponent === 'function' && + typeof type.prototype.receiveComponent === 'function'; + if (isReactClass) { + ("production" !== "development" ? warning( + false, + 'Did not expect to get a React class here. Use `Component` instead ' + + 'of `Component.type` or `this.constructor`.' + ) : null); + } else { + if (!type._reactWarnedForThisType) { + try { + type._reactWarnedForThisType = true; + } catch (x) { + // just incase this is a frozen object or some special object + } + monitorCodeUse( + 'react_non_component_in_jsx', + { version: 3, name: type.name } + ); + } + ("production" !== "development" ? warning( + false, + 'This JSX uses a plain function. Only React components are ' + + 'valid in React\'s JSX transform.' + ) : null); + } +} + +function warnForNonLegacyFactory(type) { + ("production" !== "development" ? warning( + false, + 'Do not pass React.DOM.' + type.type + ' to JSX or createFactory. ' + + 'Use the string "' + type.type + '" instead.' + ) : null); +} + +/** + * Transfer static properties from the source to the target. Functions are + * rebound to have this reflect the original source. + */ +function proxyStaticMethods(target, source) { + if (typeof source !== 'function') { + return; + } + for (var key in source) { + if (source.hasOwnProperty(key)) { + var value = source[key]; + if (typeof value === 'function') { + var bound = value.bind(source); + // Copy any properties defined on the function, such as `isRequired` on + // a PropTypes validator. + for (var k in value) { + if (value.hasOwnProperty(k)) { + bound[k] = value[k]; + } + } + target[key] = bound; + } else { + target[key] = value; + } + } + } +} + +// We use an object instead of a boolean because booleans are ignored by our +// mocking libraries when these factories gets mocked. +var LEGACY_MARKER = {}; +var NON_LEGACY_MARKER = {}; + +var ReactLegacyElementFactory = {}; + +ReactLegacyElementFactory.wrapCreateFactory = function(createFactory) { + var legacyCreateFactory = function(type) { + if (typeof type !== 'function') { + // Non-function types cannot be legacy factories + return createFactory(type); + } + + if (type.isReactNonLegacyFactory) { + // This is probably a factory created by ReactDOM we unwrap it to get to + // the underlying string type. It shouldn't have been passed here so we + // warn. + if ("production" !== "development") { + warnForNonLegacyFactory(type); + } + return createFactory(type.type); + } + + if (type.isReactLegacyFactory) { + // This is probably a legacy factory created by ReactCompositeComponent. + // We unwrap it to get to the underlying class. + return createFactory(type.type); + } + + if ("production" !== "development") { + warnForPlainFunctionType(type); + } + + // Unless it's a legacy factory, then this is probably a plain function, + // that is expecting to be invoked by JSX. We can just return it as is. + return type; + }; + return legacyCreateFactory; +}; + +ReactLegacyElementFactory.wrapCreateElement = function(createElement) { + var legacyCreateElement = function(type, props, children) { + if (typeof type !== 'function') { + // Non-function types cannot be legacy factories + return createElement.apply(this, arguments); + } + + var args; + + if (type.isReactNonLegacyFactory) { + // This is probably a factory created by ReactDOM we unwrap it to get to + // the underlying string type. It shouldn't have been passed here so we + // warn. + if ("production" !== "development") { + warnForNonLegacyFactory(type); + } + args = Array.prototype.slice.call(arguments, 0); + args[0] = type.type; + return createElement.apply(this, args); + } + + if (type.isReactLegacyFactory) { + // This is probably a legacy factory created by ReactCompositeComponent. + // We unwrap it to get to the underlying class. + if (type._isMockFunction) { + // If this is a mock function, people will expect it to be called. We + // will actually call the original mock factory function instead. This + // future proofs unit testing that assume that these are classes. + type.type._mockedReactClassConstructor = type; + } + args = Array.prototype.slice.call(arguments, 0); + args[0] = type.type; + return createElement.apply(this, args); + } + + if ("production" !== "development") { + warnForPlainFunctionType(type); + } + + // This is being called with a plain function we should invoke it + // immediately as if this was used with legacy JSX. + return type.apply(null, Array.prototype.slice.call(arguments, 1)); + }; + return legacyCreateElement; +}; + +ReactLegacyElementFactory.wrapFactory = function(factory) { + ("production" !== "development" ? invariant( + typeof factory === 'function', + 'This is suppose to accept a element factory' + ) : invariant(typeof factory === 'function')); + var legacyElementFactory = function(config, children) { + // This factory should not be called when JSX is used. Use JSX instead. + if ("production" !== "development") { + warnForLegacyFactoryCall(); + } + return factory.apply(this, arguments); + }; + proxyStaticMethods(legacyElementFactory, factory.type); + legacyElementFactory.isReactLegacyFactory = LEGACY_MARKER; + legacyElementFactory.type = factory.type; + return legacyElementFactory; +}; + +// This is used to mark a factory that will remain. E.g. we're allowed to call +// it as a function. However, you're not suppose to pass it to createElement +// or createFactory, so it will warn you if you do. +ReactLegacyElementFactory.markNonLegacyFactory = function(factory) { + factory.isReactNonLegacyFactory = NON_LEGACY_MARKER; + return factory; +}; + +// Checks if a factory function is actually a legacy factory pretending to +// be a class. +ReactLegacyElementFactory.isValidFactory = function(factory) { + // TODO: This will be removed and moved into a class validator or something. + return typeof factory === 'function' && + factory.isReactLegacyFactory === LEGACY_MARKER; +}; + +ReactLegacyElementFactory.isValidClass = function(factory) { + if ("production" !== "development") { + ("production" !== "development" ? warning( + false, + 'isValidClass is deprecated and will be removed in a future release. ' + + 'Use a more specific validator instead.' + ) : null); + } + return ReactLegacyElementFactory.isValidFactory(factory); +}; + +ReactLegacyElementFactory._isLegacyCallWarningEnabled = true; + +module.exports = ReactLegacyElementFactory; + +},{"./ReactCurrentOwner":42,"./invariant":140,"./monitorCodeUse":150,"./warning":160}],68:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactLink * @typechecks static-only @@ -11287,21 +11410,14 @@ ReactLink.PropTypes = { module.exports = ReactLink; -},{"./React":29}],66:[function(_dereq_,module,exports){ +},{"./React":31}],69:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactMarkupChecksum */ @@ -11342,21 +11458,14 @@ var ReactMarkupChecksum = { module.exports = ReactMarkupChecksum; -},{"./adler32":107}],67:[function(_dereq_,module,exports){ +},{"./adler32":110}],70:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactMount */ @@ -11366,17 +11475,23 @@ module.exports = ReactMarkupChecksum; var DOMProperty = _dereq_("./DOMProperty"); var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter"); var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); +var ReactLegacyElement = _dereq_("./ReactLegacyElement"); var ReactInstanceHandles = _dereq_("./ReactInstanceHandles"); var ReactPerf = _dereq_("./ReactPerf"); var containsNode = _dereq_("./containsNode"); +var deprecated = _dereq_("./deprecated"); var getReactRootElementInContainer = _dereq_("./getReactRootElementInContainer"); var instantiateReactComponent = _dereq_("./instantiateReactComponent"); var invariant = _dereq_("./invariant"); var shouldUpdateReactComponent = _dereq_("./shouldUpdateReactComponent"); var warning = _dereq_("./warning"); +var createElement = ReactLegacyElement.wrapCreateElement( + ReactElement.createElement +); + var SEPARATOR = ReactInstanceHandles.SEPARATOR; var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; @@ -11544,7 +11659,7 @@ function findDeepestCachedAncestor(targetID) { * representative DOM elements and inserting them into a supplied `container`. * Any prior content inside `container` is destroyed in the process. * - * ReactMount.renderComponent( + * ReactMount.render( * component, * document.getElementById('container') * ); @@ -11650,7 +11765,7 @@ var ReactMount = { 'componentDidUpdate.' ) : null); - var componentInstance = instantiateReactComponent(nextComponent); + var componentInstance = instantiateReactComponent(nextComponent, null); var reactRootID = ReactMount._registerComponent( componentInstance, container @@ -11678,35 +11793,38 @@ var ReactMount = { * perform an update on it and only mutate the DOM as necessary to reflect the * latest React component. * - * @param {ReactDescriptor} nextDescriptor Component descriptor to render. + * @param {ReactElement} nextElement Component element to render. * @param {DOMElement} container DOM element to render into. * @param {?function} callback function triggered on completion * @return {ReactComponent} Component instance rendered in `container`. */ - renderComponent: function(nextDescriptor, container, callback) { + render: function(nextElement, container, callback) { ("production" !== "development" ? invariant( - ReactDescriptor.isValidDescriptor(nextDescriptor), - 'renderComponent(): Invalid component descriptor.%s', + ReactElement.isValidElement(nextElement), + 'renderComponent(): Invalid component element.%s', ( - ReactDescriptor.isValidFactory(nextDescriptor) ? + typeof nextElement === 'string' ? + ' Instead of passing an element string, make sure to instantiate ' + + 'it by passing it to React.createElement.' : + ReactLegacyElement.isValidFactory(nextElement) ? ' Instead of passing a component class, make sure to instantiate ' + - 'it first by calling it with props.' : - // Check if it quacks like a descriptor - typeof nextDescriptor.props !== "undefined" ? + 'it by passing it to React.createElement.' : + // Check if it quacks like a element + typeof nextElement.props !== "undefined" ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '' ) - ) : invariant(ReactDescriptor.isValidDescriptor(nextDescriptor))); + ) : invariant(ReactElement.isValidElement(nextElement))); var prevComponent = instancesByReactRootID[getReactRootID(container)]; if (prevComponent) { - var prevDescriptor = prevComponent._descriptor; - if (shouldUpdateReactComponent(prevDescriptor, nextDescriptor)) { + var prevElement = prevComponent._currentElement; + if (shouldUpdateReactComponent(prevElement, nextElement)) { return ReactMount._updateRootComponent( prevComponent, - nextDescriptor, + nextElement, container, callback ); @@ -11722,7 +11840,7 @@ var ReactMount = { var shouldReuseMarkup = containerHasReactMarkup && !prevComponent; var component = ReactMount._renderNewRootComponent( - nextDescriptor, + nextElement, container, shouldReuseMarkup ); @@ -11740,7 +11858,8 @@ var ReactMount = { * @return {ReactComponent} Component instance rendered in `container`. */ constructAndRenderComponent: function(constructor, props, container) { - return ReactMount.renderComponent(constructor(props), container); + var element = createElement(constructor, props); + return ReactMount.render(element, container); }, /** @@ -11999,9 +12118,10 @@ var ReactMount = { false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + - 'usually due to forgetting a <tbody> when using tables, nesting <p> ' + - 'or <a> tags, or using non-SVG elements in an <svg> parent. Try ' + - 'inspecting the child nodes of the element with React ID `%s`.', + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + + 'parent. ' + + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode) ) : invariant(false)); @@ -12023,23 +12143,25 @@ var ReactMount = { purgeID: purgeID }; +// Deprecations (remove for 0.13) +ReactMount.renderComponent = deprecated( + 'ReactMount', + 'renderComponent', + 'render', + this, + ReactMount.render +); + module.exports = ReactMount; -},{"./DOMProperty":11,"./ReactBrowserEventEmitter":31,"./ReactCurrentOwner":40,"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactPerf":71,"./containsNode":109,"./getReactRootElementInContainer":128,"./instantiateReactComponent":133,"./invariant":134,"./shouldUpdateReactComponent":154,"./warning":158}],68:[function(_dereq_,module,exports){ +},{"./DOMProperty":12,"./ReactBrowserEventEmitter":33,"./ReactCurrentOwner":42,"./ReactElement":58,"./ReactInstanceHandles":66,"./ReactLegacyElement":67,"./ReactPerf":75,"./containsNode":114,"./deprecated":120,"./getReactRootElementInContainer":134,"./instantiateReactComponent":139,"./invariant":140,"./shouldUpdateReactComponent":156,"./warning":160}],71:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactMultiChild * @typechecks static-only @@ -12223,7 +12345,7 @@ var ReactMultiChild = { if (children.hasOwnProperty(name)) { // The rendered children must be turned into instances as they're // mounted. - var childInstance = instantiateReactComponent(child); + var childInstance = instantiateReactComponent(child, null); children[name] = childInstance; // Inlined for performance, see `ReactInstanceHandles.createReactID`. var rootID = this._rootNodeID + name; @@ -12314,12 +12436,12 @@ var ReactMultiChild = { continue; } var prevChild = prevChildren && prevChildren[name]; - var prevDescriptor = prevChild && prevChild._descriptor; - var nextDescriptor = nextChildren[name]; - if (shouldUpdateReactComponent(prevDescriptor, nextDescriptor)) { + var prevElement = prevChild && prevChild._currentElement; + var nextElement = nextChildren[name]; + if (shouldUpdateReactComponent(prevElement, nextElement)) { this.moveChild(prevChild, nextIndex, lastIndex); lastIndex = Math.max(prevChild._mountIndex, lastIndex); - prevChild.receiveComponent(nextDescriptor, transaction); + prevChild.receiveComponent(nextElement, transaction); prevChild._mountIndex = nextIndex; } else { if (prevChild) { @@ -12328,7 +12450,10 @@ var ReactMultiChild = { this._unmountChildByName(prevChild, name); } // The child must be instantiated before it's mounted. - var nextChildInstance = instantiateReactComponent(nextDescriptor); + var nextChildInstance = instantiateReactComponent( + nextElement, + null + ); this._mountChildByNameAtIndex( nextChildInstance, name, nextIndex, transaction ); @@ -12457,21 +12582,14 @@ var ReactMultiChild = { module.exports = ReactMultiChild; -},{"./ReactComponent":35,"./ReactMultiChildUpdateTypes":69,"./flattenChildren":119,"./instantiateReactComponent":133,"./shouldUpdateReactComponent":154}],69:[function(_dereq_,module,exports){ +},{"./ReactComponent":37,"./ReactMultiChildUpdateTypes":72,"./flattenChildren":124,"./instantiateReactComponent":139,"./shouldUpdateReactComponent":156}],72:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactMultiChildUpdateTypes */ @@ -12497,21 +12615,85 @@ var ReactMultiChildUpdateTypes = keyMirror({ module.exports = ReactMultiChildUpdateTypes; -},{"./keyMirror":140}],70:[function(_dereq_,module,exports){ +},{"./keyMirror":146}],73:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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 + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * http://www.apache.org/licenses/LICENSE-2.0 + * @providesModule ReactNativeComponent + */ + +"use strict"; + +var assign = _dereq_("./Object.assign"); +var invariant = _dereq_("./invariant"); + +var genericComponentClass = null; +// This registry keeps track of wrapper classes around native tags +var tagToComponentClass = {}; + +var ReactNativeComponentInjection = { + // This accepts a class that receives the tag string. This is a catch all + // that can render any kind of tag. + injectGenericComponentClass: function(componentClass) { + genericComponentClass = componentClass; + }, + // This accepts a keyed object with classes as values. Each key represents a + // tag. That particular tag will use this class instead of the generic one. + injectComponentClasses: function(componentClasses) { + assign(tagToComponentClass, componentClasses); + } +}; + +/** + * Create an internal class for a specific tag. * - * 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. + * @param {string} tag The tag for which to create an internal instance. + * @param {any} props The props passed to the instance constructor. + * @return {ReactComponent} component The injected empty component. + */ +function createInstanceForTag(tag, props, parentType) { + var componentClass = tagToComponentClass[tag]; + if (componentClass == null) { + ("production" !== "development" ? invariant( + genericComponentClass, + 'There is no registered component for the tag %s', + tag + ) : invariant(genericComponentClass)); + return new genericComponentClass(tag, props); + } + if (parentType === tag) { + // Avoid recursion + ("production" !== "development" ? invariant( + genericComponentClass, + 'There is no registered component for the tag %s', + tag + ) : invariant(genericComponentClass)); + return new genericComponentClass(tag, props); + } + // Unwrap legacy factories + return new componentClass.type(props); +} + +var ReactNativeComponent = { + createInstanceForTag: createInstanceForTag, + injection: ReactNativeComponentInjection +}; + +module.exports = ReactNativeComponent; + +},{"./Object.assign":29,"./invariant":140}],74:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactOwner */ @@ -12658,21 +12840,14 @@ var ReactOwner = { module.exports = ReactOwner; -},{"./emptyObject":117,"./invariant":134}],71:[function(_dereq_,module,exports){ +},{"./emptyObject":122,"./invariant":140}],75:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPerf * @typechecks static-only @@ -12708,7 +12883,7 @@ var ReactPerf = { measure: function(objName, fnName, func) { if ("production" !== "development") { var measuredFunc = null; - return function() { + var wrapper = function() { if (ReactPerf.enableMeasure) { if (!measuredFunc) { measuredFunc = ReactPerf.storedMeasure(objName, fnName, func); @@ -12717,6 +12892,8 @@ var ReactPerf = { } return func.apply(this, arguments); }; + wrapper.displayName = objName + '_' + fnName; + return wrapper; } return func; }, @@ -12745,31 +12922,27 @@ function _noMeasure(objName, fnName, func) { module.exports = ReactPerf; -},{}],72:[function(_dereq_,module,exports){ +},{}],76:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTransferer */ "use strict"; +var assign = _dereq_("./Object.assign"); var emptyFunction = _dereq_("./emptyFunction"); var invariant = _dereq_("./invariant"); var joinClasses = _dereq_("./joinClasses"); -var merge = _dereq_("./merge"); +var warning = _dereq_("./warning"); + +var didWarn = false; /** * Creates a transfer strategy that will merge prop values using the supplied @@ -12792,7 +12965,7 @@ var transferStrategyMerge = createTransferStrategy(function(a, b) { // `merge` overrides the first object's (`props[key]` above) keys using the // second object's (`value`) keys. An object's style's existing `propA` would // get overridden. Flip the order here. - return merge(b, a); + return assign({}, b, a); }); /** @@ -12810,14 +12983,6 @@ var TransferStrategies = { */ className: createTransferStrategy(joinClasses), /** - * Never transfer the `key` prop. - */ - key: emptyFunction, - /** - * Never transfer the `ref` prop. - */ - ref: emptyFunction, - /** * Transfer the `style` prop (which is an object) by merging them. */ style: transferStrategyMerge @@ -12866,7 +13031,7 @@ var ReactPropTransferer = { * @return {object} a new object containing both sets of props merged. */ mergeProps: function(oldProps, newProps) { - return transferInto(merge(oldProps), newProps); + return transferInto(assign({}, oldProps), newProps); }, /** @@ -12882,26 +13047,39 @@ var ReactPropTransferer = { * * This is usually used to pass down props to a returned root component. * - * @param {ReactDescriptor} descriptor Component receiving the properties. - * @return {ReactDescriptor} The supplied `component`. + * @param {ReactElement} element Component receiving the properties. + * @return {ReactElement} The supplied `component`. * @final * @protected */ - transferPropsTo: function(descriptor) { + transferPropsTo: function(element) { ("production" !== "development" ? invariant( - descriptor._owner === this, + element._owner === this, '%s: You can\'t call transferPropsTo() on a component that you ' + 'don\'t own, %s. This usually means you are calling ' + 'transferPropsTo() on a component passed in as props or children.', this.constructor.displayName, - descriptor.type.displayName - ) : invariant(descriptor._owner === this)); + typeof element.type === 'string' ? + element.type : + element.type.displayName + ) : invariant(element._owner === this)); + + if ("production" !== "development") { + if (!didWarn) { + didWarn = true; + ("production" !== "development" ? warning( + false, + 'transferPropsTo is deprecated. ' + + 'See http://fb.me/react-transferpropsto for more information.' + ) : null); + } + } - // Because descriptors are immutable we have to merge into the existing + // Because elements are immutable we have to merge into the existing // props object rather than clone it. - transferInto(descriptor.props, this.props); + transferInto(element.props, this.props); - return descriptor; + return element; } } @@ -12909,21 +13087,14 @@ var ReactPropTransferer = { module.exports = ReactPropTransferer; -},{"./emptyFunction":116,"./invariant":134,"./joinClasses":139,"./merge":144}],73:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./emptyFunction":121,"./invariant":140,"./joinClasses":145,"./warning":160}],77:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypeLocationNames */ @@ -12942,21 +13113,14 @@ if ("production" !== "development") { module.exports = ReactPropTypeLocationNames; -},{}],74:[function(_dereq_,module,exports){ +},{}],78:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypeLocations */ @@ -12973,30 +13137,24 @@ var ReactPropTypeLocations = keyMirror({ module.exports = ReactPropTypeLocations; -},{"./keyMirror":140}],75:[function(_dereq_,module,exports){ +},{"./keyMirror":146}],79:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPropTypes */ "use strict"; -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); var ReactPropTypeLocationNames = _dereq_("./ReactPropTypeLocationNames"); +var deprecated = _dereq_("./deprecated"); var emptyFunction = _dereq_("./emptyFunction"); /** @@ -13048,6 +13206,9 @@ var emptyFunction = _dereq_("./emptyFunction"); var ANONYMOUS = '<<anonymous>>'; +var elementTypeChecker = createElementTypeChecker(); +var nodeTypeChecker = createNodeChecker(); + var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), @@ -13058,13 +13219,28 @@ var ReactPropTypes = { any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, - component: createComponentTypeChecker(), + element: elementTypeChecker, instanceOf: createInstanceTypeChecker, + node: nodeTypeChecker, objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, - renderable: createRenderableTypeChecker(), - shape: createShapeTypeChecker + shape: createShapeTypeChecker, + + component: deprecated( + 'React.PropTypes', + 'component', + 'element', + this, + elementTypeChecker + ), + renderable: deprecated( + 'React.PropTypes', + 'renderable', + 'node', + this, + nodeTypeChecker + ) }; function createChainableTypeChecker(validate) { @@ -13134,13 +13310,13 @@ function createArrayOfTypeChecker(typeChecker) { return createChainableTypeChecker(validate); } -function createComponentTypeChecker() { +function createElementTypeChecker() { function validate(props, propName, componentName, location) { - if (!ReactDescriptor.isValidDescriptor(props[propName])) { + if (!ReactElement.isValidElement(props[propName])) { var locationName = ReactPropTypeLocationNames[location]; return new Error( ("Invalid " + locationName + " `" + propName + "` supplied to ") + - ("`" + componentName + "`, expected a React component.") + ("`" + componentName + "`, expected a ReactElement.") ); } } @@ -13221,13 +13397,13 @@ function createUnionTypeChecker(arrayOfTypeCheckers) { return createChainableTypeChecker(validate); } -function createRenderableTypeChecker() { +function createNodeChecker() { function validate(props, propName, componentName, location) { - if (!isRenderable(props[propName])) { + if (!isNode(props[propName])) { var locationName = ReactPropTypeLocationNames[location]; return new Error( ("Invalid " + locationName + " `" + propName + "` supplied to ") + - ("`" + componentName + "`, expected a renderable prop.") + ("`" + componentName + "`, expected a ReactNode.") ); } } @@ -13259,11 +13435,8 @@ function createShapeTypeChecker(shapeTypes) { return createChainableTypeChecker(validate, 'expected `object`'); } -function isRenderable(propValue) { +function isNode(propValue) { switch(typeof propValue) { - // TODO: this was probably written with the assumption that we're not - // returning `this.props.component` directly from `render`. This is - // currently not supported but we should, to make it consistent. case 'number': case 'string': return true; @@ -13271,13 +13444,13 @@ function isRenderable(propValue) { return !propValue; case 'object': if (Array.isArray(propValue)) { - return propValue.every(isRenderable); + return propValue.every(isNode); } - if (ReactDescriptor.isValidDescriptor(propValue)) { + if (ReactElement.isValidElement(propValue)) { return true; } for (var k in propValue) { - if (!isRenderable(propValue[k])) { + if (!isNode(propValue[k])) { return false; } } @@ -13318,21 +13491,14 @@ function getPreciseType(propValue) { module.exports = ReactPropTypes; -},{"./ReactDescriptor":56,"./ReactPropTypeLocationNames":73,"./emptyFunction":116}],76:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./ReactPropTypeLocationNames":77,"./deprecated":120,"./emptyFunction":121}],80:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactPutListenerQueue */ @@ -13342,13 +13508,13 @@ module.exports = ReactPropTypes; var PooledClass = _dereq_("./PooledClass"); var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter"); -var mixInto = _dereq_("./mixInto"); +var assign = _dereq_("./Object.assign"); function ReactPutListenerQueue() { this.listenersToPut = []; } -mixInto(ReactPutListenerQueue, { +assign(ReactPutListenerQueue.prototype, { enqueuePutListener: function(rootNodeID, propKey, propValue) { this.listenersToPut.push({ rootNodeID: rootNodeID, @@ -13381,21 +13547,14 @@ PooledClass.addPoolingTo(ReactPutListenerQueue); module.exports = ReactPutListenerQueue; -},{"./PooledClass":28,"./ReactBrowserEventEmitter":31,"./mixInto":147}],77:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./PooledClass":30,"./ReactBrowserEventEmitter":33}],81:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactReconcileTransaction * @typechecks static-only @@ -13410,7 +13569,7 @@ var ReactInputSelection = _dereq_("./ReactInputSelection"); var ReactPutListenerQueue = _dereq_("./ReactPutListenerQueue"); var Transaction = _dereq_("./Transaction"); -var mixInto = _dereq_("./mixInto"); +var assign = _dereq_("./Object.assign"); /** * Ensures that, when possible, the selection range (currently selected text @@ -13558,28 +13717,20 @@ var Mixin = { }; -mixInto(ReactReconcileTransaction, Transaction.Mixin); -mixInto(ReactReconcileTransaction, Mixin); +assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin); PooledClass.addPoolingTo(ReactReconcileTransaction); module.exports = ReactReconcileTransaction; -},{"./CallbackQueue":6,"./PooledClass":28,"./ReactBrowserEventEmitter":31,"./ReactInputSelection":63,"./ReactPutListenerQueue":76,"./Transaction":104,"./mixInto":147}],78:[function(_dereq_,module,exports){ +},{"./CallbackQueue":7,"./Object.assign":29,"./PooledClass":30,"./ReactBrowserEventEmitter":33,"./ReactInputSelection":65,"./ReactPutListenerQueue":80,"./Transaction":107}],82:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactRootIndex * @typechecks @@ -13603,28 +13754,21 @@ var ReactRootIndex = { module.exports = ReactRootIndex; -},{}],79:[function(_dereq_,module,exports){ +},{}],83:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks static-only * @providesModule ReactServerRendering */ "use strict"; -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); var ReactInstanceHandles = _dereq_("./ReactInstanceHandles"); var ReactMarkupChecksum = _dereq_("./ReactMarkupChecksum"); var ReactServerRenderingTransaction = @@ -13634,20 +13778,14 @@ var instantiateReactComponent = _dereq_("./instantiateReactComponent"); var invariant = _dereq_("./invariant"); /** - * @param {ReactComponent} component + * @param {ReactElement} element * @return {string} the HTML markup */ -function renderComponentToString(component) { +function renderToString(element) { ("production" !== "development" ? invariant( - ReactDescriptor.isValidDescriptor(component), - 'renderComponentToString(): You must pass a valid ReactComponent.' - ) : invariant(ReactDescriptor.isValidDescriptor(component))); - - ("production" !== "development" ? invariant( - !(arguments.length === 2 && typeof arguments[1] === 'function'), - 'renderComponentToString(): This function became synchronous and now ' + - 'returns the generated markup. Please remove the second parameter.' - ) : invariant(!(arguments.length === 2 && typeof arguments[1] === 'function'))); + ReactElement.isValidElement(element), + 'renderToString(): You must pass a valid ReactElement.' + ) : invariant(ReactElement.isValidElement(element))); var transaction; try { @@ -13655,7 +13793,7 @@ function renderComponentToString(component) { transaction = ReactServerRenderingTransaction.getPooled(false); return transaction.perform(function() { - var componentInstance = instantiateReactComponent(component); + var componentInstance = instantiateReactComponent(element, null); var markup = componentInstance.mountComponent(id, transaction, 0); return ReactMarkupChecksum.addChecksumToMarkup(markup); }, null); @@ -13665,15 +13803,15 @@ function renderComponentToString(component) { } /** - * @param {ReactComponent} component + * @param {ReactElement} element * @return {string} the HTML markup, without the extra React ID and checksum -* (for generating static pages) + * (for generating static pages) */ -function renderComponentToStaticMarkup(component) { +function renderToStaticMarkup(element) { ("production" !== "development" ? invariant( - ReactDescriptor.isValidDescriptor(component), - 'renderComponentToStaticMarkup(): You must pass a valid ReactComponent.' - ) : invariant(ReactDescriptor.isValidDescriptor(component))); + ReactElement.isValidElement(element), + 'renderToStaticMarkup(): You must pass a valid ReactElement.' + ) : invariant(ReactElement.isValidElement(element))); var transaction; try { @@ -13681,7 +13819,7 @@ function renderComponentToStaticMarkup(component) { transaction = ReactServerRenderingTransaction.getPooled(true); return transaction.perform(function() { - var componentInstance = instantiateReactComponent(component); + var componentInstance = instantiateReactComponent(element, null); return componentInstance.mountComponent(id, transaction, 0); }, null); } finally { @@ -13690,25 +13828,18 @@ function renderComponentToStaticMarkup(component) { } module.exports = { - renderComponentToString: renderComponentToString, - renderComponentToStaticMarkup: renderComponentToStaticMarkup + renderToString: renderToString, + renderToStaticMarkup: renderToStaticMarkup }; -},{"./ReactDescriptor":56,"./ReactInstanceHandles":64,"./ReactMarkupChecksum":66,"./ReactServerRenderingTransaction":80,"./instantiateReactComponent":133,"./invariant":134}],80:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./ReactInstanceHandles":66,"./ReactMarkupChecksum":69,"./ReactServerRenderingTransaction":84,"./instantiateReactComponent":139,"./invariant":140}],84:[function(_dereq_,module,exports){ /** - * Copyright 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 + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactServerRenderingTransaction * @typechecks @@ -13721,8 +13852,8 @@ var CallbackQueue = _dereq_("./CallbackQueue"); var ReactPutListenerQueue = _dereq_("./ReactPutListenerQueue"); var Transaction = _dereq_("./Transaction"); +var assign = _dereq_("./Object.assign"); var emptyFunction = _dereq_("./emptyFunction"); -var mixInto = _dereq_("./mixInto"); /** * Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks @@ -13804,28 +13935,24 @@ var Mixin = { }; -mixInto(ReactServerRenderingTransaction, Transaction.Mixin); -mixInto(ReactServerRenderingTransaction, Mixin); +assign( + ReactServerRenderingTransaction.prototype, + Transaction.Mixin, + Mixin +); PooledClass.addPoolingTo(ReactServerRenderingTransaction); module.exports = ReactServerRenderingTransaction; -},{"./CallbackQueue":6,"./PooledClass":28,"./ReactPutListenerQueue":76,"./Transaction":104,"./emptyFunction":116,"./mixInto":147}],81:[function(_dereq_,module,exports){ +},{"./CallbackQueue":7,"./Object.assign":29,"./PooledClass":30,"./ReactPutListenerQueue":80,"./Transaction":107,"./emptyFunction":121}],85:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactStateSetters */ @@ -13924,21 +14051,14 @@ ReactStateSetters.Mixin = { module.exports = ReactStateSetters; -},{}],82:[function(_dereq_,module,exports){ +},{}],86:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactTestUtils */ @@ -13949,16 +14069,14 @@ var EventConstants = _dereq_("./EventConstants"); var EventPluginHub = _dereq_("./EventPluginHub"); var EventPropagators = _dereq_("./EventPropagators"); var React = _dereq_("./React"); -var ReactDescriptor = _dereq_("./ReactDescriptor"); -var ReactDOM = _dereq_("./ReactDOM"); +var ReactElement = _dereq_("./ReactElement"); var ReactBrowserEventEmitter = _dereq_("./ReactBrowserEventEmitter"); var ReactMount = _dereq_("./ReactMount"); var ReactTextComponent = _dereq_("./ReactTextComponent"); var ReactUpdates = _dereq_("./ReactUpdates"); var SyntheticEvent = _dereq_("./SyntheticEvent"); -var mergeInto = _dereq_("./mergeInto"); -var copyProperties = _dereq_("./copyProperties"); +var assign = _dereq_("./Object.assign"); var topLevelTypes = EventConstants.topLevelTypes; @@ -13981,16 +14099,16 @@ var ReactTestUtils = { // clean up, so we're going to stop honoring the name of this method // (and probably rename it eventually) if no problems arise. // document.documentElement.appendChild(div); - return React.renderComponent(instance, div); + return React.render(instance, div); }, - isDescriptor: function(descriptor) { - return ReactDescriptor.isValidDescriptor(descriptor); + isElement: function(element) { + return ReactElement.isValidElement(element); }, - isDescriptorOfType: function(inst, convenienceConstructor) { + isElementOfType: function(inst, convenienceConstructor) { return ( - ReactDescriptor.isValidDescriptor(inst) && + ReactElement.isValidElement(inst) && inst.type === convenienceConstructor.type ); }, @@ -13999,9 +14117,9 @@ var ReactTestUtils = { return !!(inst && inst.mountComponent && inst.tagName); }, - isDOMComponentDescriptor: function(inst) { + isDOMComponentElement: function(inst) { return !!(inst && - ReactDescriptor.isValidDescriptor(inst) && + ReactElement.isValidElement(inst) && !!inst.tagName); }, @@ -14015,8 +14133,8 @@ var ReactTestUtils = { (inst.constructor === type.type)); }, - isCompositeComponentDescriptor: function(inst) { - if (!ReactDescriptor.isValidDescriptor(inst)) { + isCompositeComponentElement: function(inst) { + if (!ReactElement.isValidElement(inst)) { return false; } // We check the prototype of the type that will get mounted, not the @@ -14028,8 +14146,8 @@ var ReactTestUtils = { ); }, - isCompositeComponentDescriptorWithType: function(inst, type) { - return !!(ReactTestUtils.isCompositeComponentDescriptor(inst) && + isCompositeComponentElementWithType: function(inst, type) { + return !!(ReactTestUtils.isCompositeComponentElement(inst) && (inst.constructor === type)); }, @@ -14165,16 +14283,23 @@ var ReactTestUtils = { * @return {object} the ReactTestUtils object (for chaining) */ mockComponent: function(module, mockTagName) { - var ConvenienceConstructor = React.createClass({ + mockTagName = mockTagName || module.mockTagName || "div"; + + var ConvenienceConstructor = React.createClass({displayName: 'ConvenienceConstructor', render: function() { - var mockTagName = mockTagName || module.mockTagName || "div"; - return ReactDOM[mockTagName](null, this.props.children); + return React.createElement( + mockTagName, + null, + this.props.children + ); } }); - copyProperties(module, ConvenienceConstructor); module.mockImplementation(ConvenienceConstructor); + module.type = ConvenienceConstructor.type; + module.isReactLegacyFactory = true; + return this; }, @@ -14249,7 +14374,7 @@ function makeSimulator(eventType) { ReactMount.getID(node), fakeNativeEvent ); - mergeInto(event, eventData); + assign(event, eventData); EventPropagators.accumulateTwoPhaseDispatches(event); ReactUpdates.batchedUpdates(function() { @@ -14305,7 +14430,7 @@ buildSimulators(); function makeNativeSimulator(eventType) { return function(domComponentOrNode, nativeEventData) { var fakeNativeEvent = new Event(eventType); - mergeInto(fakeNativeEvent, nativeEventData); + assign(fakeNativeEvent, nativeEventData); if (ReactTestUtils.isDOMComponent(domComponentOrNode)) { ReactTestUtils.simulateNativeEventOnDOMComponent( eventType, @@ -14338,21 +14463,14 @@ for (eventType in topLevelTypes) { module.exports = ReactTestUtils; -},{"./EventConstants":16,"./EventPluginHub":18,"./EventPropagators":21,"./React":29,"./ReactBrowserEventEmitter":31,"./ReactDOM":41,"./ReactDescriptor":56,"./ReactMount":67,"./ReactTextComponent":83,"./ReactUpdates":87,"./SyntheticEvent":96,"./copyProperties":110,"./mergeInto":146}],83:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPluginHub":19,"./EventPropagators":22,"./Object.assign":29,"./React":31,"./ReactBrowserEventEmitter":33,"./ReactElement":58,"./ReactMount":70,"./ReactTextComponent":87,"./ReactUpdates":91,"./SyntheticEvent":99}],87:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactTextComponent * @typechecks static-only @@ -14361,12 +14479,11 @@ module.exports = ReactTestUtils; "use strict"; var DOMPropertyOperations = _dereq_("./DOMPropertyOperations"); -var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); var ReactComponent = _dereq_("./ReactComponent"); -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); +var assign = _dereq_("./Object.assign"); var escapeTextForBrowser = _dereq_("./escapeTextForBrowser"); -var mixInto = _dereq_("./mixInto"); /** * Text nodes violate a couple assumptions that React makes about components: @@ -14383,13 +14500,11 @@ var mixInto = _dereq_("./mixInto"); * @extends ReactComponent * @internal */ -var ReactTextComponent = function(descriptor) { - this.construct(descriptor); +var ReactTextComponent = function(props) { + // This constructor and it's argument is currently used by mocks. }; -mixInto(ReactTextComponent, ReactComponent.Mixin); -mixInto(ReactTextComponent, ReactBrowserComponentMixin); -mixInto(ReactTextComponent, { +assign(ReactTextComponent.prototype, ReactComponent.Mixin, { /** * Creates the markup for this text node. This node is not intended to have @@ -14445,23 +14560,23 @@ mixInto(ReactTextComponent, { }); -module.exports = ReactDescriptor.createFactory(ReactTextComponent); +var ReactTextComponentFactory = function(text) { + // Bypass validation and configuration + return new ReactElement(ReactTextComponent, null, null, null, null, text); +}; + +ReactTextComponentFactory.type = ReactTextComponent; + +module.exports = ReactTextComponentFactory; -},{"./DOMPropertyOperations":12,"./ReactBrowserComponentMixin":30,"./ReactComponent":35,"./ReactDescriptor":56,"./escapeTextForBrowser":118,"./mixInto":147}],84:[function(_dereq_,module,exports){ +},{"./DOMPropertyOperations":13,"./Object.assign":29,"./ReactComponent":37,"./ReactElement":58,"./escapeTextForBrowser":123}],88:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks static-only * @providesModule ReactTransitionChildMapping @@ -14487,7 +14602,7 @@ var ReactTransitionChildMapping = { /** * When you're adding or removing children some may be added or removed in the - * same render pass. We want ot show *both* since we want to simultaneously + * same render pass. We want to show *both* since we want to simultaneously * animate elements in and out. This function takes a previous set of keys * and a new set of keys and merges them with its best guess of the correct * ordering. In the future we may expose some of the utilities in @@ -14555,21 +14670,14 @@ var ReactTransitionChildMapping = { module.exports = ReactTransitionChildMapping; -},{"./ReactChildren":34}],85:[function(_dereq_,module,exports){ +},{"./ReactChildren":36}],89:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactTransitionEvents */ @@ -14673,21 +14781,14 @@ var ReactTransitionEvents = { module.exports = ReactTransitionEvents; -},{"./ExecutionEnvironment":22}],86:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23}],90:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactTransitionGroup */ @@ -14697,21 +14798,21 @@ module.exports = ReactTransitionEvents; var React = _dereq_("./React"); var ReactTransitionChildMapping = _dereq_("./ReactTransitionChildMapping"); +var assign = _dereq_("./Object.assign"); var cloneWithProps = _dereq_("./cloneWithProps"); var emptyFunction = _dereq_("./emptyFunction"); -var merge = _dereq_("./merge"); var ReactTransitionGroup = React.createClass({ displayName: 'ReactTransitionGroup', propTypes: { - component: React.PropTypes.func, + component: React.PropTypes.any, childFactory: React.PropTypes.func }, getDefaultProps: function() { return { - component: React.DOM.span, + component: 'span', childFactory: emptyFunction.thatReturnsArgument }; }, @@ -14835,7 +14936,7 @@ var ReactTransitionGroup = React.createClass({ // This entered again before it fully left. Add it again. this.performEnter(key); } else { - var newChildren = merge(this.state.children); + var newChildren = assign({}, this.state.children); delete newChildren[key]; this.setState({children: newChildren}); } @@ -14859,27 +14960,24 @@ var ReactTransitionGroup = React.createClass({ ); } } - return this.transferPropsTo(this.props.component(null, childrenToRender)); + return React.createElement( + this.props.component, + this.props, + childrenToRender + ); } }); module.exports = ReactTransitionGroup; -},{"./React":29,"./ReactTransitionChildMapping":84,"./cloneWithProps":108,"./emptyFunction":116,"./merge":144}],87:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./React":31,"./ReactTransitionChildMapping":88,"./cloneWithProps":113,"./emptyFunction":121}],91:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactUpdates */ @@ -14892,11 +14990,13 @@ var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); var ReactPerf = _dereq_("./ReactPerf"); var Transaction = _dereq_("./Transaction"); +var assign = _dereq_("./Object.assign"); var invariant = _dereq_("./invariant"); -var mixInto = _dereq_("./mixInto"); var warning = _dereq_("./warning"); var dirtyComponents = []; +var asapCallbackQueue = CallbackQueue.getPooled(); +var asapEnqueued = false; var batchingStrategy = null; @@ -14941,13 +15041,14 @@ var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; function ReactUpdatesFlushTransaction() { this.reinitializeTransaction(); this.dirtyComponentsLength = null; - this.callbackQueue = CallbackQueue.getPooled(null); + this.callbackQueue = CallbackQueue.getPooled(); this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(); } -mixInto(ReactUpdatesFlushTransaction, Transaction.Mixin); -mixInto(ReactUpdatesFlushTransaction, { +assign( + ReactUpdatesFlushTransaction.prototype, + Transaction.Mixin, { getTransactionWrappers: function() { return TRANSACTION_WRAPPERS; }, @@ -15038,11 +15139,21 @@ var flushBatchedUpdates = ReactPerf.measure( // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents // array and perform any updates enqueued by mount-ready handlers (i.e., // componentDidUpdate) but we need to check here too in order to catch - // updates enqueued by setState callbacks. - while (dirtyComponents.length) { - var transaction = ReactUpdatesFlushTransaction.getPooled(); - transaction.perform(runBatchedUpdates, null, transaction); - ReactUpdatesFlushTransaction.release(transaction); + // updates enqueued by setState callbacks and asap calls. + while (dirtyComponents.length || asapEnqueued) { + if (dirtyComponents.length) { + var transaction = ReactUpdatesFlushTransaction.getPooled(); + transaction.perform(runBatchedUpdates, null, transaction); + ReactUpdatesFlushTransaction.release(transaction); + } + + if (asapEnqueued) { + asapEnqueued = false; + var queue = asapCallbackQueue; + asapCallbackQueue = CallbackQueue.getPooled(); + queue.notifyAll(); + CallbackQueue.release(queue); + } } } ); @@ -15089,6 +15200,20 @@ function enqueueUpdate(component, callback) { } } +/** + * Enqueue a callback to be run at the end of the current batching cycle. Throws + * if no updates are currently being performed. + */ +function asap(callback, context) { + ("production" !== "development" ? invariant( + batchingStrategy.isBatchingUpdates, + 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + + 'updates are not being batched.' + ) : invariant(batchingStrategy.isBatchingUpdates)); + asapCallbackQueue.enqueue(callback, context); + asapEnqueued = true; +} + var ReactUpdatesInjection = { injectReconcileTransaction: function(ReconcileTransaction) { ("production" !== "development" ? invariant( @@ -15127,84 +15252,20 @@ var ReactUpdates = { batchedUpdates: batchedUpdates, enqueueUpdate: enqueueUpdate, flushBatchedUpdates: flushBatchedUpdates, - injection: ReactUpdatesInjection + injection: ReactUpdatesInjection, + asap: asap }; module.exports = ReactUpdates; -},{"./CallbackQueue":6,"./PooledClass":28,"./ReactCurrentOwner":40,"./ReactPerf":71,"./Transaction":104,"./invariant":134,"./mixInto":147,"./warning":158}],88:[function(_dereq_,module,exports){ +},{"./CallbackQueue":7,"./Object.assign":29,"./PooledClass":30,"./ReactCurrentOwner":42,"./ReactPerf":75,"./Transaction":107,"./invariant":140,"./warning":160}],92:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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 ReactWithAddons - */ - -/** - * This module exists purely in the open source project, and is meant as a way - * to create a separate standalone build of React. This build has "addons", or - * functionality we've built and think might be useful but doesn't have a good - * place to live inside React core. - */ - -"use strict"; - -var LinkedStateMixin = _dereq_("./LinkedStateMixin"); -var React = _dereq_("./React"); -var ReactComponentWithPureRenderMixin = - _dereq_("./ReactComponentWithPureRenderMixin"); -var ReactCSSTransitionGroup = _dereq_("./ReactCSSTransitionGroup"); -var ReactTransitionGroup = _dereq_("./ReactTransitionGroup"); - -var cx = _dereq_("./cx"); -var cloneWithProps = _dereq_("./cloneWithProps"); -var update = _dereq_("./update"); - -React.addons = { - CSSTransitionGroup: ReactCSSTransitionGroup, - LinkedStateMixin: LinkedStateMixin, - PureRenderMixin: ReactComponentWithPureRenderMixin, - TransitionGroup: ReactTransitionGroup, - - classSet: cx, - cloneWithProps: cloneWithProps, - update: update -}; - -if ("production" !== "development") { - React.addons.Perf = _dereq_("./ReactDefaultPerf"); - React.addons.TestUtils = _dereq_("./ReactTestUtils"); -} - -module.exports = React; - - -},{"./LinkedStateMixin":24,"./React":29,"./ReactCSSTransitionGroup":32,"./ReactComponentWithPureRenderMixin":37,"./ReactDefaultPerf":54,"./ReactTestUtils":82,"./ReactTransitionGroup":86,"./cloneWithProps":108,"./cx":114,"./update":157}],89:[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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SVGDOMPropertyConfig */ @@ -15289,21 +15350,14 @@ var SVGDOMPropertyConfig = { module.exports = SVGDOMPropertyConfig; -},{"./DOMProperty":11}],90:[function(_dereq_,module,exports){ +},{"./DOMProperty":12}],93:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SelectEventPlugin */ @@ -15361,6 +15415,14 @@ function getSelection(node) { start: node.selectionStart, end: node.selectionEnd }; + } else if (window.getSelection) { + var selection = window.getSelection(); + return { + anchorNode: selection.anchorNode, + anchorOffset: selection.anchorOffset, + focusNode: selection.focusNode, + focusOffset: selection.focusOffset + }; } else if (document.selection) { var range = document.selection.createRange(); return { @@ -15369,14 +15431,6 @@ function getSelection(node) { top: range.boundingTop, left: range.boundingLeft }; - } else { - var selection = window.getSelection(); - return { - anchorNode: selection.anchorNode, - anchorOffset: selection.anchorOffset, - focusNode: selection.focusNode, - focusOffset: selection.focusOffset - }; } } @@ -15491,21 +15545,14 @@ var SelectEventPlugin = { module.exports = SelectEventPlugin; -},{"./EventConstants":16,"./EventPropagators":21,"./ReactInputSelection":63,"./SyntheticEvent":96,"./getActiveElement":122,"./isTextInputElement":137,"./keyOf":141,"./shallowEqual":153}],91:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPropagators":22,"./ReactInputSelection":65,"./SyntheticEvent":99,"./getActiveElement":127,"./isTextInputElement":143,"./keyOf":147,"./shallowEqual":155}],94:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ServerReactRootIndex * @typechecks @@ -15529,21 +15576,14 @@ var ServerReactRootIndex = { module.exports = ServerReactRootIndex; -},{}],92:[function(_dereq_,module,exports){ +},{}],95:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SimpleEventPlugin */ @@ -15563,8 +15603,11 @@ var SyntheticTouchEvent = _dereq_("./SyntheticTouchEvent"); var SyntheticUIEvent = _dereq_("./SyntheticUIEvent"); var SyntheticWheelEvent = _dereq_("./SyntheticWheelEvent"); +var getEventCharCode = _dereq_("./getEventCharCode"); + var invariant = _dereq_("./invariant"); var keyOf = _dereq_("./keyOf"); +var warning = _dereq_("./warning"); var topLevelTypes = EventConstants.topLevelTypes; @@ -15831,7 +15874,7 @@ var SimpleEventPlugin = { /** * Same as the default implementation, except cancels the event when return - * value is false. + * value is false. This behavior will be disabled in a future release. * * @param {object} Event to be dispatched. * @param {function} Application-level callback. @@ -15839,6 +15882,14 @@ var SimpleEventPlugin = { */ executeDispatch: function(event, listener, domID) { var returnValue = EventPluginUtils.executeDispatch(event, listener, domID); + + ("production" !== "development" ? warning( + typeof returnValue !== 'boolean', + 'Returning `false` from an event handler is deprecated and will be ' + + 'ignored in a future release. Instead, manually call ' + + 'e.stopPropagation() or e.preventDefault(), as appropriate.' + ) : null); + if (returnValue === false) { event.stopPropagation(); event.preventDefault(); @@ -15875,8 +15926,9 @@ var SimpleEventPlugin = { break; case topLevelTypes.topKeyPress: // FireFox creates a keypress event for function keys too. This removes - // the unwanted keypress events. - if (nativeEvent.charCode === 0) { + // the unwanted keypress events. Enter is however both printable and + // non-printable. One would expect Tab to be as well (but it isn't). + if (getEventCharCode(nativeEvent) === 0) { return null; } /* falls through */ @@ -15950,21 +16002,14 @@ var SimpleEventPlugin = { module.exports = SimpleEventPlugin; -},{"./EventConstants":16,"./EventPluginUtils":20,"./EventPropagators":21,"./SyntheticClipboardEvent":93,"./SyntheticDragEvent":95,"./SyntheticEvent":96,"./SyntheticFocusEvent":97,"./SyntheticKeyboardEvent":99,"./SyntheticMouseEvent":100,"./SyntheticTouchEvent":101,"./SyntheticUIEvent":102,"./SyntheticWheelEvent":103,"./invariant":134,"./keyOf":141}],93:[function(_dereq_,module,exports){ +},{"./EventConstants":17,"./EventPluginUtils":21,"./EventPropagators":22,"./SyntheticClipboardEvent":96,"./SyntheticDragEvent":98,"./SyntheticEvent":99,"./SyntheticFocusEvent":100,"./SyntheticKeyboardEvent":102,"./SyntheticMouseEvent":103,"./SyntheticTouchEvent":104,"./SyntheticUIEvent":105,"./SyntheticWheelEvent":106,"./getEventCharCode":128,"./invariant":140,"./keyOf":147,"./warning":160}],96:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticClipboardEvent * @typechecks static-only @@ -16003,21 +16048,14 @@ SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); module.exports = SyntheticClipboardEvent; -},{"./SyntheticEvent":96}],94:[function(_dereq_,module,exports){ +},{"./SyntheticEvent":99}],97:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticCompositionEvent * @typechecks static-only @@ -16056,21 +16094,14 @@ SyntheticEvent.augmentClass( module.exports = SyntheticCompositionEvent; -},{"./SyntheticEvent":96}],95:[function(_dereq_,module,exports){ +},{"./SyntheticEvent":99}],98:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticDragEvent * @typechecks static-only @@ -16102,21 +16133,14 @@ SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); module.exports = SyntheticDragEvent; -},{"./SyntheticMouseEvent":100}],96:[function(_dereq_,module,exports){ +},{"./SyntheticMouseEvent":103}],99:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticEvent * @typechecks static-only @@ -16126,10 +16150,9 @@ module.exports = SyntheticDragEvent; var PooledClass = _dereq_("./PooledClass"); +var assign = _dereq_("./Object.assign"); var emptyFunction = _dereq_("./emptyFunction"); var getEventTarget = _dereq_("./getEventTarget"); -var merge = _dereq_("./merge"); -var mergeInto = _dereq_("./mergeInto"); /** * @interface Event @@ -16196,7 +16219,7 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) { this.isPropagationStopped = emptyFunction.thatReturnsFalse; } -mergeInto(SyntheticEvent.prototype, { +assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = true; @@ -16254,11 +16277,11 @@ SyntheticEvent.augmentClass = function(Class, Interface) { var Super = this; var prototype = Object.create(Super.prototype); - mergeInto(prototype, Class.prototype); + assign(prototype, Class.prototype); Class.prototype = prototype; Class.prototype.constructor = Class; - Class.Interface = merge(Super.Interface, Interface); + Class.Interface = assign({}, Super.Interface, Interface); Class.augmentClass = Super.augmentClass; PooledClass.addPoolingTo(Class, PooledClass.threeArgumentPooler); @@ -16268,21 +16291,14 @@ PooledClass.addPoolingTo(SyntheticEvent, PooledClass.threeArgumentPooler); module.exports = SyntheticEvent; -},{"./PooledClass":28,"./emptyFunction":116,"./getEventTarget":125,"./merge":144,"./mergeInto":146}],97:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./PooledClass":30,"./emptyFunction":121,"./getEventTarget":131}],100:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticFocusEvent * @typechecks static-only @@ -16314,21 +16330,14 @@ SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); module.exports = SyntheticFocusEvent; -},{"./SyntheticUIEvent":102}],98:[function(_dereq_,module,exports){ +},{"./SyntheticUIEvent":105}],101:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticInputEvent * @typechecks static-only @@ -16368,21 +16377,14 @@ SyntheticEvent.augmentClass( module.exports = SyntheticInputEvent; -},{"./SyntheticEvent":96}],99:[function(_dereq_,module,exports){ +},{"./SyntheticEvent":99}],102:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticKeyboardEvent * @typechecks static-only @@ -16392,6 +16394,7 @@ module.exports = SyntheticInputEvent; var SyntheticUIEvent = _dereq_("./SyntheticUIEvent"); +var getEventCharCode = _dereq_("./getEventCharCode"); var getEventKey = _dereq_("./getEventKey"); var getEventModifierState = _dereq_("./getEventModifierState"); @@ -16414,11 +16417,10 @@ var KeyboardEventInterface = { // `charCode` is the result of a KeyPress event and represents the value of // the actual printable character. - // KeyPress is deprecated but its replacement is not yet final and not - // implemented in any major browser. + // KeyPress is deprecated, but its replacement is not yet final and not + // implemented in any major browser. Only KeyPress has charCode. if (event.type === 'keypress') { - // IE8 does not implement "charCode", but "keyCode" has the correct value. - return 'charCode' in event ? event.charCode : event.keyCode; + return getEventCharCode(event); } return 0; }, @@ -16437,9 +16439,14 @@ var KeyboardEventInterface = { }, which: function(event) { // `which` is an alias for either `keyCode` or `charCode` depending on the - // type of the event. There is no need to determine the type of the event - // as `keyCode` and `charCode` are either aliased or default to zero. - return event.keyCode || event.charCode; + // type of the event. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; } }; @@ -16457,21 +16464,14 @@ SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); module.exports = SyntheticKeyboardEvent; -},{"./SyntheticUIEvent":102,"./getEventKey":123,"./getEventModifierState":124}],100:[function(_dereq_,module,exports){ +},{"./SyntheticUIEvent":105,"./getEventCharCode":128,"./getEventKey":129,"./getEventModifierState":130}],103:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticMouseEvent * @typechecks static-only @@ -16547,21 +16547,14 @@ SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; -},{"./SyntheticUIEvent":102,"./ViewportMetrics":105,"./getEventModifierState":124}],101:[function(_dereq_,module,exports){ +},{"./SyntheticUIEvent":105,"./ViewportMetrics":108,"./getEventModifierState":130}],104:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticTouchEvent * @typechecks static-only @@ -16602,21 +16595,14 @@ SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); module.exports = SyntheticTouchEvent; -},{"./SyntheticUIEvent":102,"./getEventModifierState":124}],102:[function(_dereq_,module,exports){ +},{"./SyntheticUIEvent":105,"./getEventModifierState":130}],105:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticUIEvent * @typechecks static-only @@ -16671,21 +16657,14 @@ SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; -},{"./SyntheticEvent":96,"./getEventTarget":125}],103:[function(_dereq_,module,exports){ +},{"./SyntheticEvent":99,"./getEventTarget":131}],106:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule SyntheticWheelEvent * @typechecks static-only @@ -16739,21 +16718,14 @@ SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); module.exports = SyntheticWheelEvent; -},{"./SyntheticMouseEvent":100}],104:[function(_dereq_,module,exports){ +},{"./SyntheticMouseEvent":103}],107:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Transaction */ @@ -16985,21 +16957,14 @@ var Transaction = { module.exports = Transaction; -},{"./invariant":134}],105:[function(_dereq_,module,exports){ +},{"./invariant":140}],108:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ViewportMetrics */ @@ -17024,23 +16989,16 @@ var ViewportMetrics = { module.exports = ViewportMetrics; -},{"./getUnboundedScrollPosition":130}],106:[function(_dereq_,module,exports){ +},{"./getUnboundedScrollPosition":136}],109:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule accumulate + * @providesModule accumulateInto */ "use strict"; @@ -17048,53 +17006,61 @@ module.exports = ViewportMetrics; var invariant = _dereq_("./invariant"); /** - * Accumulates items that must not be null or undefined. * - * This is used to conserve memory by avoiding array allocations. + * Accumulates items that must not be null or undefined into the first one. This + * is used to conserve memory by avoiding array allocations, and thus sacrifices + * API cleanness. Since `current` can be null before being passed in and not + * null after this function, make sure to assign it back to `current`: + * + * `a = accumulateInto(a, b);` + * + * This API should be sparingly used. Try `accumulate` for something cleaner. * * @return {*|array<*>} An accumulation of items. */ -function accumulate(current, next) { + +function accumulateInto(current, next) { ("production" !== "development" ? invariant( next != null, - 'accumulate(...): Accumulated items must be not be null or undefined.' + 'accumulateInto(...): Accumulated items must not be null or undefined.' ) : invariant(next != null)); if (current == null) { return next; - } else { - // Both are not empty. Warning: Never call x.concat(y) when you are not - // certain that x is an Array (x could be a string with concat method). - var currentIsArray = Array.isArray(current); - var nextIsArray = Array.isArray(next); - if (currentIsArray) { - return current.concat(next); - } else { - if (nextIsArray) { - return [current].concat(next); - } else { - return [current, next]; - } - } } + + // Both are not empty. Warning: Never call x.concat(y) when you are not + // certain that x is an Array (x could be a string with concat method). + var currentIsArray = Array.isArray(current); + var nextIsArray = Array.isArray(next); + + if (currentIsArray && nextIsArray) { + current.push.apply(current, next); + return current; + } + + if (currentIsArray) { + current.push(next); + return current; + } + + if (nextIsArray) { + // A bit too dangerous to mutate `next`. + return [current].concat(next); + } + + return [current, next]; } -module.exports = accumulate; +module.exports = accumulateInto; -},{"./invariant":134}],107:[function(_dereq_,module,exports){ +},{"./invariant":140}],110:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule adler32 */ @@ -17107,7 +17073,7 @@ var MOD = 65521; // This is a clean-room implementation of adler32 designed for detecting // if markup is not what we expect it to be. It does not need to be -// cryptographically strong, only reasonable good at detecting if markup +// cryptographically strong, only reasonably good at detecting if markup // generated on the server is different than that on the client. function adler32(data) { var a = 1; @@ -17121,21 +17087,88 @@ function adler32(data) { module.exports = adler32; -},{}],108:[function(_dereq_,module,exports){ +},{}],111:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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 + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * http://www.apache.org/licenses/LICENSE-2.0 + * @providesModule camelize + * @typechecks + */ + +var _hyphenPattern = /-(.)/g; + +/** + * Camelcases a hyphenated string, for example: * - * 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. + * > camelize('background-color') + * < "backgroundColor" + * + * @param {string} string + * @return {string} + */ +function camelize(string) { + return string.replace(_hyphenPattern, function(_, character) { + return character.toUpperCase(); + }); +} + +module.exports = camelize; + +},{}],112:[function(_dereq_,module,exports){ +/** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule camelizeStyleName + * @typechecks + */ + +"use strict"; + +var camelize = _dereq_("./camelize"); + +var msPattern = /^-ms-/; + +/** + * Camelcases a hyphenated CSS property name, for example: + * + * > camelizeStyleName('background-color') + * < "backgroundColor" + * > camelizeStyleName('-moz-transition') + * < "MozTransition" + * > camelizeStyleName('-ms-transition') + * < "msTransition" + * + * As Andi Smith suggests + * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix + * is converted to lowercase `ms`. + * + * @param {string} string + * @return {string} + */ +function camelizeStyleName(string) { + return camelize(string.replace(msPattern, 'ms-')); +} + +module.exports = camelizeStyleName; + +},{"./camelize":111}],113:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @typechecks * @providesModule cloneWithProps @@ -17143,6 +17176,7 @@ module.exports = adler32; "use strict"; +var ReactElement = _dereq_("./ReactElement"); var ReactPropTransferer = _dereq_("./ReactPropTransferer"); var keyOf = _dereq_("./keyOf"); @@ -17162,7 +17196,7 @@ var CHILDREN_PROP = keyOf({children: null}); function cloneWithProps(child, props) { if ("production" !== "development") { ("production" !== "development" ? warning( - !child.props.ref, + !child.ref, 'You are calling cloneWithProps() on a child with a ref. This is ' + 'dangerous because you\'re creating a new child which will not be ' + 'added as a ref to its parent.' @@ -17178,27 +17212,20 @@ function cloneWithProps(child, props) { } // The current API doesn't retain _owner and _context, which is why this - // doesn't use ReactDescriptor.cloneAndReplaceProps. - return child.constructor(newProps); + // doesn't use ReactElement.cloneAndReplaceProps. + return ReactElement.createElement(child.type, newProps); } module.exports = cloneWithProps; -},{"./ReactPropTransferer":72,"./keyOf":141,"./warning":158}],109:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./ReactPropTransferer":76,"./keyOf":147,"./warning":160}],114:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule containsNode * @typechecks @@ -17235,77 +17262,14 @@ function containsNode(outerNode, innerNode) { module.exports = containsNode; -},{"./isTextNode":138}],110:[function(_dereq_,module,exports){ +},{"./isTextNode":144}],115:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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 copyProperties - */ - -/** - * Copy properties from one or more objects (up to 5) into the first object. - * This is a shallow copy. It mutates the first object and also returns it. - * - * NOTE: `arguments` has a very significant performance penalty, which is why - * we don't support unlimited arguments. - */ -function copyProperties(obj, a, b, c, d, e, f) { - obj = obj || {}; - - if ("production" !== "development") { - if (f) { - throw new Error('Too many arguments passed to copyProperties'); - } - } - - var args = [a, b, c, d, e]; - var ii = 0, v; - while (args[ii]) { - v = args[ii++]; - for (var k in v) { - obj[k] = v[k]; - } - - // IE ignores toString in object iteration.. See: - // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html - if (v.hasOwnProperty && v.hasOwnProperty('toString') && - (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) { - obj.toString = v.toString; - } - } - - return obj; -} - -module.exports = copyProperties; - -},{}],111:[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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule createArrayFrom * @typechecks @@ -17384,21 +17348,14 @@ function createArrayFrom(obj) { module.exports = createArrayFrom; -},{"./toArray":155}],112:[function(_dereq_,module,exports){ +},{"./toArray":157}],116:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule createFullPageComponent * @typechecks @@ -17408,6 +17365,7 @@ module.exports = createArrayFrom; // Defeat circular references by requiring this directly. var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactElement = _dereq_("./ReactElement"); var invariant = _dereq_("./invariant"); @@ -17419,14 +17377,14 @@ var invariant = _dereq_("./invariant"); * take advantage of React's reconciliation for styling and <title> * management. So we just document it and throw in dangerous cases. * - * @param {function} componentClass convenience constructor to wrap + * @param {string} tag The tag to wrap * @return {function} convenience constructor of new component */ -function createFullPageComponent(componentClass) { +function createFullPageComponent(tag) { + var elementFactory = ReactElement.createFactory(tag); + var FullPageComponent = ReactCompositeComponent.createClass({ - displayName: 'ReactFullPageComponent' + ( - componentClass.type.displayName || '' - ), + displayName: 'ReactFullPageComponent' + tag, componentWillUnmount: function() { ("production" !== "development" ? invariant( @@ -17440,7 +17398,7 @@ function createFullPageComponent(componentClass) { }, render: function() { - return this.transferPropsTo(componentClass(null, this.props.children)); + return elementFactory(this.props); } }); @@ -17449,21 +17407,14 @@ function createFullPageComponent(componentClass) { module.exports = createFullPageComponent; -},{"./ReactCompositeComponent":38,"./invariant":134}],113:[function(_dereq_,module,exports){ +},{"./ReactCompositeComponent":40,"./ReactElement":58,"./invariant":140}],117:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule createNodesFromMarkup * @typechecks @@ -17544,21 +17495,14 @@ function createNodesFromMarkup(markup, handleScript) { module.exports = createNodesFromMarkup; -},{"./ExecutionEnvironment":22,"./createArrayFrom":111,"./getMarkupWrap":126,"./invariant":134}],114:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23,"./createArrayFrom":115,"./getMarkupWrap":132,"./invariant":140}],118:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule cx */ @@ -17590,21 +17534,14 @@ function cx(classNames) { module.exports = cx; -},{}],115:[function(_dereq_,module,exports){ +},{}],119:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule dangerousStyleValue * @typechecks static-only @@ -17655,27 +17592,67 @@ function dangerousStyleValue(name, value) { module.exports = dangerousStyleValue; -},{"./CSSProperty":4}],116:[function(_dereq_,module,exports){ +},{"./CSSProperty":5}],120:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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 + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * http://www.apache.org/licenses/LICENSE-2.0 + * @providesModule deprecated + */ + +var assign = _dereq_("./Object.assign"); +var warning = _dereq_("./warning"); + +/** + * This will log a single deprecation notice per function and forward the call + * on to the new API. * - * 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. + * @param {string} namespace The namespace of the call, eg 'React' + * @param {string} oldName The old function name, eg 'renderComponent' + * @param {string} newName The new function name, eg 'render' + * @param {*} ctx The context this forwarded call should run in + * @param {function} fn The function to forward on to + * @return {*} Will be the value as returned from `fn` + */ +function deprecated(namespace, oldName, newName, ctx, fn) { + var warned = false; + if ("production" !== "development") { + var newFn = function() { + ("production" !== "development" ? warning( + warned, + (namespace + "." + oldName + " will be deprecated in a future version. ") + + ("Use " + namespace + "." + newName + " instead.") + ) : null); + warned = true; + return fn.apply(ctx, arguments); + }; + newFn.displayName = (namespace + "_" + oldName); + // We need to make sure all properties of the original fn are copied over. + // In particular, this is needed to support PropTypes + return assign(newFn, fn); + } + + return fn; +} + +module.exports = deprecated; + +},{"./Object.assign":29,"./warning":160}],121:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule emptyFunction */ -var copyProperties = _dereq_("./copyProperties"); - function makeEmptyFunction(arg) { return function() { return arg; @@ -17689,32 +17666,23 @@ function makeEmptyFunction(arg) { */ function emptyFunction() {} -copyProperties(emptyFunction, { - thatReturns: makeEmptyFunction, - thatReturnsFalse: makeEmptyFunction(false), - thatReturnsTrue: makeEmptyFunction(true), - thatReturnsNull: makeEmptyFunction(null), - thatReturnsThis: function() { return this; }, - thatReturnsArgument: function(arg) { return arg; } -}); +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function() { return this; }; +emptyFunction.thatReturnsArgument = function(arg) { return arg; }; module.exports = emptyFunction; -},{"./copyProperties":110}],117:[function(_dereq_,module,exports){ +},{}],122:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule emptyObject */ @@ -17729,21 +17697,14 @@ if ("production" !== "development") { module.exports = emptyObject; -},{}],118:[function(_dereq_,module,exports){ +},{}],123:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule escapeTextForBrowser * @typechecks static-only @@ -17777,27 +17738,22 @@ function escapeTextForBrowser(text) { module.exports = escapeTextForBrowser; -},{}],119:[function(_dereq_,module,exports){ +},{}],124:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule flattenChildren */ "use strict"; +var ReactTextComponent = _dereq_("./ReactTextComponent"); + var traverseAllChildren = _dereq_("./traverseAllChildren"); var warning = _dereq_("./warning"); @@ -17818,7 +17774,18 @@ function flattenSingleChildIntoContext(traverseContext, child, name) { name ) : null); if (keyUnique && child != null) { - result[name] = child; + var type = typeof child; + var normalizedValue; + + if (type === 'string') { + normalizedValue = ReactTextComponent(child); + } else if (type === 'number') { + normalizedValue = ReactTextComponent('' + child); + } else { + normalizedValue = child; + } + + result[name] = normalizedValue; } } @@ -17838,21 +17805,14 @@ function flattenChildren(children) { module.exports = flattenChildren; -},{"./traverseAllChildren":156,"./warning":158}],120:[function(_dereq_,module,exports){ +},{"./ReactTextComponent":87,"./traverseAllChildren":158,"./warning":160}],125:[function(_dereq_,module,exports){ /** - * Copyright 2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule focusNode */ @@ -17860,34 +17820,28 @@ module.exports = flattenChildren; "use strict"; /** - * IE8 throws if an input/textarea is disabled and we try to focus it. - * Focus only when necessary. - * * @param {DOMElement} node input/textarea to focus */ function focusNode(node) { - if (!node.disabled) { + // IE8 can throw "Can't move focus to the control because it is invisible, + // not enabled, or of a type that does not accept the focus." for all kinds of + // reasons that are too expensive and fragile to test. + try { node.focus(); + } catch(e) { } } module.exports = focusNode; -},{}],121:[function(_dereq_,module,exports){ +},{}],126:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule forEachAccumulated */ @@ -17911,21 +17865,14 @@ var forEachAccumulated = function(arr, cb, scope) { module.exports = forEachAccumulated; -},{}],122:[function(_dereq_,module,exports){ +},{}],127:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getActiveElement * @typechecks @@ -17947,21 +17894,66 @@ function getActiveElement() /*?DOMElement*/ { module.exports = getActiveElement; -},{}],123:[function(_dereq_,module,exports){ +},{}],128:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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 + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * http://www.apache.org/licenses/LICENSE-2.0 + * @providesModule getEventCharCode + * @typechecks static-only + */ + +"use strict"; + +/** + * `charCode` represents the actual "character code" and is safe to use with + * `String.fromCharCode`. As such, only keys that correspond to printable + * characters produce a valid `charCode`, the only exception to this is Enter. + * The Tab-key is considered non-printable and does not have a `charCode`, + * presumably because it does not produce a tab-character in browsers. * - * 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. + * @param {object} nativeEvent Native browser event. + * @return {string} Normalized `charCode` property. + */ +function getEventCharCode(nativeEvent) { + var charCode; + var keyCode = nativeEvent.keyCode; + + if ('charCode' in nativeEvent) { + charCode = nativeEvent.charCode; + + // FF does not set `charCode` for the Enter-key, check against `keyCode`. + if (charCode === 0 && keyCode === 13) { + charCode = 13; + } + } else { + // IE8 does not implement `charCode`, but `keyCode` has the correct value. + charCode = keyCode; + } + + // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. + // Must not discard the (non-)printable Enter-key. + if (charCode >= 32 || charCode === 13) { + return charCode; + } + + return 0; +} + +module.exports = getEventCharCode; + +},{}],129:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getEventKey * @typechecks static-only @@ -17969,7 +17961,7 @@ module.exports = getActiveElement; "use strict"; -var invariant = _dereq_("./invariant"); +var getEventCharCode = _dereq_("./getEventCharCode"); /** * Normalization of deprecated HTML5 `key` values @@ -17991,7 +17983,7 @@ var normalizeKey = { }; /** - * Translation from legacy `which`/`keyCode` to HTML5 `key` + * Translation from legacy `keyCode` to HTML5 `key` * Only special keys supported, all others depend on keyboard layout or browser * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names */ @@ -18043,11 +18035,7 @@ function getEventKey(nativeEvent) { // Browser does not implement `key`, polyfill as much of it as we can. if (nativeEvent.type === 'keypress') { - // Create the character from the `charCode` ourselves and use as an almost - // perfect replacement. - var charCode = 'charCode' in nativeEvent ? - nativeEvent.charCode : - nativeEvent.keyCode; + var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can // thus be captured by `keypress`, no other non-printable key should. @@ -18058,27 +18046,19 @@ function getEventKey(nativeEvent) { // `keyCode` value, almost all function keys have a universal value. return translateToKey[nativeEvent.keyCode] || 'Unidentified'; } - - ("production" !== "development" ? invariant(false, "Unexpected keyboard event type: %s", nativeEvent.type) : invariant(false)); + return ''; } module.exports = getEventKey; -},{"./invariant":134}],124:[function(_dereq_,module,exports){ +},{"./getEventCharCode":128}],130:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getEventModifierState * @typechecks static-only @@ -18118,21 +18098,14 @@ function getEventModifierState(nativeEvent) { module.exports = getEventModifierState; -},{}],125:[function(_dereq_,module,exports){ +},{}],131:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getEventTarget * @typechecks static-only @@ -18156,21 +18129,14 @@ function getEventTarget(nativeEvent) { module.exports = getEventTarget; -},{}],126:[function(_dereq_,module,exports){ +},{}],132:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getMarkupWrap */ @@ -18278,21 +18244,14 @@ function getMarkupWrap(nodeName) { module.exports = getMarkupWrap; -},{"./ExecutionEnvironment":22,"./invariant":134}],127:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23,"./invariant":140}],133:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getNodeForCharacterOffset */ @@ -18360,21 +18319,14 @@ function getNodeForCharacterOffset(root, offset) { module.exports = getNodeForCharacterOffset; -},{}],128:[function(_dereq_,module,exports){ +},{}],134:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getReactRootElementInContainer */ @@ -18402,21 +18354,14 @@ function getReactRootElementInContainer(container) { module.exports = getReactRootElementInContainer; -},{}],129:[function(_dereq_,module,exports){ +},{}],135:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getTextContentAccessor */ @@ -18446,21 +18391,14 @@ function getTextContentAccessor() { module.exports = getTextContentAccessor; -},{"./ExecutionEnvironment":22}],130:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23}],136:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule getUnboundedScrollPosition * @typechecks @@ -18493,21 +18431,14 @@ function getUnboundedScrollPosition(scrollable) { module.exports = getUnboundedScrollPosition; -},{}],131:[function(_dereq_,module,exports){ +},{}],137:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule hyphenate * @typechecks @@ -18533,21 +18464,14 @@ function hyphenate(string) { module.exports = hyphenate; -},{}],132:[function(_dereq_,module,exports){ +},{}],138:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule hyphenateStyleName * @typechecks @@ -18562,11 +18486,11 @@ var msPattern = /^ms-/; /** * Hyphenates a camelcased CSS property name, for example: * - * > hyphenate('backgroundColor') + * > hyphenateStyleName('backgroundColor') * < "background-color" - * > hyphenate('MozTransition') + * > hyphenateStyleName('MozTransition') * < "-moz-transition" - * > hyphenate('msTransition') + * > hyphenateStyleName('msTransition') * < "-ms-transition" * * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix @@ -18581,21 +18505,14 @@ function hyphenateStyleName(string) { module.exports = hyphenateStyleName; -},{"./hyphenate":131}],133:[function(_dereq_,module,exports){ +},{"./hyphenate":137}],139:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule instantiateReactComponent * @typechecks static-only @@ -18603,63 +18520,111 @@ module.exports = hyphenateStyleName; "use strict"; -var invariant = _dereq_("./invariant"); +var warning = _dereq_("./warning"); -/** - * Validate a `componentDescriptor`. This should be exposed publicly in a follow - * up diff. - * - * @param {object} descriptor - * @return {boolean} Returns true if this is a valid descriptor of a Component. - */ -function isValidComponentDescriptor(descriptor) { - return ( - descriptor && - typeof descriptor.type === 'function' && - typeof descriptor.type.prototype.mountComponent === 'function' && - typeof descriptor.type.prototype.receiveComponent === 'function' - ); -} +var ReactElement = _dereq_("./ReactElement"); +var ReactLegacyElement = _dereq_("./ReactLegacyElement"); +var ReactNativeComponent = _dereq_("./ReactNativeComponent"); +var ReactEmptyComponent = _dereq_("./ReactEmptyComponent"); /** - * Given a `componentDescriptor` create an instance that will actually be - * mounted. Currently it just extracts an existing clone from composite - * components but this is an implementation detail which will change. + * Given an `element` create an instance that will actually be mounted. * - * @param {object} descriptor - * @return {object} A new instance of componentDescriptor's constructor. + * @param {object} element + * @param {*} parentCompositeType The composite type that resolved this. + * @return {object} A new instance of the element's constructor. * @protected */ -function instantiateReactComponent(descriptor) { +function instantiateReactComponent(element, parentCompositeType) { + var instance; - // TODO: Make warning - // if (__DEV__) { - ("production" !== "development" ? invariant( - isValidComponentDescriptor(descriptor), - 'Only React Components are valid for mounting.' - ) : invariant(isValidComponentDescriptor(descriptor))); - // } + if ("production" !== "development") { + ("production" !== "development" ? warning( + element && (typeof element.type === 'function' || + typeof element.type === 'string'), + 'Only functions or strings can be mounted as React components.' + ) : null); + + // Resolve mock instances + if (element.type._mockedReactClassConstructor) { + // If this is a mocked class, we treat the legacy factory as if it was the + // class constructor for future proofing unit tests. Because this might + // be mocked as a legacy factory, we ignore any warnings triggerd by + // this temporary hack. + ReactLegacyElement._isLegacyCallWarningEnabled = false; + try { + instance = new element.type._mockedReactClassConstructor( + element.props + ); + } finally { + ReactLegacyElement._isLegacyCallWarningEnabled = true; + } + + // If the mock implementation was a legacy factory, then it returns a + // element. We need to turn this into a real component instance. + if (ReactElement.isValidElement(instance)) { + instance = new instance.type(instance.props); + } + + var render = instance.render; + if (!render) { + // For auto-mocked factories, the prototype isn't shimmed and therefore + // there is no render function on the instance. We replace the whole + // component with an empty component instance instead. + element = ReactEmptyComponent.getEmptyComponent(); + } else { + if (render._isMockFunction && !render._getMockImplementation()) { + // Auto-mocked components may have a prototype with a mocked render + // function. For those, we'll need to mock the result of the render + // since we consider undefined to be invalid results from render. + render.mockImplementation( + ReactEmptyComponent.getEmptyComponent + ); + } + instance.construct(element); + return instance; + } + } + } - return new descriptor.type(descriptor); + // Special case string values + if (typeof element.type === 'string') { + instance = ReactNativeComponent.createInstanceForTag( + element.type, + element.props, + parentCompositeType + ); + } else { + // Normal case for non-mocks and non-strings + instance = new element.type(element.props); + } + + if ("production" !== "development") { + ("production" !== "development" ? warning( + typeof instance.construct === 'function' && + typeof instance.mountComponent === 'function' && + typeof instance.receiveComponent === 'function', + 'Only React Components can be mounted.' + ) : null); + } + + // This actually sets up the internal instance. This will become decoupled + // from the public instance in a future diff. + instance.construct(element); + + return instance; } module.exports = instantiateReactComponent; -},{"./invariant":134}],134:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./ReactEmptyComponent":60,"./ReactLegacyElement":67,"./ReactNativeComponent":73,"./warning":160}],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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule invariant */ @@ -18707,21 +18672,14 @@ var invariant = function(condition, format, a, b, c, d, e, f) { module.exports = invariant; -},{}],135:[function(_dereq_,module,exports){ +},{}],141:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule isEventSupported */ @@ -18779,21 +18737,14 @@ function isEventSupported(eventNameSuffix, capture) { module.exports = isEventSupported; -},{"./ExecutionEnvironment":22}],136:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23}],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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule isNode * @typechecks @@ -18814,21 +18765,14 @@ function isNode(object) { module.exports = isNode; -},{}],137:[function(_dereq_,module,exports){ +},{}],143:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule isTextInputElement */ @@ -18865,21 +18809,14 @@ function isTextInputElement(elem) { module.exports = isTextInputElement; -},{}],138:[function(_dereq_,module,exports){ +},{}],144:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule isTextNode * @typechecks @@ -18897,21 +18834,14 @@ function isTextNode(object) { module.exports = isTextNode; -},{"./isNode":136}],139:[function(_dereq_,module,exports){ +},{"./isNode":142}],145:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule joinClasses * @typechecks static-only @@ -18935,7 +18865,9 @@ function joinClasses(className/*, ... */) { if (argLength > 1) { for (var ii = 1; ii < argLength; ii++) { nextClass = arguments[ii]; - nextClass && (className += ' ' + nextClass); + if (nextClass) { + className = (className ? className + ' ' : '') + nextClass; + } } } return className; @@ -18943,21 +18875,14 @@ function joinClasses(className/*, ... */) { module.exports = joinClasses; -},{}],140:[function(_dereq_,module,exports){ +},{}],146:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule keyMirror * @typechecks static-only @@ -19003,21 +18928,14 @@ var keyMirror = function(obj) { module.exports = keyMirror; -},{"./invariant":134}],141:[function(_dereq_,module,exports){ +},{"./invariant":140}],147:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule keyOf */ @@ -19046,75 +18964,67 @@ var keyOf = function(oneKeyObj) { module.exports = keyOf; -},{}],142:[function(_dereq_,module,exports){ +},{}],148:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule mapObject */ -"use strict"; +'use strict'; + +var hasOwnProperty = Object.prototype.hasOwnProperty; /** - * 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: + * Executes the provided `callback` once for each enumerable own property in the + * object and constructs a new object from the results. The `callback` is + * invoked with three arguments: * - * func(value, key, iteration) + * - the property value + * - the property name + * - the object being traversed * - * Grepable names: + * Properties that are added after the call to `mapObject` will not be visited + * by `callback`. If the values of existing properties are changed, the value + * passed to `callback` will be the value at the time `mapObject` visits them. + * Properties that are deleted before being visited are not visited. * - * function objectMap() - * function objMap() + * @grep function objectMap() + * @grep 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 + * @param {?object} object + * @param {function} callback + * @param {*} context + * @return {?object} */ -function mapObject(obj, func, context) { - if (!obj) { +function mapObject(object, callback, context) { + if (!object) { 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++); + var result = {}; + for (var name in object) { + if (hasOwnProperty.call(object, name)) { + result[name] = callback.call(context, object[name], name, object); } } - return ret; + return result; } module.exports = mapObject; -},{}],143:[function(_dereq_,module,exports){ +},{}],149:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule memoizeStringOnly * @typechecks static-only @@ -19141,293 +19051,14 @@ function memoizeStringOnly(callback) { module.exports = memoizeStringOnly; -},{}],144:[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 merge - */ - -"use strict"; - -var mergeInto = _dereq_("./mergeInto"); - -/** - * Shallow merges two structures into a return value, without mutating either. - * - * @param {?object} one Optional object with properties to merge from. - * @param {?object} two Optional object with properties to merge from. - * @return {object} The shallow extension of one by two. - */ -var merge = function(one, two) { - var result = {}; - mergeInto(result, one); - mergeInto(result, two); - return result; -}; - -module.exports = merge; - -},{"./mergeInto":146}],145:[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 mergeHelpers - * - * requiresPolyfills: Array.isArray - */ - -"use strict"; - -var invariant = _dereq_("./invariant"); -var keyMirror = _dereq_("./keyMirror"); - +},{}],150:[function(_dereq_,module,exports){ /** - * Maximum number of levels to traverse. Will catch circular structures. - * @const - */ -var MAX_MERGE_DEPTH = 36; - -/** - * We won't worry about edge cases like new String('x') or new Boolean(true). - * Functions are considered terminals, and arrays are not. - * @param {*} o The item/object/value to test. - * @return {boolean} true iff the argument is a terminal. - */ -var isTerminal = function(o) { - return typeof o !== 'object' || o === null; -}; - -var mergeHelpers = { - - MAX_MERGE_DEPTH: MAX_MERGE_DEPTH, - - isTerminal: isTerminal, - - /** - * Converts null/undefined values into empty object. - * - * @param {?Object=} arg Argument to be normalized (nullable optional) - * @return {!Object} - */ - normalizeMergeArg: function(arg) { - return arg === undefined || arg === null ? {} : arg; - }, - - /** - * If merging Arrays, a merge strategy *must* be supplied. If not, it is - * likely the caller's fault. If this function is ever called with anything - * but `one` and `two` being `Array`s, it is the fault of the merge utilities. - * - * @param {*} one Array to merge into. - * @param {*} two Array to merge from. - */ - checkMergeArrayArgs: function(one, two) { - ("production" !== "development" ? invariant( - Array.isArray(one) && Array.isArray(two), - 'Tried to merge arrays, instead got %s and %s.', - one, - two - ) : invariant(Array.isArray(one) && Array.isArray(two))); - }, - - /** - * @param {*} one Object to merge into. - * @param {*} two Object to merge from. - */ - checkMergeObjectArgs: function(one, two) { - mergeHelpers.checkMergeObjectArg(one); - mergeHelpers.checkMergeObjectArg(two); - }, - - /** - * @param {*} arg - */ - checkMergeObjectArg: function(arg) { - ("production" !== "development" ? invariant( - !isTerminal(arg) && !Array.isArray(arg), - 'Tried to merge an object, instead got %s.', - arg - ) : 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. - * - * @param {number} Level of recursion to validate against maximum. - */ - checkMergeLevel: function(level) { - ("production" !== "development" ? invariant( - level < MAX_MERGE_DEPTH, - 'Maximum deep merge depth exceeded. You may be attempting to merge ' + - 'circular structures in an unsupported way.' - ) : invariant(level < MAX_MERGE_DEPTH)); - }, - - /** - * Checks that the supplied merge strategy is valid. - * - * @param {string} Array merge strategy. - */ - checkArrayStrategy: function(strategy) { - ("production" !== "development" ? invariant( - strategy === undefined || strategy in mergeHelpers.ArrayStrategies, - 'You must provide an array strategy to deep merge functions to ' + - 'instruct the deep merge how to resolve merging two arrays.' - ) : invariant(strategy === undefined || strategy in mergeHelpers.ArrayStrategies)); - }, - - /** - * Set of possible behaviors of merge algorithms when encountering two Arrays - * that must be merged together. - * - `clobber`: The left `Array` is ignored. - * - `indexByIndex`: The result is achieved by recursively deep merging at - * each index. (not yet supported.) - */ - ArrayStrategies: keyMirror({ - Clobber: true, - IndexByIndex: true - }) - -}; - -module.exports = mergeHelpers; - -},{"./invariant":134,"./keyMirror":140}],146:[function(_dereq_,module,exports){ -/** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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 mergeInto - * @typechecks static-only - */ - -"use strict"; - -var mergeHelpers = _dereq_("./mergeHelpers"); - -var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg; -var checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg; - -/** - * Shallow merges two structures by mutating the first parameter. - * - * @param {object|function} one Object to be merged into. - * @param {?object} two Optional object with properties to merge from. - */ -function mergeInto(one, two) { - checkMergeIntoObjectArg(one); - if (two != null) { - checkMergeObjectArg(two); - for (var key in two) { - if (!two.hasOwnProperty(key)) { - continue; - } - one[key] = two[key]; - } - } -} - -module.exports = mergeInto; - -},{"./mergeHelpers":145}],147:[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 mixInto - */ - -"use strict"; - -/** - * Simply copies properties to the prototype. - */ -var mixInto = function(constructor, methodBag) { - var methodName; - for (methodName in methodBag) { - if (!methodBag.hasOwnProperty(methodName)) { - continue; - } - constructor.prototype[methodName] = methodBag[methodName]; - } -}; - -module.exports = mixInto; - -},{}],148:[function(_dereq_,module,exports){ -/** - * Copyright 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule monitorCodeUse */ @@ -19452,27 +19083,20 @@ function monitorCodeUse(eventName, data) { module.exports = monitorCodeUse; -},{"./invariant":134}],149:[function(_dereq_,module,exports){ +},{"./invariant":140}],151:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule onlyChild */ "use strict"; -var ReactDescriptor = _dereq_("./ReactDescriptor"); +var ReactElement = _dereq_("./ReactElement"); var invariant = _dereq_("./invariant"); @@ -19489,29 +19113,22 @@ var invariant = _dereq_("./invariant"); */ function onlyChild(children) { ("production" !== "development" ? invariant( - ReactDescriptor.isValidDescriptor(children), + ReactElement.isValidElement(children), 'onlyChild must be passed a children with exactly one child.' - ) : invariant(ReactDescriptor.isValidDescriptor(children))); + ) : invariant(ReactElement.isValidElement(children))); return children; } module.exports = onlyChild; -},{"./ReactDescriptor":56,"./invariant":134}],150:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./invariant":140}],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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule performance * @typechecks @@ -19532,21 +19149,14 @@ if (ExecutionEnvironment.canUseDOM) { module.exports = performance || {}; -},{"./ExecutionEnvironment":22}],151:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23}],153:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule performanceNow * @typechecks @@ -19567,21 +19177,14 @@ var performanceNow = performance.now.bind(performance); module.exports = performanceNow; -},{"./performance":150}],152:[function(_dereq_,module,exports){ +},{"./performance":152}],154:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule setInnerHTML */ @@ -19590,6 +19193,9 @@ module.exports = performanceNow; var ExecutionEnvironment = _dereq_("./ExecutionEnvironment"); +var WHITESPACE_TEST = /^[ \r\n\t\f]/; +var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; + /** * Set the innerHTML property of a node, ensuring that whitespace is preserved * even in IE8. @@ -19626,13 +19232,8 @@ if (ExecutionEnvironment.canUseDOM) { // 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('<noscript') !== -1 || - html.indexOf('<script') !== -1 || - html.indexOf('<style') !== -1 || - html.indexOf('<meta') !== -1 || - html.indexOf('<link') !== -1)) { + if (WHITESPACE_TEST.test(html) || + html[0] === '<' && NONVISIBLE_TEST.test(html)) { // Recover leading whitespace by temporarily prepending any character. // \uFEFF has the potential advantage of being zero-width/invisible. node.innerHTML = '\uFEFF' + html; @@ -19654,21 +19255,14 @@ if (ExecutionEnvironment.canUseDOM) { module.exports = setInnerHTML; -},{"./ExecutionEnvironment":22}],153:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":23}],155:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule shallowEqual */ @@ -19694,7 +19288,7 @@ function shallowEqual(objA, objB) { return false; } } - // Test for B'a keys missing from A. + // Test for B's keys missing from A. for (key in objB) { if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) { return false; @@ -19705,21 +19299,14 @@ function shallowEqual(objA, objB) { module.exports = shallowEqual; -},{}],154:[function(_dereq_,module,exports){ +},{}],156:[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 + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule shouldUpdateReactComponent * @typechecks static-only @@ -19728,22 +19315,21 @@ module.exports = shallowEqual; "use strict"; /** - * Given a `prevDescriptor` and `nextDescriptor`, determines if the existing + * Given a `prevElement` and `nextElement`, determines if the existing * instance should be updated as opposed to being destroyed or replaced by a new - * instance. Both arguments are descriptors. This ensures that this logic can + * instance. Both arguments are elements. This ensures that this logic can * operate on stateless trees without any backing instance. * - * @param {?object} prevDescriptor - * @param {?object} nextDescriptor + * @param {?object} prevElement + * @param {?object} nextElement * @return {boolean} True if the existing instance should be updated. * @protected */ -function shouldUpdateReactComponent(prevDescriptor, nextDescriptor) { - if (prevDescriptor && nextDescriptor && - prevDescriptor.type === nextDescriptor.type && ( - (prevDescriptor.props && prevDescriptor.props.key) === - (nextDescriptor.props && nextDescriptor.props.key) - ) && prevDescriptor._owner === nextDescriptor._owner) { +function shouldUpdateReactComponent(prevElement, nextElement) { + if (prevElement && nextElement && + prevElement.type === nextElement.type && + prevElement.key === nextElement.key && + prevElement._owner === nextElement._owner) { return true; } return false; @@ -19751,21 +19337,14 @@ function shouldUpdateReactComponent(prevDescriptor, nextDescriptor) { module.exports = shouldUpdateReactComponent; -},{}],155:[function(_dereq_,module,exports){ +},{}],157:[function(_dereq_,module,exports){ /** - * Copyright 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 + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule toArray * @typechecks @@ -19828,29 +19407,22 @@ function toArray(obj) { module.exports = toArray; -},{"./invariant":134}],156:[function(_dereq_,module,exports){ +},{"./invariant":140}],158:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule traverseAllChildren */ "use strict"; +var ReactElement = _dereq_("./ReactElement"); var ReactInstanceHandles = _dereq_("./ReactInstanceHandles"); -var ReactTextComponent = _dereq_("./ReactTextComponent"); var invariant = _dereq_("./invariant"); @@ -19885,9 +19457,9 @@ function userProvidedKeyEscaper(match) { * @return {string} */ function getComponentKey(component, index) { - if (component && component.props && component.props.key != null) { + if (component && component.key != null) { // Explicit key - return wrapUserProvidedKey(component.props.key); + return wrapUserProvidedKey(component.key); } // Implicit key determined by the index in the set return index.toString(36); @@ -19928,16 +19500,17 @@ function wrapUserProvidedKey(key) { */ var traverseAllChildrenImpl = function(children, nameSoFar, indexSoFar, callback, traverseContext) { + var nextName, nextIndex; var subtreeCount = 0; // Count of children found in the current subtree. if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { var child = children[i]; - var nextName = ( + nextName = ( nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + getComponentKey(child, i) ); - var nextIndex = indexSoFar + subtreeCount; + nextIndex = indexSoFar + subtreeCount; subtreeCount += traverseAllChildrenImpl( child, nextName, @@ -19957,40 +19530,32 @@ var traverseAllChildrenImpl = // All of the above are perceived as null. callback(traverseContext, null, storageName, indexSoFar); subtreeCount = 1; - } else if (children.type && children.type.prototype && - children.type.prototype.mountComponentIntoNode) { + } else if (type === 'string' || type === 'number' || + ReactElement.isValidElement(children)) { callback(traverseContext, children, storageName, indexSoFar); subtreeCount = 1; - } else { - if (type === 'object') { - ("production" !== "development" ? invariant( - !children || children.nodeType !== 1, - 'traverseAllChildren(...): Encountered an invalid child; DOM ' + - 'elements are not valid children of React components.' - ) : invariant(!children || children.nodeType !== 1)); - for (var key in children) { - if (children.hasOwnProperty(key)) { - subtreeCount += traverseAllChildrenImpl( - children[key], - ( - nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + - wrapUserProvidedKey(key) + SUBSEPARATOR + - getComponentKey(children[key], 0) - ), - indexSoFar + subtreeCount, - callback, - traverseContext - ); - } + } else if (type === 'object') { + ("production" !== "development" ? invariant( + !children || children.nodeType !== 1, + 'traverseAllChildren(...): Encountered an invalid child; DOM ' + + 'elements are not valid children of React components.' + ) : invariant(!children || children.nodeType !== 1)); + for (var key in children) { + if (children.hasOwnProperty(key)) { + nextName = ( + nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + + wrapUserProvidedKey(key) + SUBSEPARATOR + + getComponentKey(children[key], 0) + ); + nextIndex = indexSoFar + subtreeCount; + subtreeCount += traverseAllChildrenImpl( + children[key], + nextName, + nextIndex, + callback, + traverseContext + ); } - } else if (type === 'string') { - var normalizedText = ReactTextComponent(children); - callback(traverseContext, normalizedText, storageName, indexSoFar); - subtreeCount += 1; - } else if (type === 'number') { - var normalizedNumber = ReactTextComponent('' + children); - callback(traverseContext, normalizedNumber, storageName, indexSoFar); - subtreeCount += 1; } } } @@ -20023,28 +19588,21 @@ function traverseAllChildren(children, callback, traverseContext) { module.exports = traverseAllChildren; -},{"./ReactInstanceHandles":64,"./ReactTextComponent":83,"./invariant":134}],157:[function(_dereq_,module,exports){ +},{"./ReactElement":58,"./ReactInstanceHandles":66,"./invariant":140}],159:[function(_dereq_,module,exports){ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule update */ "use strict"; -var copyProperties = _dereq_("./copyProperties"); +var assign = _dereq_("./Object.assign"); var keyOf = _dereq_("./keyOf"); var invariant = _dereq_("./invariant"); @@ -20052,7 +19610,7 @@ function shallowCopy(x) { if (Array.isArray(x)) { return x.concat(); } else if (x && typeof x === 'object') { - return copyProperties(new x.constructor(), x); + return assign(new x.constructor(), x); } else { return x; } @@ -20132,7 +19690,7 @@ function update(value, spec) { COMMAND_MERGE, nextValue ) : invariant(nextValue && typeof nextValue === 'object')); - copyProperties(nextValue, spec[COMMAND_MERGE]); + assign(nextValue, spec[COMMAND_MERGE]); } if (spec.hasOwnProperty(COMMAND_PUSH)) { @@ -20196,21 +19754,14 @@ function update(value, spec) { module.exports = update; -},{"./copyProperties":110,"./invariant":134,"./keyOf":141}],158:[function(_dereq_,module,exports){ +},{"./Object.assign":29,"./invariant":140,"./keyOf":147}],160:[function(_dereq_,module,exports){ /** - * Copyright 2014 Facebook, Inc. + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * 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. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule warning */ @@ -20229,7 +19780,7 @@ var emptyFunction = _dereq_("./emptyFunction"); var warning = emptyFunction; if ("production" !== "development") { - warning = function(condition, format ) {var args=Array.prototype.slice.call(arguments,2); + warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); if (format === undefined) { throw new Error( '`warning(condition, format, ...args)` requires a warning ' + @@ -20246,6 +19797,5 @@ if ("production" !== "development") { module.exports = warning; -},{"./emptyFunction":116}]},{},[88]) -(88) +},{"./emptyFunction":121}]},{},[1])(1) });
\ No newline at end of file |