react-dom 16.4.0-alpha.0911da3 → 16.4.1
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 +168 -116
- package/cjs/react-dom-server.browser.production.min.js +30 -30
- package/cjs/react-dom-server.node.development.js +169 -117
- package/cjs/react-dom-server.node.production.min.js +32 -32
- package/cjs/react-dom-test-utils.development.js +145 -136
- package/cjs/react-dom-test-utils.production.min.js +25 -26
- package/cjs/react-dom-unstable-native-dependencies.development.js +81 -61
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +27 -28
- package/cjs/react-dom.development.js +11460 -10809
- package/cjs/react-dom.production.min.js +229 -240
- package/cjs/react-dom.profiling.min.js +242 -0
- package/package.json +2 -2
- package/umd/react-dom-server.browser.development.js +172 -120
- package/umd/react-dom-server.browser.production.min.js +29 -28
- package/umd/react-dom-test-utils.development.js +145 -136
- package/umd/react-dom-test-utils.production.min.js +20 -21
- package/umd/react-dom-unstable-native-dependencies.development.js +82 -62
- package/umd/react-dom-unstable-native-dependencies.production.min.js +23 -23
- package/umd/react-dom.development.js +11565 -10914
- package/umd/react-dom.production.min.js +188 -203
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.4.
|
|
1
|
+
/** @license React v16.4.1
|
|
2
2
|
* react-dom-server.node.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -7,37 +7,37 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var
|
|
11
|
-
function
|
|
12
|
-
var
|
|
13
|
-
F={},G={};function
|
|
14
|
-
function
|
|
15
|
-
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){I[a]=new H(a,0,!1,a,null)});
|
|
10
|
+
'use strict';var p=require("object-assign"),r=require("fbjs/lib/invariant"),u=require("react"),w=require("fbjs/lib/emptyFunction"),x=require("fbjs/lib/emptyObject"),y=require("fbjs/lib/hyphenateStyleName"),aa=require("fbjs/lib/memoizeStringOnly"),ba=require("stream");
|
|
11
|
+
function z(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)d+="&args[]="+encodeURIComponent(arguments[c+1]);r(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",d)}
|
|
12
|
+
var A="function"===typeof Symbol&&Symbol.for,ca=A?Symbol.for("react.portal"):60106,C=A?Symbol.for("react.fragment"):60107,da=A?Symbol.for("react.strict_mode"):60108,ea=A?Symbol.for("react.profiler"):60114,E=A?Symbol.for("react.provider"):60109,fa=A?Symbol.for("react.context"):60110,ha=A?Symbol.for("react.async_mode"):60111,ia=A?Symbol.for("react.forward_ref"):60112,ja=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
|
|
13
|
+
F={},G={};function ka(a){if(G.hasOwnProperty(a))return!0;if(F.hasOwnProperty(a))return!1;if(ja.test(a))return G[a]=!0;F[a]=!0;return!1}function la(a,b,d,c){if(null!==d&&0===d.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(c)return!1;if(null!==d)return!d.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}
|
|
14
|
+
function ma(a,b,d,c){if(null===b||"undefined"===typeof b||la(a,b,d,c))return!0;if(c)return!1;if(null!==d)switch(d.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function H(a,b,d,c,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=g;this.mustUseProperty=d;this.propertyName=a;this.type=b}var I={};
|
|
15
|
+
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){I[a]=new H(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];I[b]=new H(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){I[a]=new H(a,2,!1,a.toLowerCase(),null)});
|
|
16
16
|
["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(a){I[a]=new H(a,2,!1,a,null)});"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){I[a]=new H(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){I[a]=new H(a,3,!0,a.toLowerCase(),null)});
|
|
17
|
-
["capture","download"].forEach(function(a){I[a]=new H(a,4,!1,a.toLowerCase(),null)});["cols","rows","size","span"].forEach(function(a){I[a]=new H(a,6,!1,a.toLowerCase(),null)});["rowSpan","start"].forEach(function(a){I[a]=new H(a,5,!1,a.toLowerCase(),null)});var J=/[
|
|
17
|
+
["capture","download"].forEach(function(a){I[a]=new H(a,4,!1,a.toLowerCase(),null)});["cols","rows","size","span"].forEach(function(a){I[a]=new H(a,6,!1,a.toLowerCase(),null)});["rowSpan","start"].forEach(function(a){I[a]=new H(a,5,!1,a.toLowerCase(),null)});var J=/[\-:]([a-z])/g;function K(a){return a[1].toUpperCase()}
|
|
18
18
|
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(J,
|
|
19
|
-
K);I[b]=new H(b,1,!1,a,null)});"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(J,K);I[b]=new H(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(J,K);I[b]=new H(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});I.tabIndex=new H("tabIndex",1,!1,"tabindex",null);var
|
|
20
|
-
function L(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=
|
|
19
|
+
K);I[b]=new H(b,1,!1,a,null)});"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(J,K);I[b]=new H(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(J,K);I[b]=new H(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});I.tabIndex=new H("tabIndex",1,!1,"tabindex",null);var na=/["'&<>]/;
|
|
20
|
+
function L(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=na.exec(a);if(b){var d="",c,g=0;for(c=b.index;c<a.length;c++){switch(a.charCodeAt(c)){case 34:b=""";break;case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}g!==c&&(d+=a.substring(g,c));g=c+1;d+=b}a=g!==c?d+a.substring(g,c):d}return a}var M={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};
|
|
21
21
|
function N(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}
|
|
22
|
-
var O={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},
|
|
23
|
-
fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},
|
|
24
|
-
function S(a){return"string"===typeof a?a:"function"===typeof a?a.displayName||a.name:null}var
|
|
25
|
-
function U(a,b){void 0===a&&
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var V=function(){function a(b,
|
|
31
|
-
this.
|
|
32
|
-
c.footer;b+=
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(
|
|
36
|
-
null!=
|
|
37
|
-
typeof
|
|
38
|
-
P[
|
|
39
|
-
m[0]&&"O"!==m[0]||"n"!==m[1]&&"N"!==m[1]?!1:!0;
|
|
40
|
-
|
|
41
|
-
function
|
|
42
|
-
var W=function(a){function b(
|
|
43
|
-
!1)).read(Infinity)},renderToStaticMarkup:function(a){return(new V(a,!0)).read(Infinity)},renderToNodeStream:function(a){return new W(a,!1)},renderToStaticNodeStream:function(a){return new W(a,!0)},version:"16.4.
|
|
22
|
+
var O={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},oa=p({menuitem:!0},O),P={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,
|
|
23
|
+
fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pa=["Webkit","ms","Moz","O"];Object.keys(P).forEach(function(a){pa.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);P[b]=P[a]})});var Q=u.Children.toArray,R=w.thatReturns("");w.thatReturns("");var qa={listing:!0,pre:!0,textarea:!0};
|
|
24
|
+
function S(a){return"string"===typeof a?a:"function"===typeof a?a.displayName||a.name:null}var ra=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,T={},sa=aa(function(a){return y(a)});function ta(a){var b="";u.Children.forEach(a,function(a){null==a||"string"!==typeof a&&"number"!==typeof a||(b+=a)});return b}function ua(a,b){if(a=a.contextTypes){var d={},c;for(c in a)d[c]=b[c];b=d}else b=x;return b}var va={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};
|
|
25
|
+
function U(a,b){void 0===a&&z("152",S(b)||"Component")}
|
|
26
|
+
function wa(a,b){function d(c,g){var d=ua(g,b),f=[],k=!1,h={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===f)return null},enqueueReplaceState:function(a,b){k=!0;f=[b]},enqueueSetState:function(a,b){if(null===f)return null;f.push(b)}},e=void 0;if(g.prototype&&g.prototype.isReactComponent){if(e=new g(c.props,d,h),"function"===typeof g.getDerivedStateFromProps){var v=g.getDerivedStateFromProps.call(null,c.props,e.state);null!=v&&(e.state=p({},e.state,v))}}else if(e=g(c.props,
|
|
27
|
+
d,h),null==e||null==e.render){a=e;U(a,g);return}e.props=c.props;e.context=d;e.updater=h;h=e.state;void 0===h&&(e.state=h=null);if("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount)if("function"===typeof e.componentWillMount&&"function"!==typeof g.getDerivedStateFromProps&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&"function"!==typeof g.getDerivedStateFromProps&&e.UNSAFE_componentWillMount(),f.length){h=f;var t=k;f=null;k=!1;if(t&&
|
|
28
|
+
1===h.length)e.state=h[0];else{v=t?h[0]:e.state;var m=!0;for(t=t?1:0;t<h.length;t++){var n=h[t];n="function"===typeof n?n.call(e,v,c.props,d):n;null!=n&&(m?(m=!1,v=p({},v,n)):p(v,n))}e.state=v}}else f=null;a=e.render();U(a,g);c=void 0;if("function"===typeof e.getChildContext&&(d=g.childContextTypes,"object"===typeof d)){c=e.getChildContext();for(var q in c)q in d?void 0:z("108",S(g)||"Unknown",q)}c&&(b=p({},b,c))}for(;u.isValidElement(a);){var c=a,g=c.type;if("function"!==typeof g)break;d(c,g)}return{child:a,
|
|
29
|
+
context:b}}
|
|
30
|
+
var V=function(){function a(b,d){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");u.isValidElement(b)?b.type!==C?b=[b]:(b=b.props.children,b=u.isValidElement(b)?[b]:Q(b)):b=Q(b);this.stack=[{type:null,domNamespace:M.html,children:b,childIndex:0,context:x,footer:""}];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup=d;this.contextIndex=-1;this.contextStack=[];this.contextValueStack=[]}a.prototype.pushProvider=function(b){var a=
|
|
31
|
+
++this.contextIndex,c=b.type._context,g=c._currentValue;this.contextStack[a]=c;this.contextValueStack[a]=g;c._currentValue=b.props.value};a.prototype.popProvider=function(){var a=this.contextIndex,d=this.contextStack[a],c=this.contextValueStack[a];this.contextStack[a]=null;this.contextValueStack[a]=null;this.contextIndex--;d._currentValue=c};a.prototype.read=function(a){if(this.exhausted)return null;for(var b="";b.length<a;){if(0===this.stack.length){this.exhausted=!0;break}var c=this.stack[this.stack.length-
|
|
32
|
+
1];if(c.childIndex>=c.children.length){var g=c.footer;b+=g;""!==g&&(this.previousWasTextNode=!1);this.stack.pop();"select"===c.type?this.currentSelectValue=null:null!=c.type&&null!=c.type.type&&c.type.type.$$typeof===E&&this.popProvider(c.type)}else g=c.children[c.childIndex++],b+=this.render(g,c.context,c.domNamespace)}return b};a.prototype.render=function(a,d,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return L(c);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+
|
|
33
|
+
L(c);this.previousWasTextNode=!0;return L(c)}d=wa(a,d);a=d.child;d=d.context;if(null===a||!1===a)return"";if(!u.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof;b===ca?z("257"):void 0;z("258",b.toString())}a=Q(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""});return""}b=a.type;if("string"===typeof b)return this.renderDOM(a,d,c);switch(b){case da:case ha:case ea:case C:return a=Q(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,
|
|
34
|
+
childIndex:0,context:d,footer:""}),""}if("object"===typeof b&&null!==b)switch(b.$$typeof){case ia:return a=Q(b.render(a.props,a.ref)),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case E:return b=Q(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""},this.pushProvider(a),this.stack.push(c),"";case fa:return b=Q(a.props.children(a.type._currentValue)),this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:d,
|
|
35
|
+
footer:""}),""}z("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();c===M.html&&N(b);T.hasOwnProperty(b)||(ra.test(b)?void 0:z("65",b),T[b]=!0);var f=a.props;if("input"===b)f=p({type:void 0},f,{defaultChecked:void 0,defaultValue:void 0,value:null!=f.value?f.value:f.defaultValue,checked:null!=f.checked?f.checked:f.defaultChecked});else if("textarea"===b){var k=f.value;if(null==k){k=f.defaultValue;var l=f.children;null!=l&&(null!=k?z("92"):void 0,Array.isArray(l)&&
|
|
36
|
+
(1>=l.length?void 0:z("93"),l=l[0]),k=""+l);null==k&&(k="")}f=p({},f,{value:void 0,children:""+k})}else if("select"===b)this.currentSelectValue=null!=f.value?f.value:f.defaultValue,f=p({},f,{value:void 0});else if("option"===b){l=this.currentSelectValue;var D=ta(f.children);if(null!=l){var B=null!=f.value?f.value+"":D;k=!1;if(Array.isArray(l))for(var h=0;h<l.length;h++){if(""+l[h]===B){k=!0;break}}else k=""+l===B;f=p({selected:void 0,children:void 0},f,{selected:k,children:D})}}if(k=f)oa[b]&&(null!=
|
|
37
|
+
k.children||null!=k.dangerouslySetInnerHTML?z("137",b,R()):void 0),null!=k.dangerouslySetInnerHTML&&(null!=k.children?z("60"):void 0,"object"===typeof k.dangerouslySetInnerHTML&&"__html"in k.dangerouslySetInnerHTML?void 0:z("61")),null!=k.style&&"object"!==typeof k.style?z("62",R()):void 0;k=f;l=this.makeStaticMarkup;D=1===this.stack.length;B="<"+a.type;for(q in k)if(k.hasOwnProperty(q)){var e=k[q];if(null!=e){if("style"===q){h=void 0;var v="",t="";for(h in e)if(e.hasOwnProperty(h)){var m=0===h.indexOf("--"),
|
|
38
|
+
n=e[h];null!=n&&(v+=t+sa(h)+":",t=h,m=null==n||"boolean"===typeof n||""===n?"":m||"number"!==typeof n||0===n||P.hasOwnProperty(t)&&P[t]?(""+n).trim():n+"px",v+=m,t=";")}e=v||null}h=null;b:if(m=b,n=k,-1===m.indexOf("-"))m="string"===typeof n.is;else switch(m){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":m=!1;break b;default:m=!0}if(m)va.hasOwnProperty(q)||(h=q,h=ka(h)&&null!=
|
|
39
|
+
e?h+"="+('"'+L(e)+'"'):"");else{m=q;h=e;e=I.hasOwnProperty(m)?I[m]:null;if(n="style"!==m)n=null!==e?0===e.type:!(2<m.length)||"o"!==m[0]&&"O"!==m[0]||"n"!==m[1]&&"N"!==m[1]?!1:!0;n||ma(m,h,e,!1)?h="":null!==e?(m=e.attributeName,e=e.type,h=3===e||4===e&&!0===h?m+'=""':m+"="+('"'+L(h)+'"')):h=m+"="+('"'+L(h)+'"')}h&&(B+=" "+h)}}l||D&&(B+=' data-reactroot=""');var q=B;k="";O.hasOwnProperty(b)?q+="/>":(q+=">",k="</"+a.type+">");a:{l=f.dangerouslySetInnerHTML;if(null!=l){if(null!=l.__html){l=l.__html;
|
|
40
|
+
break a}}else if(l=f.children,"string"===typeof l||"number"===typeof l){l=L(l);break a}l=null}null!=l?(f=[],qa[b]&&"\n"===l.charAt(0)&&(q+="\n"),q+=l):f=Q(f.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?N(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c;this.stack.push({domNamespace:c,type:b,children:f,childIndex:0,context:d,footer:k});this.previousWasTextNode=!1;return q};return a}();
|
|
41
|
+
function xa(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}
|
|
42
|
+
var W=function(a){function b(d,c){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var g=a.call(this,{});if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");g=!g||"object"!==typeof g&&"function"!==typeof g?this:g;g.partialRenderer=new V(d,c);return g}xa(b,a);b.prototype._read=function(a){try{this.push(this.partialRenderer.read(a))}catch(c){this.emit("error",c)}};return b}(ba.Readable),X={renderToString:function(a){return(new V(a,
|
|
43
|
+
!1)).read(Infinity)},renderToStaticMarkup:function(a){return(new V(a,!0)).read(Infinity)},renderToNodeStream:function(a){return new W(a,!1)},renderToStaticNodeStream:function(a){return new W(a,!0)},version:"16.4.1"},Y={default:X},Z=Y&&X||Y;module.exports=Z.default?Z.default:Z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.4.
|
|
1
|
+
/** @license React v16.4.1
|
|
2
2
|
* react-dom-test-utils.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -16,19 +16,15 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
18
|
var _assign = require('object-assign');
|
|
19
|
+
var invariant = require('fbjs/lib/invariant');
|
|
19
20
|
var React = require('react');
|
|
20
21
|
var ReactDOM = require('react-dom');
|
|
21
|
-
var invariant = require('fbjs/lib/invariant');
|
|
22
22
|
var warning = require('fbjs/lib/warning');
|
|
23
23
|
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
24
24
|
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* This is a replacement for `invariant(...)` used by the error code system
|
|
29
|
-
* and will _only_ be required by the corresponding babel pass.
|
|
30
|
-
* It always throws.
|
|
31
|
-
*/
|
|
26
|
+
// Relying on the `invariant()` implementation lets us
|
|
27
|
+
// have preserve the format and params in the www builds.
|
|
32
28
|
|
|
33
29
|
/**
|
|
34
30
|
* `ReactInstanceMap` maintains a mapping from a public facing stateful
|
|
@@ -96,15 +92,15 @@ function isFiberMountedImpl(fiber) {
|
|
|
96
92
|
if ((node.effectTag & Placement) !== NoEffect) {
|
|
97
93
|
return MOUNTING;
|
|
98
94
|
}
|
|
99
|
-
while (node
|
|
100
|
-
node = node
|
|
95
|
+
while (node.return) {
|
|
96
|
+
node = node.return;
|
|
101
97
|
if ((node.effectTag & Placement) !== NoEffect) {
|
|
102
98
|
return MOUNTING;
|
|
103
99
|
}
|
|
104
100
|
}
|
|
105
101
|
} else {
|
|
106
|
-
while (node
|
|
107
|
-
node = node
|
|
102
|
+
while (node.return) {
|
|
103
|
+
node = node.return;
|
|
108
104
|
}
|
|
109
105
|
}
|
|
110
106
|
if (node.tag === HostRoot) {
|
|
@@ -142,7 +138,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
|
|
142
138
|
var a = fiber;
|
|
143
139
|
var b = alternate;
|
|
144
140
|
while (true) {
|
|
145
|
-
var parentA = a
|
|
141
|
+
var parentA = a.return;
|
|
146
142
|
var parentB = parentA ? parentA.alternate : null;
|
|
147
143
|
if (!parentA || !parentB) {
|
|
148
144
|
// We're at the root.
|
|
@@ -172,7 +168,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
|
|
172
168
|
invariant(false, 'Unable to find node on an unmounted component.');
|
|
173
169
|
}
|
|
174
170
|
|
|
175
|
-
if (a
|
|
171
|
+
if (a.return !== b.return) {
|
|
176
172
|
// The return pointer of A and the return pointer of B point to different
|
|
177
173
|
// fibers. We assume that return pointers never criss-cross, so A must
|
|
178
174
|
// belong to the child set of A.return, and B must belong to the child
|
|
@@ -441,7 +437,7 @@ SyntheticEvent.extend = function (Interface) {
|
|
|
441
437
|
return new Proxy(constructor.apply(that, args), {
|
|
442
438
|
set: function (target, prop, value) {
|
|
443
439
|
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
|
444
|
-
|
|
440
|
+
!(didWarnForAddedNewProperty || target.isPersistent()) ? warning(false, "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;
|
|
445
441
|
didWarnForAddedNewProperty = true;
|
|
446
442
|
}
|
|
447
443
|
target[prop] = value;
|
|
@@ -486,7 +482,7 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
|
|
|
486
482
|
|
|
487
483
|
function warn(action, result) {
|
|
488
484
|
var warningCondition = false;
|
|
489
|
-
warning(
|
|
485
|
+
!warningCondition ? warning(false, "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;
|
|
490
486
|
}
|
|
491
487
|
}
|
|
492
488
|
|
|
@@ -517,6 +513,14 @@ function addEventPoolingTo(EventConstructor) {
|
|
|
517
513
|
|
|
518
514
|
var SyntheticEvent$1 = SyntheticEvent;
|
|
519
515
|
|
|
516
|
+
// Do not uses the below two methods directly!
|
|
517
|
+
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
|
|
518
|
+
// (It is the only module that is allowed to access these methods.)
|
|
519
|
+
|
|
520
|
+
function unsafeCastStringToDOMTopLevelType(topLevelType) {
|
|
521
|
+
return topLevelType;
|
|
522
|
+
}
|
|
523
|
+
|
|
520
524
|
/**
|
|
521
525
|
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
|
|
522
526
|
*
|
|
@@ -603,91 +607,97 @@ function getVendorPrefixedEventName(eventName) {
|
|
|
603
607
|
}
|
|
604
608
|
|
|
605
609
|
/**
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
610
|
+
* To identify top level events in ReactDOM, we use constants defined by this
|
|
611
|
+
* module. This is the only module that uses the unsafe* methods to express
|
|
612
|
+
* that the constants actually correspond to the browser event names. This lets
|
|
613
|
+
* us save some bundle size by avoiding a top level type -> event name map.
|
|
614
|
+
* The rest of ReactDOM code should import top level types from this file.
|
|
611
615
|
*/
|
|
612
|
-
var
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
616
|
+
var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
|
|
617
|
+
var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
|
|
618
|
+
var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
|
|
619
|
+
var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
|
|
620
|
+
var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
|
|
621
|
+
var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
|
|
622
|
+
var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
|
|
623
|
+
var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
|
|
624
|
+
var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
|
|
625
|
+
var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
|
|
626
|
+
var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
|
|
627
|
+
var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
|
|
628
|
+
var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
|
|
629
|
+
var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
|
|
630
|
+
var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
|
|
631
|
+
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
|
|
632
|
+
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
|
|
633
|
+
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
|
|
634
|
+
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
|
|
635
|
+
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
|
|
636
|
+
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
|
|
637
|
+
var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
|
|
638
|
+
var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
|
|
639
|
+
var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
|
|
640
|
+
var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
|
|
641
|
+
var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
|
|
642
|
+
var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
|
|
643
|
+
var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
|
|
644
|
+
var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
|
|
645
|
+
var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
|
|
646
|
+
var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
|
|
647
|
+
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
|
|
648
|
+
|
|
649
|
+
var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
|
|
650
|
+
|
|
651
|
+
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
|
|
652
|
+
var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
|
|
653
|
+
var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
|
|
654
|
+
var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
|
|
655
|
+
var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
|
|
656
|
+
var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
|
|
657
|
+
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
|
|
658
|
+
|
|
659
|
+
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
|
|
660
|
+
var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
|
|
661
|
+
var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
|
|
662
|
+
var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
|
|
663
|
+
var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
|
|
664
|
+
var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
|
|
665
|
+
var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
|
|
666
|
+
var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
|
|
667
|
+
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
|
|
677
|
+
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
|
|
678
|
+
|
|
679
|
+
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
|
|
680
|
+
var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
|
|
681
|
+
var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
|
|
682
|
+
var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
|
|
683
|
+
var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
|
|
684
|
+
|
|
685
|
+
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
|
|
686
|
+
var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
|
|
687
|
+
var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
|
|
688
|
+
var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
|
|
689
|
+
var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
|
|
690
|
+
var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
|
|
691
|
+
var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
|
|
692
|
+
var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
|
|
693
|
+
var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
|
|
694
|
+
var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
|
|
695
|
+
var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
|
|
696
|
+
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
|
|
697
|
+
|
|
698
|
+
// List of events that need to be individually attached to media elements.
|
|
699
|
+
// Note that events in this list will *not* be listened to at the top level
|
|
700
|
+
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
|
|
691
701
|
|
|
692
702
|
var findDOMNode = ReactDOM.findDOMNode;
|
|
693
703
|
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -705,6 +715,29 @@ function Event(suffix) {}
|
|
|
705
715
|
* @class ReactTestUtils
|
|
706
716
|
*/
|
|
707
717
|
|
|
718
|
+
/**
|
|
719
|
+
* Simulates a top level event being dispatched from a raw event that occurred
|
|
720
|
+
* on an `Element` node.
|
|
721
|
+
* @param {number} topLevelType A number from `TopLevelEventTypes`
|
|
722
|
+
* @param {!Element} node The dom to simulate an event occurring on.
|
|
723
|
+
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
|
724
|
+
*/
|
|
725
|
+
function simulateNativeEventOnNode(topLevelType, node, fakeNativeEvent) {
|
|
726
|
+
fakeNativeEvent.target = node;
|
|
727
|
+
ReactDOMEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Simulates a top level event being dispatched from a raw event that occurred
|
|
732
|
+
* on the `ReactDOMComponent` `comp`.
|
|
733
|
+
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`.
|
|
734
|
+
* @param {!ReactDOMComponent} comp
|
|
735
|
+
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
|
736
|
+
*/
|
|
737
|
+
function simulateNativeEventOnDOMComponent(topLevelType, comp, fakeNativeEvent) {
|
|
738
|
+
simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
|
|
739
|
+
}
|
|
740
|
+
|
|
708
741
|
function findAllInRenderedFiberTreeInternal(fiber, test) {
|
|
709
742
|
if (!fiber) {
|
|
710
743
|
return [];
|
|
@@ -723,7 +756,7 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
|
|
723
756
|
}
|
|
724
757
|
}
|
|
725
758
|
if (node.child) {
|
|
726
|
-
node.child
|
|
759
|
+
node.child.return = node;
|
|
727
760
|
node = node.child;
|
|
728
761
|
continue;
|
|
729
762
|
}
|
|
@@ -731,12 +764,12 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
|
|
731
764
|
return ret;
|
|
732
765
|
}
|
|
733
766
|
while (!node.sibling) {
|
|
734
|
-
if (!node
|
|
767
|
+
if (!node.return || node.return === currentParent) {
|
|
735
768
|
return ret;
|
|
736
769
|
}
|
|
737
|
-
node = node
|
|
770
|
+
node = node.return;
|
|
738
771
|
}
|
|
739
|
-
node.sibling
|
|
772
|
+
node.sibling.return = node.return;
|
|
740
773
|
node = node.sibling;
|
|
741
774
|
}
|
|
742
775
|
}
|
|
@@ -917,29 +950,6 @@ var ReactTestUtils = {
|
|
|
917
950
|
return this;
|
|
918
951
|
},
|
|
919
952
|
|
|
920
|
-
/**
|
|
921
|
-
* Simulates a top level event being dispatched from a raw event that occurred
|
|
922
|
-
* on an `Element` node.
|
|
923
|
-
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`
|
|
924
|
-
* @param {!Element} node The dom to simulate an event occurring on.
|
|
925
|
-
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
|
926
|
-
*/
|
|
927
|
-
simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
|
|
928
|
-
fakeNativeEvent.target = node;
|
|
929
|
-
ReactDOMEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
|
930
|
-
},
|
|
931
|
-
|
|
932
|
-
/**
|
|
933
|
-
* Simulates a top level event being dispatched from a raw event that occurred
|
|
934
|
-
* on the `ReactDOMComponent` `comp`.
|
|
935
|
-
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`.
|
|
936
|
-
* @param {!ReactDOMComponent} comp
|
|
937
|
-
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
|
938
|
-
*/
|
|
939
|
-
simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
|
|
940
|
-
ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
|
|
941
|
-
},
|
|
942
|
-
|
|
943
953
|
nativeTouchData: function (x, y) {
|
|
944
954
|
return {
|
|
945
955
|
touches: [{ pageX: x, pageY: y }]
|
|
@@ -1038,29 +1048,28 @@ buildSimulators();
|
|
|
1038
1048
|
* to dispatch synthetic events.
|
|
1039
1049
|
*/
|
|
1040
1050
|
|
|
1041
|
-
function makeNativeSimulator(eventType) {
|
|
1051
|
+
function makeNativeSimulator(eventType, topLevelType) {
|
|
1042
1052
|
return function (domComponentOrNode, nativeEventData) {
|
|
1043
1053
|
var fakeNativeEvent = new Event(eventType);
|
|
1044
1054
|
_assign(fakeNativeEvent, nativeEventData);
|
|
1045
1055
|
if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
|
|
1046
|
-
|
|
1056
|
+
simulateNativeEventOnDOMComponent(topLevelType, domComponentOrNode, fakeNativeEvent);
|
|
1047
1057
|
} else if (domComponentOrNode.tagName) {
|
|
1048
1058
|
// Will allow on actual dom nodes.
|
|
1049
|
-
|
|
1059
|
+
simulateNativeEventOnNode(topLevelType, domComponentOrNode, fakeNativeEvent);
|
|
1050
1060
|
}
|
|
1051
1061
|
};
|
|
1052
1062
|
}
|
|
1053
1063
|
|
|
1054
|
-
|
|
1064
|
+
[[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_BLUR, 'blur'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CANCEL, 'cancel'], [TOP_CHANGE, 'change'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_COMPOSITION_END, 'compositionEnd'], [TOP_COMPOSITION_START, 'compositionStart'], [TOP_COMPOSITION_UPDATE, 'compositionUpdate'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DRAG_START, 'dragStart'], [TOP_DRAG, 'drag'], [TOP_DROP, 'drop'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_PLAYING, 'playing'], [TOP_PROGRESS, 'progress'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_SCROLL, 'scroll'], [TOP_SEEKED, 'seeked'], [TOP_SEEKING, 'seeking'], [TOP_SELECTION_CHANGE, 'selectionChange'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TEXT_INPUT, 'textInput'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TOUCH_START, 'touchStart'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_VOLUME_CHANGE, 'volumeChange'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']].forEach(function (_ref) {
|
|
1065
|
+
var topLevelType = _ref[0],
|
|
1066
|
+
eventType = _ref[1];
|
|
1055
1067
|
|
|
1056
|
-
eventKeys.forEach(function (eventType) {
|
|
1057
|
-
// Event type is stored as 'topClick' - we transform that to 'click'
|
|
1058
|
-
var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
|
|
1059
1068
|
/**
|
|
1060
1069
|
* @param {!Element|ReactDOMComponent} domComponentOrNode
|
|
1061
1070
|
* @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
|
|
1062
1071
|
*/
|
|
1063
|
-
ReactTestUtils.SimulateNative[
|
|
1072
|
+
ReactTestUtils.SimulateNative[eventType] = makeNativeSimulator(eventType, topLevelType);
|
|
1064
1073
|
});
|
|
1065
1074
|
|
|
1066
1075
|
|
|
@@ -1073,7 +1082,7 @@ var ReactTestUtils$3 = ( ReactTestUtils$2 && ReactTestUtils ) || ReactTestUtils$
|
|
|
1073
1082
|
|
|
1074
1083
|
// TODO: decide on the top-level export form.
|
|
1075
1084
|
// This is hacky but makes it work with both Rollup and Jest.
|
|
1076
|
-
var testUtils = ReactTestUtils$3
|
|
1085
|
+
var testUtils = ReactTestUtils$3.default ? ReactTestUtils$3.default : ReactTestUtils$3;
|
|
1077
1086
|
|
|
1078
1087
|
module.exports = testUtils;
|
|
1079
1088
|
})();
|