From 72ecec99ea63435f0ee41680770b0527cef3b024 Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Mon, 19 Jun 2017 16:14:21 +0800 Subject: [PATCH 01/33] disable widget in explanation --- build/perseus-1.js | 4 ++-- src/widgets/explanation-editor.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/perseus-1.js b/build/perseus-1.js index 5915228622..0f0a473f5e 100644 --- a/build/perseus-1.js +++ b/build/perseus-1.js @@ -1,5 +1,5 @@ /*! Perseus | http://github.com/Khan/perseus */ -// commit 604e0e1dae9592e89f5a20d0e03411c63b5b2944 +// commit 96e37a6618a36a761a5d0d45ee22d234ca272d4d // branch react-15 (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Perseus = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o { var newProps = {}; From 689bc9e8d679806ed100be1fa501c23c6ec7e4d1 Mon Sep 17 00:00:00 2001 From: pytseng Date: Mon, 19 Jun 2017 16:24:21 +0800 Subject: [PATCH 02/33] temp commit for merging new origin brench --- src/widgets/image.jsx | 5 +++- src/widgets/radio.jsx | 60 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/src/widgets/image.jsx b/src/widgets/image.jsx index 49a930f68d..f786d1f5dd 100644 --- a/src/widgets/image.jsx +++ b/src/widgets/image.jsx @@ -2,6 +2,7 @@ var React = require("react"); var _ = require("underscore"); var BlurInput = require("react-components/js/blur-input.jsx"); +var FileInput = require("react-components/js/file-input.jsx"); var InfoTip = require("react-components/js/info-tip.jsx"); var Changeable = require("../mixins/changeable.jsx"); @@ -161,6 +162,8 @@ var ImageEditor = React.createClass({
圖片網址:{' '} +

填入圖片的網址。例如,先上傳至 http://imgur.com ,貼上圖片網址 (Direct link)。

@@ -172,7 +175,7 @@ var ImageEditor = React.createClass({
寬度:{' '} + onChange={this.onWidthChange} />

希望圖片顯示的寬度(px),若要調整請先勾選"手動調整寬度"

diff --git a/src/widgets/radio.jsx b/src/widgets/radio.jsx index e08e62aa1d..f11136bf2b 100644 --- a/src/widgets/radio.jsx +++ b/src/widgets/radio.jsx @@ -1,6 +1,7 @@ var React = require('react'); var ReactDOM = require('react-dom'); var classNames = require("classnames"); +var RadioImage = require("./image.jsx").editor; var Changeable = require("../mixins/changeable.jsx"); var ApiClassNames = require("../perseus-api.jsx").ClassNames; @@ -160,6 +161,7 @@ var Radio = React.createClass({ } return { // We need to make a copy, which _.pick does + widgets: , content: , checked: values[i], clue: , @@ -174,7 +176,7 @@ var Radio = React.createClass({ multipleSelect={this.props.multipleSelect} showClues={this.state.showClues} choices={choices.map(function(choice) { - return _.pick(choice, "content", "checked", "clue"); + return _.pick(choice, "content", "checked", "clue", "widgets"); })} onCheckedChange={this.onCheckedChange} />; }, @@ -303,6 +305,7 @@ var RadioEditor = React.createClass({ propTypes: { choices: React.PropTypes.arrayOf(React.PropTypes.shape({ + widgets: React.PropTypes.object, content: React.PropTypes.string, clue: React.PropTypes.string, correct: React.PropTypes.bool @@ -350,11 +353,38 @@ var RadioEditor = React.createClass({ var editor = { if ("content" in newProps) { - this.onContentChange(i, newProps.content); + this.onContentChange(i, newProps.content);} + // if ("widgets" in newProps) { + // this.onWidgetChange(i, newProps.content);} + } + } + />; + var testeditor = { + if ("widgets" in newProps) { + this.onWidgetChange(i, newProps.widgets);} + // if ("widgets" in newProps) { + // this.onWidgetChange(i, newProps.content);} + } + } + />; + var imageEditor = { + if ("content" in newProps) { + this.onImageChange(i, newProps.content); }} } />; @@ -381,6 +411,12 @@ var RadioEditor = React.createClass({
{editor}
+
+ {testeditor} +
+
+ {imageEditor} +
{/* TODO(eater): Remove this condition after clues are fully launched. */} {(!window.KA || window.KA.allowEditingClues) && @@ -447,6 +483,24 @@ var RadioEditor = React.createClass({ this.props.onChange({choices: choices}); }, + onImageChange: function(choiceIndex, newImage) { + var choices = this.props.choices.slice(); + choices[choiceIndex] = _.extend({}, choices[choiceIndex], { + image: newImage + }); + if (newImage ==="") { + delete choices[choiceIndex].clue; + } + this.props.onChange({choices: choices}); + }, + onWidgetChange: function(choiceIndex, newWidget) { + var choices = this.props.choices.slice(); + choices[choiceIndex] = _.extend({}, choices[choiceIndex], { + widgets: newWidget + }); + this.props.onChange({choices: choices}); + }, + onClueChange: function(choiceIndex, newClue) { var choices = this.props.choices.slice(); choices[choiceIndex] = _.extend({}, choices[choiceIndex], { From 6c854906e5c45c98159313eefd5d3b53177d7a35 Mon Sep 17 00:00:00 2001 From: pytseng Date: Tue, 20 Jun 2017 16:55:57 +0800 Subject: [PATCH 03/33] temp --- build/perseus-1.js | 3558 +++++++++++++++++++++++------------------ src/widgets/image.jsx | 1 + src/widgets/radio.jsx | 612 ------- 3 files changed, 1969 insertions(+), 2202 deletions(-) diff --git a/build/perseus-1.js b/build/perseus-1.js index 0f0a473f5e..9b69c93885 100644 --- a/build/perseus-1.js +++ b/build/perseus-1.js @@ -1,5 +1,5 @@ /*! Perseus | http://github.com/Khan/perseus */ -// commit 96e37a6618a36a761a5d0d45ee22d234ca272d4d +// commit c8635f6362ae06c1fac09f9e36b37409b7812519 // branch react-15 (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Perseus = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;oHello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @nosideeffects + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function (Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function (Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function (Constructor, childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); + }, + contextTypes: function (Constructor, contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function (Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function (Constructor, propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function (Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function () {} }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0; + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (process.env.NODE_ENV !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0; + } + + return; + } + + _invariant(typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.'); + _invariant(!isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.'); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name); + + var isInherited = name in Constructor; + _invariant(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name); + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function (newThis) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0; + } else if (!args.length) { + process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0; + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedMixin = { + componentDidMount: function () { + this.__isMounted = true; + }, + componentWillUnmount: function () { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function (newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function () { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component') : void 0; + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function () {}; + _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // 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. + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0; + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if (initialState === undefined && this.getInitialState._isMockFunction) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent'); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedMixin); + mixSpecIntoComponent(Constructor, spec); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (process.env.NODE_ENV !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.'); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0; + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + +}).call(this,require('_process')) +},{"_process":59,"fbjs/lib/emptyObject":24,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"object-assign":58}],14:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -2097,7 +2825,7 @@ function hyphenateProperty(property) { return (0, _hyphenateStyleName2.default)(property); } module.exports = exports['default']; -},{"hyphenate-style-name":38}],14:[function(require,module,exports){ +},{"hyphenate-style-name":39}],15:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -2111,7 +2839,7 @@ function isPrefixedValue(value) { return typeof value === 'string' && regex.test(value); } module.exports = exports['default']; -},{}],15:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ (function (process){ 'use strict'; @@ -2197,7 +2925,7 @@ var EventListener = { module.exports = EventListener; }).call(this,require('_process')) -},{"./emptyFunction":22,"_process":58}],16:[function(require,module,exports){ +},{"./emptyFunction":23,"_process":59}],17:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -2233,7 +2961,7 @@ var ExecutionEnvironment = { }; module.exports = ExecutionEnvironment; -},{}],17:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ "use strict"; /** @@ -2265,7 +2993,7 @@ function camelize(string) { } module.exports = camelize; -},{}],18:[function(require,module,exports){ +},{}],19:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -2305,7 +3033,7 @@ function camelizeStyleName(string) { } module.exports = camelizeStyleName; -},{"./camelize":17}],19:[function(require,module,exports){ +},{"./camelize":18}],20:[function(require,module,exports){ 'use strict'; /** @@ -2345,7 +3073,7 @@ function containsNode(outerNode, innerNode) { } module.exports = containsNode; -},{"./isTextNode":32}],20:[function(require,module,exports){ +},{"./isTextNode":33}],21:[function(require,module,exports){ (function (process){ 'use strict'; @@ -2474,7 +3202,7 @@ function createArrayFromMixed(obj) { module.exports = createArrayFromMixed; }).call(this,require('_process')) -},{"./invariant":30,"_process":58}],21:[function(require,module,exports){ +},{"./invariant":31,"_process":59}],22:[function(require,module,exports){ (function (process){ 'use strict'; @@ -2560,7 +3288,7 @@ function createNodesFromMarkup(markup, handleScript) { module.exports = createNodesFromMarkup; }).call(this,require('_process')) -},{"./ExecutionEnvironment":16,"./createArrayFromMixed":20,"./getMarkupWrap":26,"./invariant":30,"_process":58}],22:[function(require,module,exports){ +},{"./ExecutionEnvironment":17,"./createArrayFromMixed":21,"./getMarkupWrap":27,"./invariant":31,"_process":59}],23:[function(require,module,exports){ "use strict"; /** @@ -2599,7 +3327,7 @@ emptyFunction.thatReturnsArgument = function (arg) { }; module.exports = emptyFunction; -},{}],23:[function(require,module,exports){ +},{}],24:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2013-present, Facebook, Inc. @@ -2621,7 +3349,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = emptyObject; }).call(this,require('_process')) -},{"_process":58}],24:[function(require,module,exports){ +},{"_process":59}],25:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -2648,7 +3376,7 @@ function focusNode(node) { } module.exports = focusNode; -},{}],25:[function(require,module,exports){ +},{}],26:[function(require,module,exports){ 'use strict'; /** @@ -2687,7 +3415,7 @@ function getActiveElement(doc) /*?DOMElement*/{ } module.exports = getActiveElement; -},{}],26:[function(require,module,exports){ +},{}],27:[function(require,module,exports){ (function (process){ 'use strict'; @@ -2784,7 +3512,7 @@ function getMarkupWrap(nodeName) { module.exports = getMarkupWrap; }).call(this,require('_process')) -},{"./ExecutionEnvironment":16,"./invariant":30,"_process":58}],27:[function(require,module,exports){ +},{"./ExecutionEnvironment":17,"./invariant":31,"_process":59}],28:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -2823,7 +3551,7 @@ function getUnboundedScrollPosition(scrollable) { } module.exports = getUnboundedScrollPosition; -},{}],28:[function(require,module,exports){ +},{}],29:[function(require,module,exports){ 'use strict'; /** @@ -2856,7 +3584,7 @@ function hyphenate(string) { } module.exports = hyphenate; -},{}],29:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -2895,7 +3623,7 @@ function hyphenateStyleName(string) { } module.exports = hyphenateStyleName; -},{"./hyphenate":28}],30:[function(require,module,exports){ +},{"./hyphenate":29}],31:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2013-present, Facebook, Inc. @@ -2953,7 +3681,7 @@ function invariant(condition, format, a, b, c, d, e, f) { module.exports = invariant; }).call(this,require('_process')) -},{"_process":58}],31:[function(require,module,exports){ +},{"_process":59}],32:[function(require,module,exports){ 'use strict'; /** @@ -2978,7 +3706,7 @@ function isNode(object) { } module.exports = isNode; -},{}],32:[function(require,module,exports){ +},{}],33:[function(require,module,exports){ 'use strict'; /** @@ -3003,7 +3731,7 @@ function isTextNode(object) { } module.exports = isTextNode; -},{"./isNode":31}],33:[function(require,module,exports){ +},{"./isNode":32}],34:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -3033,7 +3761,7 @@ function memoizeStringOnly(callback) { } module.exports = memoizeStringOnly; -},{}],34:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -3056,7 +3784,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = performance || {}; -},{"./ExecutionEnvironment":16}],35:[function(require,module,exports){ +},{"./ExecutionEnvironment":17}],36:[function(require,module,exports){ 'use strict'; /** @@ -3090,7 +3818,7 @@ if (performance.now) { } module.exports = performanceNow; -},{"./performance":34}],36:[function(require,module,exports){ +},{"./performance":35}],37:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -3158,7 +3886,7 @@ function shallowEqual(objA, objB) { } module.exports = shallowEqual; -},{}],37:[function(require,module,exports){ +},{}],38:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -3227,7 +3955,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = warning; }).call(this,require('_process')) -},{"./emptyFunction":22,"_process":58}],38:[function(require,module,exports){ +},{"./emptyFunction":23,"_process":59}],39:[function(require,module,exports){ 'use strict'; var uppercasePattern = /[A-Z]/g; @@ -3245,7 +3973,7 @@ function hyphenateStyleName(string) { module.exports = hyphenateStyleName; -},{}],39:[function(require,module,exports){ +},{}],40:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3281,8 +4009,9 @@ function createPrefixer(_ref) { // handle nested objects if ((0, _isObject2.default)(value)) { - style[property] = prefixAll(value); + style[property] = prefixAll(value // handle array values + ); } else if (Array.isArray(value)) { var combinedValue = []; @@ -3297,11 +4026,11 @@ function createPrefixer(_ref) { style[property] = combinedValue; } } else { - var _processedValue = (0, _prefixValue2.default)(plugins, property, value, style, prefixMap); + var _processedValue = (0, _prefixValue2.default)(plugins, property, value, style, prefixMap // only modify the value if it was touched // by any plugin to prevent unnecessary mutations - if (_processedValue) { + );if (_processedValue) { style[property] = _processedValue; } @@ -3315,7 +4044,7 @@ function createPrefixer(_ref) { return prefixAll; } module.exports = exports['default']; -},{"../utils/addNewValuesOnly":52,"../utils/isObject":54,"../utils/prefixProperty":55,"../utils/prefixValue":56}],40:[function(require,module,exports){ +},{"../utils/addNewValuesOnly":53,"../utils/isObject":55,"../utils/prefixProperty":56,"../utils/prefixValue":57}],41:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3338,7 +4067,7 @@ function calc(property, value) { } } module.exports = exports['default']; -},{"css-in-js-utils/lib/isPrefixedValue":14}],41:[function(require,module,exports){ +},{"css-in-js-utils/lib/isPrefixedValue":15}],42:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3362,7 +4091,7 @@ function crossFade(property, value) { } } module.exports = exports['default']; -},{"css-in-js-utils/lib/isPrefixedValue":14}],42:[function(require,module,exports){ +},{"css-in-js-utils/lib/isPrefixedValue":15}],43:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3386,7 +4115,7 @@ function cursor(property, value) { } } module.exports = exports['default']; -},{}],43:[function(require,module,exports){ +},{}],44:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3410,7 +4139,7 @@ function filter(property, value) { } } module.exports = exports['default']; -},{"css-in-js-utils/lib/isPrefixedValue":14}],44:[function(require,module,exports){ +},{"css-in-js-utils/lib/isPrefixedValue":15}],45:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3418,17 +4147,17 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = flex; var values = { - flex: true, - 'inline-flex': true + flex: ['-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex'], + 'inline-flex': ['-webkit-inline-box', '-moz-inline-box', '-ms-inline-flexbox', '-webkit-inline-flex', 'inline-flex'] }; function flex(property, value) { if (property === 'display' && values.hasOwnProperty(value)) { - return ['-webkit-box', '-moz-box', '-ms-' + value + 'box', '-webkit-' + value, value]; + return values[value]; } } module.exports = exports['default']; -},{}],45:[function(require,module,exports){ +},{}],46:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3458,7 +4187,7 @@ function flexboxIE(property, value, style) { } } module.exports = exports['default']; -},{}],46:[function(require,module,exports){ +},{}],47:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3498,7 +4227,7 @@ function flexboxOld(property, value, style) { } } module.exports = exports['default']; -},{}],47:[function(require,module,exports){ +},{}],48:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3524,7 +4253,7 @@ function gradient(property, value) { } } module.exports = exports['default']; -},{"css-in-js-utils/lib/isPrefixedValue":14}],48:[function(require,module,exports){ +},{"css-in-js-utils/lib/isPrefixedValue":15}],49:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3548,7 +4277,7 @@ function imageSet(property, value) { } } module.exports = exports['default']; -},{"css-in-js-utils/lib/isPrefixedValue":14}],49:[function(require,module,exports){ +},{"css-in-js-utils/lib/isPrefixedValue":15}],50:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3561,7 +4290,7 @@ function position(property, value) { } } module.exports = exports['default']; -},{}],50:[function(require,module,exports){ +},{}],51:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3595,7 +4324,7 @@ function sizing(property, value) { } } module.exports = exports['default']; -},{}],51:[function(require,module,exports){ +},{}],52:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3665,9 +4394,9 @@ function prefixValue(value, propertyPrefixMap) { function transition(property, value, style, propertyPrefixMap) { // also check for already prefixed transitions if (typeof value === 'string' && properties.hasOwnProperty(property)) { - var outputValue = prefixValue(value, propertyPrefixMap); + var outputValue = prefixValue(value, propertyPrefixMap // if the property is already prefixed - var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) { + );var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) { return !/-moz-|-ms-/.test(val); }).join(','); @@ -3689,7 +4418,7 @@ function transition(property, value, style, propertyPrefixMap) { } } module.exports = exports['default']; -},{"../../utils/capitalizeString":53,"css-in-js-utils/lib/hyphenateProperty":13,"css-in-js-utils/lib/isPrefixedValue":14}],52:[function(require,module,exports){ +},{"../../utils/capitalizeString":54,"css-in-js-utils/lib/hyphenateProperty":14,"css-in-js-utils/lib/isPrefixedValue":15}],53:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3712,7 +4441,7 @@ function addNewValuesOnly(list, values) { } } module.exports = exports["default"]; -},{}],53:[function(require,module,exports){ +},{}],54:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3723,7 +4452,7 @@ function capitalizeString(str) { return str.charAt(0).toUpperCase() + str.slice(1); } module.exports = exports["default"]; -},{}],54:[function(require,module,exports){ +},{}],55:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3734,7 +4463,7 @@ function isObject(value) { return value instanceof Object && !Array.isArray(value); } module.exports = exports["default"]; -},{}],55:[function(require,module,exports){ +},{}],56:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -3757,7 +4486,7 @@ function prefixProperty(prefixProperties, property, style) { } } module.exports = exports['default']; -},{"./capitalizeString":53}],56:[function(require,module,exports){ +},{"./capitalizeString":54}],57:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3766,17 +4495,17 @@ Object.defineProperty(exports, "__esModule", { exports.default = prefixValue; function prefixValue(plugins, property, value, style, metaData) { for (var i = 0, len = plugins.length; i < len; ++i) { - var processedValue = plugins[i](property, value, style, metaData); + var processedValue = plugins[i](property, value, style, metaData // we can stop processing if a value is returned // as all plugin criteria are unique - if (processedValue) { + );if (processedValue) { return processedValue; } } } module.exports = exports["default"]; -},{}],57:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ /* object-assign (c) Sindre Sorhus @@ -3868,7 +4597,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],58:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -4054,7 +4783,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],59:[function(require,module,exports){ +},{}],60:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -4119,7 +4848,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { module.exports = checkPropTypes; }).call(this,require('_process')) -},{"./lib/ReactPropTypesSecret":62,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37}],60:[function(require,module,exports){ +},{"./lib/ReactPropTypesSecret":63,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38}],61:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -4142,7 +4871,7 @@ module.exports = function(isValidElement) { return factory(isValidElement, throwOnDirectAccess); }; -},{"./factoryWithTypeCheckers":61}],61:[function(require,module,exports){ +},{"./factoryWithTypeCheckers":62}],62:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -4466,6 +5195,20 @@ module.exports = function(isValidElement, throwOnDirectAccess) { return emptyFunction.thatReturnsNull; } + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; @@ -4598,6 +5341,9 @@ module.exports = function(isValidElement, throwOnDirectAccess) { // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { @@ -4609,6 +5355,23 @@ module.exports = function(isValidElement, throwOnDirectAccess) { return propType; } + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { @@ -4624,7 +5387,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) { }; }).call(this,require('_process')) -},{"./checkPropTypes":59,"./lib/ReactPropTypesSecret":62,"_process":58,"fbjs/lib/emptyFunction":22,"fbjs/lib/invariant":30,"fbjs/lib/warning":37}],62:[function(require,module,exports){ +},{"./checkPropTypes":60,"./lib/ReactPropTypesSecret":63,"_process":59,"fbjs/lib/emptyFunction":23,"fbjs/lib/invariant":31,"fbjs/lib/warning":38}],63:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -4640,7 +5403,7 @@ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; -},{}],63:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -4994,7 +5757,7 @@ function createReactFragment(object) { module.exports = createReactFragment; }).call(this,require('_process')) -},{"_process":58,"fbjs/lib/emptyFunction":22,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"react":246}],64:[function(require,module,exports){ +},{"_process":59,"fbjs/lib/emptyFunction":23,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"react":249}],65:[function(require,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -5018,7 +5781,7 @@ module.exports = { }, }; -},{"fbjs/lib/shallowEqual":36}],65:[function(require,module,exports){ +},{"fbjs/lib/shallowEqual":37}],66:[function(require,module,exports){ "use strict"; var React = require("react"); @@ -5070,7 +5833,7 @@ var BlurInput = React.createClass({ module.exports = BlurInput; -},{"react":246}],66:[function(require,module,exports){ +},{"react":249}],67:[function(require,module,exports){ 'use strict'; /* ButtonGroup is an aesthetically pleasing group of buttons. @@ -5166,7 +5929,7 @@ var ButtonGroup = React.createClass({ module.exports = ButtonGroup; -},{"./styles.js":70,"aphrodite":75,"react":246,"react-dom":95}],67:[function(require,module,exports){ +},{"./styles.js":72,"aphrodite":77,"react":249,"react-dom":97}],68:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -5254,7 +6017,74 @@ var DragTarget = React.createClass({ module.exports = DragTarget; -},{"react":246}],68:[function(require,module,exports){ +},{"react":249}],69:[function(require,module,exports){ +"use strict"; + +var React = require("react"); + +/* You know when you want to propagate input to a parent... + * but then that parent does something with the input... + * then changing the props of the input... + * on every keystroke... + * so if some input is invalid or incomplete... + * the input gets reset or otherwise effed... + * + * This is the solution. + * + * Enough melodrama. Its an input that only sends changes + * to its parent on blur. + */ +var FileInput = React.createClass({ + displayName: "FileInput", + + propTypes: { + className: React.PropTypes.string, + style: React.PropTypes.any, + value: React.PropTypes.string.isRequired, + onChange: React.PropTypes.func.isRequired + }, + getInitialState: function getInitialState() { + return { value: this.props.value }; + }, + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + this.setState({ value: nextProps.value }); + }, + handleChange: function handleChange(e) { + var file = e.target.files[0]; + var reader = new FileReader(); + var that = this; + reader.onloadend = function () { + // console.log('RESULT', reader.result); + // that.setState({value: reader.result}); + console.log(that); + console.log(that.props); + + that.props.onChange(reader.result); + }; + reader.readAsDataURL(file); + }, + handleBlur: function handleBlur(e) { + // this.props.onChange(e.target.value); + }, + render: function render() { + // var decodedData = window.atob(this.state.value); + // var theFile = "" + debugger; + return React.createElement("input", { + className: this.props.className, + style: this.props.style, + type: "file" + // value={decodedData} + , value: this.state.value, + onChange: this.handleChange, + onBlur: this.handleBlur + }); + } +}); + +module.exports = FileInput; + +},{"react":249}],70:[function(require,module,exports){ 'use strict'; var _require = require("aphrodite"), @@ -5378,7 +6208,7 @@ var InfoTip = React.createClass({ module.exports = InfoTip; -},{"aphrodite":75,"react":246}],69:[function(require,module,exports){ +},{"aphrodite":77,"react":249}],71:[function(require,module,exports){ "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -5875,7 +6705,7 @@ if (typeof module !== "undefined") { undefined.katexA11yRender = render; } -},{}],70:[function(require,module,exports){ +},{}],72:[function(require,module,exports){ 'use strict'; var StyleSheet = require("aphrodite").StyleSheet; @@ -5920,7 +6750,7 @@ module.exports = { button: button }; -},{"aphrodite":75}],71:[function(require,module,exports){ +},{"aphrodite":77}],73:[function(require,module,exports){ "use strict"; /** * For math rendered using KaTex and/or MathJax. Use me like 2x + 3. @@ -6176,7 +7006,7 @@ var TeX = React.createClass({ module.exports = TeX; -},{"./katex-a11y.js":69,"react":246,"react-addons-pure-render-mixin":64,"react-dom":95}],72:[function(require,module,exports){ +},{"./katex-a11y.js":71,"react":249,"react-addons-pure-render-mixin":65,"react-dom":97}],74:[function(require,module,exports){ "use strict"; /** @@ -6393,7 +7223,8 @@ var Tooltip = React.createClass({ horizontalPosition: React.PropTypes.oneOf(Object.keys(HORIZONTAL_CORNERS)), horizontalAlign: React.PropTypes.oneOf(Object.keys(HORIZONTAL_ALIGNMNENTS)), children: React.PropTypes.arrayOf(React.PropTypes.element).isRequired, - targetContainerStyle: React.PropTypes.any }, + targetContainerStyle: React.PropTypes.any // style object + }, getDefaultProps: function getDefaultProps() { return { @@ -6409,7 +7240,8 @@ var Tooltip = React.createClass({ getInitialState: function getInitialState() { return { - height: null }; + height: null // used for offsetting "top" positioned tooltips + }; }, componentDidMount: function componentDidMount() { @@ -6549,7 +7381,7 @@ var Tooltip = React.createClass({ // Sorry. // Apology-Oriented-Programming module.exports = Tooltip; -},{"react":246,"react-dom":95}],73:[function(require,module,exports){ +},{"react":249,"react-dom":97}],75:[function(require,module,exports){ 'use strict'; var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); @@ -6688,7 +7520,7 @@ var makeExports = function makeExports(useImportant, selectorHandlers) { }; module.exports = makeExports; -},{"./inject":76,"./util":77}],74:[function(require,module,exports){ +},{"./inject":78,"./util":79}],76:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { @@ -6974,9 +7806,9 @@ var generateCSSRuleset = function generateCSSRuleset(selector, declarations, str } }; exports.generateCSSRuleset = generateCSSRuleset; -},{"./util":77,"inline-style-prefixer/static":94}],75:[function(require,module,exports){ +},{"./util":79,"inline-style-prefixer/static":96}],77:[function(require,module,exports){ arguments[4][5][0].apply(exports,arguments) -},{"./exports":73,"./generate":74,"dup":5}],76:[function(require,module,exports){ +},{"./exports":75,"./generate":76,"dup":5}],78:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { @@ -7215,7 +8047,7 @@ var injectAndGetClassName = function injectAndGetClassName(useImportant, styleDe return className; }; exports.injectAndGetClassName = injectAndGetClassName; -},{"./generate":74,"./util":77,"asap":10}],77:[function(require,module,exports){ +},{"./generate":76,"./util":79,"asap":10}],79:[function(require,module,exports){ // {K1: V1, K2: V2, ...} -> [[K1, V1], [K2, V2]] 'use strict'; @@ -7458,7 +8290,7 @@ var importantify = function importantify(string) { }); }; exports.importantify = importantify; -},{}],78:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7484,7 +8316,7 @@ function calc(property, value) { } } module.exports = exports['default']; -},{"../../utils/isPrefixedValue":91,"../../utils/joinPrefixedValue":92}],79:[function(require,module,exports){ +},{"../../utils/isPrefixedValue":93,"../../utils/joinPrefixedValue":94}],81:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7511,7 +8343,7 @@ function cursor(property, value) { } } module.exports = exports['default']; -},{"../../utils/joinPrefixedValue":92}],80:[function(require,module,exports){ +},{"../../utils/joinPrefixedValue":94}],82:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7528,7 +8360,7 @@ function flex(property, value) { } } module.exports = exports['default']; -},{}],81:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7561,7 +8393,7 @@ function flexboxIE(property, value) { } } module.exports = exports['default']; -},{}],82:[function(require,module,exports){ +},{}],84:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7598,7 +8430,7 @@ function flexboxOld(property, value) { } } module.exports = exports['default']; -},{}],83:[function(require,module,exports){ +},{}],85:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7624,7 +8456,7 @@ function gradient(property, value) { } } module.exports = exports['default']; -},{"../../utils/isPrefixedValue":91,"../../utils/joinPrefixedValue":92}],84:[function(require,module,exports){ +},{"../../utils/isPrefixedValue":93,"../../utils/joinPrefixedValue":94}],86:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7637,7 +8469,7 @@ function position(property, value) { } } module.exports = exports['default']; -},{}],85:[function(require,module,exports){ +},{}],87:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7674,7 +8506,7 @@ function sizing(property, value) { } } module.exports = exports['default']; -},{"../../utils/joinPrefixedValue":92}],86:[function(require,module,exports){ +},{"../../utils/joinPrefixedValue":94}],88:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7757,7 +8589,7 @@ function prefixValue(value) { return multipleValues.join(','); } module.exports = exports['default']; -},{"../../utils/capitalizeString":89,"../../utils/isPrefixedValue":91,"../prefixProps":88,"hyphenate-style-name":38}],87:[function(require,module,exports){ +},{"../../utils/capitalizeString":91,"../../utils/isPrefixedValue":93,"../prefixProps":90,"hyphenate-style-name":39}],89:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7873,7 +8705,7 @@ function assignStyles(base) { }); } module.exports = exports['default']; -},{"../utils/capitalizeString":89,"../utils/sortPrefixedStyle":93,"./plugins/calc":78,"./plugins/cursor":79,"./plugins/flex":80,"./plugins/flexboxIE":81,"./plugins/flexboxOld":82,"./plugins/gradient":83,"./plugins/position":84,"./plugins/sizing":85,"./plugins/transition":86,"./prefixProps":88}],88:[function(require,module,exports){ +},{"../utils/capitalizeString":91,"../utils/sortPrefixedStyle":95,"./plugins/calc":80,"./plugins/cursor":81,"./plugins/flex":82,"./plugins/flexboxIE":83,"./plugins/flexboxOld":84,"./plugins/gradient":85,"./plugins/position":86,"./plugins/sizing":87,"./plugins/transition":88,"./prefixProps":90}],90:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -7881,7 +8713,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = { "Webkit": { "transform": true, "transformOrigin": true, "transformOriginX": true, "transformOriginY": true, "backfaceVisibility": true, "perspective": true, "perspectiveOrigin": true, "transformStyle": true, "transformOriginZ": true, "animation": true, "animationDelay": true, "animationDirection": true, "animationFillMode": true, "animationDuration": true, "animationIterationCount": true, "animationName": true, "animationPlayState": true, "animationTimingFunction": true, "appearance": true, "userSelect": true, "fontKerning": true, "textEmphasisPosition": true, "textEmphasis": true, "textEmphasisStyle": true, "textEmphasisColor": true, "boxDecorationBreak": true, "clipPath": true, "maskImage": true, "maskMode": true, "maskRepeat": true, "maskPosition": true, "maskClip": true, "maskOrigin": true, "maskSize": true, "maskComposite": true, "mask": true, "maskBorderSource": true, "maskBorderMode": true, "maskBorderSlice": true, "maskBorderWidth": true, "maskBorderOutset": true, "maskBorderRepeat": true, "maskBorder": true, "maskType": true, "textDecorationStyle": true, "textDecorationSkip": true, "textDecorationLine": true, "textDecorationColor": true, "filter": true, "fontFeatureSettings": true, "breakAfter": true, "breakBefore": true, "breakInside": true, "columnCount": true, "columnFill": true, "columnGap": true, "columnRule": true, "columnRuleColor": true, "columnRuleStyle": true, "columnRuleWidth": true, "columns": true, "columnSpan": true, "columnWidth": true, "flex": true, "flexBasis": true, "flexDirection": true, "flexGrow": true, "flexFlow": true, "flexShrink": true, "flexWrap": true, "alignContent": true, "alignItems": true, "alignSelf": true, "justifyContent": true, "order": true, "transition": true, "transitionDelay": true, "transitionDuration": true, "transitionProperty": true, "transitionTimingFunction": true, "backdropFilter": true, "scrollSnapType": true, "scrollSnapPointsX": true, "scrollSnapPointsY": true, "scrollSnapDestination": true, "scrollSnapCoordinate": true, "shapeImageThreshold": true, "shapeImageMargin": true, "shapeImageOutside": true, "hyphens": true, "flowInto": true, "flowFrom": true, "regionFragment": true, "textSizeAdjust": true }, "Moz": { "appearance": true, "userSelect": true, "boxSizing": true, "textAlignLast": true, "textDecorationStyle": true, "textDecorationSkip": true, "textDecorationLine": true, "textDecorationColor": true, "tabSize": true, "hyphens": true, "fontFeatureSettings": true, "breakAfter": true, "breakBefore": true, "breakInside": true, "columnCount": true, "columnFill": true, "columnGap": true, "columnRule": true, "columnRuleColor": true, "columnRuleStyle": true, "columnRuleWidth": true, "columns": true, "columnSpan": true, "columnWidth": true }, "ms": { "flex": true, "flexBasis": false, "flexDirection": true, "flexGrow": false, "flexFlow": true, "flexShrink": false, "flexWrap": true, "alignContent": false, "alignItems": false, "alignSelf": false, "justifyContent": false, "order": false, "transform": true, "transformOrigin": true, "transformOriginX": true, "transformOriginY": true, "userSelect": true, "wrapFlow": true, "wrapThrough": true, "wrapMargin": true, "scrollSnapType": true, "scrollSnapPointsX": true, "scrollSnapPointsY": true, "scrollSnapDestination": true, "scrollSnapCoordinate": true, "touchAction": true, "hyphens": true, "flowInto": true, "flowFrom": true, "breakBefore": true, "breakAfter": true, "breakInside": true, "regionFragment": true, "gridTemplateColumns": true, "gridTemplateRows": true, "gridTemplateAreas": true, "gridTemplate": true, "gridAutoColumns": true, "gridAutoRows": true, "gridAutoFlow": true, "grid": true, "gridRowStart": true, "gridColumnStart": true, "gridRowEnd": true, "gridRow": true, "gridColumn": true, "gridColumnEnd": true, "gridColumnGap": true, "gridRowGap": true, "gridArea": true, "gridGap": true, "textSizeAdjust": true } }; module.exports = exports["default"]; -},{}],89:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -7894,7 +8726,7 @@ exports.default = function (str) { }; module.exports = exports["default"]; -},{}],90:[function(require,module,exports){ +},{}],92:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -7906,7 +8738,7 @@ exports.default = function (property) { }; module.exports = exports["default"]; -},{}],91:[function(require,module,exports){ +},{}],93:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7920,7 +8752,7 @@ exports.default = function (value) { }; module.exports = exports['default']; -},{}],92:[function(require,module,exports){ +},{}],94:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7941,7 +8773,7 @@ exports.default = function (property, value) { }; module.exports = exports['default']; -},{}],93:[function(require,module,exports){ +},{}],95:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7969,15 +8801,15 @@ function sortPrefixedStyle(style) { }, {}); } module.exports = exports['default']; -},{"./isPrefixedProperty":90}],94:[function(require,module,exports){ +},{"./isPrefixedProperty":92}],96:[function(require,module,exports){ module.exports = require('./lib/static/prefixAll') -},{"./lib/static/prefixAll":87}],95:[function(require,module,exports){ +},{"./lib/static/prefixAll":89}],97:[function(require,module,exports){ 'use strict'; module.exports = require('./lib/ReactDOM'); -},{"./lib/ReactDOM":125}],96:[function(require,module,exports){ +},{"./lib/ReactDOM":127}],98:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8051,7 +8883,7 @@ var ARIADOMPropertyConfig = { }; module.exports = ARIADOMPropertyConfig; -},{}],97:[function(require,module,exports){ +},{}],99:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8075,7 +8907,7 @@ var AutoFocusUtils = { }; module.exports = AutoFocusUtils; -},{"./ReactDOMComponentTree":128,"fbjs/lib/focusNode":24}],98:[function(require,module,exports){ +},{"./ReactDOMComponentTree":130,"fbjs/lib/focusNode":25}],100:[function(require,module,exports){ /** * Copyright 2013-present Facebook, Inc. * All rights reserved. @@ -8451,7 +9283,6 @@ function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEv * `composition` event types. */ var BeforeInputEventPlugin = { - eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -8460,7 +9291,7 @@ var BeforeInputEventPlugin = { }; module.exports = BeforeInputEventPlugin; -},{"./EventPropagators":114,"./FallbackCompositionState":115,"./SyntheticCompositionEvent":179,"./SyntheticInputEvent":183,"fbjs/lib/ExecutionEnvironment":16}],99:[function(require,module,exports){ +},{"./EventPropagators":116,"./FallbackCompositionState":117,"./SyntheticCompositionEvent":181,"./SyntheticInputEvent":185,"fbjs/lib/ExecutionEnvironment":17}],101:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8493,7 +9324,13 @@ var isUnitlessNumber = { flexNegative: true, flexOrder: true, gridRow: true, + gridRowEnd: true, + gridRowSpan: true, + gridRowStart: true, gridColumn: true, + gridColumnEnd: true, + gridColumnSpan: true, + gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, @@ -8608,7 +9445,7 @@ var CSSProperty = { }; module.exports = CSSProperty; -},{}],100:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -8687,7 +9524,7 @@ if (process.env.NODE_ENV !== 'production') { } warnedStyleValues[value] = true; - process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0; + process.env.NODE_ENV !== 'production' ? warning(false, "Style property values shouldn't contain a semicolon.%s " + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0; }; var warnStyleValueIsNaN = function (name, value, owner) { @@ -8715,6 +9552,10 @@ if (process.env.NODE_ENV !== 'production') { * @param {ReactDOMComponent} component */ var warnValidStyle = function (name, value, component) { + // Don't warn for CSS variables + if (name.indexOf('--') === 0) { + return; + } var owner; if (component) { owner = component._currentElement._owner; @@ -8737,7 +9578,6 @@ if (process.env.NODE_ENV !== 'production') { * Operations for dealing with CSS properties. */ var CSSPropertyOperations = { - /** * Serializes a mapping of style properties for use as inline styles: * @@ -8798,7 +9638,9 @@ var CSSPropertyOperations = { if (styleName === 'float' || styleName === 'cssFloat') { styleName = styleFloatAccessor; } - if (styleValue) { + if (styleName.indexOf('--') === 0) { + style.setProperty(styleName, styleValue); + } else if (styleValue) { style[styleName] = styleValue; } else { var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName]; @@ -8814,12 +9656,11 @@ var CSSPropertyOperations = { } } } - }; module.exports = CSSPropertyOperations; }).call(this,require('_process')) -},{"./CSSProperty":99,"./ReactInstrumentation":157,"./dangerousStyleValue":196,"_process":58,"fbjs/lib/ExecutionEnvironment":16,"fbjs/lib/camelizeStyleName":18,"fbjs/lib/hyphenateStyleName":29,"fbjs/lib/memoizeStringOnly":33,"fbjs/lib/warning":37}],101:[function(require,module,exports){ +},{"./CSSProperty":101,"./ReactInstrumentation":159,"./dangerousStyleValue":198,"_process":59,"fbjs/lib/ExecutionEnvironment":17,"fbjs/lib/camelizeStyleName":19,"fbjs/lib/hyphenateStyleName":30,"fbjs/lib/memoizeStringOnly":34,"fbjs/lib/warning":38}],103:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -8940,7 +9781,7 @@ var CallbackQueue = function () { module.exports = PooledClass.addPoolingTo(CallbackQueue); }).call(this,require('_process')) -},{"./PooledClass":119,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],102:[function(require,module,exports){ +},{"./PooledClass":121,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],104:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8960,6 +9801,7 @@ var ReactDOMComponentTree = require('./ReactDOMComponentTree'); var ReactUpdates = require('./ReactUpdates'); var SyntheticEvent = require('./SyntheticEvent'); +var inputValueTracking = require('./inputValueTracking'); var getEventTarget = require('./getEventTarget'); var isEventSupported = require('./isEventSupported'); var isTextInputElement = require('./isTextInputElement'); @@ -8974,13 +9816,17 @@ var eventTypes = { } }; +function createAndAccumulateChangeEvent(inst, nativeEvent, target) { + var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, target); + event.type = 'change'; + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; +} /** * For IE shims */ var activeElement = null; var activeElementInst = null; -var activeElementValue = null; -var activeElementValueProp = null; /** * SECTION: handle `change` event @@ -8997,8 +9843,7 @@ if (ExecutionEnvironment.canUseDOM) { } function manualDispatchChangeEvent(nativeEvent) { - var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); - EventPropagators.accumulateTwoPhaseDispatches(event); + var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the // other events and have it go through ReactBrowserEventEmitter. Since it @@ -9034,11 +9879,21 @@ function stopWatchingForChangeEventIE8() { activeElementInst = null; } +function getInstIfValueChanged(targetInst, nativeEvent) { + var updated = inputValueTracking.updateValueIfChanged(targetInst); + var simulated = nativeEvent.simulated === true && ChangeEventPlugin._allowSimulatedPassThrough; + + if (updated || simulated) { + return targetInst; + } +} + function getTargetInstForChangeEvent(topLevelType, targetInst) { if (topLevelType === 'topChange') { return targetInst; } } + function handleEventsForChangeEventIE8(topLevelType, target, targetInst) { if (topLevelType === 'topFocus') { // stopWatching() should be a noop here but we call it just in case we @@ -9057,105 +9912,54 @@ var isInputEventSupported = false; if (ExecutionEnvironment.canUseDOM) { // IE9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events. - // IE10+ fire input events to often, such when a placeholder - // changes or when an input with a placeholder is focused. - isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11); -} -/** - * (For IE <=11) Replacement getter/setter for the `value` property that gets - * set on the active element. - */ -var newValueProp = { - get: function () { - return activeElementValueProp.get.call(this); - }, - set: function (val) { - // Cast to a string so we can do equality checks. - activeElementValue = '' + val; - activeElementValueProp.set.call(this, val); - } -}; + isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9); +} /** - * (For IE <=11) Starts tracking propertychange events on the passed-in element + * (For IE <=9) Starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in JS. */ function startWatchingForValueChange(target, targetInst) { activeElement = target; activeElementInst = targetInst; - activeElementValue = target.value; - activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value'); - - // Not guarded in a canDefineProperty check: IE8 supports defineProperty only - // on DOM elements - Object.defineProperty(activeElement, 'value', newValueProp); - if (activeElement.attachEvent) { - activeElement.attachEvent('onpropertychange', handlePropertyChange); - } else { - activeElement.addEventListener('propertychange', handlePropertyChange, false); - } + activeElement.attachEvent('onpropertychange', handlePropertyChange); } /** - * (For IE <=11) Removes the event listeners from the currently-tracked element, + * (For IE <=9) Removes the event listeners from the currently-tracked element, * if any exists. */ function stopWatchingForValueChange() { if (!activeElement) { return; } - - // delete restores the original property definition - delete activeElement.value; - - if (activeElement.detachEvent) { - activeElement.detachEvent('onpropertychange', handlePropertyChange); - } else { - activeElement.removeEventListener('propertychange', handlePropertyChange, false); - } + activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementInst = null; - activeElementValue = null; - activeElementValueProp = null; } /** - * (For IE <=11) Handles a propertychange event, sending a `change` event if + * (For IE <=9) Handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } - var value = nativeEvent.srcElement.value; - if (value === activeElementValue) { - return; - } - activeElementValue = value; - - manualDispatchChangeEvent(nativeEvent); -} - -/** - * If a `change` event should be fired, returns the target's ID. - */ -function getTargetInstForInputEvent(topLevelType, targetInst) { - 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; + if (getInstIfValueChanged(activeElementInst, nativeEvent)) { + manualDispatchChangeEvent(nativeEvent); } } -function handleEventsForInputEventIE(topLevelType, target, targetInst) { +function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) { 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' - // In IE9-11, propertychange fires for most input events but is buggy and + // In IE9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed @@ -9173,7 +9977,7 @@ function handleEventsForInputEventIE(topLevelType, target, targetInst) { } // For IE8 and IE9. -function getTargetInstForInputEventIE(topLevelType, targetInst) { +function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) { 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. @@ -9185,10 +9989,7 @@ function getTargetInstForInputEventIE(topLevelType, targetInst) { // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). Other input methods (e.g., paste) seem to // fire selectionchange normally. - if (activeElement && activeElement.value !== activeElementValue) { - activeElementValue = activeElement.value; - return activeElementInst; - } + return getInstIfValueChanged(activeElementInst, nativeEvent); } } @@ -9199,12 +10000,19 @@ function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. - return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); } -function getTargetInstForClickEvent(topLevelType, targetInst) { +function getTargetInstForClickEvent(topLevelType, targetInst, nativeEvent) { if (topLevelType === 'topClick') { - return targetInst; + return getInstIfValueChanged(targetInst, nativeEvent); + } +} + +function getTargetInstForInputOrChangeEvent(topLevelType, targetInst, nativeEvent) { + if (topLevelType === 'topInput' || topLevelType === 'topChange') { + return getInstIfValueChanged(targetInst, nativeEvent); } } @@ -9239,9 +10047,11 @@ function handleControlledInputBlur(inst, node) { * - select */ var ChangeEventPlugin = { - eventTypes: eventTypes, + _allowSimulatedPassThrough: true, + _isInputEventSupported: isInputEventSupported, + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window; @@ -9254,21 +10064,19 @@ var ChangeEventPlugin = { } } else if (isTextInputElement(targetNode)) { if (isInputEventSupported) { - getTargetInstFunc = getTargetInstForInputEvent; + getTargetInstFunc = getTargetInstForInputOrChangeEvent; } else { - getTargetInstFunc = getTargetInstForInputEventIE; - handleEventFunc = handleEventsForInputEventIE; + getTargetInstFunc = getTargetInstForInputEventPolyfill; + handleEventFunc = handleEventsForInputEventPolyfill; } } else if (shouldUseClickEvent(targetNode)) { getTargetInstFunc = getTargetInstForClickEvent; } if (getTargetInstFunc) { - var inst = getTargetInstFunc(topLevelType, targetInst); + var inst = getTargetInstFunc(topLevelType, targetInst, nativeEvent); if (inst) { - var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget); - event.type = 'change'; - EventPropagators.accumulateTwoPhaseDispatches(event); + var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget); return event; } } @@ -9282,11 +10090,10 @@ var ChangeEventPlugin = { handleControlledInputBlur(targetInst, targetNode); } } - }; module.exports = ChangeEventPlugin; -},{"./EventPluginHub":111,"./EventPropagators":114,"./ReactDOMComponentTree":128,"./ReactUpdates":172,"./SyntheticEvent":181,"./getEventTarget":204,"./isEventSupported":211,"./isTextInputElement":212,"fbjs/lib/ExecutionEnvironment":16}],103:[function(require,module,exports){ +},{"./EventPluginHub":113,"./EventPropagators":116,"./ReactDOMComponentTree":130,"./ReactUpdates":174,"./SyntheticEvent":183,"./getEventTarget":206,"./inputValueTracking":212,"./isEventSupported":214,"./isTextInputElement":215,"fbjs/lib/ExecutionEnvironment":17}],105:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -9435,7 +10242,6 @@ if (process.env.NODE_ENV !== 'production') { * Operations for updating with DOM children. */ var DOMChildrenOperations = { - dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, replaceDelimitedText: replaceDelimitedText, @@ -9461,7 +10267,10 @@ var DOMChildrenOperations = { ReactInstrumentation.debugTool.onHostOperation({ instanceID: parentNodeDebugID, type: 'insert child', - payload: { toIndex: update.toIndex, content: update.content.toString() } + payload: { + toIndex: update.toIndex, + content: update.content.toString() + } }); } break; @@ -9508,12 +10317,11 @@ var DOMChildrenOperations = { } } } - }; module.exports = DOMChildrenOperations; }).call(this,require('_process')) -},{"./DOMLazyTree":104,"./Danger":108,"./ReactDOMComponentTree":128,"./ReactInstrumentation":157,"./createMicrosoftUnsafeLocalFunction":195,"./setInnerHTML":216,"./setTextContent":217,"_process":58}],104:[function(require,module,exports){ +},{"./DOMLazyTree":106,"./Danger":110,"./ReactDOMComponentTree":130,"./ReactInstrumentation":159,"./createMicrosoftUnsafeLocalFunction":197,"./setInnerHTML":219,"./setTextContent":220,"_process":59}],106:[function(require,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -9631,7 +10439,7 @@ DOMLazyTree.queueHTML = queueHTML; DOMLazyTree.queueText = queueText; module.exports = DOMLazyTree; -},{"./DOMNamespaces":105,"./createMicrosoftUnsafeLocalFunction":195,"./setInnerHTML":216,"./setTextContent":217}],105:[function(require,module,exports){ +},{"./DOMNamespaces":107,"./createMicrosoftUnsafeLocalFunction":197,"./setInnerHTML":219,"./setTextContent":220}],107:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9651,7 +10459,7 @@ var DOMNamespaces = { }; module.exports = DOMNamespaces; -},{}],106:[function(require,module,exports){ +},{}],108:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -9791,7 +10599,6 @@ var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\ * @see http://jsperf.com/key-missing */ var DOMProperty = { - ID_ATTRIBUTE_NAME: 'data-reactid', ROOT_ATTRIBUTE_NAME: 'data-reactroot', @@ -9863,7 +10670,7 @@ var DOMProperty = { module.exports = DOMProperty; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],107:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],109:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -9912,7 +10719,6 @@ function shouldIgnoreValue(propertyInfo, value) { * Operations for dealing with DOM properties. */ var DOMPropertyOperations = { - /** * Creates markup for the ID property. * @@ -10097,12 +10903,11 @@ var DOMPropertyOperations = { }); } } - }; module.exports = DOMPropertyOperations; }).call(this,require('_process')) -},{"./DOMProperty":106,"./ReactDOMComponentTree":128,"./ReactInstrumentation":157,"./quoteAttributeValueForBrowser":213,"_process":58,"fbjs/lib/warning":37}],108:[function(require,module,exports){ +},{"./DOMProperty":108,"./ReactDOMComponentTree":130,"./ReactInstrumentation":159,"./quoteAttributeValueForBrowser":216,"_process":59,"fbjs/lib/warning":38}],110:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -10126,7 +10931,6 @@ var emptyFunction = require('fbjs/lib/emptyFunction'); var invariant = require('fbjs/lib/invariant'); var Danger = { - /** * Replaces a node with a string of markup at its current position within its * parent. The markup must render into a single root node. @@ -10147,12 +10951,11 @@ var Danger = { DOMLazyTree.replaceChildWithTree(oldChild, markup); } } - }; module.exports = Danger; }).call(this,require('_process')) -},{"./DOMLazyTree":104,"./reactProdInvariant":214,"_process":58,"fbjs/lib/ExecutionEnvironment":16,"fbjs/lib/createNodesFromMarkup":21,"fbjs/lib/emptyFunction":22,"fbjs/lib/invariant":30}],109:[function(require,module,exports){ +},{"./DOMLazyTree":106,"./reactProdInvariant":217,"_process":59,"fbjs/lib/ExecutionEnvironment":17,"fbjs/lib/createNodesFromMarkup":22,"fbjs/lib/emptyFunction":23,"fbjs/lib/invariant":31}],111:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -10178,7 +10981,7 @@ module.exports = Danger; var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; module.exports = DefaultEventPluginOrder; -},{}],110:[function(require,module,exports){ +},{}],112:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -10207,7 +11010,6 @@ var eventTypes = { }; var EnterLeaveEventPlugin = { - eventTypes: eventTypes, /** @@ -10274,11 +11076,10 @@ var EnterLeaveEventPlugin = { return [leave, enter]; } - }; module.exports = EnterLeaveEventPlugin; -},{"./EventPropagators":114,"./ReactDOMComponentTree":128,"./SyntheticMouseEvent":185}],111:[function(require,module,exports){ +},{"./EventPropagators":116,"./ReactDOMComponentTree":130,"./SyntheticMouseEvent":187}],113:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -10387,12 +11188,10 @@ function shouldPreventMouseEvent(name, type, props) { * @public */ var EventPluginHub = { - /** * Methods for injecting dependencies. */ injection: { - /** * @param {array} InjectedEventPluginOrder * @public @@ -10403,7 +11202,6 @@ var EventPluginHub = { * @param {object} injectedNamesToPlugins Map from names to plugin modules. */ injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName - }, /** @@ -10553,12 +11351,11 @@ var EventPluginHub = { __getListenerBank: function () { return listenerBank; } - }; module.exports = EventPluginHub; }).call(this,require('_process')) -},{"./EventPluginRegistry":112,"./EventPluginUtils":113,"./ReactErrorUtils":148,"./accumulateInto":192,"./forEachAccumulated":200,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],112:[function(require,module,exports){ +},{"./EventPluginRegistry":114,"./EventPluginUtils":115,"./ReactErrorUtils":150,"./accumulateInto":194,"./forEachAccumulated":202,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],114:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -10670,7 +11467,6 @@ function publishRegistrationName(registrationName, pluginModule, eventName) { * @see {EventPluginHub} */ var EventPluginRegistry = { - /** * Ordered list of injected plugins. */ @@ -10810,12 +11606,11 @@ var EventPluginRegistry = { } } } - }; module.exports = EventPluginRegistry; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],113:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],115:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11043,7 +11838,7 @@ var EventPluginUtils = { module.exports = EventPluginUtils; }).call(this,require('_process')) -},{"./ReactErrorUtils":148,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37}],114:[function(require,module,exports){ +},{"./ReactErrorUtils":150,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38}],116:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11179,7 +11974,7 @@ var EventPropagators = { module.exports = EventPropagators; }).call(this,require('_process')) -},{"./EventPluginHub":111,"./EventPluginUtils":113,"./accumulateInto":192,"./forEachAccumulated":200,"_process":58,"fbjs/lib/warning":37}],115:[function(require,module,exports){ +},{"./EventPluginHub":113,"./EventPluginUtils":115,"./accumulateInto":194,"./forEachAccumulated":202,"_process":59,"fbjs/lib/warning":38}],117:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11274,7 +12069,7 @@ _assign(FallbackCompositionState.prototype, { PooledClass.addPoolingTo(FallbackCompositionState); module.exports = FallbackCompositionState; -},{"./PooledClass":119,"./getTextContentAccessor":208,"object-assign":57}],116:[function(require,module,exports){ +},{"./PooledClass":121,"./getTextContentAccessor":210,"object-assign":58}],118:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11510,7 +12305,7 @@ var HTMLDOMPropertyConfig = { }; module.exports = HTMLDOMPropertyConfig; -},{"./DOMProperty":106}],117:[function(require,module,exports){ +},{"./DOMProperty":108}],119:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11569,7 +12364,7 @@ var KeyEscapeUtils = { }; module.exports = KeyEscapeUtils; -},{}],118:[function(require,module,exports){ +},{}],120:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11595,13 +12390,13 @@ var invariant = require('fbjs/lib/invariant'); var warning = require('fbjs/lib/warning'); var hasReadOnlyValue = { - 'button': true, - 'checkbox': true, - 'image': true, - 'hidden': true, - 'radio': true, - 'reset': true, - 'submit': true + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true }; function _assertSingleLink(inputProps) { @@ -11709,7 +12504,7 @@ var LinkedValueUtils = { module.exports = LinkedValueUtils; }).call(this,require('_process')) -},{"./ReactPropTypesSecret":165,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"prop-types/factory":60,"react/lib/React":223}],119:[function(require,module,exports){ +},{"./ReactPropTypesSecret":167,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"prop-types/factory":61,"react/lib/React":226}],121:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11823,7 +12618,7 @@ var PooledClass = { module.exports = PooledClass; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],120:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],122:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -12001,7 +12796,6 @@ function getListeningForDocument(mountAt) { * @internal */ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { - /** * Injectable event backend */ @@ -12075,14 +12869,12 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt); } } else if (dependency === 'topScroll') { - if (isEventSupported('scroll', true)) { ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt); } else { ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); } } else if (dependency === 'topFocus' || dependency === 'topBlur') { - if (isEventSupported('focus', true)) { ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt); ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt); @@ -12147,11 +12939,10 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { isMonitoringScrollValue = true; } } - }); module.exports = ReactBrowserEventEmitter; -},{"./EventPluginRegistry":112,"./ReactEventEmitterMixin":149,"./ViewportMetrics":191,"./getVendorPrefixedEventName":209,"./isEventSupported":211,"object-assign":57}],121:[function(require,module,exports){ +},{"./EventPluginRegistry":114,"./ReactEventEmitterMixin":151,"./ViewportMetrics":193,"./getVendorPrefixedEventName":211,"./isEventSupported":214,"object-assign":58}],123:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -12214,8 +13005,8 @@ var ReactChildReconciler = { * @return {?object} A set of child instances. * @internal */ - instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots - ) { + instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID) // 0 in production and for roots + { if (nestedChildNodes == null) { return null; } @@ -12241,8 +13032,8 @@ var ReactChildReconciler = { * @return {?object} A new set of child instances. * @internal */ - updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots - ) { + updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) // 0 in production and for roots + { // We currently don't have a way to track moves here but if we use iterators // instead of for..in we can zip the iterators and check if an item has // moved. @@ -12302,12 +13093,11 @@ var ReactChildReconciler = { } } } - }; module.exports = ReactChildReconciler; }).call(this,require('_process')) -},{"./KeyEscapeUtils":117,"./ReactReconciler":167,"./instantiateReactComponent":210,"./shouldUpdateReactComponent":218,"./traverseAllChildren":219,"_process":58,"fbjs/lib/warning":37,"react/lib/ReactComponentTreeHook":227}],122:[function(require,module,exports){ +},{"./KeyEscapeUtils":119,"./ReactReconciler":169,"./instantiateReactComponent":213,"./shouldUpdateReactComponent":221,"./traverseAllChildren":222,"_process":59,"fbjs/lib/warning":38,"react/lib/ReactComponentTreeHook":229}],124:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -12329,15 +13119,13 @@ var ReactDOMIDOperations = require('./ReactDOMIDOperations'); * need for this injection. */ var ReactComponentBrowserEnvironment = { - processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup - }; module.exports = ReactComponentBrowserEnvironment; -},{"./DOMChildrenOperations":103,"./ReactDOMIDOperations":132}],123:[function(require,module,exports){ +},{"./DOMChildrenOperations":105,"./ReactDOMIDOperations":134}],125:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -12359,7 +13147,6 @@ var invariant = require('fbjs/lib/invariant'); var injected = false; var ReactComponentEnvironment = { - /** * Optionally injectable hook for swapping out mount images in the middle of * the tree. @@ -12380,12 +13167,11 @@ var ReactComponentEnvironment = { injected = true; } } - }; module.exports = ReactComponentEnvironment; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],124:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],126:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -12506,7 +13292,6 @@ var nextMountID = 1; * @lends {ReactCompositeComponent.prototype} */ var ReactCompositeComponent = { - /** * Base constructor for all composite component. * @@ -12602,7 +13387,7 @@ var ReactCompositeComponent = { var propsMutated = inst.props !== publicProps; var componentName = Component.displayName || Component.name || 'Component'; - process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0; + process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", componentName, componentName) : void 0; } // These should be set up in the constructor, but as a convenience for @@ -13284,12 +14069,11 @@ var ReactCompositeComponent = { // Stub _instantiateReactComponent: null - }; module.exports = ReactCompositeComponent; }).call(this,require('_process')) -},{"./ReactComponentEnvironment":123,"./ReactErrorUtils":148,"./ReactInstanceMap":156,"./ReactInstrumentation":157,"./ReactNodeTypes":162,"./ReactReconciler":167,"./checkReactTypeSpec":194,"./reactProdInvariant":214,"./shouldUpdateReactComponent":218,"_process":58,"fbjs/lib/emptyObject":23,"fbjs/lib/invariant":30,"fbjs/lib/shallowEqual":36,"fbjs/lib/warning":37,"object-assign":57,"react/lib/React":223,"react/lib/ReactCurrentOwner":228}],125:[function(require,module,exports){ +},{"./ReactComponentEnvironment":125,"./ReactErrorUtils":150,"./ReactInstanceMap":158,"./ReactInstrumentation":159,"./ReactNodeTypes":164,"./ReactReconciler":169,"./checkReactTypeSpec":196,"./reactProdInvariant":217,"./shouldUpdateReactComponent":221,"_process":59,"fbjs/lib/emptyObject":24,"fbjs/lib/invariant":31,"fbjs/lib/shallowEqual":37,"fbjs/lib/warning":38,"object-assign":58,"react/lib/React":226,"react/lib/ReactCurrentOwner":230}],127:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -13328,6 +14112,7 @@ var ReactDOM = { /* eslint-disable camelcase */ unstable_batchedUpdates: ReactUpdates.batchedUpdates, unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer + /* eslint-enable camelcase */ }; // Inject the runtime into a devtools global hook regardless of browser. @@ -13356,7 +14141,6 @@ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVT if (process.env.NODE_ENV !== 'production') { var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment'); 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. @@ -13368,7 +14152,7 @@ if (process.env.NODE_ENV !== 'production') { } var testFunc = function testFn() {}; - process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0; + process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, "It looks like you're using a minified copy of the development build " + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0; // If we're in IE8, check to see if we are in compatibility mode and provide // information on preventing compatibility mode @@ -13402,7 +14186,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactDOM; }).call(this,require('_process')) -},{"./ReactDOMComponentTree":128,"./ReactDOMInvalidARIAHook":134,"./ReactDOMNullInputValuePropHook":135,"./ReactDOMUnknownPropertyHook":142,"./ReactDefaultInjection":145,"./ReactInstrumentation":157,"./ReactMount":160,"./ReactReconciler":167,"./ReactUpdates":172,"./ReactVersion":173,"./findDOMNode":198,"./getHostComponentFromComposite":205,"./renderSubtreeIntoContainer":215,"_process":58,"fbjs/lib/ExecutionEnvironment":16,"fbjs/lib/warning":37}],126:[function(require,module,exports){ +},{"./ReactDOMComponentTree":130,"./ReactDOMInvalidARIAHook":136,"./ReactDOMNullInputValuePropHook":137,"./ReactDOMUnknownPropertyHook":144,"./ReactDefaultInjection":147,"./ReactInstrumentation":159,"./ReactMount":162,"./ReactReconciler":169,"./ReactUpdates":174,"./ReactVersion":175,"./findDOMNode":200,"./getHostComponentFromComposite":207,"./renderSubtreeIntoContainer":218,"_process":59,"fbjs/lib/ExecutionEnvironment":17,"fbjs/lib/warning":38}],128:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -13445,6 +14229,7 @@ var escapeTextContentForBrowser = require('./escapeTextContentForBrowser'); var invariant = require('fbjs/lib/invariant'); var isEventSupported = require('./isEventSupported'); var shallowEqual = require('fbjs/lib/shallowEqual'); +var inputValueTracking = require('./inputValueTracking'); var validateDOMNesting = require('./validateDOMNesting'); var warning = require('fbjs/lib/warning'); @@ -13455,7 +14240,7 @@ var listenTo = ReactBrowserEventEmitter.listenTo; var registrationNameModules = EventPluginRegistry.registrationNameModules; // For quickly matching children type, to test if can be treated as content. -var CONTENT_TYPES = { 'string': true, 'number': true }; +var CONTENT_TYPES = { string: true, number: true }; var STYLE = 'style'; var HTML = '__html'; @@ -13564,7 +14349,7 @@ function enqueuePutListener(inst, registrationName, listener, transaction) { if (process.env.NODE_ENV !== 'production') { // IE8 has no API for event capturing and the `onScroll` event doesn't // bubble. - process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0; + process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), "This browser doesn't support the `onScroll` event") : void 0; } var containerInfo = inst._hostContainerInfo; var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE; @@ -13654,6 +14439,10 @@ var mediaEvents = { topWaiting: 'waiting' }; +function trackInputValue() { + inputValueTracking.track(this); +} + function trapBubbledEventsLocal() { var inst = this; // If a component renders to null or if another component fatals and causes @@ -13669,7 +14458,6 @@ function trapBubbledEventsLocal() { break; case 'video': case 'audio': - inst._wrapperState.listeners = []; // Create listener for each media event for (var event in mediaEvents) { @@ -13703,34 +14491,35 @@ function postUpdateSelectWrapper() { // those special-case tags. var omittedCloseTags = { - 'area': true, - 'base': true, - 'br': true, - 'col': true, - 'embed': true, - 'hr': true, - 'img': true, - 'input': true, - 'keygen': true, - 'link': true, - 'meta': true, - 'param': true, - 'source': true, - 'track': true, - 'wbr': true + area: true, + base: true, + br: true, + col: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + // NOTE: menuitem's close tag should be omitted, but that causes problems. }; var newlineEatingTags = { - 'listing': true, - 'pre': true, - 'textarea': true + listing: true, + pre: true, + textarea: true }; // For HTML, certain tags cannot have children. This has the same purpose as // `omittedCloseTags` except that `menuitem` should still have its closing tag. var voidElementTags = _assign({ - 'menuitem': true + menuitem: true }, omittedCloseTags); // We accept any tag to be rendered but since this gets injected into arbitrary @@ -13794,7 +14583,6 @@ function ReactDOMComponent(element) { ReactDOMComponent.displayName = 'ReactDOMComponent'; ReactDOMComponent.Mixin = { - /** * Generates root tag markup then recurses. This method has side effects and * is not idempotent. @@ -13831,6 +14619,7 @@ ReactDOMComponent.Mixin = { case 'input': ReactDOMInput.mountWrapper(this, props, hostParent); props = ReactDOMInput.getHostProps(this, props); + transaction.getReactMountReady().enqueue(trackInputValue, this); transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); break; case 'option': @@ -13845,6 +14634,7 @@ ReactDOMComponent.Mixin = { case 'textarea': ReactDOMTextarea.mountWrapper(this, props, hostParent); props = ReactDOMTextarea.getHostProps(this, props); + transaction.getReactMountReady().enqueue(trackInputValue, this); transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); break; } @@ -14370,6 +15160,10 @@ ReactDOMComponent.Mixin = { } } break; + case 'input': + case 'textarea': + inputValueTracking.stopTracking(this); + break; case 'html': case 'head': case 'body': @@ -14398,14 +15192,13 @@ ReactDOMComponent.Mixin = { getPublicInstance: function () { return getNode(this); } - }; _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin); module.exports = ReactDOMComponent; }).call(this,require('_process')) -},{"./AutoFocusUtils":97,"./CSSPropertyOperations":100,"./DOMLazyTree":104,"./DOMNamespaces":105,"./DOMProperty":106,"./DOMPropertyOperations":107,"./EventPluginHub":111,"./EventPluginRegistry":112,"./ReactBrowserEventEmitter":120,"./ReactDOMComponentFlags":127,"./ReactDOMComponentTree":128,"./ReactDOMInput":133,"./ReactDOMOption":136,"./ReactDOMSelect":137,"./ReactDOMTextarea":140,"./ReactInstrumentation":157,"./ReactMultiChild":161,"./ReactServerRenderingTransaction":169,"./escapeTextContentForBrowser":197,"./isEventSupported":211,"./reactProdInvariant":214,"./validateDOMNesting":220,"_process":58,"fbjs/lib/emptyFunction":22,"fbjs/lib/invariant":30,"fbjs/lib/shallowEqual":36,"fbjs/lib/warning":37,"object-assign":57}],127:[function(require,module,exports){ +},{"./AutoFocusUtils":99,"./CSSPropertyOperations":102,"./DOMLazyTree":106,"./DOMNamespaces":107,"./DOMProperty":108,"./DOMPropertyOperations":109,"./EventPluginHub":113,"./EventPluginRegistry":114,"./ReactBrowserEventEmitter":122,"./ReactDOMComponentFlags":129,"./ReactDOMComponentTree":130,"./ReactDOMInput":135,"./ReactDOMOption":138,"./ReactDOMSelect":139,"./ReactDOMTextarea":142,"./ReactInstrumentation":159,"./ReactMultiChild":163,"./ReactServerRenderingTransaction":171,"./escapeTextContentForBrowser":199,"./inputValueTracking":212,"./isEventSupported":214,"./reactProdInvariant":217,"./validateDOMNesting":223,"_process":59,"fbjs/lib/emptyFunction":23,"fbjs/lib/invariant":31,"fbjs/lib/shallowEqual":37,"fbjs/lib/warning":38,"object-assign":58}],129:[function(require,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -14423,7 +15216,7 @@ var ReactDOMComponentFlags = { }; module.exports = ReactDOMComponentFlags; -},{}],128:[function(require,module,exports){ +},{}],130:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -14620,7 +15413,7 @@ var ReactDOMComponentTree = { module.exports = ReactDOMComponentTree; }).call(this,require('_process')) -},{"./DOMProperty":106,"./ReactDOMComponentFlags":127,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],129:[function(require,module,exports){ +},{"./DOMProperty":108,"./ReactDOMComponentFlags":129,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],131:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -14655,7 +15448,7 @@ function ReactDOMContainerInfo(topLevelWrapper, node) { module.exports = ReactDOMContainerInfo; }).call(this,require('_process')) -},{"./validateDOMNesting":220,"_process":58}],130:[function(require,module,exports){ +},{"./validateDOMNesting":223,"_process":59}],132:[function(require,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -14715,7 +15508,7 @@ _assign(ReactDOMEmptyComponent.prototype, { }); module.exports = ReactDOMEmptyComponent; -},{"./DOMLazyTree":104,"./ReactDOMComponentTree":128,"object-assign":57}],131:[function(require,module,exports){ +},{"./DOMLazyTree":106,"./ReactDOMComponentTree":130,"object-assign":58}],133:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -14734,7 +15527,7 @@ var ReactDOMFeatureFlags = { }; module.exports = ReactDOMFeatureFlags; -},{}],132:[function(require,module,exports){ +},{}],134:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -14754,7 +15547,6 @@ var ReactDOMComponentTree = require('./ReactDOMComponentTree'); * Operations used to process updates to DOM nodes. */ var ReactDOMIDOperations = { - /** * Updates a component's children by processing a series of updates. * @@ -14768,7 +15560,7 @@ var ReactDOMIDOperations = { }; module.exports = ReactDOMIDOperations; -},{"./DOMChildrenOperations":103,"./ReactDOMComponentTree":128}],133:[function(require,module,exports){ +},{"./DOMChildrenOperations":105,"./ReactDOMComponentTree":130}],135:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -14922,14 +15714,16 @@ var ReactDOMInput = { // Simulate `input.valueAsNumber`. IE9 does not support it var valueAsNumber = parseFloat(node.value, 10) || 0; + if ( + // eslint-disable-next-line + value != valueAsNumber || // eslint-disable-next-line - if (value != valueAsNumber) { + value == valueAsNumber && node.value != value) { // Cast `value` to a string to ensure the value is set correctly. While // browsers typically do this as necessary, jsdom doesn't. node.value = '' + value; } - // eslint-disable-next-line - } else if (value != node.value) { + } else if (node.value !== '' + value) { // Cast `value` to a string to ensure the value is set correctly. While // browsers typically do this as necessary, jsdom doesn't. node.value = '' + value; @@ -15055,7 +15849,7 @@ function _handleChange(event) { module.exports = ReactDOMInput; }).call(this,require('_process')) -},{"./DOMPropertyOperations":107,"./LinkedValueUtils":118,"./ReactDOMComponentTree":128,"./ReactUpdates":172,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"object-assign":57}],134:[function(require,module,exports){ +},{"./DOMPropertyOperations":109,"./LinkedValueUtils":120,"./ReactDOMComponentTree":130,"./ReactUpdates":174,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"object-assign":58}],136:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15150,7 +15944,7 @@ var ReactDOMInvalidARIAHook = { module.exports = ReactDOMInvalidARIAHook; }).call(this,require('_process')) -},{"./DOMProperty":106,"_process":58,"fbjs/lib/warning":37,"react/lib/ReactComponentTreeHook":227}],135:[function(require,module,exports){ +},{"./DOMProperty":108,"_process":59,"fbjs/lib/warning":38,"react/lib/ReactComponentTreeHook":229}],137:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15195,7 +15989,7 @@ var ReactDOMNullInputValuePropHook = { module.exports = ReactDOMNullInputValuePropHook; }).call(this,require('_process')) -},{"_process":58,"fbjs/lib/warning":37,"react/lib/ReactComponentTreeHook":227}],136:[function(require,module,exports){ +},{"_process":59,"fbjs/lib/warning":38,"react/lib/ReactComponentTreeHook":229}],138:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15315,12 +16109,11 @@ var ReactDOMOption = { return hostProps; } - }; module.exports = ReactDOMOption; }).call(this,require('_process')) -},{"./ReactDOMComponentTree":128,"./ReactDOMSelect":137,"_process":58,"fbjs/lib/warning":37,"object-assign":57,"react/lib/React":223}],137:[function(require,module,exports){ +},{"./ReactDOMComponentTree":130,"./ReactDOMSelect":139,"_process":59,"fbjs/lib/warning":38,"object-assign":58,"react/lib/React":226}],139:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15522,7 +16315,7 @@ function _handleChange(event) { module.exports = ReactDOMSelect; }).call(this,require('_process')) -},{"./LinkedValueUtils":118,"./ReactDOMComponentTree":128,"./ReactUpdates":172,"_process":58,"fbjs/lib/warning":37,"object-assign":57}],138:[function(require,module,exports){ +},{"./LinkedValueUtils":120,"./ReactDOMComponentTree":130,"./ReactUpdates":174,"_process":59,"fbjs/lib/warning":38,"object-assign":58}],140:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -15734,7 +16527,7 @@ var ReactDOMSelection = { }; module.exports = ReactDOMSelection; -},{"./getNodeForCharacterOffset":207,"./getTextContentAccessor":208,"fbjs/lib/ExecutionEnvironment":16}],139:[function(require,module,exports){ +},{"./getNodeForCharacterOffset":209,"./getTextContentAccessor":210,"fbjs/lib/ExecutionEnvironment":17}],141:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15790,7 +16583,6 @@ var ReactDOMTextComponent = function (text) { }; _assign(ReactDOMTextComponent.prototype, { - /** * Creates the markup for this text node. This node is not intended to have * any features besides containing text content. @@ -15895,12 +16687,11 @@ _assign(ReactDOMTextComponent.prototype, { this._commentNodes = null; ReactDOMComponentTree.uncacheNode(this); } - }); module.exports = ReactDOMTextComponent; }).call(this,require('_process')) -},{"./DOMChildrenOperations":103,"./DOMLazyTree":104,"./ReactDOMComponentTree":128,"./escapeTextContentForBrowser":197,"./reactProdInvariant":214,"./validateDOMNesting":220,"_process":58,"fbjs/lib/invariant":30,"object-assign":57}],140:[function(require,module,exports){ +},{"./DOMChildrenOperations":105,"./DOMLazyTree":106,"./ReactDOMComponentTree":130,"./escapeTextContentForBrowser":199,"./reactProdInvariant":217,"./validateDOMNesting":223,"_process":59,"fbjs/lib/invariant":31,"object-assign":58}],142:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -16062,7 +16853,7 @@ function _handleChange(event) { module.exports = ReactDOMTextarea; }).call(this,require('_process')) -},{"./LinkedValueUtils":118,"./ReactDOMComponentTree":128,"./ReactUpdates":172,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"object-assign":57}],141:[function(require,module,exports){ +},{"./LinkedValueUtils":120,"./ReactDOMComponentTree":130,"./ReactUpdates":174,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"object-assign":58}],143:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -16200,7 +16991,7 @@ module.exports = { traverseEnterLeave: traverseEnterLeave }; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],142:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],144:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -16314,7 +17105,7 @@ var ReactDOMUnknownPropertyHook = { module.exports = ReactDOMUnknownPropertyHook; }).call(this,require('_process')) -},{"./DOMProperty":106,"./EventPluginRegistry":112,"_process":58,"fbjs/lib/warning":37,"react/lib/ReactComponentTreeHook":227}],143:[function(require,module,exports){ +},{"./DOMProperty":108,"./EventPluginRegistry":114,"_process":59,"fbjs/lib/warning":38,"react/lib/ReactComponentTreeHook":229}],145:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -16544,7 +17335,9 @@ function markEnd(debugID, markType) { } performance.clearMarks(markName); - performance.clearMeasures(measurementName); + if (measurementName) { + performance.clearMeasures(measurementName); + } } var ReactDebugTool = { @@ -16675,7 +17468,7 @@ if (/[?&]react_perf\b/.test(url)) { module.exports = ReactDebugTool; }).call(this,require('_process')) -},{"./ReactHostOperationHistoryHook":153,"./ReactInvalidSetStateWarningHook":158,"_process":58,"fbjs/lib/ExecutionEnvironment":16,"fbjs/lib/performanceNow":35,"fbjs/lib/warning":37,"react/lib/ReactComponentTreeHook":227}],144:[function(require,module,exports){ +},{"./ReactHostOperationHistoryHook":155,"./ReactInvalidSetStateWarningHook":160,"_process":59,"fbjs/lib/ExecutionEnvironment":17,"fbjs/lib/performanceNow":36,"fbjs/lib/warning":38,"react/lib/ReactComponentTreeHook":229}],146:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -16743,7 +17536,7 @@ var ReactDefaultBatchingStrategy = { }; module.exports = ReactDefaultBatchingStrategy; -},{"./ReactUpdates":172,"./Transaction":190,"fbjs/lib/emptyFunction":22,"object-assign":57}],145:[function(require,module,exports){ +},{"./ReactUpdates":174,"./Transaction":192,"fbjs/lib/emptyFunction":23,"object-assign":58}],147:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -16829,7 +17622,7 @@ function inject() { module.exports = { inject: inject }; -},{"./ARIADOMPropertyConfig":96,"./BeforeInputEventPlugin":98,"./ChangeEventPlugin":102,"./DefaultEventPluginOrder":109,"./EnterLeaveEventPlugin":110,"./HTMLDOMPropertyConfig":116,"./ReactComponentBrowserEnvironment":122,"./ReactDOMComponent":126,"./ReactDOMComponentTree":128,"./ReactDOMEmptyComponent":130,"./ReactDOMTextComponent":139,"./ReactDOMTreeTraversal":141,"./ReactDefaultBatchingStrategy":144,"./ReactEventListener":150,"./ReactInjection":154,"./ReactReconcileTransaction":166,"./SVGDOMPropertyConfig":174,"./SelectEventPlugin":175,"./SimpleEventPlugin":176}],146:[function(require,module,exports){ +},{"./ARIADOMPropertyConfig":98,"./BeforeInputEventPlugin":100,"./ChangeEventPlugin":104,"./DefaultEventPluginOrder":111,"./EnterLeaveEventPlugin":112,"./HTMLDOMPropertyConfig":118,"./ReactComponentBrowserEnvironment":124,"./ReactDOMComponent":128,"./ReactDOMComponentTree":130,"./ReactDOMEmptyComponent":132,"./ReactDOMTextComponent":141,"./ReactDOMTreeTraversal":143,"./ReactDefaultBatchingStrategy":146,"./ReactEventListener":152,"./ReactInjection":156,"./ReactReconcileTransaction":168,"./SVGDOMPropertyConfig":176,"./SelectEventPlugin":177,"./SimpleEventPlugin":178}],148:[function(require,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -16849,7 +17642,7 @@ module.exports = { var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; module.exports = REACT_ELEMENT_TYPE; -},{}],147:[function(require,module,exports){ +},{}],149:[function(require,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -16879,7 +17672,7 @@ var ReactEmptyComponent = { ReactEmptyComponent.injection = ReactEmptyComponentInjection; module.exports = ReactEmptyComponent; -},{}],148:[function(require,module,exports){ +},{}],150:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -16957,7 +17750,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactErrorUtils; }).call(this,require('_process')) -},{"_process":58}],149:[function(require,module,exports){ +},{"_process":59}],151:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -16978,7 +17771,6 @@ function runEventQueueInBatch(events) { } var ReactEventEmitterMixin = { - /** * Streams a fired top-level event to `EventPluginHub` where plugins have the * opportunity to create `ReactEvent`s to be dispatched. @@ -16990,7 +17782,7 @@ var ReactEventEmitterMixin = { }; module.exports = ReactEventEmitterMixin; -},{"./EventPluginHub":111}],150:[function(require,module,exports){ +},{"./EventPluginHub":113}],152:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17145,7 +17937,7 @@ var ReactEventListener = { }; module.exports = ReactEventListener; -},{"./PooledClass":119,"./ReactDOMComponentTree":128,"./ReactUpdates":172,"./getEventTarget":204,"fbjs/lib/EventListener":15,"fbjs/lib/ExecutionEnvironment":16,"fbjs/lib/getUnboundedScrollPosition":27,"object-assign":57}],151:[function(require,module,exports){ +},{"./PooledClass":121,"./ReactDOMComponentTree":130,"./ReactUpdates":174,"./getEventTarget":206,"fbjs/lib/EventListener":16,"fbjs/lib/ExecutionEnvironment":17,"fbjs/lib/getUnboundedScrollPosition":28,"object-assign":58}],153:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17167,7 +17959,7 @@ var ReactFeatureFlags = { }; module.exports = ReactFeatureFlags; -},{}],152:[function(require,module,exports){ +},{}],154:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -17237,7 +18029,7 @@ var ReactHostComponent = { module.exports = ReactHostComponent; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],153:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],155:[function(require,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. @@ -17271,7 +18063,7 @@ var ReactHostOperationHistoryHook = { }; module.exports = ReactHostOperationHistoryHook; -},{}],154:[function(require,module,exports){ +},{}],156:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17305,7 +18097,7 @@ var ReactInjection = { }; module.exports = ReactInjection; -},{"./DOMProperty":106,"./EventPluginHub":111,"./EventPluginUtils":113,"./ReactBrowserEventEmitter":120,"./ReactComponentEnvironment":123,"./ReactEmptyComponent":147,"./ReactHostComponent":152,"./ReactUpdates":172}],155:[function(require,module,exports){ +},{"./DOMProperty":108,"./EventPluginHub":113,"./EventPluginUtils":115,"./ReactBrowserEventEmitter":122,"./ReactComponentEnvironment":125,"./ReactEmptyComponent":149,"./ReactHostComponent":154,"./ReactUpdates":174}],157:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17335,7 +18127,6 @@ function isInDocument(node) { * Input selection module for React. */ var ReactInputSelection = { - hasSelectionCapabilities: function (elem) { var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true'); @@ -17429,7 +18220,7 @@ var ReactInputSelection = { }; module.exports = ReactInputSelection; -},{"./ReactDOMSelection":138,"fbjs/lib/containsNode":19,"fbjs/lib/focusNode":24,"fbjs/lib/getActiveElement":25}],156:[function(require,module,exports){ +},{"./ReactDOMSelection":140,"fbjs/lib/containsNode":20,"fbjs/lib/focusNode":25,"fbjs/lib/getActiveElement":26}],158:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17452,7 +18243,6 @@ module.exports = ReactInputSelection; // TODO: Replace this with ES6: var ReactInstanceMap = new Map(); var ReactInstanceMap = { - /** * This API should be called `delete` but we'd have to make sure to always * transform these to strings for IE support. When this transform is fully @@ -17473,11 +18263,10 @@ var ReactInstanceMap = { set: function (key, value) { key._reactInternalInstance = value; } - }; module.exports = ReactInstanceMap; -},{}],157:[function(require,module,exports){ +},{}],159:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -17503,7 +18292,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = { debugTool: debugTool }; }).call(this,require('_process')) -},{"./ReactDebugTool":143,"_process":58}],158:[function(require,module,exports){ +},{"./ReactDebugTool":145,"_process":59}],160:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -17542,7 +18331,7 @@ var ReactInvalidSetStateWarningHook = { module.exports = ReactInvalidSetStateWarningHook; }).call(this,require('_process')) -},{"_process":58,"fbjs/lib/warning":37}],159:[function(require,module,exports){ +},{"_process":59,"fbjs/lib/warning":38}],161:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17592,7 +18381,7 @@ var ReactMarkupChecksum = { }; module.exports = ReactMarkupChecksum; -},{"./adler32":193}],160:[function(require,module,exports){ +},{"./adler32":195}],162:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -17852,7 +18641,6 @@ TopLevelWrapper.isReactTopLevelWrapper = true; * Inside of `container`, the first element rendered is the "reactRoot". */ var ReactMount = { - TopLevelWrapper: TopLevelWrapper, /** @@ -17941,13 +18729,14 @@ var ReactMount = { _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render'); - !React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or
.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or .' : - // Check if it quacks like an element - nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or
.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or .' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0; + !React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or
." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or .' : // Check if it quacks like an element + nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or
." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or .' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0; process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0; - var nextWrappedElement = React.createElement(TopLevelWrapper, { child: nextElement }); + var nextWrappedElement = React.createElement(TopLevelWrapper, { + child: nextElement + }); var nextContext; if (parentComponent) { @@ -18036,7 +18825,7 @@ var ReactMount = { !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0; if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0; } var prevComponent = getTopLevelWrapperInContainer(container); @@ -18049,7 +18838,7 @@ var ReactMount = { var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME); if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0; } return false; @@ -18132,7 +18921,7 @@ var ReactMount = { module.exports = ReactMount; }).call(this,require('_process')) -},{"./DOMLazyTree":104,"./DOMProperty":106,"./ReactBrowserEventEmitter":120,"./ReactDOMComponentTree":128,"./ReactDOMContainerInfo":129,"./ReactDOMFeatureFlags":131,"./ReactFeatureFlags":151,"./ReactInstanceMap":156,"./ReactInstrumentation":157,"./ReactMarkupChecksum":159,"./ReactReconciler":167,"./ReactUpdateQueue":171,"./ReactUpdates":172,"./instantiateReactComponent":210,"./reactProdInvariant":214,"./setInnerHTML":216,"./shouldUpdateReactComponent":218,"_process":58,"fbjs/lib/emptyObject":23,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"react/lib/React":223,"react/lib/ReactCurrentOwner":228}],161:[function(require,module,exports){ +},{"./DOMLazyTree":106,"./DOMProperty":108,"./ReactBrowserEventEmitter":122,"./ReactDOMComponentTree":130,"./ReactDOMContainerInfo":131,"./ReactDOMFeatureFlags":133,"./ReactFeatureFlags":153,"./ReactInstanceMap":158,"./ReactInstrumentation":159,"./ReactMarkupChecksum":161,"./ReactReconciler":169,"./ReactUpdateQueue":173,"./ReactUpdates":174,"./instantiateReactComponent":213,"./reactProdInvariant":217,"./setInnerHTML":219,"./shouldUpdateReactComponent":221,"_process":59,"fbjs/lib/emptyObject":24,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"react/lib/React":226,"react/lib/ReactCurrentOwner":230}],163:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18304,7 +19093,6 @@ if (process.env.NODE_ENV !== 'production') { * @internal */ var ReactMultiChild = { - /** * Provides common functionality for components that must reconcile multiple * children. This is used by `ReactDOMComponent` to mount, update, and @@ -18313,7 +19101,6 @@ var ReactMultiChild = { * @lends {ReactMultiChild.prototype} */ Mixin: { - _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) { if (process.env.NODE_ENV !== 'production') { var selfDebugID = getDebugID(this); @@ -18577,14 +19364,12 @@ var ReactMultiChild = { child._mountIndex = null; return update; } - } - }; module.exports = ReactMultiChild; }).call(this,require('_process')) -},{"./ReactChildReconciler":121,"./ReactComponentEnvironment":123,"./ReactInstanceMap":156,"./ReactInstrumentation":157,"./ReactReconciler":167,"./flattenChildren":199,"./reactProdInvariant":214,"_process":58,"fbjs/lib/emptyFunction":22,"fbjs/lib/invariant":30,"react/lib/ReactCurrentOwner":228}],162:[function(require,module,exports){ +},{"./ReactChildReconciler":123,"./ReactComponentEnvironment":125,"./ReactInstanceMap":158,"./ReactInstrumentation":159,"./ReactReconciler":169,"./flattenChildren":201,"./reactProdInvariant":217,"_process":59,"fbjs/lib/emptyFunction":23,"fbjs/lib/invariant":31,"react/lib/ReactCurrentOwner":230}],164:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18626,7 +19411,7 @@ var ReactNodeTypes = { module.exports = ReactNodeTypes; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"react/lib/React":223}],163:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"react/lib/React":226}],165:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18717,12 +19502,11 @@ var ReactOwner = { owner.detachRef(ref); } } - }; module.exports = ReactOwner; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],164:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],166:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18749,7 +19533,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactPropTypeLocationNames; }).call(this,require('_process')) -},{"_process":58}],165:[function(require,module,exports){ +},{"_process":59}],167:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18766,7 +19550,7 @@ module.exports = ReactPropTypeLocationNames; var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; -},{}],166:[function(require,module,exports){ +},{}],168:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18946,7 +19730,7 @@ PooledClass.addPoolingTo(ReactReconcileTransaction); module.exports = ReactReconcileTransaction; }).call(this,require('_process')) -},{"./CallbackQueue":101,"./PooledClass":119,"./ReactBrowserEventEmitter":120,"./ReactInputSelection":155,"./ReactInstrumentation":157,"./ReactUpdateQueue":171,"./Transaction":190,"_process":58,"object-assign":57}],167:[function(require,module,exports){ +},{"./CallbackQueue":103,"./PooledClass":121,"./ReactBrowserEventEmitter":122,"./ReactInputSelection":157,"./ReactInstrumentation":159,"./ReactUpdateQueue":173,"./Transaction":192,"_process":59,"object-assign":58}],169:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18974,7 +19758,6 @@ function attachRefs() { } var ReactReconciler = { - /** * Initializes the component, renders markup, and registers event listeners. * @@ -18986,8 +19769,8 @@ var ReactReconciler = { * @final * @internal */ - mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots - ) { + mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots + { if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); @@ -19111,12 +19894,11 @@ var ReactReconciler = { } } } - }; module.exports = ReactReconciler; }).call(this,require('_process')) -},{"./ReactInstrumentation":157,"./ReactRef":168,"_process":58,"fbjs/lib/warning":37}],168:[function(require,module,exports){ +},{"./ReactInstrumentation":159,"./ReactRef":170,"_process":59,"fbjs/lib/warning":38}],170:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19205,7 +19987,7 @@ ReactRef.detachRefs = function (instance, element) { }; module.exports = ReactRef; -},{"./ReactOwner":163}],169:[function(require,module,exports){ +},{"./ReactOwner":165}],171:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -19297,7 +20079,7 @@ PooledClass.addPoolingTo(ReactServerRenderingTransaction); module.exports = ReactServerRenderingTransaction; }).call(this,require('_process')) -},{"./PooledClass":119,"./ReactInstrumentation":157,"./ReactServerUpdateQueue":170,"./Transaction":190,"_process":58,"object-assign":57}],170:[function(require,module,exports){ +},{"./PooledClass":121,"./ReactInstrumentation":159,"./ReactServerUpdateQueue":172,"./Transaction":192,"_process":59,"object-assign":58}],172:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -19438,7 +20220,7 @@ var ReactServerUpdateQueue = function () { module.exports = ReactServerUpdateQueue; }).call(this,require('_process')) -},{"./ReactUpdateQueue":171,"_process":58,"fbjs/lib/warning":37}],171:[function(require,module,exports){ +},{"./ReactUpdateQueue":173,"_process":59,"fbjs/lib/warning":38}],173:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -19493,7 +20275,7 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { } if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0; + process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + "within `render` or another component's constructor). Render methods " + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0; } return internalInstance; @@ -19504,7 +20286,6 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { * reconciliation step. */ var ReactUpdateQueue = { - /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. @@ -19671,12 +20452,11 @@ var ReactUpdateQueue = { validateCallback: function (callback, callerName) { !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0; } - }; module.exports = ReactUpdateQueue; }).call(this,require('_process')) -},{"./ReactInstanceMap":156,"./ReactInstrumentation":157,"./ReactUpdates":172,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"react/lib/ReactCurrentOwner":228}],172:[function(require,module,exports){ +},{"./ReactInstanceMap":158,"./ReactInstrumentation":159,"./ReactUpdates":174,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"react/lib/ReactCurrentOwner":230}],174:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -19929,7 +20709,7 @@ var ReactUpdates = { module.exports = ReactUpdates; }).call(this,require('_process')) -},{"./CallbackQueue":101,"./PooledClass":119,"./ReactFeatureFlags":151,"./ReactReconciler":167,"./Transaction":190,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"object-assign":57}],173:[function(require,module,exports){ +},{"./CallbackQueue":103,"./PooledClass":121,"./ReactFeatureFlags":153,"./ReactReconciler":169,"./Transaction":192,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"object-assign":58}],175:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19942,8 +20722,8 @@ module.exports = ReactUpdates; 'use strict'; -module.exports = '15.5.4'; -},{}],174:[function(require,module,exports){ +module.exports = '15.6.0'; +},{}],176:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -20245,7 +21025,7 @@ Object.keys(ATTRS).forEach(function (key) { }); module.exports = SVGDOMPropertyConfig; -},{}],175:[function(require,module,exports){ +},{}],177:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -20371,7 +21151,6 @@ function constructSelectEvent(nativeEvent, nativeEventTarget) { * - Fires after user input. */ var SelectEventPlugin = { - eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -20395,7 +21174,6 @@ var SelectEventPlugin = { activeElementInst = null; lastSelection = null; break; - // Don't fire the event while the user is dragging. This matches the // semantics of the native select event. case 'topMouseDown': @@ -20405,7 +21183,6 @@ var SelectEventPlugin = { case 'topMouseUp': mouseDown = false; return constructSelectEvent(nativeEvent, nativeEventTarget); - // Chrome and IE fire non-standard event when selection is changed (and // sometimes when it hasn't). IE's event fires out of order with respect // to key and input events on deletion, so we discard it. @@ -20436,7 +21213,7 @@ var SelectEventPlugin = { }; module.exports = SelectEventPlugin; -},{"./EventPropagators":114,"./ReactDOMComponentTree":128,"./ReactInputSelection":155,"./SyntheticEvent":181,"./isTextInputElement":212,"fbjs/lib/ExecutionEnvironment":16,"fbjs/lib/getActiveElement":25,"fbjs/lib/shallowEqual":36}],176:[function(require,module,exports){ +},{"./EventPropagators":116,"./ReactDOMComponentTree":130,"./ReactInputSelection":157,"./SyntheticEvent":183,"./isTextInputElement":215,"fbjs/lib/ExecutionEnvironment":17,"fbjs/lib/getActiveElement":26,"fbjs/lib/shallowEqual":37}],178:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -20521,7 +21298,6 @@ function isInteractive(tag) { } var SimpleEventPlugin = { - eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -20661,12 +21437,11 @@ var SimpleEventPlugin = { delete onClickListeners[key]; } } - }; module.exports = SimpleEventPlugin; }).call(this,require('_process')) -},{"./EventPropagators":114,"./ReactDOMComponentTree":128,"./SyntheticAnimationEvent":177,"./SyntheticClipboardEvent":178,"./SyntheticDragEvent":180,"./SyntheticEvent":181,"./SyntheticFocusEvent":182,"./SyntheticKeyboardEvent":184,"./SyntheticMouseEvent":185,"./SyntheticTouchEvent":186,"./SyntheticTransitionEvent":187,"./SyntheticUIEvent":188,"./SyntheticWheelEvent":189,"./getEventCharCode":201,"./reactProdInvariant":214,"_process":58,"fbjs/lib/EventListener":15,"fbjs/lib/emptyFunction":22,"fbjs/lib/invariant":30}],177:[function(require,module,exports){ +},{"./EventPropagators":116,"./ReactDOMComponentTree":130,"./SyntheticAnimationEvent":179,"./SyntheticClipboardEvent":180,"./SyntheticDragEvent":182,"./SyntheticEvent":183,"./SyntheticFocusEvent":184,"./SyntheticKeyboardEvent":186,"./SyntheticMouseEvent":187,"./SyntheticTouchEvent":188,"./SyntheticTransitionEvent":189,"./SyntheticUIEvent":190,"./SyntheticWheelEvent":191,"./getEventCharCode":203,"./reactProdInvariant":217,"_process":59,"fbjs/lib/EventListener":16,"fbjs/lib/emptyFunction":23,"fbjs/lib/invariant":31}],179:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -20705,7 +21480,7 @@ function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, na SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface); module.exports = SyntheticAnimationEvent; -},{"./SyntheticEvent":181}],178:[function(require,module,exports){ +},{"./SyntheticEvent":183}],180:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -20743,7 +21518,7 @@ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, na SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); module.exports = SyntheticClipboardEvent; -},{"./SyntheticEvent":181}],179:[function(require,module,exports){ +},{"./SyntheticEvent":183}],181:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -20779,7 +21554,7 @@ function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); module.exports = SyntheticCompositionEvent; -},{"./SyntheticEvent":181}],180:[function(require,module,exports){ +},{"./SyntheticEvent":183}],182:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -20815,7 +21590,7 @@ function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeE SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); module.exports = SyntheticDragEvent; -},{"./SyntheticMouseEvent":185}],181:[function(require,module,exports){ +},{"./SyntheticMouseEvent":187}],183:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -20921,7 +21696,6 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg } _assign(SyntheticEvent.prototype, { - preventDefault: function () { this.defaultPrevented = true; var event = this.nativeEvent; @@ -20931,8 +21705,8 @@ _assign(SyntheticEvent.prototype, { if (event.preventDefault) { event.preventDefault(); + // eslint-disable-next-line valid-typeof } else if (typeof event.returnValue !== 'unknown') { - // eslint-disable-line valid-typeof event.returnValue = false; } this.isDefaultPrevented = emptyFunction.thatReturnsTrue; @@ -20946,8 +21720,8 @@ _assign(SyntheticEvent.prototype, { if (event.stopPropagation) { event.stopPropagation(); + // eslint-disable-next-line valid-typeof } else if (typeof event.cancelBubble !== 'unknown') { - // eslint-disable-line valid-typeof // The ChangeEventPlugin registers a "propertychange" event for // IE. This event does not support bubbling or cancelling, and // any references to cancelBubble throw "Member not found". A @@ -20996,7 +21770,6 @@ _assign(SyntheticEvent.prototype, { Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); } } - }); SyntheticEvent.Interface = EventInterface; @@ -21012,7 +21785,7 @@ if (process.env.NODE_ENV !== 'production') { return new Proxy(constructor.apply(that, args), { set: function (target, prop, value) { if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) { - process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0; + process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0; didWarnForAddedNewProperty = true; } target[prop] = value; @@ -21081,11 +21854,11 @@ function getPooledWarningPropertyDefinition(propName, getVal) { function warn(action, result) { var warningCondition = false; - process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; + process.env.NODE_ENV !== 'production' ? warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; } } }).call(this,require('_process')) -},{"./PooledClass":119,"_process":58,"fbjs/lib/emptyFunction":22,"fbjs/lib/warning":37,"object-assign":57}],182:[function(require,module,exports){ +},{"./PooledClass":121,"_process":59,"fbjs/lib/emptyFunction":23,"fbjs/lib/warning":38,"object-assign":58}],184:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21121,7 +21894,7 @@ function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); module.exports = SyntheticFocusEvent; -},{"./SyntheticUIEvent":188}],183:[function(require,module,exports){ +},{"./SyntheticUIEvent":190}],185:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21158,7 +21931,7 @@ function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface); module.exports = SyntheticInputEvent; -},{"./SyntheticEvent":181}],184:[function(require,module,exports){ +},{"./SyntheticEvent":183}],186:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21242,7 +22015,7 @@ function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nat SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); module.exports = SyntheticKeyboardEvent; -},{"./SyntheticUIEvent":188,"./getEventCharCode":201,"./getEventKey":202,"./getEventModifierState":203}],185:[function(require,module,exports){ +},{"./SyntheticUIEvent":190,"./getEventCharCode":203,"./getEventKey":204,"./getEventModifierState":205}],187:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21314,7 +22087,7 @@ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; -},{"./SyntheticUIEvent":188,"./ViewportMetrics":191,"./getEventModifierState":203}],186:[function(require,module,exports){ +},{"./SyntheticUIEvent":190,"./ViewportMetrics":193,"./getEventModifierState":205}],188:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21359,7 +22132,7 @@ function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); module.exports = SyntheticTouchEvent; -},{"./SyntheticUIEvent":188,"./getEventModifierState":203}],187:[function(require,module,exports){ +},{"./SyntheticUIEvent":190,"./getEventModifierState":205}],189:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21398,7 +22171,7 @@ function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, n SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface); module.exports = SyntheticTransitionEvent; -},{"./SyntheticEvent":181}],188:[function(require,module,exports){ +},{"./SyntheticEvent":183}],190:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21457,7 +22230,7 @@ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEve SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; -},{"./SyntheticEvent":181,"./getEventTarget":204}],189:[function(require,module,exports){ +},{"./SyntheticEvent":183,"./getEventTarget":206}],191:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21478,15 +22251,12 @@ var SyntheticMouseEvent = require('./SyntheticMouseEvent'); */ var WheelEventInterface = { deltaX: function (event) { - return 'deltaX' in event ? event.deltaX : - // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). + return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; }, deltaY: function (event) { - return 'deltaY' in event ? event.deltaY : - // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). - 'wheelDeltaY' in event ? -event.wheelDeltaY : - // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). + return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). + 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). 'wheelDelta' in event ? -event.wheelDelta : 0; }, deltaZ: null, @@ -21511,7 +22281,7 @@ function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); module.exports = SyntheticWheelEvent; -},{"./SyntheticMouseEvent":185}],190:[function(require,module,exports){ +},{"./SyntheticMouseEvent":187}],192:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -21623,6 +22393,8 @@ var TransactionImpl = { return !!this._isInTransaction; }, + /* eslint-disable space-before-function-paren */ + /** * Executes the function within a safety window. Use this for the top level * methods that result in large amounts of computation/mutations that would @@ -21641,6 +22413,7 @@ var TransactionImpl = { * @return {*} Return value from `method`. */ perform: function (method, scope, a, b, c, d, e, f) { + /* eslint-enable space-before-function-paren */ !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0; var errorThrown; var ret; @@ -21738,7 +22511,7 @@ var TransactionImpl = { module.exports = TransactionImpl; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],191:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],193:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21752,7 +22525,6 @@ module.exports = TransactionImpl; 'use strict'; var ViewportMetrics = { - currentScrollLeft: 0, currentScrollTop: 0, @@ -21761,11 +22533,10 @@ var ViewportMetrics = { ViewportMetrics.currentScrollLeft = scrollPosition.x; ViewportMetrics.currentScrollTop = scrollPosition.y; } - }; module.exports = ViewportMetrics; -},{}],192:[function(require,module,exports){ +},{}],194:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -21825,7 +22596,7 @@ function accumulateInto(current, next) { module.exports = accumulateInto; }).call(this,require('_process')) -},{"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30}],193:[function(require,module,exports){ +},{"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31}],195:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21869,7 +22640,7 @@ function adler32(data) { } module.exports = adler32; -},{}],194:[function(require,module,exports){ +},{}],196:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -21958,7 +22729,7 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element, module.exports = checkReactTypeSpec; }).call(this,require('_process')) -},{"./ReactPropTypeLocationNames":164,"./ReactPropTypesSecret":165,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"react/lib/ReactComponentTreeHook":227}],195:[function(require,module,exports){ +},{"./ReactPropTypeLocationNames":166,"./ReactPropTypesSecret":167,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"react/lib/ReactComponentTreeHook":229}],197:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -21990,7 +22761,7 @@ var createMicrosoftUnsafeLocalFunction = function (func) { }; module.exports = createMicrosoftUnsafeLocalFunction; -},{}],196:[function(require,module,exports){ +},{}],198:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -22071,7 +22842,7 @@ function dangerousStyleValue(name, value, component) { module.exports = dangerousStyleValue; }).call(this,require('_process')) -},{"./CSSProperty":99,"_process":58,"fbjs/lib/warning":37}],197:[function(require,module,exports){ +},{"./CSSProperty":101,"_process":59,"fbjs/lib/warning":38}],199:[function(require,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. @@ -22176,7 +22947,6 @@ function escapeHtml(string) { } // end code copied and modified from escape-html - /** * Escapes text to prevent scripting attacks. * @@ -22194,7 +22964,7 @@ function escapeTextContentForBrowser(text) { } module.exports = escapeTextContentForBrowser; -},{}],198:[function(require,module,exports){ +},{}],200:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -22256,7 +23026,7 @@ function findDOMNode(componentOrElement) { module.exports = findDOMNode; }).call(this,require('_process')) -},{"./ReactDOMComponentTree":128,"./ReactInstanceMap":156,"./getHostComponentFromComposite":205,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"react/lib/ReactCurrentOwner":228}],199:[function(require,module,exports){ +},{"./ReactDOMComponentTree":130,"./ReactInstanceMap":158,"./getHostComponentFromComposite":207,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"react/lib/ReactCurrentOwner":230}],201:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -22334,7 +23104,7 @@ function flattenChildren(children, selfDebugID) { module.exports = flattenChildren; }).call(this,require('_process')) -},{"./KeyEscapeUtils":117,"./traverseAllChildren":219,"_process":58,"fbjs/lib/warning":37,"react/lib/ReactComponentTreeHook":227}],200:[function(require,module,exports){ +},{"./KeyEscapeUtils":119,"./traverseAllChildren":222,"_process":59,"fbjs/lib/warning":38,"react/lib/ReactComponentTreeHook":229}],202:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22365,7 +23135,7 @@ function forEachAccumulated(arr, cb, scope) { } module.exports = forEachAccumulated; -},{}],201:[function(require,module,exports){ +},{}],203:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22415,7 +23185,7 @@ function getEventCharCode(nativeEvent) { } module.exports = getEventCharCode; -},{}],202:[function(require,module,exports){ +},{}],204:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22435,18 +23205,18 @@ var getEventCharCode = require('./getEventCharCode'); * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names */ var normalizeKey = { - 'Esc': 'Escape', - 'Spacebar': ' ', - 'Left': 'ArrowLeft', - 'Up': 'ArrowUp', - 'Right': 'ArrowRight', - 'Down': 'ArrowDown', - 'Del': 'Delete', - 'Win': 'OS', - 'Menu': 'ContextMenu', - 'Apps': 'ContextMenu', - 'Scroll': 'ScrollLock', - 'MozPrintableKey': 'Unidentified' + Esc: 'Escape', + Spacebar: ' ', + Left: 'ArrowLeft', + Up: 'ArrowUp', + Right: 'ArrowRight', + Down: 'ArrowDown', + Del: 'Delete', + Win: 'OS', + Menu: 'ContextMenu', + Apps: 'ContextMenu', + Scroll: 'ScrollLock', + MozPrintableKey: 'Unidentified' }; /** @@ -22476,8 +23246,18 @@ var translateToKey = { 40: 'ArrowDown', 45: 'Insert', 46: 'Delete', - 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6', - 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12', + 112: 'F1', + 113: 'F2', + 114: 'F3', + 115: 'F4', + 116: 'F5', + 117: 'F6', + 118: 'F7', + 119: 'F8', + 120: 'F9', + 121: 'F10', + 122: 'F11', + 123: 'F12', 144: 'NumLock', 145: 'ScrollLock', 224: 'Meta' @@ -22517,7 +23297,7 @@ function getEventKey(nativeEvent) { } module.exports = getEventKey; -},{"./getEventCharCode":201}],203:[function(require,module,exports){ +},{"./getEventCharCode":203}],205:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22536,10 +23316,10 @@ module.exports = getEventKey; */ var modifierKeyToProp = { - 'Alt': 'altKey', - 'Control': 'ctrlKey', - 'Meta': 'metaKey', - 'Shift': 'shiftKey' + Alt: 'altKey', + Control: 'ctrlKey', + Meta: 'metaKey', + Shift: 'shiftKey' }; // IE8 does not implement getModifierState so we simply map it to the only @@ -22560,7 +23340,7 @@ function getEventModifierState(nativeEvent) { } module.exports = getEventModifierState; -},{}],204:[function(require,module,exports){ +},{}],206:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22595,7 +23375,7 @@ function getEventTarget(nativeEvent) { } module.exports = getEventTarget; -},{}],205:[function(require,module,exports){ +},{}],207:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22625,7 +23405,7 @@ function getHostComponentFromComposite(inst) { } module.exports = getHostComponentFromComposite; -},{"./ReactNodeTypes":162}],206:[function(require,module,exports){ +},{"./ReactNodeTypes":164}],208:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22666,7 +23446,7 @@ function getIteratorFn(maybeIterable) { } module.exports = getIteratorFn; -},{}],207:[function(require,module,exports){ +},{}],209:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22740,7 +23520,7 @@ function getNodeForCharacterOffset(root, offset) { } module.exports = getNodeForCharacterOffset; -},{}],208:[function(require,module,exports){ +},{}],210:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22773,7 +23553,7 @@ function getTextContentAccessor() { } module.exports = getTextContentAccessor; -},{"fbjs/lib/ExecutionEnvironment":16}],209:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":17}],211:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22874,7 +23654,129 @@ function getVendorPrefixedEventName(eventName) { } module.exports = getVendorPrefixedEventName; -},{"fbjs/lib/ExecutionEnvironment":16}],210:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":17}],212:[function(require,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 ReactDOMComponentTree = require('./ReactDOMComponentTree'); + +function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); +} + +function getTracker(inst) { + return inst._wrapperState.valueTracker; +} + +function attachTracker(inst, tracker) { + inst._wrapperState.valueTracker = tracker; +} + +function detachTracker(inst) { + delete inst._wrapperState.valueTracker; +} + +function getValueFromNode(node) { + var value; + if (node) { + value = isCheckable(node) ? '' + node.checked : node.value; + } + return value; +} + +var inputValueTracking = { + // exposed for testing + _getTrackerFromNode: function (node) { + return getTracker(ReactDOMComponentTree.getInstanceFromNode(node)); + }, + + + track: function (inst) { + if (getTracker(inst)) { + return; + } + + var node = ReactDOMComponentTree.getNodeFromInstance(inst); + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + + var currentValue = '' + node[valueField]; + + // if someone has already defined a value bail and don't track value + // will cause over reporting of changes, but it's better then a hard failure + // (needed for certain tests that spyOn input values) + if (node.hasOwnProperty(valueField)) { + return; + } + + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable, + configurable: true, + get: function () { + return descriptor.get.call(this); + }, + set: function (value) { + currentValue = '' + value; + descriptor.set.call(this, value); + } + }); + + attachTracker(inst, { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(inst); + delete node[valueField]; + } + }); + }, + + updateValueIfChanged: function (inst) { + if (!inst) { + return false; + } + var tracker = getTracker(inst); + + if (!tracker) { + inputValueTracking.track(inst); + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(ReactDOMComponentTree.getNodeFromInstance(inst)); + + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + + return false; + }, + stopTracking: function (inst) { + var tracker = getTracker(inst); + if (tracker) { + tracker.stopTracking(); + } + } +}; + +module.exports = inputValueTracking; +},{"./ReactDOMComponentTree":130}],213:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -22945,7 +23847,7 @@ function instantiateReactComponent(node, shouldHaveDebugID) { var info = ''; if (process.env.NODE_ENV !== 'production') { 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 += ' You likely forgot to export your component from the file ' + "it's defined in."; } } info += getDeclarationErrorAddendum(element._owner); @@ -23005,7 +23907,7 @@ _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { module.exports = instantiateReactComponent; }).call(this,require('_process')) -},{"./ReactCompositeComponent":124,"./ReactEmptyComponent":147,"./ReactHostComponent":152,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"object-assign":57,"react/lib/getNextDebugID":242}],211:[function(require,module,exports){ +},{"./ReactCompositeComponent":126,"./ReactEmptyComponent":149,"./ReactHostComponent":154,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"object-assign":58,"react/lib/getNextDebugID":244}],214:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23065,7 +23967,7 @@ function isEventSupported(eventNameSuffix, capture) { } module.exports = isEventSupported; -},{"fbjs/lib/ExecutionEnvironment":16}],212:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":17}],215:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23084,21 +23986,21 @@ module.exports = isEventSupported; */ var supportedInputTypes = { - 'color': true, - 'date': true, - 'datetime': true, + color: true, + date: true, + datetime: true, 'datetime-local': true, - 'email': true, - 'month': true, - 'number': true, - 'password': true, - 'range': true, - 'search': true, - 'tel': true, - 'text': true, - 'time': true, - 'url': true, - 'week': true + email: true, + month: true, + number: true, + password: true, + range: true, + search: true, + tel: true, + text: true, + time: true, + url: true, + week: true }; function isTextInputElement(elem) { @@ -23116,7 +24018,7 @@ function isTextInputElement(elem) { } module.exports = isTextInputElement; -},{}],213:[function(require,module,exports){ +},{}],216:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23142,7 +24044,7 @@ function quoteAttributeValueForBrowser(value) { } module.exports = quoteAttributeValueForBrowser; -},{"./escapeTextContentForBrowser":197}],214:[function(require,module,exports){ +},{"./escapeTextContentForBrowser":199}],217:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -23181,7 +24083,7 @@ function reactProdInvariant(code) { } module.exports = reactProdInvariant; -},{}],215:[function(require,module,exports){ +},{}],218:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23197,7 +24099,7 @@ module.exports = reactProdInvariant; var ReactMount = require('./ReactMount'); module.exports = ReactMount.renderSubtreeIntoContainer; -},{"./ReactMount":160}],216:[function(require,module,exports){ +},{"./ReactMount":162}],219:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23276,7 +24178,7 @@ if (ExecutionEnvironment.canUseDOM) { // in hopes that this is preserved even if "\uFEFF" is transformed to // the actual Unicode character (by Babel, for example). // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 - node.innerHTML = String.fromCharCode(0xFEFF) + html; + node.innerHTML = String.fromCharCode(0xfeff) + html; // deleteData leaves an empty `TextNode` which offsets the index of all // children. Definitely want to avoid this. @@ -23295,7 +24197,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = setInnerHTML; -},{"./DOMNamespaces":105,"./createMicrosoftUnsafeLocalFunction":195,"fbjs/lib/ExecutionEnvironment":16}],217:[function(require,module,exports){ +},{"./DOMNamespaces":107,"./createMicrosoftUnsafeLocalFunction":197,"fbjs/lib/ExecutionEnvironment":17}],220:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23347,7 +24249,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = setTextContent; -},{"./escapeTextContentForBrowser":197,"./setInnerHTML":216,"fbjs/lib/ExecutionEnvironment":16}],218:[function(require,module,exports){ +},{"./escapeTextContentForBrowser":199,"./setInnerHTML":219,"fbjs/lib/ExecutionEnvironment":17}],221:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23389,7 +24291,7 @@ function shouldUpdateReactComponent(prevElement, nextElement) { } module.exports = shouldUpdateReactComponent; -},{}],219:[function(require,module,exports){ +},{}],222:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -23524,7 +24426,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) if (process.env.NODE_ENV !== 'production') { addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; if (children._isReactElement) { - addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; + addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; } if (ReactCurrentOwner.current) { var name = ReactCurrentOwner.current.getName(); @@ -23567,7 +24469,7 @@ function traverseAllChildren(children, callback, traverseContext) { module.exports = traverseAllChildren; }).call(this,require('_process')) -},{"./KeyEscapeUtils":117,"./ReactElementSymbol":146,"./getIteratorFn":206,"./reactProdInvariant":214,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"react/lib/ReactCurrentOwner":228}],220:[function(require,module,exports){ +},{"./KeyEscapeUtils":119,"./ReactElementSymbol":148,"./getIteratorFn":208,"./reactProdInvariant":217,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38,"react/lib/ReactCurrentOwner":230}],223:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -23692,7 +24594,6 @@ if (process.env.NODE_ENV !== 'production') { // but case 'option': return tag === '#text'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption // No special behavior since these rules fall back to "in body" mode for @@ -23701,25 +24602,20 @@ if (process.env.NODE_ENV !== 'production') { // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr case 'tr': return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody case 'tbody': case 'thead': case 'tfoot': return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup case 'colgroup': return tag === 'col' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable case 'table': return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead case 'head': return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element case 'html': return tag === 'head' || tag === 'body'; @@ -23915,7 +24811,7 @@ if (process.env.NODE_ENV !== 'production') { tagDisplayName = 'Text nodes'; } else { tagDisplayName = 'Whitespace text nodes'; - whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.'; + whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.'; } } else { tagDisplayName = '<' + childTag + '>'; @@ -23946,11 +24842,11 @@ if (process.env.NODE_ENV !== 'production') { module.exports = validateDOMNesting; }).call(this,require('_process')) -},{"_process":58,"fbjs/lib/emptyFunction":22,"fbjs/lib/warning":37,"object-assign":57}],221:[function(require,module,exports){ -arguments[4][117][0].apply(exports,arguments) -},{"dup":117}],222:[function(require,module,exports){ +},{"_process":59,"fbjs/lib/emptyFunction":23,"fbjs/lib/warning":38,"object-assign":58}],224:[function(require,module,exports){ arguments[4][119][0].apply(exports,arguments) -},{"./reactProdInvariant":244,"_process":58,"dup":119,"fbjs/lib/invariant":30}],223:[function(require,module,exports){ +},{"dup":119}],225:[function(require,module,exports){ +arguments[4][121][0].apply(exports,arguments) +},{"./reactProdInvariant":247,"_process":59,"dup":121,"fbjs/lib/invariant":31}],226:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -23966,23 +24862,22 @@ arguments[4][119][0].apply(exports,arguments) var _assign = require('object-assign'); +var ReactBaseClasses = require('./ReactBaseClasses'); var ReactChildren = require('./ReactChildren'); -var ReactComponent = require('./ReactComponent'); -var ReactPureComponent = require('./ReactPureComponent'); -var ReactClass = require('./ReactClass'); var ReactDOMFactories = require('./ReactDOMFactories'); var ReactElement = require('./ReactElement'); var ReactPropTypes = require('./ReactPropTypes'); var ReactVersion = require('./ReactVersion'); +var createReactClass = require('./createClass'); var onlyChild = require('./onlyChild'); -var warning = require('fbjs/lib/warning'); var createElement = ReactElement.createElement; var createFactory = ReactElement.createFactory; var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { + var lowPriorityWarning = require('./lowPriorityWarning'); var canDefineProperty = require('./canDefineProperty'); var ReactElementValidator = require('./ReactElementValidator'); var didWarnPropTypesDeprecated = false; @@ -23992,18 +24887,27 @@ if (process.env.NODE_ENV !== 'production') { } var __spread = _assign; +var createMixin = function (mixin) { + return mixin; +}; if (process.env.NODE_ENV !== 'production') { - var warned = false; + var warnedForSpread = false; + var warnedForCreateMixin = 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; + lowPriorityWarning(warnedForSpread, '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.'); + warnedForSpread = true; return _assign.apply(null, arguments); }; + + createMixin = function (mixin) { + lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.'); + warnedForCreateMixin = true; + return mixin; + }; } var React = { - // Modern Children: { @@ -24014,8 +24918,8 @@ var React = { only: onlyChild }, - Component: ReactComponent, - PureComponent: ReactPureComponent, + Component: ReactBaseClasses.Component, + PureComponent: ReactBaseClasses.PureComponent, createElement: createElement, cloneElement: cloneElement, @@ -24024,12 +24928,9 @@ var React = { // Classic PropTypes: ReactPropTypes, - createClass: ReactClass.createClass, + createClass: createReactClass, createFactory: createFactory, - createMixin: function (mixin) { - // Currently a noop. Will be used to validate and trace mixins. - return mixin; - }, + createMixin: createMixin, // This looks DOM specific but these are actually isomorphic helpers // since they are just generating DOM strings. @@ -24041,938 +24942,45 @@ var React = { __spread: __spread }; -// TODO: Fix tests so that this deprecation warning doesn't cause failures. if (process.env.NODE_ENV !== 'production') { + var warnedForCreateClass = false; 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; + lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs'); didWarnPropTypesDeprecated = true; return ReactPropTypes; } }); - } -} - -module.exports = React; -}).call(this,require('_process')) -},{"./ReactChildren":224,"./ReactClass":225,"./ReactComponent":226,"./ReactDOMFactories":229,"./ReactElement":230,"./ReactElementValidator":232,"./ReactPropTypes":235,"./ReactPureComponent":237,"./ReactVersion":238,"./canDefineProperty":239,"./onlyChild":243,"_process":58,"fbjs/lib/warning":37,"object-assign":57}],224:[function(require,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 PooledClass = require('./PooledClass'); -var ReactElement = require('./ReactElement'); - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var traverseAllChildren = require('./traverseAllChildren'); - -var twoArgumentPooler = PooledClass.twoArgumentPooler; -var fourArgumentPooler = PooledClass.fourArgumentPooler; - -var userProvidedKeyEscapeRegex = /\/+/g; -function escapeUserProvidedKey(text) { - return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * traversal. Allows avoiding binding callbacks. - * - * @constructor ForEachBookKeeping - * @param {!function} forEachFunction Function to perform traversal with. - * @param {?*} forEachContext Context to perform context with. - */ -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); - -function forEachSingleChild(bookKeeping, child, name) { - var func = bookKeeping.func, - context = bookKeeping.context; - - func.call(context, child, bookKeeping.count++); -} - -/** - * Iterates through children that are typically specified as `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach - * - * The provided forEachFunc(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} forEachFunc - * @param {*} forEachContext Context for forEachContext. - */ -function forEachChildren(children, forEachFunc, forEachContext) { - if (children == null) { - return children; - } - var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); - traverseAllChildren(children, forEachSingleChild, traverseContext); - ForEachBookKeeping.release(traverseContext); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * mapping. Allows avoiding binding callbacks. - * - * @constructor MapBookKeeping - * @param {!*} mapResult Object containing the ordered map of results. - * @param {!function} mapFunction Function to perform mapping with. - * @param {?*} mapContext Context to perform mapping with. - */ -function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { - this.result = mapResult; - this.keyPrefix = keyPrefix; - this.func = mapFunction; - this.context = mapContext; - this.count = 0; -} -MapBookKeeping.prototype.destructor = function () { - this.result = null; - this.keyPrefix = null; - this.func = null; - this.context = null; - this.count = 0; -}; -PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); - -function mapSingleChildIntoContext(bookKeeping, child, childKey) { - var result = bookKeeping.result, - keyPrefix = bookKeeping.keyPrefix, - func = bookKeeping.func, - context = bookKeeping.context; - - - var mappedChild = func.call(context, child, bookKeeping.count++); - if (Array.isArray(mappedChild)) { - mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); - } else if (mappedChild != null) { - if (ReactElement.isValidElement(mappedChild)) { - mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, - // Keep both the (mapped) and old keys if they differ, just as - // traverseAllChildren used to do for objects as children - keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); - } - result.push(mappedChild); - } -} - -function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { - var escapedPrefix = ''; - if (prefix != null) { - escapedPrefix = escapeUserProvidedKey(prefix) + '/'; - } - var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); - traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); - MapBookKeeping.release(traverseContext); -} - -/** - * Maps children that are typically specified as `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map - * - * The provided mapFunction(child, key, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} func The map function. - * @param {*} context Context for mapFunction. - * @return {object} Object containing the ordered map of results. - */ -function mapChildren(children, func, context) { - if (children == null) { - return children; - } - var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, func, context); - return result; -} - -function forEachSingleChildDummy(traverseContext, child, name) { - return null; -} - -/** - * Count the number of children that are typically specified as - * `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count - * - * @param {?*} children Children tree container. - * @return {number} The number of children. - */ -function countChildren(children, context) { - return traverseAllChildren(children, forEachSingleChildDummy, null); -} - -/** - * Flatten a children object (typically specified as `props.children`) and - * return an array with appropriately re-keyed children. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray - */ -function toArray(children) { - var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); - return result; -} - -var ReactChildren = { - forEach: forEachChildren, - map: mapChildren, - mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, - count: countChildren, - toArray: toArray -}; - -module.exports = ReactChildren; -},{"./PooledClass":222,"./ReactElement":230,"./traverseAllChildren":245,"fbjs/lib/emptyFunction":22}],225:[function(require,module,exports){ -(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. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'), - _assign = require('object-assign'); - -var ReactComponent = require('./ReactComponent'); -var ReactElement = require('./ReactElement'); -var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); -var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); - -var emptyObject = require('fbjs/lib/emptyObject'); -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -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 injectedMixins = []; - -/** - * Composite components are higher-level components that compose other composite - * or host components. - * - * To create a new type of `ReactClass`, pass a specification of - * your new class to `React.createClass`. The only requirement of your class - * specification is that you implement a `render` method. - * - * var MyComponent = React.createClass({ - * render: function() { - * return
Hello World
; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactClassInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will be available on the prototype. - * - * @interface ReactClassInterface - * @internal - */ -var ReactClassInterface = { - - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: 'DEFINE_MANY', - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: 'DEFINE_MANY', - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: 'DEFINE_MANY', - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: 'DEFINE_MANY', - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: 'DEFINE_MANY', - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: 'DEFINE_MANY_MERGED', - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: 'DEFINE_MANY_MERGED', - - /** - * @return {object} - * @optional - */ - getChildContext: 'DEFINE_MANY_MERGED', - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return
Hello, {name}!
; - * } - * - * @return {ReactComponent} - * @required - */ - render: 'DEFINE_ONCE', - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: 'DEFINE_MANY', - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: 'DEFINE_MANY', - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: 'DEFINE_MANY', - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: 'DEFINE_ONCE', - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: 'DEFINE_MANY', - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: 'OVERRIDE_BASE' - -}; - -/** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ -var RESERVED_SPEC_KEYS = { - displayName: function (Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function (Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); + Object.defineProperty(React, 'createClass', { + get: function () { + lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class'); + warnedForCreateClass = true; + return createReactClass; } - } - }, - childContextTypes: function (Constructor, childContextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, childContextTypes, 'childContext'); - } - Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); - }, - contextTypes: function (Constructor, contextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, contextTypes, 'context'); - } - Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function (Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function (Constructor, propTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, propTypes, 'prop'); - } - Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); - }, - statics: function (Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - }, - autobind: function () {} }; - -function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - // use a warning instead of an invariant so components - // don't show up in prod but only in __DEV__ - process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0; - } - } -} - -function validateMethodOverride(isAlreadyDefined, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactClassMixin.hasOwnProperty(name)) { - !(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 === '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; - } -} - -/** - * Mixin helper which handles policy validation and reserved - * specification keys when building React classes. - */ -function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - if (process.env.NODE_ENV !== 'production') { - var typeofSpec = typeof spec; - var isMixinValid = typeofSpec === 'object' && spec !== null; - - process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0; - } - - return; - } - - !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0; - !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0; - - var proto = Constructor.prototype; - var autoBindPairs = proto.__reactAutoBindPairs; - - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + }); } - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above. - continue; - } - - var property = spec[name]; - var isAlreadyDefined = proto.hasOwnProperty(name); - validateMethodOverride(isAlreadyDefined, name); - - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactClass methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); - var isFunction = typeof property === 'function'; - var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; - - if (shouldAutoBind) { - autoBindPairs.push(name, property); - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactClassInterface[name]; - - // These cases should already be caught by validateMethodOverride. - !(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 === 'DEFINE_MANY_MERGED') { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === 'DEFINE_MANY') { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if (process.env.NODE_ENV !== 'production') { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } + // React.DOM factories are deprecated. Wrap these methods so that + // invocations of the React.DOM namespace and alert users to switch + // to the `react-dom-factories` package. + React.DOM = {}; + var warnedForFactories = false; + Object.keys(ReactDOMFactories).forEach(function (factory) { + React.DOM[factory] = function () { + if (!warnedForFactories) { + lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory); + warnedForFactories = true; } - } - } -} - -function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } - - var isReserved = name in RESERVED_SPEC_KEYS; - !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0; - - var isInherited = name in Constructor; - !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0; - Constructor[name] = property; - } -} - -/** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ -function mergeIntoWithNoDuplicateKeys(one, two) { - !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0; - - for (var key in two) { - if (two.hasOwnProperty(key)) { - !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : void 0; - one[key] = two[key]; - } - } - return one; -} - -/** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ -function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - var c = {}; - mergeIntoWithNoDuplicateKeys(c, a); - mergeIntoWithNoDuplicateKeys(c, b); - return c; - }; -} - -/** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ -function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; -} - -/** - * Binds a method to the component. - * - * @param {object} component Component whose method is going to be bound. - * @param {function} method Method to be bound. - * @return {function} The bound method. - */ -function bindAutoBindMethod(component, method) { - var boundMethod = method.bind(component); - if (process.env.NODE_ENV !== 'production') { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - boundMethod.bind = function (newThis) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0; - } else if (!args.length) { - process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0; - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; + return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments); }; - } - return boundMethod; -} - -/** - * Binds all auto-bound methods in a component. - * - * @param {object} component Component whose method is going to be bound. - */ -function bindAutoBindMethods(component) { - var pairs = component.__reactAutoBindPairs; - for (var i = 0; i < pairs.length; i += 2) { - var autoBindKey = pairs[i]; - var method = pairs[i + 1]; - component[autoBindKey] = bindAutoBindMethod(component, method); - } + }); } -/** - * Add more to the ReactClass base class. These are all legacy features and - * therefore not already part of the modern ReactComponent. - */ -var ReactClassMixin = { - - /** - * TODO: This will be deprecated because state should always keep a consistent - * type signature and the only use case for this, is to avoid that. - */ - replaceState: function (newState, callback) { - this.updater.enqueueReplaceState(this, newState); - if (callback) { - this.updater.enqueueCallback(this, callback, 'replaceState'); - } - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function () { - return this.updater.isMounted(this); - } -}; - -var ReactClassComponent = function () {}; -_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); - -var didWarnDeprecated = false; - -/** - * Module for creating composite components. - * - * @class ReactClass - */ -var ReactClass = { - - /** - * Creates a composite component class given a class specification. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - createClass: function (spec) { - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0; - didWarnDeprecated = true; - } - - // 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. - - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0; - } - - // Wire up auto-binding - if (this.__reactAutoBindPairs.length) { - bindAutoBindMethods(this); - } - - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - - this.state = null; - - // ReactClasses doesn't have constructors. Instead, they use the - // getInitialState and componentWillMount methods for initialization. - - var initialState = this.getInitialState ? this.getInitialState() : null; - if (process.env.NODE_ENV !== 'production') { - // We allow auto-mocks to proceed as if they're returning null. - if (initialState === undefined && this.getInitialState._isMockFunction) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - initialState = null; - } - } - !(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 = []; - - injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - - mixSpecIntoComponent(Constructor, spec); - - // Initialize the defaultProps property after all mixins have been merged. - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } - - if (process.env.NODE_ENV !== 'production') { - // This is a tag to indicate that the use of these method names is ok, - // since it's used with createClass. If it's not, then it's likely a - // mistake so we'll warn you to use the static property, property - // initializer or constructor respectively. - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps.isReactClassApproved = {}; - } - if (Constructor.prototype.getInitialState) { - Constructor.prototype.getInitialState.isReactClassApproved = {}; - } - } - - !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0; - - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0; - process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0; - } - - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactClassInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } - - return Constructor; - }, - - injection: { - injectMixin: function (mixin) { - injectedMixins.push(mixin); - } - } - -}; - -module.exports = ReactClass; +module.exports = React; }).call(this,require('_process')) -},{"./ReactComponent":226,"./ReactElement":230,"./ReactNoopUpdateQueue":233,"./ReactPropTypeLocationNames":234,"./reactProdInvariant":244,"_process":58,"fbjs/lib/emptyObject":23,"fbjs/lib/invariant":30,"fbjs/lib/warning":37,"object-assign":57}],226:[function(require,module,exports){ +},{"./ReactBaseClasses":227,"./ReactChildren":228,"./ReactDOMFactories":231,"./ReactElement":232,"./ReactElementValidator":234,"./ReactPropTypes":237,"./ReactVersion":239,"./canDefineProperty":240,"./createClass":242,"./lowPriorityWarning":245,"./onlyChild":246,"_process":59,"object-assign":58}],227:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -24986,14 +24994,15 @@ module.exports = ReactClass; 'use strict'; -var _prodInvariant = require('./reactProdInvariant'); +var _prodInvariant = require('./reactProdInvariant'), + _assign = require('object-assign'); var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); var canDefineProperty = require('./canDefineProperty'); var emptyObject = require('fbjs/lib/emptyObject'); var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); +var lowPriorityWarning = require('./lowPriorityWarning'); /** * Base class helpers for the updating state of a component. @@ -25077,7 +25086,7 @@ if (process.env.NODE_ENV !== 'production') { if (canDefineProperty) { Object.defineProperty(ReactComponent.prototype, methodName, { get: function () { - process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0; + lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); return undefined; } }); @@ -25090,9 +25099,224 @@ if (process.env.NODE_ENV !== 'production') { } } -module.exports = ReactComponent; +/** + * Base class helpers for the updating state of a component. + */ +function ReactPureComponent(props, context, updater) { + // Duplicated from ReactComponent. + this.props = props; + this.context = context; + this.refs = emptyObject; + // We initialize the default updater but the real one gets injected by the + // renderer. + this.updater = updater || ReactNoopUpdateQueue; +} + +function ComponentDummy() {} +ComponentDummy.prototype = ReactComponent.prototype; +ReactPureComponent.prototype = new ComponentDummy(); +ReactPureComponent.prototype.constructor = ReactPureComponent; +// Avoid an extra prototype jump for these methods. +_assign(ReactPureComponent.prototype, ReactComponent.prototype); +ReactPureComponent.prototype.isPureReactComponent = true; + +module.exports = { + Component: ReactComponent, + PureComponent: ReactPureComponent +}; }).call(this,require('_process')) -},{"./ReactNoopUpdateQueue":233,"./canDefineProperty":239,"./reactProdInvariant":244,"_process":58,"fbjs/lib/emptyObject":23,"fbjs/lib/invariant":30,"fbjs/lib/warning":37}],227:[function(require,module,exports){ +},{"./ReactNoopUpdateQueue":235,"./canDefineProperty":240,"./lowPriorityWarning":245,"./reactProdInvariant":247,"_process":59,"fbjs/lib/emptyObject":24,"fbjs/lib/invariant":31,"object-assign":58}],228:[function(require,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 PooledClass = require('./PooledClass'); +var ReactElement = require('./ReactElement'); + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var traverseAllChildren = require('./traverseAllChildren'); + +var twoArgumentPooler = PooledClass.twoArgumentPooler; +var fourArgumentPooler = PooledClass.fourArgumentPooler; + +var userProvidedKeyEscapeRegex = /\/+/g; +function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); +} + +/** + * PooledClass representing the bookkeeping associated with performing a child + * traversal. Allows avoiding binding callbacks. + * + * @constructor ForEachBookKeeping + * @param {!function} forEachFunction Function to perform traversal with. + * @param {?*} forEachContext Context to perform context with. + */ +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); + +function forEachSingleChild(bookKeeping, child, name) { + var func = bookKeeping.func, + context = bookKeeping.context; + + func.call(context, child, bookKeeping.count++); +} + +/** + * Iterates through children that are typically specified as `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ +function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + ForEachBookKeeping.release(traverseContext); +} + +/** + * PooledClass representing the bookkeeping associated with performing a child + * mapping. Allows avoiding binding callbacks. + * + * @constructor MapBookKeeping + * @param {!*} mapResult Object containing the ordered map of results. + * @param {!function} mapFunction Function to perform mapping with. + * @param {?*} mapContext Context to perform mapping with. + */ +function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { + this.result = mapResult; + this.keyPrefix = keyPrefix; + this.func = mapFunction; + this.context = mapContext; + this.count = 0; +} +MapBookKeeping.prototype.destructor = function () { + this.result = null; + this.keyPrefix = null; + this.func = null; + this.context = null; + this.count = 0; +}; +PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); + +function mapSingleChildIntoContext(bookKeeping, child, childKey) { + var result = bookKeeping.result, + keyPrefix = bookKeeping.keyPrefix, + func = bookKeeping.func, + context = bookKeeping.context; + + + var mappedChild = func.call(context, child, bookKeeping.count++); + if (Array.isArray(mappedChild)) { + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); + } else if (mappedChild != null) { + if (ReactElement.isValidElement(mappedChild)) { + mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, + // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); + } + result.push(mappedChild); + } +} + +function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { + var escapedPrefix = ''; + if (prefix != null) { + escapedPrefix = escapeUserProvidedKey(prefix) + '/'; + } + var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + MapBookKeeping.release(traverseContext); +} + +/** + * Maps children that are typically specified as `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map + * + * The provided mapFunction(child, key, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ +function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, func, context); + return result; +} + +function forEachSingleChildDummy(traverseContext, child, name) { + return null; +} + +/** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ +function countChildren(children, context) { + return traverseAllChildren(children, forEachSingleChildDummy, null); +} + +/** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray + */ +function toArray(children) { + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); + return result; +} + +var ReactChildren = { + forEach: forEachChildren, + map: mapChildren, + mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, + count: countChildren, + toArray: toArray +}; + +module.exports = ReactChildren; +},{"./PooledClass":225,"./ReactElement":232,"./traverseAllChildren":248,"fbjs/lib/emptyFunction":23}],229:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -25120,11 +25344,11 @@ function isNative(fn) { var hasOwnProperty = Object.prototype.hasOwnProperty; var reIsNative = RegExp('^' + funcToString // Take an example native function source for comparison - .call(hasOwnProperty) + .call(hasOwnProperty // Strip regex characters so we can use it for regex - .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&' // Remove hasOwnProperty from the template to make it generic - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); try { var source = funcToString.call(fn); return reIsNative.test(source); @@ -25423,12 +25647,57 @@ var ReactComponentTreeHook = { getRootIDs: getRootIDs, - getRegisteredIDs: getItemIDs + getRegisteredIDs: getItemIDs, + + pushNonStandardWarningStack: function (isCreatingElement, currentSource) { + if (typeof console.reactStack !== 'function') { + return; + } + + var stack = []; + var currentOwner = ReactCurrentOwner.current; + var id = currentOwner && currentOwner._debugID; + + try { + if (isCreatingElement) { + stack.push({ + name: id ? ReactComponentTreeHook.getDisplayName(id) : null, + fileName: currentSource ? currentSource.fileName : null, + lineNumber: currentSource ? currentSource.lineNumber : null + }); + } + + while (id) { + var element = ReactComponentTreeHook.getElement(id); + var parentID = ReactComponentTreeHook.getParentID(id); + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null; + var source = element && element._source; + stack.push({ + name: ownerName, + fileName: source ? source.fileName : null, + lineNumber: source ? source.lineNumber : null + }); + id = parentID; + } + } catch (err) { + // Internal state is messed up. + // Stop building the stack (it's just a nice to have). + } + + console.reactStack(stack); + }, + popNonStandardWarningStack: function () { + if (typeof console.reactStackEnd !== 'function') { + return; + } + console.reactStackEnd(); + } }; module.exports = ReactComponentTreeHook; }).call(this,require('_process')) -},{"./ReactCurrentOwner":228,"./reactProdInvariant":244,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37}],228:[function(require,module,exports){ +},{"./ReactCurrentOwner":230,"./reactProdInvariant":247,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38}],230:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -25449,17 +25718,15 @@ module.exports = ReactComponentTreeHook; * currently being constructed. */ var ReactCurrentOwner = { - /** * @internal * @type {ReactComponent} */ current: null - }; module.exports = ReactCurrentOwner; -},{}],229:[function(require,module,exports){ +},{}],231:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -25488,7 +25755,6 @@ if (process.env.NODE_ENV !== 'production') { /** * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. - * This is also accessible via `React.DOM`. * * @public */ @@ -25631,7 +25897,7 @@ var ReactDOMFactories = { module.exports = ReactDOMFactories; }).call(this,require('_process')) -},{"./ReactElement":230,"./ReactElementValidator":232,"_process":58}],230:[function(require,module,exports){ +},{"./ReactElement":232,"./ReactElementValidator":234,"_process":59}],232:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -25974,9 +26240,9 @@ ReactElement.isValidElement = function (object) { module.exports = ReactElement; }).call(this,require('_process')) -},{"./ReactCurrentOwner":228,"./ReactElementSymbol":231,"./canDefineProperty":239,"_process":58,"fbjs/lib/warning":37,"object-assign":57}],231:[function(require,module,exports){ -arguments[4][146][0].apply(exports,arguments) -},{"dup":146}],232:[function(require,module,exports){ +},{"./ReactCurrentOwner":230,"./ReactElementSymbol":233,"./canDefineProperty":240,"_process":59,"fbjs/lib/warning":38,"object-assign":58}],233:[function(require,module,exports){ +arguments[4][148][0].apply(exports,arguments) +},{"dup":148}],234:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -26006,6 +26272,7 @@ var checkReactTypeSpec = require('./checkReactTypeSpec'); var canDefineProperty = require('./canDefineProperty'); var getIteratorFn = require('./getIteratorFn'); var warning = require('fbjs/lib/warning'); +var lowPriorityWarning = require('./lowPriorityWarning'); function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { @@ -26146,7 +26413,6 @@ function validatePropTypes(element) { } var ReactElementValidator = { - createElement: function (type, props, children) { var validType = typeof type === 'string' || typeof type === 'function'; // We warn in this case but don't throw. We expect the element creation to @@ -26155,7 +26421,7 @@ var ReactElementValidator = { 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 += ' You likely forgot to export your component from the file ' + "it's defined in."; } var sourceInfo = getSourceInfoErrorAddendum(props); @@ -26167,7 +26433,10 @@ var ReactElementValidator = { info += ReactComponentTreeHook.getCurrentStackAddendum(); + var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null; + ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource); 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; + ReactComponentTreeHook.popNonStandardWarningStack(); } } @@ -26205,7 +26474,7 @@ var ReactElementValidator = { Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { - process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0; + lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); Object.defineProperty(this, 'type', { value: type }); @@ -26226,12 +26495,11 @@ var ReactElementValidator = { validatePropTypes(newElement); return newElement; } - }; module.exports = ReactElementValidator; }).call(this,require('_process')) -},{"./ReactComponentTreeHook":227,"./ReactCurrentOwner":228,"./ReactElement":230,"./canDefineProperty":239,"./checkReactTypeSpec":240,"./getIteratorFn":241,"_process":58,"fbjs/lib/warning":37}],233:[function(require,module,exports){ +},{"./ReactComponentTreeHook":229,"./ReactCurrentOwner":230,"./ReactElement":232,"./canDefineProperty":240,"./checkReactTypeSpec":241,"./getIteratorFn":243,"./lowPriorityWarning":245,"_process":59,"fbjs/lib/warning":38}],235:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -26258,7 +26526,6 @@ function warnNoop(publicInstance, callerName) { * This is the abstract API for an update queue. */ var ReactNoopUpdateQueue = { - /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. @@ -26329,9 +26596,9 @@ var ReactNoopUpdateQueue = { module.exports = ReactNoopUpdateQueue; }).call(this,require('_process')) -},{"_process":58,"fbjs/lib/warning":37}],234:[function(require,module,exports){ -arguments[4][164][0].apply(exports,arguments) -},{"_process":58,"dup":164}],235:[function(require,module,exports){ +},{"_process":59,"fbjs/lib/warning":38}],236:[function(require,module,exports){ +arguments[4][166][0].apply(exports,arguments) +},{"_process":59,"dup":166}],237:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -26350,53 +26617,11 @@ var _require = require('./ReactElement'), var factory = require('prop-types/factory'); module.exports = factory(isValidElement); -},{"./ReactElement":230,"prop-types/factory":60}],236:[function(require,module,exports){ -arguments[4][165][0].apply(exports,arguments) -},{"dup":165}],237:[function(require,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 _assign = require('object-assign'); - -var ReactComponent = require('./ReactComponent'); -var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); - -var emptyObject = require('fbjs/lib/emptyObject'); - -/** - * Base class helpers for the updating state of a component. - */ -function ReactPureComponent(props, context, updater) { - // Duplicated from ReactComponent. - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -function ComponentDummy() {} -ComponentDummy.prototype = ReactComponent.prototype; -ReactPureComponent.prototype = new ComponentDummy(); -ReactPureComponent.prototype.constructor = ReactPureComponent; -// Avoid an extra prototype jump for these methods. -_assign(ReactPureComponent.prototype, ReactComponent.prototype); -ReactPureComponent.prototype.isPureReactComponent = true; - -module.exports = ReactPureComponent; -},{"./ReactComponent":226,"./ReactNoopUpdateQueue":233,"fbjs/lib/emptyObject":23,"object-assign":57}],238:[function(require,module,exports){ -arguments[4][173][0].apply(exports,arguments) -},{"dup":173}],239:[function(require,module,exports){ +},{"./ReactElement":232,"prop-types/factory":61}],238:[function(require,module,exports){ +arguments[4][167][0].apply(exports,arguments) +},{"dup":167}],239:[function(require,module,exports){ +arguments[4][175][0].apply(exports,arguments) +},{"dup":175}],240:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -26424,7 +26649,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = canDefineProperty; }).call(this,require('_process')) -},{"_process":58}],240:[function(require,module,exports){ +},{"_process":59}],241:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -26513,9 +26738,32 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element, module.exports = checkReactTypeSpec; }).call(this,require('_process')) -},{"./ReactComponentTreeHook":227,"./ReactPropTypeLocationNames":234,"./ReactPropTypesSecret":236,"./reactProdInvariant":244,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37}],241:[function(require,module,exports){ -arguments[4][206][0].apply(exports,arguments) -},{"dup":206}],242:[function(require,module,exports){ +},{"./ReactComponentTreeHook":229,"./ReactPropTypeLocationNames":236,"./ReactPropTypesSecret":238,"./reactProdInvariant":247,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38}],242:[function(require,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 _require = require('./ReactBaseClasses'), + Component = _require.Component; + +var _require2 = require('./ReactElement'), + isValidElement = _require2.isValidElement; + +var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); +var factory = require('create-react-class/factory'); + +module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue); +},{"./ReactBaseClasses":227,"./ReactElement":232,"./ReactNoopUpdateQueue":235,"create-react-class/factory":13}],243:[function(require,module,exports){ +arguments[4][208][0].apply(exports,arguments) +},{"dup":208}],244:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -26536,7 +26784,74 @@ function getNextDebugID() { } module.exports = getNextDebugID; -},{}],243:[function(require,module,exports){ +},{}],245:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2014-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. + * + */ + +'use strict'; + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +if (process.env.NODE_ENV !== 'production') { + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +module.exports = lowPriorityWarning; +}).call(this,require('_process')) +},{"_process":59}],246:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -26576,9 +26891,9 @@ function onlyChild(children) { module.exports = onlyChild; }).call(this,require('_process')) -},{"./ReactElement":230,"./reactProdInvariant":244,"_process":58,"fbjs/lib/invariant":30}],244:[function(require,module,exports){ -arguments[4][214][0].apply(exports,arguments) -},{"dup":214}],245:[function(require,module,exports){ +},{"./ReactElement":232,"./reactProdInvariant":247,"_process":59,"fbjs/lib/invariant":31}],247:[function(require,module,exports){ +arguments[4][217][0].apply(exports,arguments) +},{"dup":217}],248:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -26713,7 +27028,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) if (process.env.NODE_ENV !== 'production') { addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; if (children._isReactElement) { - addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; + addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; } if (ReactCurrentOwner.current) { var name = ReactCurrentOwner.current.getName(); @@ -26756,12 +27071,12 @@ function traverseAllChildren(children, callback, traverseContext) { module.exports = traverseAllChildren; }).call(this,require('_process')) -},{"./KeyEscapeUtils":221,"./ReactCurrentOwner":228,"./ReactElementSymbol":231,"./getIteratorFn":241,"./reactProdInvariant":244,"_process":58,"fbjs/lib/invariant":30,"fbjs/lib/warning":37}],246:[function(require,module,exports){ +},{"./KeyEscapeUtils":224,"./ReactCurrentOwner":230,"./ReactElementSymbol":233,"./getIteratorFn":243,"./reactProdInvariant":247,"_process":59,"fbjs/lib/invariant":31,"fbjs/lib/warning":38}],249:[function(require,module,exports){ 'use strict'; module.exports = require('./lib/React'); -},{"./lib/React":223}],247:[function(require,module,exports){ +},{"./lib/React":226}],250:[function(require,module,exports){ "use strict"; function hash(str) { @@ -26780,7 +27095,7 @@ function hash(str) { module.exports = hash; -},{}],248:[function(require,module,exports){ +},{}],251:[function(require,module,exports){ /* This note applies to rcss, react, and underscore. * * We're faking a node module for this package by just exporting the global. @@ -26804,7 +27119,7 @@ module.exports = hash; */ module.exports = window._; -},{}],249:[function(require,module,exports){ +},{}],252:[function(require,module,exports){ "use strict"; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); @@ -26828,7 +27143,7 @@ _.each([require("./widgets/categorizer.jsx"), require("./widgets/dropdown.jsx"), Widgets.register(name, widget, editor); }); -},{"./widgets.js":306,"./widgets/categorizer.jsx":307,"./widgets/dropdown.jsx":308,"./widgets/example-graphie-widget.jsx":309,"./widgets/example-widget.jsx":310,"./widgets/explanation-editor.jsx":311,"./widgets/explanation.jsx":312,"./widgets/expression.jsx":313,"./widgets/iframe.jsx":314,"./widgets/image.jsx":315,"./widgets/input-number.jsx":316,"./widgets/interactive-graph.jsx":317,"./widgets/interactive-number-line.jsx":318,"./widgets/lights-puzzle.jsx":319,"./widgets/matcher.jsx":320,"./widgets/matrix.jsx":321,"./widgets/measurer.jsx":322,"./widgets/number-line.jsx":323,"./widgets/numeric-input.jsx":324,"./widgets/orderer.jsx":325,"./widgets/plotter.jsx":326,"./widgets/radio.jsx":327,"./widgets/sorter.jsx":328,"./widgets/speaking-text-input.jsx":329,"./widgets/speaking-voice.jsx":330,"./widgets/table.jsx":331,"./widgets/transformer.jsx":332}],250:[function(require,module,exports){ +},{"./widgets.js":309,"./widgets/categorizer.jsx":310,"./widgets/dropdown.jsx":311,"./widgets/example-graphie-widget.jsx":312,"./widgets/example-widget.jsx":313,"./widgets/explanation-editor.jsx":314,"./widgets/explanation.jsx":315,"./widgets/expression.jsx":316,"./widgets/iframe.jsx":317,"./widgets/image.jsx":318,"./widgets/input-number.jsx":319,"./widgets/interactive-graph.jsx":320,"./widgets/interactive-number-line.jsx":321,"./widgets/lights-puzzle.jsx":322,"./widgets/matcher.jsx":323,"./widgets/matrix.jsx":324,"./widgets/measurer.jsx":325,"./widgets/number-line.jsx":326,"./widgets/numeric-input.jsx":327,"./widgets/orderer.jsx":328,"./widgets/plotter.jsx":329,"./widgets/radio.jsx":330,"./widgets/sorter.jsx":331,"./widgets/speaking-text-input.jsx":332,"./widgets/speaking-voice.jsx":333,"./widgets/table.jsx":334,"./widgets/transformer.jsx":335}],253:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -26910,7 +27225,7 @@ var AnswerAreaEditor = React.createClass({ module.exports = AnswerAreaEditor; -},{"./editor.jsx":275,"./widgets.js":306,"react":246,"react-components/js/info-tip.jsx":68}],251:[function(require,module,exports){ +},{"./editor.jsx":278,"./widgets.js":309,"react":249,"react-components/js/info-tip.jsx":70}],254:[function(require,module,exports){ 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -27253,9 +27568,9 @@ var AnswerAreaRenderer = React.createClass({ console.log("Target widget cannot show in answerarea", answerData); return 'no setAnswerFromJSON implemented for widgets in answer area.'; } else { - console.log("Target widget show in answerarea"); + console.log("Target widget show in answerarea" // Just show the given answer. - this.refs.widget.setAnswerFromJSON(answerData); + );this.refs.widget.setAnswerFromJSON(answerData); } }, @@ -27291,7 +27606,7 @@ var AnswerAreaRenderer = React.createClass({ module.exports = AnswerAreaRenderer; -},{"./enabled-features.jsx":276,"./perseus-api.jsx":294,"./question-paragraph.jsx":296,"./renderer.jsx":298,"./util.js":303,"./widget-container.jsx":305,"./widgets.js":306,"react":246,"react-dom":95}],252:[function(require,module,exports){ +},{"./enabled-features.jsx":279,"./perseus-api.jsx":297,"./question-paragraph.jsx":299,"./renderer.jsx":301,"./util.js":306,"./widget-container.jsx":308,"./widgets.js":309,"react":249,"react-dom":97}],255:[function(require,module,exports){ "use strict"; var _arguments = arguments; @@ -27469,7 +27784,7 @@ FancySelect.Option = FancyOption; module.exports = FancySelect; -},{"classnames":12,"react":246}],253:[function(require,module,exports){ +},{"classnames":12,"react":249}],256:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -28005,7 +28320,7 @@ var GraphSettings = React.createClass({ module.exports = GraphSettings; -},{"../components/number-input.jsx":261,"../components/prop-check-box.jsx":262,"../components/range-input.jsx":263,"../mixins/changeable.jsx":291,"../util.js":303,"react":246,"react-components/js/button-group.jsx":66,"react-components/js/info-tip.jsx":68}],254:[function(require,module,exports){ +},{"../components/number-input.jsx":264,"../components/prop-check-box.jsx":265,"../components/range-input.jsx":266,"../mixins/changeable.jsx":294,"../util.js":306,"react":249,"react-components/js/button-group.jsx":67,"react-components/js/info-tip.jsx":70}],257:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -28334,7 +28649,7 @@ var Graph = React.createClass({ module.exports = Graph; -},{"../util.js":303,"react":246,"react-dom":95}],255:[function(require,module,exports){ +},{"../util.js":306,"react":249,"react-dom":97}],258:[function(require,module,exports){ "use strict"; var Util = require("../util.js"); @@ -28460,7 +28775,7 @@ module.exports = { createSimpleClass: createSimpleClass }; -},{"../util.js":303}],256:[function(require,module,exports){ +},{"../util.js":306}],259:[function(require,module,exports){ "use strict"; var GraphieClasses = require("./graphie-classes.jsx"); @@ -28508,7 +28823,7 @@ module.exports = { MovablePoint: MovablePoint }; -},{"../interactive2.js":280,"../interactive2/interactive-util.js":281,"./graphie-classes.jsx":255}],257:[function(require,module,exports){ +},{"../interactive2.js":283,"../interactive2/interactive-util.js":284,"./graphie-classes.jsx":258}],260:[function(require,module,exports){ "use strict"; var React = require("react"); @@ -28793,7 +29108,7 @@ _.extend(Graphie, Movables); module.exports = Graphie; -},{"../interactive2/interactive-util.js":281,"../util.js":303,"./graphie-classes.jsx":255,"./graphie-movables.jsx":256,"react":246,"react-dom":95,"underscore":248}],258:[function(require,module,exports){ +},{"../interactive2/interactive-util.js":284,"../util.js":306,"./graphie-classes.jsx":258,"./graphie-movables.jsx":259,"react":249,"react-dom":97,"underscore":251}],261:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -28951,7 +29266,7 @@ var InputWithExamples = React.createClass({ module.exports = InputWithExamples; -},{"../perseus-api.jsx":294,"../renderer.jsx":298,"../util.js":303,"./math-input.jsx":259,"./text-input.jsx":266,"react":246,"react-components/js/tooltip.jsx":72}],259:[function(require,module,exports){ +},{"../perseus-api.jsx":297,"../renderer.jsx":301,"../util.js":306,"./math-input.jsx":262,"./text-input.jsx":269,"react":249,"react-components/js/tooltip.jsx":74}],262:[function(require,module,exports){ "use strict"; var classNames = require("classnames"); @@ -29213,7 +29528,7 @@ var MathInput = React.createClass({ module.exports = MathInput; -},{"./tex-buttons.jsx":265,"classnames":12,"react":246,"react-dom":95,"underscore":248}],260:[function(require,module,exports){ +},{"./tex-buttons.jsx":268,"classnames":12,"react":249,"react-dom":97,"underscore":251}],263:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -29292,7 +29607,7 @@ var MultiButtonGroup = React.createClass({ module.exports = MultiButtonGroup; -},{"react":246,"react-dom":95}],261:[function(require,module,exports){ +},{"react":249,"react-dom":97}],264:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -29479,7 +29794,7 @@ var NumberInput = React.createClass({ module.exports = NumberInput; -},{"../util.js":303,"classnames":12,"react":246,"react-dom":95}],262:[function(require,module,exports){ +},{"../util.js":306,"classnames":12,"react":249,"react-dom":97}],265:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -29544,7 +29859,7 @@ var PropCheckBox = React.createClass({ module.exports = PropCheckBox; -},{"react":246}],263:[function(require,module,exports){ +},{"react":249}],266:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -29614,7 +29929,7 @@ var RangeInput = React.createClass({ module.exports = RangeInput; -},{"../components/number-input.jsx":261,"react":246}],264:[function(require,module,exports){ +},{"../components/number-input.jsx":264,"react":249}],267:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -30115,7 +30430,7 @@ var Sortable = React.createClass({ module.exports = Sortable; -},{"../renderer.jsx":298,"../util.js":303,"react":246,"react-dom":95}],265:[function(require,module,exports){ +},{"../renderer.jsx":301,"../util.js":306,"react":249,"react-dom":97}],268:[function(require,module,exports){ "use strict"; var React = require("react"); @@ -30349,7 +30664,7 @@ var TexButtons = React.createClass({ module.exports = TexButtons; -},{"react":246,"react-components/js/tex.jsx":71}],266:[function(require,module,exports){ +},{"react":249,"react-components/js/tex.jsx":73}],269:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -30411,7 +30726,7 @@ var TextInput = React.createClass({ module.exports = TextInput; -},{"react":246,"react-dom":95}],267:[function(require,module,exports){ +},{"react":249,"react-dom":97}],270:[function(require,module,exports){ "use strict"; var React = require("react"); @@ -30545,7 +30860,7 @@ var TextListEditor = React.createClass({ module.exports = TextListEditor; -},{"react":246,"react-dom":95,"underscore":248}],268:[function(require,module,exports){ +},{"react":249,"react-dom":97,"underscore":251}],271:[function(require,module,exports){ "use strict"; // Responsible for combining the text diffs from text-diff and the widget @@ -30675,7 +30990,7 @@ var RevisionDiff = React.createClass({ module.exports = RevisionDiff; -},{"./text-diff.jsx":271,"./widget-diff.jsx":273,"react":246,"underscore":248}],269:[function(require,module,exports){ +},{"./text-diff.jsx":274,"./widget-diff.jsx":276,"react":249,"underscore":251}],272:[function(require,module,exports){ "use strict"; // Split a word-wise diff generated by jsdiff into multiple lines, for the @@ -30706,7 +31021,7 @@ var splitDiff = function splitDiff(diffEntries) { module.exports = splitDiff; -},{}],270:[function(require,module,exports){ +},{}],273:[function(require,module,exports){ "use strict"; var jsdiff = require("../../lib/jsdiff"); @@ -30792,7 +31107,7 @@ var stringArrayDiff = function stringArrayDiff(a, b) { module.exports = stringArrayDiff; -},{"../../lib/jsdiff":1}],271:[function(require,module,exports){ +},{"../../lib/jsdiff":1}],274:[function(require,module,exports){ "use strict"; var React = require("react"); @@ -30992,7 +31307,7 @@ var TextDiff = React.createClass({ module.exports = TextDiff; -},{"../../lib/jsdiff":1,"./split-diff.jsx":269,"./string-array-diff.jsx":270,"classnames":12,"react":246,"underscore":248}],272:[function(require,module,exports){ +},{"../../lib/jsdiff":1,"./split-diff.jsx":272,"./string-array-diff.jsx":273,"classnames":12,"react":249,"underscore":251}],275:[function(require,module,exports){ "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -31066,7 +31381,7 @@ var performDiff = function performDiff(before, after, /* optional */key) { module.exports = performDiff; -},{}],273:[function(require,module,exports){ +},{}],276:[function(require,module,exports){ "use strict"; var classNames = require("classnames"); @@ -31294,7 +31609,7 @@ var WidgetDiff = React.createClass({ module.exports = WidgetDiff; -},{"./widget-diff-performer.jsx":272,"classnames":12,"react":246}],274:[function(require,module,exports){ +},{"./widget-diff-performer.jsx":275,"classnames":12,"react":249}],277:[function(require,module,exports){ 'use strict'; var React = require('react'); @@ -31564,7 +31879,7 @@ var EditorPage = React.createClass({ module.exports = EditorPage; -},{"./components/prop-check-box.jsx":262,"./enabled-features.jsx":276,"./hint-editor.jsx":277,"./item-editor.jsx":289,"./item-renderer.jsx":290,"./perseus-api.jsx":294,"react":246,"react-dom":95}],275:[function(require,module,exports){ +},{"./components/prop-check-box.jsx":265,"./enabled-features.jsx":279,"./hint-editor.jsx":280,"./item-editor.jsx":292,"./item-renderer.jsx":293,"./perseus-api.jsx":297,"react":249,"react-dom":97}],278:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -32235,7 +32550,7 @@ var Editor = React.createClass({ module.exports = Editor; -},{"./components/prop-check-box.jsx":262,"./util.js":303,"./widgets.js":306,"react":246,"react-addons-create-fragment":63,"react-components/js/drag-target.jsx":67,"react-dom":95}],276:[function(require,module,exports){ +},{"./components/prop-check-box.jsx":265,"./util.js":306,"./widgets.js":309,"react":249,"react-addons-create-fragment":64,"react-components/js/drag-target.jsx":68,"react-dom":97}],279:[function(require,module,exports){ 'use strict'; var React = require('react'); @@ -32253,7 +32568,7 @@ module.exports = { } }; -},{"react":246}],277:[function(require,module,exports){ +},{"react":249}],280:[function(require,module,exports){ "use strict"; /* Collection of classes for rendering the hint editor area, @@ -32514,7 +32829,7 @@ var CombinedHintsEditor = React.createClass({ module.exports = CombinedHintsEditor; -},{"./editor.jsx":275,"./hint-renderer.jsx":278,"react":246,"react-components/js/info-tip.jsx":68,"react-dom":95}],278:[function(require,module,exports){ +},{"./editor.jsx":278,"./hint-renderer.jsx":281,"react":249,"react-components/js/info-tip.jsx":70,"react-dom":97}],281:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -32546,7 +32861,7 @@ var HintRenderer = React.createClass({ module.exports = HintRenderer; -},{"./renderer.jsx":298,"react":246}],279:[function(require,module,exports){ +},{"./renderer.jsx":301,"react":249}],282:[function(require,module,exports){ 'use strict'; var React = require('react'); @@ -32597,7 +32912,7 @@ window.ReactDOM = ReactDOM; module.exports = init; -},{"react":246,"react-dom":95}],280:[function(require,module,exports){ +},{"react":249,"react-dom":97}],283:[function(require,module,exports){ "use strict"; var Movable = require("./interactive2/movable.js"); @@ -32619,7 +32934,7 @@ var Interactive2 = { module.exports = Interactive2; -},{"./interactive2/movable-line.js":284,"./interactive2/movable-point.js":286,"./interactive2/movable.js":287}],281:[function(require,module,exports){ +},{"./interactive2/movable-line.js":287,"./interactive2/movable-point.js":289,"./interactive2/movable.js":290}],284:[function(require,module,exports){ "use strict"; /** @@ -32698,7 +33013,7 @@ var InteractiveUtil = { module.exports = InteractiveUtil; -},{"./movable-helper-methods.js":282}],282:[function(require,module,exports){ +},{"./movable-helper-methods.js":285}],285:[function(require,module,exports){ "use strict"; /** @@ -32795,7 +33110,7 @@ var MovableHelperMethods = { module.exports = MovableHelperMethods; -},{}],283:[function(require,module,exports){ +},{}],286:[function(require,module,exports){ "use strict"; /** @@ -33037,7 +33352,7 @@ module.exports = { onMoveEnd: { standard: null } }; -},{}],284:[function(require,module,exports){ +},{}],287:[function(require,module,exports){ "use strict"; /** @@ -33296,7 +33611,7 @@ _.extend(MovableLine.prototype, { module.exports = MovableLine; -},{"./interactive-util.js":281,"./movable-line-options.js":283,"./objective_.js":288}],285:[function(require,module,exports){ +},{"./interactive-util.js":284,"./movable-line-options.js":286,"./objective_.js":291}],288:[function(require,module,exports){ "use strict"; /** @@ -33422,7 +33737,7 @@ module.exports = { onClick: { standard: null } }; -},{}],286:[function(require,module,exports){ +},{}],289:[function(require,module,exports){ "use strict"; /** @@ -33545,11 +33860,11 @@ _.extend(MovablePoint.prototype, { // - are objects, not primitives (and need a deeper copy) // - they don't need getters created for them // TODO(jack): Consider "default" once we es3ify perseus - objective_.pluck(MovablePointOptions, "standard") + objective_.pluck(MovablePointOptions, "standard" // We only update props here, because we want things on state to // be persistent, and updated appropriately in modify() - ), DEFAULT_PROPS); + )), DEFAULT_PROPS); }, /** @@ -33745,7 +34060,7 @@ _.extend(MovablePoint.prototype, { module.exports = MovablePoint; -},{"./interactive-util.js":281,"./movable-point-options.js":285,"./objective_.js":288}],287:[function(require,module,exports){ +},{"./interactive-util.js":284,"./movable-point-options.js":288,"./objective_.js":291}],290:[function(require,module,exports){ "use strict"; /** @@ -33980,7 +34295,7 @@ _.extend(Movable.prototype, { module.exports = Movable; -},{"./interactive-util.js":281}],288:[function(require,module,exports){ +},{"./interactive-util.js":284}],291:[function(require,module,exports){ "use strict"; /** @@ -34011,7 +34326,7 @@ var pluck = exports.pluck = function (table, subKey) { })); }; -},{}],289:[function(require,module,exports){ +},{}],292:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -34158,7 +34473,7 @@ var ItemEditor = React.createClass({ module.exports = ItemEditor; -},{"./answer-area-editor.jsx":250,"./editor.jsx":275,"./version.json":304,"react":246}],290:[function(require,module,exports){ +},{"./answer-area-editor.jsx":253,"./editor.jsx":278,"./version.json":307,"react":249}],293:[function(require,module,exports){ 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -34484,7 +34799,7 @@ var ItemRenderer = React.createClass({ module.exports = ItemRenderer; -},{"./answer-area-renderer.jsx":251,"./enabled-features.jsx":276,"./hint-renderer.jsx":278,"./perseus-api.jsx":294,"./renderer.jsx":298,"./util.js":303,"react":246,"react-dom":95}],291:[function(require,module,exports){ +},{"./answer-area-renderer.jsx":254,"./enabled-features.jsx":279,"./hint-renderer.jsx":281,"./perseus-api.jsx":297,"./renderer.jsx":301,"./util.js":306,"react":249,"react-dom":97}],294:[function(require,module,exports){ "use strict"; /** @@ -34572,7 +34887,7 @@ var Changeable = { module.exports = Changeable; -},{"./widget-prop-blacklist.jsx":293,"react":246,"underscore":248}],292:[function(require,module,exports){ +},{"./widget-prop-blacklist.jsx":296,"react":249,"underscore":251}],295:[function(require,module,exports){ "use strict"; var WIDGET_PROP_BLACKLIST = require("./widget-prop-blacklist.jsx"); @@ -34586,7 +34901,7 @@ var JsonifyProps = { module.exports = JsonifyProps; -},{"./widget-prop-blacklist.jsx":293}],293:[function(require,module,exports){ +},{"./widget-prop-blacklist.jsx":296}],296:[function(require,module,exports){ "use strict"; module.exports = [ @@ -34596,7 +34911,7 @@ module.exports = [ // added by src/renderer.jsx "widgetId", "onChange", "problemNum", "enabledFeatures", "apiOptions"]; -},{}],294:[function(require,module,exports){ +},{}],297:[function(require,module,exports){ "use strict"; /** @@ -34670,7 +34985,7 @@ module.exports = { } }; -},{"react":246}],295:[function(require,module,exports){ +},{"react":249}],298:[function(require,module,exports){ "use strict"; require("./all-widgets.js"); @@ -34693,7 +35008,7 @@ module.exports = { Util: require("./util.js") }; -},{"./all-widgets.js":249,"./answer-area-renderer.jsx":251,"./diffs/revision-diff.jsx":268,"./editor-page.jsx":274,"./editor.jsx":275,"./init.js":279,"./item-renderer.jsx":290,"./perseus-api.jsx":294,"./render.js":297,"./renderer.jsx":298,"./stateful-editor-page.jsx":299,"./util.js":303,"./version.json":304}],296:[function(require,module,exports){ +},{"./all-widgets.js":252,"./answer-area-renderer.jsx":254,"./diffs/revision-diff.jsx":271,"./editor-page.jsx":277,"./editor.jsx":278,"./init.js":282,"./item-renderer.jsx":293,"./perseus-api.jsx":297,"./render.js":300,"./renderer.jsx":301,"./stateful-editor-page.jsx":302,"./util.js":306,"./version.json":307}],299:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -34712,7 +35027,7 @@ var QuestionParagraph = React.createClass({ module.exports = QuestionParagraph; -},{"react":246}],297:[function(require,module,exports){ +},{"react":249}],300:[function(require,module,exports){ 'use strict'; var React = require('react'); @@ -34724,7 +35039,7 @@ var render = function render(Component, dom, props) { module.exports = render; -},{"react":246,"react-dom":95}],298:[function(require,module,exports){ +},{"react":249,"react-dom":97}],301:[function(require,module,exports){ 'use strict'; var React = require('react'); @@ -35400,7 +35715,7 @@ function extractMathAndWidgets(text) { module.exports = Renderer; -},{"./enabled-features.jsx":276,"./perseus-api.jsx":294,"./question-paragraph.jsx":296,"./tex.jsx":302,"./util.js":303,"./widget-container.jsx":305,"./widgets.js":306,"react":246,"react-dom":95}],299:[function(require,module,exports){ +},{"./enabled-features.jsx":279,"./perseus-api.jsx":297,"./question-paragraph.jsx":299,"./tex.jsx":305,"./util.js":306,"./widget-container.jsx":308,"./widgets.js":309,"react":249,"react-dom":97}],302:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -35445,7 +35760,7 @@ var StatefulEditorPage = React.createClass({ module.exports = StatefulEditorPage; -},{"./editor-page.jsx":274,"react":246}],300:[function(require,module,exports){ +},{"./editor-page.jsx":277,"react":249}],303:[function(require,module,exports){ "use strict"; // Generated by running: @@ -35554,7 +35869,7 @@ module.exports = { module.exports.radioBorderColor = module.exports.gray76; module.exports.checkedColor = module.exports.kaGreen; -},{}],301:[function(require,module,exports){ +},{}],304:[function(require,module,exports){ "use strict"; /** @@ -35597,7 +35912,7 @@ module.exports = { lgOrLarger: "@media screen and (min-width: " + pureLgMin + ")" }; -},{"./constants.js":300}],302:[function(require,module,exports){ +},{"./constants.js":303}],305:[function(require,module,exports){ "use strict"; /** @@ -35755,7 +36070,7 @@ var TeX = React.createClass({ module.exports = TeX; -},{"react":246}],303:[function(require,module,exports){ +},{"react":249}],306:[function(require,module,exports){ "use strict"; var nestedMap = function nestedMap(children, func, context) { @@ -36205,11 +36520,11 @@ var Util = { * CC-BY-SA 2.5 license. */ strongEncodeURIComponent: function strongEncodeURIComponent(str) { - return encodeURIComponent(str) + return encodeURIComponent(str // Note that although RFC3986 reserves "!", RFC5987 does not, // so we do not need to escape it - .replace(/['()!]/g, window.escape) // i.e., %27 %28 %29 - .replace(/\*/g, '%2A'); + ).replace(/['()!]/g, window.escape // i.e., %27 %28 %29 + ).replace(/\*/g, '%2A'); }, // There are certain widgets where we don't want to provide the "answered" @@ -36309,7 +36624,7 @@ Util.random = Util.seededRNG(new Date().getTime() & 0xffffffff); module.exports = Util; -},{}],304:[function(require,module,exports){ +},{}],307:[function(require,module,exports){ module.exports={ "apiVersion": { "major": 1, @@ -36321,7 +36636,7 @@ module.exports={ } } -},{}],305:[function(require,module,exports){ +},{}],308:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -36372,7 +36687,7 @@ var WidgetContainer = React.createClass({ module.exports = WidgetContainer; -},{"classnames":12,"react":246}],306:[function(require,module,exports){ +},{"classnames":12,"react":249}],309:[function(require,module,exports){ "use strict"; var widgets = {}; @@ -36502,7 +36817,7 @@ var Widgets = { module.exports = Widgets; -},{}],307:[function(require,module,exports){ +},{}],310:[function(require,module,exports){ "use strict"; var React = require("react"); @@ -36728,7 +37043,7 @@ module.exports = { hidden: false }; -},{"../components/text-list-editor.jsx":267,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"../renderer.jsx":298,"../util.js":303,"react":246}],308:[function(require,module,exports){ +},{"../components/text-list-editor.jsx":270,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"../renderer.jsx":301,"../util.js":306,"react":249}],311:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -37042,7 +37357,7 @@ module.exports = { hidden: false }; -},{"../components/fancy-select.jsx":252,"../mixins/jsonify-props.jsx":292,"../perseus-api.jsx":294,"../util.js":303,"classnames":12,"react":246,"react-components/js/info-tip.jsx":68,"react-dom":95}],309:[function(require,module,exports){ +},{"../components/fancy-select.jsx":255,"../mixins/jsonify-props.jsx":295,"../perseus-api.jsx":297,"../util.js":306,"classnames":12,"react":249,"react-components/js/info-tip.jsx":70,"react-dom":97}],312:[function(require,module,exports){ "use strict"; /** @@ -37237,7 +37552,7 @@ module.exports = { editor: ExampleGraphieWidgetEditor }; -},{"../components/graphie.jsx":257,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"../util.js":303,"react":246}],310:[function(require,module,exports){ +},{"../components/graphie.jsx":260,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"../util.js":306,"react":249}],313:[function(require,module,exports){ "use strict"; /** @@ -37427,7 +37742,7 @@ module.exports = { editor: ExampleWidgetEditor }; -},{"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"react":246}],311:[function(require,module,exports){ +},{"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"react":249}],314:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -37528,7 +37843,7 @@ var ExplanationEditor = React.createClass({ module.exports = ExplanationEditor; -},{"../components/text-input.jsx":266,"../editor.jsx":275,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"react":246,"underscore":248}],312:[function(require,module,exports){ +},{"../components/text-input.jsx":269,"../editor.jsx":278,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"react":249,"underscore":251}],315:[function(require,module,exports){ "use strict"; var _explanationLink, _mobileExplanationLin; @@ -37796,7 +38111,7 @@ module.exports = { transform: _.identity }; -},{"../mixins/changeable.jsx":291,"../perseus-api.jsx":294,"../renderer.jsx":298,"../styles/constants.js":300,"../styles/media-queries.js":301,"aphrodite":5,"react":246,"underscore":248}],313:[function(require,module,exports){ +},{"../mixins/changeable.jsx":294,"../perseus-api.jsx":297,"../renderer.jsx":301,"../styles/constants.js":303,"../styles/media-queries.js":304,"aphrodite":5,"react":249,"underscore":251}],316:[function(require,module,exports){ "use strict"; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } @@ -38353,7 +38668,7 @@ module.exports = { propUpgrades: propUpgrades }; -},{"../components/input-with-examples.jsx":258,"../components/math-input.jsx":259,"../components/prop-check-box.jsx":262,"../components/tex-buttons.jsx":265,"../enabled-features.jsx":276,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"../perseus-api.jsx":294,"../tex.jsx":302,"../util.js":303,"classnames":12,"react":246,"react-components/js/info-tip.jsx":68,"react-components/js/tooltip.jsx":72,"react-dom":95}],314:[function(require,module,exports){ +},{"../components/input-with-examples.jsx":261,"../components/math-input.jsx":262,"../components/prop-check-box.jsx":265,"../components/tex-buttons.jsx":268,"../enabled-features.jsx":279,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"../perseus-api.jsx":297,"../tex.jsx":305,"../util.js":306,"classnames":12,"react":249,"react-components/js/info-tip.jsx":70,"react-components/js/tooltip.jsx":74,"react-dom":97}],317:[function(require,module,exports){ "use strict"; /** @@ -38627,13 +38942,14 @@ module.exports = { editor: IframeEditor }; -},{"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"../util.js":303,"react":246,"react-components/js/blur-input.jsx":65}],315:[function(require,module,exports){ +},{"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"../util.js":306,"react":249,"react-components/js/blur-input.jsx":66}],318:[function(require,module,exports){ "use strict"; var React = require("react"); var _ = require("underscore"); var BlurInput = require("react-components/js/blur-input.jsx"); +var FileInput = require("react-components/js/file-input.jsx"); var InfoTip = require("react-components/js/info-tip.jsx"); var Changeable = require("../mixins/changeable.jsx"); @@ -38789,8 +39105,11 @@ var ImageEditor = React.createClass({ null, "\u5716\u7247\u7DB2\u5740:", ' ', + React.createElement("textarea", { value: this.props.backgroundImage.url }), React.createElement(BlurInput, { value: this.props.backgroundImage.url, onChange: this.onUrlChange }), + React.createElement(FileInput, { value: this.props.backgroundImage.name, + onChange: this.onUrlChange }), React.createElement( InfoTip, null, @@ -39005,7 +39324,7 @@ module.exports = { editor: ImageEditor }; -},{"../components/graphie.jsx":257,"../components/range-input.jsx":263,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"react":246,"react-components/js/blur-input.jsx":65,"react-components/js/info-tip.jsx":68,"underscore":248}],316:[function(require,module,exports){ +},{"../components/graphie.jsx":260,"../components/range-input.jsx":266,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"react":249,"react-components/js/blur-input.jsx":66,"react-components/js/file-input.jsx":69,"react-components/js/info-tip.jsx":70,"underscore":251}],319:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -39376,7 +39695,7 @@ module.exports = { transform: propTransform }; -},{"../components/input-with-examples.jsx":258,"../enabled-features.jsx":276,"../perseus-api.jsx":294,"../renderer.jsx":298,"../tex.jsx":302,"../util.js":303,"react":246,"react-components/js/blur-input.jsx":65,"react-components/js/info-tip.jsx":68,"react-dom":95}],317:[function(require,module,exports){ +},{"../components/input-with-examples.jsx":261,"../enabled-features.jsx":279,"../perseus-api.jsx":297,"../renderer.jsx":301,"../tex.jsx":305,"../util.js":306,"react":249,"react-components/js/blur-input.jsx":66,"react-components/js/info-tip.jsx":70,"react-dom":97}],320:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -41933,7 +42252,7 @@ module.exports = { hidden: false }; -},{"../components/graph-settings.jsx":253,"../components/graph.jsx":254,"../components/number-input.jsx":261,"../interactive2.js":280,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68}],318:[function(require,module,exports){ +},{"../components/graph-settings.jsx":256,"../components/graph.jsx":257,"../components/number-input.jsx":264,"../interactive2.js":283,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70}],321:[function(require,module,exports){ "use strict"; var React = require("react"); @@ -42478,7 +42797,7 @@ module.exports = { editor: InteractiveNumberLineEditor }; -},{"../components/prop-check-box.jsx":262,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68,"react-dom":95,"underscore":248}],319:[function(require,module,exports){ +},{"../components/prop-check-box.jsx":265,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70,"react-dom":97,"underscore":251}],322:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -42954,7 +43273,7 @@ module.exports = { transform: transformProps }; -},{"../components/number-input.jsx":261,"../components/prop-check-box.jsx":262,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"react":246,"react-components/js/info-tip.jsx":68}],320:[function(require,module,exports){ +},{"../components/number-input.jsx":264,"../components/prop-check-box.jsx":265,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"react":249,"react-components/js/info-tip.jsx":70}],323:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -43253,7 +43572,7 @@ module.exports = { hidden: false }; -},{"../components/prop-check-box.jsx":262,"../components/sortable.jsx":264,"../components/text-list-editor.jsx":267,"../renderer.jsx":298,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68}],321:[function(require,module,exports){ +},{"../components/prop-check-box.jsx":265,"../components/sortable.jsx":267,"../components/text-list-editor.jsx":270,"../renderer.jsx":301,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70}],324:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -43880,7 +44199,7 @@ module.exports = { staticTransform: staticTransform }; -},{"../components/range-input.jsx":263,"../components/text-input.jsx":266,"../editor.jsx":275,"../interactive2/interactive-util.js":281,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"../perseus-api.jsx":294,"../renderer.jsx":298,"../util.js":303,"classnames":12,"react":246,"react-dom":95,"underscore":248}],322:[function(require,module,exports){ +},{"../components/range-input.jsx":266,"../components/text-input.jsx":269,"../editor.jsx":278,"../interactive2/interactive-util.js":284,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"../perseus-api.jsx":297,"../renderer.jsx":301,"../util.js":306,"classnames":12,"react":249,"react-dom":97,"underscore":251}],325:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -44297,7 +44616,7 @@ module.exports = { hidden: false }; -},{"../components/number-input.jsx":261,"../components/prop-check-box.jsx":262,"../components/range-input.jsx":263,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"react":246,"react-components/js/info-tip.jsx":68,"react-dom":95}],323:[function(require,module,exports){ +},{"../components/number-input.jsx":264,"../components/prop-check-box.jsx":265,"../components/range-input.jsx":266,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"react":249,"react-components/js/info-tip.jsx":70,"react-dom":97}],326:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -45276,7 +45595,7 @@ module.exports = { hidden: false }; -},{"../components/graphie.jsx":257,"../components/number-input.jsx":261,"../components/prop-check-box.jsx":262,"../components/range-input.jsx":263,"../interactive2.js":280,"../interactive2/interactive-util.js":281,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"../util.js":303,"react":246,"react-components/js/button-group.jsx":66,"react-components/js/info-tip.jsx":68}],324:[function(require,module,exports){ +},{"../components/graphie.jsx":260,"../components/number-input.jsx":264,"../components/prop-check-box.jsx":265,"../components/range-input.jsx":266,"../interactive2.js":283,"../interactive2/interactive-util.js":284,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"../util.js":306,"react":249,"react-components/js/button-group.jsx":67,"react-components/js/info-tip.jsx":70}],327:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -45836,7 +46155,7 @@ module.exports = { hidden: false }; -},{"../components/input-with-examples.jsx":258,"../components/multi-button-group.jsx":260,"../components/number-input.jsx":261,"../components/prop-check-box.jsx":262,"../editor.jsx":275,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"../util.js":303,"react":246,"react-components/js/button-group.jsx":66,"react-components/js/info-tip.jsx":68,"underscore":248}],325:[function(require,module,exports){ +},{"../components/input-with-examples.jsx":261,"../components/multi-button-group.jsx":263,"../components/number-input.jsx":264,"../components/prop-check-box.jsx":265,"../editor.jsx":278,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"../util.js":306,"react":249,"react-components/js/button-group.jsx":67,"react-components/js/info-tip.jsx":70,"underscore":251}],328:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -46568,7 +46887,7 @@ module.exports = { hidden: false }; -},{"../components/text-list-editor.jsx":267,"../renderer.jsx":298,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68,"react-dom":95}],326:[function(require,module,exports){ +},{"../components/text-list-editor.jsx":270,"../renderer.jsx":301,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70,"react-dom":97}],329:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -47621,12 +47940,13 @@ module.exports = { hidden: false }; -},{"../components/number-input.jsx":261,"../components/range-input.jsx":263,"../components/text-list-editor.jsx":267,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68,"react-dom":95}],327:[function(require,module,exports){ +},{"../components/number-input.jsx":264,"../components/range-input.jsx":266,"../components/text-list-editor.jsx":270,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70,"react-dom":97}],330:[function(require,module,exports){ 'use strict'; var React = require('react'); var ReactDOM = require('react-dom'); var classNames = require("classnames"); +var RadioImage = require("./image.jsx").editor; var Changeable = require("../mixins/changeable.jsx"); var ApiClassNames = require("../perseus-api.jsx").ClassNames; @@ -47635,6 +47955,7 @@ var ButtonGroup = require("react-components/js/button-group.jsx"); var Editor = require("../editor.jsx"); var PropCheckBox = require("../components/prop-check-box.jsx"); var Renderer = require("../renderer.jsx"); +var FileInput = require("react-components/js/file-input.jsx"); var InfoTip = require("react-components/js/info-tip.jsx"); @@ -47650,7 +47971,8 @@ var BaseRadio = React.createClass({ multipleSelect: React.PropTypes.bool, onCheckedChange: React.PropTypes.func, showClues: React.PropTypes.bool, - onePerLine: React.PropTypes.bool + onePerLine: React.PropTypes.bool, + widgets: React.PropTypes.widgets }, getDefaultProps: function getDefaultProps() { @@ -47790,8 +48112,10 @@ var Radio = React.createClass({ content = _.pick(choice, "content"); } return { - // We need to make a copy, which _.pick does - content: React.createElement(Renderer, content), + // We need to make a copy, which _.pick does + content: React.createElement(Renderer, { + content: choice.content, + widgets: choice.widgets }), checked: values[i], clue: React.createElement(Renderer, { content: choice.clue }) }; @@ -47805,7 +48129,7 @@ var Radio = React.createClass({ multipleSelect: this.props.multipleSelect, showClues: this.state.showClues, choices: choices.map(function (choice) { - return _.pick(choice, "content", "checked", "clue"); + return _.pick(choice, "content", "checked", "clue", "widgets"); }), onCheckedChange: this.onCheckedChange }); }, @@ -47947,6 +48271,7 @@ var RadioEditor = React.createClass({ propTypes: { choices: React.PropTypes.arrayOf(React.PropTypes.shape({ + widgets: React.PropTypes.object, content: React.PropTypes.string, clue: React.PropTypes.string, correct: React.PropTypes.bool @@ -47997,12 +48322,39 @@ var RadioEditor = React.createClass({ var editor = React.createElement(Editor, { ref: "editor" + i, content: choice.content || "", - widgetEnabled: false, + widgets: choice.widgets || "", + widgetEnabled: true, placeholder: "請輸入選項內容", onChange: function onChange(newProps) { - if ("content" in newProps) { + if ("content" in newProps || "widgets" in newProps) { _this2.onContentChange(i, newProps.content); } + // if ("widgets" in newProps) { + // this.onWidgetChange(i, newProps.content);} + } + }); + var testeditor = React.createElement(Editor, { + ref: "test-editor" + i + // content={choice.widgets || ""} + , widgets: choice.widgets || "", + widgetEnabled: true, + placeholder: "請輸入選項內容", + onChange: function onChange(newProps) { + if ("widgets" in newProps) { + _this2.onWidgetChange(i, newProps.widgets); + } + // if ("widgets" in newProps) { + // this.onWidgetChange(i, newProps.content);} + } + }); + var imageEditor = React.createElement(RadioImage, { + ref: "radio-image" + i, + content: choice.image || "", + placeholder: "請插入圖片", + onChange: function onChange(newProps) { + if ("content" in newProps) { + _this2.onImageChange(i, newProps.content); + } } }); var clueEditor = React.createElement(Editor, { @@ -48091,10 +48443,36 @@ var RadioEditor = React.createClass({ this.props.onChange({ choices: choices }); }, - onContentChange: function onContentChange(choiceIndex, newContent) { + onContentChange: function onContentChange(choiceIndex, newContent, newWidgets) { + var choices = this.props.choices.slice(); + if (newContent) { + choices[choiceIndex] = _.extend({}, choices[choiceIndex], { + content: newContent + }); + } + if (newWidgets) { + choices[choiceIndex] = _.extend({}, choices[choiceIndex], { + widgets: newWidgets + }); + } + + this.props.onChange({ choices: choices }); + }, + + onImageChange: function onImageChange(choiceIndex, newImage) { var choices = this.props.choices.slice(); choices[choiceIndex] = _.extend({}, choices[choiceIndex], { - content: newContent + image: newImage + }); + if (newImage === "") { + delete choices[choiceIndex].clue; + } + this.props.onChange({ choices: choices }); + }, + onWidgetChange: function onWidgetChange(choiceIndex, newWidget) { + var choices = this.props.choices.slice(); + choices[choiceIndex] = _.extend({}, choices[choiceIndex], { + widgets: newWidget }); this.props.onChange({ choices: choices }); }, @@ -48194,7 +48572,7 @@ module.exports = { transform: choiceTransform }; -},{"../components/prop-check-box.jsx":262,"../editor.jsx":275,"../mixins/changeable.jsx":291,"../perseus-api.jsx":294,"../renderer.jsx":298,"../util.js":303,"classnames":12,"react":246,"react-components/js/button-group.jsx":66,"react-components/js/info-tip.jsx":68,"react-dom":95}],328:[function(require,module,exports){ +},{"../components/prop-check-box.jsx":265,"../editor.jsx":278,"../mixins/changeable.jsx":294,"../perseus-api.jsx":297,"../renderer.jsx":301,"../util.js":306,"./image.jsx":318,"classnames":12,"react":249,"react-components/js/button-group.jsx":67,"react-components/js/file-input.jsx":69,"react-components/js/info-tip.jsx":70,"react-dom":97}],331:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -48416,7 +48794,7 @@ module.exports = { hidden: false }; -},{"../components/prop-check-box.jsx":262,"../components/sortable.jsx":264,"../components/text-list-editor.jsx":267,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68}],329:[function(require,module,exports){ +},{"../components/prop-check-box.jsx":265,"../components/sortable.jsx":267,"../components/text-list-editor.jsx":270,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70}],332:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -48777,7 +49155,7 @@ module.exports = { editor: SpeakingTextInputEditor }; -},{"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"classnames":12,"react":246}],330:[function(require,module,exports){ +},{"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"classnames":12,"react":249}],333:[function(require,module,exports){ "use strict"; var React = require('react'); @@ -49138,7 +49516,7 @@ module.exports = { editor: SpeakingVoiceEditor }; -},{"../../lib/responsivevoice.js":2,"../mixins/changeable.jsx":291,"../mixins/jsonify-props.jsx":292,"react":246}],331:[function(require,module,exports){ +},{"../../lib/responsivevoice.js":2,"../mixins/changeable.jsx":294,"../mixins/jsonify-props.jsx":295,"react":249}],334:[function(require,module,exports){ 'use strict'; var React = require('react'); @@ -49519,7 +49897,7 @@ module.exports = { hidden: false }; -},{"../editor.jsx":275,"../renderer.jsx":298,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68,"react-dom":95}],332:[function(require,module,exports){ +},{"../editor.jsx":278,"../renderer.jsx":301,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70,"react-dom":97}],335:[function(require,module,exports){ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -52078,5 +52456,5 @@ module.exports = { hidden: false }; -},{"../components/graph-settings.jsx":253,"../components/graph.jsx":254,"../components/number-input.jsx":261,"../components/prop-check-box.jsx":262,"../tex.jsx":302,"../util.js":303,"react":246,"react-components/js/info-tip.jsx":68}]},{},[295])(295) +},{"../components/graph-settings.jsx":256,"../components/graph.jsx":257,"../components/number-input.jsx":264,"../components/prop-check-box.jsx":265,"../tex.jsx":305,"../util.js":306,"react":249,"react-components/js/info-tip.jsx":70}]},{},[298])(298) }); \ No newline at end of file diff --git a/src/widgets/image.jsx b/src/widgets/image.jsx index f786d1f5dd..26925f6a2a 100644 --- a/src/widgets/image.jsx +++ b/src/widgets/image.jsx @@ -160,6 +160,7 @@ var ImageEditor = React.createClass({ render: function() { var imageSettings =
圖片網址:{' '} +