Selaa lähdekoodia

Move `StatusBar` to `@uppy/statusbar`.

Renée Kooi 6 vuotta sitten
vanhempi
commit
8062a39fb5

+ 21 - 0
packages/@uppy/statusbar/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.

+ 44 - 0
packages/@uppy/statusbar/README.md

@@ -0,0 +1,44 @@
+# @uppy/statusbar
+
+<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/statusbar"><img src="https://img.shields.io/npm/v/@uppy/statusbar.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 StatusBar shows upload progress and speed, ETAs, pre- and post-processing information, and allows users to control (pause/resume/cancel) the upload.
+Best used together with a simple file source plugin, such as [@uppy/file-input](https://uppy.io/docs/file-input) or [@uppy/drag-drop](https://uppy.io/docs/dragdrop), or a custom implementation. It is also included in the [@uppy/dashboard](https://uppy.io/docs/dashboard) plugin.
+
+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 StatusBar = require('@uppy/statusbar')
+
+const uppy = Uppy()
+uppy.use(StatusBar, {
+  target: 'body',
+  hideUploadButton: false,
+  showProgressDetails: false,
+  hideAfterFinish: true
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/statusbar --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/statusbar).
+
+## License
+
+[The MIT License](./LICENSE).

+ 37 - 0
packages/@uppy/statusbar/package.json

@@ -0,0 +1,37 @@
+{
+  "name": "@uppy/statusbar",
+  "description": "A progress bar for Uppy, with many bells and whistles.",
+  "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",
+    "progress bar",
+    "progress",
+    "upload",
+    "eta",
+    "speed"
+  ],
+  "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",
+    "classnames": "^2.2.6",
+    "lodash.throttle": "^4.1.1",
+    "preact": "^8.2.9",
+    "prettier-bytes": "^1.0.4"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.25.5"
+  }
+}

+ 0 - 0
src/plugins/StatusBar/StatusBar.js → packages/@uppy/statusbar/src/StatusBar.js


+ 0 - 0
src/plugins/StatusBar/StatusBarStates.js → packages/@uppy/statusbar/src/StatusBarStates.js


+ 0 - 0
src/plugins/StatusBar/index.js → packages/@uppy/statusbar/src/index.js


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


+ 1 - 1
src/index.js

@@ -20,7 +20,7 @@ const Url = require('./plugins/Url')
 const Webcam = require('./plugins/Webcam')
 
 // Progressindicators
-const StatusBar = require('./plugins/StatusBar')
+const StatusBar = require('@uppy/statusbar')
 const ProgressBar = require('./plugins/ProgressBar')
 const Informer = require('@uppy/informer')
 

+ 1 - 1
src/plugins/Dashboard/index.js

@@ -2,7 +2,7 @@ const Plugin = require('@uppy/core/lib/Plugin')
 const Translator = require('@uppy/utils/lib/Translator')
 const dragDrop = require('drag-drop')
 const DashboardUI = require('./Dashboard')
-const StatusBar = require('../StatusBar')
+const StatusBar = require('@uppy/statusbar')
 const Informer = require('@uppy/informer')
 const ThumbnailGenerator = require('../ThumbnailGenerator')
 const findAllDOMElements = require('@uppy/utils/lib/findAllDOMElements')

+ 1 - 1
src/plugins/Dashboard/index.test.js

@@ -1,6 +1,6 @@
 const Core = require('@uppy/core')
 const DashboardPlugin = require('./index')
-const StatusBarPlugin = require('../StatusBar')
+const StatusBarPlugin = require('@uppy/statusbar')
 
 describe('Dashboard', () => {
   it('can safely be added together with the StatusBar without id conflicts', () => {

+ 1 - 1
src/react/StatusBar.js

@@ -1,6 +1,6 @@
 const React = require('react')
 const PropTypes = require('prop-types')
-const StatusBarPlugin = require('../plugins/StatusBar')
+const StatusBarPlugin = require('@uppy/statusbar')
 const uppyPropType = require('./propTypes').uppy
 
 const h = React.createElement

+ 1 - 1
src/react/StatusBar.test.js

@@ -7,7 +7,7 @@ beforeAll(() => {
   configure({ adapter: new ReactAdapter() })
 })
 
-jest.mock('../plugins/StatusBar', () => require('./__mocks__/StatusBarPlugin'))
+jest.mock('@uppy/statusbar', () => require('./__mocks__/StatusBarPlugin'))
 
 const StatusBar = require('./StatusBar')