diff --git a/.github/MIGRATION.md b/.github/MIGRATION.md index 29056f47d..b9b4fd2d0 100644 --- a/.github/MIGRATION.md +++ b/.github/MIGRATION.md @@ -20,4 +20,92 @@ This is a temporary file that can be updated with any pending migration changes, ### @uppy/informer merged into @uppy/dashboard -The `@uppy/informer` plugin has been merged into `@uppy/dashboard` to reduce bundle size and improve maintainability. The `@uppy/informer` package is no longer maintained as a standalone package and should be removed from your dependencies. \ No newline at end of file +The `@uppy/informer` plugin has been merged into `@uppy/dashboard` to reduce bundle size and improve maintainability. The `@uppy/informer` package is no longer maintained as a standalone package and should be removed from your dependencies. + +### @uppy/progress-bar removed + +The `@uppy/progress-bar` plugin has been removed as it provided minimal functionality that can be easily replicated with Uppy's built-in state management. + +**Before:** +```js +import ProgressBar from '@uppy/progress-bar' + +uppy.use(ProgressBar, { target: '#progress' }) +``` + +**After:** +```js +// Custom progress bar using Uppy state +uppy.on('upload-progress', (file, progress) => { + const progressElement = document.getElementById('progress') + progressElement.style.width = `${progress.percentage}%` + progressElement.textContent = `${progress.percentage}%` +}) + +// Or listen to total progress +uppy.on('progress', (progress) => { + const progressElement = document.getElementById('progress') + progressElement.style.width = `${progress}%` + progressElement.textContent = `${progress}%` +}) +``` + +**Migration steps:** +1. Remove `@uppy/progress-bar` from your dependencies +2. Create a custom progress indicator using Uppy's `progress` or `upload-progress` events +3. Style your progress bar according to your design system. + +### @uppy/drag-drop and @uppy/file-input removed + +The `@uppy/drag-drop` and `@uppy/file-input` plugins have been removed in favor of more flexible, headless hooks. These hooks provide the same functionality but with maximum customization freedom. + +**Before:** +```js +import DragDrop from '@uppy/drag-drop' +import FileInput from '@uppy/file-input' + +uppy + .use(DragDrop, { target: '#drag-drop' }) + .use(FileInput, { target: '#file-input' }) +``` + +**After:** +```js +// React example +import { useDropzone, useFileInput } from '@uppy/react' + +function MyUploader() { + const { getRootProps, getInputProps, isDragging } = useDropzone() + const { getButtonProps, getInputProps: getFileInputProps } = useFileInput() + + return ( +
+ +
+ + +

or drag and drop files here

