From 7967d52afc0bb7edee7dc26f30d291970a0d81a7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 20 Feb 2017 16:41:50 +0800 Subject: Updates --- examples/common.js | 4984 ++++++++++++++++------------------ examples/common.js.map | 2 +- examples/disabled.html | 4 +- examples/disabled.js | 6 +- examples/format.html | 4 +- examples/format.js | 10 +- examples/hidden.html | 4 +- examples/hidden.js | 10 +- examples/open.html | 321 +++ examples/open.js | 70 + examples/open.js.map | 1 + examples/pick-time.html | 4 +- examples/pick-time.js | 12 +- examples/value-and-defaultValue.html | 4 +- examples/value-and-defaultValue.js | 12 +- index.html | 25 +- 16 files changed, 2839 insertions(+), 2634 deletions(-) create mode 100644 examples/open.html create mode 100644 examples/open.js create mode 100644 examples/open.js.map diff --git a/examples/common.js b/examples/common.js index 3471ad5..8562f55 100644 --- a/examples/common.js +++ b/examples/common.js @@ -12,7 +12,28 @@ /******/ installedChunks[chunkId] = 0; /******/ } /******/ for(moduleId in moreModules) { -/******/ modules[moduleId] = moreModules[moduleId]; +/******/ var _m = moreModules[moduleId]; +/******/ +/******/ // Check if module is deduplicated +/******/ switch(typeof _m) { +/******/ case "object": +/******/ // Module can be created from a template +/******/ modules[moduleId] = (function(_m) { +/******/ var args = _m.slice(1), templateId = _m[0]; +/******/ return function (a,b,c) { +/******/ modules[templateId].apply(this, [a,b,c].concat(args)); +/******/ }; +/******/ }(_m)); +/******/ break; +/******/ case "function": +/******/ // Normal module +/******/ modules[moduleId] = _m; +/******/ break; +/******/ default: +/******/ // Module is a copy of another module +/******/ modules[moduleId] = modules[_m]; +/******/ break; +/******/ } /******/ } /******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules); /******/ while(callbacks.length) @@ -30,7 +51,7 @@ /******/ // "0" means "already loaded" /******/ // Array means "loading", array contains callbacks /******/ var installedChunks = { -/******/ 5:0 +/******/ 6:0 /******/ }; /******/ /******/ // The require function @@ -76,7 +97,7 @@ /******/ script.charset = 'utf-8'; /******/ script.async = true; /******/ -/******/ script.src = __webpack_require__.p + "" + chunkId + "." + ({"0":"disabled","1":"format","2":"hidden","3":"pick-time","4":"value-and-defaultValue"}[chunkId]||chunkId) + ".js"; +/******/ script.src = __webpack_require__.p + "" + chunkId + "." + ({"0":"disabled","1":"format","2":"hidden","3":"open","4":"pick-time","5":"value-and-defaultValue"}[chunkId]||chunkId) + ".js"; /******/ head.appendChild(script); /******/ } /******/ }; @@ -91,7 +112,30 @@ /******/ __webpack_require__.p = ""; /******/ }) /************************************************************************/ -/******/ ([ +/******/ ((function(modules) { + // Check all modules for deduplicated modules + for(var i in modules) { + if(Object.prototype.hasOwnProperty.call(modules, i)) { + switch(typeof modules[i]) { + case "function": break; + case "object": + // Module can be created from a template + modules[i] = (function(_m) { + var args = _m.slice(1), fn = modules[_m[0]]; + return function (a,b,c) { + fn.apply(this, [a,b,c].concat(args)); + }; + }(modules[i])); + break; + default: + // Module is a copy of another module + modules[i] = modules[modules[i]]; + break; + } + } + } + return modules; +}([ /* 0 */, /* 1 */, /* 2 */ @@ -120,7 +164,6 @@ * 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 */ 'use strict'; @@ -128,15 +171,15 @@ var _assign = __webpack_require__(6); var ReactChildren = __webpack_require__(7); - var ReactComponent = __webpack_require__(19); - var ReactPureComponent = __webpack_require__(22); - var ReactClass = __webpack_require__(23); - var ReactDOMFactories = __webpack_require__(28); + var ReactComponent = __webpack_require__(20); + var ReactPureComponent = __webpack_require__(23); + var ReactClass = __webpack_require__(24); + var ReactDOMFactories = __webpack_require__(26); var ReactElement = __webpack_require__(11); - var ReactPropTypes = __webpack_require__(33); - var ReactVersion = __webpack_require__(34); + var ReactPropTypes = __webpack_require__(31); + var ReactVersion = __webpack_require__(32); - var onlyChild = __webpack_require__(35); + var onlyChild = __webpack_require__(33); var warning = __webpack_require__(13); var createElement = ReactElement.createElement; @@ -144,7 +187,7 @@ var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = __webpack_require__(29); + var ReactElementValidator = __webpack_require__(27); createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; cloneElement = ReactElementValidator.cloneElement; @@ -393,8 +436,15 @@ /* 6 */ /***/ function(module, exports) { + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + 'use strict'; /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; @@ -415,7 +465,7 @@ // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; @@ -444,7 +494,7 @@ } return true; - } catch (e) { + } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } @@ -464,8 +514,8 @@ } } - if (Object.getOwnPropertySymbols) { - symbols = Object.getOwnPropertySymbols(from); + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; @@ -490,7 +540,6 @@ * 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 */ 'use strict'; @@ -499,7 +548,7 @@ var ReactElement = __webpack_require__(11); var emptyFunction = __webpack_require__(14); - var traverseAllChildren = __webpack_require__(16); + var traverseAllChildren = __webpack_require__(17); var twoArgumentPooler = PooledClass.twoArgumentPooler; var fourArgumentPooler = PooledClass.fourArgumentPooler; @@ -530,8 +579,8 @@ PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); function forEachSingleChild(bookKeeping, child, name) { - var func = bookKeeping.func; - var context = bookKeeping.context; + var func = bookKeeping.func, + context = bookKeeping.context; func.call(context, child, bookKeeping.count++); } @@ -583,10 +632,10 @@ PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); function mapSingleChildIntoContext(bookKeeping, child, childKey) { - var result = bookKeeping.result; - var keyPrefix = bookKeeping.keyPrefix; - var func = bookKeeping.func; - var context = bookKeeping.context; + var result = bookKeeping.result, + keyPrefix = bookKeeping.keyPrefix, + func = bookKeeping.func, + context = bookKeeping.context; var mappedChild = func.call(context, child, bookKeeping.count++); @@ -676,132 +725,7 @@ /***/ }, /* 8 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, 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 PooledClass - */ - - 'use strict'; - - var _prodInvariant = __webpack_require__(9); - - var invariant = __webpack_require__(10); - - /** - * Static poolers. Several custom versions for each potential number of - * arguments. A completely generic pooler is easy to implement, but would - * require accessing the `arguments` object. In each of these, `this` refers to - * the Class itself, not an instance. If any others are needed, simply add them - * here, or in their own files. - */ - var oneArgumentPooler = function (copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, copyFieldsFrom); - return instance; - } else { - return new Klass(copyFieldsFrom); - } - }; - - var twoArgumentPooler = function (a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2); - return instance; - } else { - return new Klass(a1, a2); - } - }; - - var threeArgumentPooler = function (a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3); - return instance; - } else { - return new Klass(a1, a2, a3); - } - }; - - var fourArgumentPooler = function (a1, a2, a3, a4) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4); - return instance; - } else { - return new Klass(a1, a2, a3, a4); - } - }; - - var fiveArgumentPooler = function (a1, a2, a3, a4, a5) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4, a5); - return instance; - } else { - return new Klass(a1, a2, a3, a4, a5); - } - }; - - var standardReleaser = function (instance) { - var Klass = this; - !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; - instance.destructor(); - if (Klass.instancePool.length < Klass.poolSize) { - Klass.instancePool.push(instance); - } - }; - - var DEFAULT_POOL_SIZE = 10; - var DEFAULT_POOLER = oneArgumentPooler; - - /** - * Augments `CopyConstructor` to be a poolable class, augmenting only the class - * itself (statically) not adding any prototypical fields. Any CopyConstructor - * you give this may have a `poolSize` property, and will look for a - * prototypical `destructor` on instances. - * - * @param {Function} CopyConstructor Constructor that can be used to reset. - * @param {Function} pooler Customizable pooler. - */ - var addPoolingTo = function (CopyConstructor, pooler) { - var NewKlass = CopyConstructor; - NewKlass.instancePool = []; - NewKlass.getPooled = pooler || DEFAULT_POOLER; - if (!NewKlass.poolSize) { - NewKlass.poolSize = DEFAULT_POOL_SIZE; - } - NewKlass.release = standardReleaser; - return NewKlass; - }; - - var PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fourArgumentPooler: fourArgumentPooler, - fiveArgumentPooler: fiveArgumentPooler - }; - - module.exports = PooledClass; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }, +[271, 9], /* 9 */ /***/ function(module, exports) { @@ -813,7 +737,6 @@ * 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 reactProdInvariant * */ 'use strict'; @@ -872,12 +795,18 @@ * will remain to ensure logic does not differ in production. */ - function invariant(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { + var validateFormat = function validateFormat(format) {}; + + if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } - } + }; + } + + function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); if (!condition) { var error; @@ -912,7 +841,6 @@ * 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 ReactElement */ 'use strict'; @@ -925,9 +853,7 @@ var canDefineProperty = __webpack_require__(15); var hasOwnProperty = Object.prototype.hasOwnProperty; - // The Symbol used to tag the ReactElement type. If there is no native Symbol - // nor polyfill, then a plain number is used for performance. - var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; + var REACT_ELEMENT_TYPE = __webpack_require__(16); var RESERVED_PROPS = { key: true, @@ -1031,7 +957,6 @@ // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; - var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should @@ -1051,12 +976,6 @@ writable: false, value: self }); - Object.defineProperty(element, '_shadowChildren', { - configurable: false, - enumerable: false, - writable: false, - value: shadowChildren - }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { @@ -1068,7 +987,6 @@ } else { element._store.validated = false; element._self = self; - element._shadowChildren = shadowChildren; element._source = source; } if (Object.freeze) { @@ -1123,6 +1041,11 @@ for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } + if (process.env.NODE_ENV !== 'production') { + if (Object.freeze) { + Object.freeze(childArray); + } + } props.children = childArray; } @@ -1249,8 +1172,6 @@ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; }; - ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE; - module.exports = ReactElement; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) @@ -1266,7 +1187,7 @@ * 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 + * */ 'use strict'; @@ -1277,7 +1198,6 @@ * The current owner is the component who should own any components that are * currently being constructed. */ - var ReactCurrentOwner = { /** @@ -1417,7 +1337,7 @@ * 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 canDefineProperty + * */ 'use strict'; @@ -1425,6 +1345,7 @@ var canDefineProperty = false; if (process.env.NODE_ENV !== 'production') { try { + // $FlowFixMe https://github.com/facebook/flow/issues/285 Object.defineProperty({}, 'x', { get: function () {} }); canDefineProperty = true; } catch (x) { @@ -1437,6 +1358,30 @@ /***/ }, /* 16 */ +/***/ function(module, exports) { + + /** + * Copyright 2014-present, 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. + * + * + */ + + 'use strict'; + + // The Symbol used to tag the ReactElement type. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + + var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; + + module.exports = REACT_ELEMENT_TYPE; + +/***/ }, +/* 17 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -1447,7 +1392,6 @@ * 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'; @@ -1455,16 +1399,22 @@ var _prodInvariant = __webpack_require__(9); var ReactCurrentOwner = __webpack_require__(12); - var ReactElement = __webpack_require__(11); + var REACT_ELEMENT_TYPE = __webpack_require__(16); - var getIteratorFn = __webpack_require__(17); + var getIteratorFn = __webpack_require__(18); var invariant = __webpack_require__(10); - var KeyEscapeUtils = __webpack_require__(18); + var KeyEscapeUtils = __webpack_require__(19); var warning = __webpack_require__(13); var SEPARATOR = '.'; var SUBSEPARATOR = ':'; + /** + * This is inlined from ReactElement since this file is shared between + * isomorphic and renderers. We could extract this to a + * + */ + /** * TODO: Test that a single child and an array with one item have the same key * pattern. @@ -1506,7 +1456,10 @@ children = null; } - if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) { + if (children === null || type === 'string' || type === 'number' || + // The following is inlined from ReactElement. This means we can optimize + // some checks. React Fiber also inlines this logic for similar purposes. + type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows. @@ -1609,7 +1562,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 17 */ +/* 18 */ /***/ function(module, exports) { /** @@ -1620,7 +1573,6 @@ * 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 getIteratorFn * */ @@ -1655,7 +1607,7 @@ module.exports = getIteratorFn; /***/ }, -/* 18 */ +/* 19 */ /***/ function(module, exports) { /** @@ -1666,7 +1618,6 @@ * 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 KeyEscapeUtils * */ @@ -1719,7 +1670,7 @@ module.exports = KeyEscapeUtils; /***/ }, -/* 19 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -1730,17 +1681,16 @@ * 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 _prodInvariant = __webpack_require__(9); - var ReactNoopUpdateQueue = __webpack_require__(20); + var ReactNoopUpdateQueue = __webpack_require__(21); var canDefineProperty = __webpack_require__(15); - var emptyObject = __webpack_require__(21); + var emptyObject = __webpack_require__(22); var invariant = __webpack_require__(10); var warning = __webpack_require__(13); @@ -1843,7 +1793,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 20 */ +/* 21 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -1854,7 +1804,6 @@ * 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 ReactNoopUpdateQueue */ 'use strict'; @@ -1945,7 +1894,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 21 */ +/* 22 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -1970,7 +1919,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 22 */ +/* 23 */ /***/ function(module, exports, __webpack_require__) { /** @@ -1981,17 +1930,16 @@ * 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 ReactPureComponent */ 'use strict'; var _assign = __webpack_require__(6); - var ReactComponent = __webpack_require__(19); - var ReactNoopUpdateQueue = __webpack_require__(20); + var ReactComponent = __webpack_require__(20); + var ReactNoopUpdateQueue = __webpack_require__(21); - var emptyObject = __webpack_require__(21); + var emptyObject = __webpack_require__(22); /** * Base class helpers for the updating state of a component. @@ -2017,7 +1965,7 @@ module.exports = ReactPureComponent; /***/ }, -/* 23 */ +/* 24 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -2028,7 +1976,6 @@ * 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 ReactClass */ 'use strict'; @@ -2036,44 +1983,27 @@ var _prodInvariant = __webpack_require__(9), _assign = __webpack_require__(6); - var ReactComponent = __webpack_require__(19); + var ReactComponent = __webpack_require__(20); var ReactElement = __webpack_require__(11); - var ReactPropTypeLocations = __webpack_require__(24); - var ReactPropTypeLocationNames = __webpack_require__(26); - var ReactNoopUpdateQueue = __webpack_require__(20); + var ReactPropTypeLocationNames = __webpack_require__(25); + var ReactNoopUpdateQueue = __webpack_require__(21); - var emptyObject = __webpack_require__(21); + var emptyObject = __webpack_require__(22); var invariant = __webpack_require__(10); - var keyMirror = __webpack_require__(25); - var keyOf = __webpack_require__(27); var warning = __webpack_require__(13); - var MIXINS_KEY = keyOf({ mixins: null }); + var MIXINS_KEY = 'mixins'; + + // Helper function to allow the creation of anonymous functions which do not + // have .name set to the name of the variable being assigned to. + function identity(fn) { + return fn; + } /** * Policies that describe methods in `ReactClassInterface`. */ - var SpecPolicy = keyMirror({ - /** - * These methods may be defined only once by the class specification or mixin. - */ - DEFINE_ONCE: null, - /** - * These methods may be defined by both the class specification and mixins. - * Subsequent definitions will be chained. These methods must return void. - */ - DEFINE_MANY: null, - /** - * These methods are overriding the base class. - */ - OVERRIDE_BASE: null, - /** - * These methods are similar to DEFINE_MANY, except we assume they return - * objects. We try to merge the keys of the return values of all the mixed in - * functions. If there is a key conflict we throw. - */ - DEFINE_MANY_MERGED: null - }); + var injectedMixins = []; @@ -2107,7 +2037,7 @@ * @type {array} * @optional */ - mixins: SpecPolicy.DEFINE_MANY, + mixins: 'DEFINE_MANY', /** * An object containing properties and methods that should be defined on @@ -2116,7 +2046,7 @@ * @type {object} * @optional */ - statics: SpecPolicy.DEFINE_MANY, + statics: 'DEFINE_MANY', /** * Definition of prop types for this component. @@ -2124,7 +2054,7 @@ * @type {object} * @optional */ - propTypes: SpecPolicy.DEFINE_MANY, + propTypes: 'DEFINE_MANY', /** * Definition of context types for this component. @@ -2132,7 +2062,7 @@ * @type {object} * @optional */ - contextTypes: SpecPolicy.DEFINE_MANY, + contextTypes: 'DEFINE_MANY', /** * Definition of context types this component sets for its children. @@ -2140,7 +2070,7 @@ * @type {object} * @optional */ - childContextTypes: SpecPolicy.DEFINE_MANY, + childContextTypes: 'DEFINE_MANY', // ==== Definition methods ==== @@ -2154,7 +2084,7 @@ * @return {object} * @optional */ - getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, + getDefaultProps: 'DEFINE_MANY_MERGED', /** * Invoked once before the component is mounted. The return value will be used @@ -2170,13 +2100,13 @@ * @return {object} * @optional */ - getInitialState: SpecPolicy.DEFINE_MANY_MERGED, + getInitialState: 'DEFINE_MANY_MERGED', /** * @return {object} * @optional */ - getChildContext: SpecPolicy.DEFINE_MANY_MERGED, + getChildContext: 'DEFINE_MANY_MERGED', /** * Uses props from `this.props` and state from `this.state` to render the @@ -2194,7 +2124,7 @@ * @nosideeffects * @required */ - render: SpecPolicy.DEFINE_ONCE, + render: 'DEFINE_ONCE', // ==== Delegate methods ==== @@ -2205,7 +2135,7 @@ * * @optional */ - componentWillMount: SpecPolicy.DEFINE_MANY, + componentWillMount: 'DEFINE_MANY', /** * Invoked when the component has been mounted and has a DOM representation. @@ -2217,7 +2147,7 @@ * @param {DOMElement} rootNode DOM element representing the component. * @optional */ - componentDidMount: SpecPolicy.DEFINE_MANY, + componentDidMount: 'DEFINE_MANY', /** * Invoked before the component receives new props. @@ -2238,7 +2168,7 @@ * @param {object} nextProps * @optional */ - componentWillReceiveProps: SpecPolicy.DEFINE_MANY, + componentWillReceiveProps: 'DEFINE_MANY', /** * Invoked while deciding if the component should be updated as a result of @@ -2260,7 +2190,7 @@ * @return {boolean} True if the component should update. * @optional */ - shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, + shouldComponentUpdate: 'DEFINE_ONCE', /** * Invoked when the component is about to update due to a transition from @@ -2277,7 +2207,7 @@ * @param {ReactReconcileTransaction} transaction * @optional */ - componentWillUpdate: SpecPolicy.DEFINE_MANY, + componentWillUpdate: 'DEFINE_MANY', /** * Invoked when the component's DOM representation has been updated. @@ -2291,7 +2221,7 @@ * @param {DOMElement} rootNode DOM element representing the component. * @optional */ - componentDidUpdate: SpecPolicy.DEFINE_MANY, + componentDidUpdate: 'DEFINE_MANY', /** * Invoked when the component is about to be removed from its parent and have @@ -2304,7 +2234,7 @@ * * @optional */ - componentWillUnmount: SpecPolicy.DEFINE_MANY, + componentWillUnmount: 'DEFINE_MANY', // ==== Advanced methods ==== @@ -2318,7 +2248,7 @@ * @internal * @overridable */ - updateComponent: SpecPolicy.OVERRIDE_BASE + updateComponent: 'OVERRIDE_BASE' }; @@ -2344,13 +2274,13 @@ }, childContextTypes: function (Constructor, childContextTypes) { if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext); + validateTypeDef(Constructor, childContextTypes, 'childContext'); } Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); }, contextTypes: function (Constructor, contextTypes) { if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context); + validateTypeDef(Constructor, contextTypes, 'context'); } Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); }, @@ -2367,7 +2297,7 @@ }, propTypes: function (Constructor, propTypes) { if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop); + validateTypeDef(Constructor, propTypes, 'prop'); } Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); }, @@ -2376,7 +2306,6 @@ }, autobind: function () {} }; - // noop function validateTypeDef(Constructor, typeDef, location) { for (var propName in typeDef) { if (typeDef.hasOwnProperty(propName)) { @@ -2392,12 +2321,12 @@ // Disallow overriding of base class methods unless explicitly allowed. if (ReactClassMixin.hasOwnProperty(name)) { - !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0; + !(specPolicy === 'OVERRIDE_BASE') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0; } // Disallow defining methods more than once unless explicitly allowed. if (isAlreadyDefined) { - !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0; + !(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0; } } @@ -2463,13 +2392,13 @@ var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride. - !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0; + !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0; // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. - if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { + if (specPolicy === 'DEFINE_MANY_MERGED') { proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === SpecPolicy.DEFINE_MANY) { + } else if (specPolicy === 'DEFINE_MANY') { proto[name] = createChainedFunction(proto[name], property); } } else { @@ -2664,7 +2593,10 @@ * @public */ createClass: function (spec) { - var Constructor = function (props, context, updater) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function (props, context, updater) { // This constructor gets overridden by mocks. The argument is used // by mocks to assert on what gets mounted. @@ -2699,7 +2631,7 @@ !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0; this.state = initialState; - }; + }); Constructor.prototype = new ReactClassComponent(); Constructor.prototype.constructor = Constructor; Constructor.prototype.__reactAutoBindPairs = []; @@ -2754,84 +2686,34 @@ module.exports = ReactClass; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) -/***/ }, -/* 24 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-present, 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 ReactPropTypeLocations - */ - - 'use strict'; - - var keyMirror = __webpack_require__(25); - - var ReactPropTypeLocations = keyMirror({ - prop: null, - context: null, - childContext: null - }); - - module.exports = ReactPropTypeLocations; - /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. + * Copyright 2013-present, 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 static-only + * */ 'use strict'; - var invariant = __webpack_require__(10); + var ReactPropTypeLocationNames = {}; - /** - * Constructs an enumeration with keys equal to their value. - * - * For example: - * - * var COLORS = keyMirror({blue: null, red: null}); - * var myColor = COLORS.blue; - * var isColorValid = !!COLORS[myColor]; - * - * The last line could not be performed if the values of the generated enum were - * not equal to their keys. - * - * Input: {key1: val1, key2: val2} - * Output: {key1: key1, key2: key2} - * - * @param {object} obj - * @return {object} - */ - var keyMirror = function keyMirror(obj) { - var ret = {}; - var key; - !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0; - for (key in obj) { - if (!obj.hasOwnProperty(key)) { - continue; - } - ret[key] = key; - } - return ret; - }; + if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; + } - module.exports = keyMirror; + module.exports = ReactPropTypeLocationNames; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, @@ -2846,81 +2728,11 @@ * 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 */ 'use strict'; - var ReactPropTypeLocationNames = {}; - - if (process.env.NODE_ENV !== 'production') { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' - }; - } - - module.exports = ReactPropTypeLocationNames; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }, -/* 27 */ -/***/ function(module, exports) { - - "use strict"; - - /** - * Copyright (c) 2013-present, 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. - * - */ - - /** - * Allows extraction of a minified key. Let's the build system minify keys - * without losing the ability to dynamically use key strings as values - * themselves. Pass in an object with a single key/val pair and it will return - * you the string key of that single record. Suppose you want to grab the - * value for a key 'className' inside of an object. Key/val minification may - * have aliased that key to be 'xa12'. keyOf({className: null}) will return - * 'xa12' in that case. Resolve keys you want to use once at startup time, then - * reuse those resolutions. - */ - var keyOf = function keyOf(oneKeyObj) { - var key; - for (key in oneKeyObj) { - if (!oneKeyObj.hasOwnProperty(key)) { - continue; - } - return key; - } - return null; - }; - - module.exports = keyOf; - -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, 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 ReactDOMFactories - */ - - 'use strict'; - - var ReactElement = __webpack_require__(11); + var ReactElement = __webpack_require__(11); /** * Create a factory that creates HTML tag elements. @@ -2929,7 +2741,7 @@ */ var createDOMFactory = ReactElement.createFactory; if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = __webpack_require__(29); + var ReactElementValidator = __webpack_require__(27); createDOMFactory = ReactElementValidator.createFactory; } @@ -3080,7 +2892,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 29 */ +/* 27 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3091,7 +2903,6 @@ * 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 ReactElementValidator */ /** @@ -3104,14 +2915,13 @@ 'use strict'; var ReactCurrentOwner = __webpack_require__(12); - var ReactComponentTreeHook = __webpack_require__(30); + var ReactComponentTreeHook = __webpack_require__(28); var ReactElement = __webpack_require__(11); - var ReactPropTypeLocations = __webpack_require__(24); - var checkReactTypeSpec = __webpack_require__(31); + var checkReactTypeSpec = __webpack_require__(29); var canDefineProperty = __webpack_require__(15); - var getIteratorFn = __webpack_require__(17); + var getIteratorFn = __webpack_require__(18); var warning = __webpack_require__(13); function getDeclarationErrorAddendum() { @@ -3235,7 +3045,7 @@ } var name = componentClass.displayName || componentClass.name; if (componentClass.propTypes) { - checkReactTypeSpec(componentClass.propTypes, element.props, ReactPropTypeLocations.prop, name, element, null); + checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); } if (typeof componentClass.getDefaultProps === 'function') { process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; @@ -3249,7 +3059,14 @@ // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. if (!validType) { - process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0; + if (typeof type !== 'function' && typeof type !== 'string') { + var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; + } + info += getDeclarationErrorAddendum(); + process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; + } } var element = ReactElement.createElement.apply(this, arguments); @@ -3314,7 +3131,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 30 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3325,7 +3142,7 @@ * 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 ReactComponentTreeHook + * */ 'use strict'; @@ -3368,113 +3185,96 @@ // Set.prototype.keys Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys); - var itemMap; - var rootIDSet; - - var itemByKey; - var rootByKey; + var setItem; + var getItem; + var removeItem; + var getItemIDs; + var addRoot; + var removeRoot; + var getRootIDs; if (canUseCollections) { - itemMap = new Map(); - rootIDSet = new Set(); - } else { - itemByKey = {}; - rootByKey = {}; - } - - var unmountedIDs = []; - - // Use non-numeric keys to prevent V8 performance issues: - // https://github.com/facebook/react/pull/7232 - function getKeyFromID(id) { - return '.' + id; - } - function getIDFromKey(key) { - return parseInt(key.substr(1), 10); - } + var itemMap = new Map(); + var rootIDSet = new Set(); - function get(id) { - if (canUseCollections) { + setItem = function (id, item) { + itemMap.set(id, item); + }; + getItem = function (id) { return itemMap.get(id); - } else { - var key = getKeyFromID(id); - return itemByKey[key]; - } - } - - function remove(id) { - if (canUseCollections) { + }; + removeItem = function (id) { itemMap['delete'](id); - } else { - var key = getKeyFromID(id); - delete itemByKey[key]; - } - } + }; + getItemIDs = function () { + return Array.from(itemMap.keys()); + }; - function create(id, element, parentID) { - var item = { - element: element, - parentID: parentID, - text: null, - childIDs: [], - isMounted: false, - updateCount: 0 + addRoot = function (id) { + rootIDSet.add(id); + }; + removeRoot = function (id) { + rootIDSet['delete'](id); + }; + getRootIDs = function () { + return Array.from(rootIDSet.keys()); }; + } else { + var itemByKey = {}; + var rootByKey = {}; - if (canUseCollections) { - itemMap.set(id, item); - } else { + // Use non-numeric keys to prevent V8 performance issues: + // https://github.com/facebook/react/pull/7232 + var getKeyFromID = function (id) { + return '.' + id; + }; + var getIDFromKey = function (key) { + return parseInt(key.substr(1), 10); + }; + + setItem = function (id, item) { var key = getKeyFromID(id); itemByKey[key] = item; - } - } + }; + getItem = function (id) { + var key = getKeyFromID(id); + return itemByKey[key]; + }; + removeItem = function (id) { + var key = getKeyFromID(id); + delete itemByKey[key]; + }; + getItemIDs = function () { + return Object.keys(itemByKey).map(getIDFromKey); + }; - function addRoot(id) { - if (canUseCollections) { - rootIDSet.add(id); - } else { + addRoot = function (id) { var key = getKeyFromID(id); rootByKey[key] = true; - } - } - - function removeRoot(id) { - if (canUseCollections) { - rootIDSet['delete'](id); - } else { + }; + removeRoot = function (id) { var key = getKeyFromID(id); delete rootByKey[key]; - } - } - - function getRegisteredIDs() { - if (canUseCollections) { - return Array.from(itemMap.keys()); - } else { - return Object.keys(itemByKey).map(getIDFromKey); - } - } - - function getRootIDs() { - if (canUseCollections) { - return Array.from(rootIDSet.keys()); - } else { + }; + getRootIDs = function () { return Object.keys(rootByKey).map(getIDFromKey); - } + }; } + var unmountedIDs = []; + function purgeDeep(id) { - var item = get(id); + var item = getItem(id); if (item) { var childIDs = item.childIDs; - remove(id); + removeItem(id); childIDs.forEach(purgeDeep); } } function describeComponentFrame(name, source, ownerName) { - return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); + return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); } function getDisplayName(element) { @@ -3503,12 +3303,13 @@ var ReactComponentTreeHook = { onSetChildren: function (id, nextChildIDs) { - var item = get(id); + var item = getItem(id); + !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; item.childIDs = nextChildIDs; for (var i = 0; i < nextChildIDs.length; i++) { var nextChildID = nextChildIDs[i]; - var nextChild = get(nextChildID); + var nextChild = getItem(nextChildID); !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0; !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0; !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; @@ -3516,16 +3317,24 @@ nextChild.parentID = id; // TODO: This shouldn't be necessary but mounting a new root during in // componentWillMount currently causes not-yet-mounted components to - // be purged from our tree data so their parent ID is missing. + // be purged from our tree data so their parent id is missing. } !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0; } }, onBeforeMountComponent: function (id, element, parentID) { - create(id, element, parentID); + var item = { + element: element, + parentID: parentID, + text: null, + childIDs: [], + isMounted: false, + updateCount: 0 + }; + setItem(id, item); }, onBeforeUpdateComponent: function (id, element) { - var item = get(id); + var item = getItem(id); if (!item || !item.isMounted) { // We may end up here as a result of setState() in componentWillUnmount(). // In this case, ignore the element. @@ -3534,7 +3343,8 @@ item.element = element; }, onMountComponent: function (id) { - var item = get(id); + var item = getItem(id); + !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; item.isMounted = true; var isRoot = item.parentID === 0; if (isRoot) { @@ -3542,7 +3352,7 @@ } }, onUpdateComponent: function (id) { - var item = get(id); + var item = getItem(id); if (!item || !item.isMounted) { // We may end up here as a result of setState() in componentWillUnmount(). // In this case, ignore the element. @@ -3551,7 +3361,7 @@ item.updateCount++; }, onUnmountComponent: function (id) { - var item = get(id); + var item = getItem(id); if (item) { // We need to check if it exists. // `item` might not exist if it is inside an error boundary, and a sibling @@ -3579,16 +3389,15 @@ unmountedIDs.length = 0; }, isMounted: function (id) { - var item = get(id); + var item = getItem(id); return item ? item.isMounted : false; }, getCurrentStackAddendum: function (topElement) { var info = ''; if (topElement) { - var type = topElement.type; - var name = typeof type === 'function' ? type.displayName || type.name : type; + var name = getDisplayName(topElement); var owner = topElement._owner; - info += describeComponentFrame(name || 'Unknown', topElement._source, owner && owner.getName()); + info += describeComponentFrame(name, topElement._source, owner && owner.getName()); } var currentOwner = ReactCurrentOwner.current; @@ -3606,7 +3415,7 @@ return info; }, getChildIDs: function (id) { - var item = get(id); + var item = getItem(id); return item ? item.childIDs : []; }, getDisplayName: function (id) { @@ -3617,7 +3426,7 @@ return getDisplayName(element); }, getElement: function (id) { - var item = get(id); + var item = getItem(id); return item ? item.element : null; }, getOwnerID: function (id) { @@ -3628,11 +3437,11 @@ return element._owner._debugID; }, getParentID: function (id) { - var item = get(id); + var item = getItem(id); return item ? item.parentID : null; }, getSource: function (id) { - var item = get(id); + var item = getItem(id); var element = item ? item.element : null; var source = element != null ? element._source : null; return source; @@ -3648,21 +3457,20 @@ } }, getUpdateCount: function (id) { - var item = get(id); + var item = getItem(id); return item ? item.updateCount : 0; }, - getRegisteredIDs: getRegisteredIDs, - - getRootIDs: getRootIDs + getRootIDs: getRootIDs, + getRegisteredIDs: getItemIDs }; module.exports = ReactComponentTreeHook; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 31 */ +/* 29 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3673,15 +3481,14 @@ * 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 checkReactTypeSpec */ 'use strict'; var _prodInvariant = __webpack_require__(9); - var ReactPropTypeLocationNames = __webpack_require__(26); - var ReactPropTypesSecret = __webpack_require__(32); + var ReactPropTypeLocationNames = __webpack_require__(25); + var ReactPropTypesSecret = __webpack_require__(30); var invariant = __webpack_require__(10); var warning = __webpack_require__(13); @@ -3694,7 +3501,7 @@ // https://github.com/facebook/react/issues/7240 // Remove the inline requires when we don't need them anymore: // https://github.com/facebook/react/pull/7178 - ReactComponentTreeHook = __webpack_require__(30); + ReactComponentTreeHook = __webpack_require__(28); } var loggedTypeFailures = {}; @@ -3736,7 +3543,7 @@ if (process.env.NODE_ENV !== 'production') { if (!ReactComponentTreeHook) { - ReactComponentTreeHook = __webpack_require__(30); + ReactComponentTreeHook = __webpack_require__(28); } if (debugID !== null) { componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); @@ -3755,7 +3562,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 32 */ +/* 30 */ /***/ function(module, exports) { /** @@ -3766,7 +3573,7 @@ * 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 ReactPropTypesSecret + * */ 'use strict'; @@ -3776,7 +3583,7 @@ module.exports = ReactPropTypesSecret; /***/ }, -/* 33 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3787,17 +3594,16 @@ * 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 ReactElement = __webpack_require__(11); - var ReactPropTypeLocationNames = __webpack_require__(26); - var ReactPropTypesSecret = __webpack_require__(32); + var ReactPropTypeLocationNames = __webpack_require__(25); + var ReactPropTypesSecret = __webpack_require__(30); var emptyFunction = __webpack_require__(14); - var getIteratorFn = __webpack_require__(17); + var getIteratorFn = __webpack_require__(18); var warning = __webpack_require__(13); /** @@ -3912,7 +3718,7 @@ if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { var cacheKey = componentName + ':' + propName; if (!manualPropTypeCallCache[cacheKey]) { - process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in the next major version. You may be ' + 'seeing this warning due to a third-party PropTypes library. ' + 'See https://fb.me/react-warning-dont-call-proptypes for details.', propFullName, componentName) : void 0; + process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0; manualPropTypeCallCache[cacheKey] = true; } } @@ -3920,7 +3726,10 @@ if (props[propName] == null) { var locationName = ReactPropTypeLocationNames[location]; if (isRequired) { - return new PropTypeError('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); + if (props[propName] === null) { + return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); } return null; } else { @@ -4213,7 +4022,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 34 */ +/* 32 */ /***/ function(module, exports) { /** @@ -4224,15 +4033,14 @@ * 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 ReactVersion */ 'use strict'; - module.exports = '15.3.2'; + module.exports = '15.4.2'; /***/ }, -/* 35 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4243,7 +4051,6 @@ * 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'; @@ -4276,16 +4083,16 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 36 */ +/* 34 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - module.exports = __webpack_require__(37); + module.exports = __webpack_require__(35); /***/ }, -/* 37 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4296,23 +4103,22 @@ * 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 */ /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/ 'use strict'; - var ReactDOMComponentTree = __webpack_require__(38); - var ReactDefaultInjection = __webpack_require__(41); - var ReactMount = __webpack_require__(164); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactDefaultInjection = __webpack_require__(40); + var ReactMount = __webpack_require__(168); var ReactReconciler = __webpack_require__(61); var ReactUpdates = __webpack_require__(58); - var ReactVersion = __webpack_require__(34); + var ReactVersion = __webpack_require__(173); - var findDOMNode = __webpack_require__(169); - var getHostComponentFromComposite = __webpack_require__(170); - var renderSubtreeIntoContainer = __webpack_require__(171); + var findDOMNode = __webpack_require__(174); + var getHostComponentFromComposite = __webpack_require__(175); + var renderSubtreeIntoContainer = __webpack_require__(176); var warning = __webpack_require__(13); ReactDefaultInjection.inject(); @@ -4330,7 +4136,6 @@ // Inject the runtime into a devtools global hook regardless of browser. // Allows for debugging when the hook is injected on the page. - /* eslint-enable camelcase */ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ ComponentTree: { @@ -4353,7 +4158,7 @@ } if (process.env.NODE_ENV !== 'production') { - var ExecutionEnvironment = __webpack_require__(51); + var ExecutionEnvironment = __webpack_require__(50); if (ExecutionEnvironment.canUseDOM && window.top === window.self) { // First check if devtools is not installed @@ -4377,7 +4182,7 @@ var expectedFeatures = [ // shims - Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim]; + Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim]; for (var i = 0; i < expectedFeatures.length; i++) { if (!expectedFeatures[i]) { @@ -4390,18 +4195,20 @@ if (process.env.NODE_ENV !== 'production') { var ReactInstrumentation = __webpack_require__(64); - var ReactDOMUnknownPropertyHook = __webpack_require__(172); - var ReactDOMNullInputValuePropHook = __webpack_require__(173); + var ReactDOMUnknownPropertyHook = __webpack_require__(177); + var ReactDOMNullInputValuePropHook = __webpack_require__(178); + var ReactDOMInvalidARIAHook = __webpack_require__(179); ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook); ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook); + ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook); } module.exports = ReactDOM; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 38 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4412,15 +4219,14 @@ * 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 ReactDOMComponentTree */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); - var DOMProperty = __webpack_require__(39); - var ReactDOMComponentFlags = __webpack_require__(40); + var DOMProperty = __webpack_require__(38); + var ReactDOMComponentFlags = __webpack_require__(39); var invariant = __webpack_require__(10); @@ -4429,6 +4235,13 @@ var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2); + /** + * Check if a given node should be cached. + */ + function shouldPrecacheNode(node, nodeID) { + return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' '; + } + /** * Drill down (through composites and empty components) until we get a host or * host text component. @@ -4494,7 +4307,7 @@ } // We assume the child nodes are in the same order as the child instances. for (; childNode !== null; childNode = childNode.nextSibling) { - if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') { + if (shouldPrecacheNode(childNode, childID)) { precacheNode(childInst, childNode); continue outer; } @@ -4595,7 +4408,9 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 39 */ +/* 37 */ +9, +/* 38 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4606,12 +4421,11 @@ * 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 */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); var invariant = __webpack_require__(10); @@ -4777,9 +4591,13 @@ /** * Mapping from lowercase property names to the properly cased version, used * to warn in the case of missing properties. Available only in __DEV__. + * + * autofocus is predefined, because adding it to the property whitelist + * causes unintended side effects. + * * @type {Object} */ - getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null, + getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : null, /** * All of the isCustomAttribute() functions that have been injected. @@ -4807,7 +4625,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 40 */ +/* 39 */ /***/ function(module, exports) { /** @@ -4818,7 +4636,6 @@ * 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 ReactDOMComponentFlags */ 'use strict'; @@ -4830,7 +4647,7 @@ module.exports = ReactDOMComponentFlags; /***/ }, -/* 41 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4841,29 +4658,29 @@ * 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 */ 'use strict'; + var ARIADOMPropertyConfig = __webpack_require__(41); var BeforeInputEventPlugin = __webpack_require__(42); var ChangeEventPlugin = __webpack_require__(57); - var DefaultEventPluginOrder = __webpack_require__(75); - var EnterLeaveEventPlugin = __webpack_require__(76); - var HTMLDOMPropertyConfig = __webpack_require__(81); - var ReactComponentBrowserEnvironment = __webpack_require__(82); - var ReactDOMComponent = __webpack_require__(96); - var ReactDOMComponentTree = __webpack_require__(38); - var ReactDOMEmptyComponent = __webpack_require__(135); - var ReactDOMTreeTraversal = __webpack_require__(136); - var ReactDOMTextComponent = __webpack_require__(137); - var ReactDefaultBatchingStrategy = __webpack_require__(138); - var ReactEventListener = __webpack_require__(139); - var ReactInjection = __webpack_require__(142); - var ReactReconcileTransaction = __webpack_require__(143); - var SVGDOMPropertyConfig = __webpack_require__(151); - var SelectEventPlugin = __webpack_require__(152); - var SimpleEventPlugin = __webpack_require__(153); + var DefaultEventPluginOrder = __webpack_require__(74); + var EnterLeaveEventPlugin = __webpack_require__(75); + var HTMLDOMPropertyConfig = __webpack_require__(80); + var ReactComponentBrowserEnvironment = __webpack_require__(81); + var ReactDOMComponent = __webpack_require__(94); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactDOMEmptyComponent = __webpack_require__(139); + var ReactDOMTreeTraversal = __webpack_require__(140); + var ReactDOMTextComponent = __webpack_require__(141); + var ReactDefaultBatchingStrategy = __webpack_require__(142); + var ReactEventListener = __webpack_require__(143); + var ReactInjection = __webpack_require__(146); + var ReactReconcileTransaction = __webpack_require__(147); + var SVGDOMPropertyConfig = __webpack_require__(155); + var SelectEventPlugin = __webpack_require__(156); + var SimpleEventPlugin = __webpack_require__(157); var alreadyInjected = false; @@ -4901,6 +4718,7 @@ ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent); + ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig); ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig); @@ -4918,6 +4736,84 @@ inject: inject }; +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + /** + * Copyright 2013-present, 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. + * + */ + + 'use strict'; + + var ARIADOMPropertyConfig = { + Properties: { + // Global States and Properties + 'aria-current': 0, // state + 'aria-details': 0, + 'aria-disabled': 0, // state + 'aria-hidden': 0, // state + 'aria-invalid': 0, // state + 'aria-keyshortcuts': 0, + 'aria-label': 0, + 'aria-roledescription': 0, + // Widget Attributes + 'aria-autocomplete': 0, + 'aria-checked': 0, + 'aria-expanded': 0, + 'aria-haspopup': 0, + 'aria-level': 0, + 'aria-modal': 0, + 'aria-multiline': 0, + 'aria-multiselectable': 0, + 'aria-orientation': 0, + 'aria-placeholder': 0, + 'aria-pressed': 0, + 'aria-readonly': 0, + 'aria-required': 0, + 'aria-selected': 0, + 'aria-sort': 0, + 'aria-valuemax': 0, + 'aria-valuemin': 0, + 'aria-valuenow': 0, + 'aria-valuetext': 0, + // Live Region Attributes + 'aria-atomic': 0, + 'aria-busy': 0, + 'aria-live': 0, + 'aria-relevant': 0, + // Drag-and-Drop Attributes + 'aria-dropeffect': 0, + 'aria-grabbed': 0, + // Relationship Attributes + 'aria-activedescendant': 0, + 'aria-colcount': 0, + 'aria-colindex': 0, + 'aria-colspan': 0, + 'aria-controls': 0, + 'aria-describedby': 0, + 'aria-errormessage': 0, + 'aria-flowto': 0, + 'aria-labelledby': 0, + 'aria-owns': 0, + 'aria-posinset': 0, + 'aria-rowcount': 0, + 'aria-rowindex': 0, + 'aria-rowspan': 0, + 'aria-setsize': 0 + }, + DOMAttributeNames: {}, + DOMPropertyNames: {} + }; + + module.exports = ARIADOMPropertyConfig; + /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { @@ -4930,20 +4826,16 @@ * 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 */ 'use strict'; - var EventConstants = __webpack_require__(43); - var EventPropagators = __webpack_require__(44); - var ExecutionEnvironment = __webpack_require__(51); - var FallbackCompositionState = __webpack_require__(52); + var EventPropagators = __webpack_require__(43); + var ExecutionEnvironment = __webpack_require__(50); + var FallbackCompositionState = __webpack_require__(51); var SyntheticCompositionEvent = __webpack_require__(54); var SyntheticInputEvent = __webpack_require__(56); - var keyOf = __webpack_require__(27); - var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space var START_KEYCODE = 229; @@ -4976,37 +4868,35 @@ var SPACEBAR_CODE = 32; var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); - var topLevelTypes = EventConstants.topLevelTypes; - // Events and their corresponding property names. var eventTypes = { beforeInput: { phasedRegistrationNames: { - bubbled: keyOf({ onBeforeInput: null }), - captured: keyOf({ onBeforeInputCapture: null }) + bubbled: 'onBeforeInput', + captured: 'onBeforeInputCapture' }, - dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste] + dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste'] }, compositionEnd: { phasedRegistrationNames: { - bubbled: keyOf({ onCompositionEnd: null }), - captured: keyOf({ onCompositionEndCapture: null }) + bubbled: 'onCompositionEnd', + captured: 'onCompositionEndCapture' }, - dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] + dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] }, compositionStart: { phasedRegistrationNames: { - bubbled: keyOf({ onCompositionStart: null }), - captured: keyOf({ onCompositionStartCapture: null }) + bubbled: 'onCompositionStart', + captured: 'onCompositionStartCapture' }, - dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] + dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] }, compositionUpdate: { phasedRegistrationNames: { - bubbled: keyOf({ onCompositionUpdate: null }), - captured: keyOf({ onCompositionUpdateCapture: null }) + bubbled: 'onCompositionUpdate', + captured: 'onCompositionUpdateCapture' }, - dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown] + dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] } }; @@ -5032,11 +4922,11 @@ */ function getCompositionEventType(topLevelType) { switch (topLevelType) { - case topLevelTypes.topCompositionStart: + case 'topCompositionStart': return eventTypes.compositionStart; - case topLevelTypes.topCompositionEnd: + case 'topCompositionEnd': return eventTypes.compositionEnd; - case topLevelTypes.topCompositionUpdate: + case 'topCompositionUpdate': return eventTypes.compositionUpdate; } } @@ -5050,7 +4940,7 @@ * @return {boolean} */ function isFallbackCompositionStart(topLevelType, nativeEvent) { - return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE; + return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE; } /** @@ -5062,16 +4952,16 @@ */ function isFallbackCompositionEnd(topLevelType, nativeEvent) { switch (topLevelType) { - case topLevelTypes.topKeyUp: + case 'topKeyUp': // Command keys insert or clear IME input. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; - case topLevelTypes.topKeyDown: + case 'topKeyDown': // Expect IME keyCode on each keydown. If we get any other // code we must have exited earlier. return nativeEvent.keyCode !== START_KEYCODE; - case topLevelTypes.topKeyPress: - case topLevelTypes.topMouseDown: - case topLevelTypes.topBlur: + case 'topKeyPress': + case 'topMouseDown': + case 'topBlur': // Events are not possible without cancelling IME. return true; default: @@ -5156,9 +5046,9 @@ */ function getNativeBeforeInputChars(topLevelType, nativeEvent) { switch (topLevelType) { - case topLevelTypes.topCompositionEnd: + case 'topCompositionEnd': return getDataFromCustomEvent(nativeEvent); - case topLevelTypes.topKeyPress: + case 'topKeyPress': /** * If native `textInput` events are available, our goal is to make * use of them. However, there is a special case: the spacebar key. @@ -5181,7 +5071,7 @@ hasSpaceKeypress = true; return SPACEBAR_CHAR; - case topLevelTypes.topTextInput: + case 'topTextInput': // Record the characters to be added to the DOM. var chars = nativeEvent.data; @@ -5214,7 +5104,7 @@ // If composition event is available, we extract a string only at // compositionevent, otherwise extract it at fallback events. if (currentComposition) { - if (topLevelType === topLevelTypes.topCompositionEnd || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { + if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { var chars = currentComposition.getData(); FallbackCompositionState.release(currentComposition); currentComposition = null; @@ -5224,11 +5114,11 @@ } switch (topLevelType) { - case topLevelTypes.topPaste: + case 'topPaste': // If a paste event occurs after a keypress, throw out the input // chars. Paste events should not lead to BeforeInput events. return null; - case topLevelTypes.topKeyPress: + case 'topKeyPress': /** * As of v27, Firefox may fire keypress events even when no character * will be inserted. A few possibilities: @@ -5249,7 +5139,7 @@ return String.fromCharCode(nativeEvent.which); } return null; - case topLevelTypes.topCompositionEnd: + case 'topCompositionEnd': return useFallbackCompositionData ? null : nativeEvent.data; default: return null; @@ -5315,108 +5205,6 @@ /***/ }, /* 43 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-present, 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 EventConstants - */ - - 'use strict'; - - var keyMirror = __webpack_require__(25); - - var PropagationPhases = keyMirror({ bubbled: null, captured: null }); - - /** - * Types of raw signals from the browser caught at the top level. - */ - var topLevelTypes = keyMirror({ - topAbort: null, - topAnimationEnd: null, - topAnimationIteration: null, - topAnimationStart: null, - topBlur: null, - topCanPlay: null, - topCanPlayThrough: null, - topChange: null, - topClick: null, - topCompositionEnd: null, - topCompositionStart: null, - topCompositionUpdate: null, - topContextMenu: null, - topCopy: null, - topCut: null, - topDoubleClick: null, - topDrag: null, - topDragEnd: null, - topDragEnter: null, - topDragExit: null, - topDragLeave: null, - topDragOver: null, - topDragStart: null, - topDrop: null, - topDurationChange: null, - topEmptied: null, - topEncrypted: null, - topEnded: null, - topError: null, - topFocus: null, - topInput: null, - topInvalid: null, - topKeyDown: null, - topKeyPress: null, - topKeyUp: null, - topLoad: null, - topLoadedData: null, - topLoadedMetadata: null, - topLoadStart: null, - topMouseDown: null, - topMouseMove: null, - topMouseOut: null, - topMouseOver: null, - topMouseUp: null, - topPaste: null, - topPause: null, - topPlay: null, - topPlaying: null, - topProgress: null, - topRateChange: null, - topReset: null, - topScroll: null, - topSeeked: null, - topSeeking: null, - topSelectionChange: null, - topStalled: null, - topSubmit: null, - topSuspend: null, - topTextInput: null, - topTimeUpdate: null, - topTouchCancel: null, - topTouchEnd: null, - topTouchMove: null, - topTouchStart: null, - topTransitionEnd: null, - topVolumeChange: null, - topWaiting: null, - topWheel: null - }); - - var EventConstants = { - topLevelTypes: topLevelTypes, - PropagationPhases: PropagationPhases - }; - - module.exports = EventConstants; - -/***/ }, -/* 44 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5427,20 +5215,17 @@ * 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 */ 'use strict'; - var EventConstants = __webpack_require__(43); - var EventPluginHub = __webpack_require__(45); - var EventPluginUtils = __webpack_require__(47); + var EventPluginHub = __webpack_require__(44); + var EventPluginUtils = __webpack_require__(46); - var accumulateInto = __webpack_require__(49); - var forEachAccumulated = __webpack_require__(50); + var accumulateInto = __webpack_require__(48); + var forEachAccumulated = __webpack_require__(49); var warning = __webpack_require__(13); - var PropagationPhases = EventConstants.PropagationPhases; var getListener = EventPluginHub.getListener; /** @@ -5458,11 +5243,10 @@ * Mutating the event's members allows us to not have to create a wrapping * "dispatch" object that pairs the event with the listener. */ - function accumulateDirectionalDispatches(inst, upwards, event) { + function accumulateDirectionalDispatches(inst, phase, event) { if (process.env.NODE_ENV !== 'production') { process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0; } - var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured; var listener = listenerAtPhase(inst, event, phase); if (listener) { event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); @@ -5559,7 +5343,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 45 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5570,19 +5354,18 @@ * 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 */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); - var EventPluginRegistry = __webpack_require__(46); - var EventPluginUtils = __webpack_require__(47); - var ReactErrorUtils = __webpack_require__(48); + var EventPluginRegistry = __webpack_require__(45); + var EventPluginUtils = __webpack_require__(46); + var ReactErrorUtils = __webpack_require__(47); - var accumulateInto = __webpack_require__(49); - var forEachAccumulated = __webpack_require__(50); + var accumulateInto = __webpack_require__(48); + var forEachAccumulated = __webpack_require__(49); var invariant = __webpack_require__(10); /** @@ -5625,6 +5408,28 @@ return '.' + inst._rootNodeID; }; + function isInteractive(tag) { + return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; + } + + function shouldPreventMouseEvent(name, type, props) { + switch (name) { + case 'onClick': + case 'onClickCapture': + case 'onDoubleClick': + case 'onDoubleClickCapture': + case 'onMouseDown': + case 'onMouseDownCapture': + case 'onMouseMove': + case 'onMouseMoveCapture': + case 'onMouseUp': + case 'onMouseUpCapture': + return !!(props.disabled && isInteractive(type)); + default: + return false; + } + } + /** * This is a unified interface for event plugins to be installed and configured. * @@ -5693,7 +5498,12 @@ * @return {?function} The stored callback. */ getListener: function (inst, registrationName) { + // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not + // live here; needs to be moved to a better place soon var bankForRegistrationName = listenerBank[registrationName]; + if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) { + return null; + } var key = getDictionaryKey(inst); return bankForRegistrationName && bankForRegistrationName[key]; }, @@ -5816,7 +5626,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 46 */ +/* 45 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5827,19 +5637,19 @@ * 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 + * */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); var invariant = __webpack_require__(10); /** * Injectable ordering of event plugins. */ - var EventPluginOrder = null; + var eventPluginOrder = null; /** * Injectable mapping from names to event plugin modules. @@ -5852,22 +5662,22 @@ * @private */ function recomputePluginOrdering() { - if (!EventPluginOrder) { - // Wait until an `EventPluginOrder` is injected. + if (!eventPluginOrder) { + // Wait until an `eventPluginOrder` is injected. return; } for (var pluginName in namesToPlugins) { - var PluginModule = namesToPlugins[pluginName]; - var pluginIndex = EventPluginOrder.indexOf(pluginName); + var pluginModule = namesToPlugins[pluginName]; + var pluginIndex = eventPluginOrder.indexOf(pluginName); !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0; if (EventPluginRegistry.plugins[pluginIndex]) { continue; } - !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0; - EventPluginRegistry.plugins[pluginIndex] = PluginModule; - var publishedEvents = PluginModule.eventTypes; + !pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0; + EventPluginRegistry.plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; for (var eventName in publishedEvents) { - !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0; + !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0; } } } @@ -5880,7 +5690,7 @@ * @return {boolean} True if the event was successfully published. * @private */ - function publishEventForPlugin(dispatchConfig, PluginModule, eventName) { + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0; EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; @@ -5889,12 +5699,12 @@ for (var phaseName in phasedRegistrationNames) { if (phasedRegistrationNames.hasOwnProperty(phaseName)) { var phasedRegistrationName = phasedRegistrationNames[phaseName]; - publishRegistrationName(phasedRegistrationName, PluginModule, eventName); + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); } } return true; } else if (dispatchConfig.registrationName) { - publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName); + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); return true; } return false; @@ -5908,10 +5718,10 @@ * @param {object} PluginModule Plugin publishing the event. * @private */ - function publishRegistrationName(registrationName, PluginModule, eventName) { + function publishRegistrationName(registrationName, pluginModule, eventName) { !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0; - EventPluginRegistry.registrationNameModules[registrationName] = PluginModule; - EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies; + EventPluginRegistry.registrationNameModules[registrationName] = pluginModule; + EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; if (process.env.NODE_ENV !== 'production') { var lowerCasedName = registrationName.toLowerCase(); @@ -5957,6 +5767,7 @@ * @type {Object} */ possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null, + // Trust the developer to only use possibleRegistrationNames in __DEV__ /** * Injects an ordering of plugins (by plugin name). This allows the ordering @@ -5967,10 +5778,10 @@ * @internal * @see {EventPluginHub.injection.injectEventPluginOrder} */ - injectEventPluginOrder: function (InjectedEventPluginOrder) { - !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0; + injectEventPluginOrder: function (injectedEventPluginOrder) { + !!eventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0; // Clone the ordering so it cannot be dynamically mutated. - EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder); + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); recomputePluginOrdering(); }, @@ -5990,10 +5801,10 @@ if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { continue; } - var PluginModule = injectedNamesToPlugins[pluginName]; - if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) { + var pluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0; - namesToPlugins[pluginName] = PluginModule; + namesToPlugins[pluginName] = pluginModule; isOrderingDirty = true; } } @@ -6014,13 +5825,19 @@ if (dispatchConfig.registrationName) { return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; } - for (var phase in dispatchConfig.phasedRegistrationNames) { - if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) { - continue; - } - var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]]; - if (PluginModule) { - return PluginModule; + if (dispatchConfig.phasedRegistrationNames !== undefined) { + // pulling phasedRegistrationNames out of dispatchConfig helps Flow see + // that it is not undefined. + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + for (var phase in phasedRegistrationNames) { + if (!phasedRegistrationNames.hasOwnProperty(phase)) { + continue; + } + var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]]; + if (pluginModule) { + return pluginModule; + } } } return null; @@ -6031,7 +5848,7 @@ * @private */ _resetEventPlugins: function () { - EventPluginOrder = null; + eventPluginOrder = null; for (var pluginName in namesToPlugins) { if (namesToPlugins.hasOwnProperty(pluginName)) { delete namesToPlugins[pluginName]; @@ -6069,7 +5886,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 47 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6080,15 +5897,13 @@ * 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 */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); - var EventConstants = __webpack_require__(43); - var ReactErrorUtils = __webpack_require__(48); + var ReactErrorUtils = __webpack_require__(47); var invariant = __webpack_require__(10); var warning = __webpack_require__(13); @@ -6118,17 +5933,15 @@ } }; - var topLevelTypes = EventConstants.topLevelTypes; - function isEndish(topLevelType) { - return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel; + return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel'; } function isMoveish(topLevelType) { - return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove; + return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove'; } function isStartish(topLevelType) { - return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart; + return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart'; } var validateEventDispatches; @@ -6304,7 +6117,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 48 */ +/* 47 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6315,7 +6128,7 @@ * 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 + * */ 'use strict'; @@ -6325,19 +6138,18 @@ /** * Call a function while guarding against errors that happens within it. * - * @param {?String} name of the guard to use for logging or debugging + * @param {String} name of the guard to use for logging or debugging * @param {Function} func The function to invoke * @param {*} a First argument * @param {*} b Second argument */ - function invokeGuardedCallback(name, func, a, b) { + function invokeGuardedCallback(name, func, a) { try { - return func(a, b); + func(a); } catch (x) { if (caughtError === null) { caughtError = x; } - return undefined; } } @@ -6370,11 +6182,12 @@ */ if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { var fakeNode = document.createElement('react'); - ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) { - var boundFunc = func.bind(null, a, b); + ReactErrorUtils.invokeGuardedCallback = function (name, func, a) { + var boundFunc = func.bind(null, a); var evtType = 'react-' + name; fakeNode.addEventListener(evtType, boundFunc, false); var evt = document.createEvent('Event'); + // $FlowFixMe https://github.com/facebook/flow/issues/2336 evt.initEvent(evtType, false, false); fakeNode.dispatchEvent(evt); fakeNode.removeEventListener(evtType, boundFunc, false); @@ -6386,7 +6199,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 49 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6397,13 +6210,12 @@ * 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 accumulateInto * */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); var invariant = __webpack_require__(10); @@ -6450,7 +6262,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 50 */ +/* 49 */ /***/ function(module, exports) { /** @@ -6461,7 +6273,6 @@ * 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 * */ @@ -6486,7 +6297,7 @@ module.exports = forEachAccumulated; /***/ }, -/* 51 */ +/* 50 */ /***/ function(module, exports) { /** @@ -6526,7 +6337,7 @@ module.exports = ExecutionEnvironment; /***/ }, -/* 52 */ +/* 51 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6537,14 +6348,13 @@ * 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 FallbackCompositionState */ 'use strict'; var _assign = __webpack_require__(6); - var PooledClass = __webpack_require__(8); + var PooledClass = __webpack_require__(52); var getTextContentAccessor = __webpack_require__(53); @@ -6626,6 +6436,8 @@ module.exports = FallbackCompositionState; /***/ }, +/* 52 */ +[271, 37], /* 53 */ /***/ function(module, exports, __webpack_require__) { @@ -6637,12 +6449,11 @@ * 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 */ 'use strict'; - var ExecutionEnvironment = __webpack_require__(51); + var ExecutionEnvironment = __webpack_require__(50); var contentKey = null; @@ -6675,7 +6486,6 @@ * 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 */ 'use strict'; @@ -6716,14 +6526,13 @@ * 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 */ 'use strict'; var _assign = __webpack_require__(6); - var PooledClass = __webpack_require__(8); + var PooledClass = __webpack_require__(52); var emptyFunction = __webpack_require__(14); var warning = __webpack_require__(13); @@ -6990,7 +6799,6 @@ * 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 */ 'use strict'; @@ -7032,33 +6840,28 @@ * 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 */ 'use strict'; - var EventConstants = __webpack_require__(43); - var EventPluginHub = __webpack_require__(45); - var EventPropagators = __webpack_require__(44); - var ExecutionEnvironment = __webpack_require__(51); - var ReactDOMComponentTree = __webpack_require__(38); + var EventPluginHub = __webpack_require__(44); + var EventPropagators = __webpack_require__(43); + var ExecutionEnvironment = __webpack_require__(50); + var ReactDOMComponentTree = __webpack_require__(36); var ReactUpdates = __webpack_require__(58); var SyntheticEvent = __webpack_require__(55); - var getEventTarget = __webpack_require__(72); - var isEventSupported = __webpack_require__(73); - var isTextInputElement = __webpack_require__(74); - var keyOf = __webpack_require__(27); - - var topLevelTypes = EventConstants.topLevelTypes; + var getEventTarget = __webpack_require__(71); + var isEventSupported = __webpack_require__(72); + var isTextInputElement = __webpack_require__(73); var eventTypes = { change: { phasedRegistrationNames: { - bubbled: keyOf({ onChange: null }), - captured: keyOf({ onChangeCapture: null }) + bubbled: 'onChange', + captured: 'onChangeCapture' }, - dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange] + dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange'] } }; @@ -7123,17 +6926,17 @@ } function getTargetInstForChangeEvent(topLevelType, targetInst) { - if (topLevelType === topLevelTypes.topChange) { + if (topLevelType === 'topChange') { return targetInst; } } function handleEventsForChangeEventIE8(topLevelType, target, targetInst) { - if (topLevelType === topLevelTypes.topFocus) { + if (topLevelType === 'topFocus') { // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForChangeEventIE8(); startWatchingForChangeEventIE8(target, targetInst); - } else if (topLevelType === topLevelTypes.topBlur) { + } else if (topLevelType === 'topBlur') { stopWatchingForChangeEventIE8(); } } @@ -7231,7 +7034,7 @@ * If a `change` event should be fired, returns the target's ID. */ function getTargetInstForInputEvent(topLevelType, targetInst) { - if (topLevelType === topLevelTypes.topInput) { + if (topLevelType === 'topInput') { // In modern browsers (i.e., not IE8 or IE9), the input event is exactly // what we want so fall through here and trigger an abstract event return targetInst; @@ -7239,7 +7042,7 @@ } function handleEventsForInputEventIE(topLevelType, target, targetInst) { - if (topLevelType === topLevelTypes.topFocus) { + if (topLevelType === 'topFocus') { // In IE8, we can capture almost all .value changes by adding a // propertychange handler and looking for events with propertyName // equal to 'value' @@ -7255,14 +7058,14 @@ // missed a blur event somehow. stopWatchingForValueChange(); startWatchingForValueChange(target, targetInst); - } else if (topLevelType === topLevelTypes.topBlur) { + } else if (topLevelType === 'topBlur') { stopWatchingForValueChange(); } } // For IE8 and IE9. function getTargetInstForInputEventIE(topLevelType, targetInst) { - if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) { + if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. // @@ -7291,7 +7094,7 @@ } function getTargetInstForClickEvent(topLevelType, targetInst) { - if (topLevelType === topLevelTypes.topClick) { + if (topLevelType === 'topClick') { return targetInst; } } @@ -7362,19 +7165,18 @@ * 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 */ 'use strict'; - var _prodInvariant = __webpack_require__(9), + var _prodInvariant = __webpack_require__(37), _assign = __webpack_require__(6); var CallbackQueue = __webpack_require__(59); - var PooledClass = __webpack_require__(8); + var PooledClass = __webpack_require__(52); var ReactFeatureFlags = __webpack_require__(60); var ReactReconciler = __webpack_require__(61); - var Transaction = __webpack_require__(71); + var Transaction = __webpack_require__(70); var invariant = __webpack_require__(10); @@ -7427,7 +7229,7 @@ /* useCreateElement */true); } - _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, { + _assign(ReactUpdatesFlushTransaction.prototype, Transaction, { getTransactionWrappers: function () { return TRANSACTION_WRAPPERS; }, @@ -7443,7 +7245,7 @@ perform: function (method, scope, a) { // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` // with this transaction's wrappers around it. - return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); + return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); } }); @@ -7451,7 +7253,7 @@ function batchedUpdates(callback, a, b, c, d, e) { ensureInjected(); - batchingStrategy.batchedUpdates(callback, a, b, c, d, e); + return batchingStrategy.batchedUpdates(callback, a, b, c, d, e); } /** @@ -7497,7 +7299,7 @@ if (ReactFeatureFlags.logTopLevelRenders) { var namedComponent = component; // Duck type TopLevelWrapper. This is probably always true. - if (component._currentElement.props === component._renderedComponent._currentElement) { + if (component._currentElement.type.isReactTopLevelWrapper) { namedComponent = component._renderedComponent; } markerName = 'React update: ' + namedComponent.getName(); @@ -7619,15 +7421,16 @@ * 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 + * */ 'use strict'; - var _prodInvariant = __webpack_require__(9), - _assign = __webpack_require__(6); + var _prodInvariant = __webpack_require__(37); - var PooledClass = __webpack_require__(8); + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var PooledClass = __webpack_require__(52); var invariant = __webpack_require__(10); @@ -7642,12 +7445,15 @@ * @implements PooledClass * @internal */ - function CallbackQueue() { - this._callbacks = null; - this._contexts = null; - } - _assign(CallbackQueue.prototype, { + var CallbackQueue = function () { + function CallbackQueue(arg) { + _classCallCheck(this, CallbackQueue); + + this._callbacks = null; + this._contexts = null; + this._arg = arg; + } /** * Enqueues a callback to be invoked when `notifyAll` is invoked. @@ -7656,12 +7462,14 @@ * @param {?object} context Context to call `callback` with. * @internal */ - enqueue: function (callback, context) { + + + CallbackQueue.prototype.enqueue = function enqueue(callback, context) { this._callbacks = this._callbacks || []; - this._contexts = this._contexts || []; this._callbacks.push(callback); + this._contexts = this._contexts || []; this._contexts.push(context); - }, + }; /** * Invokes all enqueued callbacks and clears the queue. This is invoked after @@ -7669,54 +7477,60 @@ * * @internal */ - notifyAll: function () { + + + CallbackQueue.prototype.notifyAll = function notifyAll() { var callbacks = this._callbacks; var contexts = this._contexts; - if (callbacks) { + var arg = this._arg; + if (callbacks && contexts) { !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0; this._callbacks = null; this._contexts = null; for (var i = 0; i < callbacks.length; i++) { - callbacks[i].call(contexts[i]); + callbacks[i].call(contexts[i], arg); } callbacks.length = 0; contexts.length = 0; } - }, + }; - checkpoint: function () { + CallbackQueue.prototype.checkpoint = function checkpoint() { return this._callbacks ? this._callbacks.length : 0; - }, + }; - rollback: function (len) { - if (this._callbacks) { + CallbackQueue.prototype.rollback = function rollback(len) { + if (this._callbacks && this._contexts) { this._callbacks.length = len; this._contexts.length = len; } - }, + }; /** * Resets the internal queue. * * @internal */ - reset: function () { + + + CallbackQueue.prototype.reset = function reset() { this._callbacks = null; this._contexts = null; - }, + }; /** * `PooledClass` looks for this. */ - destructor: function () { - this.reset(); - } - }); - PooledClass.addPoolingTo(CallbackQueue); + CallbackQueue.prototype.destructor = function destructor() { + this.reset(); + }; + + return CallbackQueue; + }(); - module.exports = CallbackQueue; + module.exports = PooledClass.addPoolingTo(CallbackQueue); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, @@ -7731,7 +7545,6 @@ * 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 ReactFeatureFlags * */ @@ -7758,7 +7571,6 @@ * 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 ReactReconciler */ 'use strict'; @@ -7932,7 +7744,7 @@ * 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 ReactRef + * */ 'use strict'; @@ -7960,7 +7772,7 @@ } ReactRef.attachRefs = function (instance, element) { - if (element === null || element === false) { + if (element === null || typeof element !== 'object') { return; } var ref = element.ref; @@ -7982,19 +7794,27 @@ // is made. It probably belongs where the key checking and // instantiateReactComponent is done. - var prevEmpty = prevElement === null || prevElement === false; - var nextEmpty = nextElement === null || nextElement === false; + var prevRef = null; + var prevOwner = null; + if (prevElement !== null && typeof prevElement === 'object') { + prevRef = prevElement.ref; + prevOwner = prevElement._owner; + } - return ( - // This has a few false positives w/r/t empty components. - prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref || - // If owner changes but we have an unchanged function ref, don't update refs - typeof nextElement.ref === 'string' && nextElement._owner !== prevElement._owner - ); + var nextRef = null; + var nextOwner = null; + if (nextElement !== null && typeof nextElement === 'object') { + nextRef = nextElement.ref; + nextOwner = nextElement._owner; + } + + return prevRef !== nextRef || + // If owner changes but we have an unchanged function ref, don't update refs + typeof nextRef === 'string' && nextOwner !== prevOwner; }; ReactRef.detachRefs = function (instance, element) { - if (element === null || element === false) { + if (element === null || typeof element !== 'object') { return; } var ref = element.ref; @@ -8017,15 +7837,24 @@ * 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 + * */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); var invariant = __webpack_require__(10); + /** + * @param {?object} object + * @return {boolean} True if `object` is a valid owner. + * @final + */ + function isValidOwner(object) { + return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); + } + /** * ReactOwners are capable of storing references to owned components. * @@ -8057,16 +7886,6 @@ * @class ReactOwner */ var ReactOwner = { - - /** - * @param {?object} object - * @return {boolean} True if `object` is a valid owner. - * @final - */ - isValidOwner: function (object) { - return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); - }, - /** * Adds a component by ref to an owner component. * @@ -8077,7 +7896,7 @@ * @internal */ addComponentAsRefTo: function (component, ref, owner) { - !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0; + !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0; owner.attachRef(ref, component); }, @@ -8091,7 +7910,7 @@ * @internal */ removeComponentAsRefFrom: function (component, ref, owner) { - !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0; + !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0; var ownerPublicInstance = owner.getPublicInstance(); // Check that `component`'s owner is still alive and that `component` is still the current ref // because we do not want to detach the ref if another component stole it. @@ -8117,11 +7936,13 @@ * 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 ReactInstrumentation + * */ 'use strict'; + // Trust the developer to only use ReactInstrumentation with a __DEV__ check + var debugTool = null; if (process.env.NODE_ENV !== 'production') { @@ -8144,18 +7965,17 @@ * 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 ReactDebugTool + * */ 'use strict'; var ReactInvalidSetStateWarningHook = __webpack_require__(66); var ReactHostOperationHistoryHook = __webpack_require__(67); - var ReactComponentTreeHook = __webpack_require__(30); - var ReactChildrenMutationWarningHook = __webpack_require__(68); - var ExecutionEnvironment = __webpack_require__(51); + var ReactComponentTreeHook = __webpack_require__(28); + var ExecutionEnvironment = __webpack_require__(50); - var performanceNow = __webpack_require__(69); + var performanceNow = __webpack_require__(68); var warning = __webpack_require__(13); var hooks = []; @@ -8184,11 +8004,11 @@ var flushHistory = []; var lifeCycleTimerStack = []; var currentFlushNesting = 0; - var currentFlushMeasurements = null; - var currentFlushStartTime = null; + var currentFlushMeasurements = []; + var currentFlushStartTime = 0; var currentTimerDebugID = null; - var currentTimerStartTime = null; - var currentTimerNestedFlushDuration = null; + var currentTimerStartTime = 0; + var currentTimerNestedFlushDuration = 0; var currentTimerType = null; var lifeCycleTimerHasWarned = false; @@ -8208,7 +8028,7 @@ updateCount: ReactComponentTreeHook.getUpdateCount(id), childIDs: ReactComponentTreeHook.getChildIDs(id), // Text nodes don't have owners but this is close enough. - ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID), + ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, parentID: parentID }; return tree; @@ -8217,12 +8037,12 @@ function resetMeasurements() { var previousStartTime = currentFlushStartTime; - var previousMeasurements = currentFlushMeasurements || []; + var previousMeasurements = currentFlushMeasurements; var previousOperations = ReactHostOperationHistoryHook.getHistory(); if (currentFlushNesting === 0) { - currentFlushStartTime = null; - currentFlushMeasurements = null; + currentFlushStartTime = 0; + currentFlushMeasurements = []; clearHistory(); return; } @@ -8243,7 +8063,7 @@ } function checkDebugID(debugID) { - var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (allowRoot && debugID === 0) { return; @@ -8282,8 +8102,8 @@ duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration }); } - currentTimerStartTime = null; - currentTimerNestedFlushDuration = null; + currentTimerStartTime = 0; + currentTimerNestedFlushDuration = 0; currentTimerDebugID = null; currentTimerType = null; } @@ -8296,19 +8116,18 @@ timerType: currentTimerType }; lifeCycleTimerStack.push(currentTimer); - currentTimerStartTime = null; - currentTimerNestedFlushDuration = null; + currentTimerStartTime = 0; + currentTimerNestedFlushDuration = 0; currentTimerDebugID = null; currentTimerType = null; } function resumeCurrentLifeCycleTimer() { - var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(); - - var startTime = _lifeCycleTimerStack$.startTime; - var nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime; - var debugID = _lifeCycleTimerStack$.debugID; - var timerType = _lifeCycleTimerStack$.timerType; + var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), + startTime = _lifeCycleTimerStack$.startTime, + nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, + debugID = _lifeCycleTimerStack$.debugID, + timerType = _lifeCycleTimerStack$.timerType; var nestedFlushDuration = performanceNow() - nestedFlushStartTime; currentTimerStartTime = startTime; @@ -8317,6 +8136,60 @@ currentTimerType = timerType; } + var lastMarkTimeStamp = 0; + var canUsePerformanceMeasure = + // $FlowFixMe https://github.com/facebook/flow/issues/2345 + typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; + + function shouldMark(debugID) { + if (!isProfiling || !canUsePerformanceMeasure) { + return false; + } + var element = ReactComponentTreeHook.getElement(debugID); + if (element == null || typeof element !== 'object') { + return false; + } + var isHostElement = typeof element.type === 'string'; + if (isHostElement) { + return false; + } + return true; + } + + function markBegin(debugID, markType) { + if (!shouldMark(debugID)) { + return; + } + + var markName = debugID + '::' + markType; + lastMarkTimeStamp = performanceNow(); + performance.mark(markName); + } + + function markEnd(debugID, markType) { + if (!shouldMark(debugID)) { + return; + } + + var markName = debugID + '::' + markType; + var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown'; + + // Chrome has an issue of dropping markers recorded too fast: + // https://bugs.chromium.org/p/chromium/issues/detail?id=640652 + // To work around this, we will not report very small measurements. + // I determined the magic number by tweaking it back and forth. + // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe. + // When the bug is fixed, we can `measure()` unconditionally if we want to. + var timeStamp = performanceNow(); + if (timeStamp - lastMarkTimeStamp > 0.1) { + var measurementName = displayName + ' [' + markType + ']'; + performance.measure(measurementName, markName); + } + + performance.clearMarks(markName); + performance.clearMeasures(measurementName); + } + var ReactDebugTool = { addHook: function (hook) { hooks.push(hook); @@ -8369,11 +8242,13 @@ onBeginLifeCycleTimer: function (debugID, timerType) { checkDebugID(debugID); emitEvent('onBeginLifeCycleTimer', debugID, timerType); + markBegin(debugID, timerType); beginLifeCycleTimer(debugID, timerType); }, onEndLifeCycleTimer: function (debugID, timerType) { checkDebugID(debugID); endLifeCycleTimer(debugID, timerType); + markEnd(debugID, timerType); emitEvent('onEndLifeCycleTimer', debugID, timerType); }, onBeginProcessingChildContext: function () { @@ -8382,9 +8257,9 @@ onEndProcessingChildContext: function () { emitEvent('onEndProcessingChildContext'); }, - onHostOperation: function (debugID, type, payload) { - checkDebugID(debugID); - emitEvent('onHostOperation', debugID, type, payload); + onHostOperation: function (operation) { + checkDebugID(operation.instanceID); + emitEvent('onHostOperation', operation); }, onSetState: function () { emitEvent('onSetState'); @@ -8398,25 +8273,31 @@ checkDebugID(debugID); checkDebugID(parentDebugID, true); emitEvent('onBeforeMountComponent', debugID, element, parentDebugID); + markBegin(debugID, 'mount'); }, onMountComponent: function (debugID) { checkDebugID(debugID); + markEnd(debugID, 'mount'); emitEvent('onMountComponent', debugID); }, onBeforeUpdateComponent: function (debugID, element) { checkDebugID(debugID); emitEvent('onBeforeUpdateComponent', debugID, element); + markBegin(debugID, 'update'); }, onUpdateComponent: function (debugID) { checkDebugID(debugID); + markEnd(debugID, 'update'); emitEvent('onUpdateComponent', debugID); }, onBeforeUnmountComponent: function (debugID) { checkDebugID(debugID); emitEvent('onBeforeUnmountComponent', debugID); + markBegin(debugID, 'unmount'); }, onUnmountComponent: function (debugID) { checkDebugID(debugID); + markEnd(debugID, 'unmount'); emitEvent('onUnmountComponent', debugID); }, onTestEvent: function () { @@ -8430,7 +8311,6 @@ ReactDebugTool.addHook(ReactInvalidSetStateWarningHook); ReactDebugTool.addHook(ReactComponentTreeHook); - ReactDebugTool.addHook(ReactChildrenMutationWarningHook); var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; if (/[?&]react_perf\b/.test(url)) { ReactDebugTool.beginProfiling(); @@ -8451,7 +8331,7 @@ * 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 ReactInvalidSetStateWarningHook + * */ 'use strict'; @@ -8493,7 +8373,7 @@ * 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 ReactHostOperationHistoryHook + * */ 'use strict'; @@ -8501,12 +8381,8 @@ var history = []; var ReactHostOperationHistoryHook = { - onHostOperation: function (debugID, type, payload) { - history.push({ - instanceID: debugID, - type: type, - payload: payload - }); + onHostOperation: function (operation) { + history.push(operation); }, clearHistory: function () { if (ReactHostOperationHistoryHook._preventClearing) { @@ -8525,66 +8401,6 @@ /***/ }, /* 68 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-present, 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 ReactChildrenMutationWarningHook - */ - - 'use strict'; - - var ReactComponentTreeHook = __webpack_require__(30); - - var warning = __webpack_require__(13); - - function handleElement(debugID, element) { - if (element == null) { - return; - } - if (element._shadowChildren === undefined) { - return; - } - if (element._shadowChildren === element.props.children) { - return; - } - var isMutated = false; - if (Array.isArray(element._shadowChildren)) { - if (element._shadowChildren.length === element.props.children.length) { - for (var i = 0; i < element._shadowChildren.length; i++) { - if (element._shadowChildren[i] !== element.props.children[i]) { - isMutated = true; - } - } - } else { - isMutated = true; - } - } - if (!Array.isArray(element._shadowChildren) || isMutated) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Component\'s children should not be mutated.%s', ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - } - } - - var ReactChildrenMutationWarningHook = { - onMountComponent: function (debugID) { - handleElement(debugID, ReactComponentTreeHook.getElement(debugID)); - }, - onUpdateComponent: function (debugID) { - handleElement(debugID, ReactComponentTreeHook.getElement(debugID)); - } - }; - - module.exports = ReactChildrenMutationWarningHook; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }, -/* 69 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -8600,7 +8416,7 @@ * @typechecks */ - var performance = __webpack_require__(70); + var performance = __webpack_require__(69); var performanceNow; @@ -8622,7 +8438,7 @@ module.exports = performanceNow; /***/ }, -/* 70 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8638,7 +8454,7 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(51); + var ExecutionEnvironment = __webpack_require__(50); var performance; @@ -8649,7 +8465,7 @@ module.exports = performance || {}; /***/ }, -/* 71 */ +/* 70 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8660,15 +8476,17 @@ * 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 + * */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); var invariant = __webpack_require__(10); + var OBSERVED_ERROR = {}; + /** * `Transaction` creates a black box that is able to wrap any method such that * certain invariants are maintained before and after the method is invoked @@ -8730,7 +8548,7 @@ * * @class Transaction */ - var Mixin = { + var TransactionImpl = { /** * Sets up this instance so that it is prepared for collecting metrics. Does * so such that this setup method may be used on an instance that is already @@ -8820,10 +8638,10 @@ // OBSERVED_ERROR state before overwriting it with the real return value // of initialize -- if it's still set to OBSERVED_ERROR in the finally // block, it means wrapper.initialize threw. - this.wrapperInitData[i] = Transaction.OBSERVED_ERROR; + this.wrapperInitData[i] = OBSERVED_ERROR; this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; } finally { - if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) { + if (this.wrapperInitData[i] === OBSERVED_ERROR) { // The initializer for wrapper i threw an error; initialize the // remaining wrappers but silence any exceptions from them to ensure // that the first error is the one to bubble up. @@ -8854,7 +8672,7 @@ // close -- if it's still set to true in the finally block, it means // wrapper.close threw. errorThrown = true; - if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) { + if (initData !== OBSERVED_ERROR && wrapper.close) { wrapper.close.call(this, initData); } errorThrown = false; @@ -8873,22 +8691,11 @@ } }; - var Transaction = { - - Mixin: Mixin, - - /** - * Token to look for to determine if an error occurred. - */ - OBSERVED_ERROR: {} - - }; - - module.exports = Transaction; + module.exports = TransactionImpl; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 72 */ +/* 71 */ /***/ function(module, exports) { /** @@ -8899,7 +8706,6 @@ * 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 */ 'use strict'; @@ -8928,7 +8734,7 @@ module.exports = getEventTarget; /***/ }, -/* 73 */ +/* 72 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8939,12 +8745,11 @@ * 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 */ 'use strict'; - var ExecutionEnvironment = __webpack_require__(51); + var ExecutionEnvironment = __webpack_require__(50); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { @@ -8993,7 +8798,7 @@ module.exports = isEventSupported; /***/ }, -/* 74 */ +/* 73 */ /***/ function(module, exports) { /** @@ -9004,7 +8809,6 @@ * 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 * */ @@ -9049,8 +8853,8 @@ module.exports = isTextInputElement; /***/ }, -/* 75 */ -/***/ function(module, exports, __webpack_require__) { +/* 74 */ +/***/ function(module, exports) { /** * Copyright 2013-present, Facebook, Inc. @@ -9060,13 +8864,10 @@ * 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 */ 'use strict'; - var keyOf = __webpack_require__(27); - /** * Module that is injectable into `EventPluginHub`, that specifies a * deterministic ordering of `EventPlugin`s. A convenient way to reason about @@ -9076,12 +8877,13 @@ * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that * preventing default on events is convenient in `SimpleEventPlugin` handlers. */ - var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })]; + + var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; module.exports = DefaultEventPluginOrder; /***/ }, -/* 76 */ +/* 75 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9092,28 +8894,22 @@ * 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 */ 'use strict'; - var EventConstants = __webpack_require__(43); - var EventPropagators = __webpack_require__(44); - var ReactDOMComponentTree = __webpack_require__(38); - var SyntheticMouseEvent = __webpack_require__(77); - - var keyOf = __webpack_require__(27); - - var topLevelTypes = EventConstants.topLevelTypes; + var EventPropagators = __webpack_require__(43); + var ReactDOMComponentTree = __webpack_require__(36); + var SyntheticMouseEvent = __webpack_require__(76); var eventTypes = { mouseEnter: { - registrationName: keyOf({ onMouseEnter: null }), - dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver] + registrationName: 'onMouseEnter', + dependencies: ['topMouseOut', 'topMouseOver'] }, mouseLeave: { - registrationName: keyOf({ onMouseLeave: null }), - dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver] + registrationName: 'onMouseLeave', + dependencies: ['topMouseOut', 'topMouseOver'] } }; @@ -9129,10 +8925,10 @@ * the `mouseover` top-level event. */ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { + if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { return null; } - if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) { + if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') { // Must not be a mouse in or mouse out - ignoring. return null; } @@ -9153,7 +8949,7 @@ var from; var to; - if (topLevelType === topLevelTypes.topMouseOut) { + if (topLevelType === 'topMouseOut') { from = targetInst; var related = nativeEvent.relatedTarget || nativeEvent.toElement; to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null; @@ -9191,7 +8987,7 @@ module.exports = EnterLeaveEventPlugin; /***/ }, -/* 77 */ +/* 76 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9202,15 +8998,14 @@ * 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 */ 'use strict'; - var SyntheticUIEvent = __webpack_require__(78); - var ViewportMetrics = __webpack_require__(79); + var SyntheticUIEvent = __webpack_require__(77); + var ViewportMetrics = __webpack_require__(78); - var getEventModifierState = __webpack_require__(80); + var getEventModifierState = __webpack_require__(79); /** * @interface MouseEvent @@ -9268,7 +9063,7 @@ module.exports = SyntheticMouseEvent; /***/ }, -/* 78 */ +/* 77 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9279,14 +9074,13 @@ * 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 */ 'use strict'; var SyntheticEvent = __webpack_require__(55); - var getEventTarget = __webpack_require__(72); + var getEventTarget = __webpack_require__(71); /** * @interface UIEvent @@ -9332,7 +9126,7 @@ module.exports = SyntheticUIEvent; /***/ }, -/* 79 */ +/* 78 */ /***/ function(module, exports) { /** @@ -9343,7 +9137,6 @@ * 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 */ 'use strict'; @@ -9364,7 +9157,7 @@ module.exports = ViewportMetrics; /***/ }, -/* 80 */ +/* 79 */ /***/ function(module, exports) { /** @@ -9375,7 +9168,6 @@ * 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 */ 'use strict'; @@ -9412,7 +9204,7 @@ module.exports = getEventModifierState; /***/ }, -/* 81 */ +/* 80 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9423,12 +9215,11 @@ * 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 */ 'use strict'; - var DOMProperty = __webpack_require__(39); + var DOMProperty = __webpack_require__(38); var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; @@ -9629,7 +9420,7 @@ module.exports = HTMLDOMPropertyConfig; /***/ }, -/* 82 */ +/* 81 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9640,13 +9431,12 @@ * 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 */ 'use strict'; - var DOMChildrenOperations = __webpack_require__(83); - var ReactDOMIDOperations = __webpack_require__(95); + var DOMChildrenOperations = __webpack_require__(82); + var ReactDOMIDOperations = __webpack_require__(93); /** * Abstracts away all functionality of the reconciler that requires knowledge of @@ -9664,7 +9454,7 @@ module.exports = ReactComponentBrowserEnvironment; /***/ }, -/* 83 */ +/* 82 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -9675,20 +9465,18 @@ * 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 */ 'use strict'; - var DOMLazyTree = __webpack_require__(84); - var Danger = __webpack_require__(90); - var ReactMultiChildUpdateTypes = __webpack_require__(94); - var ReactDOMComponentTree = __webpack_require__(38); + var DOMLazyTree = __webpack_require__(83); + var Danger = __webpack_require__(89); + var ReactDOMComponentTree = __webpack_require__(36); var ReactInstrumentation = __webpack_require__(64); - var createMicrosoftUnsafeLocalFunction = __webpack_require__(87); - var setInnerHTML = __webpack_require__(86); - var setTextContent = __webpack_require__(88); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); + var setInnerHTML = __webpack_require__(85); + var setTextContent = __webpack_require__(87); function getNodeAfter(parentNode, node) { // Special case for text components, which return [open, close] comments @@ -9781,7 +9569,11 @@ } if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, + type: 'replace text', + payload: stringText + }); } } @@ -9790,11 +9582,19 @@ dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) { Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup); if (prevInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onHostOperation(prevInstance._debugID, 'replace with', markup.toString()); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: prevInstance._debugID, + type: 'replace with', + payload: markup.toString() + }); } else { var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node); if (nextInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onHostOperation(nextInstance._debugID, 'mount', markup.toString()); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: nextInstance._debugID, + type: 'mount', + payload: markup.toString() + }); } } }; @@ -9824,34 +9624,54 @@ for (var k = 0; k < updates.length; k++) { var update = updates[k]; switch (update.type) { - case ReactMultiChildUpdateTypes.INSERT_MARKUP: + case 'INSERT_MARKUP': insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode)); if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() }); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'insert child', + payload: { toIndex: update.toIndex, content: update.content.toString() } + }); } break; - case ReactMultiChildUpdateTypes.MOVE_EXISTING: + case 'MOVE_EXISTING': moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode)); if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex }); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'move child', + payload: { fromIndex: update.fromIndex, toIndex: update.toIndex } + }); } break; - case ReactMultiChildUpdateTypes.SET_MARKUP: + case 'SET_MARKUP': setInnerHTML(parentNode, update.content); if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace children', update.content.toString()); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'replace children', + payload: update.content.toString() + }); } break; - case ReactMultiChildUpdateTypes.TEXT_CONTENT: + case 'TEXT_CONTENT': setTextContent(parentNode, update.content); if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace text', update.content.toString()); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'replace text', + payload: update.content.toString() + }); } break; - case ReactMultiChildUpdateTypes.REMOVE_NODE: + case 'REMOVE_NODE': removeChild(parentNode, update.fromNode); if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex }); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: parentNodeDebugID, + type: 'remove child', + payload: { fromIndex: update.fromIndex } + }); } break; } @@ -9864,7 +9684,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 84 */ +/* 83 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9875,16 +9695,15 @@ * 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 DOMLazyTree */ 'use strict'; - var DOMNamespaces = __webpack_require__(85); - var setInnerHTML = __webpack_require__(86); + var DOMNamespaces = __webpack_require__(84); + var setInnerHTML = __webpack_require__(85); - var createMicrosoftUnsafeLocalFunction = __webpack_require__(87); - var setTextContent = __webpack_require__(88); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); + var setTextContent = __webpack_require__(87); var ELEMENT_NODE_TYPE = 1; var DOCUMENT_FRAGMENT_NODE_TYPE = 11; @@ -9987,7 +9806,7 @@ module.exports = DOMLazyTree; /***/ }, -/* 85 */ +/* 84 */ /***/ function(module, exports) { /** @@ -9998,7 +9817,6 @@ * 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 DOMNamespaces */ 'use strict'; @@ -10012,7 +9830,7 @@ module.exports = DOMNamespaces; /***/ }, -/* 86 */ +/* 85 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10023,18 +9841,17 @@ * 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 */ 'use strict'; - var ExecutionEnvironment = __webpack_require__(51); - var DOMNamespaces = __webpack_require__(85); + var ExecutionEnvironment = __webpack_require__(50); + var DOMNamespaces = __webpack_require__(84); var WHITESPACE_TEST = /^[ \r\n\t\f]/; var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; - var createMicrosoftUnsafeLocalFunction = __webpack_require__(87); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); // SVG temp container for IE lacking innerHTML var reusableSVGContainer; @@ -10115,7 +9932,7 @@ module.exports = setInnerHTML; /***/ }, -/* 87 */ +/* 86 */ /***/ function(module, exports) { /** @@ -10126,7 +9943,6 @@ * 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 createMicrosoftUnsafeLocalFunction */ /* globals MSApp */ @@ -10152,7 +9968,7 @@ module.exports = createMicrosoftUnsafeLocalFunction; /***/ }, -/* 88 */ +/* 87 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10163,14 +9979,13 @@ * 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 setTextContent */ 'use strict'; - var ExecutionEnvironment = __webpack_require__(51); - var escapeTextContentForBrowser = __webpack_require__(89); - var setInnerHTML = __webpack_require__(86); + var ExecutionEnvironment = __webpack_require__(50); + var escapeTextContentForBrowser = __webpack_require__(88); + var setInnerHTML = __webpack_require__(85); /** * Set the textContent property of a node, ensuring that whitespace is preserved @@ -10197,6 +10012,10 @@ if (ExecutionEnvironment.canUseDOM) { if (!('textContent' in document.documentElement)) { setTextContent = function (node, text) { + if (node.nodeType === 3) { + node.nodeValue = text; + return; + } setInnerHTML(node, escapeTextContentForBrowser(text)); }; } @@ -10205,7 +10024,7 @@ module.exports = setTextContent; /***/ }, -/* 89 */ +/* 88 */ /***/ function(module, exports) { /** @@ -10241,7 +10060,6 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * @providesModule escapeTextContentForBrowser */ 'use strict'; @@ -10333,7 +10151,7 @@ module.exports = escapeTextContentForBrowser; /***/ }, -/* 90 */ +/* 89 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -10344,17 +10162,16 @@ * 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 */ 'use strict'; - var _prodInvariant = __webpack_require__(9); + var _prodInvariant = __webpack_require__(37); - var DOMLazyTree = __webpack_require__(84); - var ExecutionEnvironment = __webpack_require__(51); + var DOMLazyTree = __webpack_require__(83); + var ExecutionEnvironment = __webpack_require__(50); - var createNodesFromMarkup = __webpack_require__(91); + var createNodesFromMarkup = __webpack_require__(90); var emptyFunction = __webpack_require__(14); var invariant = __webpack_require__(10); @@ -10387,7 +10204,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 91 */ +/* 90 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10405,10 +10222,10 @@ /*eslint-disable fb-www/unsafe-html*/ - var ExecutionEnvironment = __webpack_require__(51); + var ExecutionEnvironment = __webpack_require__(50); - var createArrayFromMixed = __webpack_require__(92); - var getMarkupWrap = __webpack_require__(93); + var createArrayFromMixed = __webpack_require__(91); + var getMarkupWrap = __webpack_require__(92); var invariant = __webpack_require__(10); /** @@ -10476,7 +10293,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 92 */ +/* 91 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10608,7 +10425,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 93 */ +/* 92 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10625,7 +10442,7 @@ /*eslint-disable fb-www/unsafe-html */ - var ExecutionEnvironment = __webpack_require__(51); + var ExecutionEnvironment = __webpack_require__(50); var invariant = __webpack_require__(10); @@ -10708,44 +10525,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 94 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-present, 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 ReactMultiChildUpdateTypes - */ - - 'use strict'; - - var keyMirror = __webpack_require__(25); - - /** - * When a component's children are updated, a series of update configuration - * objects are created in order to batch and serialize the required changes. - * - * Enumerates all the possible types of update configurations. - * - * @internal - */ - var ReactMultiChildUpdateTypes = keyMirror({ - INSERT_MARKUP: null, - MOVE_EXISTING: null, - REMOVE_NODE: null, - SET_MARKUP: null, - TEXT_CONTENT: null - }); - - module.exports = ReactMultiChildUpdateTypes; - -/***/ }, -/* 95 */ +/* 93 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10756,13 +10536,12 @@ * 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 */ 'use strict'; - var DOMChildrenOperations = __webpack_require__(83); - var ReactDOMComponentTree = __webpack_require__(38); + var DOMChildrenOperations = __webpack_require__(82); + var ReactDOMComponentTree = __webpack_require__(36); /** * Operations used to process updates to DOM nodes. @@ -10784,7 +10563,7 @@ module.exports = ReactDOMIDOperations; /***/ }, -/* 96 */ +/* 94 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -10795,44 +10574,40 @@ * 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 */ /* global hasOwnProperty:true */ 'use strict'; - var _prodInvariant = __webpack_require__(9), + var _prodInvariant = __webpack_require__(37), _assign = __webpack_require__(6); - var AutoFocusUtils = __webpack_require__(97); - var CSSPropertyOperations = __webpack_require__(99); - var DOMLazyTree = __webpack_require__(84); - var DOMNamespaces = __webpack_require__(85); - var DOMProperty = __webpack_require__(39); - var DOMPropertyOperations = __webpack_require__(107); - var EventConstants = __webpack_require__(43); - var EventPluginHub = __webpack_require__(45); - var EventPluginRegistry = __webpack_require__(46); - var ReactBrowserEventEmitter = __webpack_require__(109); - var ReactDOMButton = __webpack_require__(112); - var ReactDOMComponentFlags = __webpack_require__(40); - var ReactDOMComponentTree = __webpack_require__(38); - var ReactDOMInput = __webpack_require__(114); - var ReactDOMOption = __webpack_require__(116); - var ReactDOMSelect = __webpack_require__(117); - var ReactDOMTextarea = __webpack_require__(118); + var AutoFocusUtils = __webpack_require__(95); + var CSSPropertyOperations = __webpack_require__(97); + var DOMLazyTree = __webpack_require__(83); + var DOMNamespaces = __webpack_require__(84); + var DOMProperty = __webpack_require__(38); + var DOMPropertyOperations = __webpack_require__(105); + var EventPluginHub = __webpack_require__(44); + var EventPluginRegistry = __webpack_require__(45); + var ReactBrowserEventEmitter = __webpack_require__(107); + var ReactDOMComponentFlags = __webpack_require__(39); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactDOMInput = __webpack_require__(110); + var ReactDOMOption = __webpack_require__(113); + var ReactDOMSelect = __webpack_require__(114); + var ReactDOMTextarea = __webpack_require__(115); var ReactInstrumentation = __webpack_require__(64); - var ReactMultiChild = __webpack_require__(119); - var ReactServerRenderingTransaction = __webpack_require__(131); + var ReactMultiChild = __webpack_require__(116); + var ReactServerRenderingTransaction = __webpack_require__(135); var emptyFunction = __webpack_require__(14); - var escapeTextContentForBrowser = __webpack_require__(89); + var escapeTextContentForBrowser = __webpack_require__(88); var invariant = __webpack_require__(10); - var isEventSupported = __webpack_require__(73); - var keyOf = __webpack_require__(27); - var shallowEqual = __webpack_require__(126); - var validateDOMNesting = __webpack_require__(134); + var isEventSupported = __webpack_require__(72); + var shallowEqual = __webpack_require__(125); + var validateDOMNesting = __webpack_require__(138); var warning = __webpack_require__(13); var Flags = ReactDOMComponentFlags; @@ -10844,8 +10619,8 @@ // For quickly matching children type, to test if can be treated as content. var CONTENT_TYPES = { 'string': true, 'number': true }; - var STYLE = keyOf({ style: null }); - var HTML = keyOf({ __html: null }); + var STYLE = 'style'; + var HTML = '__html'; var RESERVED_PROPS = { children: null, dangerouslySetInnerHTML: null, @@ -11052,7 +10827,7 @@ switch (inst._tag) { case 'iframe': case 'object': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)]; + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)]; break; case 'video': case 'audio': @@ -11061,23 +10836,23 @@ // Create listener for each media event for (var event in mediaEvents) { if (mediaEvents.hasOwnProperty(event)) { - inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node)); + inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node)); } } break; case 'source': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node)]; + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)]; break; case 'img': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)]; + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)]; break; case 'form': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)]; + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)]; break; case 'input': case 'select': case 'textarea': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)]; + inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)]; break; } } @@ -11107,7 +10882,6 @@ 'wbr': true }; - // NOTE: menuitem's close tag should be omitted, but that causes problems. var newlineEatingTags = { 'listing': true, 'pre': true, @@ -11216,9 +10990,6 @@ }; transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); break; - case 'button': - props = ReactDOMButton.getHostProps(this, props, hostParent); - break; case 'input': ReactDOMInput.mountWrapper(this, props, hostParent); props = ReactDOMInput.getHostProps(this, props); @@ -11478,12 +11249,18 @@ } else { var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; var childrenToUse = contentToUse != null ? null : props.children; + // TODO: Validate that text is allowed as a child of this node if (contentToUse != null) { - // TODO: Validate that text is allowed as a child of this node - if (process.env.NODE_ENV !== 'production') { - setAndValidateContentChildDev.call(this, contentToUse); + // Avoid setting textContent when the text is empty. In IE11 setting + // textContent on a text area will cause the placeholder to not + // show within the textarea until it has been focused and blurred again. + // https://github.com/facebook/react/issues/6731#issuecomment-254874553 + if (contentToUse !== '') { + if (process.env.NODE_ENV !== 'production') { + setAndValidateContentChildDev.call(this, contentToUse); + } + DOMLazyTree.queueText(lazyTree, contentToUse); } - DOMLazyTree.queueText(lazyTree, contentToUse); } else if (childrenToUse != null) { var mountImages = this.mountChildren(childrenToUse, transaction, context); for (var i = 0; i < mountImages.length; i++) { @@ -11522,10 +11299,6 @@ var nextProps = this._currentElement.props; switch (this._tag) { - case 'button': - lastProps = ReactDOMButton.getHostProps(this, lastProps); - nextProps = ReactDOMButton.getHostProps(this, nextProps); - break; case 'input': lastProps = ReactDOMInput.getHostProps(this, lastProps); nextProps = ReactDOMInput.getHostProps(this, nextProps); @@ -11796,7 +11569,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 97 */ +/* 95 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11807,14 +11580,13 @@ * 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 AutoFocusUtils */ 'use strict'; - var ReactDOMComponentTree = __webpack_require__(38); + var ReactDOMComponentTree = __webpack_require__(36); - var focusNode = __webpack_require__(98); + var focusNode = __webpack_require__(96); var AutoFocusUtils = { focusDOMComponent: function () { @@ -11825,7 +11597,7 @@ module.exports = AutoFocusUtils; /***/ }, -/* 98 */ +/* 96 */ /***/ function(module, exports) { /** @@ -11856,7 +11628,7 @@ module.exports = focusNode; /***/ }, -/* 99 */ +/* 97 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -11867,19 +11639,18 @@ * 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 */ 'use strict'; - var CSSProperty = __webpack_require__(100); - var ExecutionEnvironment = __webpack_require__(51); + var CSSProperty = __webpack_require__(98); + var ExecutionEnvironment = __webpack_require__(50); var ReactInstrumentation = __webpack_require__(64); - var camelizeStyleName = __webpack_require__(101); - var dangerousStyleValue = __webpack_require__(103); - var hyphenateStyleName = __webpack_require__(104); - var memoizeStringOnly = __webpack_require__(106); + var camelizeStyleName = __webpack_require__(99); + var dangerousStyleValue = __webpack_require__(101); + var hyphenateStyleName = __webpack_require__(102); + var memoizeStringOnly = __webpack_require__(104); var warning = __webpack_require__(13); var processStyleName = memoizeStringOnly(function (styleName) { @@ -12029,7 +11800,11 @@ */ setValueForStyles: function (node, styles, component) { if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(component._debugID, 'update styles', styles); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: component._debugID, + type: 'update styles', + payload: styles + }); } var style = node.style; @@ -12067,7 +11842,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 100 */ +/* 98 */ /***/ function(module, exports) { /** @@ -12078,7 +11853,6 @@ * 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 */ 'use strict'; @@ -12220,7 +11994,7 @@ module.exports = CSSProperty; /***/ }, -/* 101 */ +/* 99 */ /***/ function(module, exports, __webpack_require__) { /** @@ -12236,7 +12010,7 @@ 'use strict'; - var camelize = __webpack_require__(102); + var camelize = __webpack_require__(100); var msPattern = /^-ms-/; @@ -12264,7 +12038,7 @@ module.exports = camelizeStyleName; /***/ }, -/* 102 */ +/* 100 */ /***/ function(module, exports) { "use strict"; @@ -12300,7 +12074,7 @@ module.exports = camelize; /***/ }, -/* 103 */ +/* 101 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -12311,12 +12085,11 @@ * 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 */ 'use strict'; - var CSSProperty = __webpack_require__(100); + var CSSProperty = __webpack_require__(98); var warning = __webpack_require__(13); var isUnitlessNumber = CSSProperty.isUnitlessNumber; @@ -12385,7 +12158,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 104 */ +/* 102 */ /***/ function(module, exports, __webpack_require__) { /** @@ -12401,7 +12174,7 @@ 'use strict'; - var hyphenate = __webpack_require__(105); + var hyphenate = __webpack_require__(103); var msPattern = /^ms-/; @@ -12428,7 +12201,7 @@ module.exports = hyphenateStyleName; /***/ }, -/* 105 */ +/* 103 */ /***/ function(module, exports) { 'use strict'; @@ -12465,7 +12238,7 @@ module.exports = hyphenate; /***/ }, -/* 106 */ +/* 104 */ /***/ function(module, exports) { /** @@ -12499,7 +12272,7 @@ module.exports = memoizeStringOnly; /***/ }, -/* 107 */ +/* 105 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -12510,16 +12283,15 @@ * 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 */ 'use strict'; - var DOMProperty = __webpack_require__(39); - var ReactDOMComponentTree = __webpack_require__(38); + var DOMProperty = __webpack_require__(38); + var ReactDOMComponentTree = __webpack_require__(36); var ReactInstrumentation = __webpack_require__(64); - var quoteAttributeValueForBrowser = __webpack_require__(108); + var quoteAttributeValueForBrowser = __webpack_require__(106); var warning = __webpack_require__(13); var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$'); @@ -12655,7 +12427,11 @@ if (process.env.NODE_ENV !== 'production') { var payload = {}; payload[name] = value; - ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'update attribute', + payload: payload + }); } }, @@ -12672,7 +12448,11 @@ if (process.env.NODE_ENV !== 'production') { var payload = {}; payload[name] = value; - ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'update attribute', + payload: payload + }); } }, @@ -12685,7 +12465,11 @@ deleteValueForAttribute: function (node, name) { node.removeAttribute(name); if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'remove attribute', + payload: name + }); } }, @@ -12716,7 +12500,11 @@ } if (process.env.NODE_ENV !== 'production') { - ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name); + ReactInstrumentation.debugTool.onHostOperation({ + instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, + type: 'remove attribute', + payload: name + }); } } @@ -12726,7 +12514,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 108 */ +/* 106 */ /***/ function(module, exports, __webpack_require__) { /** @@ -12737,12 +12525,11 @@ * 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 quoteAttributeValueForBrowser */ 'use strict'; - var escapeTextContentForBrowser = __webpack_require__(89); + var escapeTextContentForBrowser = __webpack_require__(88); /** * Escapes attribute value to prevent scripting attacks. @@ -12757,7 +12544,7 @@ module.exports = quoteAttributeValueForBrowser; /***/ }, -/* 109 */ +/* 107 */ /***/ function(module, exports, __webpack_require__) { /** @@ -12768,20 +12555,18 @@ * 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 */ 'use strict'; var _assign = __webpack_require__(6); - var EventConstants = __webpack_require__(43); - var EventPluginRegistry = __webpack_require__(46); - var ReactEventEmitterMixin = __webpack_require__(110); - var ViewportMetrics = __webpack_require__(79); + var EventPluginRegistry = __webpack_require__(45); + var ReactEventEmitterMixin = __webpack_require__(108); + var ViewportMetrics = __webpack_require__(78); - var getVendorPrefixedEventName = __webpack_require__(111); - var isEventSupported = __webpack_require__(73); + var getVendorPrefixedEventName = __webpack_require__(109); + var isEventSupported = __webpack_require__(72); /** * Summary of `ReactBrowserEventEmitter` event handling: @@ -12999,42 +12784,41 @@ var isListening = getListeningForDocument(mountAt); var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName]; - var topLevelTypes = EventConstants.topLevelTypes; for (var i = 0; i < dependencies.length; i++) { var dependency = dependencies[i]; if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { - if (dependency === topLevelTypes.topWheel) { + if (dependency === 'topWheel') { if (isEventSupported('wheel')) { - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt); } else if (isEventSupported('mousewheel')) { - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt); } else { // Firefox needs to capture a different mouse scroll event. // @see http://www.quirksmode.org/dom/events/tests/scroll.html - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt); } - } else if (dependency === topLevelTypes.topScroll) { + } else if (dependency === 'topScroll') { if (isEventSupported('scroll', true)) { - ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt); } else { - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); } - } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) { + } else if (dependency === 'topFocus' || dependency === 'topBlur') { if (isEventSupported('focus', true)) { - ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt); - ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt); } else if (isEventSupported('focusin')) { // IE has `focusin` and `focusout` events which bubble. // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt); - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt); } // to make sure blur and focus event listeners are only attached once - isListening[topLevelTypes.topBlur] = true; - isListening[topLevelTypes.topFocus] = true; + isListening.topBlur = true; + isListening.topFocus = true; } else if (topEventMapping.hasOwnProperty(dependency)) { ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt); } @@ -13092,7 +12876,7 @@ module.exports = ReactBrowserEventEmitter; /***/ }, -/* 110 */ +/* 108 */ /***/ function(module, exports, __webpack_require__) { /** @@ -13103,12 +12887,11 @@ * 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 */ 'use strict'; - var EventPluginHub = __webpack_require__(45); + var EventPluginHub = __webpack_require__(44); function runEventQueueInBatch(events) { EventPluginHub.enqueueEvents(events); @@ -13130,7 +12913,7 @@ module.exports = ReactEventEmitterMixin; /***/ }, -/* 111 */ +/* 109 */ /***/ function(module, exports, __webpack_require__) { /** @@ -13141,12 +12924,11 @@ * 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 getVendorPrefixedEventName */ 'use strict'; - var ExecutionEnvironment = __webpack_require__(51); + var ExecutionEnvironment = __webpack_require__(50); /** * Generate a mapping of standard vendor prefixes using the defined style property and event name. @@ -13236,91 +13018,7 @@ module.exports = getVendorPrefixedEventName; /***/ }, -/* 112 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-present, 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 ReactDOMButton - */ - - 'use strict'; - - var DisabledInputUtils = __webpack_require__(113); - - /** - * Implements a