diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/react-dom/lib | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/react-dom/lib')
63 files changed, 397 insertions, 277 deletions
diff --git a/node_modules/react-dom/lib/BeforeInputEventPlugin.js b/node_modules/react-dom/lib/BeforeInputEventPlugin.js index 61ef00a03..be43a7f93 100644 --- a/node_modules/react-dom/lib/BeforeInputEventPlugin.js +++ b/node_modules/react-dom/lib/BeforeInputEventPlugin.js @@ -373,7 +373,6 @@ function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEv * `composition` event types. */ var BeforeInputEventPlugin = { - eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { diff --git a/node_modules/react-dom/lib/CSSProperty.js b/node_modules/react-dom/lib/CSSProperty.js index 4c319870b..8507106b1 100644 --- a/node_modules/react-dom/lib/CSSProperty.js +++ b/node_modules/react-dom/lib/CSSProperty.js @@ -30,7 +30,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, diff --git a/node_modules/react-dom/lib/CSSPropertyOperations.js b/node_modules/react-dom/lib/CSSPropertyOperations.js index 03837d8c9..2d7c11438 100644 --- a/node_modules/react-dom/lib/CSSPropertyOperations.js +++ b/node_modules/react-dom/lib/CSSPropertyOperations.js @@ -75,7 +75,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) { @@ -125,7 +125,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: * @@ -145,13 +144,16 @@ var CSSPropertyOperations = { if (!styles.hasOwnProperty(styleName)) { continue; } + var isCustomProperty = styleName.indexOf('--') === 0; var styleValue = styles[styleName]; if (process.env.NODE_ENV !== 'production') { - warnValidStyle(styleName, styleValue, component); + if (!isCustomProperty) { + warnValidStyle(styleName, styleValue, component); + } } if (styleValue != null) { serialized += processStyleName(styleName) + ':'; - serialized += dangerousStyleValue(styleName, styleValue, component) + ';'; + serialized += dangerousStyleValue(styleName, styleValue, component, isCustomProperty) + ';'; } } return serialized || null; @@ -179,14 +181,19 @@ var CSSPropertyOperations = { if (!styles.hasOwnProperty(styleName)) { continue; } + var isCustomProperty = styleName.indexOf('--') === 0; if (process.env.NODE_ENV !== 'production') { - warnValidStyle(styleName, styles[styleName], component); + if (!isCustomProperty) { + warnValidStyle(styleName, styles[styleName], component); + } } - var styleValue = dangerousStyleValue(styleName, styles[styleName], component); + var styleValue = dangerousStyleValue(styleName, styles[styleName], component, isCustomProperty); if (styleName === 'float' || styleName === 'cssFloat') { styleName = styleFloatAccessor; } - if (styleValue) { + if (isCustomProperty) { + style.setProperty(styleName, styleValue); + } else if (styleValue) { style[styleName] = styleValue; } else { var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName]; @@ -202,7 +209,6 @@ var CSSPropertyOperations = { } } } - }; module.exports = CSSPropertyOperations;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ChangeEventPlugin.js b/node_modules/react-dom/lib/ChangeEventPlugin.js index 808bdbf46..0da17879e 100644 --- a/node_modules/react-dom/lib/ChangeEventPlugin.js +++ b/node_modules/react-dom/lib/ChangeEventPlugin.js @@ -17,6 +17,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'); @@ -31,13 +32,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 @@ -54,8 +59,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 @@ -91,11 +95,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 @@ -114,105 +128,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 @@ -230,7 +193,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. @@ -242,10 +205,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); } } @@ -256,12 +216,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); } } @@ -296,9 +263,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; @@ -311,21 +280,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; } } @@ -339,7 +306,6 @@ var ChangeEventPlugin = { handleControlledInputBlur(targetInst, targetNode); } } - }; module.exports = ChangeEventPlugin;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/DOMChildrenOperations.js b/node_modules/react-dom/lib/DOMChildrenOperations.js index 905dc3ec0..ebbdc756b 100644 --- a/node_modules/react-dom/lib/DOMChildrenOperations.js +++ b/node_modules/react-dom/lib/DOMChildrenOperations.js @@ -145,7 +145,6 @@ if (process.env.NODE_ENV !== 'production') { * Operations for updating with DOM children. */ var DOMChildrenOperations = { - dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, replaceDelimitedText: replaceDelimitedText, @@ -171,7 +170,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; @@ -218,7 +220,6 @@ var DOMChildrenOperations = { } } } - }; module.exports = DOMChildrenOperations;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/DOMProperty.js b/node_modules/react-dom/lib/DOMProperty.js index 87f7e73cf..da76729eb 100644 --- a/node_modules/react-dom/lib/DOMProperty.js +++ b/node_modules/react-dom/lib/DOMProperty.js @@ -136,7 +136,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', diff --git a/node_modules/react-dom/lib/DOMPropertyOperations.js b/node_modules/react-dom/lib/DOMPropertyOperations.js index 94b110930..12bad8169 100644 --- a/node_modules/react-dom/lib/DOMPropertyOperations.js +++ b/node_modules/react-dom/lib/DOMPropertyOperations.js @@ -45,7 +45,6 @@ function shouldIgnoreValue(propertyInfo, value) { * Operations for dealing with DOM properties. */ var DOMPropertyOperations = { - /** * Creates markup for the ID property. * @@ -230,7 +229,6 @@ var DOMPropertyOperations = { }); } } - }; module.exports = DOMPropertyOperations;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/Danger.js b/node_modules/react-dom/lib/Danger.js index ce3e491ca..5e25bf2d0 100644 --- a/node_modules/react-dom/lib/Danger.js +++ b/node_modules/react-dom/lib/Danger.js @@ -20,7 +20,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. @@ -41,7 +40,6 @@ var Danger = { DOMLazyTree.replaceChildWithTree(oldChild, markup); } } - }; module.exports = Danger;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/EnterLeaveEventPlugin.js b/node_modules/react-dom/lib/EnterLeaveEventPlugin.js index 9b07d08a6..891b5f548 100644 --- a/node_modules/react-dom/lib/EnterLeaveEventPlugin.js +++ b/node_modules/react-dom/lib/EnterLeaveEventPlugin.js @@ -26,7 +26,6 @@ var eventTypes = { }; var EnterLeaveEventPlugin = { - eventTypes: eventTypes, /** @@ -93,7 +92,6 @@ var EnterLeaveEventPlugin = { return [leave, enter]; } - }; module.exports = EnterLeaveEventPlugin;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/EventPluginHub.js b/node_modules/react-dom/lib/EventPluginHub.js index ee95b1256..85ea4a501 100644 --- a/node_modules/react-dom/lib/EventPluginHub.js +++ b/node_modules/react-dom/lib/EventPluginHub.js @@ -105,12 +105,10 @@ function shouldPreventMouseEvent(name, type, props) { * @public */ var EventPluginHub = { - /** * Methods for injecting dependencies. */ injection: { - /** * @param {array} InjectedEventPluginOrder * @public @@ -121,7 +119,6 @@ var EventPluginHub = { * @param {object} injectedNamesToPlugins Map from names to plugin modules. */ injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName - }, /** @@ -271,7 +268,6 @@ var EventPluginHub = { __getListenerBank: function () { return listenerBank; } - }; module.exports = EventPluginHub;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/EventPluginRegistry.js b/node_modules/react-dom/lib/EventPluginRegistry.js index 378ddd4b0..ddd3d9b98 100644 --- a/node_modules/react-dom/lib/EventPluginRegistry.js +++ b/node_modules/react-dom/lib/EventPluginRegistry.js @@ -108,7 +108,6 @@ function publishRegistrationName(registrationName, pluginModule, eventName) { * @see {EventPluginHub} */ var EventPluginRegistry = { - /** * Ordered list of injected plugins. */ @@ -248,7 +247,6 @@ var EventPluginRegistry = { } } } - }; module.exports = EventPluginRegistry;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/LinkedValueUtils.js b/node_modules/react-dom/lib/LinkedValueUtils.js index 8e4610f62..a1e61415f 100644 --- a/node_modules/react-dom/lib/LinkedValueUtils.js +++ b/node_modules/react-dom/lib/LinkedValueUtils.js @@ -22,13 +22,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) { diff --git a/node_modules/react-dom/lib/ReactBrowserEventEmitter.js b/node_modules/react-dom/lib/ReactBrowserEventEmitter.js index 0b83bc025..ac2990c15 100644 --- a/node_modules/react-dom/lib/ReactBrowserEventEmitter.js +++ b/node_modules/react-dom/lib/ReactBrowserEventEmitter.js @@ -175,7 +175,6 @@ function getListeningForDocument(mountAt) { * @internal */ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { - /** * Injectable event backend */ @@ -249,14 +248,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); @@ -321,7 +318,6 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { isMonitoringScrollValue = true; } } - }); module.exports = ReactBrowserEventEmitter;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactChildFiber.js b/node_modules/react-dom/lib/ReactChildFiber.js index c78c63809..ed3bd96e1 100644 --- a/node_modules/react-dom/lib/ReactChildFiber.js +++ b/node_modules/react-dom/lib/ReactChildFiber.js @@ -30,7 +30,6 @@ var createReifiedYield = ReactReifiedYield.createReifiedYield; var isArray = Array.isArray; function ChildReconciler(shouldClone) { - function createSubsequentChild(returnFiber, existingChild, previousSibling, newChildren, priority) { if (typeof newChildren !== 'object' || newChildren === null) { return previousSibling; diff --git a/node_modules/react-dom/lib/ReactChildReconciler.js b/node_modules/react-dom/lib/ReactChildReconciler.js index cf37bd63b..e89f763d3 100644 --- a/node_modules/react-dom/lib/ReactChildReconciler.js +++ b/node_modules/react-dom/lib/ReactChildReconciler.js @@ -59,8 +59,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; } @@ -86,8 +86,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. @@ -147,7 +147,6 @@ var ReactChildReconciler = { } } } - }; module.exports = ReactChildReconciler;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactComponentBrowserEnvironment.js b/node_modules/react-dom/lib/ReactComponentBrowserEnvironment.js index 0948c01d4..e35d5a869 100644 --- a/node_modules/react-dom/lib/ReactComponentBrowserEnvironment.js +++ b/node_modules/react-dom/lib/ReactComponentBrowserEnvironment.js @@ -19,11 +19,9 @@ var ReactDOMIDOperations = require('./ReactDOMIDOperations'); * need for this injection. */ var ReactComponentBrowserEnvironment = { - processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup - }; module.exports = ReactComponentBrowserEnvironment;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactComponentEnvironment.js b/node_modules/react-dom/lib/ReactComponentEnvironment.js index 1521594aa..e3a1abd4d 100644 --- a/node_modules/react-dom/lib/ReactComponentEnvironment.js +++ b/node_modules/react-dom/lib/ReactComponentEnvironment.js @@ -18,7 +18,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. @@ -39,7 +38,6 @@ var ReactComponentEnvironment = { injected = true; } } - }; module.exports = ReactComponentEnvironment;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactCompositeComponent.js b/node_modules/react-dom/lib/ReactCompositeComponent.js index 9f751b203..c80d8f561 100644 --- a/node_modules/react-dom/lib/ReactCompositeComponent.js +++ b/node_modules/react-dom/lib/ReactCompositeComponent.js @@ -117,7 +117,6 @@ var nextMountID = 1; * @lends {ReactCompositeComponent.prototype} */ var ReactCompositeComponent = { - /** * Base constructor for all composite component. * @@ -213,7 +212,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 @@ -895,7 +894,6 @@ var ReactCompositeComponent = { // Stub _instantiateReactComponent: null - }; module.exports = ReactCompositeComponent;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactDOM.js b/node_modules/react-dom/lib/ReactDOM.js index 105cae143..22384bbb0 100644 --- a/node_modules/react-dom/lib/ReactDOM.js +++ b/node_modules/react-dom/lib/ReactDOM.js @@ -35,6 +35,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. @@ -63,7 +64,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. @@ -75,7 +75,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 diff --git a/node_modules/react-dom/lib/ReactDOMComponent.js b/node_modules/react-dom/lib/ReactDOMComponent.js index 725918ca6..7306071f6 100644 --- a/node_modules/react-dom/lib/ReactDOMComponent.js +++ b/node_modules/react-dom/lib/ReactDOMComponent.js @@ -39,6 +39,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'); @@ -49,7 +50,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'; @@ -158,7 +159,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; @@ -248,6 +249,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 @@ -263,7 +268,6 @@ function trapBubbledEventsLocal() { break; case 'video': case 'audio': - inst._wrapperState.listeners = []; // Create listener for each media event for (var event in mediaEvents) { @@ -297,34 +301,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 @@ -388,7 +393,6 @@ function ReactDOMComponent(element) { ReactDOMComponent.displayName = 'ReactDOMComponent'; ReactDOMComponent.Mixin = { - /** * Generates root tag markup then recurses. This method has side effects and * is not idempotent. @@ -425,6 +429,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': @@ -439,6 +444,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; } @@ -964,6 +970,10 @@ ReactDOMComponent.Mixin = { } } break; + case 'input': + case 'textarea': + inputValueTracking.stopTracking(this); + break; case 'html': case 'head': case 'body': @@ -992,7 +1002,6 @@ ReactDOMComponent.Mixin = { getPublicInstance: function () { return getNode(this); } - }; _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin); diff --git a/node_modules/react-dom/lib/ReactDOMFiber.js b/node_modules/react-dom/lib/ReactDOMFiber.js index ac9a2180a..8188b18c8 100644 --- a/node_modules/react-dom/lib/ReactDOMFiber.js +++ b/node_modules/react-dom/lib/ReactDOMFiber.js @@ -63,7 +63,6 @@ var DOMRenderer = ReactFiberReconciler({ scheduleAnimationCallback: window.requestAnimationFrame, scheduleDeferredCallback: window.requestIdleCallback - }); var warned = false; diff --git a/node_modules/react-dom/lib/ReactDOMIDOperations.js b/node_modules/react-dom/lib/ReactDOMIDOperations.js index 11c615984..f30f1bbc4 100644 --- a/node_modules/react-dom/lib/ReactDOMIDOperations.js +++ b/node_modules/react-dom/lib/ReactDOMIDOperations.js @@ -17,7 +17,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. * diff --git a/node_modules/react-dom/lib/ReactDOMInput.js b/node_modules/react-dom/lib/ReactDOMInput.js index 4b5697f33..40a9a4259 100644 --- a/node_modules/react-dom/lib/ReactDOMInput.js +++ b/node_modules/react-dom/lib/ReactDOMInput.js @@ -150,14 +150,16 @@ var ReactDOMInput = { // Simulate `input.valueAsNumber`. IE9 does not support it var valueAsNumber = parseFloat(node.value, 10) || 0; + if ( // eslint-disable-next-line - if (value != valueAsNumber) { + value != valueAsNumber || + // eslint-disable-next-line + 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; diff --git a/node_modules/react-dom/lib/ReactDOMOption.js b/node_modules/react-dom/lib/ReactDOMOption.js index 4846e9d51..44777d6b7 100644 --- a/node_modules/react-dom/lib/ReactDOMOption.js +++ b/node_modules/react-dom/lib/ReactDOMOption.js @@ -116,7 +116,6 @@ var ReactDOMOption = { return hostProps; } - }; module.exports = ReactDOMOption;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactDOMTextComponent.js b/node_modules/react-dom/lib/ReactDOMTextComponent.js index 73b4026f3..c1f149240 100644 --- a/node_modules/react-dom/lib/ReactDOMTextComponent.js +++ b/node_modules/react-dom/lib/ReactDOMTextComponent.js @@ -52,7 +52,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. @@ -157,7 +156,6 @@ _assign(ReactDOMTextComponent.prototype, { this._commentNodes = null; ReactDOMComponentTree.uncacheNode(this); } - }); module.exports = ReactDOMTextComponent;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactDebugTool.js b/node_modules/react-dom/lib/ReactDebugTool.js index 9ec0d20cd..4df393017 100644 --- a/node_modules/react-dom/lib/ReactDebugTool.js +++ b/node_modules/react-dom/lib/ReactDebugTool.js @@ -226,7 +226,9 @@ function markEnd(debugID, markType) { } performance.clearMarks(markName); - performance.clearMeasures(measurementName); + if (measurementName) { + performance.clearMeasures(measurementName); + } } var ReactDebugTool = { diff --git a/node_modules/react-dom/lib/ReactEventEmitterMixin.js b/node_modules/react-dom/lib/ReactEventEmitterMixin.js index fc9c0cd53..74d5b8a13 100644 --- a/node_modules/react-dom/lib/ReactEventEmitterMixin.js +++ b/node_modules/react-dom/lib/ReactEventEmitterMixin.js @@ -18,7 +18,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. diff --git a/node_modules/react-dom/lib/ReactFiber.js b/node_modules/react-dom/lib/ReactFiber.js index 07737ecc4..2774a2dc4 100644 --- a/node_modules/react-dom/lib/ReactFiber.js +++ b/node_modules/react-dom/lib/ReactFiber.js @@ -47,7 +47,6 @@ var _require = require('./ReactPriorityLevel'), // compatible. var createFiber = function (tag, key) { return { - // Instance tag: tag, @@ -83,7 +82,6 @@ var createFiber = function (tag, key) { progressedChild: null, alternate: null - }; }; diff --git a/node_modules/react-dom/lib/ReactFiberBeginWork.js b/node_modules/react-dom/lib/ReactFiberBeginWork.js index baa1197a6..d87b6f0a7 100644 --- a/node_modules/react-dom/lib/ReactFiberBeginWork.js +++ b/node_modules/react-dom/lib/ReactFiberBeginWork.js @@ -42,7 +42,6 @@ var _require4 = require('./ReactFiberUpdateQueue'), var ReactInstanceMap = require('./ReactInstanceMap'); module.exports = function (config, getScheduler) { - function markChildAsProgressed(current, workInProgress, priorityLevel) { // We now have clones. Let's store them as the currently progressed work. workInProgress.progressedChild = workInProgress.child; diff --git a/node_modules/react-dom/lib/ReactFiberCommitWork.js b/node_modules/react-dom/lib/ReactFiberCommitWork.js index 7e5132f3c..bdf063c8f 100644 --- a/node_modules/react-dom/lib/ReactFiberCommitWork.js +++ b/node_modules/react-dom/lib/ReactFiberCommitWork.js @@ -20,7 +20,6 @@ var _require = require('./ReactFiberUpdateQueue'), callCallbacks = _require.callCallbacks; module.exports = function (config) { - var updateContainer = config.updateContainer; var commitUpdate = config.commitUpdate; diff --git a/node_modules/react-dom/lib/ReactFiberCompleteWork.js b/node_modules/react-dom/lib/ReactFiberCompleteWork.js index a6836755a..74f7fc764 100644 --- a/node_modules/react-dom/lib/ReactFiberCompleteWork.js +++ b/node_modules/react-dom/lib/ReactFiberCompleteWork.js @@ -26,7 +26,6 @@ var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, module.exports = function (config) { - var createInstance = config.createInstance; var prepareUpdate = config.prepareUpdate; @@ -193,7 +192,6 @@ module.exports = function (config) { case YieldComponent: // Does nothing. return null; - // Error cases case IndeterminateComponent: throw new Error('An indeterminate component should have become determinate before completing.'); diff --git a/node_modules/react-dom/lib/ReactInputSelection.js b/node_modules/react-dom/lib/ReactInputSelection.js index 91308646f..fec1c74fc 100644 --- a/node_modules/react-dom/lib/ReactInputSelection.js +++ b/node_modules/react-dom/lib/ReactInputSelection.js @@ -27,7 +27,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'); diff --git a/node_modules/react-dom/lib/ReactInstanceMap.js b/node_modules/react-dom/lib/ReactInstanceMap.js index 6303bb51e..ae0a7f6a8 100644 --- a/node_modules/react-dom/lib/ReactInstanceMap.js +++ b/node_modules/react-dom/lib/ReactInstanceMap.js @@ -20,7 +20,6 @@ // 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 @@ -41,7 +40,6 @@ var ReactInstanceMap = { set: function (key, value) { key._reactInternalInstance = value; } - }; module.exports = ReactInstanceMap;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactMount.js b/node_modules/react-dom/lib/ReactMount.js index bb7d5bf81..b0f7ceb99 100644 --- a/node_modules/react-dom/lib/ReactMount.js +++ b/node_modules/react-dom/lib/ReactMount.js @@ -256,7 +256,6 @@ TopLevelWrapper.isReactTopLevelWrapper = true; * Inside of `container`, the first element rendered is the "reactRoot". */ var ReactMount = { - TopLevelWrapper: TopLevelWrapper, /** @@ -345,13 +344,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 <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : - // 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 <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : 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 <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : // 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 <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : 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) { @@ -440,7 +440,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); @@ -453,7 +453,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; diff --git a/node_modules/react-dom/lib/ReactMultiChild.js b/node_modules/react-dom/lib/ReactMultiChild.js index e52005ff2..66b07e388 100644 --- a/node_modules/react-dom/lib/ReactMultiChild.js +++ b/node_modules/react-dom/lib/ReactMultiChild.js @@ -168,7 +168,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 @@ -177,7 +176,6 @@ var ReactMultiChild = { * @lends {ReactMultiChild.prototype} */ Mixin: { - _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) { if (process.env.NODE_ENV !== 'production') { var selfDebugID = getDebugID(this); @@ -441,9 +439,7 @@ var ReactMultiChild = { child._mountIndex = null; return update; } - } - }; module.exports = ReactMultiChild;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactOwner.js b/node_modules/react-dom/lib/ReactOwner.js index 6a6fbb922..4c81d3898 100644 --- a/node_modules/react-dom/lib/ReactOwner.js +++ b/node_modules/react-dom/lib/ReactOwner.js @@ -87,7 +87,6 @@ var ReactOwner = { owner.detachRef(ref); } } - }; module.exports = ReactOwner;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactPerf.js b/node_modules/react-dom/lib/ReactPerf.js index a7e1201bc..891b9dc81 100644 --- a/node_modules/react-dom/lib/ReactPerf.js +++ b/node_modules/react-dom/lib/ReactPerf.js @@ -16,7 +16,7 @@ var _assign = require('object-assign'); var _extends = _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; }; var ReactDebugTool = require('./ReactDebugTool'); -var warning = require('fbjs/lib/warning'); +var lowPriorityWarning = require('./lowPriorityWarning'); var alreadyWarned = false; function roundFloat(val) { @@ -360,7 +360,7 @@ function printExclusive(flushHistory) { var renderCount = item.counts.render || 0; var renderDuration = item.durations.render || 0; return { - 'Component': key, + Component: key, 'Total time (ms)': roundFloat(totalDuration), 'Instance count': instanceCount, 'Total render time (ms)': roundFloat(renderDuration), @@ -428,8 +428,8 @@ function printOperations(flushHistory) { var table = stats.map(function (stat) { return { 'Owner > Node': stat.key, - 'Operation': stat.type, - 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload, + Operation: stat.type, + Payload: typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload, 'Flush index': stat.flushIndex, 'Owner Component ID': stat.ownerID, 'DOM Component ID': stat.instanceID @@ -440,14 +440,14 @@ function printOperations(flushHistory) { var warnedAboutPrintDOM = false; function printDOM(measurements) { - process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0; + lowPriorityWarning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.'); warnedAboutPrintDOM = true; return printOperations(measurements); } var warnedAboutGetMeasurementsSummaryMap = false; function getMeasurementsSummaryMap(measurements) { - process.env.NODE_ENV !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0; + lowPriorityWarning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.'); warnedAboutGetMeasurementsSummaryMap = true; return getWasted(measurements); } diff --git a/node_modules/react-dom/lib/ReactPriorityLevel.js b/node_modules/react-dom/lib/ReactPriorityLevel.js index e84ba8920..fc524e65a 100644 --- a/node_modules/react-dom/lib/ReactPriorityLevel.js +++ b/node_modules/react-dom/lib/ReactPriorityLevel.js @@ -17,4 +17,5 @@ module.exports = { AnimationPriority: 2, // Needs to complete before the next frame. HighPriority: 3, // Interaction that needs to complete pretty soon to feel responsive. LowPriority: 4, // Data fetching, or result from updating stores. - OffscreenPriority: 5 };
\ No newline at end of file + OffscreenPriority: 5 // Won't be visible but do the work in case it becomes visible. +};
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactReconciler.js b/node_modules/react-dom/lib/ReactReconciler.js index 7b3cdfdc4..23e54a020 100644 --- a/node_modules/react-dom/lib/ReactReconciler.js +++ b/node_modules/react-dom/lib/ReactReconciler.js @@ -24,7 +24,6 @@ function attachRefs() { } var ReactReconciler = { - /** * Initializes the component, renders markup, and registers event listeners. * @@ -36,8 +35,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); @@ -161,7 +160,6 @@ var ReactReconciler = { } } } - }; module.exports = ReactReconciler;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactSimpleEmptyComponent.js b/node_modules/react-dom/lib/ReactSimpleEmptyComponent.js index d3c04efb8..74f293320 100644 --- a/node_modules/react-dom/lib/ReactSimpleEmptyComponent.js +++ b/node_modules/react-dom/lib/ReactSimpleEmptyComponent.js @@ -19,8 +19,8 @@ var ReactSimpleEmptyComponent = function (placeholderElement, instantiate) { this._renderedComponent = instantiate(placeholderElement); }; _assign(ReactSimpleEmptyComponent.prototype, { - mountComponent: function (transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots - ) { + mountComponent: function (transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots + { return ReactReconciler.mountComponent(this._renderedComponent, transaction, hostParent, hostContainerInfo, context, parentDebugID); }, receiveComponent: function () {}, diff --git a/node_modules/react-dom/lib/ReactTestUtils.js b/node_modules/react-dom/lib/ReactTestUtils.js index 340eb627e..79fb36444 100644 --- a/node_modules/react-dom/lib/ReactTestUtils.js +++ b/node_modules/react-dom/lib/ReactTestUtils.js @@ -281,6 +281,7 @@ var ReactTestUtils = { */ simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) { fakeNativeEvent.target = node; + fakeNativeEvent.simulated = true; ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent); }, diff --git a/node_modules/react-dom/lib/ReactUpdateQueue.js b/node_modules/react-dom/lib/ReactUpdateQueue.js index 96b42fb5b..f1fda7c8d 100644 --- a/node_modules/react-dom/lib/ReactUpdateQueue.js +++ b/node_modules/react-dom/lib/ReactUpdateQueue.js @@ -51,7 +51,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; @@ -62,7 +62,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. @@ -229,7 +228,6 @@ 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;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ReactVersion.js b/node_modules/react-dom/lib/ReactVersion.js index 077806963..3ea2eb058 100644 --- a/node_modules/react-dom/lib/ReactVersion.js +++ b/node_modules/react-dom/lib/ReactVersion.js @@ -10,4 +10,4 @@ 'use strict'; -module.exports = '15.5.4';
\ No newline at end of file +module.exports = '15.6.1';
\ No newline at end of file diff --git a/node_modules/react-dom/lib/ResponderEventPlugin.js b/node_modules/react-dom/lib/ResponderEventPlugin.js index d2b9befcd..dc35ded47 100644 --- a/node_modules/react-dom/lib/ResponderEventPlugin.js +++ b/node_modules/react-dom/lib/ResponderEventPlugin.js @@ -340,7 +340,6 @@ function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, n EventPropagators.accumulateDirectDispatches(grantEvent); var blockHostResponder = executeDirectDispatch(grantEvent) === true; if (responderInst) { - var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); terminationRequestEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; EventPropagators.accumulateDirectDispatches(terminationRequestEvent); @@ -411,7 +410,6 @@ function noResponderTouches(nativeEvent) { } var ResponderEventPlugin = { - /* For unit testing only */ _getResponderID: function () { return responderInst ? responderInst._rootNodeID : null; diff --git a/node_modules/react-dom/lib/SelectEventPlugin.js b/node_modules/react-dom/lib/SelectEventPlugin.js index 0d0af2110..28b820e46 100644 --- a/node_modules/react-dom/lib/SelectEventPlugin.js +++ b/node_modules/react-dom/lib/SelectEventPlugin.js @@ -123,7 +123,6 @@ function constructSelectEvent(nativeEvent, nativeEventTarget) { * - Fires after user input. */ var SelectEventPlugin = { - eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -147,7 +146,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': @@ -157,7 +155,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. diff --git a/node_modules/react-dom/lib/SimpleEventPlugin.js b/node_modules/react-dom/lib/SimpleEventPlugin.js index 600beed77..f2673cb72 100644 --- a/node_modules/react-dom/lib/SimpleEventPlugin.js +++ b/node_modules/react-dom/lib/SimpleEventPlugin.js @@ -81,7 +81,6 @@ function isInteractive(tag) { } var SimpleEventPlugin = { - eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -221,7 +220,6 @@ var SimpleEventPlugin = { delete onClickListeners[key]; } } - }; module.exports = SimpleEventPlugin;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/SyntheticEvent.js b/node_modules/react-dom/lib/SyntheticEvent.js index 6b745cccc..61d869bb1 100644 --- a/node_modules/react-dom/lib/SyntheticEvent.js +++ b/node_modules/react-dom/lib/SyntheticEvent.js @@ -102,7 +102,6 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg } _assign(SyntheticEvent.prototype, { - preventDefault: function () { this.defaultPrevented = true; var event = this.nativeEvent; @@ -112,8 +111,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; @@ -127,8 +126,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 @@ -177,7 +176,6 @@ _assign(SyntheticEvent.prototype, { Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); } } - }); SyntheticEvent.Interface = EventInterface; @@ -193,7 +191,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; @@ -262,6 +260,6 @@ 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; } }
\ No newline at end of file diff --git a/node_modules/react-dom/lib/SyntheticWheelEvent.js b/node_modules/react-dom/lib/SyntheticWheelEvent.js index e3ac8f9fa..2ef895075 100644 --- a/node_modules/react-dom/lib/SyntheticWheelEvent.js +++ b/node_modules/react-dom/lib/SyntheticWheelEvent.js @@ -18,15 +18,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, diff --git a/node_modules/react-dom/lib/TapEventPlugin.js b/node_modules/react-dom/lib/TapEventPlugin.js index 463fe9851..ec1606877 100644 --- a/node_modules/react-dom/lib/TapEventPlugin.js +++ b/node_modules/react-dom/lib/TapEventPlugin.js @@ -74,7 +74,6 @@ var usedTouchTime = 0; var TOUCH_DELAY = 1000; var TapEventPlugin = { - tapMoveThreshold: tapMoveThreshold, eventTypes: eventTypes, @@ -109,7 +108,6 @@ var TapEventPlugin = { EventPropagators.accumulateTwoPhaseDispatches(event); return event; } - }; module.exports = TapEventPlugin;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/Transaction.js b/node_modules/react-dom/lib/Transaction.js index 565e55a0a..f329dbb42 100644 --- a/node_modules/react-dom/lib/Transaction.js +++ b/node_modules/react-dom/lib/Transaction.js @@ -108,6 +108,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 @@ -126,6 +128,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; diff --git a/node_modules/react-dom/lib/ViewportMetrics.js b/node_modules/react-dom/lib/ViewportMetrics.js index cfc945ae5..4c2a2372d 100644 --- a/node_modules/react-dom/lib/ViewportMetrics.js +++ b/node_modules/react-dom/lib/ViewportMetrics.js @@ -11,7 +11,6 @@ 'use strict'; var ViewportMetrics = { - currentScrollLeft: 0, currentScrollTop: 0, @@ -20,7 +19,6 @@ var ViewportMetrics = { ViewportMetrics.currentScrollLeft = scrollPosition.x; ViewportMetrics.currentScrollTop = scrollPosition.y; } - }; module.exports = ViewportMetrics;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/dangerousStyleValue.js b/node_modules/react-dom/lib/dangerousStyleValue.js index 6996df2fe..1164f1a91 100644 --- a/node_modules/react-dom/lib/dangerousStyleValue.js +++ b/node_modules/react-dom/lib/dangerousStyleValue.js @@ -26,7 +26,7 @@ var styleWarnings = {}; * @param {ReactDOMComponent} component * @return {string} Normalized style value with dimensions applied. */ -function dangerousStyleValue(name, value, component) { +function dangerousStyleValue(name, value, component, isCustomProperty) { // Note that we've removed escapeTextForBrowser() calls here since the // whole string will be escaped when the attribute is injected into // the markup. If you provide unsafe user data here they can inject @@ -43,7 +43,7 @@ function dangerousStyleValue(name, value, component) { } var isNonNumeric = isNaN(value); - if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) { + if (isCustomProperty || isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) { return '' + value; // cast to string } diff --git a/node_modules/react-dom/lib/deprecated.js b/node_modules/react-dom/lib/deprecated.js index aa0b49fce..f5683c4ab 100644 --- a/node_modules/react-dom/lib/deprecated.js +++ b/node_modules/react-dom/lib/deprecated.js @@ -13,7 +13,7 @@ var _assign = require('object-assign'); -var warning = require('fbjs/lib/warning'); +var lowPriorityWarning = require('./lowPriorityWarning'); /** * This will log a single deprecation notice per function and forward the call @@ -30,12 +30,12 @@ function deprecated(fnName, newModule, newPackage, ctx, fn) { var warned = false; if (process.env.NODE_ENV !== 'production') { var newFn = function () { - process.env.NODE_ENV !== 'production' ? warning(warned, + lowPriorityWarning(warned, /* eslint-disable no-useless-concat */ // Require examples in this string must be split to prevent React's // build tools from mistaking them for real requires. // Otherwise the build tools will attempt to build a '%s' module. - 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : void 0; + 'React.%s is deprecated. Please use %s.%s from require' + "('%s') " + 'instead.', fnName, newModule, fnName, newPackage); /* eslint-enable no-useless-concat */ warned = true; return fn.apply(ctx, arguments); diff --git a/node_modules/react-dom/lib/escapeTextContentForBrowser.js b/node_modules/react-dom/lib/escapeTextContentForBrowser.js index ec29818d2..6138f315e 100644 --- a/node_modules/react-dom/lib/escapeTextContentForBrowser.js +++ b/node_modules/react-dom/lib/escapeTextContentForBrowser.js @@ -102,7 +102,6 @@ function escapeHtml(string) { } // end code copied and modified from escape-html - /** * Escapes text to prevent scripting attacks. * diff --git a/node_modules/react-dom/lib/getEventKey.js b/node_modules/react-dom/lib/getEventKey.js index ad92bbd47..a8408b4c5 100644 --- a/node_modules/react-dom/lib/getEventKey.js +++ b/node_modules/react-dom/lib/getEventKey.js @@ -17,18 +17,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' }; /** @@ -58,8 +58,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' diff --git a/node_modules/react-dom/lib/getEventModifierState.js b/node_modules/react-dom/lib/getEventModifierState.js index c8a68fcb9..0af4df74c 100644 --- a/node_modules/react-dom/lib/getEventModifierState.js +++ b/node_modules/react-dom/lib/getEventModifierState.js @@ -16,10 +16,10 @@ */ 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 diff --git a/node_modules/react-dom/lib/inputValueTracking.js b/node_modules/react-dom/lib/inputValueTracking.js new file mode 100644 index 000000000..7a7fa137a --- /dev/null +++ b/node_modules/react-dom/lib/inputValueTracking.js @@ -0,0 +1,122 @@ +/** + * 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 or Safari, then 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 and Safari) + if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + 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;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/instantiateReactComponent.js b/node_modules/react-dom/lib/instantiateReactComponent.js index 2f81c8c71..e4a3bdd3f 100644 --- a/node_modules/react-dom/lib/instantiateReactComponent.js +++ b/node_modules/react-dom/lib/instantiateReactComponent.js @@ -67,7 +67,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); diff --git a/node_modules/react-dom/lib/isTextInputElement.js b/node_modules/react-dom/lib/isTextInputElement.js index 1b6193e5a..52276a38e 100644 --- a/node_modules/react-dom/lib/isTextInputElement.js +++ b/node_modules/react-dom/lib/isTextInputElement.js @@ -16,21 +16,21 @@ */ 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) { diff --git a/node_modules/react-dom/lib/lowPriorityWarning.js b/node_modules/react-dom/lib/lowPriorityWarning.js new file mode 100644 index 000000000..8c0f58bff --- /dev/null +++ b/node_modules/react-dom/lib/lowPriorityWarning.js @@ -0,0 +1,64 @@ +/** + * 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;
\ No newline at end of file diff --git a/node_modules/react-dom/lib/setInnerHTML.js b/node_modules/react-dom/lib/setInnerHTML.js index 6c5f3d301..23488df6f 100644 --- a/node_modules/react-dom/lib/setInnerHTML.js +++ b/node_modules/react-dom/lib/setInnerHTML.js @@ -76,7 +76,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. diff --git a/node_modules/react-dom/lib/traverseAllChildren.js b/node_modules/react-dom/lib/traverseAllChildren.js index 008ab088a..6970a0cc3 100644 --- a/node_modules/react-dom/lib/traverseAllChildren.js +++ b/node_modules/react-dom/lib/traverseAllChildren.js @@ -131,7 +131,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(); diff --git a/node_modules/react-dom/lib/validateDOMNesting.js b/node_modules/react-dom/lib/validateDOMNesting.js index 116e61d9a..ec74f513a 100644 --- a/node_modules/react-dom/lib/validateDOMNesting.js +++ b/node_modules/react-dom/lib/validateDOMNesting.js @@ -121,7 +121,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 @@ -130,25 +129,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'; @@ -344,7 +338,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 + '>'; |