update website

This commit is contained in:
Christopher Chedeau
2015-03-15 18:44:26 -07:00
parent 44f3f386c3
commit 1da61d41cb
28 changed files with 52 additions and 939 deletions
+1 -104
View File
@@ -23,110 +23,7 @@ in the render function.</p><p>Performance:
- Making a stylesheet from a style object makes it possible to refer to it
by ID instead of creating a new style object every time.
- It also allows to send the style only once through the bridge. All
subsequent uses are going to refer an id (not implemented yet).</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create(<span class="propType">obj</span>) <a class="hash-link" href="#create">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyleprop"></a><span class="propType">static </span>validateStyleProp(<span class="propType">prop, style, caller</span>) <a class="hash-link" href="#validatestyleprop">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyle"></a><span class="propType">static </span>validateStyle(<span class="propType">name, styles</span>) <a class="hash-link" href="#validatestyle">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="addvalidstyleproptypes"></a><span class="propType">static </span>addValidStylePropTypes(<span class="propType">stylePropTypes</span>) <a class="hash-link" href="#addvalidstyleproptypes">#</a></h4></div></div><pre>{
&quot;methods&quot;: [
{
&quot;line&quot;: 55,
&quot;source&quot;: &quot;static create(obj) {\n var result = {};\n for (var key in obj) {\n StyleSheet.validateStyle(key, obj);\n result[key] = StyleSheetRegistry.registerStyle(obj[key]);\n }\n return result;\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;obj&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;create&quot;
},
{
&quot;line&quot;: 64,
&quot;source&quot;: &quot;static validateStyleProp(prop, style, caller) {\n if (!__DEV__) {\n return;\n }\n if (allStylePropTypes[prop] === undefined) {\n var message1 = &#x27;\&quot;&#x27; + prop + &#x27;\&quot; is not a valid style property.&#x27;;\n var message2 = &#x27;\\nValid style props: &#x27; +\n JSON.stringify(Object.keys(allStylePropTypes), null, &#x27; &#x27;);\n styleError(message1, style, caller, message2);\n }\n var error = allStylePropTypes[prop](\n style,\n prop,\n caller,\n ReactPropTypeLocations.prop\n );\n if (error) {\n styleError(error.message, style, caller);\n }\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;prop&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;style&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;caller&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;validateStyleProp&quot;
},
{
&quot;line&quot;: 85,
&quot;source&quot;: &quot;static validateStyle(name, styles) {\n if (!__DEV__) {\n return;\n }\n for (var prop in styles[name]) {\n StyleSheet.validateStyleProp(prop, styles[name], &#x27;StyleSheet &#x27; + name);\n }\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;name&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;styles&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;validateStyle&quot;
},
{
&quot;line&quot;: 94,
&quot;source&quot;: &quot;static addValidStylePropTypes(stylePropTypes) {\n for (var key in stylePropTypes) {\n invariant(\n allStylePropTypes[key] === undefined ||\n allStylePropTypes[key] === stylePropTypes[key],\n &#x27;Attemped to redefine existing style prop type \&quot;&#x27; + key + &#x27;\&quot;.&#x27;\n );\n allStylePropTypes[key] = stylePropTypes[key];\n }\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;stylePropTypes&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;addValidStylePropTypes&quot;
}
],
&quot;type&quot;: &quot;api&quot;,
&quot;line&quot;: 54,
&quot;name&quot;: &quot;StyleSheet&quot;,
&quot;docblock&quot;: &quot;/**\n * A StyleSheet is an abstraction similar to CSS StyleSheets\n *\n * Create a new StyleSheet:\n *\n * var styles = StyleSheet.create({\n * container: {\n * borderRadius: 4,\n * borderWidth: 0.5,\n * borderColor: &#x27;#d6d7da&#x27;,\n * },\n * title: {\n * fontSize: 19,\n * fontWeight: &#x27;bold&#x27;,\n * },\n * activeTitle: {\n * color: &#x27;red&#x27;,\n * },\n * })\n *\n * Use a StyleSheet:\n *\n * &lt;View style={styles.container}&gt;\n * &lt;Text style={[styles.title, this.props.isActive &amp;&amp; styles.activeTitle]} /&gt;\n * &lt;/View&gt;\n *\n * Code quality:\n * - By moving styles away from the render function, you&#x27;re making the code\n * code easier to understand.\n * - Naming the styles is a good way to add meaning to the low level components\n * in the render function.\n *\n * Performance:\n * - Making a stylesheet from a style object makes it possible to refer to it\n * by ID instead of creating a new style object every time.\n * - It also allows to send the style only once through the bridge. All\n * subsequent uses are going to refer an id (not implemented yet).\n */\n&quot;,
&quot;requires&quot;: [
{
&quot;name&quot;: &quot;ImageStylePropTypes&quot;
},
{
&quot;name&quot;: &quot;ReactPropTypeLocations&quot;
},
{
&quot;name&quot;: &quot;StyleSheetRegistry&quot;
},
{
&quot;name&quot;: &quot;TextStylePropTypes&quot;
},
{
&quot;name&quot;: &quot;ViewStylePropTypes&quot;
},
{
&quot;name&quot;: &quot;invariant&quot;
}
]
}</pre></div><noscript></noscript><div class="docs-prevnext"></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
subsequent uses are going to refer an id (not implemented yet).</p></div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create(<span class="propType">obj</span>) <a class="hash-link" href="#create">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyleprop"></a><span class="propType">static </span>validateStyleProp(<span class="propType">prop, style, caller</span>) <a class="hash-link" href="#validatestyleprop">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyle"></a><span class="propType">static </span>validateStyle(<span class="propType">name, styles</span>) <a class="hash-link" href="#validatestyle">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="addvalidstyleproptypes"></a><span class="propType">static </span>addValidStylePropTypes(<span class="propType">stylePropTypes</span>) <a class="hash-link" href="#addvalidstyleproptypes">#</a></h4></div></div></div><noscript></noscript><div class="docs-prevnext"></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)