Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drei

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drei - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

dist/MapControls.d.ts

28

dist/index.cjs.js

@@ -41,2 +41,29 @@ 'use strict';

reactThreeFiber.extend({
MapControls: OrbitControls$1.MapControls
});
function MapControls(props) {
if (props === void 0) {
props = {
enableDamping: true,
dampingFactor: 0.05,
screenSpacePanning: false
};
}
var controls = React.useRef();
var _useThree = reactThreeFiber.useThree(),
camera = _useThree.camera,
gl = _useThree.gl;
reactThreeFiber.useFrame(function () {
return controls.current && controls.current.update();
});
return /*#__PURE__*/React__default.createElement("mapControls", _extends({
ref: controls,
args: [camera, gl.domElement]
}, props));
}
function draco(url) {

@@ -54,3 +81,4 @@ if (url === void 0) {

exports.MapControls = MapControls;
exports.OrbitControls = OrbitControls;
exports.draco = draco;

1

dist/index.d.ts
export * from './OrbitControls';
export * from './MapControls';
export * from './draco';
import _extends from '@babel/runtime/helpers/esm/extends';
import React, { useRef } from 'react';
import { extend, useThree, useFrame } from 'react-three-fiber';
import { OrbitControls as OrbitControls$1 } from 'three/examples/jsm/controls/OrbitControls';
import { OrbitControls as OrbitControls$1, MapControls as MapControls$1 } from 'three/examples/jsm/controls/OrbitControls';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader';

@@ -27,2 +27,22 @@

extend({
MapControls: MapControls$1
});
function MapControls(props = {
enableDamping: true,
dampingFactor: 0.05,
screenSpacePanning: false
}) {
const controls = useRef();
const {
camera,
gl
} = useThree();
useFrame(() => controls.current && controls.current.update());
return /*#__PURE__*/React.createElement("mapControls", _extends({
ref: controls,
args: [camera, gl.domElement]
}, props));
}
function draco(url = '/draco-gltf/') {

@@ -36,2 +56,2 @@ return loader => {

export { OrbitControls, draco };
export { MapControls, OrbitControls, draco };

2

package.json
{
"name": "drei",
"version": "0.0.4",
"version": "0.0.5",
"description": "useful add-ons for react-three-fiber",

@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js",

@@ -1,12 +0,19 @@

[![Build Status](https://travis-ci.org/drcmda/drei.svg?branch=master)](https://travis-ci.org/drcmda/drei) [![npm version](https://badge.fury.io/js/drei.svg)](https://badge.fury.io/js/drei) ![npm](https://img.shields.io/npm/dt/drei.svg)
[![Build Status](https://travis-ci.org/react-spring/drei.svg?branch=master)](https://travis-ci.org/react-spring/drei) [![npm version](https://badge.fury.io/js/drei.svg)](https://badge.fury.io/js/drei) ![npm](https://img.shields.io/npm/dt/drei.svg)
This is a collection of useful helpers and abstractions for [react-three-fiber](https://github.com/react-spring/react-three-fiber), saving you some boilerplate.
**PR's are more than welcome!** If you find yourself repeating set-up code often and if it's generic enough to be useful, add it here, everyone benefits.
<br />
npm install drei
yarn add drei
```jsx
import { ... } from 'drei'
```
<br />
- [x] OrbitControls, `<OrbitControls enableDamping ... />`
- [x] MapControls, `<MapControls enableDamping ... />`
- [x] draco, `useLoader(GLTFLoader, url, draco())`
export * from './OrbitControls'
export * from './MapControls'
export * from './draco'
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc