diff --git a/demo/dist/js/bundle.js b/demo/dist/js/bundle.js
index be8147ce..a1799af1 100644
--- a/demo/dist/js/bundle.js
+++ b/demo/dist/js/bundle.js
@@ -42,169 +42,135 @@
/************************************************************************/
/******/ ([
/* 0 */
-/***/ function(module, exports, __webpack_require__) {
+/***/ (function(module, exports, __webpack_require__) {
var React = __webpack_require__(1);
- var ReactDOM = __webpack_require__(158);
- var Demo = __webpack_require__(159);
+ var ReactDOM = __webpack_require__(36);
+ var Demo = __webpack_require__(182);
ReactDOM.render(React.createElement(Demo, null), document.getElementById('demo'));
-/***/ },
+/***/ }),
/* 1 */
-/***/ function(module, exports, __webpack_require__) {
+/***/ (function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(2);
-/***/ },
+/***/ }),
/* 2 */
-/***/ function(module, exports, __webpack_require__) {
+/***/ (function(module, exports, __webpack_require__) {
- /**
- * Copyright 2013-2015, Facebook, Inc.
+ /* 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 React
*/
'use strict';
- var ReactDOM = __webpack_require__(3);
- var ReactDOMServer = __webpack_require__(148);
- var ReactIsomorphic = __webpack_require__(152);
+ var _assign = __webpack_require__(4);
- var assign = __webpack_require__(39);
- var deprecated = __webpack_require__(157);
+ var ReactChildren = __webpack_require__(5);
+ var ReactComponent = __webpack_require__(18);
+ var ReactPureComponent = __webpack_require__(21);
+ var ReactClass = __webpack_require__(22);
+ var ReactDOMFactories = __webpack_require__(24);
+ var ReactElement = __webpack_require__(9);
+ var ReactPropTypes = __webpack_require__(29);
+ var ReactVersion = __webpack_require__(34);
- // `version` will be added here by ReactIsomorphic.
- var React = {};
+ var onlyChild = __webpack_require__(35);
+ var warning = __webpack_require__(11);
- assign(React, ReactIsomorphic);
-
- assign(React, {
- // ReactDOM
- findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
- render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
- unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
+ var createElement = ReactElement.createElement;
+ var createFactory = ReactElement.createFactory;
+ var cloneElement = ReactElement.cloneElement;
- // ReactDOMServer
- renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
- renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
- });
+ if (process.env.NODE_ENV !== 'production') {
+ var canDefineProperty = __webpack_require__(13);
+ var ReactElementValidator = __webpack_require__(25);
+ var didWarnPropTypesDeprecated = false;
+ createElement = ReactElementValidator.createElement;
+ createFactory = ReactElementValidator.createFactory;
+ cloneElement = ReactElementValidator.cloneElement;
+ }
- React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
- React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
+ var __spread = _assign;
- module.exports = React;
+ if (process.env.NODE_ENV !== 'production') {
+ var warned = false;
+ __spread = function () {
+ process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
+ warned = true;
+ return _assign.apply(null, arguments);
+ };
+ }
-/***/ },
-/* 3 */
-/***/ function(module, exports, __webpack_require__) {
+ var React = {
- /* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-2015, 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 ReactDOM
- */
+ // Modern
- /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
+ Children: {
+ map: ReactChildren.map,
+ forEach: ReactChildren.forEach,
+ count: ReactChildren.count,
+ toArray: ReactChildren.toArray,
+ only: onlyChild
+ },
- 'use strict';
+ Component: ReactComponent,
+ PureComponent: ReactPureComponent,
- var ReactCurrentOwner = __webpack_require__(5);
- var ReactDOMTextComponent = __webpack_require__(6);
- var ReactDefaultInjection = __webpack_require__(71);
- var ReactInstanceHandles = __webpack_require__(45);
- var ReactMount = __webpack_require__(28);
- var ReactPerf = __webpack_require__(18);
- var ReactReconciler = __webpack_require__(50);
- var ReactUpdates = __webpack_require__(54);
- var ReactVersion = __webpack_require__(146);
+ createElement: createElement,
+ cloneElement: cloneElement,
+ isValidElement: ReactElement.isValidElement,
- var findDOMNode = __webpack_require__(91);
- var renderSubtreeIntoContainer = __webpack_require__(147);
- var warning = __webpack_require__(25);
+ // Classic
- ReactDefaultInjection.inject();
+ PropTypes: ReactPropTypes,
+ createClass: ReactClass.createClass,
+ createFactory: createFactory,
+ createMixin: function (mixin) {
+ // Currently a noop. Will be used to validate and trace mixins.
+ return mixin;
+ },
- var render = ReactPerf.measure('React', 'render', ReactMount.render);
+ // This looks DOM specific but these are actually isomorphic helpers
+ // since they are just generating DOM strings.
+ DOM: ReactDOMFactories,
- var React = {
- findDOMNode: findDOMNode,
- render: render,
- unmountComponentAtNode: ReactMount.unmountComponentAtNode,
version: ReactVersion,
- /* eslint-disable camelcase */
- unstable_batchedUpdates: ReactUpdates.batchedUpdates,
- unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
+ // Deprecated hook for JSX spread, don't use this for anything.
+ __spread: __spread
};
- // 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({
- CurrentOwner: ReactCurrentOwner,
- InstanceHandles: ReactInstanceHandles,
- Mount: ReactMount,
- Reconciler: ReactReconciler,
- TextComponent: ReactDOMTextComponent
- });
- }
-
+ // TODO: Fix tests so that this deprecation warning doesn't cause failures.
if (process.env.NODE_ENV !== 'production') {
- var ExecutionEnvironment = __webpack_require__(9);
- if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
-
- // First check if devtools is not installed
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
- // If we're in Chrome or Firefox, provide a download link if not installed.
- if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
- console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
- }
- }
-
- // If we're in IE8, check to see if we are in compatibility mode and provide
- // information on preventing compatibility mode
- var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
-
- process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '') : undefined;
-
- 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,
-
- // shams
- Object.create, Object.freeze];
-
- for (var i = 0; i < expectedFeatures.length; i++) {
- if (!expectedFeatures[i]) {
- console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
- break;
+ if (canDefineProperty) {
+ Object.defineProperty(React, 'PropTypes', {
+ get: function () {
+ process.env.NODE_ENV !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0;
+ didWarnPropTypesDeprecated = true;
+ return ReactPropTypes;
}
- }
+ });
}
}
module.exports = React;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
-/***/ },
-/* 4 */
-/***/ function(module, exports) {
+/***/ }),
+/* 3 */
+/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
@@ -376,6 +342,10 @@
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
+ process.prependListener = noop;
+ process.prependOnceListener = noop;
+
+ process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
@@ -388,757 +358,469 @@
process.umask = function() { return 0; };
-/***/ },
-/* 5 */
-/***/ function(module, exports) {
-
- /**
- * Copyright 2013-2015, 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 ReactCurrentOwner
- */
-
- 'use strict';
-
- /**
- * Keeps track of the current owner.
- *
- * The current owner is the component who should own any components that are
- * currently being constructed.
- */
- var ReactCurrentOwner = {
-
- /**
- * @internal
- * @type {ReactComponent}
- */
- current: null
-
- };
-
- module.exports = ReactCurrentOwner;
-
-/***/ },
-/* 6 */
-/***/ function(module, exports, __webpack_require__) {
+/***/ }),
+/* 4 */
+/***/ (function(module, exports) {
- /* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-2015, 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 ReactDOMTextComponent
- * @typechecks static-only
- */
+ /*
+ 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;
- var DOMChildrenOperations = __webpack_require__(7);
- var DOMPropertyOperations = __webpack_require__(22);
- var ReactComponentBrowserEnvironment = __webpack_require__(26);
- var ReactMount = __webpack_require__(28);
+ function toObject(val) {
+ if (val === null || val === undefined) {
+ throw new TypeError('Object.assign cannot be called with null or undefined');
+ }
- var assign = __webpack_require__(39);
- var escapeTextContentForBrowser = __webpack_require__(21);
- var setTextContent = __webpack_require__(20);
- var validateDOMNesting = __webpack_require__(70);
+ return Object(val);
+ }
- /**
- * Text nodes violate a couple assumptions that React makes about components:
- *
- * - When mounting text into the DOM, adjacent text nodes are merged.
- * - Text nodes cannot be assigned a React root ID.
- *
- * This component is used to wrap strings in elements so that they can undergo
- * the same reconciliation that is applied to elements.
- *
- * TODO: Investigate representing React components in the DOM with text nodes.
- *
- * @class ReactDOMTextComponent
- * @extends ReactComponent
- * @internal
- */
- var ReactDOMTextComponent = function (props) {
- // This constructor and its argument is currently used by mocks.
- };
+ function shouldUseNative() {
+ try {
+ if (!Object.assign) {
+ return false;
+ }
- assign(ReactDOMTextComponent.prototype, {
+ // Detect buggy property enumeration order in older V8 versions.
- /**
- * @param {ReactText} text
- * @internal
- */
- construct: function (text) {
- // TODO: This is really a ReactText (ReactNode), not a ReactElement
- this._currentElement = text;
- this._stringText = '' + text;
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
+ test1[5] = 'de';
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
+ return false;
+ }
- // Properties
- this._rootNodeID = null;
- this._mountIndex = 0;
- },
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test2 = {};
+ for (var i = 0; i < 10; i++) {
+ test2['_' + String.fromCharCode(i)] = i;
+ }
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
+ return test2[n];
+ });
+ if (order2.join('') !== '0123456789') {
+ return false;
+ }
- /**
- * Creates the markup for this text node. This node is not intended to have
- * any features besides containing text content.
- *
- * @param {string} rootID DOM ID of the root node.
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @return {string} Markup for this text node.
- * @internal
- */
- mountComponent: function (rootID, transaction, context) {
- if (process.env.NODE_ENV !== 'production') {
- if (context[validateDOMNesting.ancestorInfoContextKey]) {
- validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
- }
- }
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test3 = {};
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
+ test3[letter] = letter;
+ });
+ if (Object.keys(Object.assign({}, test3)).join('') !==
+ 'abcdefghijklmnopqrst') {
+ return false;
+ }
- this._rootNodeID = rootID;
- if (transaction.useCreateElement) {
- var ownerDocument = context[ReactMount.ownerDocumentContextKey];
- var el = ownerDocument.createElement('span');
- DOMPropertyOperations.setAttributeForID(el, rootID);
- // Populate node cache
- ReactMount.getID(el);
- setTextContent(el, this._stringText);
- return el;
- } else {
- var escapedText = escapeTextContentForBrowser(this._stringText);
+ return true;
+ } catch (err) {
+ // We don't expect any of the above to throw, but better to be safe.
+ return false;
+ }
+ }
- if (transaction.renderToStaticMarkup) {
- // Normally we'd wrap this in a `span` for the reasons stated above, but
- // since this is a situation where React won't take over (static pages),
- // we can simply return the text as it is.
- return escapedText;
- }
+ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
+ var from;
+ var to = toObject(target);
+ var symbols;
- return '' + escapedText + '';
- }
- },
+ for (var s = 1; s < arguments.length; s++) {
+ from = Object(arguments[s]);
- /**
- * Updates this component by updating the text content.
- *
- * @param {ReactText} nextText The next text content
- * @param {ReactReconcileTransaction} transaction
- * @internal
- */
- receiveComponent: function (nextText, transaction) {
- if (nextText !== this._currentElement) {
- this._currentElement = nextText;
- var nextStringText = '' + nextText;
- if (nextStringText !== this._stringText) {
- // TODO: Save this as pending props and use performUpdateIfNecessary
- // and/or updateComponent to do the actual update for consistency with
- // other component types?
- this._stringText = nextStringText;
- var node = ReactMount.getNode(this._rootNodeID);
- DOMChildrenOperations.updateTextContent(node, nextStringText);
- }
- }
- },
+ for (var key in from) {
+ if (hasOwnProperty.call(from, key)) {
+ to[key] = from[key];
+ }
+ }
- unmountComponent: function () {
- ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
- }
+ 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]];
+ }
+ }
+ }
+ }
- });
+ return to;
+ };
- module.exports = ReactDOMTextComponent;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
-/***/ },
-/* 7 */
-/***/ function(module, exports, __webpack_require__) {
+/***/ }),
+/* 5 */
+/***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-2015, 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.
*
- * @providesModule DOMChildrenOperations
- * @typechecks static-only
*/
'use strict';
- var Danger = __webpack_require__(8);
- var ReactMultiChildUpdateTypes = __webpack_require__(16);
- var ReactPerf = __webpack_require__(18);
+ var PooledClass = __webpack_require__(6);
+ var ReactElement = __webpack_require__(9);
+
+ var emptyFunction = __webpack_require__(12);
+ var traverseAllChildren = __webpack_require__(15);
- var setInnerHTML = __webpack_require__(19);
- var setTextContent = __webpack_require__(20);
- var invariant = __webpack_require__(13);
+ var twoArgumentPooler = PooledClass.twoArgumentPooler;
+ var fourArgumentPooler = PooledClass.fourArgumentPooler;
+
+ var userProvidedKeyEscapeRegex = /\/+/g;
+ function escapeUserProvidedKey(text) {
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
+ }
/**
- * Inserts `childNode` as a child of `parentNode` at the `index`.
+ * PooledClass representing the bookkeeping associated with performing a child
+ * traversal. Allows avoiding binding callbacks.
*
- * @param {DOMElement} parentNode Parent node in which to insert.
- * @param {DOMElement} childNode Child node to insert.
- * @param {number} index Index at which to insert the child.
- * @internal
+ * @constructor ForEachBookKeeping
+ * @param {!function} forEachFunction Function to perform traversal with.
+ * @param {?*} forEachContext Context to perform context with.
*/
- function insertChildAt(parentNode, childNode, index) {
- // By exploiting arrays returning `undefined` for an undefined index, we can
- // rely exclusively on `insertBefore(node, null)` instead of also using
- // `appendChild(node)`. However, using `undefined` is not allowed by all
- // browsers so we must replace it with `null`.
+ function ForEachBookKeeping(forEachFunction, forEachContext) {
+ this.func = forEachFunction;
+ this.context = forEachContext;
+ this.count = 0;
+ }
+ ForEachBookKeeping.prototype.destructor = function () {
+ this.func = null;
+ this.context = null;
+ this.count = 0;
+ };
+ PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
- // fix render order error in safari
- // IE8 will throw error when index out of list size.
- var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index);
+ function forEachSingleChild(bookKeeping, child, name) {
+ var func = bookKeeping.func,
+ context = bookKeeping.context;
- parentNode.insertBefore(childNode, beforeChild);
+ func.call(context, child, bookKeeping.count++);
}
/**
- * Operations for updating with DOM children.
- */
- var DOMChildrenOperations = {
-
- dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
-
- updateTextContent: setTextContent,
-
- /**
- * Updates a component's children by processing a series of updates. The
- * update configurations are each expected to have a `parentNode` property.
- *
- * @param {array