@vaadin/upload 25.1.0-alpha7 → 25.1.0-alpha8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1487,7 +1487,7 @@
1487
1487
  "type": {
1488
1488
  "text": "object"
1489
1489
  },
1490
- "default": "{ dropFiles: { one: 'Drop file here', many: 'Drop files here', }, addFiles: { one: 'Upload File...', many: 'Upload Files...', }, error: { tooManyFiles: 'Too Many Files.', fileIsTooBig: 'File is Too Big.', incorrectFileType: 'Incorrect File Type.', }, uploading: { status: { connecting: 'Connecting...', stalled: 'Stalled', processing: 'Processing File...', held: 'Queued', }, remainingTime: { prefix: 'remaining time: ', unknown: 'unknown remaining time', }, error: { serverUnavailable: 'Upload failed, please try again later', unexpectedServerError: 'Upload failed due to server error', forbidden: 'Upload forbidden', }, }, file: { retry: 'Retry', start: 'Start', remove: 'Remove', }, units: { size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], }, }"
1490
+ "default": "{ dropFiles: { one: 'Drop file here', many: 'Drop files here', }, addFiles: { one: 'Upload File...', many: 'Upload Files...', }, error: { tooManyFiles: 'Too Many Files.', fileIsTooBig: 'File is Too Big.', incorrectFileType: 'Incorrect File Type.', }, uploading: { status: { connecting: 'Connecting...', stalled: 'Stalled', processing: 'Processing File...', held: 'Queued', }, remainingTime: { prefix: 'remaining time: ', unknown: 'unknown remaining time', }, error: { serverUnavailable: 'Upload failed, please try again later', unexpectedServerError: 'Upload failed due to server error', forbidden: 'Upload forbidden', fileTooLarge: 'File is too large', }, }, file: { retry: 'Retry', start: 'Start', remove: 'Remove', }, units: { size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], }, }"
1491
1491
  },
1492
1492
  {
1493
1493
  "kind": "mixin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/upload",
3
- "version": "25.1.0-alpha7",
3
+ "version": "25.1.0-alpha8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,19 +35,19 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.1.0-alpha7",
39
- "@vaadin/button": "25.1.0-alpha7",
40
- "@vaadin/component-base": "25.1.0-alpha7",
41
- "@vaadin/progress-bar": "25.1.0-alpha7",
42
- "@vaadin/vaadin-themable-mixin": "25.1.0-alpha7",
38
+ "@vaadin/a11y-base": "25.1.0-alpha8",
39
+ "@vaadin/button": "25.1.0-alpha8",
40
+ "@vaadin/component-base": "25.1.0-alpha8",
41
+ "@vaadin/progress-bar": "25.1.0-alpha8",
42
+ "@vaadin/vaadin-themable-mixin": "25.1.0-alpha8",
43
43
  "lit": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/aura": "25.1.0-alpha7",
47
- "@vaadin/chai-plugins": "25.1.0-alpha7",
48
- "@vaadin/test-runner-commands": "25.1.0-alpha7",
46
+ "@vaadin/aura": "25.1.0-alpha8",
47
+ "@vaadin/chai-plugins": "25.1.0-alpha8",
48
+ "@vaadin/test-runner-commands": "25.1.0-alpha8",
49
49
  "@vaadin/testing-helpers": "^2.0.0",
50
- "@vaadin/vaadin-lumo-styles": "25.1.0-alpha7",
50
+ "@vaadin/vaadin-lumo-styles": "25.1.0-alpha8",
51
51
  "sinon": "^21.0.0"
52
52
  },
53
53
  "customElements": "custom-elements.json",
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "98c586125f769c8fefd307536965293668fda81d"
58
+ "gitHead": "810590c9c7682a9326c9352df795b5ea4891a71f"
59
59
  }
@@ -193,7 +193,7 @@ class UploadDropZone extends ElementMixin(ThemableMixin(PolylitMixin(LumoInjecti
193
193
  event.preventDefault();
194
194
  // Only remove dragover if we're actually leaving the drop zone
195
195
  // (not just entering a child element)
196
- if (event.relatedTarget && this.contains(event.relatedTarget)) {
196
+ if (event.target !== this) {
197
197
  return;
198
198
  }
199
199
  this.__dragover = false;
@@ -34,6 +34,7 @@ const DEFAULT_I18N = {
34
34
  serverUnavailable: 'Upload failed, please try again later',
35
35
  unexpectedServerError: 'Upload failed due to server error',
36
36
  forbidden: 'Upload forbidden',
37
+ fileTooLarge: 'File is too large',
37
38
  },
38
39
  },
39
40
  units: {
@@ -9,7 +9,13 @@ export type UploadFormat = 'raw' | 'multipart';
9
9
 
10
10
  export type FileRejectError = 'tooManyFiles' | 'fileIsTooBig' | 'incorrectFileType';
11
11
 
12
- export type UploadErrorKey = 'timeout' | 'serverUnavailable' | 'unexpectedServerError' | 'forbidden' | 'sendFailed';
12
+ export type UploadErrorKey =
13
+ | 'timeout'
14
+ | 'serverUnavailable'
15
+ | 'unexpectedServerError'
16
+ | 'forbidden'
17
+ | 'sendFailed'
18
+ | 'fileTooLarge';
13
19
 
14
20
  export interface UploadFile extends File {
15
21
  uploadTarget: string;
@@ -544,6 +544,8 @@ export class UploadManager extends EventTarget {
544
544
  file.errorKey = 'serverUnavailable';
545
545
  } else if (xhr.status >= 500) {
546
546
  file.errorKey = 'unexpectedServerError';
547
+ } else if (xhr.status === 413) {
548
+ file.errorKey = 'fileTooLarge';
547
549
  } else if (xhr.status >= 400) {
548
550
  file.errorKey = 'forbidden';
549
551
  }
@@ -54,6 +54,7 @@ export interface UploadI18n {
54
54
  serverUnavailable?: string;
55
55
  unexpectedServerError?: string;
56
56
  forbidden?: string;
57
+ fileTooLarge?: string;
57
58
  };
58
59
  };
59
60
  units?: {
@@ -39,6 +39,7 @@ export const DEFAULT_I18N = {
39
39
  serverUnavailable: 'Upload failed, please try again later',
40
40
  unexpectedServerError: 'Upload failed due to server error',
41
41
  forbidden: 'Upload forbidden',
42
+ fileTooLarge: 'File is too large',
42
43
  },
43
44
  },
44
45
  file: {
@@ -795,6 +796,8 @@ export const UploadMixin = (superClass) =>
795
796
  file.error = this.__effectiveI18n.uploading.error.serverUnavailable;
796
797
  } else if (xhr.status >= 500) {
797
798
  file.error = this.__effectiveI18n.uploading.error.unexpectedServerError;
799
+ } else if (xhr.status === 413) {
800
+ file.error = this.__effectiveI18n.uploading.error.fileTooLarge;
798
801
  } else if (xhr.status >= 400) {
799
802
  file.error = this.__effectiveI18n.uploading.error.forbidden;
800
803
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/upload",
4
- "version": "25.1.0-alpha7",
4
+ "version": "25.1.0-alpha8",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/upload",
4
- "version": "25.1.0-alpha7",
4
+ "version": "25.1.0-alpha8",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {