diff --git a/dist/react-lite.common.js b/dist/react-lite.common.js index 842620f..227d224 100644 --- a/dist/react-lite.common.js +++ b/dist/react-lite.common.js @@ -872,7 +872,6 @@ var unbubbleEvents = { * even though mousemove event can bubble */ onmousemove: 1, - ontouchmove: 1, onmouseleave: 1, onmouseenter: 1, onload: 1, @@ -956,8 +955,6 @@ function addEvent(elem, eventType, listener) { return; } - var nodeName = elem.nodeName; - if (eventType === 'onchange' && supportInputEvent(elem)) { addEvent(elem, 'oninput', listener); } @@ -977,8 +974,6 @@ function removeEvent(elem, eventType) { return; } - var nodeName = elem.nodeName; - if (eventType === 'onchange' && supportInputEvent(elem)) { delete eventStore['oninput']; } diff --git a/dist/react-lite.js b/dist/react-lite.js index 8994cef..eb5c334 100644 --- a/dist/react-lite.js +++ b/dist/react-lite.js @@ -876,7 +876,6 @@ * even though mousemove event can bubble */ onmousemove: 1, - ontouchmove: 1, onmouseleave: 1, onmouseenter: 1, onload: 1, @@ -960,8 +959,6 @@ return; } - var nodeName = elem.nodeName; - if (eventType === 'onchange' && supportInputEvent(elem)) { addEvent(elem, 'oninput', listener); } @@ -981,8 +978,6 @@ return; } - var nodeName = elem.nodeName; - if (eventType === 'onchange' && supportInputEvent(elem)) { delete eventStore['oninput']; } diff --git a/dist/react-lite.min.js b/dist/react-lite.min.js index 2107cbd..8b15319 100644 --- a/dist/react-lite.min.js +++ b/dist/react-lite.min.js @@ -3,4 +3,4 @@ * (c) 2017 Jade Gu * Released under the MIT License. */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){"use strict";function e(e,t,n,r,o){var i={vtype:e,type:t,props:n,refs:Xe,key:r,ref:o};return e!==je&&e!==Be||(i.uid=ie()),i}function t(e,t,n){var r=e.vtype,o=null;return r?r===Ve?o=l(e,t,n):r===Be?o=x(e,t,n):r===je?o=v(e,t,n):r===_e&&(o=document.createComment("react-text: "+(e.uid||ie()))):o=document.createTextNode(e),o}function n(e,t,n,o){var i=e.vtype;if(i===Be)return k(e,t,n,o);if(i===je)return m(e,t,n,o);if(i!==Ve)return n;var a=e.props[Le]&&e.props[Le].__html;return null!=a?(f(e,t,n,o),c(t,n,o)):(r(e,t,n,o),f(e,t,n,o)),n}function r(e,t,n,r){var s={removes:[],updates:[],creates:[]};d(s,e,t,n,r),re(s.removes,i),re(s.updates,o),re(s.creates,a)}function o(e){if(e){var t=e.vnode,n=e.node;e.shouldIgnore||(t.vtype?t.vtype===Ve?f(t,e.newVnode,n,e.parentContext):t.vtype===je?n=m(t,e.newVnode,n,e.parentContext):t.vtype===Be&&(n=k(t,e.newVnode,n,e.parentContext)):n.replaceData(0,n.length,e.newVnode));var r=n.parentNode.childNodes[e.index];return r!==n&&n.parentNode.insertBefore(n,r),n}}function i(e){s(e.vnode,e.node),e.node.parentNode.removeChild(e.node)}function a(e){var n=t(e.vnode,e.parentContext,e.parentNode.namespaceURI);e.parentNode.insertBefore(n,e.parentNode.childNodes[e.index])}function s(e,t){var n=e.vtype;n===Ve?h(e,t):n===Be?b(e,t):n===je&&y(e,t)}function l(e,t,n){var r=e.type,o=e.props,i=null;"svg"===r||n===$e?(i=document.createElementNS($e,r),n=$e):i=document.createElement(r),c(e,i,t);var a=r.indexOf("-")>=0||null!=o.is;return ce(i,o,a),null!=e.ref&&(ne(Ge,e),ne(Ge,i)),i}function c(e,n,r){for(var o=n.vchildren=p(e),i=n.namespaceURI,a=0,s=o.length;a0)for(var v=0;v=0||null!=e.props.is;return pe(n,e.props,t.props,r),e.ref!==t.ref&&(A(e.refs,e.ref,n),E(t.refs,t.ref,n)),n}function h(e,t){var n=(e.props,t.vchildren),r=t.childNodes;if(n)for(var o=0,i=n.length;o3){u=Array(p-2);for(var d=2;d2?a-2:0),l=2;l0)&&(n=n||e.props,r=r||e.context,this.nextProps=this.nextContext=null,F(e,n,this.getState(),r,this.clearCallbacks))},addState:function(e){e&&(ne(this.pendingStates,e),this.isPending||this.emitUpdate())},replaceState:function(e){var t=this.pendingStates;t.pop(),ne(t,[e])},getState:function(){var e=this.instance,t=this.pendingStates,n=e.state,r=e.props;return t.length&&(n=oe({},n),t.forEach(function(t){var o=bt(t);o&&(t=t[0]),K(t)&&(t=t.call(e,n,r)),o?n=oe({},t):oe(n,t)}),t.length=0),n},clearCallbacks:function(){var e=this.pendingCallbacks,t=this.instance;e.length>0&&(this.pendingCallbacks=[],e.forEach(function(e){return e.call(t)}))},addCallback:function(e){K(e)&&ne(this.pendingCallbacks,e)}};var Je={};D.prototype={constructor:D,isReactComponent:Je,forceUpdate:function(e){var t=this.$updater,n=this.$cache,r=this.props,o=this.state,i=this.context;if(n.isMounted){if(t.isPending)return void t.addState(o);var a=n.props||r,s=n.state||o,l=n.context||i,c=n.parentContext,p=n.node,u=n.vnode;n.props=n.state=n.context=null,t.isPending=!0,this.componentWillUpdate&&this.componentWillUpdate(a,s,l),this.state=s,this.props=a,this.context=l;var d=w(this),f=T(u,d,p,P(this,c));f!==p&&(f.cache=f.cache||{},M(f.cache,p.cache,f)),n.vnode=d,n.node=f,N(),this.componentDidUpdate&&this.componentDidUpdate(r,o,i),e&&e.call(this),t.isPending=!1,t.emitUpdate()}},setState:function(e,t){var n=this.$updater;n.addCallback(t),n.addState(e)},replaceState:function(e,t){var n=this.$updater;n.addCallback(t),n.replaceState(e)},getDOMNode:function(){var e=this.$cache.node;return e&&"#comment"===e.nodeName?null:e},isMounted:function(){return this.$cache.isMounted}};var Ke={onmousemove:1,ontouchmove:1,onmouseleave:1,onmouseenter:1,onload:1,onunload:1,onscroll:1,onfocus:1,onblur:1,onrowexit:1,onbeforeunload:1,onstop:1,ondragdrop:1,ondragenter:1,ondragexit:1,ondraggesture:1,ondragover:1,oncontextmenu:1,onerror:1,onabort:1,oncanplay:1,oncanplaythrough:1,ondurationchange:1,onemptied:1,onended:1,onloadeddata:1,onloadedmetadata:1,onloadstart:1,onencrypted:1,onpause:1,onplay:1,onplaying:1,onprogress:1,onratechange:1,onseeking:1,onseeked:1,onstalled:1,onsuspend:1,ontimeupdate:1,onvolumechange:1,onwaiting:1},Qe="ontouchstart"in document,et=function(){},tt="onclick",nt={},rt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridColumn:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ot=["Webkit","ms","Moz","O"];Object.keys(rt).forEach(function(e){ot.forEach(function(t){rt[H(t,e)]=1})});var it=/^-?\d+(\.\d+)?$/,at=":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",st=at+"\\-.0-9\\uB7\\u0300-\\u036F\\u203F-\\u2040",lt=new RegExp("^["+at+"]["+st+"]*$"),ct=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+st+"]*$")),pt={},ut=1,dt=4,ft=8,ht=24,vt=32,mt={props:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:dt,allowTransparency:0,alt:0,async:dt,autoComplete:0,autoFocus:dt,autoPlay:dt,capture:dt,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:ut|dt,cite:0,classID:0,className:0,cols:ht,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:dt,coords:0,crossOrigin:0,data:0,dateTime:0,default:dt,defaultValue:ut,defaultChecked:ut|dt,defer:dt,dir:0,disabled:dt,download:vt,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:dt,formTarget:0,frameBorder:0,headers:0,height:0,hidden:dt,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:dt,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:ut|dt,muted:ut|dt,name:0,nonce:0,noValidate:dt,open:dt,optimum:0,pattern:0,placeholder:0,poster:0,preload:0,profile:0,radioGroup:0,readOnly:dt,referrerPolicy:0,rel:0,required:dt,reversed:dt,role:0,rows:ht,rowSpan:ft,sandbox:0,scope:0,scoped:dt,scrolling:0,seamless:dt,selected:ut|dt,shape:0,size:ht,sizes:0,span:ht,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:ft,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:ut,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,playsInline:dt,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:dt,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},attrNS:{},domAttrs:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},domProps:{}},yt="http://www.w3.org/1999/xlink",gt="http://www.w3.org/XML/1998/namespace",xt={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},kt={props:{},attrNS:{xlinkActuate:yt,xlinkArcrole:yt,xlinkHref:yt,xlinkRole:yt,xlinkShow:yt,xlinkTitle:yt,xlinkType:yt,xmlBase:gt,xmlLang:gt,xmlSpace:gt},domAttrs:{},domProps:{}};Object.keys(xt).map(function(e){kt.props[e]=0,xt[e]&&(kt.domAttrs[e]=xt[e])}),Y(mt),Y(kt);var bt=Array.isArray,Ct=0,wt=/^on/i;Object.freeze||(Object.freeze=ee);var Pt={},St={},Ot=Object.freeze({render:fe,unstable_renderSubtreeIntoContainer:he,unmountComponentAtNode:ve,findDOMNode:me}),Nt="a|abbr|address|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|main|map|mark|menu|menuitem|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|picture|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|span|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|u|ul|var|video|wbr|circle|clipPath|defs|ellipse|g|image|line|linearGradient|mask|path|pattern|polygon|polyline|radialGradient|rect|stop|svg|text|tspan",Tt={};Nt.split("|").forEach(function(e){Tt[e]=ke(e)});var Ut=function e(){return e};Ut.isRequired=Ut;var Et={array:Ut,bool:Ut,func:Ut,number:Ut,object:Ut,string:Ut,any:Ut,arrayOf:Ut,element:Ut,instanceOf:Ut,node:Ut,objectOf:Ut,oneOf:Ut,oneOfType:Ut,shape:Ut},At=/\/(?!\/)/g,Mt=Object.freeze({only:be,forEach:Ce,map:we,count:Pe,toArray:Se}),Rt=function(){};Rt.prototype=D.prototype,Fe.prototype=Object.create(D.prototype),Fe.prototype.constructor=Fe,Fe.prototype.isPureReactComponent=!0,Fe.prototype.shouldComponentUpdate=Ie;var Dt=oe({version:"0.15.1",cloneElement:xe,isValidElement:ge,createElement:ye,createFactory:ke,Component:D,PureComponent:Fe,createClass:Re,Children:Mt,PropTypes:Et,DOM:Tt},Ot);return Dt.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ot,Dt}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.React=t()}(this,function(){"use strict";function e(e,t,n,r,o){var i={vtype:e,type:t,props:n,refs:Xe,key:r,ref:o};return e!==je&&e!==Be||(i.uid=ie()),i}function t(e,t,n){var r=e.vtype,o=null;return r?r===Ve?o=l(e,t,n):r===Be?o=x(e,t,n):r===je?o=v(e,t,n):r===_e&&(o=document.createComment("react-text: "+(e.uid||ie()))):o=document.createTextNode(e),o}function n(e,t,n,o){var i=e.vtype;return i===Be?k(e,t,n,o):i===je?m(e,t,n,o):i!==Ve?n:(null!=(e.props[Le]&&e.props[Le].__html)?(f(e,t,n),c(t,n,o)):(r(e,t,n,o),f(e,t,n)),n)}function r(e,t,n,r){var s={removes:[],updates:[],creates:[]};d(s,e,t,n,r),re(s.removes,i),re(s.updates,o),re(s.creates,a)}function o(e){if(e){var t=e.vnode,n=e.node;e.shouldIgnore||(t.vtype?t.vtype===Ve?f(t,e.newVnode,n,e.parentContext):t.vtype===je?n=m(t,e.newVnode,n,e.parentContext):t.vtype===Be&&(n=k(t,e.newVnode,n,e.parentContext)):n.replaceData(0,n.length,e.newVnode));var r=n.parentNode.childNodes[e.index];return r!==n&&n.parentNode.insertBefore(n,r),n}}function i(e){s(e.vnode,e.node),e.node.parentNode.removeChild(e.node)}function a(e){var n=t(e.vnode,e.parentContext,e.parentNode.namespaceURI);e.parentNode.insertBefore(n,e.parentNode.childNodes[e.index])}function s(e,t){var n=e.vtype;n===Ve?h(e,t):n===Be?b(e,t):n===je&&y(e,t)}function l(e,t,n){var r=e.type,o=e.props,i=null;return"svg"===r||n===$e?(i=document.createElementNS($e,r),n=$e):i=document.createElement(r),c(e,i,t),ce(i,o,r.indexOf("-")>=0||null!=o.is),null!=e.ref&&(ne(Ge,e),ne(Ge,i)),i}function c(e,n,r){for(var o=n.vchildren=p(e),i=n.namespaceURI,a=0,s=o.length;a0)for(var v=0;v=0||null!=e.props.is;return pe(n,e.props,t.props,r),e.ref!==t.ref&&(A(e.refs,e.ref,n),E(t.refs,t.ref,n)),n}function h(e,t){var n=(e.props,t.vchildren),r=t.childNodes;if(n)for(var o=0,i=n.length;o3){u=Array(p-2);for(var d=2;d2?a-2:0),l=2;l0)&&(n=n||e.props,r=r||e.context,this.nextProps=this.nextContext=null,F(e,n,this.getState(),r,this.clearCallbacks))},addState:function(e){e&&(ne(this.pendingStates,e),this.isPending||this.emitUpdate())},replaceState:function(e){var t=this.pendingStates;t.pop(),ne(t,[e])},getState:function(){var e=this.instance,t=this.pendingStates,n=e.state,r=e.props;return t.length&&(n=oe({},n),t.forEach(function(t){var o=bt(t);o&&(t=t[0]),K(t)&&(t=t.call(e,n,r)),o?n=oe({},t):oe(n,t)}),t.length=0),n},clearCallbacks:function(){var e=this.pendingCallbacks,t=this.instance;e.length>0&&(this.pendingCallbacks=[],e.forEach(function(e){return e.call(t)}))},addCallback:function(e){K(e)&&ne(this.pendingCallbacks,e)}};var Je={};D.prototype={constructor:D,isReactComponent:Je,forceUpdate:function(e){var t=this.$updater,n=this.$cache,r=this.props,o=this.state,i=this.context;if(n.isMounted){if(t.isPending)return void t.addState(o);var a=n.props||r,s=n.state||o,l=n.context||i,c=n.parentContext,p=n.node,u=n.vnode;n.props=n.state=n.context=null,t.isPending=!0,this.componentWillUpdate&&this.componentWillUpdate(a,s,l),this.state=s,this.props=a,this.context=l;var d=w(this),f=T(u,d,p,P(this,c));f!==p&&(f.cache=f.cache||{},M(f.cache,p.cache,f)),n.vnode=d,n.node=f,N(),this.componentDidUpdate&&this.componentDidUpdate(r,o,i),e&&e.call(this),t.isPending=!1,t.emitUpdate()}},setState:function(e,t){var n=this.$updater;n.addCallback(t),n.addState(e)},replaceState:function(e,t){var n=this.$updater;n.addCallback(t),n.replaceState(e)},getDOMNode:function(){var e=this.$cache.node;return e&&"#comment"===e.nodeName?null:e},isMounted:function(){return this.$cache.isMounted}};var Ke={onmousemove:1,onmouseleave:1,onmouseenter:1,onload:1,onunload:1,onscroll:1,onfocus:1,onblur:1,onrowexit:1,onbeforeunload:1,onstop:1,ondragdrop:1,ondragenter:1,ondragexit:1,ondraggesture:1,ondragover:1,oncontextmenu:1,onerror:1,onabort:1,oncanplay:1,oncanplaythrough:1,ondurationchange:1,onemptied:1,onended:1,onloadeddata:1,onloadedmetadata:1,onloadstart:1,onencrypted:1,onpause:1,onplay:1,onplaying:1,onprogress:1,onratechange:1,onseeking:1,onseeked:1,onstalled:1,onsuspend:1,ontimeupdate:1,onvolumechange:1,onwaiting:1},Qe="ontouchstart"in document,et=function(){},tt="onclick",nt={},rt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridColumn:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ot=["Webkit","ms","Moz","O"];Object.keys(rt).forEach(function(e){ot.forEach(function(t){rt[H(t,e)]=1})});var it=/^-?\d+(\.\d+)?$/,at=":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",st=at+"\\-.0-9\\uB7\\u0300-\\u036F\\u203F-\\u2040",lt=new RegExp("^["+at+"]["+st+"]*$"),ct=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+st+"]*$")),pt={},ut=1,dt=4,ft=8,ht=24,vt=32,mt={props:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:dt,allowTransparency:0,alt:0,async:dt,autoComplete:0,autoFocus:dt,autoPlay:dt,capture:dt,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:ut|dt,cite:0,classID:0,className:0,cols:ht,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:dt,coords:0,crossOrigin:0,data:0,dateTime:0,default:dt,defaultValue:ut,defaultChecked:ut|dt,defer:dt,dir:0,disabled:dt,download:vt,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:dt,formTarget:0,frameBorder:0,headers:0,height:0,hidden:dt,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:dt,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:ut|dt,muted:ut|dt,name:0,nonce:0,noValidate:dt,open:dt,optimum:0,pattern:0,placeholder:0,poster:0,preload:0,profile:0,radioGroup:0,readOnly:dt,referrerPolicy:0,rel:0,required:dt,reversed:dt,role:0,rows:ht,rowSpan:ft,sandbox:0,scope:0,scoped:dt,scrolling:0,seamless:dt,selected:ut|dt,shape:0,size:ht,sizes:0,span:ht,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:ft,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:ut,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,playsInline:dt,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:dt,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},attrNS:{},domAttrs:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},domProps:{}},yt="http://www.w3.org/1999/xlink",gt="http://www.w3.org/XML/1998/namespace",xt={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},kt={props:{},attrNS:{xlinkActuate:yt,xlinkArcrole:yt,xlinkHref:yt,xlinkRole:yt,xlinkShow:yt,xlinkTitle:yt,xlinkType:yt,xmlBase:gt,xmlLang:gt,xmlSpace:gt},domAttrs:{},domProps:{}};Object.keys(xt).map(function(e){kt.props[e]=0,xt[e]&&(kt.domAttrs[e]=xt[e])}),Y(mt),Y(kt);var bt=Array.isArray,Ct=0,wt=/^on/i;Object.freeze||(Object.freeze=ee);var Pt={},St={},Ot=Object.freeze({render:fe,unstable_renderSubtreeIntoContainer:he,unmountComponentAtNode:ve,findDOMNode:me}),Nt={};"a|abbr|address|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|main|map|mark|menu|menuitem|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|picture|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|span|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|u|ul|var|video|wbr|circle|clipPath|defs|ellipse|g|image|line|linearGradient|mask|path|pattern|polygon|polyline|radialGradient|rect|stop|svg|text|tspan".split("|").forEach(function(e){Nt[e]=ke(e)});var Tt=function e(){return e};Tt.isRequired=Tt;var Ut={array:Tt,bool:Tt,func:Tt,number:Tt,object:Tt,string:Tt,any:Tt,arrayOf:Tt,element:Tt,instanceOf:Tt,node:Tt,objectOf:Tt,oneOf:Tt,oneOfType:Tt,shape:Tt},Et=/\/(?!\/)/g,At=Object.freeze({only:be,forEach:Ce,map:we,count:Pe,toArray:Se}),Mt=function(){};Mt.prototype=D.prototype,Fe.prototype=Object.create(D.prototype),Fe.prototype.constructor=Fe,Fe.prototype.isPureReactComponent=!0,Fe.prototype.shouldComponentUpdate=Ie;var Rt=oe({version:"0.15.1",cloneElement:xe,isValidElement:ge,createElement:ye,createFactory:ke,Component:D,PureComponent:Fe,createClass:Re,Children:At,PropTypes:Ut,DOM:Nt},Ot);return Rt.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ot,Rt}); \ No newline at end of file diff --git a/dist/react-lite.min.js.gz b/dist/react-lite.min.js.gz index ef8625a..8abf279 100644 Binary files a/dist/react-lite.min.js.gz and b/dist/react-lite.min.js.gz differ diff --git a/package.json b/package.json index 38bac62..a1dbb83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-lite", - "version": "0.15.37", + "version": "0.15.38", "description": "an implementation of React that optimizes for small script size", "main": "dist/react-lite.common.js", "jsnext:main": "src/index.js", diff --git a/src/event-system.js b/src/event-system.js index 5dc1970..9ac240b 100644 --- a/src/event-system.js +++ b/src/event-system.js @@ -8,7 +8,6 @@ export const unbubbleEvents = { * even though mousemove event can bubble */ onmousemove: 1, - ontouchmove: 1, onmouseleave: 1, onmouseenter: 1, onload: 1, @@ -92,8 +91,6 @@ export function addEvent(elem, eventType, listener) { return } - let nodeName = elem.nodeName - if (eventType === 'onchange' && supportInputEvent(elem)) { addEvent(elem, 'oninput', listener) } @@ -113,8 +110,6 @@ export function removeEvent(elem, eventType) { return } - let nodeName = elem.nodeName - if (eventType === 'onchange' && supportInputEvent(elem)) { delete eventStore['oninput'] }