Pārlūkot izejas kodu

Move `Webcam` to `@uppy/webcam`.

Renée Kooi 6 gadi atpakaļ
vecāks
revīzija
f1751140a3

+ 21 - 0
packages/@uppy/webcam/LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Transloadit
+
+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.

+ 41 - 0
packages/@uppy/webcam/README.md

@@ -0,0 +1,41 @@
+# @uppy/webcam
+
+<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
+
+<a href="https://www.npmjs.com/package/@uppy/webcam"><img src="https://img.shields.io/npm/v/@uppy/webcam.svg?style=flat-square"></a>
+<a href="https://travis-ci.org/transloadit/uppy"><img src="https://img.shields.io/travis/transloadit/uppy/master.svg?style=flat-square" alt="Build Status"></a>
+
+The Webcam plugin for Uppy lets you take photos and record videos with a built-in camera on desktop and mobile devices.
+
+Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
+
+## Example
+
+```js
+const Uppy = require('@uppy/core')
+const Webcam = require('@uppy/webcam')
+
+const uppy = Uppy()
+uppy.use(Webcam, {
+  mirror: true,
+  facingMode: 'user'
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/webcam --save
+```
+
+We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
+
+Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
+
+## Documentation
+
+Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/webcam).
+
+## License
+
+[The MIT License](./LICENSE).

+ 35 - 0
packages/@uppy/webcam/package.json

@@ -0,0 +1,35 @@
+{
+  "name": "@uppy/webcam",
+  "description": "Uppy plugin that takes photos or records videos using the device's camera.",
+  "version": "0.25.5",
+  "license": "MIT",
+  "main": "lib/index.js",
+  "jsnext:main": "src/index.js",
+  "types": "types/index.d.ts",
+  "keywords": [
+    "file uploader",
+    "uppy",
+    "uppy-plugin",
+    "webcam",
+    "picture",
+    "photo",
+    "video",
+    "record",
+    "mediarecorder"
+  ],
+  "homepage": "https://uppy.io",
+  "bugs": {
+    "url": "https://github.com/transloadit/uppy/issues"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/transloadit/uppy.git"
+  },
+  "dependencies": {
+    "@uppy/utils": "^0.25.5",
+    "preact": "^8.2.9"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.25.5"
+  }
+}

+ 0 - 0
src/plugins/Webcam/CameraIcon.js → packages/@uppy/webcam/src/CameraIcon.js


+ 0 - 0
src/plugins/Webcam/CameraScreen.js → packages/@uppy/webcam/src/CameraScreen.js


+ 0 - 0
src/plugins/Webcam/PermissionsScreen.js → packages/@uppy/webcam/src/PermissionsScreen.js


+ 0 - 0
src/plugins/Webcam/RecordButton.js → packages/@uppy/webcam/src/RecordButton.js


+ 0 - 0
src/plugins/Webcam/SnapshotButton.js → packages/@uppy/webcam/src/SnapshotButton.js


+ 0 - 0
src/plugins/Webcam/index.js → packages/@uppy/webcam/src/index.js


+ 0 - 0
src/plugins/Webcam/supportsMediaRecorder.js → packages/@uppy/webcam/src/supportsMediaRecorder.js


+ 0 - 0
src/plugins/Webcam/supportsMediaRecorder.test.js → packages/@uppy/webcam/src/supportsMediaRecorder.test.js


+ 0 - 0
packages/@uppy/webcam/types/index.d.ts


+ 1 - 1
src/index.js

@@ -17,7 +17,7 @@ const GoogleDrive = require('./plugins/GoogleDrive')
 const Dropbox = require('./plugins/Dropbox')
 const Instagram = require('./plugins/Instagram')
 const Url = require('./plugins/Url')
-const Webcam = require('./plugins/Webcam')
+const Webcam = require('@uppy/webcam')
 
 // Progressindicators
 const StatusBar = require('@uppy/statusbar')