react-dom 16.4.0-alpha.7926752 → 16.4.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 +127 -106
- package/cjs/react-dom-server.browser.production.min.js +30 -30
- package/cjs/react-dom-server.node.development.js +128 -107
- package/cjs/react-dom-server.node.production.min.js +32 -32
- package/cjs/react-dom-test-utils.development.js +145 -150
- 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 +11357 -11092
- package/cjs/react-dom.production.min.js +227 -245
- package/package.json +2 -2
- package/umd/react-dom-server.browser.development.js +131 -110
- package/umd/react-dom-server.browser.production.min.js +28 -28
- package/umd/react-dom-test-utils.development.js +145 -150
- 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 +11468 -11203
- package/umd/react-dom.production.min.js +186 -205
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.4.0
|
|
1
|
+
/** @license React v16.4.0
|
|
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,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=h;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,h=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}h!==c&&(d+=a.substring(h,c));h=c+1;d+=b}a=h!==c?d+a.substring(h,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.providerStack[this.providerIndex]=a;a.type.
|
|
32
|
-
c.footer;b+=
|
|
33
|
-
!0;return L(c)}
|
|
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.0
|
|
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,h){var d=ua(h,b),f=[],k=!1,g={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===f)return null},enqueueReplaceState:function(a,b){k=!0;f=[b]},enqueueSetState:function(b,a){if(null===f)return null;f.push(a)}},e=void 0;if(h.prototype&&h.prototype.isReactComponent){if(e=new h(c.props,d,g),"function"===typeof h.getDerivedStateFromProps){var v=h.getDerivedStateFromProps.call(null,c.props,e.state);null!=v&&(e.state=p({},e.state,v))}}else if(e=h(c.props,
|
|
27
|
+
d,g),null==e||null==e.render){a=e;U(a,h);return}e.props=c.props;e.context=d;e.updater=g;g=e.state;void 0===g&&(e.state=g=null);if("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount)if("function"===typeof e.componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&e.UNSAFE_componentWillMount(),f.length){g=f;var t=k;f=null;k=!1;if(t&&
|
|
28
|
+
1===g.length)e.state=g[0];else{v=t?g[0]:e.state;var m=!0;for(t=t?1:0;t<g.length;t++){var n=g[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,h);c=void 0;if("function"===typeof e.getChildContext&&(d=h.childContextTypes,"object"===typeof d)){c=e.getChildContext();for(var q in c)q in d?void 0:z("108",S(h)||"Unknown",q)}c&&(b=p({},b,c))}for(;u.isValidElement(a);){var c=a,h=c.type;if("function"!==typeof h)break;d(c,h)}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.providerStack=[];this.providerIndex=-1}a.prototype.pushProvider=function(a){this.providerIndex+=1;
|
|
31
|
+
this.providerStack[this.providerIndex]=a;a.type._context._currentValue=a.props.value};a.prototype.popProvider=function(a){this.providerStack[this.providerIndex]=null;--this.providerIndex;a=a.type._context;a._currentValue=0>this.providerIndex?a._defaultValue:this.providerStack[this.providerIndex].props.value};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-1];if(c.childIndex>=c.children.length){var h=
|
|
32
|
+
c.footer;b+=h;""!==h&&(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 h=c.children[c.childIndex++],b+=this.render(h,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"+L(c);this.previousWasTextNode=
|
|
33
|
+
!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,childIndex:0,context:d,
|
|
34
|
+
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,footer:""}),""}z("130",
|
|
35
|
+
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)&&(1>=l.length?
|
|
36
|
+
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 g=0;g<l.length;g++){if(""+l[g]===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!=k.children||
|
|
37
|
+
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){g=void 0;var v="",t="";for(g in e)if(e.hasOwnProperty(g)){var m=0===g.indexOf("--"),
|
|
38
|
+
n=e[g];null!=n&&(v+=t+sa(g)+":",t=g,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}g=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)||(g=q,g=ka(g)&&null!=
|
|
39
|
+
e?g+"="+('"'+L(e)+'"'):"");else{m=q;g=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,g,e,!1)?g="":null!==e?(m=e.attributeName,e=e.type,g=3===e||4===e&&!0===g?m+'=""':m+"="+('"'+L(g)+'"')):g=m+"="+('"'+L(g)+'"')}g&&(B+=" "+g)}}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 h=a.call(this,{});if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");h=!h||"object"!==typeof h&&"function"!==typeof h?this:h;h.partialRenderer=new V(d,c);return h}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.0"},Y={default:X},Z=Y&&X||Y;module.exports=Z.default?Z.default:Z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.4.0
|
|
1
|
+
/** @license React v16.4.0
|
|
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
|
|
@@ -84,20 +80,6 @@ var Placement = /* */2;
|
|
|
84
80
|
|
|
85
81
|
// Union of all host effects
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
// This indicates we exited the fiber without completing it.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// Bits greater than Incomplete are used to identify fibers that threw. These
|
|
92
|
-
// are like algebraic effects. These bits are mutually exclusive.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// Union of all algebraic effects
|
|
100
|
-
|
|
101
83
|
var MOUNTING = 1;
|
|
102
84
|
var MOUNTED = 2;
|
|
103
85
|
var UNMOUNTED = 3;
|
|
@@ -110,15 +92,15 @@ function isFiberMountedImpl(fiber) {
|
|
|
110
92
|
if ((node.effectTag & Placement) !== NoEffect) {
|
|
111
93
|
return MOUNTING;
|
|
112
94
|
}
|
|
113
|
-
while (node
|
|
114
|
-
node = node
|
|
95
|
+
while (node.return) {
|
|
96
|
+
node = node.return;
|
|
115
97
|
if ((node.effectTag & Placement) !== NoEffect) {
|
|
116
98
|
return MOUNTING;
|
|
117
99
|
}
|
|
118
100
|
}
|
|
119
101
|
} else {
|
|
120
|
-
while (node
|
|
121
|
-
node = node
|
|
102
|
+
while (node.return) {
|
|
103
|
+
node = node.return;
|
|
122
104
|
}
|
|
123
105
|
}
|
|
124
106
|
if (node.tag === HostRoot) {
|
|
@@ -156,7 +138,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
|
|
156
138
|
var a = fiber;
|
|
157
139
|
var b = alternate;
|
|
158
140
|
while (true) {
|
|
159
|
-
var parentA = a
|
|
141
|
+
var parentA = a.return;
|
|
160
142
|
var parentB = parentA ? parentA.alternate : null;
|
|
161
143
|
if (!parentA || !parentB) {
|
|
162
144
|
// We're at the root.
|
|
@@ -186,7 +168,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
|
|
186
168
|
invariant(false, 'Unable to find node on an unmounted component.');
|
|
187
169
|
}
|
|
188
170
|
|
|
189
|
-
if (a
|
|
171
|
+
if (a.return !== b.return) {
|
|
190
172
|
// The return pointer of A and the return pointer of B point to different
|
|
191
173
|
// fibers. We assume that return pointers never criss-cross, so A must
|
|
192
174
|
// belong to the child set of A.return, and B must belong to the child
|
|
@@ -455,7 +437,7 @@ SyntheticEvent.extend = function (Interface) {
|
|
|
455
437
|
return new Proxy(constructor.apply(that, args), {
|
|
456
438
|
set: function (target, prop, value) {
|
|
457
439
|
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
|
458
|
-
|
|
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;
|
|
459
441
|
didWarnForAddedNewProperty = true;
|
|
460
442
|
}
|
|
461
443
|
target[prop] = value;
|
|
@@ -500,7 +482,7 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
|
|
|
500
482
|
|
|
501
483
|
function warn(action, result) {
|
|
502
484
|
var warningCondition = false;
|
|
503
|
-
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;
|
|
504
486
|
}
|
|
505
487
|
}
|
|
506
488
|
|
|
@@ -531,6 +513,14 @@ function addEventPoolingTo(EventConstructor) {
|
|
|
531
513
|
|
|
532
514
|
var SyntheticEvent$1 = SyntheticEvent;
|
|
533
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
|
+
|
|
534
524
|
/**
|
|
535
525
|
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
|
|
536
526
|
*
|
|
@@ -617,91 +607,97 @@ function getVendorPrefixedEventName(eventName) {
|
|
|
617
607
|
}
|
|
618
608
|
|
|
619
609
|
/**
|
|
620
|
-
*
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
*
|
|
624
|
-
*
|
|
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.
|
|
625
615
|
*/
|
|
626
|
-
var
|
|
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
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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`.
|
|
705
701
|
|
|
706
702
|
var findDOMNode = ReactDOM.findDOMNode;
|
|
707
703
|
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -719,6 +715,29 @@ function Event(suffix) {}
|
|
|
719
715
|
* @class ReactTestUtils
|
|
720
716
|
*/
|
|
721
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
|
+
|
|
722
741
|
function findAllInRenderedFiberTreeInternal(fiber, test) {
|
|
723
742
|
if (!fiber) {
|
|
724
743
|
return [];
|
|
@@ -737,7 +756,7 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
|
|
737
756
|
}
|
|
738
757
|
}
|
|
739
758
|
if (node.child) {
|
|
740
|
-
node.child
|
|
759
|
+
node.child.return = node;
|
|
741
760
|
node = node.child;
|
|
742
761
|
continue;
|
|
743
762
|
}
|
|
@@ -745,12 +764,12 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
|
|
745
764
|
return ret;
|
|
746
765
|
}
|
|
747
766
|
while (!node.sibling) {
|
|
748
|
-
if (!node
|
|
767
|
+
if (!node.return || node.return === currentParent) {
|
|
749
768
|
return ret;
|
|
750
769
|
}
|
|
751
|
-
node = node
|
|
770
|
+
node = node.return;
|
|
752
771
|
}
|
|
753
|
-
node.sibling
|
|
772
|
+
node.sibling.return = node.return;
|
|
754
773
|
node = node.sibling;
|
|
755
774
|
}
|
|
756
775
|
}
|
|
@@ -931,29 +950,6 @@ var ReactTestUtils = {
|
|
|
931
950
|
return this;
|
|
932
951
|
},
|
|
933
952
|
|
|
934
|
-
/**
|
|
935
|
-
* Simulates a top level event being dispatched from a raw event that occurred
|
|
936
|
-
* on an `Element` node.
|
|
937
|
-
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`
|
|
938
|
-
* @param {!Element} node The dom to simulate an event occurring on.
|
|
939
|
-
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
|
940
|
-
*/
|
|
941
|
-
simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
|
|
942
|
-
fakeNativeEvent.target = node;
|
|
943
|
-
ReactDOMEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
|
944
|
-
},
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* Simulates a top level event being dispatched from a raw event that occurred
|
|
948
|
-
* on the `ReactDOMComponent` `comp`.
|
|
949
|
-
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`.
|
|
950
|
-
* @param {!ReactDOMComponent} comp
|
|
951
|
-
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
|
|
952
|
-
*/
|
|
953
|
-
simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
|
|
954
|
-
ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
|
|
955
|
-
},
|
|
956
|
-
|
|
957
953
|
nativeTouchData: function (x, y) {
|
|
958
954
|
return {
|
|
959
955
|
touches: [{ pageX: x, pageY: y }]
|
|
@@ -1052,29 +1048,28 @@ buildSimulators();
|
|
|
1052
1048
|
* to dispatch synthetic events.
|
|
1053
1049
|
*/
|
|
1054
1050
|
|
|
1055
|
-
function makeNativeSimulator(eventType) {
|
|
1051
|
+
function makeNativeSimulator(eventType, topLevelType) {
|
|
1056
1052
|
return function (domComponentOrNode, nativeEventData) {
|
|
1057
1053
|
var fakeNativeEvent = new Event(eventType);
|
|
1058
1054
|
_assign(fakeNativeEvent, nativeEventData);
|
|
1059
1055
|
if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
|
|
1060
|
-
|
|
1056
|
+
simulateNativeEventOnDOMComponent(topLevelType, domComponentOrNode, fakeNativeEvent);
|
|
1061
1057
|
} else if (domComponentOrNode.tagName) {
|
|
1062
1058
|
// Will allow on actual dom nodes.
|
|
1063
|
-
|
|
1059
|
+
simulateNativeEventOnNode(topLevelType, domComponentOrNode, fakeNativeEvent);
|
|
1064
1060
|
}
|
|
1065
1061
|
};
|
|
1066
1062
|
}
|
|
1067
1063
|
|
|
1068
|
-
|
|
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];
|
|
1069
1067
|
|
|
1070
|
-
eventKeys.forEach(function (eventType) {
|
|
1071
|
-
// Event type is stored as 'topClick' - we transform that to 'click'
|
|
1072
|
-
var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
|
|
1073
1068
|
/**
|
|
1074
1069
|
* @param {!Element|ReactDOMComponent} domComponentOrNode
|
|
1075
1070
|
* @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
|
|
1076
1071
|
*/
|
|
1077
|
-
ReactTestUtils.SimulateNative[
|
|
1072
|
+
ReactTestUtils.SimulateNative[eventType] = makeNativeSimulator(eventType, topLevelType);
|
|
1078
1073
|
});
|
|
1079
1074
|
|
|
1080
1075
|
|
|
@@ -1087,7 +1082,7 @@ var ReactTestUtils$3 = ( ReactTestUtils$2 && ReactTestUtils ) || ReactTestUtils$
|
|
|
1087
1082
|
|
|
1088
1083
|
// TODO: decide on the top-level export form.
|
|
1089
1084
|
// This is hacky but makes it work with both Rollup and Jest.
|
|
1090
|
-
var testUtils = ReactTestUtils$3
|
|
1085
|
+
var testUtils = ReactTestUtils$3.default ? ReactTestUtils$3.default : ReactTestUtils$3;
|
|
1091
1086
|
|
|
1092
1087
|
module.exports = testUtils;
|
|
1093
1088
|
})();
|