瀏覽代碼

Move `Dashboard` to `@uppy/dashboard`.

:tada:
Renée Kooi 6 年之前
父節點
當前提交
7fab052e00

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

+ 50 - 0
packages/@uppy/dashboard/README.md

@@ -0,0 +1,50 @@
+# @uppy/dashboard
+
+<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/dashboard"><img src="https://img.shields.io/npm/v/@uppy/dashboard.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>
+
+Dashboard is a universal UI plugin for Uppy:
+
+ * Drag and Drop, paste, select from local disk / my device
+ * UI for Webcam and remote sources: Google Drive, Dropbox, Instagram (all optional, added via plugins)
+ * File previews and info
+ * Metadata editor
+ * Progress: total and for individual files
+ * Ability to pause/resume or cancel (depending on uploader plugin) individual or all files
+
+**[Read the docs](https://uppy.io/docs/dashboard/)** | **[Try it](https://uppy.io/examples/dashboard/)**
+
+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 Dashboard = require('@uppy/dashboard')
+
+const uppy = Uppy()
+uppy.use(Dashboard, {
+  target: 'body',
+  inline: true
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/dashboard --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/DOC_PAGE_HERE).
+
+## License
+
+[The MIT License](./LICENSE).

+ 40 - 0
packages/@uppy/dashboard/package.json

@@ -0,0 +1,40 @@
+{
+  "name": "@uppy/dashboard",
+  "description": "Universal UI plugin for Uppy.",
+  "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",
+    "dashboard",
+    "ui"
+  ],
+  "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/informer": "^0.25.5",
+    "@uppy/statusbar": "^0.25.5",
+    "@uppy/thumbnail-generator": "^0.25.5",
+    "@uppy/utils": "^0.25.5",
+    "classnames": "^2.2.6",
+    "drag-drop": "^2.14.0",
+    "preact": "^8.2.9",
+    "prettier-bytes": "^1.0.4"
+  },
+  "devDependencies": {
+    "@uppy/core": "^0.25.5"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.25.5"
+  }
+}

+ 0 - 0
src/plugins/Dashboard/ActionBrowseTagline.js → packages/@uppy/dashboard/src/ActionBrowseTagline.js


+ 0 - 0
src/plugins/Dashboard/Dashboard.js → packages/@uppy/dashboard/src/Dashboard.js


+ 0 - 0
src/plugins/Dashboard/FileCard.js → packages/@uppy/dashboard/src/FileCard.js


+ 0 - 0
src/plugins/Dashboard/FileItem.js → packages/@uppy/dashboard/src/FileItem.js


+ 0 - 0
src/plugins/Dashboard/FileItemProgress.js → packages/@uppy/dashboard/src/FileItemProgress.js


+ 0 - 0
src/plugins/Dashboard/FileList.js → packages/@uppy/dashboard/src/FileList.js


+ 0 - 0
src/plugins/Dashboard/FilePreview.js → packages/@uppy/dashboard/src/FilePreview.js


+ 0 - 0
src/plugins/Dashboard/Tabs.js → packages/@uppy/dashboard/src/Tabs.js


+ 0 - 0
src/plugins/Dashboard/getFileTypeIcon.js → packages/@uppy/dashboard/src/getFileTypeIcon.js


+ 0 - 0
src/plugins/Dashboard/icons.js → packages/@uppy/dashboard/src/icons.js


+ 0 - 0
src/plugins/Dashboard/index.js → packages/@uppy/dashboard/src/index.js


+ 0 - 0
src/plugins/Dashboard/index.test.js → packages/@uppy/dashboard/src/index.test.js


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


+ 1 - 1
src/index.js

@@ -10,7 +10,7 @@ const ProviderView = require('@uppy/provider-views')
 const Plugin = require('@uppy/core/lib/Plugin')
 
 // Acquirers
-const Dashboard = require('./plugins/Dashboard')
+const Dashboard = require('@uppy/dashboard')
 const DragDrop = require('@uppy/drag-drop')
 const FileInput = require('./plugins/FileInput')
 const GoogleDrive = require('./plugins/GoogleDrive')

+ 1 - 1
src/react/Dashboard.js

@@ -1,5 +1,5 @@
 const React = require('react')
-const DashboardPlugin = require('../plugins/Dashboard')
+const DashboardPlugin = require('@uppy/dashboard')
 const basePropTypes = require('./propTypes').dashboard
 
 const h = React.createElement

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

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

+ 1 - 1
src/react/DashboardModal.js

@@ -1,6 +1,6 @@
 const React = require('react')
 const PropTypes = require('prop-types')
-const DashboardPlugin = require('../plugins/Dashboard')
+const DashboardPlugin = require('@uppy/dashboard')
 const basePropTypes = require('./propTypes').dashboard
 
 const h = React.createElement

+ 2 - 2
src/react/DashboardModal.test.js

@@ -3,7 +3,7 @@ const { mount, configure } = require('enzyme')
 const ReactAdapter = require('enzyme-adapter-react-16')
 const Uppy = require('@uppy/core')
 
-jest.mock('../plugins/Dashboard', () => require('./__mocks__/DashboardPlugin'))
+jest.mock('@uppy/dashboard', () => require('./__mocks__/DashboardPlugin'))
 
 const DashboardModal = require('./DashboardModal')
 
@@ -12,7 +12,7 @@ beforeAll(() => {
 })
 
 beforeEach(() => {
-  Object.assign(require('../plugins/Dashboard').prototype, {
+  Object.assign(require('@uppy/dashboard').prototype, {
     openModal: jest.fn(),
     closeModal: jest.fn()
   })