react-native-for-web
Advanced tools
@@ -0,0 +0,0 @@ var gulp = require('gulp'); |
@@ -0,0 +0,0 @@ { |
{ | ||
"name": "react-native-for-web", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "A set of classes and react components to make work your react-native app in a browser. (with some limitations obviously)", | ||
@@ -29,8 +29,10 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"react": "^0.14.0-beta3" | ||
"react": "^0.14.0-beta3", | ||
"react-dom": "^0.14.0-beta3" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer-core": "^5.2.1", | ||
"babel-core": "^5.8.22", | ||
"babel-core": "^5.8.23", | ||
"babel-loader": "^5.3.2", | ||
"eslint": "^1.3.1", | ||
"gulp": "^3.9.0", | ||
@@ -40,4 +42,4 @@ "gulp-less": "^3.0.3", | ||
"gulp-sourcemaps": "^1.5.2", | ||
"webpack": "^1.11.0" | ||
"webpack": "^1.12.1" | ||
} | ||
} |
@@ -8,6 +8,14 @@ var React = require('react'); | ||
// deconstruct props and extract the needed ones. | ||
var {style, ...props} = this.props; | ||
var {pointerEvents, style, children, ...props} = this.props; | ||
// classNames | ||
var classNames = ['view']; | ||
// if pointer events available, push them into the class | ||
if(pointerEvents) classNames.push('pointer-events-' + pointerEvents); | ||
// return the component | ||
return <div {...props} style={browserifyStyle(style)}>{this.props.children}</div>; | ||
return <div {...props} className={classNames.join(' ')} style={browserifyStyle(style)}> | ||
{children} | ||
</div>; | ||
} | ||
@@ -14,0 +22,0 @@ } |
module.exports = { | ||
IE10: navigator.userAgent.toString().toLowerCase().indexOf("trident/6") > -1; | ||
IE10: navigator.userAgent.toString().toLowerCase().indexOf("trident/6") > -1 | ||
}; |
@@ -0,0 +0,0 @@ // this module is responsible for apply a px suffix if property is numeric |
@@ -0,0 +0,0 @@ // this module takes a react native style array/object and translates it into a browser friendly style |
@@ -0,0 +0,0 @@ // this module is responsible for decoupling bidirectional props. |
// This module is responsible for merging an array of nullish, | ||
// styles or array of styles into a single plain object, | ||
// this way we could even optimize the outgoing css | ||
module.exports = (styles) => { | ||
function mergeStyles(styles) { | ||
// by default, return an empty object. | ||
@@ -14,2 +15,4 @@ var mergedStyle = {}; | ||
if(!style) continue; | ||
// if is array, flatten down | ||
if(Array.isArray(style)) style = mergeStyles(style); | ||
// merge into the merged one | ||
@@ -24,2 +27,4 @@ mergedStyle = { | ||
return mergedStyle; | ||
}; | ||
} | ||
module.exports = mergeStyles; |
@@ -27,3 +27,3 @@ // this function resolves properties conflicts, this means that style props | ||
for(var j = 0; j < translateProps.length; j++){ | ||
solvedStyle[translateProps[j]] = style[propsKeys[j]]; | ||
solvedStyle[translateProps[j]] = style[propsKeys[i]]; | ||
} | ||
@@ -35,5 +35,5 @@ }else{ | ||
} | ||
// returns the new style object | ||
return solvedStyle; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
4134002
41302.12%60
328.57%42596
21305.03%1
-50%197
Infinity%4
33.33%9
12.5%2
Infinity%1
Infinity%