react-dom 16.1.2 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-dom-server.browser.development.js +68 -51
- package/cjs/react-dom-server.browser.production.min.js +20 -19
- package/cjs/react-dom-server.node.development.js +69 -52
- package/cjs/react-dom-server.node.production.min.js +22 -21
- package/cjs/react-dom-test-utils.development.js +8 -1
- package/cjs/react-dom-test-utils.production.min.js +2 -1
- package/cjs/react-dom-unstable-native-dependencies.development.js +3 -1
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +2 -1
- package/cjs/react-dom.development.js +297 -303
- package/cjs/react-dom.production.min.js +209 -207
- package/package.json +1 -1
- package/umd/react-dom-server.browser.development.js +120 -105
- package/umd/react-dom-server.browser.production.min.js +26 -27
- package/umd/react-dom-test-utils.development.js +1247 -0
- package/umd/react-dom-test-utils.production.min.js +29 -0
- package/umd/react-dom-unstable-native-dependencies.development.js +16 -16
- package/umd/react-dom-unstable-native-dependencies.production.min.js +1 -1
- package/umd/react-dom.development.js +511 -519
- package/umd/react-dom.production.min.js +182 -182
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @license React v16.2.0
|
|
2
|
+
* react-dom-test-utils.production.min.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
'use strict';(function(m,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p(require("react"),require("react-dom")):"function"===typeof define&&define.amd?define(["react","react-dom"],p):m.ReactTestUtils=p(m.React,m.ReactDOM)})(this,function(m,p){function k(a){for(var b=arguments.length-1,c="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,f=0;f<b;f++)c+="\x26args[]\x3d"+encodeURIComponent(arguments[f+1]);b=Error(c+
|
|
10
|
+
" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;}function v(a){return function(){return a}}function A(a){var b=a;if(a.alternate)for(;b["return"];)b=b["return"];else{if(0!==(b.effectTag&2))return 1;for(;b["return"];)if(b=b["return"],0!==(b.effectTag&2))return 1}return 3===b.tag?2:3}function B(a){2!==A(a)?k("188"):void 0}function I(a){var b=a.alternate;if(!b)return b=A(a),3===b?k("188"):
|
|
11
|
+
void 0,1===b?null:a;for(var c=a,f=b;;){var g=c["return"],e=g?g.alternate:null;if(!g||!e)break;if(g.child===e.child){for(var d=g.child;d;){if(d===c)return B(g),a;if(d===f)return B(g),b;d=d.sibling}k("188")}if(c["return"]!==f["return"])c=g,f=e;else{d=!1;for(var l=g.child;l;){if(l===c){d=!0;c=g;f=e;break}if(l===f){d=!0;f=g;c=e;break}l=l.sibling}if(!d){for(l=e.child;l;){if(l===c){d=!0;c=e;f=g;break}if(l===f){d=!0;f=e;c=g;break}l=l.sibling}d?void 0:k("189")}}c.alternate!==f?k("190"):void 0}3!==c.tag?k("188"):
|
|
12
|
+
void 0;return c.stateNode.current===c?a:b}function t(a,b,c,f){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=f:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?n.thatReturnsTrue:n.thatReturnsFalse;this.isPropagationStopped=n.thatReturnsFalse;return this}function J(a,b,c,d){if(this.eventPool.length){var f=this.eventPool.pop();
|
|
13
|
+
this.call(f,a,b,c,d);return f}return new this(a,b,c,d)}function K(a){a instanceof this?void 0:k("223");a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function C(a){a.eventPool=[];a.getPooled=J;a.release=K}function w(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;c["ms"+a]="MS"+b;c["O"+a]="o"+b.toLowerCase();return c}function x(a){if(y[a])return y[a];if(!h[a])return a;var b=h[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in D)return y[a]=b[c];
|
|
14
|
+
return""}function E(a){}function L(a,b){if(!a)return[];a=I(a);if(!a)return[];for(var c=a,d=[];;){if(5===c.tag||6===c.tag||2===c.tag||1===c.tag){var e=c.stateNode;b(e)&&d.push(e)}if(c.child)c.child["return"]=c,c=c.child;else{if(c===a)return d;for(;!c.sibling;){if(!c["return"]||c["return"]===a)return d;c=c["return"]}c.sibling["return"]=c["return"];c=c.sibling}}}function M(a){return function(b,c){m.isValidElement(b)?k("228"):void 0;e.isCompositeComponent(b)?k("229"):void 0;var d=F.eventNameDispatchConfigs[a],
|
|
15
|
+
g=new E;g.target=b;g.type=a.toLowerCase();var n=N.getInstanceFromNode(b),h=new t(d,n,g,b);h.persist();u(h,c);d.phasedRegistrationNames?G.accumulateTwoPhaseDispatches(h):G.accumulateDirectDispatches(h);p.unstable_batchedUpdates(function(){O.enqueueStateRestore(b);q.enqueueEvents(h);q.processEventQueue(!0)})}}function z(){e.Simulate={};for(var a in F.eventNameDispatchConfigs)e.Simulate[a]=M(a)}function P(a){return function(b,c){var d=new E(a);u(d,c);e.isDOMComponent(b)?e.simulateNativeEventOnDOMComponent(a,
|
|
16
|
+
b,d):b.tagName&&e.simulateNativeEventOnNode(a,b,d)}}var u=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,d=function(){};d.thatReturns=v;d.thatReturnsFalse=v(!1);d.thatReturnsTrue=v(!0);d.thatReturnsNull=v(null);d.thatReturnsThis=function(){return this};d.thatReturnsArgument=function(a){return a};var n=d,H="dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" ");d={type:null,target:null,currentTarget:n.thatReturnsNull,
|
|
17
|
+
eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=n.thatReturnsTrue)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=
|
|
18
|
+
!0),this.isPropagationStopped=n.thatReturnsTrue)},persist:function(){this.isPersistent=n.thatReturnsTrue},isPersistent:n.thatReturnsFalse,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;for(a=0;a<H.length;a++)this[H[a]]=null}});t.Interface=d;t.augmentClass=function(a,b){var c=function(){};c.prototype=this.prototype;c=new c;u(c,a.prototype);a.prototype=c;a.prototype.constructor=a;a.Interface=u({},this.Interface,b);a.augmentClass=this.augmentClass;C(a)};C(t);d=!("undefined"===
|
|
19
|
+
typeof window||!window.document||!window.document.createElement);var h={animationend:w("Animation","AnimationEnd"),animationiteration:w("Animation","AnimationIteration"),animationstart:w("Animation","AnimationStart"),transitionend:w("Transition","TransitionEnd")},y={},D={};d&&(D=document.createElement("div").style,"AnimationEvent"in window||(delete h.animationend.animation,delete h.animationiteration.animation,delete h.animationstart.animation),"TransitionEvent"in window||delete h.transitionend.transition);
|
|
20
|
+
d={topAbort:"abort",topAnimationEnd:x("animationend")||"animationend",topAnimationIteration:x("animationiteration")||"animationiteration",topAnimationStart:x("animationstart")||"animationstart",topBlur:"blur",topCancel:"cancel",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",
|
|
21
|
+
topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoad:"load",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",
|
|
22
|
+
topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",
|
|
23
|
+
topTouchStart:"touchstart",topTransitionEnd:x("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"};var Q=p.findDOMNode,r=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,q=r.EventPluginHub,F=r.EventPluginRegistry,G=r.EventPropagators,O=r.ReactControlledComponent,N=r.ReactDOMComponentTree,R=r.ReactDOMEventListener,e={renderIntoDocument:function(a){var b=document.createElement("div");return p.render(a,b)},isElement:function(a){return m.isValidElement(a)},
|
|
24
|
+
isElementOfType:function(a,b){return m.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&m.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return e.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a,b){return e.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){if(!a)return[];
|
|
25
|
+
e.isCompositeComponent(a)?void 0:k("10");return L(a._reactInternalFiber,b)},scryRenderedDOMComponentsWithClass:function(a,b){return e.findAllInRenderedTree(a,function(a){if(e.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);Array.isArray(b)||(void 0===b?k("11"):void 0,b=b.split(/\s+/));return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){a=e.scryRenderedDOMComponentsWithClass(a,
|
|
26
|
+
b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){return e.findAllInRenderedTree(a,function(a){return e.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){a=e.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,
|
|
27
|
+
b){return e.findAllInRenderedTree(a,function(a){return e.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){a=e.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return m.createElement(b,null,this.props.children)});return this},simulateNativeEventOnNode:function(a,
|
|
28
|
+
b,c){c.target=b;R.dispatchEvent(a,c)},simulateNativeEventOnDOMComponent:function(a,b,c){e.simulateNativeEventOnNode(a,Q(b),c)},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{}},S=q.injection.injectEventPluginOrder;q.injection.injectEventPluginOrder=function(){S.apply(this,arguments);z()};var T=q.injection.injectEventPluginsByName;q.injection.injectEventPluginsByName=function(){T.apply(this,arguments);z()};z();Object.keys(d).forEach(function(a){var b=
|
|
29
|
+
0===a.indexOf("top")?a.charAt(3).toLowerCase()+a.substr(4):a;e.SimulateNative[b]=P(a)});d=(d=Object.freeze({default:e}))&&e||d;return d["default"]?d["default"]:d});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.2.0
|
|
2
2
|
* react-dom-unstable-native-dependencies.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -74,7 +74,7 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
var invariant_1
|
|
77
|
+
var invariant_1 = invariant;
|
|
78
78
|
|
|
79
79
|
{
|
|
80
80
|
// In DEV mode, we swap out invokeGuardedCallback for a special version
|
|
@@ -201,7 +201,7 @@ var warning = emptyFunction_1;
|
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
var warning_1
|
|
204
|
+
var warning_1 = warning;
|
|
205
205
|
|
|
206
206
|
var getFiberCurrentPropsFromNode = null;
|
|
207
207
|
var getInstanceFromNode = null;
|
|
@@ -214,7 +214,7 @@ var injection = {
|
|
|
214
214
|
getNodeFromInstance = Injected.getNodeFromInstance;
|
|
215
215
|
|
|
216
216
|
{
|
|
217
|
-
warning_1
|
|
217
|
+
warning_1(getNodeFromInstance && getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
};
|
|
@@ -242,7 +242,7 @@ var validateEventDispatches;
|
|
|
242
242
|
var instancesIsArr = Array.isArray(dispatchInstances);
|
|
243
243
|
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
|
|
244
244
|
|
|
245
|
-
warning_1
|
|
245
|
+
warning_1(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.');
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -307,7 +307,7 @@ function executeDirectDispatch(event) {
|
|
|
307
307
|
}
|
|
308
308
|
var dispatchListener = event._dispatchListeners;
|
|
309
309
|
var dispatchInstance = event._dispatchInstances;
|
|
310
|
-
!!Array.isArray(dispatchListener) ? invariant_1
|
|
310
|
+
!!Array.isArray(dispatchListener) ? invariant_1(false, 'executeDirectDispatch(...): Invalid `event`.') : void 0;
|
|
311
311
|
event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null;
|
|
312
312
|
var res = dispatchListener ? dispatchListener(event) : null;
|
|
313
313
|
event.currentTarget = null;
|
|
@@ -501,7 +501,7 @@ function traverseTwoPhase(inst, fn, arg) {
|
|
|
501
501
|
*/
|
|
502
502
|
|
|
503
503
|
function accumulateInto(current, next) {
|
|
504
|
-
!(next != null) ? invariant_1
|
|
504
|
+
!(next != null) ? invariant_1(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;
|
|
505
505
|
|
|
506
506
|
if (current == null) {
|
|
507
507
|
return next;
|
|
@@ -617,7 +617,7 @@ function getListener(inst, registrationName) {
|
|
|
617
617
|
if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
|
|
618
618
|
return null;
|
|
619
619
|
}
|
|
620
|
-
!(!listener || typeof listener === 'function') ? invariant_1
|
|
620
|
+
!(!listener || typeof listener === 'function') ? invariant_1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;
|
|
621
621
|
return listener;
|
|
622
622
|
}
|
|
623
623
|
|
|
@@ -672,7 +672,7 @@ function listenerAtPhase(inst, event, propagationPhase) {
|
|
|
672
672
|
*/
|
|
673
673
|
function accumulateDirectionalDispatches(inst, phase, event) {
|
|
674
674
|
{
|
|
675
|
-
warning_1
|
|
675
|
+
warning_1(inst, 'Dispatching inst must not be null');
|
|
676
676
|
}
|
|
677
677
|
var listener = listenerAtPhase(inst, event, phase);
|
|
678
678
|
if (listener) {
|
|
@@ -949,7 +949,7 @@ SyntheticEvent.augmentClass = function (Class, Interface) {
|
|
|
949
949
|
return new Proxy(constructor.apply(that, args), {
|
|
950
950
|
set: function (target, prop, value) {
|
|
951
951
|
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
|
952
|
-
warning_1
|
|
952
|
+
warning_1(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.');
|
|
953
953
|
didWarnForAddedNewProperty = true;
|
|
954
954
|
}
|
|
955
955
|
target[prop] = value;
|
|
@@ -994,7 +994,7 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
|
|
|
994
994
|
|
|
995
995
|
function warn(action, result) {
|
|
996
996
|
var warningCondition = false;
|
|
997
|
-
warning_1
|
|
997
|
+
warning_1(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);
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
1000
|
|
|
@@ -1010,7 +1010,7 @@ function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
|
|
|
1010
1010
|
|
|
1011
1011
|
function releasePooledEvent(event) {
|
|
1012
1012
|
var EventConstructor = this;
|
|
1013
|
-
!(event instanceof EventConstructor) ? invariant_1
|
|
1013
|
+
!(event instanceof EventConstructor) ? invariant_1(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
|
|
1014
1014
|
event.destructor();
|
|
1015
1015
|
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
|
|
1016
1016
|
EventConstructor.eventPool.push(event);
|
|
@@ -1109,9 +1109,9 @@ function resetTouchRecord(touchRecord, touch) {
|
|
|
1109
1109
|
function getTouchIdentifier(_ref) {
|
|
1110
1110
|
var identifier = _ref.identifier;
|
|
1111
1111
|
|
|
1112
|
-
!(identifier != null) ? invariant_1
|
|
1112
|
+
!(identifier != null) ? invariant_1(false, 'Touch object is missing identifier.') : void 0;
|
|
1113
1113
|
{
|
|
1114
|
-
warning_1
|
|
1114
|
+
warning_1(identifier <= MAX_TOUCH_BANK, 'Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK);
|
|
1115
1115
|
}
|
|
1116
1116
|
return identifier;
|
|
1117
1117
|
}
|
|
@@ -1199,7 +1199,7 @@ var ResponderTouchHistoryStore = {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
{
|
|
1201
1201
|
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
1202
|
-
warning_1
|
|
1202
|
+
warning_1(activeRecord != null && activeRecord.touchActive, 'Cannot find single active touch.');
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
@@ -1217,7 +1217,7 @@ var ResponderTouchHistoryStore = {
|
|
|
1217
1217
|
* @return {*|array<*>} An accumulation of items.
|
|
1218
1218
|
*/
|
|
1219
1219
|
function accumulate(current, next) {
|
|
1220
|
-
!(next != null) ? invariant_1
|
|
1220
|
+
!(next != null) ? invariant_1(false, 'accumulate(...): Accumulated items must be not be null or undefined.') : void 0;
|
|
1221
1221
|
|
|
1222
1222
|
if (current == null) {
|
|
1223
1223
|
return next;
|