Merge stable branch

This commit is contained in:
Antoine du Hamel 2024-07-03 00:51:17 +02:00
commit cb4e5c7f77
No known key found for this signature in database
GPG key ID: 21D900FFDB233756
6 changed files with 55 additions and 10 deletions

View file

@ -502,6 +502,25 @@ Released: 2024-03-28
- @uppy/vue: [v4.x] remove manual types (Antoine du Hamel / #4803)
- meta: prepare release workflow for beta versions (Antoine du Hamel)
## 3.27.2
Released: 2024-07-02
| Package | Version | Package | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/companion | 4.15.0 | @uppy/drag-drop | 3.1.1 |
| @uppy/companion-client | 3.8.2 | @uppy/form | 3.2.2 |
| @uppy/core | 3.13.1 | uppy | 3.27.2 |
- @uppy/form: do not emit `'submit'` event more than once (Merlijn Vos / #5299)
- @uppy/companion: add `s3.forcePathStyle` option (Nadeem Reinhardt / #5066)
- meta: fix broken workflow status badges in README (Alexander Zaytsev / #5298)
- @uppy/core: add `clearUploadedFiles` to type definition (Augustine Smith / #5295)
- @uppy/companion: add `oauthOrigin` option (Antoine du Hamel / #5297)
- meta: add dark-mode Transloadit logo in README (Alexander Zaytsev / #5291)
- docs,@uppy/drag-drop: `uppy.io/docs` - fix typos/broken links (Evgenia Karunus / #5296)
- meta: Bump docker/build-push-action from 6.1.0 to 6.2.0 (dependabot[bot] / #5290)
## 3.27.1

View file

@ -81,6 +81,14 @@ Included in: Uppy v4.0.0-beta.1
- @uppy/companion: improve error msg (Mikael Finstad / #5010)
- @uppy/companion: crash if trying to set path to / (Mikael Finstad / #5003)
## 4.15.0
Released: 2024-07-02
Included in: Uppy v3.27.2
- @uppy/companion: add `s3.forcePathStyle` option (Nadeem Reinhardt / #5066)
- @uppy/companion: add `oauthOrigin` option (Antoine du Hamel / #5297)
## 4.14.0
Released: 2024-06-18

View file

@ -68,6 +68,13 @@ Included in: Uppy v4.0.0-beta.1
- @uppy/core: various type fixes (Antoine du Hamel / #4995)
- @uppy/core,@uppy/provider-views: Fix breadcrumbs (Evgenia Karunus / #4986)
## 3.13.1
Released: 2024-07-02
Included in: Uppy v3.27.2
- @uppy/core: add `clearUploadedFiles` to type definition (Augustine Smith / #5295)
## 3.12.0
Released: 2024-06-04

View file

@ -9,6 +9,13 @@ Included in: Uppy v4.0.0-beta.1
- @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

View file

@ -14,6 +14,13 @@ Included in: Uppy v4.0.0-beta.4
- @uppy/form: fix `submitOnSuccess` and `triggerUploadOnSubmit` combination (Merlijn Vos / #5058)
## 3.2.2
Released: 2024-07-02
Included in: Uppy v3.27.2
- @uppy/form: do not emit `'submit'` event more than once (Merlijn Vos / #5299)
## 3.2.1
Released: 2024-04-29

View file

@ -52,12 +52,6 @@ export default class Form<M extends Meta, B extends Body> extends BasePlugin<
#form!: HTMLFormElement
/**
* Unfortunately Uppy isn't a state machine in which we can guarantee it's
* currently in one state and one state only so we use this completed property which is set on `upload-success'.
*/
#completed = false
constructor(uppy: Uppy<M, B>, opts?: FormOptions) {
super(uppy, { ...defaultOptions, ...opts })
this.type = 'acquirer'
@ -71,25 +65,28 @@ export default class Form<M extends Meta, B extends Body> extends BasePlugin<
}
handleUploadStart(): void {
this.#completed = false
if (this.opts.getMetaFromForm) {
this.getMetaFromForm()
}
}
handleSuccess(result: Result<M, B>): void {
this.#completed = true
if (this.opts.addResultToForm) {
this.addResultToForm(result)
}
if (this.opts.submitOnSuccess) {
this.#form.requestSubmit()
// Returns true if the element's child controls satisfy their validation constraints.
// When false is returned, cancelable invalid events are fired for each invalid child
// and validation problems are reported to the user.
if (this.#form.reportValidity()) {
this.#form.submit()
}
}
}
handleFormSubmit(ev: Event): void {
if (this.opts.triggerUploadOnSubmit && !this.#completed) {
if (this.opts.triggerUploadOnSubmit) {
ev.preventDefault()
const elements = toArray((ev.target as HTMLFormElement).elements)
const disabledByUppy: HTMLButtonElement[] = []