+
+
+ ) +} +``` + +**Alternative: Use Dashboard** +```js +// If you want a complete UI solution, use Dashboard instead +import Dashboard from '@uppy/dashboard' + +uppy.use(Dashboard, { + target: '#uppy-dashboard', + inline: true, +}) +``` + +**Migration steps:** +1. Remove `@uppy/drag-drop` and `@uppy/file-input` from your dependencies +2. Choose one of these approaches: + - Use the framework-specific hooks (`@uppy/react`, `@uppy/vue`, `@uppy/svelte`) for maximum flexibility + - Use `@uppy/dashboard` for a complete, ready-to-use UI solution +3. Replace your existing components with custom implementations using the hooks or Dashboard +4. See [examples/](../examples/) for complete implementation examples \ No newline at end of file diff --git a/README.md b/README.md index 9f4d20a07..751af6c01 100644 --- a/README.md +++ b/README.md @@ -194,8 +194,6 @@ server-side component, is needed for a plugin to work. image previews (included by default with `Dashboard`) - [`Form`](https://uppy.io/docs/form/) — collects metadata from `
` right before an Uppy upload, then optionally appends results back to the form -- [`Redux`](https://uppy.io/docs/guides/custom-stores#reduxstore) — for your - emerging [time traveling](https://github.com/gaearon/redux-devtools) needs ## React diff --git a/e2e/clients/react/App.jsx b/e2e/clients/react/App.jsx index 868caf885..f9f5d7c54 100644 --- a/e2e/clients/react/App.jsx +++ b/e2e/clients/react/App.jsx @@ -1,20 +1,18 @@ /** biome-ignore-all lint/nursery/useUniqueElementIds: it's fine */ import Uppy from '@uppy/core' -import { Dashboard, DashboardModal, DragDrop } from '@uppy/react' +import { Dashboard, DashboardModal } from '@uppy/react' import RemoteSources from '@uppy/remote-sources' import ThumbnailGenerator from '@uppy/thumbnail-generator' import React, { useState } from 'react' import '@uppy/core/dist/style.css' import '@uppy/dashboard/dist/style.css' -import '@uppy/drag-drop/dist/style.css' const uppyDashboard = new Uppy({ id: 'dashboard' }).use(RemoteSources, { companionUrl: 'http://companion.uppy.io', sources: ['GoogleDrive', 'OneDrive', 'Unsplash', 'Zoom', 'Url'], }) const uppyModal = new Uppy({ id: 'modal' }) -const uppyDragDrop = new Uppy({ id: 'drag-drop' }).use(ThumbnailGenerator) export default function App() { const [open, setOpen] = useState(false) @@ -22,8 +20,7 @@ export default function App() { // We are using Parcel in an odd way and I don't think there is an easy fix. // const files = useUppyState(uppyDashboard, (state) => state.files) - // drag-drop has no visual output so we test it via the uppy instance - window.uppy = uppyDragDrop + // window.uppy = uppyDashboard // (if you want to expose for tests) return (
-
) } diff --git a/e2e/cypress/integration/dashboard-aws-multipart.spec.ts b/e2e/cypress/integration/dashboard-aws-multipart.spec.ts index 12ea66cc1..708c8470e 100644 --- a/e2e/cypress/integration/dashboard-aws-multipart.spec.ts +++ b/e2e/cypress/integration/dashboard-aws-multipart.spec.ts @@ -1,4 +1,4 @@ -describe('Dashboard with @uppy/aws-s3-multipart', () => { +describe('Dashboard with @uppy/aws-s3 (multipart)', () => { beforeEach(() => { cy.visit('/dashboard-aws-multipart') cy.get('.uppy-Dashboard-input:first').as('file-input') diff --git a/e2e/cypress/integration/react.spec.ts b/e2e/cypress/integration/react.spec.ts index e7925819a..cd7aee4e1 100644 --- a/e2e/cypress/integration/react.spec.ts +++ b/e2e/cypress/integration/react.spec.ts @@ -3,7 +3,6 @@ describe('@uppy/react', () => { cy.visit('/react') cy.get('#dashboard .uppy-Dashboard-input:first').as('dashboard-input') cy.get('#modal .uppy-Dashboard-input:first').as('modal-input') - cy.get('#drag-drop .uppy-DragDrop-input').as('dragdrop-input') }) it('should render Dashboard in React and show thumbnails', () => { @@ -48,20 +47,4 @@ describe('@uppy/react', () => { .should('have.length', 2) .each((element) => expect(element).attr('src').to.include('blob:')) }) - - it('should render Drag & Drop in React and create a thumbail with @uppy/thumbnail-generator', () => { - const spy = cy.spy() - - // @ts-ignore fix me - cy.window().then(({ uppy }) => uppy.on('thumbnail:generated', spy)) - cy.get('@dragdrop-input').selectFile( - [ - 'cypress/fixtures/images/cat.jpg', - 'cypress/fixtures/images/traffic.jpg', - ], - { force: true }, - ) - // not sure how I can accurately wait for the thumbnail - cy.wait(1000).then(() => expect(spy).to.be.called) - }) }) diff --git a/e2e/package.json b/e2e/package.json index 75b69a80f..49f15869c 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -12,16 +12,13 @@ "dependencies": { "@uppy/audio": "workspace:^", "@uppy/aws-s3": "workspace:^", - "@uppy/aws-s3-multipart": "workspace:^", "@uppy/box": "workspace:^", "@uppy/companion-client": "workspace:^", "@uppy/core": "workspace:^", "@uppy/dashboard": "workspace:^", - "@uppy/drag-drop": "workspace:^", "@uppy/drop-target": "workspace:^", "@uppy/dropbox": "workspace:^", "@uppy/facebook": "workspace:^", - "@uppy/file-input": "workspace:^", "@uppy/form": "workspace:^", "@uppy/golden-retriever": "workspace:^", "@uppy/google-drive": "workspace:^", @@ -30,12 +27,10 @@ "@uppy/image-editor": "workspace:^", "@uppy/instagram": "workspace:^", "@uppy/onedrive": "workspace:^", - "@uppy/progress-bar": "workspace:^", "@uppy/provider-views": "workspace:^", "@uppy/screen-capture": "workspace:^", "@uppy/status-bar": "workspace:^", "@uppy/store-default": "workspace:^", - "@uppy/store-redux": "workspace:^", "@uppy/thumbnail-generator": "workspace:^", "@uppy/transloadit": "workspace:^", "@uppy/tus": "workspace:^", diff --git a/examples/angular/package.json b/examples/angular/package.json index b43265f11..69516b06c 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -19,9 +19,7 @@ "@angular/router": "^18.0.0", "@uppy/angular": "workspace:*", "@uppy/core": "workspace:*", - "@uppy/drag-drop": "workspace:*", "@uppy/google-drive": "workspace:*", - "@uppy/progress-bar": "workspace:*", "@uppy/tus": "workspace:*", "@uppy/webcam": "workspace:*", "rxjs": "~7.8.0", diff --git a/examples/angular/src/app/app.component.ts b/examples/angular/src/app/app.component.ts index 4670e792b..0c6ca0ae1 100644 --- a/examples/angular/src/app/app.component.ts +++ b/examples/angular/src/app/app.component.ts @@ -36,9 +36,6 @@ import Webcam from '@uppy/webcam' -

Drag Drop Area

- -

Progress Bar

- - - - - Uppy example: Redux - - -
-

A counter

-
-

- Clicked: 0 times - - - - -

-
-

An Uppy

-
-
- - - - - diff --git a/examples/redux/main.js b/examples/redux/main.js deleted file mode 100644 index 11c93fbb8..000000000 --- a/examples/redux/main.js +++ /dev/null @@ -1,93 +0,0 @@ -import { configureStore } from '@reduxjs/toolkit' -import Uppy from '@uppy/core' -import Dashboard from '@uppy/dashboard' -import ReduxStore, * as uppyReduxStore from '@uppy/store-redux' -import Tus from '@uppy/tus' -import { applyMiddleware, combineReducers, compose } from 'redux' -import logger from 'redux-logger' - -import '@uppy/core/dist/style.css' -import '@uppy/dashboard/dist/style.css' - -function counter(state = 0, action) { - switch (action.type) { - case 'INCREMENT': - return state + 1 - case 'DECREMENT': - return state - 1 - default: - return state - } -} - -const reducer = combineReducers({ - counter, - // You don't have to use the `uppy` key. But if you don't, - // you need to provide a custom `selector` to the `uppyReduxStore` call below. - uppy: uppyReduxStore.reducer, -}) - -let enhancer = applyMiddleware(uppyReduxStore.middleware(), logger) -if (typeof __REDUX_DEVTOOLS_EXTENSION__ !== 'undefined') { - enhancer = compose(enhancer, __REDUX_DEVTOOLS_EXTENSION__()) -} - -const store = configureStore({ - reducer, - enhancers: [enhancer], - middleware: (getDefaultMiddleware) => - getDefaultMiddleware({ - serializableCheck: { - ignoredActions: [uppyReduxStore.STATE_UPDATE], - ignoreState: true, - }, - }), -}) - -// Counter example from https://github.com/reactjs/redux/blob/master/examples/counter-vanilla/index.html -const valueEl = document.querySelector('#value') - -function getCounter() { - return store.getState().counter -} -function render() { - valueEl.innerHTML = getCounter().toString() -} -render() -store.subscribe(render) - -document.querySelector('#increment').onclick = () => { - store.dispatch({ type: 'INCREMENT' }) -} -document.querySelector('#decrement').onclick = () => { - store.dispatch({ type: 'DECREMENT' }) -} -document.querySelector('#incrementIfOdd').onclick = () => { - if (getCounter() % 2 !== 0) { - store.dispatch({ type: 'INCREMENT' }) - } -} -document.querySelector('#incrementAsync').onclick = () => { - setTimeout(() => store.dispatch({ type: 'INCREMENT' }), 1000) -} - -// Uppy using the same store -const uppy = new Uppy({ - id: 'redux', - store: new ReduxStore({ store }), - // If we had placed our `reducer` elsewhere in Redux, eg. under an `uppy` key in the state for a profile page, - // we'd do something like: - // - // store: new ReduxStore({ - // store: store, - // id: 'avatar', - // selector: state => state.pages.profile.uppy - // }), - debug: true, -}) -uppy.use(Dashboard, { - target: '#app', - inline: true, - width: 400, -}) -uppy.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' }) diff --git a/examples/redux/package.json b/examples/redux/package.json deleted file mode 100644 index 6550bf432..000000000 --- a/examples/redux/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "example-redux", - "version": "0.0.0", - "type": "module", - "dependencies": { - "@reduxjs/toolkit": "^1.9.3", - "@uppy/core": "workspace:*", - "@uppy/dashboard": "workspace:*", - "@uppy/store-redux": "workspace:*", - "@uppy/tus": "workspace:*", - "redux": "^4.2.1", - "redux-logger": "^3.0.6" - }, - "devDependencies": { - "vite": "^5.4.17" - }, - "private": true, - "scripts": { - "start": "vite" - } -} diff --git a/examples/sveltekit/package.json b/examples/sveltekit/package.json index 5414d59ab..dfd21c4d3 100644 --- a/examples/sveltekit/package.json +++ b/examples/sveltekit/package.json @@ -14,8 +14,6 @@ "dependencies": { "@uppy/core": "workspace:*", "@uppy/dashboard": "workspace:*", - "@uppy/drag-drop": "workspace:*", - "@uppy/progress-bar": "workspace:*", "@uppy/screen-capture": "workspace:*", "@uppy/svelte": "workspace:*", "@uppy/tus": "workspace:*", diff --git a/examples/transloadit/main.js b/examples/transloadit/main.js index 4c6699dfb..667a8d63e 100644 --- a/examples/transloadit/main.js +++ b/examples/transloadit/main.js @@ -2,7 +2,6 @@ import Uppy from '@uppy/core' import Dashboard from '@uppy/dashboard' import Form from '@uppy/form' import ImageEditor from '@uppy/image-editor' -import ProgressBar from '@uppy/progress-bar' import RemoteSources from '@uppy/remote-sources' import Transloadit, { COMPANION_URL } from '@uppy/transloadit' import Webcam from '@uppy/webcam' @@ -10,7 +9,6 @@ import Webcam from '@uppy/webcam' import '@uppy/core/dist/style.css' import '@uppy/dashboard/dist/style.css' import '@uppy/image-editor/dist/style.css' -import '@uppy/progress-bar/dist/style.css' const TRANSLOADIT_KEY = '35c1aed03f5011e982b6afe82599b6a0' // A trivial template that resizes images, just for example purposes. @@ -182,15 +180,13 @@ const uppyWithoutUI = new Uppy({ restrictions: { allowedFileTypes: ['.png'], }, +}).use(Transloadit, { + waitForEncoding: true, + params: { + auth: { key: TRANSLOADIT_KEY }, + template_id: TEMPLATE_ID, + }, }) - .use(Transloadit, { - waitForEncoding: true, - params: { - auth: { key: TRANSLOADIT_KEY }, - template_id: TEMPLATE_ID, - }, - }) - .use(ProgressBar, { target: '#upload-progress' }) window.doUpload = (event) => { const resultEl = document.querySelector('#upload-result') diff --git a/examples/transloadit/package.json b/examples/transloadit/package.json index 8567bcc85..72e08c82b 100644 --- a/examples/transloadit/package.json +++ b/examples/transloadit/package.json @@ -12,7 +12,6 @@ "@uppy/drop-target": "workspace:*", "@uppy/form": "workspace:*", "@uppy/image-editor": "workspace:*", - "@uppy/progress-bar": "workspace:*", "@uppy/remote-sources": "workspace:*", "@uppy/transloadit": "workspace:*", "@uppy/webcam": "workspace:*", diff --git a/examples/vue/package.json b/examples/vue/package.json index f916a077f..2c9e76683 100644 --- a/examples/vue/package.json +++ b/examples/vue/package.json @@ -11,8 +11,6 @@ "dependencies": { "@uppy/core": "workspace:*", "@uppy/dashboard": "workspace:*", - "@uppy/drag-drop": "workspace:*", - "@uppy/progress-bar": "workspace:*", "@uppy/remote-sources": "workspace:*", "@uppy/screen-capture": "workspace:*", "@uppy/tus": "workspace:*", diff --git a/migration.md b/migration.md deleted file mode 100644 index 914955c58..000000000 --- a/migration.md +++ /dev/null @@ -1,30 +0,0 @@ -### `@uppy/informer` - -- **Breaking:** `@uppy/informer` is no longer available as a standalone plugin. The Informer functionality is now built into `@uppy/dashboard` by default. -- **Migration:** Remove any separate `@uppy/informer` imports and `.use()` calls. Informer is automatically included when using Dashboard. -- **Control:** Use the `disableInformer: true` option in Dashboard to hide informer notifications if needed. - -**Before:** -```js -import Uppy from '@uppy/core' -import Dashboard from '@uppy/dashboard' -import Informer from '@uppy/informer' - -const uppy = new Uppy() - .use(Dashboard, { target: '#uppy' }) - .use(Informer, { target: '#uppy-informer' }) -``` - -**After:** -```js -import Uppy from '@uppy/core' -import Dashboard from '@uppy/dashboard' - -const uppy = new Uppy() - .use(Dashboard, { - target: '#uppy', - // Informer is included by default - // Use disableInformer: true to disable it - }) -``` - diff --git a/packages/@uppy/angular/projects/uppy/angular/package.json b/packages/@uppy/angular/projects/uppy/angular/package.json index 8d05c5a67..e8e987473 100644 --- a/packages/@uppy/angular/projects/uppy/angular/package.json +++ b/packages/@uppy/angular/projects/uppy/angular/package.json @@ -29,8 +29,6 @@ "@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0", "@uppy/core": "workspace:^", "@uppy/dashboard": "workspace:^", - "@uppy/drag-drop": "workspace:^", - "@uppy/progress-bar": "workspace:^", "@uppy/status-bar": "workspace:^", "@uppy/utils": "workspace:^" }, diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop-demo.component.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop-demo.component.ts deleted file mode 100644 index b26bd27c1..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop-demo.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ChangeDetectionStrategy, Component } from "@angular/core"; -import { Uppy } from "@uppy/core"; -import type * as DragDrop from "@uppy/drag-drop"; -import type { Body, Meta } from "@uppy/utils/lib/UppyFile"; - -@Component({ - selector: "uppy-drag-drop-demo", - template: ` `, - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class DragDropDemoComponent { - uppy: Uppy = new Uppy({ debug: true, autoProceed: true }); - props: DragDrop.DragDropOptions = {}; -} diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.spec.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.spec.ts deleted file mode 100644 index b2d7fd399..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, type ComponentFixture, TestBed } from "@angular/core/testing"; - -import { DragDropComponent } from "./drag-drop.component"; - -describe("DragDropComponent", () => { - let component: DragDropComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [DragDropComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DragDropComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.ts deleted file mode 100644 index 017372949..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - ElementRef, - Input, - inject, - type OnChanges, - type OnDestroy, - type SimpleChanges, -} from "@angular/core"; -import { Uppy } from "@uppy/core"; -import type { DragDropOptions } from "@uppy/drag-drop"; -import DragDrop from "@uppy/drag-drop"; -import type { Body, Meta } from "@uppy/utils/lib/UppyFile"; -import { UppyAngularWrapper } from "../../utils/wrapper"; - -@Component({ - selector: "uppy-drag-drop", - template: "", - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class DragDropComponent - extends UppyAngularWrapper - implements OnDestroy, OnChanges -{ - el = inject(ElementRef); - - @Input() uppy: Uppy = new Uppy(); - @Input() props: DragDropOptions = {}; - - /** Inserted by Angular inject() migration for backwards compatibility */ - constructor(...args: unknown[]); - - constructor() { - super(); - } - - ngOnInit() { - this.onMount( - { id: "angular:DragDrop", target: this.el.nativeElement }, - DragDrop, - ); - } - - ngOnChanges(changes: SimpleChanges): void { - this.handleChanges(changes, DragDrop); - } - - ngOnDestroy(): void { - this.uninstall(); - } -} diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.stories.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.stories.ts deleted file mode 100644 index 073a43a97..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/drag-drop/drag-drop.stories.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { moduleMetadata } from "@storybook/angular"; -import { DragDropDemoComponent } from "./drag-drop-demo.component"; - -export default { - title: "Drag Drop", - decorators: [ - moduleMetadata({ - declarations: [DragDropDemoComponent], - }), - ], -}; - -export const Default = () => ({ - component: DragDropDemoComponent, -}); diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar-demo.component.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar-demo.component.ts deleted file mode 100644 index e052dcf1a..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar-demo.component.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - inject, - type OnInit, -} from "@angular/core"; -import { Uppy } from "@uppy/core"; -import type { ProgressBarOptions } from "@uppy/progress-bar"; -import Tus from "@uppy/tus"; -import type { Body, Meta } from "@uppy/utils/lib/UppyFile"; - -@Component({ - selector: "uppy-progress-bar-demo", - template: ` -
-
autoProceed is on
- - - - - - - - -
-
Uploaded files:
-
    -
  1. - {{ item.fileName }} -
  2. -
-
-
- -
-
autoProceed is off
- - - - - - - - - - -
-
Uploaded files:
-
    -
  1. - {{ item.fileName }} -
  2. -
-
-
- `, - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ProgressBarDemoComponent - implements OnInit -{ - private cdr = inject(ChangeDetectorRef); - - uppyOne!: Uppy; - uppyTwo!: Uppy; - fileListOne: { url: string; fileName: string }[] = []; - fileListTwo: { url: string; fileName: string }[] = []; - props: ProgressBarOptions = { - hideAfterFinish: false, - }; - - upload(): void { - this.uppyTwo.upload(); - } - - /** Inserted by Angular inject() migration for backwards compatibility */ - constructor(...args: unknown[]); - - constructor() {} - - updateFileList = - (target: string) => - (file, response): void => { - this[target] = [ - ...this[target], - { url: response.uploadURL, fileName: file.name }, - ]; - this.cdr.markForCheck(); - }; - - ngOnInit(): void { - this.uppyOne = new Uppy({ debug: true, autoProceed: true }) - .use(Tus, { endpoint: "https://master.tus.io/files/" }) - .on("upload-success", this.updateFileList("fileListOne")); - this.uppyTwo = new Uppy({ debug: true, autoProceed: false }) - .use(Tus, { endpoint: "https://master.tus.io/files/" }) - .on("upload-success", this.updateFileList("fileListTwo")); - } -} diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.spec.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.spec.ts deleted file mode 100644 index f6e11f755..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, type ComponentFixture, TestBed } from "@angular/core/testing"; - -import { ProgressBarComponent } from "./progress-bar.component"; - -describe("ProgressBarComponent", () => { - let component: ProgressBarComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ProgressBarComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ProgressBarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it("should create", () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.ts deleted file mode 100644 index def8c65ab..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { - ChangeDetectionStrategy, - Component, - ElementRef, - Input, - inject, - type OnChanges, - type OnDestroy, - type SimpleChanges, -} from "@angular/core"; -import { Uppy } from "@uppy/core"; -import type { ProgressBarOptions } from "@uppy/progress-bar"; -import ProgressBar from "@uppy/progress-bar"; -import type { Body, Meta } from "@uppy/utils/lib/UppyFile"; -import { UppyAngularWrapper } from "../../utils/wrapper"; - -@Component({ - selector: "uppy-progress-bar", - template: "", - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class ProgressBarComponent - extends UppyAngularWrapper - implements OnDestroy, OnChanges -{ - el = inject(ElementRef); - - @Input() uppy: Uppy = new Uppy(); - @Input() props: ProgressBarOptions = {}; - - /** Inserted by Angular inject() migration for backwards compatibility */ - constructor(...args: unknown[]); - - constructor() { - super(); - } - - ngOnInit() { - this.onMount( - { id: "angular:ProgressBar", target: this.el.nativeElement }, - ProgressBar, - ); - } - - ngOnChanges(changes: SimpleChanges): void { - this.handleChanges(changes, ProgressBar); - } - - ngOnDestroy(): void { - this.uninstall(); - } -} diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.stories.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.stories.ts deleted file mode 100644 index 750063c04..000000000 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/components/progress-bar/progress-bar.stories.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CommonModule } from "@angular/common"; -import { moduleMetadata } from "@storybook/angular"; -import { ProgressBarDemoComponent } from "./progress-bar-demo.component"; - -export default { - title: "Progress Bar", - decorators: [ - moduleMetadata({ - imports: [CommonModule], - declarations: [ProgressBarDemoComponent], - }), - ], -}; - -export const Default = () => ({ - component: ProgressBarDemoComponent, -}); diff --git a/packages/@uppy/angular/projects/uppy/angular/src/lib/utils/wrapper.ts b/packages/@uppy/angular/projects/uppy/angular/src/lib/utils/wrapper.ts index ac9299502..72b5c7910 100644 --- a/packages/@uppy/angular/projects/uppy/angular/src/lib/utils/wrapper.ts +++ b/packages/@uppy/angular/projects/uppy/angular/src/lib/utils/wrapper.ts @@ -1,7 +1,5 @@ import type { ElementRef, SimpleChanges } from "@angular/core"; import type { UIPlugin, UIPluginOptions, Uppy } from "@uppy/core"; -import type { DragDropOptions } from "@uppy/drag-drop"; -import type { ProgressBarOptions } from "@uppy/progress-bar"; import type { StatusBarOptions } from "@uppy/status-bar"; import type { Body, Meta } from "@uppy/utils/lib/UppyFile"; @@ -11,7 +9,7 @@ export abstract class UppyAngularWrapper< Opts extends UIPluginOptions, PluginType extends UIPlugin = UIPlugin, > { - abstract props: DragDropOptions | StatusBarOptions | ProgressBarOptions; + abstract props: StatusBarOptions; abstract el: ElementRef; abstract uppy: Uppy; private options: any; diff --git a/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts b/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts index 83e4e277c..5ca6394a4 100644 --- a/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts +++ b/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts @@ -4,6 +4,4 @@ export { DashboardComponent } from './lib/components/dashboard/dashboard.component' export { DashboardModalComponent } from './lib/components/dashboard-modal/dashboard-modal.component' -export { DragDropComponent } from './lib/components/drag-drop/drag-drop.component' -export { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component' export { StatusBarComponent } from './lib/components/status-bar/status-bar.component' diff --git a/packages/@uppy/angular/turbo.json b/packages/@uppy/angular/turbo.json index edc321b4a..b7cbd4f6f 100644 --- a/packages/@uppy/angular/turbo.json +++ b/packages/@uppy/angular/turbo.json @@ -5,8 +5,6 @@ "dependsOn": [ "@uppy/core#build", "@uppy/dashboard#build", - "@uppy/drag-drop#build", - "@uppy/progress-bar#build", "@uppy/status-bar#build", "@uppy/utils#build" ], diff --git a/packages/@uppy/aws-s3-multipart/CHANGELOG.md b/packages/@uppy/aws-s3-multipart/CHANGELOG.md deleted file mode 100644 index 9343d061d..000000000 --- a/packages/@uppy/aws-s3-multipart/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# @uppy/aws-s3-multipart - -## 4.0.0-beta.5 - -Released: 2024-05-03 -Included in: Uppy v4.0.0-beta.5 - -- @uppy/aws-s3-multipart: Format (Murderlon) diff --git a/packages/@uppy/aws-s3-multipart/LICENSE b/packages/@uppy/aws-s3-multipart/LICENSE deleted file mode 100644 index c23747330..000000000 --- a/packages/@uppy/aws-s3-multipart/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/packages/@uppy/aws-s3-multipart/README.md b/packages/@uppy/aws-s3-multipart/README.md deleted file mode 100644 index 5d851bbe0..000000000 --- a/packages/@uppy/aws-s3-multipart/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# @uppy/aws-s3-multipart - -This package is deprecated. Use -[`@uppy/aws-s3`](https://npmjs.org/package/@uppy/aws-s3) instead. diff --git a/packages/@uppy/aws-s3-multipart/package.json b/packages/@uppy/aws-s3-multipart/package.json deleted file mode 100644 index fa7687e22..000000000 --- a/packages/@uppy/aws-s3-multipart/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@uppy/aws-s3-multipart", - "description": "Upload to Amazon S3 with Uppy and S3's Multipart upload strategy", - "version": "4.0.0", - "license": "MIT", - "main": "lib/index.js", - "type": "module", - "keywords": [ - "file uploader", - "aws s3", - "amazon s3", - "s3", - "uppy", - "uppy-plugin", - "multipart" - ], - "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/aws-s3": "workspace:^" - }, - "devDependencies": { - "@uppy/core": "workspace:^", - "typescript": "^5.8.3" - } -} diff --git a/packages/@uppy/aws-s3-multipart/src/index.ts b/packages/@uppy/aws-s3-multipart/src/index.ts deleted file mode 100644 index 429690219..000000000 --- a/packages/@uppy/aws-s3-multipart/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@uppy/aws-s3' -export { default } from '@uppy/aws-s3' diff --git a/packages/@uppy/drag-drop/.npmignore b/packages/@uppy/drag-drop/.npmignore deleted file mode 100644 index 6c816673f..000000000 --- a/packages/@uppy/drag-drop/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tsconfig.* diff --git a/packages/@uppy/drag-drop/CHANGELOG.md b/packages/@uppy/drag-drop/CHANGELOG.md deleted file mode 100644 index 8c413d76c..000000000 --- a/packages/@uppy/drag-drop/CHANGELOG.md +++ /dev/null @@ -1,117 +0,0 @@ -# @uppy/drag-drop - -## 4.1.3 - -Released: 2025-05-18 -Included in: Uppy v4.16.0 - -- @uppy/audio,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/image-editor,@uppy/instagram,@uppy/onedrive,@uppy/remote-sources,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/webcam,@uppy/webdav,@uppy/zoom: ts: make locale strings optional (Merlijn Vos / #5728) - -## 4.1.0 - -Released: 2025-01-06 -Included in: Uppy v4.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/webdav,@uppy/xhr-upload,@uppy/zoom: Remove "paths" from all tsconfig's (Merlijn Vos / #5572) - -## 4.0.5 - -Released: 2024-12-05 -Included in: Uppy v4.8.0 - -- @uppy/audio,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: cleanup tsconfig (Mikael Finstad / #5520) - -## 4.0.4 - -Released: 2024-10-31 -Included in: Uppy v4.6.0 - -- @uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react-native,@uppy/react,@uppy/redux-dev-tools,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Fix links (Anthony Veaudry / #5492) - -## 4.0.3 - -Released: 2024-10-15 -Included in: Uppy v4.5.0 - -- @uppy/dashboard,@uppy/drag-drop,@uppy/file-input: `.handleInputChange()` - use `.currentTarget`; clear the input using `''` (Evgenia Karunus / #5381) - -## 4.0.2 - -Released: 2024-08-15 -Included in: Uppy v4.1.1 - -- @uppy/dashboard,@uppy/drag-drop,@uppy/file-input: Transform the `accept` prop into a string everywhere (Evgenia Karunus / #5380) - -## 4.0.1 - -Released: 2024-07-15 -Included in: Uppy v4.0.1 - -- @uppy/dashboard,@uppy/drag-drop,@uppy/drop-target: ``, ``, `drop-target` - new anti-flickering solution (Evgenia Karunus / #5326) - -## 4.0.0-beta.1 - -Released: 2024-03-28 -Included in: Uppy v4.0.0-beta.1 - -- @uppy/drag-drop: refine type of private variables (Antoine du Hamel / #5026) -- @uppy/drag-drop,@uppy/progress-bar: add missing exports (Antoine du Hamel / #5009) -- @uppy/drag-drop: refactor to TypeScript (Antoine du Hamel / #4983) - -## 3.1.1 - -Released: 2024-07-02 -Included in: Uppy v3.27.2 - -- docs,@uppy/drag-drop: `uppy.io/docs` - fix typos/broken links (Evgenia Karunus / #5296) - -## 3.1.0 - -Released: 2024-03-27 -Included in: Uppy v3.24.0 - -- @uppy/drag-drop: refine type of private variables (Antoine du Hamel / #5026) -- @uppy/drag-drop,@uppy/progress-bar: add missing exports (Antoine du Hamel / #5009) -- @uppy/drag-drop: refactor to TypeScript (Antoine du Hamel / #4983) - -## 3.0.1 - -Released: 2022-09-25 -Included in: Uppy v3.1.0 - -- @uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/companion,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/redux-dev-tools,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: add missing entries to changelog for individual packages (Antoine du Hamel / #4092) - -## 3.0.0 - -Released: 2022-08-22 -Included in: Uppy v3.0.0 - -- Switch to ESM - -## 2.1.1 - -Released: 2022-05-30 -Included in: Uppy v2.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/onedrive,@uppy/progress-bar,@uppy/react,@uppy/redux-dev-tools,@uppy/robodog,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: doc: update bundler recommendation (Antoine du Hamel / #3763) - -## 2.0.7 - -Released: 2022-04-27 -Included in: Uppy v2.9.4 - -- @uppy/drag-drop: refactor to ESM (Antoine du Hamel / #3647) - -## 2.0.6 - -Released: 2022-01-10 -Included in: Uppy v2.4.0 - -- @uppy/drag-drop: fix `undefined is not a function` TypeError (Antoine du Hamel / #3397) - -## 2.0.5 - -Released: 2021-12-07 -Included in: Uppy v2.3.0 - -- @uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive,@uppy/image-editor,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/screen-capture,@uppy/status-bar,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/url,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Refactor locale scripts & generate types and docs (Merlijn Vos / #3276) diff --git a/packages/@uppy/drag-drop/LICENSE b/packages/@uppy/drag-drop/LICENSE deleted file mode 100644 index c23747330..000000000 --- a/packages/@uppy/drag-drop/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/packages/@uppy/drag-drop/README.md b/packages/@uppy/drag-drop/README.md deleted file mode 100644 index 0a274152e..000000000 --- a/packages/@uppy/drag-drop/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# @uppy/drag-drop - -Uppy logo: a smiling puppy above a pink upwards arrow - -[![npm version](https://img.shields.io/npm/v/@uppy/drag-drop.svg?style=flat-square)](https://www.npmjs.com/package/@uppy/drag-drop) -![CI status for Uppy tests](https://github.com/transloadit/uppy/workflows/CI/badge.svg) -![CI status for Companion tests](https://github.com/transloadit/uppy/workflows/Companion/badge.svg) -![CI status for browser tests](https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg) - -Droppable zone UI for Uppy. Drag and drop files into it to upload. - -**[Read the docs](https://uppy.io/docs/drag-drop/)** - -Uppy is being developed by the folks at [Transloadit](https://transloadit.com), -a versatile file encoding service. - -## Example - -```js -import Uppy from '@uppy/core' -import DragDrop from '@uppy/drag-drop' - -const uppy = new Uppy() -uppy.use(DragDrop, { - target: '#upload', -}) -``` - -## Installation - -```bash -$ npm install @uppy/drag-drop -``` - -Alternatively, you can also use this plugin in a pre-built bundle from -Transloadit’s CDN: Smart CDN. 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/drag-drop/). - -## License - -[The MIT License](./LICENSE). diff --git a/packages/@uppy/drag-drop/package.json b/packages/@uppy/drag-drop/package.json deleted file mode 100644 index aabd02a4c..000000000 --- a/packages/@uppy/drag-drop/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@uppy/drag-drop", - "description": "Droppable zone UI for Uppy. Drag and drop files into it to upload.", - "version": "4.1.3", - "license": "MIT", - "main": "lib/index.js", - "style": "dist/style.min.css", - "type": "module", - "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:css": "sass --load-path=../../ src/style.scss dist/style.css && postcss dist/style.css -u cssnano -o dist/style.min.css", - "typecheck": "tsc --build" - }, - "keywords": [ - "file uploader", - "uppy", - "uppy-plugin", - "drag-drop", - "drag", - "drop", - "dropzone", - "upload" - ], - "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": "workspace:^", - "preact": "^10.5.13" - }, - "peerDependencies": { - "@uppy/core": "workspace:^" - }, - "devDependencies": { - "cssnano": "^7.0.7", - "postcss": "^8.5.6", - "postcss-cli": "^11.0.1", - "sass": "^1.89.2", - "typescript": "^5.8.3" - } -} diff --git a/packages/@uppy/drag-drop/src/DragDrop.tsx b/packages/@uppy/drag-drop/src/DragDrop.tsx deleted file mode 100644 index c942b3d2b..000000000 --- a/packages/@uppy/drag-drop/src/DragDrop.tsx +++ /dev/null @@ -1,247 +0,0 @@ -import type { - Body, - DefinePluginOpts, - Meta, - UIPluginOptions, - Uppy, -} from '@uppy/core' -import { UIPlugin } from '@uppy/core' -import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles' -import isDragDropSupported from '@uppy/utils/lib/isDragDropSupported' -import type { LocaleStrings } from '@uppy/utils/lib/Translator' -import toArray from '@uppy/utils/lib/toArray' -import { type ComponentChild, h } from 'preact' -import type { TargetedEvent } from 'preact/compat' -import packageJson from '../package.json' with { type: 'json' } -import locale from './locale.js' - -export interface DragDropOptions extends UIPluginOptions { - inputName?: string - allowMultipleFiles?: boolean - width?: string | number - height?: string | number - note?: string - onDragOver?: (event: DragEvent) => void - onDragLeave?: (event: DragEvent) => void - onDrop?: (event: DragEvent) => void - locale?: LocaleStrings -} - -const defaultOptions = { - inputName: 'files[]', - width: '100%', - height: '100%', -} satisfies Partial - -/** - * Drag & Drop plugin - * - */ -export default class DragDrop extends UIPlugin< - DefinePluginOpts, - M, - B -> { - static VERSION = packageJson.version - - // Check for browser dragDrop support - private isDragDropSupported = isDragDropSupported() - - private fileInputRef!: HTMLInputElement - - constructor(uppy: Uppy, opts?: DragDropOptions) { - super(uppy, { - ...defaultOptions, - ...opts, - }) - this.type = 'acquirer' - this.id = this.opts.id || 'DragDrop' - this.title = 'Drag & Drop' - - this.defaultLocale = locale - - this.i18nInit() - } - - private addFiles = (files: File[]) => { - const descriptors = files.map((file) => ({ - source: this.id, - name: file.name, - type: file.type, - data: file, - meta: { - // path of the file relative to the ancestor directory the user selected. - // e.g. 'docs/Old Prague/airbnb.pdf' - relativePath: (file as any).relativePath || null, - } as any as M, - })) - - try { - this.uppy.addFiles(descriptors) - } catch (err) { - this.uppy.log(err as any) - } - } - - private onInputChange = (event: TargetedEvent) => { - const files = toArray(event.currentTarget.files || []) - if (files.length > 0) { - this.uppy.log('[DragDrop] Files selected through input') - this.addFiles(files) - } - - // Clear the input so that Chrome can detect file section when the same file is repeatedly selected - // (see https://github.com/transloadit/uppy/issues/768#issuecomment-2264902758) - event.currentTarget.value = '' - } - - private handleDragOver = (event: DragEvent) => { - event.preventDefault() - event.stopPropagation() - - // Check if the "type" of the datatransfer object includes files. If not, deny drop. - const { types } = event.dataTransfer! - const hasFiles = types.some((type) => type === 'Files') - const { allowNewUpload } = this.uppy.getState() - if (!hasFiles || !allowNewUpload) { - event.dataTransfer!.dropEffect = 'none' - return - } - - // Add a small (+) icon on drop - // (and prevent browsers from interpreting this as files being _moved_ into the browser - // https://github.com/transloadit/uppy/issues/1978) - // - event.dataTransfer!.dropEffect = 'copy' - - this.setPluginState({ isDraggingOver: true }) - - this.opts.onDragOver?.(event) - } - - private handleDragLeave = (event: DragEvent) => { - event.preventDefault() - event.stopPropagation() - - this.setPluginState({ isDraggingOver: false }) - - this.opts.onDragLeave?.(event) - } - - private handleDrop = async (event: DragEvent) => { - event.preventDefault() - event.stopPropagation() - - this.setPluginState({ isDraggingOver: false }) - - const logDropError = (error: any) => { - this.uppy.log(error, 'error') - } - - // Add all dropped files - const files = await getDroppedFiles(event.dataTransfer!, { logDropError }) - if (files.length > 0) { - this.uppy.log('[DragDrop] Files dropped') - this.addFiles(files) - } - - this.opts.onDrop?.(event) - } - - private renderHiddenFileInput() { - const { restrictions } = this.uppy.opts - return ( - { - this.fileInputRef = ref! - }} - name={this.opts.inputName} - multiple={restrictions.maxNumberOfFiles !== 1} - accept={restrictions.allowedFileTypes?.join(', ')} - onChange={this.onInputChange} - /> - ) - } - - private static renderArrowSvg() { - return ( - - ) - } - - private renderLabel() { - return ( -
- {this.i18nArray('dropHereOr', { - browse: ( - {this.i18n('browse')} - ) as any, - })} -
- ) - } - - private renderNote() { - return {this.opts.note} - } - - render(): ComponentChild { - const dragDropClass = `uppy-u-reset - uppy-DragDrop-container - ${this.isDragDropSupported ? 'uppy-DragDrop--isDragDropSupported' : ''} - ${this.getPluginState().isDraggingOver ? 'uppy-DragDrop--isDraggingOver' : ''} - ` - - const dragDropStyle = { - width: this.opts.width, - height: this.opts.height, - } - - return ( - - ) - } - - install(): void { - const { target } = this.opts - - this.setPluginState({ - isDraggingOver: false, - }) - - if (target) { - this.mount(target, this) - } - } - - uninstall(): void { - this.unmount() - } -} diff --git a/packages/@uppy/drag-drop/src/index.ts b/packages/@uppy/drag-drop/src/index.ts deleted file mode 100644 index c71683962..000000000 --- a/packages/@uppy/drag-drop/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { DragDropOptions } from './DragDrop.js' -export { default } from './DragDrop.js' diff --git a/packages/@uppy/drag-drop/src/locale.ts b/packages/@uppy/drag-drop/src/locale.ts deleted file mode 100644 index 540bd1ce4..000000000 --- a/packages/@uppy/drag-drop/src/locale.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default { - strings: { - // Text to show on the droppable area. - // `%{browse}` is replaced with a link that opens the system file selection dialog. - dropHereOr: 'Drop here or %{browse}', - // Used as the label for the link that opens the system file selection dialog. - browse: 'browse', - }, -} diff --git a/packages/@uppy/drag-drop/src/style.scss b/packages/@uppy/drag-drop/src/style.scss deleted file mode 100644 index 12ba3e5ef..000000000 --- a/packages/@uppy/drag-drop/src/style.scss +++ /dev/null @@ -1,67 +0,0 @@ -@use "sass:color"; -@use '@uppy/core/src/_utils.scss'; -@use '@uppy/core/src/_variables.scss'; - -.uppy-DragDrop-container { - display: flex; - align-items: center; - justify-content: center; - max-width: 100%; - font-family: variables.$font-family-base; - background-color: variables.$white; - border-radius: 7px; - cursor: pointer; - - // firefox fix: removes thin dotted outline - &::-moz-focus-inner { - border: 0; - } - - &:focus { - outline: none; - box-shadow: 0 0 0 3px rgba(variables.$blue, 0.4); - } -} - -.uppy-DragDrop-inner { - margin: 0; - padding: 80px 20px; - line-height: 1.4; - text-align: center; -} - -.uppy-DragDrop-arrow { - width: 60px; - height: 60px; - margin-bottom: 17px; - fill: color.adjust(variables.$gray-500, $lightness: 30%); -} - -.uppy-DragDrop--isDragDropSupported { - border: 2px dashed color.adjust(variables.$gray-500, $lightness: 10%); -} - -.uppy-DragDrop--isDraggingOver { - background: variables.$gray-200; - border: 2px dashed variables.$blue; - - .uppy-DragDrop-arrow { - fill: variables.$gray-500; - } -} - -.uppy-DragDrop-label { - display: block; - margin-bottom: 5px; - font-size: 1.15em; -} - -.uppy-DragDrop-browse { - color: variables.$blue; - cursor: pointer; -} - -.uppy-DragDrop-note { - color: color.adjust(variables.$gray-500, $lightness: 10%); - font-size: 1em; -} diff --git a/packages/@uppy/drag-drop/tsconfig.build.json b/packages/@uppy/drag-drop/tsconfig.build.json deleted file mode 100644 index 389eb1387..000000000 --- a/packages/@uppy/drag-drop/tsconfig.build.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src" - }, - "include": ["./src/**/*.*"], - "exclude": ["./src/**/*.test.ts"], - "references": [ - { - "path": "../utils/tsconfig.build.json" - }, - { - "path": "../core/tsconfig.build.json" - } - ] -} diff --git a/packages/@uppy/drag-drop/tsconfig.json b/packages/@uppy/drag-drop/tsconfig.json deleted file mode 100644 index 991d79cbd..000000000 --- a/packages/@uppy/drag-drop/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "emitDeclarationOnly": false, - "noEmit": true - }, - "include": ["./package.json", "./src/**/*.*"], - "references": [ - { - "path": "../utils/tsconfig.build.json" - }, - { - "path": "../core/tsconfig.build.json" - } - ] -} diff --git a/packages/@uppy/drag-drop/turbo.json b/packages/@uppy/drag-drop/turbo.json deleted file mode 100644 index bd1c705e1..000000000 --- a/packages/@uppy/drag-drop/turbo.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": ["//"], - "tasks": { - "build": { - "dependsOn": ["@uppy/core#build"] - } - } -} diff --git a/packages/@uppy/file-input/.npmignore b/packages/@uppy/file-input/.npmignore deleted file mode 100644 index 6c816673f..000000000 --- a/packages/@uppy/file-input/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tsconfig.* diff --git a/packages/@uppy/file-input/CHANGELOG.md b/packages/@uppy/file-input/CHANGELOG.md deleted file mode 100644 index 1aea507b0..000000000 --- a/packages/@uppy/file-input/CHANGELOG.md +++ /dev/null @@ -1,100 +0,0 @@ -# @uppy/file-input - -## 4.1.3 - -Released: 2025-05-18 -Included in: Uppy v4.16.0 - -- @uppy/audio,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/image-editor,@uppy/instagram,@uppy/onedrive,@uppy/remote-sources,@uppy/screen-capture,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/webcam,@uppy/webdav,@uppy/zoom: ts: make locale strings optional (Merlijn Vos / #5728) - -## 4.1.0 - -Released: 2025-01-06 -Included in: Uppy v4.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/webdav,@uppy/xhr-upload,@uppy/zoom: Remove "paths" from all tsconfig's (Merlijn Vos / #5572) - -## 4.0.4 - -Released: 2024-12-05 -Included in: Uppy v4.8.0 - -- @uppy/audio,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: cleanup tsconfig (Mikael Finstad / #5520) - -## 4.0.3 - -Released: 2024-10-31 -Included in: Uppy v4.6.0 - -- @uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react-native,@uppy/react,@uppy/redux-dev-tools,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Fix links (Anthony Veaudry / #5492) - -## 4.0.2 - -Released: 2024-10-15 -Included in: Uppy v4.5.0 - -- @uppy/dashboard,@uppy/drag-drop,@uppy/file-input: `.handleInputChange()` - use `.currentTarget`; clear the input using `''` (Evgenia Karunus / #5381) - -## 4.0.1 - -Released: 2024-08-15 -Included in: Uppy v4.1.1 - -- @uppy/dashboard,@uppy/drag-drop,@uppy/file-input: Transform the `accept` prop into a string everywhere (Evgenia Karunus / #5380) - -## 4.0.0-beta.4 - -Released: 2024-04-29 -Included in: Uppy v4.0.0-beta.4 - -- @uppy/companion,@uppy/file-input: Release: uppy@3.24.1 (github-actions[bot] / #5069) -- @uppy/file-input: add missing export (Antoine du Hamel / #5045) - -## 3.1.1 - -Released: 2024-04-10 -Included in: Uppy v3.24.1 - -- @uppy/file-input: add missing export (Antoine du Hamel / #5045) - -## 3.1.0 - -Released: 2024-02-28 -Included in: Uppy v3.23.0 - -- @uppy/file-input: refactor to TypeScript (Antoine du Hamel / #4954) - -## 3.0.1 - -Released: 2022-09-25 -Included in: Uppy v3.1.0 - -- @uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/companion,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/redux-dev-tools,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: add missing entries to changelog for individual packages (Antoine du Hamel / #4092) - -## 3.0.0 - -Released: 2022-08-22 -Included in: Uppy v3.0.0 - -- Switch to ESM - -## 2.1.1 - -Released: 2022-05-30 -Included in: Uppy v2.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/onedrive,@uppy/progress-bar,@uppy/react,@uppy/redux-dev-tools,@uppy/robodog,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: doc: update bundler recommendation (Antoine du Hamel / #3763) - -## 2.0.6 - -Released: 2022-04-27 -Included in: Uppy v2.9.4 - -- @uppy/file-input: refactor to ESM (Antoine du Hamel / #3652) - -## 2.0.5 - -Released: 2021-12-07 -Included in: Uppy v2.3.0 - -- @uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/google-drive,@uppy/image-editor,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/screen-capture,@uppy/status-bar,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/url,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Refactor locale scripts & generate types and docs (Merlijn Vos / #3276) diff --git a/packages/@uppy/file-input/LICENSE b/packages/@uppy/file-input/LICENSE deleted file mode 100644 index c23747330..000000000 --- a/packages/@uppy/file-input/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/packages/@uppy/file-input/README.md b/packages/@uppy/file-input/README.md deleted file mode 100644 index 0f945daf8..000000000 --- a/packages/@uppy/file-input/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# @uppy/file-input - -Uppy logo: a smiling puppy above a pink upwards arrow - -[![npm version](https://img.shields.io/npm/v/@uppy/file-input.svg?style=flat-square)](https://www.npmjs.com/package/@uppy/file-input) -![CI status for Uppy tests](https://github.com/transloadit/uppy/workflows/CI/badge.svg) -![CI status for Companion tests](https://github.com/transloadit/uppy/workflows/Companion/badge.svg) -![CI status for browser tests](https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg) - -FileInput is the most barebones UI for selecting files—it shows a single button -that, when clicked, opens up the browser’s file selector. - -**[Read the docs](https://uppy.io/docs/file-input)** | -**[Try it](https://uppy.io/examples/xhrupload/)** - -Uppy is being developed by the folks at [Transloadit](https://transloadit.com), -a versatile file encoding service. - -## Example - -```js -import Uppy from '@uppy/core' -import FileInput from '@uppy/file-input' - -const uppy = new Uppy() -uppy.use(FileInput, { - // Options -}) -``` - -## Installation - -```bash -$ npm install @uppy/file-input -``` - -Alternatively, you can also use this plugin in a pre-built bundle from -Transloadit’s CDN: Smart CDN. 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/file-input). - -## License - -[The MIT License](./LICENSE). diff --git a/packages/@uppy/file-input/package.json b/packages/@uppy/file-input/package.json deleted file mode 100644 index e3fe10551..000000000 --- a/packages/@uppy/file-input/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@uppy/file-input", - "description": "Simple UI of a file input button that works with Uppy right out of the box", - "version": "4.1.3", - "license": "MIT", - "main": "lib/index.js", - "style": "dist/style.min.css", - "type": "module", - "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:css": "sass --load-path=../../ src/style.scss dist/style.css && postcss dist/style.css -u cssnano -o dist/style.min.css", - "typecheck": "tsc --build" - }, - "keywords": [ - "file uploader", - "upload", - "uppy", - "uppy-plugin", - "file-input" - ], - "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": "workspace:^", - "preact": "^10.5.13" - }, - "peerDependencies": { - "@uppy/core": "workspace:^" - }, - "devDependencies": { - "cssnano": "^7.0.7", - "postcss": "^8.5.6", - "postcss-cli": "^11.0.1", - "sass": "^1.89.2", - "typescript": "^5.8.3" - } -} diff --git a/packages/@uppy/file-input/src/FileInput.tsx b/packages/@uppy/file-input/src/FileInput.tsx deleted file mode 100644 index bcef61b72..000000000 --- a/packages/@uppy/file-input/src/FileInput.tsx +++ /dev/null @@ -1,138 +0,0 @@ -import type { - Body, - DefinePluginOpts, - Meta, - UIPluginOptions, - Uppy, -} from '@uppy/core' - -import { UIPlugin } from '@uppy/core' -import type { LocaleStrings } from '@uppy/utils/lib/Translator' -import toArray from '@uppy/utils/lib/toArray' -// biome-ignore lint/style/useImportType: h is not a type -import { type ComponentChild, h } from 'preact' -import type { TargetedEvent } from 'preact/compat' -import packageJson from '../package.json' with { type: 'json' } -import locale from './locale.js' - -export interface FileInputOptions extends UIPluginOptions { - pretty?: boolean - inputName?: string - locale?: LocaleStrings -} -const defaultOptions = { - pretty: true, - inputName: 'files[]', -} - -// https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/files -interface HTMLFileInputElement extends HTMLInputElement { - files: FileList -} - -type Opts = DefinePluginOpts - -export default class FileInput extends UIPlugin< - Opts, - M, - B -> { - static VERSION = packageJson.version - - input: HTMLFileInputElement | null = null - - constructor(uppy: Uppy, opts?: FileInputOptions) { - super(uppy, { ...defaultOptions, ...opts }) - this.id = this.opts.id || 'FileInput' - this.title = 'File Input' - this.type = 'acquirer' - - this.defaultLocale = locale - - this.i18nInit() - - this.render = this.render.bind(this) - this.handleInputChange = this.handleInputChange.bind(this) - this.handleClick = this.handleClick.bind(this) - } - - addFiles(files: File[]): void { - const descriptors = files.map((file) => ({ - source: this.id, - name: file.name, - type: file.type, - data: file, - })) - - try { - this.uppy.addFiles(descriptors) - } catch (err) { - this.uppy.log(err) - } - } - - private handleInputChange(event: TargetedEvent) { - this.uppy.log('[FileInput] Something selected through input...') - const files = toArray(event.currentTarget.files || []) - this.addFiles(files) - - // Clear the input so that Chrome can detect file section when the same file is repeatedly selected - // (see https://github.com/transloadit/uppy/issues/768#issuecomment-2264902758) - event.currentTarget.value = '' - } - - private handleClick() { - this.input!.click() - } - - render(): ComponentChild { - /* http://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/ */ - const hiddenInputStyle = { - width: '0.1px', - height: '0.1px', - opacity: 0, - overflow: 'hidden', - position: 'absolute', - zIndex: -1, - } satisfies h.JSX.IntrinsicElements['input']['style'] - - const { restrictions } = this.uppy.opts - - return ( -
- { - this.input = input as HTMLFileInputElement - }} - /> - {this.opts.pretty && ( - - )} -
- ) - } - - install(): void { - const { target } = this.opts - if (target) { - this.mount(target, this) - } - } - - uninstall(): void { - this.unmount() - } -} diff --git a/packages/@uppy/file-input/src/index.ts b/packages/@uppy/file-input/src/index.ts deleted file mode 100644 index 8ecedeb28..000000000 --- a/packages/@uppy/file-input/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { FileInputOptions } from './FileInput.js' -export { default } from './FileInput.js' diff --git a/packages/@uppy/file-input/src/locale.ts b/packages/@uppy/file-input/src/locale.ts deleted file mode 100644 index 6bc0dfdc9..000000000 --- a/packages/@uppy/file-input/src/locale.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - strings: { - chooseFiles: 'Choose files', - }, -} diff --git a/packages/@uppy/file-input/src/style.scss b/packages/@uppy/file-input/src/style.scss deleted file mode 100644 index 222bf3082..000000000 --- a/packages/@uppy/file-input/src/style.scss +++ /dev/null @@ -1,24 +0,0 @@ -@use "sass:color"; -@use '@uppy/core/src/_utils.scss'; -@use '@uppy/core/src/_variables.scss'; - -.uppy-FileInput-container { - margin-bottom: 15px; -} - -.uppy-FileInput-btn { - @include utils.reset-button; - // text-transform: uppercase; - padding: 10px 15px; - color: color.adjust(variables.$blue, $lightness: -20%); - font-size: 0.85em; - font-family: sans-serif; - border: 1px solid color.adjust(variables.$blue, $lightness: -20%); - border-radius: 8px; - cursor: pointer; - - &:hover { - color: variables.$white; - background-color: color.adjust(variables.$blue, $lightness: -20%); - } -} diff --git a/packages/@uppy/file-input/tsconfig.build.json b/packages/@uppy/file-input/tsconfig.build.json deleted file mode 100644 index 389eb1387..000000000 --- a/packages/@uppy/file-input/tsconfig.build.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src" - }, - "include": ["./src/**/*.*"], - "exclude": ["./src/**/*.test.ts"], - "references": [ - { - "path": "../utils/tsconfig.build.json" - }, - { - "path": "../core/tsconfig.build.json" - } - ] -} diff --git a/packages/@uppy/file-input/tsconfig.json b/packages/@uppy/file-input/tsconfig.json deleted file mode 100644 index 991d79cbd..000000000 --- a/packages/@uppy/file-input/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "emitDeclarationOnly": false, - "noEmit": true - }, - "include": ["./package.json", "./src/**/*.*"], - "references": [ - { - "path": "../utils/tsconfig.build.json" - }, - { - "path": "../core/tsconfig.build.json" - } - ] -} diff --git a/packages/@uppy/file-input/turbo.json b/packages/@uppy/file-input/turbo.json deleted file mode 100644 index bd1c705e1..000000000 --- a/packages/@uppy/file-input/turbo.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": ["//"], - "tasks": { - "build": { - "dependsOn": ["@uppy/core#build"] - } - } -} diff --git a/packages/@uppy/locales/turbo.json b/packages/@uppy/locales/turbo.json index 3cab2971b..c828a1d3f 100644 --- a/packages/@uppy/locales/turbo.json +++ b/packages/@uppy/locales/turbo.json @@ -10,7 +10,6 @@ "@uppy/onedrive#build", "@uppy/compressor#build", "@uppy/url#build", - "@uppy/file-input#build", "@uppy/dashboard#build", "@uppy/google-photos-picker#build", "@uppy/audio#build", @@ -26,8 +25,7 @@ "@uppy/unsplash#build", "@uppy/status-bar#build", "@uppy/webcam#build", - "@uppy/instagram#build", - "@uppy/drag-drop#build" + "@uppy/instagram#build" ], "inputs": [ "../*/src/locale.ts", diff --git a/packages/@uppy/progress-bar/.npmignore b/packages/@uppy/progress-bar/.npmignore deleted file mode 100644 index 6c816673f..000000000 --- a/packages/@uppy/progress-bar/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tsconfig.* diff --git a/packages/@uppy/progress-bar/CHANGELOG.md b/packages/@uppy/progress-bar/CHANGELOG.md deleted file mode 100644 index 2be968e05..000000000 --- a/packages/@uppy/progress-bar/CHANGELOG.md +++ /dev/null @@ -1,72 +0,0 @@ -# @uppy/progress-bar - -## 4.2.0 - -Released: 2025-01-06 -Included in: Uppy v4.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive-picker,@uppy/google-drive,@uppy/google-photos-picker,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/webdav,@uppy/xhr-upload,@uppy/zoom: Remove "paths" from all tsconfig's (Merlijn Vos / #5572) - -## 4.0.2 - -Released: 2024-12-05 -Included in: Uppy v4.8.0 - -- @uppy/audio,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: cleanup tsconfig (Mikael Finstad / #5520) - -## 4.0.1 - -Released: 2024-10-31 -Included in: Uppy v4.6.0 - -- @uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react-native,@uppy/react,@uppy/redux-dev-tools,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Fix links (Anthony Veaudry / #5492) - -## 4.0.0-beta.1 - -Released: 2024-03-28 -Included in: Uppy v4.0.0-beta.1 - -- @uppy/progress-bar: remove default target (Antoine du Hamel / #4971) -- @uppy/drag-drop,@uppy/progress-bar: add missing exports (Antoine du Hamel / #5009) - -## 3.1.1 - -Released: 2024-03-27 -Included in: Uppy v3.24.0 - -- @uppy/drag-drop,@uppy/progress-bar: add missing exports (Antoine du Hamel / #5009) - -## 3.1.0 - -Released: 2024-02-28 -Included in: Uppy v3.23.0 - -- @uppy/progress-bar: refactor to TypeScript (Mikael Finstad / #4921) - -## 3.0.1 - -Released: 2022-09-25 -Included in: Uppy v3.1.0 - -- @uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/companion,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/redux-dev-tools,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: add missing entries to changelog for individual packages (Antoine du Hamel / #4092) - -## 3.0.0 - -Released: 2022-08-22 -Included in: Uppy v3.0.0 - -- Switch to ESM - -## 2.1.1 - -Released: 2022-05-30 -Included in: Uppy v2.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/onedrive,@uppy/progress-bar,@uppy/react,@uppy/redux-dev-tools,@uppy/robodog,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: doc: update bundler recommendation (Antoine du Hamel / #3763) - -## 2.1.0 - -Released: 2022-05-14 -Included in: Uppy v2.10.0 - -- @uppy/progress-bar: refactor to ESM (Antoine du Hamel / #3706) diff --git a/packages/@uppy/progress-bar/LICENSE b/packages/@uppy/progress-bar/LICENSE deleted file mode 100644 index c23747330..000000000 --- a/packages/@uppy/progress-bar/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/packages/@uppy/progress-bar/README.md b/packages/@uppy/progress-bar/README.md deleted file mode 100644 index fdd45bf57..000000000 --- a/packages/@uppy/progress-bar/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# @uppy/progress-bar - -Uppy logo: a smiling puppy above a pink upwards arrow - -[![npm version](https://img.shields.io/npm/v/@uppy/progress-bar.svg?style=flat-square)](https://www.npmjs.com/package/@uppy/progress-bar) -![CI status for Uppy tests](https://github.com/transloadit/uppy/workflows/CI/badge.svg) -![CI status for Companion tests](https://github.com/transloadit/uppy/workflows/Companion/badge.svg) -![CI status for browser tests](https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg) - -ProgressBar is a minimalist plugin that shows the current upload progress in a -thin bar element. Like the ones used by YouTube and GitHub when navigating -between pages. - -Uppy is being developed by the folks at [Transloadit](https://transloadit.com), -a versatile file encoding service. - -## Example - -```js -import Uppy from '@uppy/core' -import ProgressBar from '@uppy/progress-bar' - -const uppy = new Uppy() -uppy.use(ProgressBar, { - // Options -}) -``` - -## Installation - -```bash -$ npm install @uppy/progress-bar -``` - -Alternatively, you can also use this plugin in a pre-built bundle from -Transloadit’s CDN: Smart CDN. 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/progress-bar). - -## License - -[The MIT License](./LICENSE). diff --git a/packages/@uppy/progress-bar/package.json b/packages/@uppy/progress-bar/package.json deleted file mode 100644 index 6fd9f444b..000000000 --- a/packages/@uppy/progress-bar/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@uppy/progress-bar", - "description": "A progress bar UI for Uppy", - "version": "4.2.1", - "license": "MIT", - "main": "lib/index.js", - "style": "dist/style.min.css", - "type": "module", - "scripts": { - "build": "tsc --build tsconfig.build.json", - "build:css": "sass --load-path=../../ src/style.scss dist/style.css && postcss dist/style.css -u cssnano -o dist/style.min.css", - "typecheck": "tsc --build" - }, - "keywords": [ - "file uploader", - "uppy", - "uppy-plugin", - "progress", - "progress bar", - "upload progress" - ], - "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": "workspace:^", - "preact": "^10.5.13" - }, - "peerDependencies": { - "@uppy/core": "workspace:^" - }, - "devDependencies": { - "cssnano": "^7.0.7", - "postcss": "^8.5.6", - "postcss-cli": "^11.0.1", - "sass": "^1.89.2", - "typescript": "^5.8.3" - } -} diff --git a/packages/@uppy/progress-bar/src/ProgressBar.tsx b/packages/@uppy/progress-bar/src/ProgressBar.tsx deleted file mode 100644 index beee96d39..000000000 --- a/packages/@uppy/progress-bar/src/ProgressBar.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import type { - Body, - DefinePluginOpts, - Meta, - State, - UIPluginOptions, - Uppy, -} from '@uppy/core' -import { UIPlugin } from '@uppy/core' -import { type ComponentChild, h } from 'preact' - -import packageJson from '../package.json' with { type: 'json' } - -export interface ProgressBarOptions extends UIPluginOptions { - hideAfterFinish?: boolean - fixed?: boolean -} -// set default options, must kept in sync with @uppy/react/src/ProgressBar.js -const defaultOptions = { - fixed: false, - hideAfterFinish: true, -} - -type Opts = DefinePluginOpts - -/** - * Progress bar - * - */ -export default class ProgressBar< - M extends Meta, - B extends Body, -> extends UIPlugin { - static VERSION = packageJson.version - - constructor(uppy: Uppy, opts?: ProgressBarOptions) { - super(uppy, { ...defaultOptions, ...opts }) - this.id = this.opts.id || 'ProgressBar' - this.title = 'Progress Bar' - this.type = 'progressindicator' - - this.render = this.render.bind(this) - } - - render(state: State): ComponentChild { - const { totalProgress } = state - // before starting and after finish should be hidden if specified in the options - const isHidden = - (totalProgress === 0 || totalProgress === 100) && - this.opts.hideAfterFinish - return ( -
-
-
{totalProgress}
-
- ) - } - - install(): void { - const { target } = this.opts - if (target) { - this.mount(target, this) - } - } - - uninstall(): void { - this.unmount() - } -} diff --git a/packages/@uppy/progress-bar/src/index.ts b/packages/@uppy/progress-bar/src/index.ts deleted file mode 100644 index bbad8984e..000000000 --- a/packages/@uppy/progress-bar/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { ProgressBarOptions } from './ProgressBar.js' -export { default } from './ProgressBar.js' diff --git a/packages/@uppy/progress-bar/src/style.scss b/packages/@uppy/progress-bar/src/style.scss deleted file mode 100644 index f617c0d53..000000000 --- a/packages/@uppy/progress-bar/src/style.scss +++ /dev/null @@ -1,40 +0,0 @@ -@use '@uppy/core/src/_utils.scss'; -@use '@uppy/core/src/_variables.scss'; - -.uppy-ProgressBar { - /* no important */ - position: absolute; - top: 0; - left: 0; - z-index: 10000; - width: 100%; - height: 3px; - transition: height 0.2s; -} - -.uppy-ProgressBar[aria-hidden='true'] { - /* no important */ - height: 0; -} - -.uppy-ProgressBar-inner { - width: 0; - height: 100%; - - /* no important */ - background-color: variables.$blue; - box-shadow: 0 0 10px rgba(variables.$blue, 0.7); - transition: width 0.4s ease; -} - -.uppy-ProgressBar-percentage { - position: absolute; - top: 50%; - left: 50%; - - /* no important */ - display: none; - color: variables.$white; - text-align: center; - transform: translate(-50%, -50%); -} diff --git a/packages/@uppy/progress-bar/tsconfig.build.json b/packages/@uppy/progress-bar/tsconfig.build.json deleted file mode 100644 index 389eb1387..000000000 --- a/packages/@uppy/progress-bar/tsconfig.build.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src" - }, - "include": ["./src/**/*.*"], - "exclude": ["./src/**/*.test.ts"], - "references": [ - { - "path": "../utils/tsconfig.build.json" - }, - { - "path": "../core/tsconfig.build.json" - } - ] -} diff --git a/packages/@uppy/progress-bar/tsconfig.json b/packages/@uppy/progress-bar/tsconfig.json deleted file mode 100644 index 991d79cbd..000000000 --- a/packages/@uppy/progress-bar/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "emitDeclarationOnly": false, - "noEmit": true - }, - "include": ["./package.json", "./src/**/*.*"], - "references": [ - { - "path": "../utils/tsconfig.build.json" - }, - { - "path": "../core/tsconfig.build.json" - } - ] -} diff --git a/packages/@uppy/progress-bar/turbo.json b/packages/@uppy/progress-bar/turbo.json deleted file mode 100644 index bd1c705e1..000000000 --- a/packages/@uppy/progress-bar/turbo.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": ["//"], - "tasks": { - "build": { - "dependsOn": ["@uppy/core#build"] - } - } -} diff --git a/packages/@uppy/react/package.json b/packages/@uppy/react/package.json index a997b6cf0..07271a7d3 100644 --- a/packages/@uppy/react/package.json +++ b/packages/@uppy/react/package.json @@ -47,9 +47,6 @@ "peerDependencies": { "@uppy/core": "workspace:^", "@uppy/dashboard": "workspace:^", - "@uppy/drag-drop": "workspace:^", - "@uppy/file-input": "workspace:^", - "@uppy/progress-bar": "workspace:^", "@uppy/screen-capture": "workspace:^", "@uppy/status-bar": "workspace:^", "@uppy/webcam": "workspace:^", @@ -60,15 +57,6 @@ "@uppy/dashboard": { "optional": true }, - "@uppy/drag-drop": { - "optional": true - }, - "@uppy/file-input": { - "optional": true - }, - "@uppy/progress-bar": { - "optional": true - }, "@uppy/screen-capture": { "optional": true }, diff --git a/packages/@uppy/react/src/DragDrop.ts b/packages/@uppy/react/src/DragDrop.ts deleted file mode 100644 index 71201dcb4..000000000 --- a/packages/@uppy/react/src/DragDrop.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { Body, Meta, UnknownPlugin, Uppy } from '@uppy/core' -import DragDropPlugin, { type DragDropOptions } from '@uppy/drag-drop' -import { Component, createElement as h } from 'react' -import getHTMLProps from './getHTMLProps.js' -import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js' - -interface DragDropProps - extends DragDropOptions { - uppy: Uppy -} - -/** - * React component that renders an area in which files can be dropped to be - * uploaded. - */ - -class DragDrop extends Component< - DragDropProps -> { - private container!: HTMLElement - - private plugin!: UnknownPlugin - - componentDidMount(): void { - this.installPlugin() - } - - componentDidUpdate(prevProps: DragDrop['props']): void { - if (prevProps.uppy !== this.props.uppy) { - this.uninstallPlugin(prevProps) - this.installPlugin() - } else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { - const { uppy, ...options } = { ...this.props, target: this.container } - this.plugin.setOptions(options) - } - } - - componentWillUnmount(): void { - this.uninstallPlugin() - } - - installPlugin(): void { - const { uppy, locale, inputName, width, height, note, id } = this.props - const options = { - id: id || 'DragDrop', - locale, - inputName, - width, - height, - note, - target: this.container, - } - - uppy.use(DragDropPlugin, options) - - this.plugin = uppy.getPlugin(options.id)! - } - - uninstallPlugin(props = this.props): void { - const { uppy } = props - - uppy.removePlugin(this.plugin) - } - - render() { - return h('div', { - className: 'uppy-Container', - ref: (container: HTMLElement) => { - this.container = container - }, - ...getHTMLProps(this.props), - }) - } -} - -export default DragDrop diff --git a/packages/@uppy/react/src/FileInput.ts b/packages/@uppy/react/src/FileInput.ts deleted file mode 100644 index e48f03ca3..000000000 --- a/packages/@uppy/react/src/FileInput.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { - Body, - Meta, - UIPluginOptions, - UnknownPlugin, - Uppy, -} from '@uppy/core' -import FileInputPlugin, { type FileInputOptions } from '@uppy/file-input' -import { Component, createElement as h } from 'react' - -interface FileInputProps - extends UIPluginOptions { - uppy: Uppy - locale?: FileInputOptions['locale'] - pretty?: boolean - inputName?: string -} - -/** - * React component that renders an area in which files can be dropped to be - * uploaded. - */ - -class FileInput extends Component< - FileInputProps -> { - // Must be kept in sync with @uppy/file-input/src/FileInput.js - static defaultProps = { - locale: undefined, - pretty: true, - inputName: 'files[]', - } - - private container!: HTMLElement - - private plugin?: UnknownPlugin - - componentDidMount(): void { - this.installPlugin() - } - - componentDidUpdate(prevProps: FileInputProps): void { - if (prevProps.uppy !== this.props.uppy) { - this.uninstallPlugin(prevProps) - this.installPlugin() - } - } - - componentWillUnmount(): void { - this.uninstallPlugin() - } - - installPlugin(): void { - const { uppy, locale, pretty, inputName, id } = this.props - const options = { - id: id || 'FileInput', - locale, - pretty, - inputName, - target: this.container, - } - - uppy.use(FileInputPlugin, options) - - this.plugin = uppy.getPlugin(options.id)! - } - - uninstallPlugin(props = this.props): void { - const { uppy } = props - - uppy.removePlugin(this.plugin!) - } - - render() { - return h('div', { - className: 'uppy-Container', - ref: (container: HTMLElement) => { - this.container = container - }, - }) - } -} - -export default FileInput diff --git a/packages/@uppy/react/src/ProgressBar.ts b/packages/@uppy/react/src/ProgressBar.ts deleted file mode 100644 index 57813da01..000000000 --- a/packages/@uppy/react/src/ProgressBar.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type { Body, Meta, UnknownPlugin, Uppy } from '@uppy/core' -import ProgressBarPlugin, { type ProgressBarOptions } from '@uppy/progress-bar' -import { Component, createElement as h } from 'react' -import getHTMLProps from './getHTMLProps.js' -import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js' - -interface ProgressBarProps - extends ProgressBarOptions { - uppy: Uppy -} - -/** - * React component that renders a progress bar at the top of the page. - */ - -class ProgressBar extends Component< - ProgressBarProps -> { - private container!: HTMLElement - - private plugin!: UnknownPlugin - - componentDidMount(): void { - this.installPlugin() - } - - componentDidUpdate(prevProps: ProgressBar['props']): void { - if (prevProps.uppy !== this.props.uppy) { - this.uninstallPlugin(prevProps) - this.installPlugin() - } else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { - const { uppy, ...options } = { ...this.props, target: this.container } - this.plugin.setOptions(options) - } - } - - componentWillUnmount(): void { - this.uninstallPlugin() - } - - installPlugin(): void { - const { uppy, fixed, hideAfterFinish, id } = this.props - const options = { - id: id || 'ProgressBar', - fixed, - hideAfterFinish, - target: this.container, - } - - uppy.use(ProgressBarPlugin, options) - - this.plugin = uppy.getPlugin(options.id)! - } - - uninstallPlugin(props = this.props): void { - const { uppy } = props - - uppy.removePlugin(this.plugin) - } - - render() { - return h('div', { - className: 'uppy-Container', - ref: (container: HTMLElement) => { - this.container = container - }, - ...getHTMLProps(this.props), - }) - } -} - -export default ProgressBar diff --git a/packages/@uppy/react/src/index.ts b/packages/@uppy/react/src/index.ts index 9560eef3e..2f56d3460 100644 --- a/packages/@uppy/react/src/index.ts +++ b/packages/@uppy/react/src/index.ts @@ -1,14 +1,11 @@ export { default as Dashboard } from './Dashboard.js' export { default as DashboardModal } from './DashboardModal.js' -export { default as DragDrop } from './DragDrop.js' -export { default as FileInput } from './FileInput.js' export * from './headless/generated/index.js' // Headless components export { UppyContext, UppyContextProvider, } from './headless/UppyContextProvider.js' -export { default as ProgressBar } from './ProgressBar.js' export { default as StatusBar } from './StatusBar.js' export { useDropzone } from './useDropzone.js' export { useFileInput } from './useFileInput.js' diff --git a/packages/@uppy/react/tsconfig.build.json b/packages/@uppy/react/tsconfig.build.json index a5a0f5985..31e06d255 100644 --- a/packages/@uppy/react/tsconfig.build.json +++ b/packages/@uppy/react/tsconfig.build.json @@ -21,15 +21,6 @@ { "path": "../dashboard/tsconfig.build.json" }, - { - "path": "../drag-drop/tsconfig.build.json" - }, - { - "path": "../file-input/tsconfig.build.json" - }, - { - "path": "../progress-bar/tsconfig.build.json" - }, { "path": "../status-bar/tsconfig.build.json" }, diff --git a/packages/@uppy/react/tsconfig.json b/packages/@uppy/react/tsconfig.json index b4964e01f..70441c123 100644 --- a/packages/@uppy/react/tsconfig.json +++ b/packages/@uppy/react/tsconfig.json @@ -20,15 +20,6 @@ { "path": "../dashboard/tsconfig.build.json" }, - { - "path": "../drag-drop/tsconfig.build.json" - }, - { - "path": "../file-input/tsconfig.build.json" - }, - { - "path": "../progress-bar/tsconfig.build.json" - }, { "path": "../status-bar/tsconfig.build.json" }, diff --git a/packages/@uppy/redux-dev-tools/CHANGELOG.md b/packages/@uppy/redux-dev-tools/CHANGELOG.md deleted file mode 100644 index 5d29c5df5..000000000 --- a/packages/@uppy/redux-dev-tools/CHANGELOG.md +++ /dev/null @@ -1,30 +0,0 @@ -# @uppy/redux-dev-tools - -## 4.0.1 - -Released: 2024-10-31 -Included in: Uppy v4.6.0 - -- @uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react-native,@uppy/react,@uppy/redux-dev-tools,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Fix links (Anthony Veaudry / #5492) - -## 3.0.1 - -Released: 2022-09-25 -Included in: Uppy v3.1.0 - -- @uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/companion,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/redux-dev-tools,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: add missing entries to changelog for individual packages (Antoine du Hamel / #4092) - -## 3.0.0 - -Released: 2022-08-22 -Included in: Uppy v3.0.0 - -- Switch to ESM - -## 2.1.0 - -Released: 2022-05-30 -Included in: Uppy v2.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/onedrive,@uppy/progress-bar,@uppy/react,@uppy/redux-dev-tools,@uppy/robodog,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: doc: update bundler recommendation (Antoine du Hamel / #3763) -- @uppy/redux-dev-tools: refactor to ESM (Antoine du Hamel / #3733) diff --git a/packages/@uppy/redux-dev-tools/LICENSE b/packages/@uppy/redux-dev-tools/LICENSE deleted file mode 100644 index c23747330..000000000 --- a/packages/@uppy/redux-dev-tools/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/packages/@uppy/redux-dev-tools/README.md b/packages/@uppy/redux-dev-tools/README.md deleted file mode 100644 index 8763517ba..000000000 --- a/packages/@uppy/redux-dev-tools/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# @uppy/redux-dev-tools - -Uppy logo: a smiling puppy above a pink upwards arrow - -[![npm version](https://img.shields.io/npm/v/@uppy/redux-dev-tools.svg?style=flat-square)](https://www.npmjs.com/package/@uppy/redux-dev-tools) -![CI status for Uppy tests](https://github.com/transloadit/uppy/workflows/CI/badge.svg) -![CI status for Companion tests](https://github.com/transloadit/uppy/workflows/Companion/badge.svg) -![CI status for browser tests](https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg) - -ReduxDevTools plugin that syncs with redux-devtools browser or JS extensions, -and allows for basic time travel: - -Uppy is being developed by the folks at [Transloadit](https://transloadit.com), -a versatile file encoding service. - -## Example - -```js -import Uppy from '@uppy/core' -import ReduxDevTools from 'uppy/redux-dev-tools' - -const uppy = new Uppy() -uppy.use(ReduxDevTools) -``` - -## Installation - -```bash -$ npm install @uppy/redux-dev-tools -``` - -Alternatively, you can also use this plugin in a pre-built bundle from -Transloadit’s CDN: Smart CDN. 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. - - - -## License - -[The MIT License](./LICENSE). diff --git a/packages/@uppy/redux-dev-tools/package.json b/packages/@uppy/redux-dev-tools/package.json deleted file mode 100644 index e808ad997..000000000 --- a/packages/@uppy/redux-dev-tools/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@uppy/redux-dev-tools", - "description": "Redux developer tools plugin for Uppy that simply syncs Uppy’s state with redux-devtools browser or JS extensions, and allows for basic time travel", - "version": "4.0.1", - "license": "MIT", - "main": "lib/index.js", - "type": "module", - "keywords": [ - "file uploader", - "redux", - "redux-dev-tools", - "uppy", - "uppy-plugin" - ], - "homepage": "https://uppy.io", - "bugs": { - "url": "https://github.com/transloadit/uppy/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/transloadit/uppy.git" - }, - "peerDependencies": { - "@uppy/core": "workspace:^" - }, - "scripts": { - "build": "tsc --build tsconfig.build.json", - "typecheck": "tsc --build" - } -} diff --git a/packages/@uppy/redux-dev-tools/src/index.js b/packages/@uppy/redux-dev-tools/src/index.js deleted file mode 100644 index 74dad4ec0..000000000 --- a/packages/@uppy/redux-dev-tools/src/index.js +++ /dev/null @@ -1,82 +0,0 @@ -import { UIPlugin } from '@uppy/core' - -import packageJson from '../package.json' - -/** - * Add Redux DevTools support to Uppy - * - * See https://medium.com/@zalmoxis/redux-devtools-without-redux-or-how-to-have-a-predictable-state-with-any-architecture-61c5f5a7716f - * and https://github.com/zalmoxisus/mobx-remotedev/blob/master/src/monitorActions.js - */ -export default class ReduxDevTools extends UIPlugin { - static VERSION = packageJson.version - - constructor(uppy, opts) { - super(uppy, opts) - this.type = 'debugger' - this.id = this.opts.id || 'ReduxDevTools' - this.title = 'Redux DevTools' - - // set default options - const defaultOptions = {} - - // merge default options with the ones set by user - this.opts = { ...defaultOptions, ...opts } - - this.handleStateChange = this.handleStateChange.bind(this) - this.initDevTools = this.initDevTools.bind(this) - } - - handleStateChange(prevState, nextState) { - this.devTools.send('UPPY_STATE_UPDATE', nextState) - } - - initDevTools() { - this.devTools = window.devToolsExtension.connect() - this.devToolsUnsubscribe = this.devTools.subscribe((message) => { - if (message.type === 'DISPATCH') { - // Implement monitors actions - switch (message.payload.type) { - case 'RESET': - this.uppy.cancelAll() - return - case 'IMPORT_STATE': { - const { computedStates } = message.payload.nextLiftedState - this.uppy.store.state = { - ...this.uppy.getState(), - ...computedStates[computedStates.length - 1].state, - } - this.uppy.updateAll(this.uppy.getState()) - return - } - case 'JUMP_TO_STATE': - case 'JUMP_TO_ACTION': - this.uppy.store.state = { - ...this.uppy.getState(), - ...JSON.parse(message.state), - } - this.uppy.updateAll(this.uppy.getState()) - break - - default: - } - } - }) - } - - install() { - this.withDevTools = - typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ - if (this.withDevTools) { - this.initDevTools() - this.uppy.on('state-update', this.handleStateChange) - } - } - - uninstall() { - if (this.withDevTools) { - this.devToolsUnsubscribe() - this.uppy.off('state-update', this.handleStateUpdate) - } - } -} diff --git a/packages/@uppy/redux-dev-tools/tsconfig.build.json b/packages/@uppy/redux-dev-tools/tsconfig.build.json deleted file mode 100644 index 4565ae577..000000000 --- a/packages/@uppy/redux-dev-tools/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src", - "allowJs": true - }, - "include": ["./src/**/*.*"], - "exclude": ["./src/**/*.test.ts"] -} diff --git a/packages/@uppy/redux-dev-tools/tsconfig.json b/packages/@uppy/redux-dev-tools/tsconfig.json deleted file mode 100644 index 61a4986d8..000000000 --- a/packages/@uppy/redux-dev-tools/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "noEmit": true, - "allowJs": true - }, - "include": ["./package.json", "./src/**/*.*"] -} diff --git a/packages/@uppy/store-redux/CHANGELOG.md b/packages/@uppy/store-redux/CHANGELOG.md deleted file mode 100644 index fb25b6543..000000000 --- a/packages/@uppy/store-redux/CHANGELOG.md +++ /dev/null @@ -1,51 +0,0 @@ -# @uppy/store-redux - -## 4.0.2 - -Released: 2025-01-06 -Included in: Uppy v4.10.0 - -- @uppy/core,@uppy/dashboard,@uppy/provider-views,@uppy/store-redux,@uppy/url: build(deps): bump nanoid from 5.0.7 to 5.0.9 (dependabot[bot] / #5544) - -## 4.0.1 - -Released: 2024-10-31 -Included in: Uppy v4.6.0 - -- @uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react-native,@uppy/react,@uppy/redux-dev-tools,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Fix links (Anthony Veaudry / #5492) - -## 3.0.2 - -Released: 2022-09-25 -Included in: Uppy v3.1.0 - -- @uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/companion,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/redux-dev-tools,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: add missing entries to changelog for individual packages (Antoine du Hamel / #4092) - -## 3.0.0 - -Released: 2022-08-22 -Included in: Uppy v3.0.0 - -- Switch to ESM - -## 3.0.0-beta.2 - -Released: 2022-07-27 -Included in: Uppy v3.0.0-beta.3 - -- @uppy/aws-s3,@uppy/core,@uppy/dashboard,@uppy/store-redux,@uppy/xhr-upload: upgrade `nanoid` to v4 (Antoine du Hamel / #3904) - -## 2.1.0 - -Released: 2022-05-30 -Included in: Uppy v2.11.0 - -- @uppy/angular,@uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/onedrive,@uppy/progress-bar,@uppy/react,@uppy/redux-dev-tools,@uppy/robodog,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: doc: update bundler recommendation (Antoine du Hamel / #3763) -- @uppy/store-redux: refactor to ESM (Antoine du Hamel / #3745) - -## 2.0.3 - -Released: 2021-12-09 -Included in: Uppy v2.3.1 - -- @uppy/aws-s3,@uppy/core,@uppy/dashboard,@uppy/store-redux,@uppy/xhr-upload: deps: use `nanoid/non-secure` to workaround react-native limitation (Antoine du Hamel / #3350) diff --git a/packages/@uppy/store-redux/LICENSE b/packages/@uppy/store-redux/LICENSE deleted file mode 100644 index c23747330..000000000 --- a/packages/@uppy/store-redux/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/packages/@uppy/store-redux/README.md b/packages/@uppy/store-redux/README.md deleted file mode 100644 index 309818bab..000000000 --- a/packages/@uppy/store-redux/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# @uppy/store-redux - -Uppy logo: a smiling puppy above a pink upwards arrow - -[![npm version](https://img.shields.io/npm/v/@uppy/store-redux.svg?style=flat-square)](https://www.npmjs.com/package/@uppy/store-redux) -![CI status for Uppy tests](https://github.com/transloadit/uppy/workflows/CI/badge.svg) -![CI status for Companion tests](https://github.com/transloadit/uppy/workflows/Companion/badge.svg) -![CI status for browser tests](https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg) - -The `ReduxStore` stores Uppy state on a key in an existing Redux store. The -`ReduxStore` dispatches `uppy/STATE_UPDATE` actions to update state. When the -state in Redux changes, it notifies Uppy. This way, you get most of the benefits -of Redux, including support for the Redux Devtools and time traveling! - -Uppy is being developed by the folks at [Transloadit](https://transloadit.com), -a versatile file encoding service. - -## Example - -```js -import Uppy from '@uppy/core' -import * as ReduxStore from '@uppy/store-redux' -import * as Redux from 'redux' - -function createStore(reducers = {}) { - const reducer = Redux.combineReducers({ - ...reducers, - uppy: ReduxStore.reducer, - }) - return Redux.createStore(reducer) -} - -const store = new ReduxStore.ReduxStore({ store: createStore() }) -const uppy = new Uppy({ store }) -``` - -## Installation - -```bash -$ npm install @uppy/store-redux -``` - -Alternatively, you can also use this plugin in a pre-built bundle from -Transloadit’s CDN: Smart CDN. 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/guides/custom-stores#reduxstore). - -## License - -[The MIT License](./LICENSE). diff --git a/packages/@uppy/store-redux/package.json b/packages/@uppy/store-redux/package.json deleted file mode 100644 index c68bdc3d1..000000000 --- a/packages/@uppy/store-redux/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@uppy/store-redux", - "description": "Make Uppy use your existing Redux store.", - "version": "4.0.2", - "license": "MIT", - "main": "lib/index.js", - "type": "module", - "keywords": [ - "file uploader", - "uppy", - "uppy-plugin", - "redux" - ], - "homepage": "https://uppy.io", - "bugs": { - "url": "https://github.com/transloadit/uppy/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/transloadit/uppy.git" - }, - "dependencies": { - "nanoid": "^5.0.9" - }, - "devDependencies": { - "jsdom": "^26.1.0", - "redux": "^4.0.0", - "vitest": "^3.2.4" - }, - "scripts": { - "build": "tsc --build tsconfig.build.json", - "typecheck": "tsc --build", - "test": "vitest run --environment=jsdom --silent='passed-only'" - } -} diff --git a/packages/@uppy/store-redux/src/index.js b/packages/@uppy/store-redux/src/index.js deleted file mode 100644 index 824fd9c55..000000000 --- a/packages/@uppy/store-redux/src/index.js +++ /dev/null @@ -1,92 +0,0 @@ -import { nanoid } from 'nanoid/non-secure' - -import packageJson from '../package.json' - -// Redux action name. -export const STATE_UPDATE = 'uppy/STATE_UPDATE' - -// Pluck Uppy state from the Redux store in the default location. -const defaultSelector = (id) => (state) => state.uppy[id] - -function getPatch(prev, next) { - const nextKeys = Object.keys(next) - const patch = {} - nextKeys.forEach((k) => { - if (prev[k] !== next[k]) patch[k] = next[k] - }) - return patch -} - -/** - * Redux store. - * - * @param {object} opts.store - The Redux store to use. - * @param {string} opts.id - This store instance's ID. Defaults to a random string. - * If you need to access Uppy state through Redux, eg. to render custom UI, set this to something constant. - * @param {Function} opts.selector - Function, `(state) => uppyState`, to pluck state from the Redux store. - * Defaults to retrieving `state.uppy[opts.id]`. Override if you placed Uppy state elsewhere in the Redux store. - */ -export class ReduxStore { - static VERSION = packageJson.version - - #id - - #selector - - #store - - constructor(opts) { - this.#store = opts.store - this.#id = opts.id || nanoid() - this.#selector = opts.selector || defaultSelector(this.#id) - - // Calling `setState` to dispatch an action to the Redux store. - // The intent is to make sure that the reducer has run once. - this.setState({}) - } - - setState(patch) { - this.#store.dispatch({ - type: STATE_UPDATE, - id: this.#id, - payload: patch, - }) - } - - getState() { - return this.#selector(this.#store.getState()) - } - - subscribe(cb) { - let prevState = this.getState() - return this.#store.subscribe(() => { - const nextState = this.getState() - if (prevState !== nextState) { - const patch = getPatch(prevState, nextState) - cb(prevState, nextState, patch) - prevState = nextState - } - }) - } - - [Symbol.for('uppy test: get id')]() { - return this.#id - } -} - -export function reducer(state = {}, action) { - if (action.type === STATE_UPDATE) { - const newState = { ...state[action.id], ...action.payload } - return { ...state, [action.id]: newState } - } - return state -} - -export function middleware() { - // Do nothing, at the moment. - return () => (next) => (action) => { - next(action) - } -} - -export default ReduxStore diff --git a/packages/@uppy/store-redux/src/index.test.js b/packages/@uppy/store-redux/src/index.test.js deleted file mode 100644 index a08705c56..000000000 --- a/packages/@uppy/store-redux/src/index.test.js +++ /dev/null @@ -1,117 +0,0 @@ -import Redux from 'redux' -import { describe, expect, it } from 'vitest' -import { ReduxStore, reducer } from './index.js' - -describe('ReduxStore', () => { - function createStore(reducers = {}) { - const combinedReducers = Redux.combineReducers({ - ...reducers, - uppy: reducer, - }) - return Redux.createStore(combinedReducers) - } - - it('can be created with named or default import', () => { - const r = createStore() - let store = new ReduxStore({ store: r }) - expect(typeof store).toBe('object') - store = new ReduxStore({ store: r }) - expect(typeof store).toBe('object') - }) - - it('merges in state using `setState`', () => { - const r = createStore() - const store = new ReduxStore({ store: r }) - expect(store.getState()).toEqual({}) - - store.setState({ - a: 1, - b: 2, - }) - expect(store.getState()).toEqual({ a: 1, b: 2 }) - - store.setState({ b: 3 }) - expect(store.getState()).toEqual({ a: 1, b: 3 }) - }) - - it('notifies subscriptions when state changes', () => { - let expected = [] - let calls = 0 - function listener(prevState, nextState, patch) { - calls++ - expect([prevState, nextState, patch]).toEqual(expected) - } - - const r = createStore() - const store = new ReduxStore({ store: r }) - store.subscribe(listener) - - expected = [{}, { a: 1, b: 2 }, { a: 1, b: 2 }] - store.setState({ - a: 1, - b: 2, - }) - - expected = [{ a: 1, b: 2 }, { a: 1, b: 3 }, { b: 3 }] - store.setState({ b: 3 }) - - expect(calls).toBe(2) - }) - - it('fires `subscribe` if state is modified externally (eg redux devtools)', () => { - const combinedReducers = Redux.combineReducers({ uppy: reducer }) - const r = Redux.createStore((state, action) => { - // Add a `SET` action that can change Uppy state without going through the Uppy reducer or action creator. - // Emulates Redux Devtools. - if (action.type === 'SET') return action.payload - return combinedReducers(state, action) - }) - - let expected = [] - let calls = 0 - function listener(prevState, nextState, patch) { - calls++ - expect([prevState, nextState, patch]).toEqual(expected) - } - - const store = new ReduxStore({ store: r }) - store.subscribe(listener) - - expected = [{}, { a: 1 }, { a: 1 }] - store.setState({ a: 1 }) - - expected = [{ a: 1 }, { b: 2 }, { b: 2 }] - // redux-devtools's `JUMP_TO_STATE` is similar to this. - r.dispatch({ - type: 'SET', - payload: { - uppy: { - [store[Symbol.for('uppy test: get id')]()]: { b: 2 }, - }, - }, - }) - - expect(calls).toBe(2) - }) - - it('can mount in a custom state key', () => { - const combinedReducers = Redux.combineReducers({ - hello: reducer, - }) - const r = Redux.createStore(combinedReducers) - const store = new ReduxStore({ - store: r, - id: 'world', - selector: (state) => state.hello.world, - }) - store.setState({ a: 1 }) - - expect(r.getState()).toEqual({ - hello: { - world: { - a: 1, - }, - }, - }) - }) -}) diff --git a/packages/@uppy/store-redux/tsconfig.build.json b/packages/@uppy/store-redux/tsconfig.build.json deleted file mode 100644 index 4565ae577..000000000 --- a/packages/@uppy/store-redux/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src", - "allowJs": true - }, - "include": ["./src/**/*.*"], - "exclude": ["./src/**/*.test.ts"] -} diff --git a/packages/@uppy/store-redux/tsconfig.json b/packages/@uppy/store-redux/tsconfig.json deleted file mode 100644 index 61a4986d8..000000000 --- a/packages/@uppy/store-redux/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "noEmit": true, - "allowJs": true - }, - "include": ["./package.json", "./src/**/*.*"] -} diff --git a/packages/@uppy/svelte/package.json b/packages/@uppy/svelte/package.json index 5803d2d38..0aa45779b 100644 --- a/packages/@uppy/svelte/package.json +++ b/packages/@uppy/svelte/package.json @@ -56,8 +56,6 @@ "peerDependencies": { "@uppy/core": "workspace:^", "@uppy/dashboard": "workspace:^", - "@uppy/drag-drop": "workspace:^", - "@uppy/progress-bar": "workspace:^", "@uppy/status-bar": "workspace:^", "svelte": "^4.0.0 || ^5.0.0" }, diff --git a/packages/@uppy/svelte/src/lib/components/DragDrop.svelte b/packages/@uppy/svelte/src/lib/components/DragDrop.svelte deleted file mode 100644 index 854ee5b08..000000000 --- a/packages/@uppy/svelte/src/lib/components/DragDrop.svelte +++ /dev/null @@ -1,43 +0,0 @@ - - -
diff --git a/packages/@uppy/svelte/src/lib/components/ProgressBar.svelte b/packages/@uppy/svelte/src/lib/components/ProgressBar.svelte deleted file mode 100644 index b43603198..000000000 --- a/packages/@uppy/svelte/src/lib/components/ProgressBar.svelte +++ /dev/null @@ -1,43 +0,0 @@ - - -
diff --git a/packages/@uppy/svelte/src/lib/index.ts b/packages/@uppy/svelte/src/lib/index.ts index aae472d90..8d5e2cb98 100644 --- a/packages/@uppy/svelte/src/lib/index.ts +++ b/packages/@uppy/svelte/src/lib/index.ts @@ -1,10 +1,8 @@ export { default as Dashboard } from "./components/Dashboard.svelte"; export { default as DashboardModal } from "./components/DashboardModal.svelte"; -export { default as DragDrop } from "./components/DragDrop.svelte"; export * from "./components/headless/generated/index.js"; // Headless components export { default as UppyContextProvider } from "./components/headless/UppyContextProvider.svelte"; -export { default as ProgressBar } from "./components/ProgressBar.svelte"; export { default as StatusBar } from "./components/StatusBar.svelte"; // Hooks diff --git a/packages/@uppy/vue/package.json b/packages/@uppy/vue/package.json index d9d45237b..e7208d057 100644 --- a/packages/@uppy/vue/package.json +++ b/packages/@uppy/vue/package.json @@ -22,9 +22,6 @@ "peerDependencies": { "@uppy/core": "workspace:^", "@uppy/dashboard": "workspace:^", - "@uppy/drag-drop": "workspace:^", - "@uppy/file-input": "workspace:^", - "@uppy/progress-bar": "workspace:^", "@uppy/status-bar": "workspace:^", "vue": ">=3.0.0" }, @@ -32,15 +29,6 @@ "@uppy/dashboard": { "optional": true }, - "@uppy/drag-drop": { - "optional": true - }, - "@uppy/file-input": { - "optional": true - }, - "@uppy/progress-bar": { - "optional": true - }, "@uppy/status-bar": { "optional": true } diff --git a/packages/@uppy/vue/src/drag-drop.ts b/packages/@uppy/vue/src/drag-drop.ts deleted file mode 100644 index 840d42c4a..000000000 --- a/packages/@uppy/vue/src/drag-drop.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Uppy } from '@uppy/core' -import DragDropPlugin, { type DragDropOptions } from '@uppy/drag-drop' -import { defineComponent, h, type PropType, ref } from 'vue' -import useUppy from './useUppy.js' - -export default defineComponent({ - name: 'DragDrop', - props: { - uppy: { - type: Uppy, - required: true, - }, - props: { - type: Object as PropType, - }, - }, - setup(props) { - const containerRef = ref() - const pluginRef = ref>() - const propsRef = ref(props.props) - const onMount = () => { - const { uppy } = props - const options = { - id: 'DragDrop', - ...props.props, - target: containerRef.value, - } - uppy.use(DragDropPlugin, options) - pluginRef.value = uppy.getPlugin(options.id) as DragDropPlugin - } - - useUppy(onMount, pluginRef, props.uppy, propsRef) - - return () => - h('div', { - ref: containerRef, - }) - }, -}) diff --git a/packages/@uppy/vue/src/file-input.ts b/packages/@uppy/vue/src/file-input.ts deleted file mode 100644 index 987bd7c1f..000000000 --- a/packages/@uppy/vue/src/file-input.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Uppy } from '@uppy/core' -import FileInputPlugin, { type FileInputOptions } from '@uppy/file-input' -import { defineComponent, h, type PropType, ref } from 'vue' -import useUppy from './useUppy.js' - -export default defineComponent({ - name: 'FileInput', - props: { - uppy: { - type: Uppy, - required: true, - }, - props: { - type: Object as PropType, - }, - }, - setup(props) { - const containerRef = ref() - const pluginRef = ref>() - const propsRef = ref(props.props) - const onMount = () => { - const { uppy } = props - const options = { - id: 'FileInput', - ...props.props, - target: containerRef.value, - } - uppy.use(FileInputPlugin, options) - pluginRef.value = uppy.getPlugin(options.id) as FileInputPlugin - } - - useUppy(onMount, pluginRef, props.uppy, propsRef) - - return () => - h('div', { - ref: containerRef, - }) - }, -}) diff --git a/packages/@uppy/vue/src/index.ts b/packages/@uppy/vue/src/index.ts index 3dcff0430..827ae4834 100644 --- a/packages/@uppy/vue/src/index.ts +++ b/packages/@uppy/vue/src/index.ts @@ -1,10 +1,7 @@ export { default as Dashboard } from './dashboard.js' export { default as DashboardModal } from './dashboard-modal.js' -export { default as DragDrop } from './drag-drop.js' -export { default as FileInput } from './file-input.js' export { UppyContextProvider } from './headless/context-provider.js' export * from './headless/generated/index.js' -export { default as ProgressBar } from './progress-bar.js' export { default as StatusBar } from './status-bar.js' export * from './useDropzone.js' diff --git a/packages/@uppy/vue/src/progress-bar.ts b/packages/@uppy/vue/src/progress-bar.ts deleted file mode 100644 index 174764aec..000000000 --- a/packages/@uppy/vue/src/progress-bar.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Uppy } from '@uppy/core' -import ProgressBarPlugin, { type ProgressBarOptions } from '@uppy/progress-bar' -import { defineComponent, h, type PropType, ref } from 'vue' -import useUppy from './useUppy.js' - -export default defineComponent({ - name: 'ProgressBar', - props: { - uppy: { - type: Uppy, - required: true, - }, - props: { - type: Object as PropType, - }, - }, - setup(props) { - const containerRef = ref() - const pluginRef = ref>() - const propsRef = ref(props.props) - const onMount = () => { - const { uppy } = props - const options = { - id: 'ProgressBar', - ...props.props, - target: containerRef.value, - } - uppy.use(ProgressBarPlugin, options) - pluginRef.value = uppy.getPlugin(options.id) as ProgressBarPlugin< - any, - any - > - } - - useUppy(onMount, pluginRef, props.uppy, propsRef) - - return () => - h('div', { - ref: containerRef, - }) - }, -}) diff --git a/packages/@uppy/vue/tsconfig.build.json b/packages/@uppy/vue/tsconfig.build.json index 25eabca76..714d752f1 100644 --- a/packages/@uppy/vue/tsconfig.build.json +++ b/packages/@uppy/vue/tsconfig.build.json @@ -16,15 +16,6 @@ { "path": "../dashboard/tsconfig.build.json" }, - { - "path": "../drag-drop/tsconfig.build.json" - }, - { - "path": "../file-input/tsconfig.build.json" - }, - { - "path": "../progress-bar/tsconfig.build.json" - }, { "path": "../status-bar/tsconfig.build.json" } diff --git a/packages/@uppy/vue/tsconfig.json b/packages/@uppy/vue/tsconfig.json index d419ebecc..b043fa3b8 100644 --- a/packages/@uppy/vue/tsconfig.json +++ b/packages/@uppy/vue/tsconfig.json @@ -15,15 +15,6 @@ { "path": "../dashboard/tsconfig.build.json" }, - { - "path": "../drag-drop/tsconfig.build.json" - }, - { - "path": "../file-input/tsconfig.build.json" - }, - { - "path": "../progress-bar/tsconfig.build.json" - }, { "path": "../status-bar/tsconfig.build.json" } diff --git a/packages/uppy/package.json b/packages/uppy/package.json index 9c6d44b95..b331e7366 100644 --- a/packages/uppy/package.json +++ b/packages/uppy/package.json @@ -38,11 +38,9 @@ "@uppy/compressor": "workspace:^", "@uppy/core": "workspace:^", "@uppy/dashboard": "workspace:^", - "@uppy/drag-drop": "workspace:^", "@uppy/drop-target": "workspace:^", "@uppy/dropbox": "workspace:^", "@uppy/facebook": "workspace:^", - "@uppy/file-input": "workspace:^", "@uppy/form": "workspace:^", "@uppy/golden-retriever": "workspace:^", "@uppy/google-drive": "workspace:^", @@ -51,14 +49,11 @@ "@uppy/image-editor": "workspace:^", "@uppy/instagram": "workspace:^", "@uppy/onedrive": "workspace:^", - "@uppy/progress-bar": "workspace:^", "@uppy/provider-views": "workspace:^", - "@uppy/redux-dev-tools": "workspace:^", "@uppy/remote-sources": "workspace:^", "@uppy/screen-capture": "workspace:^", "@uppy/status-bar": "workspace:^", "@uppy/store-default": "workspace:^", - "@uppy/store-redux": "workspace:^", "@uppy/thumbnail-generator": "workspace:^", "@uppy/transloadit": "workspace:^", "@uppy/tus": "workspace:^", diff --git a/packages/uppy/src/bundle.ts b/packages/uppy/src/bundle.ts index 2be955bc0..cafc4ab23 100644 --- a/packages/uppy/src/bundle.ts +++ b/packages/uppy/src/bundle.ts @@ -25,11 +25,9 @@ export { default as Box } from '@uppy/box' export { default as Compressor } from '@uppy/compressor' // UI plugins export { default as Dashboard } from '@uppy/dashboard' -export { default as DragDrop } from '@uppy/drag-drop' export { default as DropTarget } from '@uppy/drop-target' export { default as Dropbox } from '@uppy/dropbox' export { default as Facebook } from '@uppy/facebook' -export { default as FileInput } from '@uppy/file-input' export { default as Form } from '@uppy/form' export { default as GoldenRetriever } from '@uppy/golden-retriever' export { default as GoogleDrive } from '@uppy/google-drive' @@ -38,18 +36,11 @@ export { default as GooglePhotosPicker } from '@uppy/google-photos-picker' export { default as ImageEditor } from '@uppy/image-editor' export { default as Instagram } from '@uppy/instagram' export { default as OneDrive } from '@uppy/onedrive' -export { default as ProgressBar } from '@uppy/progress-bar' -// not yet typed -// @ts-ignore -export { default as ReduxDevTools } from '@uppy/redux-dev-tools' export { default as RemoteSources } from '@uppy/remote-sources' export { default as ScreenCapture } from '@uppy/screen-capture' export { default as StatusBar } from '@uppy/status-bar' // Stores export { default as DefaultStore } from '@uppy/store-default' -// not yet typed -// @ts-ignore -export { default as ReduxStore } from '@uppy/store-redux' export { default as ThumbnailGenerator } from '@uppy/thumbnail-generator' export { default as Transloadit } from '@uppy/transloadit' export { default as Tus } from '@uppy/tus' diff --git a/packages/uppy/src/index.ts b/packages/uppy/src/index.ts index 5f71308b2..3df867969 100644 --- a/packages/uppy/src/index.ts +++ b/packages/uppy/src/index.ts @@ -9,18 +9,15 @@ export type { CompressorOptions } from '@uppy/compressor' export type { UIPluginOptions, UppyOptions } from '@uppy/core' // UI plugins export type { DashboardOptions } from '@uppy/dashboard' -export type { DragDropOptions } from '@uppy/drag-drop' export type { DropTargetOptions } from '@uppy/drop-target' export type { DropboxOptions } from '@uppy/dropbox' export type { FacebookOptions } from '@uppy/facebook' -export type { FileInputOptions } from '@uppy/file-input' export type { FormOptions } from '@uppy/form' export type { GoldenRetrieverOptions } from '@uppy/golden-retriever' export type { GoogleDriveOptions } from '@uppy/google-drive' export type { ImageEditorOptions } from '@uppy/image-editor' export type { InstagramOptions } from '@uppy/instagram' export type { OneDriveOptions } from '@uppy/onedrive' -export type { ProgressBarOptions } from '@uppy/progress-bar' export type { RemoteSourcesOptions } from '@uppy/remote-sources' export type { ScreenCaptureOptions } from '@uppy/screen-capture' export type { StatusBarOptions } from '@uppy/status-bar' diff --git a/packages/uppy/src/style.scss b/packages/uppy/src/style.scss index f73aa7895..99e12ef20 100644 --- a/packages/uppy/src/style.scss +++ b/packages/uppy/src/style.scss @@ -1,8 +1,5 @@ @use '@uppy/core/src/style.scss' as core; @use '@uppy/dashboard/src/style.scss' as dashboard; -@use '@uppy/drag-drop/src/style.scss' as drag-drop; -@use '@uppy/file-input/src/style.scss' as file-input; -@use '@uppy/progress-bar/src/style.scss' as progress-bar; @use '@uppy/provider-views/src/style.scss' as provider-views; @use '@uppy/status-bar/src/style.scss' as status-bar; @use '@uppy/url/src/style.scss' as url; diff --git a/packages/uppy/tsconfig.build.json b/packages/uppy/tsconfig.build.json index 8558fd378..13bf1c160 100644 --- a/packages/uppy/tsconfig.build.json +++ b/packages/uppy/tsconfig.build.json @@ -28,9 +28,6 @@ { "path": "../@uppy/dashboard/tsconfig.build.json" }, - { - "path": "../@uppy/drag-drop/tsconfig.build.json" - }, { "path": "../@uppy/drop-target/tsconfig.build.json" }, @@ -40,9 +37,6 @@ { "path": "../@uppy/facebook/tsconfig.build.json" }, - { - "path": "../@uppy/file-input/tsconfig.build.json" - }, { "path": "../@uppy/form/tsconfig.build.json" }, @@ -67,9 +61,6 @@ { "path": "../@uppy/onedrive/tsconfig.build.json" }, - { - "path": "../@uppy/progress-bar/tsconfig.build.json" - }, { "path": "../@uppy/provider-views/tsconfig.build.json" }, diff --git a/packages/uppy/tsconfig.json b/packages/uppy/tsconfig.json index e3cff4f20..d28056eac 100644 --- a/packages/uppy/tsconfig.json +++ b/packages/uppy/tsconfig.json @@ -27,9 +27,6 @@ { "path": "../@uppy/dashboard/tsconfig.build.json" }, - { - "path": "../@uppy/drag-drop/tsconfig.build.json" - }, { "path": "../@uppy/drop-target/tsconfig.build.json" }, @@ -39,9 +36,6 @@ { "path": "../@uppy/facebook/tsconfig.build.json" }, - { - "path": "../@uppy/file-input/tsconfig.build.json" - }, { "path": "../@uppy/form/tsconfig.build.json" }, @@ -66,9 +60,6 @@ { "path": "../@uppy/onedrive/tsconfig.build.json" }, - { - "path": "../@uppy/progress-bar/tsconfig.build.json" - }, { "path": "../@uppy/provider-views/tsconfig.build.json" }, diff --git a/private/dev/DragDrop.js b/private/dev/DragDrop.js index 3b9b6d6e0..d6f29777f 100644 --- a/private/dev/DragDrop.js +++ b/private/dev/DragDrop.js @@ -1,7 +1,6 @@ // The @uppy/ dependencies are resolved from source import Uppy from '@uppy/core' -import DragDrop from '@uppy/drag-drop' -import ProgressBar from '@uppy/progress-bar' +import Dashboard from '@uppy/dashboard' import Tus from '@uppy/tus' // DEV CONFIG: create a .env file in the project root directory to customize those values. @@ -12,22 +11,19 @@ import.meta.env.VITE_TRANSLOADIT_SECRET &&= '***' // to avoid leaking secrets in console.log(import.meta.env) export default () => { - const uppyDragDrop = new Uppy({ + const uppyDashboard = new Uppy({ debug: true, - autoProceed: true, + autoProceed: false, }) - .use(DragDrop, { + .use(Dashboard, { target: '#uppyDragDrop', - }) - .use(ProgressBar, { - target: '#uppyDragDrop-progress', - hideAfterFinish: false, + inline: true, }) .use(Tus, { endpoint: TUS_ENDPOINT }) - window.uppy = uppyDragDrop + window.uppy = uppyDashboard - uppyDragDrop.on('complete', (result) => { + uppyDashboard.on('complete', (result) => { if (result.failed.length === 0) { console.log('Upload successful 😀') } else { diff --git a/yarn.lock b/yarn.lock index 6bb932392..c577880f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9284,26 +9284,6 @@ __metadata: languageName: node linkType: hard -"@reduxjs/toolkit@npm:^1.9.3": - version: 1.9.7 - resolution: "@reduxjs/toolkit@npm:1.9.7" - dependencies: - immer: "npm:^9.0.21" - redux: "npm:^4.2.1" - redux-thunk: "npm:^2.4.2" - reselect: "npm:^4.1.8" - peerDependencies: - react: ^16.9.0 || ^17.0.0 || ^18 - react-redux: ^7.2.1 || ^8.0.2 - peerDependenciesMeta: - react: - optional: true - react-redux: - optional: true - checksum: 10/11c718270bb378e5b26e172eb84cc549d6f263748b6f330b07ee9c366c6474b013fd410e5b2f65a5742e73b7873a3ac14e06cae4bb01480ba03b423c4fd92583 - languageName: node - linkType: hard - "@rolldown/pluginutils@npm:1.0.0-beta.19": version: 1.0.0-beta.19 resolution: "@rolldown/pluginutils@npm:1.0.0-beta.19" @@ -12313,8 +12293,6 @@ __metadata: "@angular/core": ^17.0.0 || ^18.0.0 || ^19.0.0 "@uppy/core": "workspace:^" "@uppy/dashboard": "workspace:^" - "@uppy/drag-drop": "workspace:^" - "@uppy/progress-bar": "workspace:^" "@uppy/status-bar": "workspace:^" "@uppy/utils": "workspace:^" languageName: unknown @@ -12338,16 +12316,6 @@ __metadata: languageName: unknown linkType: soft -"@uppy/aws-s3-multipart@workspace:^, @uppy/aws-s3-multipart@workspace:packages/@uppy/aws-s3-multipart": - version: 0.0.0-use.local - resolution: "@uppy/aws-s3-multipart@workspace:packages/@uppy/aws-s3-multipart" - dependencies: - "@uppy/aws-s3": "workspace:^" - "@uppy/core": "workspace:^" - typescript: "npm:^5.8.3" - languageName: unknown - linkType: soft - "@uppy/aws-s3@workspace:*, @uppy/aws-s3@workspace:^, @uppy/aws-s3@workspace:packages/@uppy/aws-s3": version: 0.0.0-use.local resolution: "@uppy/aws-s3@workspace:packages/@uppy/aws-s3" @@ -12571,22 +12539,6 @@ __metadata: languageName: unknown linkType: soft -"@uppy/drag-drop@workspace:*, @uppy/drag-drop@workspace:^, @uppy/drag-drop@workspace:packages/@uppy/drag-drop": - version: 0.0.0-use.local - resolution: "@uppy/drag-drop@workspace:packages/@uppy/drag-drop" - dependencies: - "@uppy/utils": "workspace:^" - cssnano: "npm:^7.0.7" - postcss: "npm:^8.5.6" - postcss-cli: "npm:^11.0.1" - preact: "npm:^10.5.13" - sass: "npm:^1.89.2" - typescript: "npm:^5.8.3" - peerDependencies: - "@uppy/core": "workspace:^" - languageName: unknown - linkType: soft - "@uppy/drop-target@workspace:*, @uppy/drop-target@workspace:^, @uppy/drop-target@workspace:packages/@uppy/drop-target": version: 0.0.0-use.local resolution: "@uppy/drop-target@workspace:packages/@uppy/drop-target" @@ -12632,22 +12584,6 @@ __metadata: languageName: unknown linkType: soft -"@uppy/file-input@workspace:^, @uppy/file-input@workspace:packages/@uppy/file-input": - version: 0.0.0-use.local - resolution: "@uppy/file-input@workspace:packages/@uppy/file-input" - dependencies: - "@uppy/utils": "workspace:^" - cssnano: "npm:^7.0.7" - postcss: "npm:^8.5.6" - postcss-cli: "npm:^11.0.1" - preact: "npm:^10.5.13" - sass: "npm:^1.89.2" - typescript: "npm:^5.8.3" - peerDependencies: - "@uppy/core": "workspace:^" - languageName: unknown - linkType: soft - "@uppy/form@workspace:*, @uppy/form@workspace:^, @uppy/form@workspace:packages/@uppy/form": version: 0.0.0-use.local resolution: "@uppy/form@workspace:packages/@uppy/form" @@ -12776,22 +12712,6 @@ __metadata: languageName: unknown linkType: soft -"@uppy/progress-bar@workspace:*, @uppy/progress-bar@workspace:^, @uppy/progress-bar@workspace:packages/@uppy/progress-bar": - version: 0.0.0-use.local - resolution: "@uppy/progress-bar@workspace:packages/@uppy/progress-bar" - dependencies: - "@uppy/utils": "workspace:^" - cssnano: "npm:^7.0.7" - postcss: "npm:^8.5.6" - postcss-cli: "npm:^11.0.1" - preact: "npm:^10.5.13" - sass: "npm:^1.89.2" - typescript: "npm:^5.8.3" - peerDependencies: - "@uppy/core": "workspace:^" - languageName: unknown - linkType: soft - "@uppy/provider-views@workspace:*, @uppy/provider-views@workspace:^, @uppy/provider-views@workspace:packages/@uppy/provider-views": version: 0.0.0-use.local resolution: "@uppy/provider-views@workspace:packages/@uppy/provider-views" @@ -12857,9 +12777,6 @@ __metadata: peerDependencies: "@uppy/core": "workspace:^" "@uppy/dashboard": "workspace:^" - "@uppy/drag-drop": "workspace:^" - "@uppy/file-input": "workspace:^" - "@uppy/progress-bar": "workspace:^" "@uppy/screen-capture": "workspace:^" "@uppy/status-bar": "workspace:^" "@uppy/webcam": "workspace:^" @@ -12868,12 +12785,6 @@ __metadata: peerDependenciesMeta: "@uppy/dashboard": optional: true - "@uppy/drag-drop": - optional: true - "@uppy/file-input": - optional: true - "@uppy/progress-bar": - optional: true "@uppy/screen-capture": optional: true "@uppy/status-bar": @@ -12883,14 +12794,6 @@ __metadata: languageName: unknown linkType: soft -"@uppy/redux-dev-tools@workspace:^, @uppy/redux-dev-tools@workspace:packages/@uppy/redux-dev-tools": - version: 0.0.0-use.local - resolution: "@uppy/redux-dev-tools@workspace:packages/@uppy/redux-dev-tools" - peerDependencies: - "@uppy/core": "workspace:^" - languageName: unknown - linkType: soft - "@uppy/remote-sources@workspace:*, @uppy/remote-sources@workspace:^, @uppy/remote-sources@workspace:packages/@uppy/remote-sources": version: 0.0.0-use.local resolution: "@uppy/remote-sources@workspace:packages/@uppy/remote-sources" @@ -12959,17 +12862,6 @@ __metadata: languageName: unknown linkType: soft -"@uppy/store-redux@workspace:*, @uppy/store-redux@workspace:^, @uppy/store-redux@workspace:packages/@uppy/store-redux": - version: 0.0.0-use.local - resolution: "@uppy/store-redux@workspace:packages/@uppy/store-redux" - dependencies: - jsdom: "npm:^26.1.0" - nanoid: "npm:^5.0.9" - redux: "npm:^4.0.0" - vitest: "npm:^3.2.4" - languageName: unknown - linkType: soft - "@uppy/svelte@workspace:*, @uppy/svelte@workspace:packages/@uppy/svelte": version: 0.0.0-use.local resolution: "@uppy/svelte@workspace:packages/@uppy/svelte" @@ -12989,8 +12881,6 @@ __metadata: peerDependencies: "@uppy/core": "workspace:^" "@uppy/dashboard": "workspace:^" - "@uppy/drag-drop": "workspace:^" - "@uppy/progress-bar": "workspace:^" "@uppy/status-bar": "workspace:^" svelte: ^4.0.0 || ^5.0.0 peerDependenciesMeta: @@ -13115,20 +13005,11 @@ __metadata: peerDependencies: "@uppy/core": "workspace:^" "@uppy/dashboard": "workspace:^" - "@uppy/drag-drop": "workspace:^" - "@uppy/file-input": "workspace:^" - "@uppy/progress-bar": "workspace:^" "@uppy/status-bar": "workspace:^" vue: ">=3.0.0" peerDependenciesMeta: "@uppy/dashboard": optional: true - "@uppy/drag-drop": - optional: true - "@uppy/file-input": - optional: true - "@uppy/progress-bar": - optional: true "@uppy/status-bar": optional: true languageName: unknown @@ -17227,13 +17108,6 @@ __metadata: languageName: node linkType: hard -"deep-diff@npm:^0.3.5": - version: 0.3.8 - resolution: "deep-diff@npm:0.3.8" - checksum: 10/d995680fa7913a2d5eda1f35a2676d29d97a64ac3ab56ac8b0511725eb74afc54476a2621fa5248e8b510de0e5357c30fc09efd69459346a74ad6b61fd4594d8 - languageName: node - linkType: hard - "deep-eql@npm:^5.0.1": version: 5.0.2 resolution: "deep-eql@npm:5.0.2" @@ -17738,16 +17612,13 @@ __metadata: "@parcel/transformer-vue": "npm:^2.9.3" "@uppy/audio": "workspace:^" "@uppy/aws-s3": "workspace:^" - "@uppy/aws-s3-multipart": "workspace:^" "@uppy/box": "workspace:^" "@uppy/companion-client": "workspace:^" "@uppy/core": "workspace:^" "@uppy/dashboard": "workspace:^" - "@uppy/drag-drop": "workspace:^" "@uppy/drop-target": "workspace:^" "@uppy/dropbox": "workspace:^" "@uppy/facebook": "workspace:^" - "@uppy/file-input": "workspace:^" "@uppy/form": "workspace:^" "@uppy/golden-retriever": "workspace:^" "@uppy/google-drive": "workspace:^" @@ -17756,12 +17627,10 @@ __metadata: "@uppy/image-editor": "workspace:^" "@uppy/instagram": "workspace:^" "@uppy/onedrive": "workspace:^" - "@uppy/progress-bar": "workspace:^" "@uppy/provider-views": "workspace:^" "@uppy/screen-capture": "workspace:^" "@uppy/status-bar": "workspace:^" "@uppy/store-default": "workspace:^" - "@uppy/store-redux": "workspace:^" "@uppy/thumbnail-generator": "workspace:^" "@uppy/transloadit": "workspace:^" "@uppy/tus": "workspace:^" @@ -19100,9 +18969,7 @@ __metadata: "@angular/router": "npm:^18.0.0" "@uppy/angular": "workspace:*" "@uppy/core": "workspace:*" - "@uppy/drag-drop": "workspace:*" "@uppy/google-drive": "workspace:*" - "@uppy/progress-bar": "workspace:*" "@uppy/tus": "workspace:*" "@uppy/webcam": "workspace:*" rxjs: "npm:~7.8.0" @@ -19260,21 +19127,6 @@ __metadata: languageName: unknown linkType: soft -"example-redux@workspace:examples/redux": - version: 0.0.0-use.local - resolution: "example-redux@workspace:examples/redux" - dependencies: - "@reduxjs/toolkit": "npm:^1.9.3" - "@uppy/core": "workspace:*" - "@uppy/dashboard": "workspace:*" - "@uppy/store-redux": "workspace:*" - "@uppy/tus": "workspace:*" - redux: "npm:^4.2.1" - redux-logger: "npm:^3.0.6" - vite: "npm:^5.4.17" - languageName: unknown - linkType: soft - "example-sveltekit@workspace:examples/sveltekit": version: 0.0.0-use.local resolution: "example-sveltekit@workspace:examples/sveltekit" @@ -19285,8 +19137,6 @@ __metadata: "@tailwindcss/vite": "npm:^4.0.0" "@uppy/core": "workspace:*" "@uppy/dashboard": "workspace:*" - "@uppy/drag-drop": "workspace:*" - "@uppy/progress-bar": "workspace:*" "@uppy/screen-capture": "workspace:*" "@uppy/svelte": "workspace:*" "@uppy/tus": "workspace:*" @@ -19308,7 +19158,6 @@ __metadata: "@uppy/drop-target": "workspace:*" "@uppy/form": "workspace:*" "@uppy/image-editor": "workspace:*" - "@uppy/progress-bar": "workspace:*" "@uppy/remote-sources": "workspace:*" "@uppy/transloadit": "workspace:*" "@uppy/webcam": "workspace:*" @@ -19326,8 +19175,6 @@ __metadata: "@tailwindcss/vite": "npm:^4.0.0" "@uppy/core": "workspace:*" "@uppy/dashboard": "workspace:*" - "@uppy/drag-drop": "workspace:*" - "@uppy/progress-bar": "workspace:*" "@uppy/remote-sources": "workspace:*" "@uppy/screen-capture": "workspace:*" "@uppy/tus": "workspace:*" @@ -21885,13 +21732,6 @@ __metadata: languageName: node linkType: hard -"immer@npm:^9.0.21": - version: 9.0.21 - resolution: "immer@npm:9.0.21" - checksum: 10/8455d6b4dc8abfe40f06eeec9bcc944d147c81279424c0f927a4d4905ae34e5af19ab6da60bcc700c14f51c452867d7089b3b9236f5a9a2248e39b4a09ee89de - languageName: node - linkType: hard - "immutable@npm:^4.0.0": version: 4.3.6 resolution: "immutable@npm:4.3.6" @@ -29750,33 +29590,6 @@ __metadata: languageName: node linkType: hard -"redux-logger@npm:^3.0.6": - version: 3.0.6 - resolution: "redux-logger@npm:3.0.6" - dependencies: - deep-diff: "npm:^0.3.5" - checksum: 10/bf98b53288423c345c58c1cd6b166513e173389d15ddef8ba3cb40459aa2efa309fc293407f1caebcfed0e7ab4ef21c32568e0a5153689ac6d1662eba74311a2 - languageName: node - linkType: hard - -"redux-thunk@npm:^2.4.2": - version: 2.4.2 - resolution: "redux-thunk@npm:2.4.2" - peerDependencies: - redux: ^4 - checksum: 10/9bcb1193835128ecebf1e1a1b1a37bc15e8dfbdf6b6ee1b5566dd4c8e4ca05a81175f0c6dda34ab47f87053cd13b74d9f881d59446691d7b192831852b5d7a72 - languageName: node - linkType: hard - -"redux@npm:^4.0.0, redux@npm:^4.2.1": - version: 4.2.1 - resolution: "redux@npm:4.2.1" - dependencies: - "@babel/runtime": "npm:^7.9.2" - checksum: 10/371e4833b671193303a7dea7803c8fdc8e0d566740c78f580e0a3b77b4161da25037626900a2205a5d616117fa6ad09a4232e5a110bd437186b5c6355a041750 - languageName: node - linkType: hard - "reflect-metadata@npm:^0.2.0": version: 0.2.2 resolution: "reflect-metadata@npm:0.2.2" @@ -30020,7 +29833,7 @@ __metadata: languageName: node linkType: hard -"reselect@npm:^4.0.0, reselect@npm:^4.1.8": +"reselect@npm:^4.0.0": version: 4.1.8 resolution: "reselect@npm:4.1.8" checksum: 10/199984d9872f71cd207f4aa6e6fd2bd48d95154f7aa9b3aee3398335f39f5491059e732f28c12e9031d5d434adab2c458dc8af5afb6564d0ad37e1644445e09c @@ -33651,11 +33464,9 @@ __metadata: "@uppy/compressor": "workspace:^" "@uppy/core": "workspace:^" "@uppy/dashboard": "workspace:^" - "@uppy/drag-drop": "workspace:^" "@uppy/drop-target": "workspace:^" "@uppy/dropbox": "workspace:^" "@uppy/facebook": "workspace:^" - "@uppy/file-input": "workspace:^" "@uppy/form": "workspace:^" "@uppy/golden-retriever": "workspace:^" "@uppy/google-drive": "workspace:^" @@ -33664,14 +33475,11 @@ __metadata: "@uppy/image-editor": "workspace:^" "@uppy/instagram": "workspace:^" "@uppy/onedrive": "workspace:^" - "@uppy/progress-bar": "workspace:^" "@uppy/provider-views": "workspace:^" - "@uppy/redux-dev-tools": "workspace:^" "@uppy/remote-sources": "workspace:^" "@uppy/screen-capture": "workspace:^" "@uppy/status-bar": "workspace:^" "@uppy/store-default": "workspace:^" - "@uppy/store-redux": "workspace:^" "@uppy/thumbnail-generator": "workspace:^" "@uppy/transloadit": "workspace:^" "@uppy/tus": "workspace:^"