From a318975da74c3b47db9dfe1f9dca159ef7ad8947 Mon Sep 17 00:00:00 2001 From: Sergio Rafael Gianazza Date: Wed, 31 Dec 2014 11:38:18 -0300 Subject: [PATCH] Added project page: * Improve project page (based on fittext.js) * Added LICENSE file * Added license header to src * Added prism to highlight example on project page * Improve code --- .gitignore | 3 +- LICENSE | 8 + client/img/arrow.png | Bin 0 -> 1255 bytes client/index.html | 38 +- client/scripts/index.js | 18 +- client/styles/index.styl | 84 +- client/vendor/prism.css | 173 ++ client/vendor/prism.js | 9 + client/webpack.config.js | 4 +- gulpfile.js | 11 +- lib/ReactFitText.js | 7 +- package.json | 1 + public/assets/bundle.js | 5576 +++++++++++++++----------------------- public/index.html | 38 +- src/ReactFitText.js | 39 +- 15 files changed, 2513 insertions(+), 3496 deletions(-) create mode 100644 LICENSE create mode 100644 client/img/arrow.png create mode 100644 client/vendor/prism.css create mode 100644 client/vendor/prism.js diff --git a/.gitignore b/.gitignore index ccc57bd..e9f09fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -public / +public/ +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..41aa571 --- /dev/null +++ b/LICENSE @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright © 2014 Sergio Rafael Gianazza + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/client/img/arrow.png b/client/img/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..29b8f35b3d4203e93f7be9c07d93fc885bbd9328 GIT binary patch literal 1255 zcmVOD2Fg7l{6}`J1@XLF`YImiZLjuIW4?CF|9f-p*JkJJur?k zDUC8Hj4>#WGAM~LCx|d7kTWTdGAXgwNZ0@X1XM{xK~#9!?A;5NgCGnAP!w?#sn-2( zcJ?rS+Bo-ap?yanBqRU;0C=db&qMj6u|)GzI3UK4d*9!AnEJV<+s#WWzyZ^1O?TSH z0vwh*p@ne9E!|g>d?GiM{}r znQA&;SAYw(Ii0Pl{J_QDHntGXuv;R-|1ROW(g?T6)yEd18TWLOT!2_5+_eC~O1Q5A z+^2QvxS;@ddRrqyIK!Hb*$Qy8wrP%saF*(>1^lZLu2GHf8L#wb1^A3y#TKGzo!CM+ zz1TuH!z#8AO`F9Q!da@=!t=+~nEnQz)?RK&K{&aZ+6d8%oi2HJbP0Daz&DsyXHpPN zn{93(oOd-Q8KN0>9k&oo+f0*!aB?+r6`~n;yITmSH@y+UnW|+nJh6nkx^n^HUL4uw z7QV}{$}L3GHo1jxmMXXKyb|u}JQ>2hI8t)~qLpy_0z`Xpq|*)r-=?=vh6gqUy__gR zxT_bt6J_`^ZPyV556tasq0BFP_msT}R9J=zT6E-(f(2-@W7oi|XGS-WmDTp%EDT5zn z=*GQ12p2$()xvqmy-XG^fDm(?)`Sb75A{R105S~q2di)a^mMq@!iCh`K<2|i(4CYP zE@YOiZ~;V>trjk1n9JuDvddO-9^%T@oEk_dTa8;tE?YBLA;HC?WJt5sH~U2(!>(Hk zVV3%0cP4}wy+npIo7@kCSu|@Q&C^T^2(zr3wGieaH~?X$rdbPN2D=C#%u{dx!p!#U zL6~b39DuZ{wL>1#s@9Y@NUK`G0myPU1%xzff82mBT-W;KffNKaYwfRvxY09?wvgGZeQ)p1 zb{m9&D1bT@NDf=GxB34cE$VYrs}K^8bj~}12SzM+Jl5C1`DqDy)dPdnou&`FyLMXXQ$`(Qy(^7Vhhbs07(Io`|yBRGdfUse0*}es; z>SiqKTA+%s*2+ByI(o(kIEWb5nr;s9M$eS>El^chTQ;@8>%v-(TL`&N$a<5nTX;`c zt5XVUcIeVW))PSGVXfC>h$2tvA)Uz(Dy-Ej1$B>}QMV8+tW~!VE3Dnp-hU~0wtP(6 zI?93IC68Kt7ZAF`V!cU!GCar7PidxbA&O?~(kpeJ=G4F%&Brml!EQX{h5Ecmb2<;d zF2jFa3I~>4hlMU{uh@w{?-_Fhbe7-k%b{KaF0002^%MUO(6N-vn R3$p+K002ovPDHLkV1mvvJS6}C literal 0 HcmV?d00001 diff --git a/client/index.html b/client/index.html index 6dfb157..05269e8 100644 --- a/client/index.html +++ b/client/index.html @@ -1,3 +1,37 @@ -ReactFitText Test Page - + + + ReactFitText Test Page + + + + + +
+
+
+

+ This component is a port of FitText. +

+
+

FitText make font-sizes flexible. Use this plugin on your fluid or responsive layout to achieve scalable headlines that fill the width of a parent element.

+

This port is 100% jQuery free, you only need React to use it.

+
+
+

Usage

+

If you want to use this component on your React project you only need to add react-fittext to your dependencies

+
+        npm install react-fittext --save
+      
+

There is an excelent use example in this very same page. To use React-Fittext on the title and subtitle of this page you only need to do this:

+

+    
+
+

React-FitText is brought to you by gianu (@sgianazza)

+

The Original jQuery Plugin is brought to you by Paravel

+
+
+ + + + diff --git a/client/scripts/index.js b/client/scripts/index.js index fb821f5..668b675 100644 --- a/client/scripts/index.js +++ b/client/scripts/index.js @@ -1,20 +1,26 @@ "use strict"; require("../styles/index.styl"); -var React = require("react/addons"); -// var ReactFitTextBase = require("../../src"); -// var {ReactFitText} = ReactFitTextBase; +var React = require("react"); var ReactFitText = require('../../src/ReactFitText'); var Body = React.createClass({ render: function() { return
- -

Testing React FitText

+ +

React FitText

+
+ +

+ A React component for inflating web type + + Fork it from Github + +

