react-three-renderer
Advanced tools
Comparing version 0.0.3-alpha to 0.0.4-alpha
@@ -17,1 +17,11 @@ import gulp from 'gulp'; | ||
}); | ||
gulp.task('clean-docs', () => { | ||
return del(['docs/generated']); | ||
}); | ||
gulp.task('doc', (done) => { | ||
const docGenerator = require('./docs/src/Generator.js'); | ||
docGenerator(done); | ||
}); |
@@ -47,2 +47,4 @@ 'use strict'; | ||
value: '' + (descriptor.displayName || descriptor.name), | ||
// used for docs | ||
enumerable: true | ||
@@ -56,2 +58,3 @@ }]); | ||
this.isResource = true; | ||
this.hasProp('resourceId', { | ||
@@ -58,0 +61,0 @@ type: _reactLibReactPropTypes2['default'].string, |
@@ -46,16 +46,22 @@ 'use strict'; | ||
this.hasProp('descriptor', { | ||
type: function type(props, propName, componentName, location, propFullName) { | ||
var locationName = _reactLibReactPropTypeLocationNames2['default'][location]; | ||
var moduleSubclassValidator = function moduleSubclassValidator(props, propName, componentName, location, propFullName) { | ||
var locationName = _reactLibReactPropTypeLocationNames2['default'][location]; | ||
if (!props[propName]) { | ||
return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); | ||
} | ||
if (!props[propName]) { | ||
return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); | ||
} | ||
if (!(props[propName].prototype instanceof _Module2['default'])) { | ||
var actualClassName = getClassName(props[propName]); | ||
if (!(props[propName].prototype instanceof _Module2['default'])) { | ||
var actualClassName = getClassName(props[propName]); | ||
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + 'subclass of `Module`.'); | ||
} | ||
}, | ||
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + 'subclass of `Module`.'); | ||
} | ||
}; | ||
moduleSubclassValidator.toString = function () { | ||
return '```' + ' subclass of ReactThreeRenderer.Module ' + '```' + ' *' + '```' + ' required ' + '```' + '*'; | ||
}; | ||
this.hasProp('descriptor', { | ||
type: moduleSubclassValidator, | ||
update: this.triggerRemount, | ||
@@ -62,0 +68,0 @@ 'default': undefined |
@@ -53,3 +53,3 @@ 'use strict'; | ||
context: { | ||
type: _reactLibReactPropTypes2['default'].string.isRequired | ||
type: _reactLibReactPropTypes2['default'].oneOf(['2d', '3d']).isRequired | ||
}, | ||
@@ -56,0 +56,0 @@ mainCamera: { |
@@ -127,2 +127,4 @@ 'use strict'; | ||
_get(Object.getPrototypeOf(Vector2.prototype), 'constructor', this).apply(this, arguments); | ||
this.displayName = 'THREE.Vector2'; | ||
} | ||
@@ -139,2 +141,4 @@ | ||
_get(Object.getPrototypeOf(Vector3.prototype), 'constructor', this).apply(this, arguments); | ||
this.displayName = 'THREE.Vector3'; | ||
} | ||
@@ -151,2 +155,4 @@ | ||
_get(Object.getPrototypeOf(Quaternion.prototype), 'constructor', this).apply(this, arguments); | ||
this.displayName = 'THREE.Quaternion'; | ||
} | ||
@@ -163,2 +169,4 @@ | ||
_get(Object.getPrototypeOf(Color.prototype), 'constructor', this).apply(this, arguments); | ||
this.displayName = 'THREE.Color'; | ||
} | ||
@@ -175,2 +183,4 @@ | ||
_get(Object.getPrototypeOf(Euler.prototype), 'constructor', this).apply(this, arguments); | ||
this.displayName = 'THREE.Euler'; | ||
} | ||
@@ -187,2 +197,4 @@ | ||
_get(Object.getPrototypeOf(Fog.prototype), 'constructor', this).apply(this, arguments); | ||
this.displayName = 'THREE.Fog'; | ||
} | ||
@@ -189,0 +201,0 @@ |
{ | ||
"name": "react-three-renderer", | ||
"version": "0.0.3-alpha", | ||
"version": "0.0.4-alpha", | ||
"description": "Render into a three.js canvas using React.", | ||
@@ -16,4 +16,4 @@ "main": "./lib/React3.js", | ||
"fbjs": "^0.4.0", | ||
"react": "^0.14.0", | ||
"react-dom": "^0.14.0", | ||
"react": "^0.14.1", | ||
"react-dom": "^0.14.1", | ||
"three.js": "^0.73.0" | ||
@@ -37,2 +37,6 @@ }, | ||
}, | ||
"babel": { | ||
"stage": 0, | ||
"optional": ["runtime"] | ||
}, | ||
"bugs": { | ||
@@ -39,0 +43,0 @@ "url": "https://github.com/toxicFork/react-three-renderer/issues" |
@@ -19,2 +19,5 @@ import ResourceContainer from '../../Resources/ResourceContainer'; | ||
// used for docs | ||
isResource = true; | ||
constructor(react3RendererInstance) { | ||
@@ -21,0 +24,0 @@ super(react3RendererInstance); |
@@ -18,18 +18,24 @@ import THREEElementDescriptor from './THREEElementDescriptor'; | ||
this.hasProp('descriptor', { | ||
type: (props, propName, componentName, location, propFullName) => { | ||
const locationName = ReactPropTypeLocationNames[location]; | ||
const moduleSubclassValidator = (props, propName, componentName, location, propFullName) => { | ||
const locationName = ReactPropTypeLocationNames[location]; | ||
if (!props[propName]) { | ||
return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); | ||
} | ||
if (!props[propName]) { | ||
return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); | ||
} | ||
if (!(props[propName].prototype instanceof Module)) { | ||
const actualClassName = getClassName(props[propName]); | ||
if (!(props[propName].prototype instanceof Module)) { | ||
const actualClassName = getClassName(props[propName]); | ||
return new Error('Invalid ' + locationName + ' `' + propFullName + | ||
'` of type ' + ('`' + actualClassName + '` supplied to `' + | ||
componentName + '`, expected ') + ('subclass of `Module`.')); | ||
} | ||
}, | ||
return new Error('Invalid ' + locationName + ' `' + propFullName + | ||
'` of type ' + ('`' + actualClassName + '` supplied to `' + | ||
componentName + '`, expected ') + ('subclass of `Module`.')); | ||
} | ||
}; | ||
moduleSubclassValidator.toString = () => { | ||
return `${'```'} subclass of ReactThreeRenderer.Module ${'```'} *${'```'} required ${'```'}*`; | ||
}; | ||
this.hasProp('descriptor', { | ||
type: moduleSubclassValidator, | ||
update: this.triggerRemount, | ||
@@ -36,0 +42,0 @@ default: undefined, |
@@ -25,3 +25,6 @@ import React3DInstance from '../React3Instance'; | ||
context: { | ||
type: PropTypes.string.isRequired, | ||
type: PropTypes.oneOf([ | ||
'2d', | ||
'3d', | ||
]).isRequired, | ||
}, | ||
@@ -28,0 +31,0 @@ mainCamera: { |
@@ -37,12 +37,18 @@ import DOMProperty from 'react/lib/DOMProperty'; | ||
THREE.Vector2 = class Vector2 extends THREE.Vector2 { | ||
displayName = 'THREE.Vector2'; | ||
}; | ||
THREE.Vector3 = class Vector3 extends THREE.Vector3 { | ||
displayName = 'THREE.Vector3'; | ||
}; | ||
THREE.Quaternion = class Quaternion extends THREE.Quaternion { | ||
displayName = 'THREE.Quaternion'; | ||
}; | ||
THREE.Color = class Color extends THREE.Color { | ||
displayName = 'THREE.Color'; | ||
}; | ||
THREE.Euler = class Euler extends THREE.Euler { | ||
displayName = 'THREE.Euler'; | ||
}; | ||
THREE.Fog = class Fog extends THREE.Fog { | ||
displayName = 'THREE.Fog'; | ||
}; | ||
@@ -49,0 +55,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
642479
206
14964
Updatedreact@^0.14.1
Updatedreact-dom@^0.14.1