; } }); -React.render(, document.body); +React.render(, document.querySelector('.js-fittext')); diff --git a/client/styles/index.styl b/client/styles/index.styl index dc7cfa3..642ffc7 100644 --- a/client/styles/index.styl +++ b/client/styles/index.styl @@ -1,7 +1,87 @@ +@import 'nib' + body top 0 margin 0 padding 0 + background #c44032 + color #f4f1de + font-size 100% + font-family "Montserrat", 'Arial', 'san-serif' + +header + margin 3.5% 0 4% + +h1 + text-align center + text-indent -.12em + color #faf1de + font-family "Arvo", 'sans-serif' + font-weight 900 + display inline-block + margin 0 auto + line-height 1 + width 100% + text-shadow #863027 .01em .01em 0, #863027 .02em .02em 0, #863027 .03em .03em 0, #863027 .04em .04em 0, #863027 .05em .05em 0, #863027 .06em .06em 0, #863027 .07em .07em 0, #863027 .08em .08em 0, #863027 .09em .09em 0, #863027 .1em .1em 0 + +a + color #f4f1de + +p + font-size 1.2em + +footer + border-top .12em solid #f4f1de + padding-top 2% + margin-top 3% + display block + font-size .8em + +.container + width 75% + margin 0 auto + +.download + font-family "Arvo", 'sans-serif' + text-align left + margin-bottom 0px + +.download a + text-decoration none + +.download__link + padding 0.3em .8em + background url('../img/arrow.png') no-repeat + background-size 100% + margin-left .4em + transition margin .15s ease-out + text-decoration none + &:hover + color #f4f1de + margin-left .6em + margin-right -.2em + +// test +pre + font-family "Courier 10 Pitch", Courier, monospace + font-size 95% + line-height 140% + white-space pre + white-space pre-wrap + white-space -moz-pre-wrap + white-space -o-pre-wrap + +code + font-family Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace + font-size 95% + line-height 140% + white-space pre + white-space pre-wrap + white-space -moz-pre-wrap + white-space -o-pre-wrap + background #faf8f0 -h2 - margin-top 0 +#content code + display block + padding 0.5em 1em + border 1px solid #bebab0 diff --git a/client/vendor/prism.css b/client/vendor/prism.css new file mode 100644 index 0000000..038cad2 --- /dev/null +++ b/client/vendor/prism.css @@ -0,0 +1,173 @@ +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+bash&plugins=line-numbers+file-highlight */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #a67f59; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important { + font-weight: bold; +} + +.token.entity { + cursor: help; +} + +pre.line-numbers { + position: relative; + padding-left: 3.8em; + counter-reset: linenumber; +} + +pre.line-numbers > code { + position: relative; +} + +.line-numbers .line-numbers-rows { + position: absolute; + pointer-events: none; + top: 0; + font-size: 100%; + left: -3.8em; + width: 3em; /* works for line-numbers below 1000 lines */ + letter-spacing: -1px; + border-right: 1px solid #999; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + +} + + .line-numbers-rows > span { + pointer-events: none; + display: block; + counter-increment: linenumber; + } + + .line-numbers-rows > span:before { + content: counter(linenumber); + color: #999; + display: block; + padding-right: 0.8em; + text-align: right; + } diff --git a/client/vendor/prism.js b/client/vendor/prism.js new file mode 100644 index 0000000..8ec6894 --- /dev/null +++ b/client/vendor/prism.js @@ -0,0 +1,9 @@ +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+bash&plugins=line-numbers+file-highlight */ +self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{};var Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(d instanceof a)){g.lastIndex=0;var m=g.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),O=[p,1];b&&O.push(b);var N=new a(l,u?t.tokenize(m,u):m,h);O.push(N),w&&O.push(w),Array.prototype.splice.apply(r,O)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("[object Array]"==Object.prototype.toString.call(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var s="";for(var o in i.attributes)s+=o+'="'+(i.attributes[o]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+s+">"+i.content+""},!self.document)return self.addEventListener?(self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code;self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),self.close()},!1),self.Prism):self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism);; +Prism.languages.markup={comment://g,prolog:/<\?.+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/\&#?[\da-z]{1,8};/gi},Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))});; +Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/gi,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,punctuation:/[\{\};:]/g,"function":/[-a-z0-9]+(?=\()/gi},Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/gi,inside:{tag:{pattern:/|<\/style>/gi,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css},alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').+?\1/gi,inside:{"attr-name":{pattern:/^\s*style/gi,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/gi,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));; +Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//g,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*?(\r?\n|$)/g,lookbehind:!0}],string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/gi,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/gi,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};; +Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|-?Infinity)\b/g,"function":/(?!\d)[a-z0-9_$]+(?=\()/gi}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/gi,inside:{tag:{pattern:/|<\/script>/gi,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:"language-javascript"}});; +Prism.languages.bash=Prism.languages.extend("clike",{comment:{pattern:/(^|[^"{\\])(#.*?(\r?\n|$))/g,lookbehind:!0},string:{pattern:/("|')(\\?[\s\S])*?\1/g,inside:{property:/\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^\}]+\})/g}},keyword:/\b(if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)\b/g}),Prism.languages.insertBefore("bash","keyword",{property:/\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^}]+\})/g}),Prism.languages.insertBefore("bash","comment",{important:/(^#!\s*\/bin\/bash)|(^#!\s*\/bin\/sh)/g});; +Prism.hooks.add("after-highlight",function(e){var n=e.element.parentNode;if(n&&/pre/i.test(n.nodeName)&&-1!==n.className.indexOf("line-numbers")){var t,a=1+e.code.split("\n").length;lines=new Array(a),lines=lines.join(""),t=document.createElement("span"),t.className="line-numbers-rows",t.innerHTML=lines,n.hasAttribute("data-start")&&(n.style.counterReset="linenumber "+(parseInt(n.getAttribute("data-start"),10)-1)),e.element.appendChild(t)}});; +(function(){if(!self.Prism||!self.document||!document.querySelector){return}var a={js:"javascript",html:"markup",svg:"markup",xml:"markup",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell"};Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(c){var e=c.getAttribute("data-src");var g=(e.match(/\.(\w+)$/)||[,""])[1];var f=a[g]||g;var b=document.createElement("code");b.className="language-"+f;c.textContent="";b.textContent="Loading…";c.appendChild(b);var d=new XMLHttpRequest();d.open("GET",e,true);d.onreadystatechange=function(){if(d.readyState==4){if(d.status<400&&d.responseText){b.textContent=d.responseText;Prism.highlightElement(b)}else{if(d.status>=400){b.textContent="✖ Error "+d.status+" while fetching file: "+d.statusText}else{b.textContent="✖ Error: File does not exist or is empty"}}}};d.send(null)})})();; diff --git a/client/webpack.config.js b/client/webpack.config.js index 5c29a69..ed78388 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -7,8 +7,6 @@ var Path = require("path"), IS_PRODUCTION = "production" === process.env.NODE_ENV, JSX_WITH_HOT_LOEADERS = ["react-hot-loader", "jsx-loader?harmony"], CSS_LOADER = "style-loader!css-loader?root=../", - // SCSS_LOADER = "style-loader!css-loader?root=../!sass-loader?includePaths[]=" + - // Path.resolve(__dirname, "../bower_components/bootstrap-sass-official/assets/stylesheets"); webpackConfig = module.exports = { entry: "./client/scripts/index.js", @@ -22,9 +20,9 @@ webpackConfig = module.exports = { { test: require.resolve("react/addons"), loader: "expose-loader?React" }, { test: /\.js(x?)$/, loaders: JSX_WITH_HOT_LOEADERS }, { test: /\.jpg$/, loader: "file-loader" }, + { test: /\.png$/, loader: "url-loader?prefix=/public/&limit=10000&mimetype=image/png"}, { test: /\.css$/, loader: CSS_LOADER }, { test: /\.styl$/, loader: 'style-loader!css-loader!stylus-loader'}, - // { test: /\.scss$/, loader: SCSS_LOADER }, ] }, plugins: [ diff --git a/gulpfile.js b/gulpfile.js index 8ad1f05..7afe84e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,6 +11,15 @@ gulp.task('build', function(callback) { .pipe(gulp.dest(__dirname + '/lib')); }); +gulp.task('copy-examples', function() { + gulp.src([__dirname + '/client/scripts/index.js']) + .pipe(gulp.dest(__dirname + '/public/assets/examples')); +}); + +gulp.task('copy-vendor', function() { + gulp.src([__dirname + '/client/vendor/**/*']) + .pipe(gulp.dest(__dirname + '/public/assets')); +}); gulp.task('webpack:build', function(callback) { var myConfig = Object.create(require('./client/webpack.config')); @@ -49,5 +58,5 @@ gulp.task('webpack:dev-server', function(callback) { }); gulp.task('dev', function(callback) { - runSequence('webpack:build', 'webpack:dev-server', callback); + runSequence('webpack:build', 'copy-vendor', 'copy-examples', 'webpack:dev-server', callback); }); diff --git a/lib/ReactFitText.js b/lib/ReactFitText.js index ac60ddf..ab93def 100644 --- a/lib/ReactFitText.js +++ b/lib/ReactFitText.js @@ -25,14 +25,17 @@ module.exports = React.createClass({ }, componentDidMount: function() { - var width = this.refs.fitTextContainer.getDOMNode().offsetWidth; + console.log(' --- COMPRESSOR ---> ' + this.props.compressor); + // var width = this.refs.fitTextContainer.getDOMNode().offsetWidth; + var width = this.getDOMNode().offsetWidth this.setState({width: width}); // document.body.onresize = this._onBodyResize; window.addEventListener("resize", this._onBodyResize); }, _onBodyResize: function() { - var width = this.refs.fitTextContainer.getDOMNode().offsetWidth; + // var width = this.refs.fitTextContainer.getDOMNode().offsetWidth; + var width = this.getDOMNode().offsetWidth; this.setState({width: width}); }, diff --git a/package.json b/package.json index 624627f..e748205 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "style-loader": "^0.8.1", "stylus": "^0.49.3", "stylus-loader": "^0.5.0", + "url-loader": "^0.5.5", "webpack": "^1.4.7", "webpack-dev-server": "^1.6.5" }, diff --git a/public/assets/bundle.js b/public/assets/bundle.js index 58cb403..71622bf 100644 --- a/public/assets/bundle.js +++ b/public/assets/bundle.js @@ -49,23 +49,29 @@ "use strict"; __webpack_require__(4); - var React = __webpack_require__(8); - // var ReactFitTextBase = require("../../src"); - // var {ReactFitText} = ReactFitTextBase; + var React = __webpack_require__(3); var ReactFitText = __webpack_require__(2); - var Body = __HUA.createClass({displayName: 'Body', + var Body = __HUA.createClass({displayName: "Body", render: function() { return React.createElement("div", {id: "react-root"}, - React.createElement(ReactFitText, null, - React.createElement("h2", null, "Testing React FitText") + React.createElement(ReactFitText, {compressor: 0.5}, + React.createElement("h1", null, "React FitText") + ), + React.createElement(ReactFitText, {compressor: 3.5}, + React.createElement("p", {className: "download"}, + "A React component for inflating web type", + React.createElement("a", {className: "download__link", href: "http://github.com/gianu/react-fittext"}, + "Fork it from Github" + ) + ) ) ); } }); - React.render(React.createElement(Body, null), document.body); + React.render(React.createElement(Body, null), document.querySelector('.js-fittext')); /***/ }, @@ -98,6 +104,17 @@ var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactFitText.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactFitText.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } + /* + * React FitText v0.0.3 + * https://github.com/gianu/react-fittext + * + * A port of the jQuery plugin: http://github.com/davatron5000/FitText.js + * + * Copyright 2014, Sergio Rafael Gianazza http://softwarepsychonaut.com + * + * Released under the MIT license + * http://gianu.mit-license.org + */ 'use strict'; var React = __webpack_require__(3); @@ -107,7 +124,9 @@ displayName: 'ReactFitText', propTypes: { - compressor: ReactPropTypes.number + compressor: ReactPropTypes.number, + minFontSize: ReactPropTypes.number, + maxFontSize: ReactPropTypes.number }, getDefaultProps: function() { @@ -118,32 +137,20 @@ }; }, - getInitialState: function() { - return { - width: 920 - } - }, - componentDidMount: function() { - var width = this.refs.fitTextContainer.getDOMNode().offsetWidth; - this.setState({width: width}); - // document.body.onresize = this._onBodyResize; window.addEventListener("resize", this._onBodyResize); + this._onBodyResize(); }, _onBodyResize: function() { - var width = this.refs.fitTextContainer.getDOMNode().offsetWidth; - this.setState({width: width}); + var element = this.getDOMNode(); + var width = element.offsetWidth; + var fontSize = Math.max(Math.min((width / (this.props.compressor*10)), parseFloat(this.props.maxFontSize)), parseFloat(this.props.minFontSize)) + 'px'; + element.style.fontSize = fontSize; }, render: function() { - var divStyle = { - 'font-size': Math.max(Math.min((this.state.width / (this.props.compressor*10)), parseFloat(this.props.maxFontSize)), parseFloat(this.props.minFontSize)) - }; - - return React.createElement("div", {ref: "fitTextContainer", style: divStyle}, - this.props.children - ); + return this.props.children; } }); @@ -152,7 +159,7 @@ /* 3 */ /***/ function(module, exports, __webpack_require__) { - module.exports = __webpack_require__(10); + module.exports = __webpack_require__(8); /***/ }, @@ -182,8 +189,8 @@ /* 5 */ /***/ function(module, exports, __webpack_require__) { - exports = module.exports = __webpack_require__(13)(); - exports.push([module.id, "body {\n top: 0;\n margin: 0;\n padding: 0;\n}\nh2 {\n margin-top: 0;\n}\n", ""]); + exports = module.exports = __webpack_require__(10)(); + exports.push([module.id, "body {\n top: 0;\n margin: 0;\n padding: 0;\n background: #c44032;\n color: #f4f1de;\n font-size: 100%;\n font-family: \"Montserrat\", 'Arial', 'san-serif';\n}\nheader {\n margin: 3.5% 0 4%;\n}\nh1 {\n text-align: center;\n text-indent: -0.12em;\n color: #faf1de;\n font-family: \"Arvo\", 'sans-serif';\n font-weight: 900;\n display: inline-block;\n margin: 0 auto;\n line-height: 1;\n width: 100%;\n text-shadow: #863027 0.01em 0.01em 0, #863027 0.02em 0.02em 0, #863027 0.03em 0.03em 0, #863027 0.04em 0.04em 0, #863027 0.05em 0.05em 0, #863027 0.06em 0.06em 0, #863027 0.07em 0.07em 0, #863027 0.08em 0.08em 0, #863027 0.09em 0.09em 0, #863027 0.1em 0.1em 0;\n}\na {\n color: #f4f1de;\n}\np {\n font-size: 1.2em;\n}\nfooter {\n border-top: 0.12em solid #f4f1de;\n padding-top: 2%;\n margin-top: 3%;\n display: block;\n font-size: 0.8em;\n}\n.container {\n width: 75%;\n margin: 0 auto;\n}\n.download {\n font-family: \"Arvo\", 'sans-serif';\n text-align: left;\n margin-bottom: 0px;\n}\n.download a {\n text-decoration: none;\n}\n.download__link {\n padding: 0.3em 0.8em;\n background: url("+__webpack_require__(34)+") no-repeat;\n -webkit-background-size: 100%;\n -moz-background-size: 100%;\n background-size: 100%;\n margin-left: 0.4em;\n -webkit-transition: margin 0.15s ease-out;\n -moz-transition: margin 0.15s ease-out;\n -o-transition: margin 0.15s ease-out;\n -ms-transition: margin 0.15s ease-out;\n transition: margin 0.15s ease-out;\n text-decoration: none;\n}\n.download__link:hover {\n color: #f4f1de;\n margin-left: 0.6em;\n margin-right: -0.2em;\n}\npre {\n font-family: \"Courier 10 Pitch\", Courier, monospace;\n font-size: 95%;\n line-height: 140%;\n white-space: pre;\n white-space: pre-wrap;\n white-space: -moz-pre-wrap;\n white-space: -o-pre-wrap;\n}\ncode {\n font-family: Monaco, Consolas, \"Andale Mono\", \"DejaVu Sans Mono\", monospace;\n font-size: 95%;\n line-height: 140%;\n white-space: pre;\n white-space: pre-wrap;\n white-space: -moz-pre-wrap;\n white-space: -o-pre-wrap;\n background: #faf8f0;\n}\n#content code {\n display: block;\n padding: 0.5em 1em;\n border: 1px solid #bebab0;\n}\n", ""]); /***/ }, /* 6 */ @@ -406,7 +413,7 @@ ); } - componentUpdater = __webpack_require__(11)(React); + componentUpdater = __webpack_require__(9)(React); componentUpdaters[displayName] = componentUpdater; return componentUpdater.createClass(spec); @@ -436,20 +443,6 @@ /***/ }, /* 8 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["React"] = __webpack_require__(9); - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = __webpack_require__(12); - - -/***/ }, -/* 10 */ /***/ function(module, exports, __webpack_require__) { /** @@ -465,30 +458,30 @@ "use strict"; - var DOMPropertyOperations = __webpack_require__(14); - var EventPluginUtils = __webpack_require__(15); - var ReactChildren = __webpack_require__(16); - var ReactComponent = __webpack_require__(17); - var ReactCompositeComponent = __webpack_require__(18); - var ReactContext = __webpack_require__(19); - var ReactCurrentOwner = __webpack_require__(20); - var ReactElement = __webpack_require__(21); - var ReactElementValidator = __webpack_require__(22); - var ReactDOM = __webpack_require__(23); - var ReactDOMComponent = __webpack_require__(24); - var ReactDefaultInjection = __webpack_require__(25); - var ReactInstanceHandles = __webpack_require__(26); - var ReactLegacyElement = __webpack_require__(27); - var ReactMount = __webpack_require__(28); - var ReactMultiChild = __webpack_require__(29); - var ReactPerf = __webpack_require__(30); - var ReactPropTypes = __webpack_require__(31); - var ReactServerRendering = __webpack_require__(32); - var ReactTextComponent = __webpack_require__(33); - - var assign = __webpack_require__(34); - var deprecated = __webpack_require__(35); - var onlyChild = __webpack_require__(36); + var DOMPropertyOperations = __webpack_require__(11); + var EventPluginUtils = __webpack_require__(12); + var ReactChildren = __webpack_require__(13); + var ReactComponent = __webpack_require__(14); + var ReactCompositeComponent = __webpack_require__(15); + var ReactContext = __webpack_require__(16); + var ReactCurrentOwner = __webpack_require__(17); + var ReactElement = __webpack_require__(18); + var ReactElementValidator = __webpack_require__(19); + var ReactDOM = __webpack_require__(20); + var ReactDOMComponent = __webpack_require__(21); + var ReactDefaultInjection = __webpack_require__(22); + var ReactInstanceHandles = __webpack_require__(23); + var ReactLegacyElement = __webpack_require__(24); + var ReactMount = __webpack_require__(25); + var ReactMultiChild = __webpack_require__(26); + var ReactPerf = __webpack_require__(27); + var ReactPropTypes = __webpack_require__(28); + var ReactServerRendering = __webpack_require__(29); + var ReactTextComponent = __webpack_require__(30); + + var assign = __webpack_require__(31); + var deprecated = __webpack_require__(32); + var onlyChild = __webpack_require__(33); ReactDefaultInjection.inject(); @@ -633,13 +626,13 @@ // Version exists only in the open-source version of React, not in Facebook's // internal version. - React.version = '0.12.1'; + React.version = '0.12.2'; module.exports = React; /***/ }, -/* 11 */ +/* 9 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -800,63 +793,7 @@ /***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactWithAddons - */ - - /** - * This module exists purely in the open source project, and is meant as a way - * to create a separate standalone build of React. This build has "addons", or - * functionality we've built and think might be useful but doesn't have a good - * place to live inside React core. - */ - - "use strict"; - - var LinkedStateMixin = __webpack_require__(37); - var React = __webpack_require__(10); - var ReactComponentWithPureRenderMixin = - __webpack_require__(38); - var ReactCSSTransitionGroup = __webpack_require__(39); - var ReactTransitionGroup = __webpack_require__(40); - var ReactUpdates = __webpack_require__(41); - - var cx = __webpack_require__(42); - var cloneWithProps = __webpack_require__(43); - var update = __webpack_require__(44); - - React.addons = { - CSSTransitionGroup: ReactCSSTransitionGroup, - LinkedStateMixin: LinkedStateMixin, - PureRenderMixin: ReactComponentWithPureRenderMixin, - TransitionGroup: ReactTransitionGroup, - - batchedUpdates: ReactUpdates.batchedUpdates, - classSet: cx, - cloneWithProps: cloneWithProps, - update: update - }; - - if (false) { - React.addons.Perf = require("./ReactDefaultPerf"); - React.addons.TestUtils = require("./ReactTestUtils"); - } - - module.exports = React; - - -/***/ }, -/* 13 */ +/* 10 */ /***/ function(module, exports, __webpack_require__) { module.exports = function() { @@ -877,7 +814,7 @@ } /***/ }, -/* 14 */ +/* 11 */ /***/ function(module, exports, __webpack_require__) { /** @@ -894,11 +831,11 @@ "use strict"; - var DOMProperty = __webpack_require__(47); + var DOMProperty = __webpack_require__(35); - var escapeTextForBrowser = __webpack_require__(48); - var memoizeStringOnly = __webpack_require__(49); - var warning = __webpack_require__(50); + var escapeTextForBrowser = __webpack_require__(36); + var memoizeStringOnly = __webpack_require__(37); + var warning = __webpack_require__(38); function shouldIgnoreValue(name, value) { return value == null || @@ -1076,7 +1013,7 @@ /***/ }, -/* 15 */ +/* 12 */ /***/ function(module, exports, __webpack_require__) { /** @@ -1092,9 +1029,9 @@ "use strict"; - var EventConstants = __webpack_require__(45); + var EventConstants = __webpack_require__(39); - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); /** * Injected dependencies: @@ -1299,7 +1236,7 @@ /***/ }, -/* 16 */ +/* 13 */ /***/ function(module, exports, __webpack_require__) { /** @@ -1315,10 +1252,10 @@ "use strict"; - var PooledClass = __webpack_require__(51); + var PooledClass = __webpack_require__(41); - var traverseAllChildren = __webpack_require__(52); - var warning = __webpack_require__(50); + var traverseAllChildren = __webpack_require__(42); + var warning = __webpack_require__(38); var twoArgumentPooler = PooledClass.twoArgumentPooler; var threeArgumentPooler = PooledClass.threeArgumentPooler; @@ -1451,7 +1388,7 @@ /***/ }, -/* 17 */ +/* 14 */ /***/ function(module, exports, __webpack_require__) { /** @@ -1467,13 +1404,13 @@ "use strict"; - var ReactElement = __webpack_require__(21); - var ReactOwner = __webpack_require__(53); - var ReactUpdates = __webpack_require__(41); + var ReactElement = __webpack_require__(18); + var ReactOwner = __webpack_require__(43); + var ReactUpdates = __webpack_require__(44); - var assign = __webpack_require__(34); - var invariant = __webpack_require__(46); - var keyMirror = __webpack_require__(54); + var assign = __webpack_require__(31); + var invariant = __webpack_require__(40); + var keyMirror = __webpack_require__(45); /** * Every React component is in one of these life cycles. @@ -1896,7 +1833,7 @@ /***/ }, -/* 18 */ +/* 15 */ /***/ function(module, exports, __webpack_require__) { var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactCompositeComponent.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactCompositeComponent.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } @@ -1914,30 +1851,30 @@ "use strict"; - var ReactComponent = __webpack_require__(17); - var ReactContext = __webpack_require__(19); - var ReactCurrentOwner = __webpack_require__(20); - var ReactElement = __webpack_require__(21); - var ReactElementValidator = __webpack_require__(22); - var ReactEmptyComponent = __webpack_require__(55); - var ReactErrorUtils = __webpack_require__(56); - var ReactLegacyElement = __webpack_require__(27); - var ReactOwner = __webpack_require__(53); - var ReactPerf = __webpack_require__(30); - var ReactPropTransferer = __webpack_require__(57); - var ReactPropTypeLocations = __webpack_require__(58); - var ReactPropTypeLocationNames = __webpack_require__(59); - var ReactUpdates = __webpack_require__(41); - - var assign = __webpack_require__(34); - var instantiateReactComponent = __webpack_require__(60); - var invariant = __webpack_require__(46); - var keyMirror = __webpack_require__(54); - var keyOf = __webpack_require__(61); - var monitorCodeUse = __webpack_require__(62); - var mapObject = __webpack_require__(63); - var shouldUpdateReactComponent = __webpack_require__(64); - var warning = __webpack_require__(50); + var ReactComponent = __webpack_require__(14); + var ReactContext = __webpack_require__(16); + var ReactCurrentOwner = __webpack_require__(17); + var ReactElement = __webpack_require__(18); + var ReactElementValidator = __webpack_require__(19); + var ReactEmptyComponent = __webpack_require__(46); + var ReactErrorUtils = __webpack_require__(47); + var ReactLegacyElement = __webpack_require__(24); + var ReactOwner = __webpack_require__(43); + var ReactPerf = __webpack_require__(27); + var ReactPropTransferer = __webpack_require__(48); + var ReactPropTypeLocations = __webpack_require__(49); + var ReactPropTypeLocationNames = __webpack_require__(50); + var ReactUpdates = __webpack_require__(44); + + var assign = __webpack_require__(31); + var instantiateReactComponent = __webpack_require__(51); + var invariant = __webpack_require__(40); + var keyMirror = __webpack_require__(45); + var keyOf = __webpack_require__(52); + var monitorCodeUse = __webpack_require__(53); + var mapObject = __webpack_require__(54); + var shouldUpdateReactComponent = __webpack_require__(55); + var warning = __webpack_require__(38); var MIXINS_KEY = keyOf({mixins: null}); @@ -3340,7 +3277,7 @@ /***/ }, -/* 19 */ +/* 16 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3356,7 +3293,7 @@ "use strict"; - var assign = __webpack_require__(34); + var assign = __webpack_require__(31); /** * Keeps track of the current context. @@ -3406,7 +3343,7 @@ /***/ }, -/* 20 */ +/* 17 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3444,7 +3381,7 @@ /***/ }, -/* 21 */ +/* 18 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3460,10 +3397,10 @@ "use strict"; - var ReactContext = __webpack_require__(19); - var ReactCurrentOwner = __webpack_require__(20); + var ReactContext = __webpack_require__(16); + var ReactCurrentOwner = __webpack_require__(17); - var warning = __webpack_require__(50); + var warning = __webpack_require__(38); var RESERVED_PROPS = { key: true, @@ -3623,7 +3560,7 @@ } // Resolve default props - if (type.defaultProps) { + if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (typeof props[propName] === 'undefined') { @@ -3692,7 +3629,7 @@ /***/ }, -/* 22 */ +/* 19 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3715,11 +3652,12 @@ "use strict"; - var ReactElement = __webpack_require__(21); - var ReactPropTypeLocations = __webpack_require__(58); - var ReactCurrentOwner = __webpack_require__(20); + var ReactElement = __webpack_require__(18); + var ReactPropTypeLocations = __webpack_require__(49); + var ReactCurrentOwner = __webpack_require__(17); - var monitorCodeUse = __webpack_require__(62); + var monitorCodeUse = __webpack_require__(53); + var warning = __webpack_require__(38); /** * Warn if there's no key explicitly set on dynamic arrays of children or @@ -3917,6 +3855,15 @@ var ReactElementValidator = { createElement: function(type, props, children) { + // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + (false ? warning( + type != null, + 'React.createElement: type should not be null or undefined. It should ' + + 'be a string (for DOM elements) or a ReactClass (for composite ' + + 'components).' + ) : null); + var element = ReactElement.createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. @@ -3929,22 +3876,24 @@ validateChildKeys(arguments[i], type); } - var name = type.displayName; - if (type.propTypes) { - checkPropTypes( - name, - type.propTypes, - element.props, - ReactPropTypeLocations.prop - ); - } - if (type.contextTypes) { - checkPropTypes( - name, - type.contextTypes, - element._context, - ReactPropTypeLocations.context - ); + if (type) { + var name = type.displayName; + if (type.propTypes) { + checkPropTypes( + name, + type.propTypes, + element.props, + ReactPropTypeLocations.prop + ); + } + if (type.contextTypes) { + checkPropTypes( + name, + type.contextTypes, + element._context, + ReactPropTypeLocations.context + ); + } } return element; }, @@ -3964,7 +3913,7 @@ /***/ }, -/* 23 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { /** @@ -3981,11 +3930,11 @@ "use strict"; - var ReactElement = __webpack_require__(21); - var ReactElementValidator = __webpack_require__(22); - var ReactLegacyElement = __webpack_require__(27); + var ReactElement = __webpack_require__(18); + var ReactElementValidator = __webpack_require__(19); + var ReactLegacyElement = __webpack_require__(24); - var mapObject = __webpack_require__(63); + var mapObject = __webpack_require__(54); /** * Create a factory that creates HTML tag elements. @@ -4149,7 +4098,7 @@ /***/ }, -/* 24 */ +/* 21 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4166,22 +4115,22 @@ "use strict"; - var CSSPropertyOperations = __webpack_require__(65); - var DOMProperty = __webpack_require__(47); - var DOMPropertyOperations = __webpack_require__(14); - var ReactBrowserComponentMixin = __webpack_require__(66); - var ReactComponent = __webpack_require__(17); - var ReactBrowserEventEmitter = __webpack_require__(67); - var ReactMount = __webpack_require__(28); - var ReactMultiChild = __webpack_require__(29); - var ReactPerf = __webpack_require__(30); - - var assign = __webpack_require__(34); - var escapeTextForBrowser = __webpack_require__(48); - var invariant = __webpack_require__(46); - var isEventSupported = __webpack_require__(68); - var keyOf = __webpack_require__(61); - var monitorCodeUse = __webpack_require__(62); + var CSSPropertyOperations = __webpack_require__(56); + var DOMProperty = __webpack_require__(35); + var DOMPropertyOperations = __webpack_require__(11); + var ReactBrowserComponentMixin = __webpack_require__(57); + var ReactComponent = __webpack_require__(14); + var ReactBrowserEventEmitter = __webpack_require__(58); + var ReactMount = __webpack_require__(25); + var ReactMultiChild = __webpack_require__(26); + var ReactPerf = __webpack_require__(27); + + var assign = __webpack_require__(31); + var escapeTextForBrowser = __webpack_require__(36); + var invariant = __webpack_require__(40); + var isEventSupported = __webpack_require__(59); + var keyOf = __webpack_require__(52); + var monitorCodeUse = __webpack_require__(53); var deleteListener = ReactBrowserEventEmitter.deleteListener; var listenTo = ReactBrowserEventEmitter.listenTo; @@ -4638,7 +4587,7 @@ /***/ }, -/* 25 */ +/* 22 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4654,37 +4603,37 @@ "use strict"; - var BeforeInputEventPlugin = __webpack_require__(69); - var ChangeEventPlugin = __webpack_require__(70); - var ClientReactRootIndex = __webpack_require__(71); - var CompositionEventPlugin = __webpack_require__(72); - var DefaultEventPluginOrder = __webpack_require__(73); - var EnterLeaveEventPlugin = __webpack_require__(74); - var ExecutionEnvironment = __webpack_require__(75); - var HTMLDOMPropertyConfig = __webpack_require__(76); - var MobileSafariClickEventPlugin = __webpack_require__(77); - var ReactBrowserComponentMixin = __webpack_require__(66); + var BeforeInputEventPlugin = __webpack_require__(60); + var ChangeEventPlugin = __webpack_require__(61); + var ClientReactRootIndex = __webpack_require__(62); + var CompositionEventPlugin = __webpack_require__(63); + var DefaultEventPluginOrder = __webpack_require__(64); + var EnterLeaveEventPlugin = __webpack_require__(65); + var ExecutionEnvironment = __webpack_require__(66); + var HTMLDOMPropertyConfig = __webpack_require__(67); + var MobileSafariClickEventPlugin = __webpack_require__(68); + var ReactBrowserComponentMixin = __webpack_require__(57); var ReactComponentBrowserEnvironment = - __webpack_require__(78); - var ReactDefaultBatchingStrategy = __webpack_require__(79); - var ReactDOMComponent = __webpack_require__(24); - var ReactDOMButton = __webpack_require__(80); - var ReactDOMForm = __webpack_require__(81); - var ReactDOMImg = __webpack_require__(82); - var ReactDOMInput = __webpack_require__(83); - var ReactDOMOption = __webpack_require__(84); - var ReactDOMSelect = __webpack_require__(85); - var ReactDOMTextarea = __webpack_require__(86); - var ReactEventListener = __webpack_require__(87); - var ReactInjection = __webpack_require__(88); - var ReactInstanceHandles = __webpack_require__(26); - var ReactMount = __webpack_require__(28); - var SelectEventPlugin = __webpack_require__(89); - var ServerReactRootIndex = __webpack_require__(90); - var SimpleEventPlugin = __webpack_require__(91); - var SVGDOMPropertyConfig = __webpack_require__(92); - - var createFullPageComponent = __webpack_require__(93); + __webpack_require__(69); + var ReactDefaultBatchingStrategy = __webpack_require__(70); + var ReactDOMComponent = __webpack_require__(21); + var ReactDOMButton = __webpack_require__(71); + var ReactDOMForm = __webpack_require__(72); + var ReactDOMImg = __webpack_require__(73); + var ReactDOMInput = __webpack_require__(74); + var ReactDOMOption = __webpack_require__(75); + var ReactDOMSelect = __webpack_require__(76); + var ReactDOMTextarea = __webpack_require__(77); + var ReactEventListener = __webpack_require__(78); + var ReactInjection = __webpack_require__(79); + var ReactInstanceHandles = __webpack_require__(23); + var ReactMount = __webpack_require__(25); + var SelectEventPlugin = __webpack_require__(80); + var ServerReactRootIndex = __webpack_require__(81); + var SimpleEventPlugin = __webpack_require__(82); + var SVGDOMPropertyConfig = __webpack_require__(83); + + var createFullPageComponent = __webpack_require__(84); function inject() { ReactInjection.EventEmitter.injectReactEventListener( @@ -4769,7 +4718,7 @@ /***/ }, -/* 26 */ +/* 23 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4786,9 +4735,9 @@ "use strict"; - var ReactRootIndex = __webpack_require__(94); + var ReactRootIndex = __webpack_require__(85); - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); var SEPARATOR = '.'; var SEPARATOR_LENGTH = SEPARATOR.length; @@ -5106,7 +5055,7 @@ /***/ }, -/* 27 */ +/* 24 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5122,11 +5071,11 @@ "use strict"; - var ReactCurrentOwner = __webpack_require__(20); + var ReactCurrentOwner = __webpack_require__(17); - var invariant = __webpack_require__(46); - var monitorCodeUse = __webpack_require__(62); - var warning = __webpack_require__(50); + var invariant = __webpack_require__(40); + var monitorCodeUse = __webpack_require__(53); + var warning = __webpack_require__(38); var legacyFactoryLogs = {}; function warnForLegacyFactoryCall() { @@ -5355,7 +5304,7 @@ /***/ }, -/* 28 */ +/* 25 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5371,21 +5320,21 @@ "use strict"; - var DOMProperty = __webpack_require__(47); - var ReactBrowserEventEmitter = __webpack_require__(67); - var ReactCurrentOwner = __webpack_require__(20); - var ReactElement = __webpack_require__(21); - var ReactLegacyElement = __webpack_require__(27); - var ReactInstanceHandles = __webpack_require__(26); - var ReactPerf = __webpack_require__(30); - - var containsNode = __webpack_require__(95); - var deprecated = __webpack_require__(35); - var getReactRootElementInContainer = __webpack_require__(96); - var instantiateReactComponent = __webpack_require__(60); - var invariant = __webpack_require__(46); - var shouldUpdateReactComponent = __webpack_require__(64); - var warning = __webpack_require__(50); + var DOMProperty = __webpack_require__(35); + var ReactBrowserEventEmitter = __webpack_require__(58); + var ReactCurrentOwner = __webpack_require__(17); + var ReactElement = __webpack_require__(18); + var ReactLegacyElement = __webpack_require__(24); + var ReactInstanceHandles = __webpack_require__(23); + var ReactPerf = __webpack_require__(27); + + var containsNode = __webpack_require__(86); + var deprecated = __webpack_require__(32); + var getReactRootElementInContainer = __webpack_require__(87); + var instantiateReactComponent = __webpack_require__(51); + var invariant = __webpack_require__(40); + var shouldUpdateReactComponent = __webpack_require__(55); + var warning = __webpack_require__(38); var createElement = ReactLegacyElement.wrapCreateElement( ReactElement.createElement @@ -6055,7 +6004,7 @@ /***/ }, -/* 29 */ +/* 26 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6072,12 +6021,12 @@ "use strict"; - var ReactComponent = __webpack_require__(17); - var ReactMultiChildUpdateTypes = __webpack_require__(97); + var ReactComponent = __webpack_require__(14); + var ReactMultiChildUpdateTypes = __webpack_require__(88); - var flattenChildren = __webpack_require__(98); - var instantiateReactComponent = __webpack_require__(60); - var shouldUpdateReactComponent = __webpack_require__(64); + var flattenChildren = __webpack_require__(89); + var instantiateReactComponent = __webpack_require__(51); + var shouldUpdateReactComponent = __webpack_require__(55); /** * Updating children of a component may trigger recursive updates. The depth is @@ -6487,7 +6436,7 @@ /***/ }, -/* 30 */ +/* 27 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6573,7 +6522,7 @@ /***/ }, -/* 31 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactPropTypes.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactPropTypes.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } @@ -6591,11 +6540,11 @@ "use strict"; - var ReactElement = __webpack_require__(21); - var ReactPropTypeLocationNames = __webpack_require__(59); + var ReactElement = __webpack_require__(18); + var ReactPropTypeLocationNames = __webpack_require__(50); - var deprecated = __webpack_require__(35); - var emptyFunction = __webpack_require__(99); + var deprecated = __webpack_require__(32); + var emptyFunction = __webpack_require__(90); /** * Collection of methods that allow declaration and validation of props that are @@ -6933,7 +6882,7 @@ /***/ }, -/* 32 */ +/* 29 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6949,14 +6898,14 @@ */ "use strict"; - var ReactElement = __webpack_require__(21); - var ReactInstanceHandles = __webpack_require__(26); - var ReactMarkupChecksum = __webpack_require__(100); + var ReactElement = __webpack_require__(18); + var ReactInstanceHandles = __webpack_require__(23); + var ReactMarkupChecksum = __webpack_require__(91); var ReactServerRenderingTransaction = - __webpack_require__(101); + __webpack_require__(92); - var instantiateReactComponent = __webpack_require__(60); - var invariant = __webpack_require__(46); + var instantiateReactComponent = __webpack_require__(51); + var invariant = __webpack_require__(40); /** * @param {ReactElement} element @@ -7015,7 +6964,7 @@ /***/ }, -/* 33 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { /** @@ -7032,12 +6981,12 @@ "use strict"; - var DOMPropertyOperations = __webpack_require__(14); - var ReactComponent = __webpack_require__(17); - var ReactElement = __webpack_require__(21); + var DOMPropertyOperations = __webpack_require__(11); + var ReactComponent = __webpack_require__(14); + var ReactElement = __webpack_require__(18); - var assign = __webpack_require__(34); - var escapeTextForBrowser = __webpack_require__(48); + var assign = __webpack_require__(31); + var escapeTextForBrowser = __webpack_require__(36); /** * Text nodes violate a couple assumptions that React makes about components: @@ -7125,7 +7074,7 @@ /***/ }, -/* 34 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { /** @@ -7176,7 +7125,7 @@ /***/ }, -/* 35 */ +/* 32 */ /***/ function(module, exports, __webpack_require__) { /** @@ -7190,8 +7139,8 @@ * @providesModule deprecated */ - var assign = __webpack_require__(34); - var warning = __webpack_require__(50); + var assign = __webpack_require__(31); + var warning = __webpack_require__(38); /** * This will log a single deprecation notice per function and forward the call @@ -7229,7 +7178,7 @@ /***/ }, -/* 36 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { /** @@ -7244,9 +7193,9 @@ */ "use strict"; - var ReactElement = __webpack_require__(21); + var ReactElement = __webpack_require__(18); - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); /** * Returns the first child in a collection of children and verifies that there @@ -7271,56 +7220,15 @@ /***/ }, -/* 37 */ +/* 34 */ /***/ function(module, exports, __webpack_require__) { - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule LinkedStateMixin - * @typechecks static-only - */ - - "use strict"; - - var ReactLink = __webpack_require__(102); - var ReactStateSetters = __webpack_require__(103); - - /** - * A simple mixin around ReactLink.forState(). - */ - var LinkedStateMixin = { - /** - * Create a ReactLink that's linked to part of this component's state. The - * ReactLink will have the current value of this.state[key] and will call - * setState() when a change is requested. - * - * @param {string} key state key to update. Note: you may want to use keyOf() - * if you're using Google Closure Compiler advanced mode. - * @return {ReactLink} ReactLink instance linking to the state. - */ - linkState: function(key) { - return new ReactLink( - this.state[key], - ReactStateSetters.createStateKeySetter(this, key) - ); - } - }; - - module.exports = LinkedStateMixin; - + module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA7YAAACoCAMAAADjEILcAAAATlBMVEXEQDK0PC+lOCyZNSqRMymGMCeOMiiHMCeVNCqxOy/APzGdNiuKMSipOS28PjGtOi6hNyy4PTCOMimNMiiMMSiPMiiJMSeIMCeQMymPMimx10jYAAAEVElEQVR42uzdC5aDIAwFUBRxFKnW/W929jB+2jj3bqF9RyAkJAAAAHiors9D+aOxRPNTOCDGj3vf33mY+rmm281LK8AB02tNd9rGAhyWO6GFcMYt3WGdCnCaoUuX2+xp4Vx5Tdd6F+BkbUtXWgpwvlylFqIZO6mFcPp0ib4Al5lqOl9XgAu1OZ2tqvzAxd42thDOsFsiw/8u4brSCLfI1ccWohn3dJJcgFgl3LUAwUq4rwLcp3XpuKEAd3pbI0M4w5qO2Qpws7ZpjodwluquBfyrEq5RjfAZr/RnBfiMXMUWommd2EI4vdhCOMMqthBNm8UWwlmq2MLzx9WY/gaf1l5uSUE4uZraCNGMnS55eHQJdy/AN5hWZ1IQTZttbiGcdzUmGaIZdh23EE3bTJOCcHI1chWiGXe7WwinN70RwpmqZTI8sYS7unMB4V4c2eUWvsuwyi1E0za5hXCWKrfwvBLu6jwZwr04UnMBopVw+wJEe3Gk0w4E36a3UIYHNgW9nChDuKsXuxNl+DJt1xEED8ztbKHML3v3ltwgDEMBVISEoQ6BsP/NNjN9/RX659s5Zw8asOUrEVe3zY4R6K9utXAhy9Tq0K6FC12Z61gz+By68qgTNjdT0JFlrRehIEgy1oubKYgy1CmDH2Xoxr0+CBdAjtXCeci9TBYugBBzndaEC6AP9UO4ADIM9QercAH0dLjVwoXU3UDmw0HQnZQWLmSWrXABRJWtFi5kmMvnFrLLVnIe4srWnBpIKFuNW0guWzNYIcHFo2RIs9U3+0Ugw65bC2GW+mJ3JoQYvUSGNJvcD4RZNGshzdNMCwizrJq1EOYiOABhpqZZC2EGuwggzFNwAMLM9uxBmGsTHIC0qrVDHtKq1pQ3SKtawQHIcjflDcI8BAcgyzJo1kKWuflBhiwXcR/IMu31q+0G9GVsqhaiLFupWohy3VUt/LOY3nADerK81YHmDhm6Mq91xCsL6K5Z62ALQaahyi8yJBmbvQMQZXnUGT620Fez1skWgtxbnWKaBYQ0a3/cgC5c1/rkgRQENWvtr4W40TOOtpDZrH1v7852G4SBKIA6FUgOW7O3+f8fLepzVKsQEo90zjuCB0YsdzzW2AhxZjP6IwWBwlplC9HCWmUL0UbPKFsIFtYqW4g2ekbZQrCwVtlCKLlLyhZCGdNSdo6HKvYJ0SUFAbsZLSWAsGFt2b4FqupmLOtaoIqw1so9CDp6xgg4iBjWmm4O8UbPlPUtUFVYWza1wOvCWo9bCLlPyHqTr1t4T1irUwpqdujSQ9YTQOVhrddkiCJP6SGdyRAqrNUrBXWPnlG3EC2sVbcQK6zd0t5/KXi2fEzbOsqB4CWPWn0XELrDYr1JfzI8x9BPaaZwIYpm7NIrdZ/m1MAazccxvcFuPOSF+rxIczoPvy7Df10KB5Zch4Uua6/YiTc6/vY1uw2z72uTy9bfzs39fL43eXYYdwkAAAD4yw8wOBOKil4LswAAAABJRU5ErkJggg==" /***/ }, -/* 38 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { - var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactComponentWithPureRenderMixin.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactComponentWithPureRenderMixin.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } - /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -7329,317 +7237,297 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactComponentWithPureRenderMixin - */ - - "use strict"; - - var shallowEqual = __webpack_require__(104); - - /** - * If your React component's render function is "pure", e.g. it will render the - * same result given the same props and state, provide this Mixin for a - * considerable performance boost. - * - * Most React components have pure render functions. - * - * Example: - * - * var ReactComponentWithPureRenderMixin = - * require('ReactComponentWithPureRenderMixin'); - * __HUA.createClass({ - * mixins: [ReactComponentWithPureRenderMixin], - * - * render: function() { - * return
foo
; - * } - * }); - * - * Note: This only checks shallow equality for props and state. If these contain - * complex data structures this mixin may have false-negatives for deeper - * differences. Only mixin to components which have simple props and state, or - * use `forceUpdate()` when you know deep data structures have changed. + * @providesModule DOMProperty + * @typechecks static-only */ - var ReactComponentWithPureRenderMixin = { - shouldComponentUpdate: function(nextProps, nextState) { - return !shallowEqual(this.props, nextProps) || - !shallowEqual(this.state, nextState); - } - }; - module.exports = ReactComponentWithPureRenderMixin; + /*jslint bitwise: true */ + "use strict"; -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { + var invariant = __webpack_require__(40); - var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactCSSTransitionGroup.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactCSSTransitionGroup.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } + function checkMask(value, bitmask) { + return (value & bitmask) === bitmask; + } - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks - * @providesModule ReactCSSTransitionGroup - */ + var DOMPropertyInjection = { + /** + * Mapping from normalized, camelcased property names to a configuration that + * specifies how the associated DOM property should be accessed or rendered. + */ + MUST_USE_ATTRIBUTE: 0x1, + MUST_USE_PROPERTY: 0x2, + HAS_SIDE_EFFECTS: 0x4, + HAS_BOOLEAN_VALUE: 0x8, + HAS_NUMERIC_VALUE: 0x10, + HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, + HAS_OVERLOADED_BOOLEAN_VALUE: 0x40, - "use strict"; + /** + * Inject some specialized knowledge about the DOM. This takes a config object + * with the following properties: + * + * isCustomAttribute: function that given an attribute name will return true + * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* + * attributes where it's impossible to enumerate all of the possible + * attribute names, + * + * Properties: object mapping DOM property name to one of the + * DOMPropertyInjection constants or null. If your attribute isn't in here, + * it won't get written to the DOM. + * + * DOMAttributeNames: object mapping React attribute name to the DOM + * attribute name. Attribute names not specified use the **lowercase** + * normalized name. + * + * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. + * Property names not specified use the normalized name. + * + * DOMMutationMethods: Properties that require special mutation methods. If + * `value` is undefined, the mutation method should unset the property. + * + * @param {object} domPropertyConfig the config as described above. + */ + injectDOMPropertyConfig: function(domPropertyConfig) { + var Properties = domPropertyConfig.Properties || {}; + var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; + var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; + var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; - var React = __webpack_require__(10); + if (domPropertyConfig.isCustomAttribute) { + DOMProperty._isCustomAttributeFunctions.push( + domPropertyConfig.isCustomAttribute + ); + } - var assign = __webpack_require__(34); + for (var propName in Properties) { + (false ? invariant( + !DOMProperty.isStandardName.hasOwnProperty(propName), + 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + + '\'%s\' which has already been injected. You may be accidentally ' + + 'injecting the same DOM property config twice, or you may be ' + + 'injecting two configs that have conflicting property names.', + propName + ) : invariant(!DOMProperty.isStandardName.hasOwnProperty(propName))); - var ReactTransitionGroup = React.createFactory( - __webpack_require__(40) - ); - var ReactCSSTransitionGroupChild = React.createFactory( - __webpack_require__(105) - ); + DOMProperty.isStandardName[propName] = true; - var ReactCSSTransitionGroup = __HUA.createClass({ - displayName: 'ReactCSSTransitionGroup', + var lowerCased = propName.toLowerCase(); + DOMProperty.getPossibleStandardName[lowerCased] = propName; - propTypes: { - transitionName: React.PropTypes.string.isRequired, - transitionEnter: React.PropTypes.bool, - transitionLeave: React.PropTypes.bool - }, + if (DOMAttributeNames.hasOwnProperty(propName)) { + var attributeName = DOMAttributeNames[propName]; + DOMProperty.getPossibleStandardName[attributeName] = propName; + DOMProperty.getAttributeName[propName] = attributeName; + } else { + DOMProperty.getAttributeName[propName] = lowerCased; + } - getDefaultProps: function() { - return { - transitionEnter: true, - transitionLeave: true - }; - }, - - _wrapChild: function(child) { - // We need to provide this childFactory so that - // ReactCSSTransitionGroupChild can receive updates to name, enter, and - // leave while it is leaving. - return ReactCSSTransitionGroupChild( - { - name: this.props.transitionName, - enter: this.props.transitionEnter, - leave: this.props.transitionLeave - }, - child - ); - }, - - render: function() { - return ( - ReactTransitionGroup( - assign({}, this.props, {childFactory: this._wrapChild}) - ) - ); - } - }); - - module.exports = ReactCSSTransitionGroup; + DOMProperty.getPropertyName[propName] = + DOMPropertyNames.hasOwnProperty(propName) ? + DOMPropertyNames[propName] : + propName; + if (DOMMutationMethods.hasOwnProperty(propName)) { + DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName]; + } else { + DOMProperty.getMutationMethod[propName] = null; + } -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { + var propConfig = Properties[propName]; + DOMProperty.mustUseAttribute[propName] = + checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE); + DOMProperty.mustUseProperty[propName] = + checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY); + DOMProperty.hasSideEffects[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS); + DOMProperty.hasBooleanValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE); + DOMProperty.hasNumericValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE); + DOMProperty.hasPositiveNumericValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE); + DOMProperty.hasOverloadedBooleanValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE); - var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactTransitionGroup.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactTransitionGroup.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } + (false ? invariant( + !DOMProperty.mustUseAttribute[propName] || + !DOMProperty.mustUseProperty[propName], + 'DOMProperty: Cannot require using both attribute and property: %s', + propName + ) : invariant(!DOMProperty.mustUseAttribute[propName] || + !DOMProperty.mustUseProperty[propName])); + (false ? invariant( + DOMProperty.mustUseProperty[propName] || + !DOMProperty.hasSideEffects[propName], + 'DOMProperty: Properties that have side effects must use property: %s', + propName + ) : invariant(DOMProperty.mustUseProperty[propName] || + !DOMProperty.hasSideEffects[propName])); + (false ? invariant( + !!DOMProperty.hasBooleanValue[propName] + + !!DOMProperty.hasNumericValue[propName] + + !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1, + 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + + 'numeric value, but not a combination: %s', + propName + ) : invariant(!!DOMProperty.hasBooleanValue[propName] + + !!DOMProperty.hasNumericValue[propName] + + !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1)); + } + } + }; + var defaultValueCache = {}; /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. + * DOMProperty exports lookup objects that can be used like functions: * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * > DOMProperty.isValid['id'] + * true + * > DOMProperty.isValid['foobar'] + * undefined + * + * Although this may be confusing, it performs better in general. * - * @providesModule ReactTransitionGroup + * @see http://jsperf.com/key-exists + * @see http://jsperf.com/key-missing */ + var DOMProperty = { - "use strict"; - - var React = __webpack_require__(10); - var ReactTransitionChildMapping = __webpack_require__(106); - - var assign = __webpack_require__(34); - var cloneWithProps = __webpack_require__(43); - var emptyFunction = __webpack_require__(99); - - var ReactTransitionGroup = __HUA.createClass({ - displayName: 'ReactTransitionGroup', - - propTypes: { - component: React.PropTypes.any, - childFactory: React.PropTypes.func - }, - - getDefaultProps: function() { - return { - component: 'span', - childFactory: emptyFunction.thatReturnsArgument - }; - }, - - getInitialState: function() { - return { - children: ReactTransitionChildMapping.getChildMapping(this.props.children) - }; - }, - - componentWillReceiveProps: function(nextProps) { - var nextChildMapping = ReactTransitionChildMapping.getChildMapping( - nextProps.children - ); - var prevChildMapping = this.state.children; - - this.setState({ - children: ReactTransitionChildMapping.mergeChildMappings( - prevChildMapping, - nextChildMapping - ) - }); - - var key; - - for (key in nextChildMapping) { - var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key); - if (nextChildMapping[key] && !hasPrev && - !this.currentlyTransitioningKeys[key]) { - this.keysToEnter.push(key); - } - } + ID_ATTRIBUTE_NAME: 'data-reactid', - for (key in prevChildMapping) { - var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(key); - if (prevChildMapping[key] && !hasNext && - !this.currentlyTransitioningKeys[key]) { - this.keysToLeave.push(key); - } - } + /** + * Checks whether a property name is a standard property. + * @type {Object} + */ + isStandardName: {}, - // If we want to someday check for reordering, we could do it here. - }, + /** + * Mapping from lowercase property names to the properly cased version, used + * to warn in the case of missing properties. + * @type {Object} + */ + getPossibleStandardName: {}, - componentWillMount: function() { - this.currentlyTransitioningKeys = {}; - this.keysToEnter = []; - this.keysToLeave = []; - }, + /** + * Mapping from normalized names to attribute names that differ. Attribute + * names are used when rendering markup or with `*Attribute()`. + * @type {Object} + */ + getAttributeName: {}, - componentDidUpdate: function() { - var keysToEnter = this.keysToEnter; - this.keysToEnter = []; - keysToEnter.forEach(this.performEnter); + /** + * Mapping from normalized names to properties on DOM node instances. + * (This includes properties that mutate due to external factors.) + * @type {Object} + */ + getPropertyName: {}, - var keysToLeave = this.keysToLeave; - this.keysToLeave = []; - keysToLeave.forEach(this.performLeave); - }, + /** + * Mapping from normalized names to mutation methods. This will only exist if + * mutation cannot be set simply by the property or `setAttribute()`. + * @type {Object} + */ + getMutationMethod: {}, - performEnter: function(key) { - this.currentlyTransitioningKeys[key] = true; + /** + * Whether the property must be accessed and mutated as an object property. + * @type {Object} + */ + mustUseAttribute: {}, - var component = this.refs[key]; + /** + * Whether the property must be accessed and mutated using `*Attribute()`. + * (This includes anything that fails ` in `.) + * @type {Object} + */ + mustUseProperty: {}, - if (component.componentWillEnter) { - component.componentWillEnter( - this._handleDoneEntering.bind(this, key) - ); - } else { - this._handleDoneEntering(key); - } - }, + /** + * Whether or not setting a value causes side effects such as triggering + * resources to be loaded or text selection changes. We must ensure that + * the value is only set if it has changed. + * @type {Object} + */ + hasSideEffects: {}, - _handleDoneEntering: function(key) { - var component = this.refs[key]; - if (component.componentDidEnter) { - component.componentDidEnter(); - } + /** + * Whether the property should be removed when set to a falsey value. + * @type {Object} + */ + hasBooleanValue: {}, - delete this.currentlyTransitioningKeys[key]; + /** + * Whether the property must be numeric or parse as a + * numeric and should be removed when set to a falsey value. + * @type {Object} + */ + hasNumericValue: {}, - var currentChildMapping = ReactTransitionChildMapping.getChildMapping( - this.props.children - ); + /** + * Whether the property must be positive numeric or parse as a positive + * numeric and should be removed when set to a falsey value. + * @type {Object} + */ + hasPositiveNumericValue: {}, - if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) { - // This was removed before it had fully entered. Remove it. - this.performLeave(key); - } - }, + /** + * Whether the property can be used as a flag as well as with a value. Removed + * when strictly equal to false; present without a value when strictly equal + * to true; present with a value otherwise. + * @type {Object} + */ + hasOverloadedBooleanValue: {}, - performLeave: function(key) { - this.currentlyTransitioningKeys[key] = true; + /** + * All of the isCustomAttribute() functions that have been injected. + */ + _isCustomAttributeFunctions: [], - var component = this.refs[key]; - if (component.componentWillLeave) { - component.componentWillLeave(this._handleDoneLeaving.bind(this, key)); - } else { - // Note that this is somewhat dangerous b/c it calls setState() - // again, effectively mutating the component before all the work - // is done. - this._handleDoneLeaving(key); + /** + * Checks whether a property name is a custom attribute. + * @method + */ + isCustomAttribute: function(attributeName) { + for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { + var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; + if (isCustomAttributeFn(attributeName)) { + return true; + } } + return false; }, - _handleDoneLeaving: function(key) { - var component = this.refs[key]; - - if (component.componentDidLeave) { - component.componentDidLeave(); + /** + * Returns the default property value for a DOM property (i.e., not an + * attribute). Most default values are '' or false, but not all. Worse yet, + * some (in particular, `type`) vary depending on the type of element. + * + * TODO: Is it better to grab all the possible properties when creating an + * element to avoid having to create the same element twice? + */ + getDefaultValueForProperty: function(nodeName, prop) { + var nodeDefaults = defaultValueCache[nodeName]; + var testElement; + if (!nodeDefaults) { + defaultValueCache[nodeName] = nodeDefaults = {}; } - - delete this.currentlyTransitioningKeys[key]; - - var currentChildMapping = ReactTransitionChildMapping.getChildMapping( - this.props.children - ); - - if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) { - // This entered again before it fully left. Add it again. - this.performEnter(key); - } else { - var newChildren = assign({}, this.state.children); - delete newChildren[key]; - this.setState({children: newChildren}); + if (!(prop in nodeDefaults)) { + testElement = document.createElement(nodeName); + nodeDefaults[prop] = testElement[prop]; } + return nodeDefaults[prop]; }, - render: function() { - // TODO: we could get rid of the need for the wrapper node - // by cloning a single child - var childrenToRender = {}; - for (var key in this.state.children) { - var child = this.state.children[key]; - if (child) { - // You may need to apply reactive updates to a child as it is leaving. - // The normal React way to do it won't work since the child will have - // already been removed. In case you need this behavior you can provide - // a childFactory function to wrap every child, even the ones that are - // leaving. - childrenToRender[key] = cloneWithProps( - this.props.childFactory(child), - {ref: key} - ); - } - } - return React.createElement( - this.props.component, - this.props, - childrenToRender - ); - } - }); + injection: DOMPropertyInjection + }; - module.exports = ReactTransitionGroup; + module.exports = DOMProperty; /***/ }, -/* 41 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { /** @@ -7650,580 +7538,144 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactUpdates + * @providesModule escapeTextForBrowser + * @typechecks static-only */ "use strict"; - var CallbackQueue = __webpack_require__(107); - var PooledClass = __webpack_require__(51); - var ReactCurrentOwner = __webpack_require__(20); - var ReactPerf = __webpack_require__(30); - var Transaction = __webpack_require__(108); - - var assign = __webpack_require__(34); - var invariant = __webpack_require__(46); - var warning = __webpack_require__(50); + var ESCAPE_LOOKUP = { + "&": "&", + ">": ">", + "<": "<", + "\"": """, + "'": "'" + }; - var dirtyComponents = []; - var asapCallbackQueue = CallbackQueue.getPooled(); - var asapEnqueued = false; + var ESCAPE_REGEX = /[&><"']/g; - var batchingStrategy = null; + function escaper(match) { + return ESCAPE_LOOKUP[match]; + } - function ensureInjected() { - (false ? invariant( - ReactUpdates.ReactReconcileTransaction && batchingStrategy, - 'ReactUpdates: must inject a reconcile transaction class and batching ' + - 'strategy' - ) : invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy)); + /** + * Escapes text to prevent scripting attacks. + * + * @param {*} text Text value to escape. + * @return {string} An escaped string. + */ + function escapeTextForBrowser(text) { + return ('' + text).replace(ESCAPE_REGEX, escaper); } - var NESTED_UPDATES = { - initialize: function() { - this.dirtyComponentsLength = dirtyComponents.length; - }, - close: function() { - if (this.dirtyComponentsLength !== dirtyComponents.length) { - // Additional updates were enqueued by componentDidUpdate handlers or - // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run - // these new updates so that if A's componentDidUpdate calls setState on - // B, B will update before the callback A's updater provided when calling - // setState. - dirtyComponents.splice(0, this.dirtyComponentsLength); - flushBatchedUpdates(); - } else { - dirtyComponents.length = 0; - } - } - }; + module.exports = escapeTextForBrowser; - var UPDATE_QUEUEING = { - initialize: function() { - this.callbackQueue.reset(); - }, - close: function() { - this.callbackQueue.notifyAll(); - } - }; - var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { - function ReactUpdatesFlushTransaction() { - this.reinitializeTransaction(); - this.dirtyComponentsLength = null; - this.callbackQueue = CallbackQueue.getPooled(); - this.reconcileTransaction = - ReactUpdates.ReactReconcileTransaction.getPooled(); - } + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule memoizeStringOnly + * @typechecks static-only + */ - assign( - ReactUpdatesFlushTransaction.prototype, - Transaction.Mixin, { - getTransactionWrappers: function() { - return TRANSACTION_WRAPPERS; - }, + "use strict"; - destructor: function() { - this.dirtyComponentsLength = null; - CallbackQueue.release(this.callbackQueue); - this.callbackQueue = null; - ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); - this.reconcileTransaction = null; - }, + /** + * Memoizes the return value of a function that accepts one string argument. + * + * @param {function} callback + * @return {function} + */ + function memoizeStringOnly(callback) { + var cache = {}; + return function(string) { + if (cache.hasOwnProperty(string)) { + return cache[string]; + } else { + return cache[string] = callback.call(this, string); + } + }; + } - perform: function(method, scope, a) { - // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` - // with this transaction's wrappers around it. - return Transaction.Mixin.perform.call( - this, - this.reconcileTransaction.perform, - this.reconcileTransaction, - method, - scope, - a - ); - } - }); + module.exports = memoizeStringOnly; - PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); - function batchedUpdates(callback, a, b) { - ensureInjected(); - batchingStrategy.batchedUpdates(callback, a, b); - } +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { /** - * Array comparator for ReactComponents by owner depth + * Copyright 2014, Facebook, Inc. + * All rights reserved. * - * @param {ReactComponent} c1 first component you're comparing - * @param {ReactComponent} c2 second component you're comparing - * @return {number} Return value usable by Array.prototype.sort(). + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule warning */ - function mountDepthComparator(c1, c2) { - return c1._mountDepth - c2._mountDepth; - } - function runBatchedUpdates(transaction) { - var len = transaction.dirtyComponentsLength; - (false ? invariant( - len === dirtyComponents.length, - 'Expected flush transaction\'s stored dirty-components length (%s) to ' + - 'match dirty-components array length (%s).', - len, - dirtyComponents.length - ) : invariant(len === dirtyComponents.length)); + "use strict"; - // Since reconciling a component higher in the owner hierarchy usually (not - // always -- see shouldComponentUpdate()) will reconcile children, reconcile - // them before their children by sorting the array. - dirtyComponents.sort(mountDepthComparator); + var emptyFunction = __webpack_require__(90); - for (var i = 0; i < len; i++) { - // If a component is unmounted before pending changes apply, ignore them - // TODO: Queue unmounts in the same list to avoid this happening at all - var component = dirtyComponents[i]; - if (component.isMounted()) { - // If performUpdateIfNecessary happens to enqueue any new updates, we - // shouldn't execute the callbacks until the next render happens, so - // stash the callbacks first - var callbacks = component._pendingCallbacks; - component._pendingCallbacks = null; - component.performUpdateIfNecessary(transaction.reconcileTransaction); + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ - if (callbacks) { - for (var j = 0; j < callbacks.length; j++) { - transaction.callbackQueue.enqueue( - callbacks[j], - component - ); - } - } + var warning = emptyFunction; + + if (false) { + warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); + if (format === undefined) { + throw new Error( + '`warning(condition, format, ...args)` requires a warning ' + + 'message argument' + ); } - } + + if (!condition) { + var argIndex = 0; + console.warn('Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];})); + } + }; } - var flushBatchedUpdates = ReactPerf.measure( - 'ReactUpdates', - 'flushBatchedUpdates', - function() { - // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents - // array and perform any updates enqueued by mount-ready handlers (i.e., - // componentDidUpdate) but we need to check here too in order to catch - // updates enqueued by setState callbacks and asap calls. - while (dirtyComponents.length || asapEnqueued) { - if (dirtyComponents.length) { - var transaction = ReactUpdatesFlushTransaction.getPooled(); - transaction.perform(runBatchedUpdates, null, transaction); - ReactUpdatesFlushTransaction.release(transaction); - } + module.exports = warning; - if (asapEnqueued) { - asapEnqueued = false; - var queue = asapCallbackQueue; - asapCallbackQueue = CallbackQueue.getPooled(); - queue.notifyAll(); - CallbackQueue.release(queue); - } - } - } - ); + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { /** - * Mark a component as needing a rerender, adding an optional callback to a - * list of functions which will be executed once the rerender occurs. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventConstants */ - function enqueueUpdate(component, callback) { - (false ? invariant( - !callback || typeof callback === "function", - 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' + - '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + - 'isn\'t callable.' - ) : invariant(!callback || typeof callback === "function")); - ensureInjected(); - // Various parts of our code (such as ReactCompositeComponent's - // _renderValidatedComponent) assume that calls to render aren't nested; - // verify that that's the case. (This is called by each top-level update - // function, like setProps, setState, forceUpdate, etc.; creation and - // destruction of top-level components is guarded in ReactMount.) - (false ? warning( - ReactCurrentOwner.current == null, - 'enqueueUpdate(): Render methods should be a pure function of props ' + - 'and state; triggering nested component updates from render is not ' + - 'allowed. If necessary, trigger nested updates in ' + - 'componentDidUpdate.' - ) : null); + "use strict"; - if (!batchingStrategy.isBatchingUpdates) { - batchingStrategy.batchedUpdates(enqueueUpdate, component, callback); - return; - } + var keyMirror = __webpack_require__(45); - dirtyComponents.push(component); - - if (callback) { - if (component._pendingCallbacks) { - component._pendingCallbacks.push(callback); - } else { - component._pendingCallbacks = [callback]; - } - } - } - - /** - * Enqueue a callback to be run at the end of the current batching cycle. Throws - * if no updates are currently being performed. - */ - function asap(callback, context) { - (false ? invariant( - batchingStrategy.isBatchingUpdates, - 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + - 'updates are not being batched.' - ) : invariant(batchingStrategy.isBatchingUpdates)); - asapCallbackQueue.enqueue(callback, context); - asapEnqueued = true; - } - - var ReactUpdatesInjection = { - injectReconcileTransaction: function(ReconcileTransaction) { - (false ? invariant( - ReconcileTransaction, - 'ReactUpdates: must provide a reconcile transaction class' - ) : invariant(ReconcileTransaction)); - ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; - }, - - injectBatchingStrategy: function(_batchingStrategy) { - (false ? invariant( - _batchingStrategy, - 'ReactUpdates: must provide a batching strategy' - ) : invariant(_batchingStrategy)); - (false ? invariant( - typeof _batchingStrategy.batchedUpdates === 'function', - 'ReactUpdates: must provide a batchedUpdates() function' - ) : invariant(typeof _batchingStrategy.batchedUpdates === 'function')); - (false ? invariant( - typeof _batchingStrategy.isBatchingUpdates === 'boolean', - 'ReactUpdates: must provide an isBatchingUpdates boolean attribute' - ) : invariant(typeof _batchingStrategy.isBatchingUpdates === 'boolean')); - batchingStrategy = _batchingStrategy; - } - }; - - var ReactUpdates = { - /** - * React references `ReactReconcileTransaction` using this property in order - * to allow dependency injection. - * - * @internal - */ - ReactReconcileTransaction: null, - - batchedUpdates: batchedUpdates, - enqueueUpdate: enqueueUpdate, - flushBatchedUpdates: flushBatchedUpdates, - injection: ReactUpdatesInjection, - asap: asap - }; - - module.exports = ReactUpdates; - - -/***/ }, -/* 42 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule cx - */ - - /** - * This function is used to mark string literals representing CSS class names - * so that they can be transformed statically. This allows for modularization - * and minification of CSS class names. - * - * In static_upstream, this function is actually implemented, but it should - * eventually be replaced with something more descriptive, and the transform - * that is used in the main stack should be ported for use elsewhere. - * - * @param string|object className to modularize, or an object of key/values. - * In the object case, the values are conditions that - * determine if the className keys should be included. - * @param [string ...] Variable list of classNames in the string case. - * @return string Renderable space-separated CSS className. - */ - function cx(classNames) { - if (typeof classNames == 'object') { - return Object.keys(classNames).filter(function(className) { - return classNames[className]; - }).join(' '); - } else { - return Array.prototype.join.call(arguments, ' '); - } - } - - module.exports = cx; - - -/***/ }, -/* 43 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks - * @providesModule cloneWithProps - */ - - "use strict"; - - var ReactElement = __webpack_require__(21); - var ReactPropTransferer = __webpack_require__(57); - - var keyOf = __webpack_require__(61); - var warning = __webpack_require__(50); - - var CHILDREN_PROP = keyOf({children: null}); - - /** - * Sometimes you want to change the props of a child passed to you. Usually - * this is to add a CSS class. - * - * @param {object} child child component you'd like to clone - * @param {object} props props you'd like to modify. They will be merged - * as if you used `transferPropsTo()`. - * @return {object} a clone of child with props merged in. - */ - function cloneWithProps(child, props) { - if (false) { - ("production" !== process.env.NODE_ENV ? warning( - !child.ref, - 'You are calling cloneWithProps() on a child with a ref. This is ' + - 'dangerous because you\'re creating a new child which will not be ' + - 'added as a ref to its parent.' - ) : null); - } - - var newProps = ReactPropTransferer.mergeProps(props, child.props); - - // Use `child.props.children` if it is provided. - if (!newProps.hasOwnProperty(CHILDREN_PROP) && - child.props.hasOwnProperty(CHILDREN_PROP)) { - newProps.children = child.props.children; - } - - // The current API doesn't retain _owner and _context, which is why this - // doesn't use ReactElement.cloneAndReplaceProps. - return ReactElement.createElement(child.type, newProps); - } - - module.exports = cloneWithProps; - - -/***/ }, -/* 44 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule update - */ - - "use strict"; - - var assign = __webpack_require__(34); - var keyOf = __webpack_require__(61); - var invariant = __webpack_require__(46); - - function shallowCopy(x) { - if (Array.isArray(x)) { - return x.concat(); - } else if (x && typeof x === 'object') { - return assign(new x.constructor(), x); - } else { - return x; - } - } - - var COMMAND_PUSH = keyOf({$push: null}); - var COMMAND_UNSHIFT = keyOf({$unshift: null}); - var COMMAND_SPLICE = keyOf({$splice: null}); - var COMMAND_SET = keyOf({$set: null}); - var COMMAND_MERGE = keyOf({$merge: null}); - var COMMAND_APPLY = keyOf({$apply: null}); - - var ALL_COMMANDS_LIST = [ - COMMAND_PUSH, - COMMAND_UNSHIFT, - COMMAND_SPLICE, - COMMAND_SET, - COMMAND_MERGE, - COMMAND_APPLY - ]; - - var ALL_COMMANDS_SET = {}; - - ALL_COMMANDS_LIST.forEach(function(command) { - ALL_COMMANDS_SET[command] = true; - }); - - function invariantArrayCase(value, spec, command) { - (false ? invariant( - Array.isArray(value), - 'update(): expected target of %s to be an array; got %s.', - command, - value - ) : invariant(Array.isArray(value))); - var specValue = spec[command]; - (false ? invariant( - Array.isArray(specValue), - 'update(): expected spec of %s to be an array; got %s. ' + - 'Did you forget to wrap your parameter in an array?', - command, - specValue - ) : invariant(Array.isArray(specValue))); - } - - function update(value, spec) { - (false ? invariant( - typeof spec === 'object', - 'update(): You provided a key path to update() that did not contain one ' + - 'of %s. Did you forget to include {%s: ...}?', - ALL_COMMANDS_LIST.join(', '), - COMMAND_SET - ) : invariant(typeof spec === 'object')); - - if (spec.hasOwnProperty(COMMAND_SET)) { - (false ? invariant( - Object.keys(spec).length === 1, - 'Cannot have more than one key in an object with %s', - COMMAND_SET - ) : invariant(Object.keys(spec).length === 1)); - - return spec[COMMAND_SET]; - } - - var nextValue = shallowCopy(value); - - if (spec.hasOwnProperty(COMMAND_MERGE)) { - var mergeObj = spec[COMMAND_MERGE]; - (false ? invariant( - mergeObj && typeof mergeObj === 'object', - 'update(): %s expects a spec of type \'object\'; got %s', - COMMAND_MERGE, - mergeObj - ) : invariant(mergeObj && typeof mergeObj === 'object')); - (false ? invariant( - nextValue && typeof nextValue === 'object', - 'update(): %s expects a target of type \'object\'; got %s', - COMMAND_MERGE, - nextValue - ) : invariant(nextValue && typeof nextValue === 'object')); - assign(nextValue, spec[COMMAND_MERGE]); - } - - if (spec.hasOwnProperty(COMMAND_PUSH)) { - invariantArrayCase(value, spec, COMMAND_PUSH); - spec[COMMAND_PUSH].forEach(function(item) { - nextValue.push(item); - }); - } - - if (spec.hasOwnProperty(COMMAND_UNSHIFT)) { - invariantArrayCase(value, spec, COMMAND_UNSHIFT); - spec[COMMAND_UNSHIFT].forEach(function(item) { - nextValue.unshift(item); - }); - } - - if (spec.hasOwnProperty(COMMAND_SPLICE)) { - (false ? invariant( - Array.isArray(value), - 'Expected %s target to be an array; got %s', - COMMAND_SPLICE, - value - ) : invariant(Array.isArray(value))); - (false ? invariant( - Array.isArray(spec[COMMAND_SPLICE]), - 'update(): expected spec of %s to be an array of arrays; got %s. ' + - 'Did you forget to wrap your parameters in an array?', - COMMAND_SPLICE, - spec[COMMAND_SPLICE] - ) : invariant(Array.isArray(spec[COMMAND_SPLICE]))); - spec[COMMAND_SPLICE].forEach(function(args) { - (false ? invariant( - Array.isArray(args), - 'update(): expected spec of %s to be an array of arrays; got %s. ' + - 'Did you forget to wrap your parameters in an array?', - COMMAND_SPLICE, - spec[COMMAND_SPLICE] - ) : invariant(Array.isArray(args))); - nextValue.splice.apply(nextValue, args); - }); - } - - if (spec.hasOwnProperty(COMMAND_APPLY)) { - (false ? invariant( - typeof spec[COMMAND_APPLY] === 'function', - 'update(): expected spec of %s to be a function; got %s.', - COMMAND_APPLY, - spec[COMMAND_APPLY] - ) : invariant(typeof spec[COMMAND_APPLY] === 'function')); - nextValue = spec[COMMAND_APPLY](nextValue); - } - - for (var k in spec) { - if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) { - nextValue[k] = update(value[k], spec[k]); - } - } - - return nextValue; - } - - module.exports = update; - - -/***/ }, -/* 45 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule EventConstants - */ - - "use strict"; - - var keyMirror = __webpack_require__(54); - - var PropagationPhases = keyMirror({bubbled: null, captured: null}); + var PropagationPhases = keyMirror({bubbled: null, captured: null}); /** * Types of raw signals from the browser caught at the top level. @@ -8281,7 +7733,7 @@ /***/ }, -/* 46 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8340,7 +7792,7 @@ /***/ }, -/* 47 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8351,545 +7803,459 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule DOMProperty - * @typechecks static-only + * @providesModule PooledClass */ - /*jslint bitwise: true */ - "use strict"; - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); - function checkMask(value, bitmask) { - return (value & bitmask) === bitmask; - } + /** + * Static poolers. Several custom versions for each potential number of + * arguments. A completely generic pooler is easy to implement, but would + * require accessing the `arguments` object. In each of these, `this` refers to + * the Class itself, not an instance. If any others are needed, simply add them + * here, or in their own files. + */ + var oneArgumentPooler = function(copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, copyFieldsFrom); + return instance; + } else { + return new Klass(copyFieldsFrom); + } + }; - var DOMPropertyInjection = { - /** - * Mapping from normalized, camelcased property names to a configuration that - * specifies how the associated DOM property should be accessed or rendered. - */ - MUST_USE_ATTRIBUTE: 0x1, - MUST_USE_PROPERTY: 0x2, - HAS_SIDE_EFFECTS: 0x4, - HAS_BOOLEAN_VALUE: 0x8, - HAS_NUMERIC_VALUE: 0x10, - HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, - HAS_OVERLOADED_BOOLEAN_VALUE: 0x40, + var twoArgumentPooler = function(a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2); + return instance; + } else { + return new Klass(a1, a2); + } + }; - /** - * Inject some specialized knowledge about the DOM. This takes a config object - * with the following properties: - * - * isCustomAttribute: function that given an attribute name will return true - * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* - * attributes where it's impossible to enumerate all of the possible - * attribute names, - * - * Properties: object mapping DOM property name to one of the - * DOMPropertyInjection constants or null. If your attribute isn't in here, - * it won't get written to the DOM. - * - * DOMAttributeNames: object mapping React attribute name to the DOM - * attribute name. Attribute names not specified use the **lowercase** - * normalized name. - * - * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. - * Property names not specified use the normalized name. - * - * DOMMutationMethods: Properties that require special mutation methods. If - * `value` is undefined, the mutation method should unset the property. - * - * @param {object} domPropertyConfig the config as described above. - */ - injectDOMPropertyConfig: function(domPropertyConfig) { - var Properties = domPropertyConfig.Properties || {}; - var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; - var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; - var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; - - if (domPropertyConfig.isCustomAttribute) { - DOMProperty._isCustomAttributeFunctions.push( - domPropertyConfig.isCustomAttribute - ); - } + var threeArgumentPooler = function(a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3); + return instance; + } else { + return new Klass(a1, a2, a3); + } + }; - for (var propName in Properties) { - (false ? invariant( - !DOMProperty.isStandardName.hasOwnProperty(propName), - 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + - '\'%s\' which has already been injected. You may be accidentally ' + - 'injecting the same DOM property config twice, or you may be ' + - 'injecting two configs that have conflicting property names.', - propName - ) : invariant(!DOMProperty.isStandardName.hasOwnProperty(propName))); + var fiveArgumentPooler = function(a1, a2, a3, a4, a5) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4, a5); + return instance; + } else { + return new Klass(a1, a2, a3, a4, a5); + } + }; - DOMProperty.isStandardName[propName] = true; + var standardReleaser = function(instance) { + var Klass = this; + (false ? invariant( + instance instanceof Klass, + 'Trying to release an instance into a pool of a different type.' + ) : invariant(instance instanceof Klass)); + if (instance.destructor) { + instance.destructor(); + } + if (Klass.instancePool.length < Klass.poolSize) { + Klass.instancePool.push(instance); + } + }; - var lowerCased = propName.toLowerCase(); - DOMProperty.getPossibleStandardName[lowerCased] = propName; + var DEFAULT_POOL_SIZE = 10; + var DEFAULT_POOLER = oneArgumentPooler; - if (DOMAttributeNames.hasOwnProperty(propName)) { - var attributeName = DOMAttributeNames[propName]; - DOMProperty.getPossibleStandardName[attributeName] = propName; - DOMProperty.getAttributeName[propName] = attributeName; - } else { - DOMProperty.getAttributeName[propName] = lowerCased; - } + /** + * Augments `CopyConstructor` to be a poolable class, augmenting only the class + * itself (statically) not adding any prototypical fields. Any CopyConstructor + * you give this may have a `poolSize` property, and will look for a + * prototypical `destructor` on instances (optional). + * + * @param {Function} CopyConstructor Constructor that can be used to reset. + * @param {Function} pooler Customizable pooler. + */ + var addPoolingTo = function(CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + NewKlass.instancePool = []; + NewKlass.getPooled = pooler || DEFAULT_POOLER; + if (!NewKlass.poolSize) { + NewKlass.poolSize = DEFAULT_POOL_SIZE; + } + NewKlass.release = standardReleaser; + return NewKlass; + }; - DOMProperty.getPropertyName[propName] = - DOMPropertyNames.hasOwnProperty(propName) ? - DOMPropertyNames[propName] : - propName; + var PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fiveArgumentPooler: fiveArgumentPooler + }; - if (DOMMutationMethods.hasOwnProperty(propName)) { - DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName]; - } else { - DOMProperty.getMutationMethod[propName] = null; - } + module.exports = PooledClass; - var propConfig = Properties[propName]; - DOMProperty.mustUseAttribute[propName] = - checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE); - DOMProperty.mustUseProperty[propName] = - checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY); - DOMProperty.hasSideEffects[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS); - DOMProperty.hasBooleanValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE); - DOMProperty.hasNumericValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE); - DOMProperty.hasPositiveNumericValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE); - DOMProperty.hasOverloadedBooleanValue[propName] = - checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE); - (false ? invariant( - !DOMProperty.mustUseAttribute[propName] || - !DOMProperty.mustUseProperty[propName], - 'DOMProperty: Cannot require using both attribute and property: %s', - propName - ) : invariant(!DOMProperty.mustUseAttribute[propName] || - !DOMProperty.mustUseProperty[propName])); - (false ? invariant( - DOMProperty.mustUseProperty[propName] || - !DOMProperty.hasSideEffects[propName], - 'DOMProperty: Properties that have side effects must use property: %s', - propName - ) : invariant(DOMProperty.mustUseProperty[propName] || - !DOMProperty.hasSideEffects[propName])); - (false ? invariant( - !!DOMProperty.hasBooleanValue[propName] + - !!DOMProperty.hasNumericValue[propName] + - !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1, - 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + - 'numeric value, but not a combination: %s', - propName - ) : invariant(!!DOMProperty.hasBooleanValue[propName] + - !!DOMProperty.hasNumericValue[propName] + - !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1)); - } - } - }; - var defaultValueCache = {}; +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { /** - * DOMProperty exports lookup objects that can be used like functions: - * - * > DOMProperty.isValid['id'] - * true - * > DOMProperty.isValid['foobar'] - * undefined + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * Although this may be confusing, it performs better in general. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * - * @see http://jsperf.com/key-exists - * @see http://jsperf.com/key-missing + * @providesModule traverseAllChildren */ - var DOMProperty = { - - ID_ATTRIBUTE_NAME: 'data-reactid', - /** - * Checks whether a property name is a standard property. - * @type {Object} - */ - isStandardName: {}, + "use strict"; - /** - * Mapping from lowercase property names to the properly cased version, used - * to warn in the case of missing properties. - * @type {Object} - */ - getPossibleStandardName: {}, + var ReactElement = __webpack_require__(18); + var ReactInstanceHandles = __webpack_require__(23); - /** - * Mapping from normalized names to attribute names that differ. Attribute - * names are used when rendering markup or with `*Attribute()`. - * @type {Object} - */ - getAttributeName: {}, + var invariant = __webpack_require__(40); - /** - * Mapping from normalized names to properties on DOM node instances. - * (This includes properties that mutate due to external factors.) - * @type {Object} - */ - getPropertyName: {}, + var SEPARATOR = ReactInstanceHandles.SEPARATOR; + var SUBSEPARATOR = ':'; - /** - * Mapping from normalized names to mutation methods. This will only exist if - * mutation cannot be set simply by the property or `setAttribute()`. - * @type {Object} - */ - getMutationMethod: {}, + /** + * TODO: Test that: + * 1. `mapChildren` transforms strings and numbers into `ReactTextComponent`. + * 2. it('should fail when supplied duplicate key', function() { + * 3. That a single child and an array with one item have the same key pattern. + * }); + */ - /** - * Whether the property must be accessed and mutated as an object property. - * @type {Object} - */ - mustUseAttribute: {}, + var userProvidedKeyEscaperLookup = { + '=': '=0', + '.': '=1', + ':': '=2' + }; - /** - * Whether the property must be accessed and mutated using `*Attribute()`. - * (This includes anything that fails ` in `.) - * @type {Object} - */ - mustUseProperty: {}, + var userProvidedKeyEscapeRegex = /[=.:]/g; - /** - * Whether or not setting a value causes side effects such as triggering - * resources to be loaded or text selection changes. We must ensure that - * the value is only set if it has changed. - * @type {Object} - */ - hasSideEffects: {}, - - /** - * Whether the property should be removed when set to a falsey value. - * @type {Object} - */ - hasBooleanValue: {}, - - /** - * Whether the property must be numeric or parse as a - * numeric and should be removed when set to a falsey value. - * @type {Object} - */ - hasNumericValue: {}, - - /** - * Whether the property must be positive numeric or parse as a positive - * numeric and should be removed when set to a falsey value. - * @type {Object} - */ - hasPositiveNumericValue: {}, - - /** - * Whether the property can be used as a flag as well as with a value. Removed - * when strictly equal to false; present without a value when strictly equal - * to true; present with a value otherwise. - * @type {Object} - */ - hasOverloadedBooleanValue: {}, - - /** - * All of the isCustomAttribute() functions that have been injected. - */ - _isCustomAttributeFunctions: [], - - /** - * Checks whether a property name is a custom attribute. - * @method - */ - isCustomAttribute: function(attributeName) { - for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { - var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; - if (isCustomAttributeFn(attributeName)) { - return true; - } - } - return false; - }, - - /** - * Returns the default property value for a DOM property (i.e., not an - * attribute). Most default values are '' or false, but not all. Worse yet, - * some (in particular, `type`) vary depending on the type of element. - * - * TODO: Is it better to grab all the possible properties when creating an - * element to avoid having to create the same element twice? - */ - getDefaultValueForProperty: function(nodeName, prop) { - var nodeDefaults = defaultValueCache[nodeName]; - var testElement; - if (!nodeDefaults) { - defaultValueCache[nodeName] = nodeDefaults = {}; - } - if (!(prop in nodeDefaults)) { - testElement = document.createElement(nodeName); - nodeDefaults[prop] = testElement[prop]; - } - return nodeDefaults[prop]; - }, - - injection: DOMPropertyInjection - }; - - module.exports = DOMProperty; - - -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { + function userProvidedKeyEscaper(match) { + return userProvidedKeyEscaperLookup[match]; + } /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * Generate a key string that identifies a component within a set. * - * @providesModule escapeTextForBrowser - * @typechecks static-only + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} */ - - "use strict"; - - var ESCAPE_LOOKUP = { - "&": "&", - ">": ">", - "<": "<", - "\"": """, - "'": "'" - }; - - var ESCAPE_REGEX = /[&><"']/g; - - function escaper(match) { - return ESCAPE_LOOKUP[match]; + function getComponentKey(component, index) { + if (component && component.key != null) { + // Explicit key + return wrapUserProvidedKey(component.key); + } + // Implicit key determined by the index in the set + return index.toString(36); } /** - * Escapes text to prevent scripting attacks. + * Escape a component key so that it is safe to use in a reactid. * - * @param {*} text Text value to escape. + * @param {*} key Component key to be escaped. * @return {string} An escaped string. */ - function escapeTextForBrowser(text) { - return ('' + text).replace(ESCAPE_REGEX, escaper); + function escapeUserProvidedKey(text) { + return ('' + text).replace( + userProvidedKeyEscapeRegex, + userProvidedKeyEscaper + ); } - module.exports = escapeTextForBrowser; - - -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * Wrap a `key` value explicitly provided by the user to distinguish it from + * implicitly-generated keys generated by a component's index in its parent. * - * @providesModule memoizeStringOnly - * @typechecks static-only + * @param {string} key Value of a user-provided `key` attribute + * @return {string} */ - - "use strict"; + function wrapUserProvidedKey(key) { + return '$' + escapeUserProvidedKey(key); + } /** - * Memoizes the return value of a function that accepts one string argument. - * - * @param {function} callback - * @return {function} + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!number} indexSoFar Number of children encountered until this point. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. */ - function memoizeStringOnly(callback) { - var cache = {}; - return function(string) { - if (cache.hasOwnProperty(string)) { - return cache[string]; + var traverseAllChildrenImpl = + function(children, nameSoFar, indexSoFar, callback, traverseContext) { + var nextName, nextIndex; + var subtreeCount = 0; // Count of children found in the current subtree. + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; + nextName = ( + nameSoFar + + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + + getComponentKey(child, i) + ); + nextIndex = indexSoFar + subtreeCount; + subtreeCount += traverseAllChildrenImpl( + child, + nextName, + nextIndex, + callback, + traverseContext + ); + } } else { - return cache[string] = callback.call(this, string); + var type = typeof children; + var isOnlyChild = nameSoFar === ''; + // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows + var storageName = + isOnlyChild ? SEPARATOR + getComponentKey(children, 0) : nameSoFar; + if (children == null || type === 'boolean') { + // All of the above are perceived as null. + callback(traverseContext, null, storageName, indexSoFar); + subtreeCount = 1; + } else if (type === 'string' || type === 'number' || + ReactElement.isValidElement(children)) { + callback(traverseContext, children, storageName, indexSoFar); + subtreeCount = 1; + } else if (type === 'object') { + (false ? invariant( + !children || children.nodeType !== 1, + 'traverseAllChildren(...): Encountered an invalid child; DOM ' + + 'elements are not valid children of React components.' + ) : invariant(!children || children.nodeType !== 1)); + for (var key in children) { + if (children.hasOwnProperty(key)) { + nextName = ( + nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + + wrapUserProvidedKey(key) + SUBSEPARATOR + + getComponentKey(children[key], 0) + ); + nextIndex = indexSoFar + subtreeCount; + subtreeCount += traverseAllChildrenImpl( + children[key], + nextName, + nextIndex, + callback, + traverseContext + ); + } + } + } } + return subtreeCount; }; + + /** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ + function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', 0, callback, traverseContext); } - module.exports = memoizeStringOnly; + module.exports = traverseAllChildren; /***/ }, -/* 50 */ +/* 43 */ /***/ function(module, exports, __webpack_require__) { + var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactOwner.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactOwner.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } + /** - * Copyright 2014, Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule warning + * @providesModule ReactOwner */ "use strict"; - var emptyFunction = __webpack_require__(99); + var emptyObject = __webpack_require__(95); + var invariant = __webpack_require__(40); /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var warning = emptyFunction; - - if (false) { - warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); - if (format === undefined) { - throw new Error( - '`warning(condition, format, ...args)` requires a warning ' + - 'message argument' - ); - } - - if (!condition) { - var argIndex = 0; - console.warn('Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];})); - } - }; - } - - module.exports = warning; - - -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. + * ReactOwners are capable of storing references to owned components. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * All components are capable of //being// referenced by owner components, but + * only ReactOwner components are capable of //referencing// owned components. + * The named reference is known as a "ref". * - * @providesModule PooledClass + * Refs are available when mounted and updated during reconciliation. + * + * var MyComponent = __HUA.createClass({ + * render: function() { + * return ( + *
+ * + *
+ * ); + * }, + * handleClick: function() { + * this.refs.custom.handleClick(); + * }, + * componentDidMount: function() { + * this.refs.custom.initialize(); + * } + * }); + * + * Refs should rarely be used. When refs are used, they should only be done to + * control data that is not handled by React's data flow. + * + * @class ReactOwner */ + var ReactOwner = { - "use strict"; - - var invariant = __webpack_require__(46); + /** + * @param {?object} object + * @return {boolean} True if `object` is a valid owner. + * @final + */ + isValidOwner: function(object) { + return !!( + object && + typeof object.attachRef === 'function' && + typeof object.detachRef === 'function' + ); + }, - /** - * Static poolers. Several custom versions for each potential number of - * arguments. A completely generic pooler is easy to implement, but would - * require accessing the `arguments` object. In each of these, `this` refers to - * the Class itself, not an instance. If any others are needed, simply add them - * here, or in their own files. - */ - var oneArgumentPooler = function(copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, copyFieldsFrom); - return instance; - } else { - return new Klass(copyFieldsFrom); - } - }; + /** + * Adds a component by ref to an owner component. + * + * @param {ReactComponent} component Component to reference. + * @param {string} ref Name by which to refer to the component. + * @param {ReactOwner} owner Component on which to record the ref. + * @final + * @internal + */ + addComponentAsRefTo: function(component, ref, owner) { + (false ? invariant( + ReactOwner.isValidOwner(owner), + 'addComponentAsRefTo(...): Only a ReactOwner can have refs. This ' + + 'usually means that you\'re trying to add a ref to a component that ' + + 'doesn\'t have an owner (that is, was not created inside of another ' + + 'component\'s `render` method). Try rendering this component inside of ' + + 'a new top-level component which will hold the ref.' + ) : invariant(ReactOwner.isValidOwner(owner))); + owner.attachRef(ref, component); + }, - var twoArgumentPooler = function(a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2); - return instance; - } else { - return new Klass(a1, a2); - } - }; + /** + * Removes a component by ref from an owner component. + * + * @param {ReactComponent} component Component to dereference. + * @param {string} ref Name of the ref to remove. + * @param {ReactOwner} owner Component on which the ref is recorded. + * @final + * @internal + */ + removeComponentAsRefFrom: function(component, ref, owner) { + (false ? invariant( + ReactOwner.isValidOwner(owner), + 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. This ' + + 'usually means that you\'re trying to remove a ref to a component that ' + + 'doesn\'t have an owner (that is, was not created inside of another ' + + 'component\'s `render` method). Try rendering this component inside of ' + + 'a new top-level component which will hold the ref.' + ) : invariant(ReactOwner.isValidOwner(owner))); + // Check that `component` is still the current ref because we do not want to + // detach the ref if another component stole it. + if (owner.refs[ref] === component) { + owner.detachRef(ref); + } + }, - var threeArgumentPooler = function(a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3); - return instance; - } else { - return new Klass(a1, a2, a3); - } - }; + /** + * A ReactComponent must mix this in to have refs. + * + * @lends {ReactOwner.prototype} + */ + Mixin: { - var fiveArgumentPooler = function(a1, a2, a3, a4, a5) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4, a5); - return instance; - } else { - return new Klass(a1, a2, a3, a4, a5); - } - }; + construct: function() { + this.refs = emptyObject; + }, - var standardReleaser = function(instance) { - var Klass = this; - (false ? invariant( - instance instanceof Klass, - 'Trying to release an instance into a pool of a different type.' - ) : invariant(instance instanceof Klass)); - if (instance.destructor) { - instance.destructor(); - } - if (Klass.instancePool.length < Klass.poolSize) { - Klass.instancePool.push(instance); - } - }; + /** + * Lazily allocates the refs object and stores `component` as `ref`. + * + * @param {string} ref Reference name. + * @param {component} component Component to store as `ref`. + * @final + * @private + */ + attachRef: function(ref, component) { + (false ? invariant( + component.isOwnedBy(this), + 'attachRef(%s, ...): Only a component\'s owner can store a ref to it.', + ref + ) : invariant(component.isOwnedBy(this))); + var refs = this.refs === emptyObject ? (this.refs = {}) : this.refs; + refs[ref] = component; + }, - var DEFAULT_POOL_SIZE = 10; - var DEFAULT_POOLER = oneArgumentPooler; + /** + * Detaches a reference name. + * + * @param {string} ref Name to dereference. + * @final + * @private + */ + detachRef: function(ref) { + delete this.refs[ref]; + } - /** - * Augments `CopyConstructor` to be a poolable class, augmenting only the class - * itself (statically) not adding any prototypical fields. Any CopyConstructor - * you give this may have a `poolSize` property, and will look for a - * prototypical `destructor` on instances (optional). - * - * @param {Function} CopyConstructor Constructor that can be used to reset. - * @param {Function} pooler Customizable pooler. - */ - var addPoolingTo = function(CopyConstructor, pooler) { - var NewKlass = CopyConstructor; - NewKlass.instancePool = []; - NewKlass.getPooled = pooler || DEFAULT_POOLER; - if (!NewKlass.poolSize) { - NewKlass.poolSize = DEFAULT_POOL_SIZE; } - NewKlass.release = standardReleaser; - return NewKlass; - }; - var PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fiveArgumentPooler: fiveArgumentPooler }; - module.exports = PooledClass; + module.exports = ReactOwner; /***/ }, -/* 52 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8900,341 +8266,288 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule traverseAllChildren + * @providesModule ReactUpdates */ "use strict"; - var ReactElement = __webpack_require__(21); - var ReactInstanceHandles = __webpack_require__(26); + var CallbackQueue = __webpack_require__(93); + var PooledClass = __webpack_require__(41); + var ReactCurrentOwner = __webpack_require__(17); + var ReactPerf = __webpack_require__(27); + var Transaction = __webpack_require__(94); - var invariant = __webpack_require__(46); + var assign = __webpack_require__(31); + var invariant = __webpack_require__(40); + var warning = __webpack_require__(38); - var SEPARATOR = ReactInstanceHandles.SEPARATOR; - var SUBSEPARATOR = ':'; + var dirtyComponents = []; + var asapCallbackQueue = CallbackQueue.getPooled(); + var asapEnqueued = false; - /** - * TODO: Test that: - * 1. `mapChildren` transforms strings and numbers into `ReactTextComponent`. - * 2. it('should fail when supplied duplicate key', function() { - * 3. That a single child and an array with one item have the same key pattern. - * }); - */ + var batchingStrategy = null; - var userProvidedKeyEscaperLookup = { - '=': '=0', - '.': '=1', - ':': '=2' + function ensureInjected() { + (false ? invariant( + ReactUpdates.ReactReconcileTransaction && batchingStrategy, + 'ReactUpdates: must inject a reconcile transaction class and batching ' + + 'strategy' + ) : invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy)); + } + + var NESTED_UPDATES = { + initialize: function() { + this.dirtyComponentsLength = dirtyComponents.length; + }, + close: function() { + if (this.dirtyComponentsLength !== dirtyComponents.length) { + // Additional updates were enqueued by componentDidUpdate handlers or + // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run + // these new updates so that if A's componentDidUpdate calls setState on + // B, B will update before the callback A's updater provided when calling + // setState. + dirtyComponents.splice(0, this.dirtyComponentsLength); + flushBatchedUpdates(); + } else { + dirtyComponents.length = 0; + } + } }; - var userProvidedKeyEscapeRegex = /[=.:]/g; + var UPDATE_QUEUEING = { + initialize: function() { + this.callbackQueue.reset(); + }, + close: function() { + this.callbackQueue.notifyAll(); + } + }; - function userProvidedKeyEscaper(match) { - return userProvidedKeyEscaperLookup[match]; + var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; + + function ReactUpdatesFlushTransaction() { + this.reinitializeTransaction(); + this.dirtyComponentsLength = null; + this.callbackQueue = CallbackQueue.getPooled(); + this.reconcileTransaction = + ReactUpdates.ReactReconcileTransaction.getPooled(); } - /** - * Generate a key string that identifies a component within a set. - * - * @param {*} component A component that could contain a manual key. - * @param {number} index Index that is used if a manual key is not provided. - * @return {string} - */ - function getComponentKey(component, index) { - if (component && component.key != null) { - // Explicit key - return wrapUserProvidedKey(component.key); + assign( + ReactUpdatesFlushTransaction.prototype, + Transaction.Mixin, { + getTransactionWrappers: function() { + return TRANSACTION_WRAPPERS; + }, + + destructor: function() { + this.dirtyComponentsLength = null; + CallbackQueue.release(this.callbackQueue); + this.callbackQueue = null; + ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); + this.reconcileTransaction = null; + }, + + perform: function(method, scope, a) { + // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` + // with this transaction's wrappers around it. + return Transaction.Mixin.perform.call( + this, + this.reconcileTransaction.perform, + this.reconcileTransaction, + method, + scope, + a + ); } - // Implicit key determined by the index in the set - return index.toString(36); - } + }); - /** - * Escape a component key so that it is safe to use in a reactid. - * - * @param {*} key Component key to be escaped. - * @return {string} An escaped string. - */ - function escapeUserProvidedKey(text) { - return ('' + text).replace( - userProvidedKeyEscapeRegex, - userProvidedKeyEscaper - ); + PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); + + function batchedUpdates(callback, a, b) { + ensureInjected(); + batchingStrategy.batchedUpdates(callback, a, b); } /** - * Wrap a `key` value explicitly provided by the user to distinguish it from - * implicitly-generated keys generated by a component's index in its parent. + * Array comparator for ReactComponents by owner depth * - * @param {string} key Value of a user-provided `key` attribute - * @return {string} + * @param {ReactComponent} c1 first component you're comparing + * @param {ReactComponent} c2 second component you're comparing + * @return {number} Return value usable by Array.prototype.sort(). */ - function wrapUserProvidedKey(key) { - return '$' + escapeUserProvidedKey(key); + function mountDepthComparator(c1, c2) { + return c1._mountDepth - c2._mountDepth; } - /** - * @param {?*} children Children tree container. - * @param {!string} nameSoFar Name of the key path so far. - * @param {!number} indexSoFar Number of children encountered until this point. - * @param {!function} callback Callback to invoke with each child found. - * @param {?*} traverseContext Used to pass information throughout the traversal - * process. - * @return {!number} The number of children in this subtree. - */ - var traverseAllChildrenImpl = - function(children, nameSoFar, indexSoFar, callback, traverseContext) { - var nextName, nextIndex; - var subtreeCount = 0; // Count of children found in the current subtree. - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - var child = children[i]; - nextName = ( - nameSoFar + - (nameSoFar ? SUBSEPARATOR : SEPARATOR) + - getComponentKey(child, i) - ); - nextIndex = indexSoFar + subtreeCount; - subtreeCount += traverseAllChildrenImpl( - child, - nextName, - nextIndex, - callback, - traverseContext - ); - } - } else { - var type = typeof children; - var isOnlyChild = nameSoFar === ''; - // If it's the only child, treat the name as if it was wrapped in an array - // so that it's consistent if the number of children grows - var storageName = - isOnlyChild ? SEPARATOR + getComponentKey(children, 0) : nameSoFar; - if (children == null || type === 'boolean') { - // All of the above are perceived as null. - callback(traverseContext, null, storageName, indexSoFar); - subtreeCount = 1; - } else if (type === 'string' || type === 'number' || - ReactElement.isValidElement(children)) { - callback(traverseContext, children, storageName, indexSoFar); - subtreeCount = 1; - } else if (type === 'object') { - (false ? invariant( - !children || children.nodeType !== 1, - 'traverseAllChildren(...): Encountered an invalid child; DOM ' + - 'elements are not valid children of React components.' - ) : invariant(!children || children.nodeType !== 1)); - for (var key in children) { - if (children.hasOwnProperty(key)) { - nextName = ( - nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + - wrapUserProvidedKey(key) + SUBSEPARATOR + - getComponentKey(children[key], 0) - ); - nextIndex = indexSoFar + subtreeCount; - subtreeCount += traverseAllChildrenImpl( - children[key], - nextName, - nextIndex, - callback, - traverseContext - ); - } + function runBatchedUpdates(transaction) { + var len = transaction.dirtyComponentsLength; + (false ? invariant( + len === dirtyComponents.length, + 'Expected flush transaction\'s stored dirty-components length (%s) to ' + + 'match dirty-components array length (%s).', + len, + dirtyComponents.length + ) : invariant(len === dirtyComponents.length)); + + // Since reconciling a component higher in the owner hierarchy usually (not + // always -- see shouldComponentUpdate()) will reconcile children, reconcile + // them before their children by sorting the array. + dirtyComponents.sort(mountDepthComparator); + + for (var i = 0; i < len; i++) { + // If a component is unmounted before pending changes apply, ignore them + // TODO: Queue unmounts in the same list to avoid this happening at all + var component = dirtyComponents[i]; + if (component.isMounted()) { + // If performUpdateIfNecessary happens to enqueue any new updates, we + // shouldn't execute the callbacks until the next render happens, so + // stash the callbacks first + var callbacks = component._pendingCallbacks; + component._pendingCallbacks = null; + component.performUpdateIfNecessary(transaction.reconcileTransaction); + + if (callbacks) { + for (var j = 0; j < callbacks.length; j++) { + transaction.callbackQueue.enqueue( + callbacks[j], + component + ); } } } - return subtreeCount; - }; - - /** - * Traverses children that are typically specified as `props.children`, but - * might also be specified through attributes: - * - * - `traverseAllChildren(this.props.children, ...)` - * - `traverseAllChildren(this.props.leftPanelChildren, ...)` - * - * The `traverseContext` is an optional argument that is passed through the - * entire traversal. It can be used to store accumulations or anything else that - * the callback might find relevant. - * - * @param {?*} children Children tree object. - * @param {!function} callback To invoke upon traversing each child. - * @param {?*} traverseContext Context for traversal. - * @return {!number} The number of children in this subtree. - */ - function traverseAllChildren(children, callback, traverseContext) { - if (children == null) { - return 0; } - - return traverseAllChildrenImpl(children, '', 0, callback, traverseContext); } - module.exports = traverseAllChildren; - - -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { - - var __HUA = (function () { var React = __webpack_require__(3); var getHotUpdateAPI = __webpack_require__(1); return getHotUpdateAPI(React, "ReactOwner.js", module.id); })(); if (false) { module.hot.accept(function (err) { if (err) { console.error("Cannot not apply hot update to " + "ReactOwner.js" + ": " + err.message); } }); module.hot.dispose(function () { var nextTick = require("/Users/gianu/work/react-fittext/node_modules/react-hot-loader/node_modules/next-tick/index.js"); nextTick(__HUA.updateMountedInstances); }); } + var flushBatchedUpdates = ReactPerf.measure( + 'ReactUpdates', + 'flushBatchedUpdates', + function() { + // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents + // array and perform any updates enqueued by mount-ready handlers (i.e., + // componentDidUpdate) but we need to check here too in order to catch + // updates enqueued by setState callbacks and asap calls. + while (dirtyComponents.length || asapEnqueued) { + if (dirtyComponents.length) { + var transaction = ReactUpdatesFlushTransaction.getPooled(); + transaction.perform(runBatchedUpdates, null, transaction); + ReactUpdatesFlushTransaction.release(transaction); + } + + if (asapEnqueued) { + asapEnqueued = false; + var queue = asapCallbackQueue; + asapCallbackQueue = CallbackQueue.getPooled(); + queue.notifyAll(); + CallbackQueue.release(queue); + } + } + } + ); /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactOwner + * Mark a component as needing a rerender, adding an optional callback to a + * list of functions which will be executed once the rerender occurs. */ + function enqueueUpdate(component, callback) { + (false ? invariant( + !callback || typeof callback === "function", + 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' + + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + + 'isn\'t callable.' + ) : invariant(!callback || typeof callback === "function")); + ensureInjected(); - "use strict"; + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (This is called by each top-level update + // function, like setProps, setState, forceUpdate, etc.; creation and + // destruction of top-level components is guarded in ReactMount.) + (false ? warning( + ReactCurrentOwner.current == null, + 'enqueueUpdate(): Render methods should be a pure function of props ' + + 'and state; triggering nested component updates from render is not ' + + 'allowed. If necessary, trigger nested updates in ' + + 'componentDidUpdate.' + ) : null); + + if (!batchingStrategy.isBatchingUpdates) { + batchingStrategy.batchedUpdates(enqueueUpdate, component, callback); + return; + } + + dirtyComponents.push(component); - var emptyObject = __webpack_require__(109); - var invariant = __webpack_require__(46); + if (callback) { + if (component._pendingCallbacks) { + component._pendingCallbacks.push(callback); + } else { + component._pendingCallbacks = [callback]; + } + } + } /** - * ReactOwners are capable of storing references to owned components. - * - * All components are capable of //being// referenced by owner components, but - * only ReactOwner components are capable of //referencing// owned components. - * The named reference is known as a "ref". - * - * Refs are available when mounted and updated during reconciliation. - * - * var MyComponent = __HUA.createClass({ - * render: function() { - * return ( - *
- * - *
- * ); - * }, - * handleClick: function() { - * this.refs.custom.handleClick(); - * }, - * componentDidMount: function() { - * this.refs.custom.initialize(); - * } - * }); - * - * Refs should rarely be used. When refs are used, they should only be done to - * control data that is not handled by React's data flow. - * - * @class ReactOwner + * Enqueue a callback to be run at the end of the current batching cycle. Throws + * if no updates are currently being performed. */ - var ReactOwner = { - - /** - * @param {?object} object - * @return {boolean} True if `object` is a valid owner. - * @final - */ - isValidOwner: function(object) { - return !!( - object && - typeof object.attachRef === 'function' && - typeof object.detachRef === 'function' - ); - }, + function asap(callback, context) { + (false ? invariant( + batchingStrategy.isBatchingUpdates, + 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + + 'updates are not being batched.' + ) : invariant(batchingStrategy.isBatchingUpdates)); + asapCallbackQueue.enqueue(callback, context); + asapEnqueued = true; + } - /** - * Adds a component by ref to an owner component. - * - * @param {ReactComponent} component Component to reference. - * @param {string} ref Name by which to refer to the component. - * @param {ReactOwner} owner Component on which to record the ref. - * @final - * @internal - */ - addComponentAsRefTo: function(component, ref, owner) { + var ReactUpdatesInjection = { + injectReconcileTransaction: function(ReconcileTransaction) { (false ? invariant( - ReactOwner.isValidOwner(owner), - 'addComponentAsRefTo(...): Only a ReactOwner can have refs. This ' + - 'usually means that you\'re trying to add a ref to a component that ' + - 'doesn\'t have an owner (that is, was not created inside of another ' + - 'component\'s `render` method). Try rendering this component inside of ' + - 'a new top-level component which will hold the ref.' - ) : invariant(ReactOwner.isValidOwner(owner))); - owner.attachRef(ref, component); + ReconcileTransaction, + 'ReactUpdates: must provide a reconcile transaction class' + ) : invariant(ReconcileTransaction)); + ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; }, - /** - * Removes a component by ref from an owner component. - * - * @param {ReactComponent} component Component to dereference. - * @param {string} ref Name of the ref to remove. - * @param {ReactOwner} owner Component on which the ref is recorded. - * @final - * @internal - */ - removeComponentAsRefFrom: function(component, ref, owner) { + injectBatchingStrategy: function(_batchingStrategy) { (false ? invariant( - ReactOwner.isValidOwner(owner), - 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. This ' + - 'usually means that you\'re trying to remove a ref to a component that ' + - 'doesn\'t have an owner (that is, was not created inside of another ' + - 'component\'s `render` method). Try rendering this component inside of ' + - 'a new top-level component which will hold the ref.' - ) : invariant(ReactOwner.isValidOwner(owner))); - // Check that `component` is still the current ref because we do not want to - // detach the ref if another component stole it. - if (owner.refs[ref] === component) { - owner.detachRef(ref); - } - }, + _batchingStrategy, + 'ReactUpdates: must provide a batching strategy' + ) : invariant(_batchingStrategy)); + (false ? invariant( + typeof _batchingStrategy.batchedUpdates === 'function', + 'ReactUpdates: must provide a batchedUpdates() function' + ) : invariant(typeof _batchingStrategy.batchedUpdates === 'function')); + (false ? invariant( + typeof _batchingStrategy.isBatchingUpdates === 'boolean', + 'ReactUpdates: must provide an isBatchingUpdates boolean attribute' + ) : invariant(typeof _batchingStrategy.isBatchingUpdates === 'boolean')); + batchingStrategy = _batchingStrategy; + } + }; + var ReactUpdates = { /** - * A ReactComponent must mix this in to have refs. + * React references `ReactReconcileTransaction` using this property in order + * to allow dependency injection. * - * @lends {ReactOwner.prototype} + * @internal */ - Mixin: { - - construct: function() { - this.refs = emptyObject; - }, - - /** - * Lazily allocates the refs object and stores `component` as `ref`. - * - * @param {string} ref Reference name. - * @param {component} component Component to store as `ref`. - * @final - * @private - */ - attachRef: function(ref, component) { - (false ? invariant( - component.isOwnedBy(this), - 'attachRef(%s, ...): Only a component\'s owner can store a ref to it.', - ref - ) : invariant(component.isOwnedBy(this))); - var refs = this.refs === emptyObject ? (this.refs = {}) : this.refs; - refs[ref] = component; - }, - - /** - * Detaches a reference name. - * - * @param {string} ref Name to dereference. - * @final - * @private - */ - detachRef: function(ref) { - delete this.refs[ref]; - } - - } + ReactReconcileTransaction: null, + batchedUpdates: batchedUpdates, + enqueueUpdate: enqueueUpdate, + flushBatchedUpdates: flushBatchedUpdates, + injection: ReactUpdatesInjection, + asap: asap }; - module.exports = ReactOwner; + module.exports = ReactUpdates; /***/ }, -/* 54 */ +/* 45 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9251,7 +8564,7 @@ "use strict"; - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); /** * Constructs an enumeration with keys equal to their value. @@ -9291,7 +8604,7 @@ /***/ }, -/* 55 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9307,9 +8620,9 @@ "use strict"; - var ReactElement = __webpack_require__(21); + var ReactElement = __webpack_require__(18); - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); var component; // This registry keeps track of the React IDs of the components that rendered to @@ -9370,7 +8683,7 @@ /***/ }, -/* 56 */ +/* 47 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9406,7 +8719,7 @@ /***/ }, -/* 57 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9422,11 +8735,11 @@ "use strict"; - var assign = __webpack_require__(34); - var emptyFunction = __webpack_require__(99); - var invariant = __webpack_require__(46); - var joinClasses = __webpack_require__(110); - var warning = __webpack_require__(50); + var assign = __webpack_require__(31); + var emptyFunction = __webpack_require__(90); + var invariant = __webpack_require__(40); + var joinClasses = __webpack_require__(96); + var warning = __webpack_require__(38); var didWarn = false; @@ -9575,7 +8888,7 @@ /***/ }, -/* 58 */ +/* 49 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9591,7 +8904,7 @@ "use strict"; - var keyMirror = __webpack_require__(54); + var keyMirror = __webpack_require__(45); var ReactPropTypeLocations = keyMirror({ prop: null, @@ -9603,7 +8916,7 @@ /***/ }, -/* 59 */ +/* 50 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9633,7 +8946,7 @@ /***/ }, -/* 60 */ +/* 51 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9650,12 +8963,12 @@ "use strict"; - var warning = __webpack_require__(50); + var warning = __webpack_require__(38); - var ReactElement = __webpack_require__(21); - var ReactLegacyElement = __webpack_require__(27); - var ReactNativeComponent = __webpack_require__(111); - var ReactEmptyComponent = __webpack_require__(55); + var ReactElement = __webpack_require__(18); + var ReactLegacyElement = __webpack_require__(24); + var ReactNativeComponent = __webpack_require__(97); + var ReactEmptyComponent = __webpack_require__(46); /** * Given an `element` create an instance that will actually be mounted. @@ -9749,7 +9062,7 @@ /***/ }, -/* 61 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9789,7 +9102,7 @@ /***/ }, -/* 62 */ +/* 53 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9805,7 +9118,7 @@ "use strict"; - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); /** * Provides open-source compatible instrumentation for monitoring certain API @@ -9825,7 +9138,7 @@ /***/ }, -/* 63 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9882,7 +9195,7 @@ /***/ }, -/* 64 */ +/* 55 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9924,7 +9237,7 @@ /***/ }, -/* 65 */ +/* 56 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9941,14 +9254,14 @@ "use strict"; - var CSSProperty = __webpack_require__(112); - var ExecutionEnvironment = __webpack_require__(75); + var CSSProperty = __webpack_require__(98); + var ExecutionEnvironment = __webpack_require__(66); - var camelizeStyleName = __webpack_require__(113); - var dangerousStyleValue = __webpack_require__(114); - var hyphenateStyleName = __webpack_require__(115); - var memoizeStringOnly = __webpack_require__(49); - var warning = __webpack_require__(50); + var camelizeStyleName = __webpack_require__(99); + var dangerousStyleValue = __webpack_require__(100); + var hyphenateStyleName = __webpack_require__(101); + var memoizeStringOnly = __webpack_require__(37); + var warning = __webpack_require__(38); var processStyleName = memoizeStringOnly(function(styleName) { return hyphenateStyleName(styleName); @@ -10061,7 +9374,7 @@ /***/ }, -/* 66 */ +/* 57 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10077,10 +9390,10 @@ "use strict"; - var ReactEmptyComponent = __webpack_require__(55); - var ReactMount = __webpack_require__(28); + var ReactEmptyComponent = __webpack_require__(46); + var ReactMount = __webpack_require__(25); - var invariant = __webpack_require__(46); + var invariant = __webpack_require__(40); var ReactBrowserComponentMixin = { /** @@ -10106,7 +9419,7 @@ /***/ }, -/* 67 */ +/* 58 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10123,14 +9436,14 @@ "use strict"; - var EventConstants = __webpack_require__(45); - var EventPluginHub = __webpack_require__(116); - var EventPluginRegistry = __webpack_require__(117); - var ReactEventEmitterMixin = __webpack_require__(118); - var ViewportMetrics = __webpack_require__(119); + var EventConstants = __webpack_require__(39); + var EventPluginHub = __webpack_require__(102); + var EventPluginRegistry = __webpack_require__(103); + var ReactEventEmitterMixin = __webpack_require__(104); + var ViewportMetrics = __webpack_require__(105); - var assign = __webpack_require__(34); - var isEventSupported = __webpack_require__(68); + var assign = __webpack_require__(31); + var isEventSupported = __webpack_require__(59); /** * Summary of `ReactBrowserEventEmitter` event handling: @@ -10465,7 +9778,7 @@ /***/ }, -/* 68 */ +/* 59 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10481,7 +9794,7 @@ "use strict"; - var ExecutionEnvironment = __webpack_require__(75); + var ExecutionEnvironment = __webpack_require__(66); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { @@ -10534,7 +9847,7 @@ /***/ }, -/* 69 */ +/* 60 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10551,12 +9864,12 @@ "use strict"; - var EventConstants = __webpack_require__(45); - var EventPropagators = __webpack_require__(120); - var ExecutionEnvironment = __webpack_require__(75); - var SyntheticInputEvent = __webpack_require__(121); + var EventConstants = __webpack_require__(39); + var EventPropagators = __webpack_require__(106); + var ExecutionEnvironment = __webpack_require__(66); + var SyntheticInputEvent = __webpack_require__(107); - var keyOf = __webpack_require__(61); + var keyOf = __webpack_require__(52); var canUseTextInputEvent = ( ExecutionEnvironment.canUseDOM && @@ -10760,7 +10073,7 @@ /***/ }, -/* 70 */ +/* 61 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10776,16 +10089,16 @@ "use strict"; - var EventConstants = __webpack_require__(45); - var EventPluginHub = __webpack_require__(116); - var EventPropagators = __webpack_require__(120); - var ExecutionEnvironment = __webpack_require__(75); - var ReactUpdates = __webpack_require__(41); - var SyntheticEvent = __webpack_require__(122); + var EventConstants = __webpack_require__(39); + var EventPluginHub = __webpack_require__(102); + var EventPropagators = __webpack_require__(106); + var ExecutionEnvironment = __webpack_require__(66); + var ReactUpdates = __webpack_require__(44); + var SyntheticEvent = __webpack_require__(108); - var isEventSupported = __webpack_require__(68); - var isTextInputElement = __webpack_require__(123); - var keyOf = __webpack_require__(61); + var isEventSupported = __webpack_require__(59); + var isTextInputElement = __webpack_require__(109); + var keyOf = __webpack_require__(52); var topLevelTypes = EventConstants.topLevelTypes; @@ -11146,7 +10459,7 @@ /***/ }, -/* 71 */ +/* 62 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11175,7 +10488,7 @@ /***/ }, -/* 72 */ +/* 63 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11192,14 +10505,14 @@ "use strict"; - var EventConstants = __webpack_require__(45); - var EventPropagators = __webpack_require__(120); - var ExecutionEnvironment = __webpack_require__(75); - var ReactInputSelection = __webpack_require__(124); - var SyntheticCompositionEvent = __webpack_require__(125); + var EventConstants = __webpack_require__(39); + var EventPropagators = __webpack_require__(106); + var ExecutionEnvironment = __webpack_require__(66); + var ReactInputSelection = __webpack_require__(110); + var SyntheticCompositionEvent = __webpack_require__(111); - var getTextContentAccessor = __webpack_require__(126); - var keyOf = __webpack_require__(61); + var getTextContentAccessor = __webpack_require__(112); + var keyOf = __webpack_require__(52); var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space var START_KEYCODE = 229; @@ -11438,7 +10751,7 @@ /***/ }, -/* 73 */ +/* 64 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11454,7 +10767,7 @@ "use strict"; - var keyOf = __webpack_require__(61); + var keyOf = __webpack_require__(52); /** * Module that is injectable into `EventPluginHub`, that specifies a @@ -11482,7 +10795,7 @@ /***/ }, -/* 74 */ +/* 65 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11499,12 +10812,12 @@ "use strict"; - var EventConstants = __webpack_require__(45); - var EventPropagators = __webpack_require__(120); - var SyntheticMouseEvent = __webpack_require__(127); + var EventConstants = __webpack_require__(39); + var EventPropagators = __webpack_require__(106); + var SyntheticMouseEvent = __webpack_require__(113); - var ReactMount = __webpack_require__(28); - var keyOf = __webpack_require__(61); + var ReactMount = __webpack_require__(25); + var keyOf = __webpack_require__(52); var topLevelTypes = EventConstants.topLevelTypes; var getFirstReactDOM = ReactMount.getFirstReactDOM; @@ -11626,7 +10939,7 @@ /***/ }, -/* 75 */ +/* 66 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11675,7 +10988,7 @@ /***/ }, -/* 76 */ +/* 67 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11693,8 +11006,8 @@ "use strict"; - var DOMProperty = __webpack_require__(47); - var ExecutionEnvironment = __webpack_require__(75); + var DOMProperty = __webpack_require__(35); + var ExecutionEnvironment = __webpack_require__(66); var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; @@ -11768,7 +11081,11 @@ draggable: null, encType: null, form: MUST_USE_ATTRIBUTE, + formAction: MUST_USE_ATTRIBUTE, + formEncType: MUST_USE_ATTRIBUTE, + formMethod: MUST_USE_ATTRIBUTE, formNoValidate: HAS_BOOLEAN_VALUE, + formTarget: MUST_USE_ATTRIBUTE, frameBorder: MUST_USE_ATTRIBUTE, height: MUST_USE_ATTRIBUTE, hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, @@ -11783,6 +11100,8 @@ list: MUST_USE_ATTRIBUTE, loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, manifest: MUST_USE_ATTRIBUTE, + marginHeight: null, + marginWidth: null, max: null, maxLength: MUST_USE_ATTRIBUTE, media: MUST_USE_ATTRIBUTE, @@ -11865,7 +11184,7 @@ /***/ }, -/* 77 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11882,9 +11201,9 @@ "use strict"; - var EventConstants = __webpack_require__(45); + var EventConstants = __webpack_require__(39); - var emptyFunction = __webpack_require__(99); + var emptyFunction = __webpack_require__(90); var topLevelTypes = EventConstants.topLevelTypes; @@ -11927,7 +11246,7 @@ /***/ }, -/* 78 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { /** @@ -11945,15 +11264,15 @@ "use strict"; - var ReactDOMIDOperations = __webpack_require__(128); - var ReactMarkupChecksum = __webpack_require__(100); - var ReactMount = __webpack_require__(28); - var ReactPerf = __webpack_require__(30); - var ReactReconcileTransaction = __webpack_require__(129); + var ReactDOMIDOperations = __webpack_require__(114); + var ReactMarkupChecksum = __webpack_require__(91); + var ReactMount = __webpack_require__(25); + var ReactPerf = __webpack_require__(27); + var ReactReconcileTransaction = __webpack_require__(115); - var getReactRootElementInContainer = __webpack_require__(96); - var invariant = __webpack_require__(46); - var setInnerHTML = __webpack_require__(130); + var getReactRootElementInContainer = __webpack_require__(87); + var invariant = __webpack_require__(40); + var setInnerHTML = __webpack_require__(116); var ELEMENT_NODE_TYPE = 1; @@ -12051,7 +11370,7 @@ /***/ }, -/* 79 */ +/* 70 */ /***/ function(module, exports, __webpack_require__) { /** @@ -12067,11 +11386,11 @@ "use strict"; - var ReactUpdates = __webpack_require__(41); - var Transaction = __webpack_require__(108); + var ReactUpdates = __webpack_require__(44); + var Transaction = __webpack_require__(94); - var assign = __webpack_require__(34); - var emptyFunction = __webpack_require__(99); + var assign = __webpack_require__(31); + var emptyFunction = __webpack_require__(90); var RESET_BATCHED_UPDATES = { initialize: emptyFunction, @@ -12128,7 +11447,7 @@ /***/ }, -/* 80 */ +/* 71 */ /***/ function(module, exports, __webpack_require__) { /** @@ -12144,13 +11463,13 @@ "use strict"; - var AutoFocusMixin = __webpack_require__(131); - var ReactBrowserComponentMixin = __webpack_require__(66); - var ReactCompositeComponent = __webpack_require__(18); - var ReactElement = __webpack_require__(21); - var ReactDOM = __webpack_require__(23); + var AutoFocusMixin = __webpack_require__(117); + var ReactBrowserComponentMixin = __webpack_require__(57); + var ReactCompositeComponent = __webpack_require__(15); + var ReactElement = __webpack_require__(18); + var ReactDOM = __webpack_require__(20); - var keyMirror = __webpack_require__(54); + var keyMirror = __webpack_require__(45); // Store a reference to the