mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
@uppy: upgrade biome and more improvements (#6244)
- This PR upgrades `biome` from `2.0.5` -> `2.1.2` and adds two new rules - [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-private-class-members) ( we already had suppressions for this rule in code, but the rule itself was never enabled in the config ) - [noUnusedPrivateClassMembers](https://biomejs.dev/linter/rules/no-unused-private-class-members/) - remove stale suppressions. - remove stale code. --------- Co-authored-by: Mikael Finstad <finstaden@gmail.com>
This commit is contained in:
parent
9143d41bc2
commit
5519b84409
111 changed files with 432 additions and 449 deletions
80
biome.json
80
biome.json
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"clientKind": "git",
|
"clientKind": "git",
|
||||||
|
|
@ -14,10 +14,11 @@
|
||||||
"bin/**",
|
"bin/**",
|
||||||
"e2e/**",
|
"e2e/**",
|
||||||
"private/**",
|
"private/**",
|
||||||
"!packages/**/{dist,lib}/**",
|
"!packages/**/{dist,lib}",
|
||||||
"!node_modules",
|
"!node_modules",
|
||||||
"!.svelte-kit",
|
"!.svelte-kit",
|
||||||
"!packages/@uppy/components/src/input.css"
|
"!packages/@uppy/components/src/input.css",
|
||||||
|
"!examples/angular/**/*.html"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
|
|
@ -25,20 +26,11 @@
|
||||||
"indentStyle": "space",
|
"indentStyle": "space",
|
||||||
"formatWithErrors": true
|
"formatWithErrors": true
|
||||||
},
|
},
|
||||||
|
"html": {
|
||||||
|
"experimentalFullSupportEnabled": true
|
||||||
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"includes": [
|
|
||||||
"packages/**",
|
|
||||||
"examples/**",
|
|
||||||
"scripts/**",
|
|
||||||
"private/**",
|
|
||||||
"!packages/**/{dist,lib}/**",
|
|
||||||
"!node_modules",
|
|
||||||
"!.svelte-kit",
|
|
||||||
"!packages/@uppy/components/src/input.css",
|
|
||||||
"!**/*.vue",
|
|
||||||
"!**/*.svelte"
|
|
||||||
],
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true,
|
"recommended": true,
|
||||||
"suspicious": {
|
"suspicious": {
|
||||||
|
|
@ -48,37 +40,26 @@
|
||||||
"useExhaustiveDependencies": "error",
|
"useExhaustiveDependencies": "error",
|
||||||
"useHookAtTopLevel": "error",
|
"useHookAtTopLevel": "error",
|
||||||
"noUnusedFunctionParameters": "off",
|
"noUnusedFunctionParameters": "off",
|
||||||
|
"noUnusedImports": "error",
|
||||||
|
"noUnusedPrivateClassMembers": "error",
|
||||||
"noUnusedVariables": {
|
"noUnusedVariables": {
|
||||||
"level": "error",
|
"level": "error",
|
||||||
"options": {
|
"options": {
|
||||||
"ignoreRestSiblings": true
|
"ignoreRestSiblings": true
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"noNestedComponentDefinitions": "error",
|
||||||
|
"noReactPropAssignments": "error"
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"noNonNullAssertion": "off"
|
"noNonNullAssertion": "off"
|
||||||
},
|
},
|
||||||
"a11y": {
|
"a11y": {
|
||||||
"noSvgWithoutTitle": "off"
|
"noSvgWithoutTitle": "off",
|
||||||
},
|
"useSemanticElements": "off"
|
||||||
"nursery": {
|
|
||||||
"noNestedComponentDefinitions": "error",
|
|
||||||
"noReactPropAssign": "error"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"includes": ["packages/@uppy/companion/**"],
|
|
||||||
"linter": {
|
|
||||||
"rules": {
|
|
||||||
"complexity": {
|
|
||||||
"useLiteralKeys": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"javascript": {
|
"javascript": {
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"quoteStyle": "single",
|
"quoteStyle": "single",
|
||||||
|
|
@ -92,5 +73,36 @@
|
||||||
"organizeImports": "on"
|
"organizeImports": "on"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"includes": ["packages/@uppy/companion/**"],
|
||||||
|
"linter": {
|
||||||
|
"rules": {
|
||||||
|
"complexity": {
|
||||||
|
"useLiteralKeys": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"includes": ["**/*.vue", "**/*.svelte", "packages/@uppy/vue/**/*.ts"],
|
||||||
|
"linter": {
|
||||||
|
"rules": {
|
||||||
|
"correctness": {
|
||||||
|
"useHookAtTopLevel": "off",
|
||||||
|
"useExhaustiveDependencies": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"includes": ["examples/nextjs/**/*.css"],
|
||||||
|
"css": {
|
||||||
|
"parser": {
|
||||||
|
"tailwindDirectives": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Uppy – AWS upload example</title>
|
<title>Uppy – AWS upload example</title>
|
||||||
|
|
@ -24,7 +24,8 @@
|
||||||
</footer>
|
</footer>
|
||||||
<noscript>You need JavaScript to run this example.</noscript>
|
<noscript>You need JavaScript to run this example.</noscript>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import { Uppy, Dashboard, AwsS3 } from './uppy.min.mjs'
|
import { AwsS3, Dashboard, Uppy } from './uppy.min.mjs'
|
||||||
|
|
||||||
function onUploadComplete(result) {
|
function onUploadComplete(result) {
|
||||||
console.log(
|
console.log(
|
||||||
'Upload complete! We’ve uploaded these files:',
|
'Upload complete! We’ve uploaded these files:',
|
||||||
|
|
@ -34,7 +35,7 @@
|
||||||
function onUploadSuccess(file, data) {
|
function onUploadSuccess(file, data) {
|
||||||
console.log(
|
console.log(
|
||||||
'Upload success! We’ve uploaded this file:',
|
'Upload success! We’ve uploaded this file:',
|
||||||
file.meta['name'],
|
file.meta.name,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Uppy – AWS upload example</title>
|
<title>Uppy – AWS upload example</title>
|
||||||
|
|
@ -16,7 +16,8 @@
|
||||||
</footer>
|
</footer>
|
||||||
<noscript>You need JavaScript to run this example.</noscript>
|
<noscript>You need JavaScript to run this example.</noscript>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import { Uppy, Dashboard, AwsS3 } from './uppy.min.mjs'
|
import { AwsS3, Dashboard, Uppy } from './uppy.min.mjs'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This generator transforms a deep object into URL-encodable pairs
|
* This generator transforms a deep object into URL-encodable pairs
|
||||||
* to work with `URLSearchParams` on the client and `body-parser` on the server.
|
* to work with `URLSearchParams` on the client and `body-parser` on the server.
|
||||||
|
|
@ -258,7 +259,7 @@
|
||||||
uppy.on('upload-success', (file, data) => {
|
uppy.on('upload-success', (file, data) => {
|
||||||
console.log(
|
console.log(
|
||||||
'Upload success! We’ve uploaded this file:',
|
'Upload success! We’ve uploaded this file:',
|
||||||
file.meta['name'],
|
file.meta.name,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need JavaScript enabled for this example to work.</noscript>
|
<noscript>You need JavaScript enabled for this example to work.</noscript>
|
||||||
<button id="uppyModalOpener">Open Modal</button>
|
<button type="button" id="uppyModalOpener">Open Modal</button>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import {
|
import {
|
||||||
Uppy,
|
|
||||||
Dashboard,
|
Dashboard,
|
||||||
Webcam,
|
|
||||||
Tus,
|
Tus,
|
||||||
|
Uppy,
|
||||||
|
Webcam,
|
||||||
} from 'https://releases.transloadit.com/uppy/v4.18.0/uppy.min.mjs'
|
} from 'https://releases.transloadit.com/uppy/v4.18.0/uppy.min.mjs'
|
||||||
|
|
||||||
const uppy = new Uppy({ debug: true, autoProceed: false })
|
const uppy = new Uppy({ debug: true, autoProceed: false })
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@
|
||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<button id="uppyModalOpener">Open Modal</button>
|
<button type="button" id="uppyModalOpener">Open Modal</button>
|
||||||
<noscript>This web page requires JavaScript to work properly.</noscript>
|
<noscript>This web page requires JavaScript to work properly.</noscript>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import {
|
import {
|
||||||
Uppy,
|
|
||||||
Dashboard,
|
Dashboard,
|
||||||
GoogleDrive,
|
GoogleDrive,
|
||||||
Tus,
|
Tus,
|
||||||
|
Uppy,
|
||||||
} from 'https://releases.transloadit.com/uppy/v4.18.0/uppy.min.mjs'
|
} from 'https://releases.transloadit.com/uppy/v4.18.0/uppy.min.mjs'
|
||||||
|
|
||||||
const uppy = new Uppy({ debug: true, autoProceed: false })
|
const uppy = new Uppy({ debug: true, autoProceed: false })
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/** biome-ignore-all lint/nursery/useUniqueElementIds: it's fine */
|
/** biome-ignore-all lint/correctness/useUniqueElementIds: it's fine */
|
||||||
import Uppy, { type UppyFile } from '@uppy/core'
|
import Uppy, { type UppyFile } from '@uppy/core'
|
||||||
import UppyImageEditor from '@uppy/image-editor'
|
import UppyImageEditor from '@uppy/image-editor'
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const { getButtonProps, getInputProps: getFileInputProps } = useFileInput()
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-center gap-4">
|
<div class="flex items-center justify-center gap-4">
|
||||||
<input {...getFileInputProps()} class="hidden" />
|
<input {...getFileInputProps()} class="hidden" />
|
||||||
<button
|
<button type="button"
|
||||||
{...getButtonProps()}
|
{...getButtonProps()}
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
@ -30,7 +30,7 @@ const { getButtonProps, getInputProps: getFileInputProps } = useFileInput()
|
||||||
Device
|
Device
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button type="button"
|
||||||
onclick={() => openModal('webcam')}
|
onclick={() => openModal('webcam')}
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
@ -40,7 +40,7 @@ const { getButtonProps, getInputProps: getFileInputProps } = useFileInput()
|
||||||
Webcam
|
Webcam
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button type="button"
|
||||||
onclick={() => openModal('screen-capture')}
|
onclick={() => openModal('screen-capture')}
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
@ -50,7 +50,7 @@ const { getButtonProps, getInputProps: getFileInputProps } = useFileInput()
|
||||||
Screen Capture
|
Screen Capture
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button type="button"
|
||||||
onclick={() => openModal('dropbox')}
|
onclick={() => openModal('dropbox')}
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ const editor = useImageEditor({ file })
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
<!-- biome-ignore lint/a11y/useAltText: alt is provided via editor.getImageProps() spread -->
|
||||||
<img
|
<img
|
||||||
class="w-full max-h-[400px] rounded-lg border-2"
|
class="w-full max-h-[400px] rounded-lg border-2"
|
||||||
{...editor.getImageProps()}
|
{...editor.getImageProps()}
|
||||||
|
|
@ -41,31 +42,31 @@ const editor = useImageEditor({ file })
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-2 flex-wrap mb-4">
|
<div class="flex gap-2 flex-wrap mb-4">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getRotateButtonProps(-90)}
|
{...editor.getRotateButtonProps(-90)}
|
||||||
>
|
>
|
||||||
↶ -90°
|
↶ -90°
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getRotateButtonProps(90)}
|
{...editor.getRotateButtonProps(90)}
|
||||||
>
|
>
|
||||||
↷ +90°
|
↷ +90°
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getFlipHorizontalButtonProps()}
|
{...editor.getFlipHorizontalButtonProps()}
|
||||||
>
|
>
|
||||||
⇆ Flip
|
⇆ Flip
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getZoomButtonProps(0.1)}
|
{...editor.getZoomButtonProps(0.1)}
|
||||||
>
|
>
|
||||||
+ Zoom
|
+ Zoom
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getZoomButtonProps(-0.1)}
|
{...editor.getZoomButtonProps(-0.1)}
|
||||||
>
|
>
|
||||||
|
|
@ -74,25 +75,25 @@ const editor = useImageEditor({ file })
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-2 flex-wrap mb-4">
|
<div class="flex gap-2 flex-wrap mb-4">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getCropSquareButtonProps()}
|
{...editor.getCropSquareButtonProps()}
|
||||||
>
|
>
|
||||||
1:1
|
1:1
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getCropLandscapeButtonProps()}
|
{...editor.getCropLandscapeButtonProps()}
|
||||||
>
|
>
|
||||||
16:9
|
16:9
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getCropPortraitButtonProps()}
|
{...editor.getCropPortraitButtonProps()}
|
||||||
>
|
>
|
||||||
9:16
|
9:16
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
{...editor.getResetButtonProps()}
|
{...editor.getResetButtonProps()}
|
||||||
>
|
>
|
||||||
|
|
@ -101,13 +102,13 @@ const editor = useImageEditor({ file })
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-4 justify-end">
|
<div class="flex gap-4 justify-end">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-500 text-white px-4 py-2 rounded-md"
|
class="bg-gray-500 text-white px-4 py-2 rounded-md"
|
||||||
{...editor.getCancelButtonProps({ onClick: close })}
|
{...editor.getCancelButtonProps({ onClick: close })}
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
||||||
{...editor.getSaveButtonProps({ onClick: close })}
|
{...editor.getSaveButtonProps({ onClick: close })}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -42,36 +42,37 @@ const {
|
||||||
<p>{mediaError.message ? `Camera error: ${mediaError.message}` : 'An unknown camera error occurred.'}</p>
|
<p>{mediaError.message ? `Camera error: ${mediaError.message}` : 'An unknown camera error occurred.'}</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
<!-- biome-ignore lint/a11y/useMediaCaption: live camera preview does not require captions -->
|
||||||
<video
|
<video
|
||||||
class="border-2 w-full rounded-lg data-[uppy-mirrored=true]:scale-x-[-1]"
|
class="border-2 w-full rounded-lg data-[uppy-mirrored=true]:scale-x-[-1]"
|
||||||
{...videoProps}
|
{...videoProps}
|
||||||
></video>
|
></video>
|
||||||
<div class="flex gap-4 flex-wrap mt-4">
|
<div class="flex gap-4 flex-wrap mt-4">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
||||||
{...primaryActionButtonProps}
|
{...primaryActionButtonProps}
|
||||||
>
|
>
|
||||||
{primaryActionButtonLabel}
|
{primaryActionButtonLabel}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
||||||
{...recordButtonProps}
|
{...recordButtonProps}
|
||||||
>
|
>
|
||||||
Record
|
Record
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-red-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-red-300"
|
class="bg-red-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-red-300"
|
||||||
{...stopRecordingButtonProps}
|
{...stopRecordingButtonProps}
|
||||||
>
|
>
|
||||||
Stop
|
Stop
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
||||||
{...submitButtonProps}
|
{...submitButtonProps}
|
||||||
>
|
>
|
||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-gray-300"
|
class="bg-gray-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-gray-300"
|
||||||
{...discardButtonProps}
|
{...discardButtonProps}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ const dtf = new Intl.DateTimeFormat('en-US', {
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// biome-ignore lint/correctness/noUnusedVariables: used as a Svelte action via use:setFolderCheckboxIndeterminate
|
||||||
function setFolderCheckboxIndeterminate(
|
function setFolderCheckboxIndeterminate(
|
||||||
node: HTMLInputElement,
|
node: HTMLInputElement,
|
||||||
item: PartialTreeFolderNode,
|
item: PartialTreeFolderNode,
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ let hideUploadButton = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="p-5 max-w-xl mx-auto">
|
<main class="p-5 max-w-xl mx-auto">
|
||||||
<button onclick={() => (disabled = !disabled)}>Toggle dashboard</button>
|
<button type="button" onclick={() => (disabled = !disabled)}>Toggle dashboard</button>
|
||||||
<Dashboard props={{disabled: disabled}} uppy={uppy} />
|
<Dashboard props={{disabled: disabled}} uppy={uppy} />
|
||||||
<button onclick={() => (hideUploadButton = !hideUploadButton)}>Toggle statusbar</button>
|
<button type="button" onclick={() => (hideUploadButton = !hideUploadButton)}>Toggle statusbar</button>
|
||||||
<div id="statusbar-container">
|
<div id="statusbar-container">
|
||||||
<StatusBar props={{ hideUploadButton }} uppy={uppy} />
|
<StatusBar props={{ hideUploadButton }} uppy={uppy} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
This API is a one-shot upload UI using a modal overlay. Call the
|
This API is a one-shot upload UI using a modal overlay. Call the
|
||||||
function and receive a listen to an event with upload results ✌️
|
function and receive a listen to an event with upload results ✌️
|
||||||
</p>
|
</p>
|
||||||
<button onclick="openModal()">Open</button>
|
<button type="button" onclick="openModal()">Open</button>
|
||||||
|
|
||||||
<h2>uppy.upload()</h2>
|
<h2>uppy.upload()</h2>
|
||||||
<p>An <input type=file> backed by <code>uppy.upload()</code>:</p>
|
<p>An <input type=file> backed by <code>uppy.upload()</code>:</p>
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ function Footer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function FormFields(fields) {
|
function FormFields(fields) {
|
||||||
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
|
// biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component
|
||||||
function Field([name, value]) {
|
function Field([name, value]) {
|
||||||
if (name === 'transloadit') return ''
|
if (name === 'transloadit') return ''
|
||||||
let isValueJSON = false
|
let isValueJSON = false
|
||||||
|
|
@ -76,7 +76,7 @@ function FormFields(fields) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function UploadsList(uploads) {
|
function UploadsList(uploads) {
|
||||||
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
|
// biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component
|
||||||
function Upload(upload) {
|
function Upload(upload) {
|
||||||
return `<li>${e(upload.name)}</li>`
|
return `<li>${e(upload.name)}</li>`
|
||||||
}
|
}
|
||||||
|
|
@ -89,12 +89,12 @@ function UploadsList(uploads) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ResultsList(results) {
|
function ResultsList(results) {
|
||||||
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
|
// biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component
|
||||||
function Result(result) {
|
function Result(result) {
|
||||||
return `<li>${e(result.name)} <a href="${result.ssl_url}" target="_blank">View</a></li>`
|
return `<li>${e(result.name)} <a href="${result.ssl_url}" target="_blank">View</a></li>`
|
||||||
}
|
}
|
||||||
|
|
||||||
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
|
// biome-ignore lint/correctness/noNestedComponentDefinitions: not a react component
|
||||||
function ResultsSection(stepName) {
|
function ResultsSection(stepName) {
|
||||||
return `
|
return `
|
||||||
<h2>${e(stepName)}</h2>
|
<h2>${e(stepName)}</h2>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-center gap-4">
|
<div class="flex items-center justify-center gap-4">
|
||||||
<input v-bind="getFileInputProps()" class="hidden" />
|
<input v-bind="getFileInputProps()" class="hidden" />
|
||||||
<button
|
<button type="button"
|
||||||
v-bind="getButtonProps()"
|
v-bind="getButtonProps()"
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
Device
|
Device
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button type="button"
|
||||||
@click="() => props.openModal('webcam')"
|
@click="() => props.openModal('webcam')"
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
Webcam
|
Webcam
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button type="button"
|
||||||
@click="() => props.openModal('screen-capture')"
|
@click="() => props.openModal('screen-capture')"
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
Screen Capture
|
Screen Capture
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button type="button"
|
||||||
@click="() => props.openModal('dropbox')"
|
@click="() => props.openModal('dropbox')"
|
||||||
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
class="hover:bg-gray-100 transition-colors p-2 rounded-md flex flex-col items-center gap-2 text-sm"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
<!-- biome-ignore lint/a11y/useAltText: alt is provided via editor.getImageProps() spread -->
|
||||||
<img
|
<img
|
||||||
class="w-full max-h-[400px] rounded-lg border-2"
|
class="w-full max-h-[400px] rounded-lg border-2"
|
||||||
v-bind="editor.getImageProps()"
|
v-bind="editor.getImageProps()"
|
||||||
|
|
@ -29,31 +30,31 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-2 flex-wrap mb-4">
|
<div class="flex gap-2 flex-wrap mb-4">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getRotateButtonProps(-90)"
|
v-bind="editor.getRotateButtonProps(-90)"
|
||||||
>
|
>
|
||||||
↶ -90°
|
↶ -90°
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getRotateButtonProps(90)"
|
v-bind="editor.getRotateButtonProps(90)"
|
||||||
>
|
>
|
||||||
↷ +90°
|
↷ +90°
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getFlipHorizontalButtonProps()"
|
v-bind="editor.getFlipHorizontalButtonProps()"
|
||||||
>
|
>
|
||||||
⇆ Flip
|
⇆ Flip
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getZoomButtonProps(0.1)"
|
v-bind="editor.getZoomButtonProps(0.1)"
|
||||||
>
|
>
|
||||||
+ Zoom
|
+ Zoom
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getZoomButtonProps(-0.1)"
|
v-bind="editor.getZoomButtonProps(-0.1)"
|
||||||
>
|
>
|
||||||
|
|
@ -62,25 +63,25 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-2 flex-wrap mb-4">
|
<div class="flex gap-2 flex-wrap mb-4">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getCropSquareButtonProps()"
|
v-bind="editor.getCropSquareButtonProps()"
|
||||||
>
|
>
|
||||||
1:1
|
1:1
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getCropLandscapeButtonProps()"
|
v-bind="editor.getCropLandscapeButtonProps()"
|
||||||
>
|
>
|
||||||
16:9
|
16:9
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getCropPortraitButtonProps()"
|
v-bind="editor.getCropPortraitButtonProps()"
|
||||||
>
|
>
|
||||||
9:16
|
9:16
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
class="bg-gray-200 px-3 py-1 rounded disabled:opacity-50"
|
||||||
v-bind="editor.getResetButtonProps()"
|
v-bind="editor.getResetButtonProps()"
|
||||||
>
|
>
|
||||||
|
|
@ -89,13 +90,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-4 justify-end">
|
<div class="flex gap-4 justify-end">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-500 text-white px-4 py-2 rounded-md"
|
class="bg-gray-500 text-white px-4 py-2 rounded-md"
|
||||||
v-bind="editor.getCancelButtonProps({ onClick: close })"
|
v-bind="editor.getCancelButtonProps({ onClick: close })"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
||||||
v-bind="editor.getSaveButtonProps({ onClick: close })"
|
v-bind="editor.getSaveButtonProps({ onClick: close })"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -24,31 +24,31 @@
|
||||||
<track kind="captions" />
|
<track kind="captions" />
|
||||||
</video>
|
</video>
|
||||||
<div class="flex gap-4 flex-wrap mt-4">
|
<div class="flex gap-4 flex-wrap mt-4">
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
||||||
v-bind="primaryActionButtonProps"
|
v-bind="primaryActionButtonProps"
|
||||||
>
|
>
|
||||||
{{ primaryActionButtonLabel }}
|
{{ primaryActionButtonLabel }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
class="bg-blue-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-blue-300"
|
||||||
v-bind="recordButtonProps"
|
v-bind="recordButtonProps"
|
||||||
>
|
>
|
||||||
Record
|
Record
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-red-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-red-300"
|
class="bg-red-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-red-300"
|
||||||
v-bind="stopRecordingButtonProps"
|
v-bind="stopRecordingButtonProps"
|
||||||
>
|
>
|
||||||
Stop
|
Stop
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
class="bg-green-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-green-300"
|
||||||
v-bind="submitButtonProps"
|
v-bind="submitButtonProps"
|
||||||
>
|
>
|
||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
class="bg-gray-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-gray-300"
|
class="bg-gray-500 text-white px-4 py-2 rounded-md disabled:opacity-50 disabled:bg-gray-300"
|
||||||
v-bind="discardButtonProps"
|
v-bind="discardButtonProps"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
"release": "changeset publish"
|
"release": "changeset publish"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.0.5",
|
"@biomejs/biome": "2.4.15",
|
||||||
"@changesets/changelog-github": "^0.5.1",
|
"@changesets/changelog-github": "^0.5.1",
|
||||||
"@changesets/cli": "patch:@changesets/cli@npm%3A2.29.5#~/.yarn/patches/@changesets-cli-npm-2.29.5-68d8030bf3.patch",
|
"@changesets/cli": "patch:@changesets/cli@npm%3A2.29.5#~/.yarn/patches/@changesets-cli-npm-2.29.5-68d8030bf3.patch",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,9 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
|
||||||
#stop = async () => {
|
#stop = async () => {
|
||||||
if (this.#stream) {
|
if (this.#stream) {
|
||||||
const audioTracks = this.#stream.getAudioTracks()
|
const audioTracks = this.#stream.getAudioTracks()
|
||||||
audioTracks.forEach((track) => track.stop())
|
audioTracks.forEach((track) => {
|
||||||
|
track.stop()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.#recorder) {
|
if (this.#recorder) {
|
||||||
|
|
|
||||||
|
|
@ -263,9 +263,9 @@ export class HTTPCommunicationQueue<M extends Meta, B extends Body> {
|
||||||
const data = chunk.getData()
|
const data = chunk.getData()
|
||||||
if (method.toUpperCase() === 'POST') {
|
if (method.toUpperCase() === 'POST') {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
Object.entries(fields!).forEach(([key, value]) =>
|
Object.entries(fields!).forEach(([key, value]) => {
|
||||||
formData.set(key, value),
|
formData.set(key, value)
|
||||||
)
|
})
|
||||||
formData.set('file', data)
|
formData.set('file', data)
|
||||||
body = formData
|
body = formData
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,7 @@ class MultipartUploader<M extends Meta, B extends Body> {
|
||||||
else this.pause()
|
else this.pause()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via Symbol in tests
|
||||||
private [Symbol.for('uppy test: getChunkState')]() {
|
private [Symbol.for('uppy test: getChunkState')]() {
|
||||||
return this.#chunkState
|
return this.#chunkState
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,5 +110,7 @@ try {
|
||||||
await Promise.all(companions)
|
await Promise.all(companions)
|
||||||
} finally {
|
} finally {
|
||||||
loadBalancer?.close()
|
loadBalancer?.close()
|
||||||
companions.forEach((companion) => companion.kill())
|
companions.forEach((companion) => {
|
||||||
|
companion.kill()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -806,9 +806,9 @@ export default class Uploader {
|
||||||
if (this.options.useFormData) {
|
if (this.options.useFormData) {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
|
|
||||||
Object.entries(this.metadata).forEach(([key, value]) =>
|
Object.entries(this.metadata).forEach(([key, value]) => {
|
||||||
formData.append(key, value),
|
formData.append(key, value)
|
||||||
)
|
})
|
||||||
|
|
||||||
// see https://github.com/octet-stream/form-data/blob/73a5a24e635938026538673f94cbae1249a3f5cc/readme.md?plain=1#L232
|
// see https://github.com/octet-stream/form-data/blob/73a5a24e635938026538673f94cbae1249a3f5cc/readme.md?plain=1#L232
|
||||||
formData.set(this.fieldname, {
|
formData.set(this.fieldname, {
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ const getNextPagePath = (
|
||||||
currentQuery: Record<string, string>,
|
currentQuery: Record<string, string>,
|
||||||
currentPath: string | undefined,
|
currentPath: string | undefined,
|
||||||
): string | null => {
|
): string | null => {
|
||||||
if (!data.paging || !data.paging.cursors) {
|
if (!data.paging?.cursors) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { S3Client } from '@aws-sdk/client-s3'
|
import type { S3Client } from '@aws-sdk/client-s3'
|
||||||
import type { CompanionRuntimeOptions } from './companion-options.js'
|
|
||||||
import type Provider from '../server/provider/Provider.js'
|
|
||||||
import { CredentialsFetchResponse } from '../schemas/companion.js'
|
import { CredentialsFetchResponse } from '../schemas/companion.js'
|
||||||
|
import type Provider from '../server/provider/Provider.js'
|
||||||
|
import type { CompanionRuntimeOptions } from './companion-options.js'
|
||||||
|
|
||||||
export type BuildUrl = (
|
export type BuildUrl = (
|
||||||
subPath: string,
|
subPath: string,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
declare module 'express-interceptor' {
|
declare module 'express-interceptor' {
|
||||||
import type { Request, Response, RequestHandler } from 'express'
|
import type { Request, RequestHandler, Response } from 'express'
|
||||||
|
|
||||||
type InterceptorConfig = {
|
type InterceptorConfig = {
|
||||||
isInterceptable: () => boolean
|
isInterceptable: () => boolean
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ describe('providers requests with remote oauth keys', () => {
|
||||||
// mocking request module used to fetch custom oauth credentials
|
// mocking request module used to fetch custom oauth credentials
|
||||||
nock('http://localhost:2111')
|
nock('http://localhost:2111')
|
||||||
.post('/zoom-keys')
|
.post('/zoom-keys')
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
.reply((uri, { provider, parameters }) => {
|
.reply((uri, { provider, parameters }) => {
|
||||||
if (provider !== 'zoom' || parameters !== 'ZOOM-CREDENTIALS-PARAMS')
|
if (provider !== 'zoom' || parameters !== 'ZOOM-CREDENTIALS-PARAMS')
|
||||||
return [400]
|
return [400]
|
||||||
|
|
|
||||||
|
|
@ -489,23 +489,22 @@ describe('provider file gets downloaded from', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('connect to provider', () => {
|
describe('connect to provider', () => {
|
||||||
test.each(providerNames)(
|
test.each(
|
||||||
'connect to %s via grant.js endpoint',
|
providerNames,
|
||||||
async (providerName: string) => {
|
)('connect to %s via grant.js endpoint', async (providerName: string) => {
|
||||||
const oauthProvider = oauthProviders[providerName]
|
const oauthProvider = oauthProviders[providerName]
|
||||||
|
|
||||||
if (oauthProvider == null) return
|
if (oauthProvider == null) return
|
||||||
|
|
||||||
await request(await getServerWithEnv())
|
await request(await getServerWithEnv())
|
||||||
.get(`/${providerName}/connect?foo=bar`)
|
.get(`/${providerName}/connect?foo=bar`)
|
||||||
.set('uppy-auth-token', token)
|
.set('uppy-auth-token', token)
|
||||||
.expect(302)
|
.expect(302)
|
||||||
.expect(
|
.expect(
|
||||||
'Location',
|
'Location',
|
||||||
`http://localhost:3020/connect/${oauthProvider}?state=${OAUTH_STATE}`,
|
`http://localhost:3020/connect/${oauthProvider}?state=${OAUTH_STATE}`,
|
||||||
)
|
)
|
||||||
},
|
})
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('logout of provider', () => {
|
describe('logout of provider', () => {
|
||||||
|
|
|
||||||
|
|
@ -82,21 +82,20 @@ describe('url get', () => {
|
||||||
.then((res) => expect(res.body.token).toBeTruthy())
|
.then((res) => expect(res.body.token).toBeTruthy())
|
||||||
})
|
})
|
||||||
|
|
||||||
test.each(invalids)(
|
test.each(
|
||||||
'downloads are not instantiated for invalid urls',
|
invalids,
|
||||||
async (urlCase) => {
|
)('downloads are not instantiated for invalid urls', async (urlCase) => {
|
||||||
nockUrl()
|
nockUrl()
|
||||||
|
|
||||||
return request(await getMockServer())
|
return request(await getMockServer())
|
||||||
.post('/url/get')
|
.post('/url/get')
|
||||||
.set('Content-Type', 'application/json')
|
.set('Content-Type', 'application/json')
|
||||||
.send({
|
.send({
|
||||||
url: urlCase,
|
url: urlCase,
|
||||||
endpoint: 'http://tusd.tusdemo.net/files',
|
endpoint: 'http://tusd.tusdemo.net/files',
|
||||||
protocol: 'tus',
|
protocol: 'tus',
|
||||||
})
|
})
|
||||||
.expect(400)
|
.expect(400)
|
||||||
.then((res) => expect(res.body.error).toBe('Invalid request body'))
|
.then((res) => expect(res.body.error).toBe('Invalid request body'))
|
||||||
},
|
})
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import prettierBytes from '@transloadit/prettier-bytes'
|
||||||
import type { DefinePluginOpts, PluginOpts } from '@uppy/core'
|
import type { DefinePluginOpts, PluginOpts } from '@uppy/core'
|
||||||
import { BasePlugin, type Uppy } from '@uppy/core'
|
import { BasePlugin, type Uppy } from '@uppy/core'
|
||||||
import type { Body, LocalUppyFile, Meta, UppyFile } from '@uppy/utils'
|
import type { Body, LocalUppyFile, Meta, UppyFile } from '@uppy/utils'
|
||||||
// @ts-ignore
|
|
||||||
import { getFileNameAndExtension, RateLimitedQueue } from '@uppy/utils'
|
import { getFileNameAndExtension, RateLimitedQueue } from '@uppy/utils'
|
||||||
import CompressorJS from 'compressorjs'
|
import CompressorJS from 'compressorjs'
|
||||||
import locale from './locale.js'
|
import locale from './locale.js'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import prettierBytes from '@transloadit/prettier-bytes'
|
import prettierBytes from '@transloadit/prettier-bytes'
|
||||||
import type { Body, I18n, Meta, UppyFile } from '@uppy/utils'
|
import type { Body, I18n, Meta, UppyFile } from '@uppy/utils'
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
import match from 'mime-match'
|
import match from 'mime-match'
|
||||||
import type { NonNullableUppyOptions, State } from './Uppy.js'
|
import type { NonNullableUppyOptions, State } from './Uppy.js'
|
||||||
|
|
||||||
|
|
@ -206,4 +206,4 @@ class Restricter<M extends Meta, B extends Body> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Restricter, defaultOptions, RestrictionError }
|
export { defaultOptions, Restricter, RestrictionError }
|
||||||
|
|
|
||||||
|
|
@ -173,26 +173,26 @@ describe('src/Core', () => {
|
||||||
core.use(AcquirerPlugin1)
|
core.use(AcquirerPlugin1)
|
||||||
core.use(AcquirerPlugin2)
|
core.use(AcquirerPlugin2)
|
||||||
core.iteratePlugins((plugin) => {
|
core.iteratePlugins((plugin) => {
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
plugin.run('hello')
|
plugin.run('hello')
|
||||||
})
|
})
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.run.mock
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.run.mock
|
||||||
.calls.length,
|
.calls.length,
|
||||||
).toEqual(1)
|
).toEqual(1)
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.run.mock
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.run.mock
|
||||||
.calls[0],
|
.calls[0],
|
||||||
).toEqual(['hello'])
|
).toEqual(['hello'])
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.run.mock
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.run.mock
|
||||||
.calls.length,
|
.calls.length,
|
||||||
).toEqual(1)
|
).toEqual(1)
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.run.mock
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.run.mock
|
||||||
.calls[0],
|
.calls[0],
|
||||||
).toEqual(['hello'])
|
).toEqual(['hello'])
|
||||||
|
|
@ -203,7 +203,7 @@ describe('src/Core', () => {
|
||||||
core.use(AcquirerPlugin1)
|
core.use(AcquirerPlugin1)
|
||||||
core.use(AcquirerPlugin2)
|
core.use(AcquirerPlugin2)
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
Object.keys(core[Symbol.for('uppy test: getPlugins')]('acquirer'))
|
Object.keys(core[Symbol.for('uppy test: getPlugins')]('acquirer'))
|
||||||
.length,
|
.length,
|
||||||
).toEqual(2)
|
).toEqual(2)
|
||||||
|
|
@ -211,14 +211,14 @@ describe('src/Core', () => {
|
||||||
const plugin = core.getPlugin('TestSelector1')
|
const plugin = core.getPlugin('TestSelector1')
|
||||||
core.removePlugin(plugin!)
|
core.removePlugin(plugin!)
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
Object.keys(core[Symbol.for('uppy test: getPlugins')]('acquirer'))
|
Object.keys(core[Symbol.for('uppy test: getPlugins')]('acquirer'))
|
||||||
.length,
|
.length,
|
||||||
).toEqual(1)
|
).toEqual(1)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(plugin.mocks.uninstall.mock.calls.length).toEqual(1)
|
expect(plugin.mocks.uninstall.mock.calls.length).toEqual(1)
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.run.mock
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.run.mock
|
||||||
.calls.length,
|
.calls.length,
|
||||||
).toEqual(0)
|
).toEqual(0)
|
||||||
|
|
@ -232,22 +232,22 @@ describe('src/Core', () => {
|
||||||
core.use(AcquirerPlugin2)
|
core.use(AcquirerPlugin2)
|
||||||
core.updateAll({ foo: 'bar' })
|
core.updateAll({ foo: 'bar' })
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.update
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.update
|
||||||
.mock.calls.length,
|
.mock.calls.length,
|
||||||
).toEqual(1)
|
).toEqual(1)
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.update
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.update
|
||||||
.mock.calls[0],
|
.mock.calls[0],
|
||||||
).toEqual([{ foo: 'bar' }])
|
).toEqual([{ foo: 'bar' }])
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.update
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.update
|
||||||
.mock.calls.length,
|
.mock.calls.length,
|
||||||
).toEqual(1)
|
).toEqual(1)
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.update
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.update
|
||||||
.mock.calls[0],
|
.mock.calls[0],
|
||||||
).toEqual([{ foo: 'bar' }])
|
).toEqual([{ foo: 'bar' }])
|
||||||
|
|
@ -285,12 +285,12 @@ describe('src/Core', () => {
|
||||||
expect(core.getState()).toEqual(newState)
|
expect(core.getState()).toEqual(newState)
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.update
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[0].mocks.update
|
||||||
.mock.calls[1],
|
.mock.calls[1],
|
||||||
).toEqual([newState])
|
).toEqual([newState])
|
||||||
expect(
|
expect(
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.update
|
core[Symbol.for('uppy test: getPlugins')]('acquirer')[1].mocks.update
|
||||||
.mock.calls[1],
|
.mock.calls[1],
|
||||||
).toEqual([newState])
|
).toEqual([newState])
|
||||||
|
|
@ -405,7 +405,7 @@ describe('src/Core', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const fileIDs = Object.keys(core.getState().files)
|
const fileIDs = Object.keys(core.getState().files)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
||||||
|
|
||||||
expect(core.getState().currentUploads[id]).toBeDefined()
|
expect(core.getState().currentUploads[id]).toBeDefined()
|
||||||
|
|
@ -443,7 +443,7 @@ describe('src/Core', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const fileIDs = Object.keys(core.getState().files)
|
const fileIDs = Object.keys(core.getState().files)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
||||||
|
|
||||||
expect(core.getState().currentUploads[id]).toBeDefined()
|
expect(core.getState().currentUploads[id]).toBeDefined()
|
||||||
|
|
@ -481,7 +481,7 @@ describe('src/Core', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const fileIDs = Object.keys(core.getState().files)
|
const fileIDs = Object.keys(core.getState().files)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
||||||
|
|
||||||
expect(core.getState().currentUploads[id]).toBeDefined()
|
expect(core.getState().currentUploads[id]).toBeDefined()
|
||||||
|
|
@ -522,7 +522,7 @@ describe('src/Core', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const fileIDs = Object.keys(core.getState().files)
|
const fileIDs = Object.keys(core.getState().files)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
const id = core[Symbol.for('uppy test: createUpload')](fileIDs)
|
||||||
|
|
||||||
expect(core.getState().currentUploads[id]).toBeDefined()
|
expect(core.getState().currentUploads[id]).toBeDefined()
|
||||||
|
|
@ -543,7 +543,7 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
const coreCancelEventMock = vi.fn()
|
const coreCancelEventMock = vi.fn()
|
||||||
const coreStateUpdateEventMock = vi.fn()
|
const coreStateUpdateEventMock = vi.fn()
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
const plugin = core[Symbol.for('uppy test: getPlugins')]('acquirer')[0]
|
const plugin = core[Symbol.for('uppy test: getPlugins')]('acquirer')[0]
|
||||||
|
|
||||||
core.on('cancel-all', coreCancelEventMock)
|
core.on('cancel-all', coreCancelEventMock)
|
||||||
|
|
@ -939,7 +939,7 @@ describe('src/Core', () => {
|
||||||
source: 'vi',
|
source: 'vi',
|
||||||
name: 'foo.webm',
|
name: 'foo.webm',
|
||||||
type: 'video/webm; codecs="vp8, opus"',
|
type: 'video/webm; codecs="vp8, opus"',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new File([sampleImage], {
|
data: new File([sampleImage], {
|
||||||
type: 'video/webm; codecs="vp8, opus"',
|
type: 'video/webm; codecs="vp8, opus"',
|
||||||
}),
|
}),
|
||||||
|
|
@ -1106,7 +1106,7 @@ describe('src/Core', () => {
|
||||||
it('does not dedupe different files', async () => {
|
it('does not dedupe different files', async () => {
|
||||||
const core = new Core()
|
const core = new Core()
|
||||||
const data = new Blob([sampleImage], { type: 'image/jpeg' })
|
const data = new Blob([sampleImage], { type: 'image/jpeg' })
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data.lastModified = 1562770350937
|
data.lastModified = 1562770350937
|
||||||
|
|
||||||
core.addFile({
|
core.addFile({
|
||||||
|
|
@ -1165,7 +1165,6 @@ describe('src/Core', () => {
|
||||||
fileIDs.forEach((fileID) => {
|
fileIDs.forEach((fileID) => {
|
||||||
const file = core.getFile(fileID)
|
const file = core.getFile(fileID)
|
||||||
if (file.name != null && /bar/.test(file.name)) {
|
if (file.name != null && /bar/.test(file.name)) {
|
||||||
// @ts-ignore
|
|
||||||
core.emit(
|
core.emit(
|
||||||
'upload-error',
|
'upload-error',
|
||||||
file,
|
file,
|
||||||
|
|
@ -1199,9 +1198,8 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
it('should only upload files that are not already assigned to another upload id', () => {
|
it('should only upload files that are not already assigned to another upload id', () => {
|
||||||
const core = new Core()
|
const core = new Core()
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core.store.state.currentUploads = {
|
core.store.state.currentUploads = {
|
||||||
// @ts-ignore
|
|
||||||
upload1: {
|
upload1: {
|
||||||
fileIDs: [
|
fileIDs: [
|
||||||
'uppy-file1/jpg-1e-image/jpeg',
|
'uppy-file1/jpg-1e-image/jpeg',
|
||||||
|
|
@ -1209,7 +1207,6 @@ describe('src/Core', () => {
|
||||||
'uppy-file3/jpg-1e-image/jpeg',
|
'uppy-file3/jpg-1e-image/jpeg',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// @ts-ignore
|
|
||||||
upload2: {
|
upload2: {
|
||||||
fileIDs: [
|
fileIDs: [
|
||||||
'uppy-file4/jpg-1e-image/jpeg',
|
'uppy-file4/jpg-1e-image/jpeg',
|
||||||
|
|
@ -1224,21 +1221,21 @@ describe('src/Core', () => {
|
||||||
source: 'vi',
|
source: 'vi',
|
||||||
name: 'foo.jpg',
|
name: 'foo.jpg',
|
||||||
type: 'image/jpeg',
|
type: 'image/jpeg',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new Uint8Array(),
|
data: new Uint8Array(),
|
||||||
})
|
})
|
||||||
core.addFile({
|
core.addFile({
|
||||||
source: 'vi',
|
source: 'vi',
|
||||||
name: 'bar.jpg',
|
name: 'bar.jpg',
|
||||||
type: 'image/jpeg',
|
type: 'image/jpeg',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new Uint8Array(),
|
data: new Uint8Array(),
|
||||||
})
|
})
|
||||||
core.addFile({
|
core.addFile({
|
||||||
source: 'file3',
|
source: 'file3',
|
||||||
name: 'file3.jpg',
|
name: 'file3.jpg',
|
||||||
type: 'image/jpeg',
|
type: 'image/jpeg',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new Uint8Array(),
|
data: new Uint8Array(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -1344,7 +1341,6 @@ describe('src/Core', () => {
|
||||||
fileIDs.forEach((fileID) => {
|
fileIDs.forEach((fileID) => {
|
||||||
const file = core.getFile(fileID)
|
const file = core.getFile(fileID)
|
||||||
if (!hasError) {
|
if (!hasError) {
|
||||||
// @ts-ignore
|
|
||||||
core.emit('upload-error', file, new Error('foo'))
|
core.emit('upload-error', file, new Error('foo'))
|
||||||
hasError = true
|
hasError = true
|
||||||
}
|
}
|
||||||
|
|
@ -1548,7 +1544,7 @@ describe('src/Core', () => {
|
||||||
core.setFileMeta(fileId, { caption: 'Test caption' })
|
core.setFileMeta(fileId, { caption: 'Test caption' })
|
||||||
|
|
||||||
// Trigger the dashboard:file-edit-complete event to update validation state
|
// Trigger the dashboard:file-edit-complete event to update validation state
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core.emit('dashboard:file-edit-complete', core.getFile(fileId))
|
core.emit('dashboard:file-edit-complete', core.getFile(fileId))
|
||||||
|
|
||||||
const updatedFile = core.getFile(fileId)
|
const updatedFile = core.getFile(fileId)
|
||||||
|
|
@ -1609,7 +1605,7 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
// Fix metadata for first file only
|
// Fix metadata for first file only
|
||||||
core.setFileMeta(fileId1, { caption: 'Fixed caption' })
|
core.setFileMeta(fileId1, { caption: 'Fixed caption' })
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core.emit('dashboard:file-edit-complete', core.getFile(fileId1))
|
core.emit('dashboard:file-edit-complete', core.getFile(fileId1))
|
||||||
|
|
||||||
// Add an error to file1 so it can be retried
|
// Add an error to file1 so it can be retried
|
||||||
|
|
@ -1676,7 +1672,7 @@ describe('src/Core', () => {
|
||||||
source: 'vi',
|
source: 'vi',
|
||||||
name: 'empty.dat',
|
name: 'empty.dat',
|
||||||
type: 'application/octet-stream',
|
type: 'application/octet-stream',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new File([new Uint8Array(1000)], {
|
data: new File([new Uint8Array(1000)], {
|
||||||
type: 'application/octet-stream',
|
type: 'application/octet-stream',
|
||||||
}),
|
}),
|
||||||
|
|
@ -1768,7 +1764,7 @@ describe('src/Core', () => {
|
||||||
source: 'vi',
|
source: 'vi',
|
||||||
name: 'foo1.png',
|
name: 'foo1.png',
|
||||||
type: 'image/png',
|
type: 'image/png',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new File([sampleImage], { type: 'image/png' }),
|
data: new File([sampleImage], { type: 'image/png' }),
|
||||||
})
|
})
|
||||||
throw new Error('should have thrown')
|
throw new Error('should have thrown')
|
||||||
|
|
@ -1786,7 +1782,7 @@ describe('src/Core', () => {
|
||||||
source: 'vi',
|
source: 'vi',
|
||||||
name: 'foo1.png',
|
name: 'foo1.png',
|
||||||
type: 'image/png',
|
type: 'image/png',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new File([sampleImage], { type: 'image/png' }),
|
data: new File([sampleImage], { type: 'image/png' }),
|
||||||
})
|
})
|
||||||
throw new Error('should have thrown')
|
throw new Error('should have thrown')
|
||||||
|
|
@ -1813,7 +1809,7 @@ describe('src/Core', () => {
|
||||||
source: 'vi',
|
source: 'vi',
|
||||||
name: 'foo1.png',
|
name: 'foo1.png',
|
||||||
type: 'image/png',
|
type: 'image/png',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: new File([sampleImage], { type: 'image/png' }),
|
data: new File([sampleImage], { type: 'image/png' }),
|
||||||
})
|
})
|
||||||
}).not.toThrow()
|
}).not.toThrow()
|
||||||
|
|
@ -1835,7 +1831,7 @@ describe('src/Core', () => {
|
||||||
any
|
any
|
||||||
>({
|
>({
|
||||||
store: DeepFrozenStore(),
|
store: DeepFrozenStore(),
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
meta: { foo2: 'bar2' },
|
meta: { foo2: 'bar2' },
|
||||||
})
|
})
|
||||||
core.setMeta({ foo: 'bar', bur: 'mur' })
|
core.setMeta({ foo: 'bar', bur: 'mur' })
|
||||||
|
|
@ -1879,7 +1875,7 @@ describe('src/Core', () => {
|
||||||
name: 'foo.jpg',
|
name: 'foo.jpg',
|
||||||
type: 'image/jpeg',
|
type: 'image/jpeg',
|
||||||
meta: {
|
meta: {
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
resize: 5000,
|
resize: 5000,
|
||||||
},
|
},
|
||||||
data: testImage,
|
data: testImage,
|
||||||
|
|
@ -1910,7 +1906,7 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
core.emit('upload-start', [core.getFile(fileId)])
|
core.emit('upload-start', [core.getFile(fileId)])
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core.emit('upload-progress', file, {
|
core.emit('upload-progress', file, {
|
||||||
bytesUploaded: 12345,
|
bytesUploaded: 12345,
|
||||||
bytesTotal: 17175,
|
bytesTotal: 17175,
|
||||||
|
|
@ -1923,7 +1919,7 @@ describe('src/Core', () => {
|
||||||
uploadStarted: expect.any(Number),
|
uploadStarted: expect.any(Number),
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core.emit('upload-progress', file, {
|
core.emit('upload-progress', file, {
|
||||||
bytesUploaded: 17175,
|
bytesUploaded: 17175,
|
||||||
bytesTotal: 17175,
|
bytesTotal: 17175,
|
||||||
|
|
@ -1951,13 +1947,13 @@ describe('src/Core', () => {
|
||||||
core.addUploader(async ([id]) => {
|
core.addUploader(async ([id]) => {
|
||||||
core.emit('upload-start', [core.getFile(id)])
|
core.emit('upload-start', [core.getFile(id)])
|
||||||
await progressPromise
|
await progressPromise
|
||||||
// @ts-ignore deprecated
|
// @ts-expect-error deprecated
|
||||||
core.emit('upload-progress', core.getFile(id), {
|
core.emit('upload-progress', core.getFile(id), {
|
||||||
bytesTotal: 3456,
|
bytesTotal: 3456,
|
||||||
bytesUploaded: 1234,
|
bytesUploaded: 1234,
|
||||||
})
|
})
|
||||||
await finishPromise
|
await finishPromise
|
||||||
// @ts-ignore deprecated
|
// @ts-expect-error deprecated
|
||||||
core.emit('upload-success', core.getFile(id), { uploadURL: 'lol' })
|
core.emit('upload-success', core.getFile(id), { uploadURL: 'lol' })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -1965,11 +1961,11 @@ describe('src/Core', () => {
|
||||||
source: 'dropbox',
|
source: 'dropbox',
|
||||||
name: 'foo.jpg',
|
name: 'foo.jpg',
|
||||||
type: 'image/jpeg',
|
type: 'image/jpeg',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: {},
|
data: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: updateTotalProgress')]()
|
core[Symbol.for('uppy test: updateTotalProgress')]()
|
||||||
|
|
||||||
const uploadStartedPromise = new Promise((resolve) =>
|
const uploadStartedPromise = new Promise((resolve) =>
|
||||||
|
|
@ -1985,7 +1981,7 @@ describe('src/Core', () => {
|
||||||
bytesTotal: null,
|
bytesTotal: null,
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
proceedUpload()
|
proceedUpload()
|
||||||
// wait for progress event
|
// wait for progress event
|
||||||
await progressPromise
|
await progressPromise
|
||||||
|
|
@ -1999,7 +1995,7 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
expect(core.getState().totalProgress).toBe(36)
|
expect(core.getState().totalProgress).toBe(36)
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
finishUpload()
|
finishUpload()
|
||||||
// wait for success event
|
// wait for success event
|
||||||
await finishPromise
|
await finishPromise
|
||||||
|
|
@ -2021,7 +2017,7 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
core.once('file-added', (file) => {
|
core.once('file-added', (file) => {
|
||||||
core.emit('upload-start', [file])
|
core.emit('upload-start', [file])
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core.emit('upload-progress', file, {
|
core.emit('upload-progress', file, {
|
||||||
bytesTotal: 3456,
|
bytesTotal: 3456,
|
||||||
bytesUploaded: 1234,
|
bytesUploaded: 1234,
|
||||||
|
|
@ -2031,16 +2027,15 @@ describe('src/Core', () => {
|
||||||
source: 'dropbox',
|
source: 'dropbox',
|
||||||
name: 'foo.jpg',
|
name: 'foo.jpg',
|
||||||
type: 'image/jpeg',
|
type: 'image/jpeg',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: {},
|
data: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
core.once('file-added', (file) => {
|
core.once('file-added', (file) => {
|
||||||
core.emit('upload-start', [file])
|
core.emit('upload-start', [file])
|
||||||
core.emit('upload-progress', file, {
|
core.emit('upload-progress', file, {
|
||||||
// @ts-ignore
|
|
||||||
bytesTotal: null,
|
bytesTotal: null,
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
bytesUploaded: null,
|
bytesUploaded: null,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -2048,11 +2043,11 @@ describe('src/Core', () => {
|
||||||
source: 'dropbox',
|
source: 'dropbox',
|
||||||
name: 'bar.jpg',
|
name: 'bar.jpg',
|
||||||
type: 'image/jpeg',
|
type: 'image/jpeg',
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
data: {},
|
data: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: updateTotalProgress')]()
|
core[Symbol.for('uppy test: updateTotalProgress')]()
|
||||||
|
|
||||||
// foo.jpg at 35%, bar.jpg has unknown size and will not be counted
|
// foo.jpg at 35%, bar.jpg has unknown size and will not be counted
|
||||||
|
|
@ -2082,27 +2077,27 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
const [file1, file2] = core.getFiles()
|
const [file1, file2] = core.getFiles()
|
||||||
core.setFileState(file1.id, {
|
core.setFileState(file1.id, {
|
||||||
// @ts-ignore suddenly dates??
|
// @ts-expect-error suddenly dates??
|
||||||
progress: { ...file1.progress, uploadStarted: new Date() },
|
progress: { ...file1.progress, uploadStarted: new Date() },
|
||||||
})
|
})
|
||||||
core.setFileState(file2.id, {
|
core.setFileState(file2.id, {
|
||||||
// @ts-ignore suddenly dates??
|
// @ts-expect-error suddenly dates??
|
||||||
progress: { ...file2.progress, uploadStarted: new Date() },
|
progress: { ...file2.progress, uploadStarted: new Date() },
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore test does not care about missing properties
|
// @ts-expect-error test does not care about missing properties
|
||||||
core.emit('upload-progress', core.getFile(file1.id), {
|
core.emit('upload-progress', core.getFile(file1.id), {
|
||||||
bytesUploaded: 12345,
|
bytesUploaded: 12345,
|
||||||
bytesTotal: 17175,
|
bytesTotal: 17175,
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore test does not care about missing properties
|
// @ts-expect-error test does not care about missing properties
|
||||||
core.emit('upload-progress', core.getFile(file2.id), {
|
core.emit('upload-progress', core.getFile(file2.id), {
|
||||||
bytesUploaded: 10201,
|
bytesUploaded: 10201,
|
||||||
bytesTotal: 17175,
|
bytesTotal: 17175,
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: updateTotalProgress')]()
|
core[Symbol.for('uppy test: updateTotalProgress')]()
|
||||||
|
|
||||||
expect(core.getState().totalProgress).toEqual(66)
|
expect(core.getState().totalProgress).toEqual(66)
|
||||||
|
|
@ -2126,27 +2121,27 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
const [file1, file2] = core.getFiles()
|
const [file1, file2] = core.getFiles()
|
||||||
core.setFileState(file1.id, {
|
core.setFileState(file1.id, {
|
||||||
// @ts-ignore suddenly dates??
|
// @ts-expect-error suddenly dates??
|
||||||
progress: { ...file1.progress, uploadStarted: new Date() },
|
progress: { ...file1.progress, uploadStarted: new Date() },
|
||||||
})
|
})
|
||||||
core.setFileState(file2.id, {
|
core.setFileState(file2.id, {
|
||||||
// @ts-ignore suddenly dates??
|
// @ts-expect-error suddenly dates??
|
||||||
progress: { ...file2.progress, uploadStarted: new Date() },
|
progress: { ...file2.progress, uploadStarted: new Date() },
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore test does not care about missing properties
|
// @ts-expect-error test does not care about missing properties
|
||||||
core.emit('upload-progress', core.getFile(file1.id), {
|
core.emit('upload-progress', core.getFile(file1.id), {
|
||||||
bytesUploaded: 12345,
|
bytesUploaded: 12345,
|
||||||
bytesTotal: 17175,
|
bytesTotal: 17175,
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore test does not care about missing properties
|
// @ts-expect-error test does not care about missing properties
|
||||||
core.emit('upload-progress', core.getFile(file2.id), {
|
core.emit('upload-progress', core.getFile(file2.id), {
|
||||||
bytesUploaded: 10201,
|
bytesUploaded: 10201,
|
||||||
bytesTotal: 17175,
|
bytesTotal: 17175,
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core[Symbol.for('uppy test: updateTotalProgress')]()
|
core[Symbol.for('uppy test: updateTotalProgress')]()
|
||||||
|
|
||||||
expect(core.getState().totalProgress).toEqual(66)
|
expect(core.getState().totalProgress).toEqual(66)
|
||||||
|
|
@ -2199,7 +2194,7 @@ describe('src/Core', () => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
core.setState(newState)
|
core.setState(newState)
|
||||||
expect(() => {
|
expect(() => {
|
||||||
core.clear()
|
core.clear()
|
||||||
|
|
@ -2486,14 +2481,13 @@ describe('src/Core', () => {
|
||||||
const core = new Core()
|
const core = new Core()
|
||||||
core.setState({
|
core.setState({
|
||||||
files: {
|
files: {
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
fileId: {
|
fileId: {
|
||||||
id: 'fileId',
|
id: 'fileId',
|
||||||
name: 'filename',
|
name: 'filename',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// @ts-ignore test does not care about missing properties
|
|
||||||
core.emit(
|
core.emit(
|
||||||
'upload-error',
|
'upload-error',
|
||||||
core.getFile('fileId'),
|
core.getFile('fileId'),
|
||||||
|
|
@ -2510,9 +2504,9 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
it('should reset the error state when receiving the upload event', () => {
|
it('should reset the error state when receiving the upload event', () => {
|
||||||
const core = new Core()
|
const core = new Core()
|
||||||
// @ts-ignore test does not care about missing properties
|
// @ts-expect-error test does not care about missing properties
|
||||||
core.emit('error', { foo: 'bar' })
|
core.emit('error', { foo: 'bar' })
|
||||||
// @ts-ignore test does not care about missing properties
|
// @ts-expect-error test does not care about missing properties
|
||||||
core.emit('upload')
|
core.emit('upload')
|
||||||
expect(core.getState().error).toEqual(null)
|
expect(core.getState().error).toEqual(null)
|
||||||
})
|
})
|
||||||
|
|
@ -2529,7 +2523,7 @@ describe('src/Core', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
// @ts-ignore readonly but whatever
|
// @ts-expect-error readonly but whatever
|
||||||
globalThis.window.navigator.onLine = RealNavigatorOnline
|
globalThis.window.navigator.onLine = RealNavigatorOnline
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -2538,11 +2532,8 @@ describe('src/Core', () => {
|
||||||
const offlineEventMock = vi.fn()
|
const offlineEventMock = vi.fn()
|
||||||
const backOnlineEventMock = vi.fn()
|
const backOnlineEventMock = vi.fn()
|
||||||
const core = new Core()
|
const core = new Core()
|
||||||
// @ts-ignore untyped
|
|
||||||
core.on('is-offline', offlineEventMock)
|
core.on('is-offline', offlineEventMock)
|
||||||
// @ts-ignore untyped
|
|
||||||
core.on('is-online', onlineEventMock)
|
core.on('is-online', onlineEventMock)
|
||||||
// @ts-ignore untyped
|
|
||||||
core.on('back-online', backOnlineEventMock)
|
core.on('back-online', backOnlineEventMock)
|
||||||
|
|
||||||
mockNavigatorOnline(true)
|
mockNavigatorOnline(true)
|
||||||
|
|
@ -2689,7 +2680,7 @@ describe('src/Core', () => {
|
||||||
data: testImage,
|
data: testImage,
|
||||||
})
|
})
|
||||||
|
|
||||||
// @ts-ignore accessing private method
|
// @ts-expect-error accessing private method
|
||||||
core[Symbol.for('uppy test: createUpload')](
|
core[Symbol.for('uppy test: createUpload')](
|
||||||
Object.keys(core.getState().files),
|
Object.keys(core.getState().files),
|
||||||
)
|
)
|
||||||
|
|
@ -2754,11 +2745,11 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
// logger.debug should have been called 1 time above,
|
// logger.debug should have been called 1 time above,
|
||||||
// but we call log in Core’s constructor to output VERSION, hence +1 here
|
// but we call log in Core’s constructor to output VERSION, hence +1 here
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(core.opts.logger.debug.mock.calls.length).toBe(2)
|
expect(core.opts.logger.debug.mock.calls.length).toBe(2)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(core.opts.logger.error.mock.calls.length).toBe(2)
|
expect(core.opts.logger.error.mock.calls.length).toBe(2)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(core.opts.logger.warn.mock.calls.length).toBe(1)
|
expect(core.opts.logger.warn.mock.calls.length).toBe(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -2781,13 +2772,13 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
// logger.debug should have been called 1 time above,
|
// logger.debug should have been called 1 time above,
|
||||||
// but we call log in Core’s constructor to output VERSION, hence +1 here
|
// but we call log in Core’s constructor to output VERSION, hence +1 here
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(core.opts.logger.debug.mock.calls.length).toBe(2)
|
expect(core.opts.logger.debug.mock.calls.length).toBe(2)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(core.opts.logger.error.mock.calls.length).toBe(2)
|
expect(core.opts.logger.error.mock.calls.length).toBe(2)
|
||||||
// logger.warn should have been called 1 time above,
|
// logger.warn should have been called 1 time above,
|
||||||
// but we warn in Core when using both logger and debug: true, hence +1 here
|
// but we warn in Core when using both logger and debug: true, hence +1 here
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(core.opts.logger.warn.mock.calls.length).toBe(2)
|
expect(core.opts.logger.warn.mock.calls.length).toBe(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -2805,14 +2796,14 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
// console.debug debug should have been called 2 times above,
|
// console.debug debug should have been called 2 times above,
|
||||||
// ibut we call log n Core’ constructor to output VERSION, hence +1 here
|
// ibut we call log n Core’ constructor to output VERSION, hence +1 here
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(console.debug.mock.calls.length).toBe(3)
|
expect(console.debug.mock.calls.length).toBe(3)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(console.error.mock.calls.length).toBe(1)
|
expect(console.error.mock.calls.length).toBe(1)
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
console.debug.mockClear()
|
console.debug.mockClear()
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
console.error.mockClear()
|
console.error.mockClear()
|
||||||
|
|
||||||
const core2 = new Core({
|
const core2 = new Core({
|
||||||
|
|
@ -2825,9 +2816,9 @@ describe('src/Core', () => {
|
||||||
|
|
||||||
// console.debug debug should have been called 2 times here,
|
// console.debug debug should have been called 2 times here,
|
||||||
// but we call log in Core constructor to output VERSION, hence +1 here
|
// but we call log in Core constructor to output VERSION, hence +1 here
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(console.debug.mock.calls.length).toBe(3)
|
expect(console.debug.mock.calls.length).toBe(3)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(console.error.mock.calls.length).toBe(1)
|
expect(console.error.mock.calls.length).toBe(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -2841,9 +2832,9 @@ describe('src/Core', () => {
|
||||||
core.log('beep boop')
|
core.log('beep boop')
|
||||||
core.log('beep beep', 'error')
|
core.log('beep beep', 'error')
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(console.debug.mock.calls.length).toBe(0)
|
expect(console.debug.mock.calls.length).toBe(0)
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
expect(console.error.mock.calls.length).toBe(1)
|
expect(console.error.mock.calls.length).toBe(1)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import {
|
||||||
Translator,
|
Translator,
|
||||||
} from '@uppy/utils'
|
} from '@uppy/utils'
|
||||||
import throttle from 'lodash/throttle.js'
|
import throttle from 'lodash/throttle.js'
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
import ee from 'namespace-emitter'
|
import ee from 'namespace-emitter'
|
||||||
import { nanoid } from 'nanoid/non-secure'
|
import { nanoid } from 'nanoid/non-secure'
|
||||||
import type { h } from 'preact'
|
import type { h } from 'preact'
|
||||||
|
|
@ -511,7 +511,7 @@ export class Uppy<
|
||||||
|
|
||||||
// Exposing uppy object on window for debugging and testing
|
// Exposing uppy object on window for debugging and testing
|
||||||
if (this.opts.debug && typeof window !== 'undefined') {
|
if (this.opts.debug && typeof window !== 'undefined') {
|
||||||
// @ts-ignore Mutating the global object for debug purposes
|
// @ts-expect-error Mutating the global object for debug purposes
|
||||||
window[this.opts.id] = this
|
window[this.opts.id] = this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1592,6 +1592,7 @@ export class Uppy<
|
||||||
{ leading: true, trailing: true },
|
{ leading: true, trailing: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via Symbol in tests
|
||||||
private [Symbol.for('uppy test: updateTotalProgress')]() {
|
private [Symbol.for('uppy test: updateTotalProgress')]() {
|
||||||
return this.#updateTotalProgress()
|
return this.#updateTotalProgress()
|
||||||
}
|
}
|
||||||
|
|
@ -1977,6 +1978,7 @@ export class Uppy<
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via Symbol in tests
|
||||||
private [Symbol.for('uppy test: getPlugins')](
|
private [Symbol.for('uppy test: getPlugins')](
|
||||||
type: string,
|
type: string,
|
||||||
): UnknownPlugin<M, B>[] {
|
): UnknownPlugin<M, B>[] {
|
||||||
|
|
@ -2181,6 +2183,7 @@ export class Uppy<
|
||||||
return uploadID
|
return uploadID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via Symbol in tests
|
||||||
private [Symbol.for('uppy test: createUpload')](...args: any[]): string {
|
private [Symbol.for('uppy test: createUpload')](...args: any[]): string {
|
||||||
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/47595
|
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/47595
|
||||||
return this.#createUpload(...args)
|
return this.#createUpload(...args)
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,4 @@ const debugLogger = {
|
||||||
console.error(`[Uppy] [${getTimeStamp()}]`, ...args),
|
console.error(`[Uppy] [${getTimeStamp()}]`, ...args),
|
||||||
}
|
}
|
||||||
|
|
||||||
export { justErrorsLogger, debugLogger }
|
export { debugLogger, justErrorsLogger }
|
||||||
|
|
|
||||||
|
|
@ -724,7 +724,7 @@ export default class Dashboard<M extends Meta, B extends Body> extends UIPlugin<
|
||||||
|
|
||||||
private handlePopState = (event: PopStateEvent) => {
|
private handlePopState = (event: PopStateEvent) => {
|
||||||
// Close the modal if the history state no longer contains our modal name
|
// Close the modal if the history state no longer contains our modal name
|
||||||
if (this.isModalOpen() && (!event.state || !event.state[this.modalName])) {
|
if (this.isModalOpen() && !event.state?.[this.modalName]) {
|
||||||
this.closeModal({ manualClose: false })
|
this.closeModal({ manualClose: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -970,9 +970,9 @@ export default class Dashboard<M extends Meta, B extends Body> extends UIPlugin<
|
||||||
if (this.opts.trigger && !this.opts.inline) {
|
if (this.opts.trigger && !this.opts.inline) {
|
||||||
const showModalTrigger = findAllDOMElements(this.opts.trigger)
|
const showModalTrigger = findAllDOMElements(this.opts.trigger)
|
||||||
if (showModalTrigger) {
|
if (showModalTrigger) {
|
||||||
showModalTrigger.forEach((trigger) =>
|
showModalTrigger.forEach((trigger) => {
|
||||||
trigger.addEventListener('click', this.openModal),
|
trigger.addEventListener('click', this.openModal)
|
||||||
)
|
})
|
||||||
} else {
|
} else {
|
||||||
this.uppy.log(
|
this.uppy.log(
|
||||||
'Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself',
|
'Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself',
|
||||||
|
|
@ -1010,9 +1010,9 @@ export default class Dashboard<M extends Meta, B extends Body> extends UIPlugin<
|
||||||
removeEvents = (): void => {
|
removeEvents = (): void => {
|
||||||
const showModalTrigger = findAllDOMElements(this.opts.trigger)
|
const showModalTrigger = findAllDOMElements(this.opts.trigger)
|
||||||
if (!this.opts.inline && showModalTrigger) {
|
if (!this.opts.inline && showModalTrigger) {
|
||||||
showModalTrigger.forEach((trigger) =>
|
showModalTrigger.forEach((trigger) => {
|
||||||
trigger.removeEventListener('click', this.openModal),
|
trigger.removeEventListener('click', this.openModal)
|
||||||
)
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stopListeningToResize()
|
this.stopListeningToResize()
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,7 @@ class AddFiles extends Component<AddFilesProps> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via Symbol in tests
|
||||||
private [Symbol.for('uppy test: disable unused locale key warning')]() {
|
private [Symbol.for('uppy test: disable unused locale key warning')]() {
|
||||||
// Those are actually used in `renderDropPasteBrowseTagline` method.
|
// Those are actually used in `renderDropPasteBrowseTagline` method.
|
||||||
this.props.i18nArray('dropPasteBoth')
|
this.props.i18nArray('dropPasteBoth')
|
||||||
|
|
@ -309,27 +310,6 @@ class AddFiles extends Component<AddFilesProps> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderAcquirers = (acquirers: TargetWithRender[]) => {
|
|
||||||
// Group last two buttons, so we don’t end up with
|
|
||||||
// just one button on a new line
|
|
||||||
const acquirersWithoutLastTwo = [...acquirers]
|
|
||||||
const lastTwoAcquirers = acquirersWithoutLastTwo.splice(
|
|
||||||
acquirers.length - 2,
|
|
||||||
acquirers.length,
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{acquirersWithoutLastTwo.map((acquirer) =>
|
|
||||||
this.renderAcquirer(acquirer),
|
|
||||||
)}
|
|
||||||
<span role="presentation" style={{ 'white-space': 'nowrap' }}>
|
|
||||||
{lastTwoAcquirers.map((acquirer) => this.renderAcquirer(acquirer))}
|
|
||||||
</span>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
private renderSourcesList = (
|
private renderSourcesList = (
|
||||||
acquirers: TargetWithRender[],
|
acquirers: TargetWithRender[],
|
||||||
disableLocalFiles: boolean,
|
disableLocalFiles: boolean,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ const AddFilesPanel = (props: $TSFixMe): $TSFixMe => {
|
||||||
<div className="uppy-DashboardContent-bar">
|
<div className="uppy-DashboardContent-bar">
|
||||||
<div
|
<div
|
||||||
className="uppy-DashboardContent-title"
|
className="uppy-DashboardContent-title"
|
||||||
// biome-ignore lint/a11y/useSemanticElements: ...
|
|
||||||
role="heading"
|
role="heading"
|
||||||
aria-level={1}
|
aria-level={1}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ function EditorPanel(props: $TSFixMe) {
|
||||||
<div className="uppy-DashboardContent-bar">
|
<div className="uppy-DashboardContent-bar">
|
||||||
<div
|
<div
|
||||||
className="uppy-DashboardContent-title"
|
className="uppy-DashboardContent-title"
|
||||||
// biome-ignore lint/a11y/useSemanticElements: ...
|
|
||||||
role="heading"
|
role="heading"
|
||||||
aria-level={1}
|
aria-level={1}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ export default function FileCard(props: $TSFixMe) {
|
||||||
<div className="uppy-DashboardContent-bar">
|
<div className="uppy-DashboardContent-bar">
|
||||||
<div
|
<div
|
||||||
className="uppy-DashboardContent-title"
|
className="uppy-DashboardContent-title"
|
||||||
// biome-ignore lint/a11y/useSemanticElements: ...
|
|
||||||
role="heading"
|
role="heading"
|
||||||
aria-level={1}
|
aria-level={1}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
|
import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
|
||||||
import type { I18n } from '@uppy/utils'
|
import type { I18n } from '@uppy/utils'
|
||||||
// @ts-ignore untyped
|
|
||||||
import { VirtualList } from '@uppy/utils'
|
import { VirtualList } from '@uppy/utils'
|
||||||
import { useMemo } from 'preact/hooks'
|
import { useMemo } from 'preact/hooks'
|
||||||
import type { DashboardState } from '../Dashboard.js'
|
import type { DashboardState } from '../Dashboard.js'
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ function PickerPanelContent({
|
||||||
<div className="uppy-DashboardContent-bar">
|
<div className="uppy-DashboardContent-bar">
|
||||||
<div
|
<div
|
||||||
className="uppy-DashboardContent-title"
|
className="uppy-DashboardContent-title"
|
||||||
// biome-ignore lint/a11y/useSemanticElements: ...
|
|
||||||
role="heading"
|
role="heading"
|
||||||
aria-level={1}
|
aria-level={1}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,6 @@ function ProgressBarComplete(props: ProgressBarCompleteProps) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="uppy-StatusBar-content"
|
className="uppy-StatusBar-content"
|
||||||
// biome-ignore lint/a11y/useSemanticElements: ...
|
|
||||||
role="status"
|
role="status"
|
||||||
title={i18n('complete')}
|
title={i18n('complete')}
|
||||||
>
|
>
|
||||||
|
|
@ -531,16 +530,17 @@ function ProgressBarError(props: ProgressBarErrorProps) {
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
UploadBtn,
|
|
||||||
RetryBtn,
|
|
||||||
CancelBtn,
|
CancelBtn,
|
||||||
PauseResumeButton,
|
|
||||||
DoneBtn,
|
DoneBtn,
|
||||||
LoadingSpinner,
|
LoadingSpinner,
|
||||||
ProgressDetails,
|
PauseResumeButton,
|
||||||
ProgressBarProcessing,
|
|
||||||
ProgressBarError,
|
|
||||||
ProgressBarUploading,
|
|
||||||
ProgressBarComplete,
|
ProgressBarComplete,
|
||||||
|
ProgressBarError,
|
||||||
|
ProgressBarProcessing,
|
||||||
|
ProgressBarUploading,
|
||||||
|
ProgressDetails,
|
||||||
|
RetryBtn,
|
||||||
|
UploadBtn,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import Core, { type UIPlugin } from '@uppy/core'
|
import Core, { type UIPlugin } from '@uppy/core'
|
||||||
import GoogleDrivePlugin from '@uppy/google-drive'
|
import GoogleDrivePlugin from '@uppy/google-drive'
|
||||||
// @ts-ignore untyped
|
|
||||||
import Url from '@uppy/url'
|
import Url from '@uppy/url'
|
||||||
// @ts-ignore untyped
|
|
||||||
import WebcamPlugin from '@uppy/webcam'
|
import WebcamPlugin from '@uppy/webcam'
|
||||||
import resizeObserverPolyfill from 'resize-observer-polyfill'
|
import resizeObserverPolyfill from 'resize-observer-polyfill'
|
||||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||||
|
|
@ -12,7 +10,6 @@ type $TSFixMe = any
|
||||||
|
|
||||||
describe('Dashboard', () => {
|
describe('Dashboard', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
// @ts-ignore we're touching globals for the test
|
|
||||||
globalThis.ResizeObserver =
|
globalThis.ResizeObserver =
|
||||||
(resizeObserverPolyfill as any).default || resizeObserverPolyfill
|
(resizeObserverPolyfill as any).default || resizeObserverPolyfill
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
// @ts-ignore untyped
|
|
||||||
import { FOCUSABLE_ELEMENTS } from '@uppy/utils'
|
import { FOCUSABLE_ELEMENTS } from '@uppy/utils'
|
||||||
import debounce from 'lodash/debounce.js'
|
import debounce from 'lodash/debounce.js'
|
||||||
import getActiveOverlayEl from './getActiveOverlayEl.js'
|
import getActiveOverlayEl from './getActiveOverlayEl.js'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
// @ts-ignore untyped
|
|
||||||
import { FOCUSABLE_ELEMENTS, toArray } from '@uppy/utils'
|
import { FOCUSABLE_ELEMENTS, toArray } from '@uppy/utils'
|
||||||
import getActiveOverlayEl from './getActiveOverlayEl.js'
|
import getActiveOverlayEl from './getActiveOverlayEl.js'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import type {
|
||||||
import { BasePlugin } from '@uppy/core'
|
import { BasePlugin } from '@uppy/core'
|
||||||
import { findDOMElement, toArray } from '@uppy/utils'
|
import { findDOMElement, toArray } from '@uppy/utils'
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
import getFormData from 'get-form-data'
|
import getFormData from 'get-form-data'
|
||||||
|
|
||||||
import packageJson from '../package.json' with { type: 'json' }
|
import packageJson from '../package.json' with { type: 'json' }
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import MetaDataStore from './MetaDataStore.js'
|
||||||
import ServiceWorkerStore from './ServiceWorkerStore.js'
|
import ServiceWorkerStore from './ServiceWorkerStore.js'
|
||||||
|
|
||||||
declare module '@uppy/core' {
|
declare module '@uppy/core' {
|
||||||
// biome-ignore lint/correctness/noUnusedVariables: must be defined
|
|
||||||
export interface UppyEventMap<M extends Meta, B extends Body> {
|
export interface UppyEventMap<M extends Meta, B extends Body> {
|
||||||
'restore:plugin-data-changed': (data: Record<string, unknown>) => void
|
'restore:plugin-data-changed': (data: Record<string, unknown>) => void
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,9 +136,9 @@ ar_SA.strings = {
|
||||||
openFolderNamed: '%{name} افتح المجلد',
|
openFolderNamed: '%{name} افتح المجلد',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.ar_SA = ar_SA
|
globalThis.Uppy.locales.ar_SA = ar_SA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,9 +164,9 @@ bg_BG.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.bg_BG = bg_BG
|
globalThis.Uppy.locales.bg_BG = bg_BG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -229,9 +229,9 @@ ca_ES.strings = {
|
||||||
unselectFileNamed: 'Desselecciona arxiu %{name}',
|
unselectFileNamed: 'Desselecciona arxiu %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.ca_ES = ca_ES
|
globalThis.Uppy.locales.ca_ES = ca_ES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -274,9 +274,9 @@ cs_CZ.strings = {
|
||||||
zoomOut: 'Oddálit',
|
zoomOut: 'Oddálit',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.cs_CZ = cs_CZ
|
globalThis.Uppy.locales.cs_CZ = cs_CZ
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,9 +141,9 @@ da_DK.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.da_DK = da_DK
|
globalThis.Uppy.locales.da_DK = da_DK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -210,9 +210,9 @@ de_DE.strings = {
|
||||||
zoomOut: 'Verkleinern',
|
zoomOut: 'Verkleinern',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.de_DE = de_DE
|
globalThis.Uppy.locales.de_DE = de_DE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,9 @@ el_GR.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.el_GR = el_GR
|
globalThis.Uppy.locales.el_GR = el_GR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,9 +252,9 @@ en_US.strings = {
|
||||||
zoomOut: 'Zoom out',
|
zoomOut: 'Zoom out',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.en_US = en_US
|
globalThis.Uppy.locales.en_US = en_US
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -232,9 +232,9 @@ es_ES.strings = {
|
||||||
unselectFileNamed: 'Deseleccionar archivo %{name}',
|
unselectFileNamed: 'Deseleccionar archivo %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.es_ES = es_ES
|
globalThis.Uppy.locales.es_ES = es_ES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -198,9 +198,9 @@ es_MX.strings = {
|
||||||
zoomOut: 'Alejar',
|
zoomOut: 'Alejar',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.es_MX = es_MX
|
globalThis.Uppy.locales.es_MX = es_MX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -221,9 +221,9 @@ fa_IR.strings = {
|
||||||
zoomOut: 'کوچکنمایی',
|
zoomOut: 'کوچکنمایی',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.fa_IR = fa_IR
|
globalThis.Uppy.locales.fa_IR = fa_IR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -146,9 +146,9 @@ fi_FI.strings = {
|
||||||
recording: 'Tallennetaan',
|
recording: 'Tallennetaan',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.fi_FI = fi_FI
|
globalThis.Uppy.locales.fi_FI = fi_FI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,9 +215,9 @@ fr_FR.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.fr_FR = fr_FR
|
globalThis.Uppy.locales.fr_FR = fr_FR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,9 +143,9 @@ gl_ES.strings = {
|
||||||
openFolderNamed: 'Cartafol aberto %{name}',
|
openFolderNamed: 'Cartafol aberto %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.gl_ES = gl_ES
|
globalThis.Uppy.locales.gl_ES = gl_ES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,9 +139,9 @@ he_IL.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.he_IL = he_IL
|
globalThis.Uppy.locales.he_IL = he_IL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,9 +189,9 @@ hi_IN.strings = {
|
||||||
zoomOut: 'ज़ूम आउट',
|
zoomOut: 'ज़ूम आउट',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.hi_IN = hi_IN
|
globalThis.Uppy.locales.hi_IN = hi_IN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,9 +143,9 @@ hr_HR.strings = {
|
||||||
openFolderNamed: 'Otvori mapu %{name}',
|
openFolderNamed: 'Otvori mapu %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.hr_HR = hr_HR
|
globalThis.Uppy.locales.hr_HR = hr_HR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,9 @@ hu_HU.strings = {
|
||||||
openFolderNamed: 'Nyitott mappa %{name}',
|
openFolderNamed: 'Nyitott mappa %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.hu_HU = hu_HU
|
globalThis.Uppy.locales.hu_HU = hu_HU
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ id_ID.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.id_ID = id_ID
|
globalThis.Uppy.locales.id_ID = id_ID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,9 @@ is_IS.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.is_IS = is_IS
|
globalThis.Uppy.locales.is_IS = is_IS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ it_IT.strings = {
|
||||||
openFolderNamed: 'Cartella aperta %{name}',
|
openFolderNamed: 'Cartella aperta %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.it_IT = it_IT
|
globalThis.Uppy.locales.it_IT = it_IT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,9 +148,9 @@ ja_JP.strings = {
|
||||||
openFolderNamed: '開いたフォルダ %{name}',
|
openFolderNamed: '開いたフォルダ %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.ja_JP = ja_JP
|
globalThis.Uppy.locales.ja_JP = ja_JP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,9 @@ ko_KR.strings = {
|
||||||
youHaveToAtLeastSelectX: '최소 %{smart_count}개의 파일을 선택해야 합니다',
|
youHaveToAtLeastSelectX: '최소 %{smart_count}개의 파일을 선택해야 합니다',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.ko_KR = ko_KR
|
globalThis.Uppy.locales.ko_KR = ko_KR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -232,9 +232,9 @@ ms_MY.strings = {
|
||||||
zoomOut: 'Zum keluar',
|
zoomOut: 'Zum keluar',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.ms_MY = ms_MY
|
globalThis.Uppy.locales.ms_MY = ms_MY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,9 +175,9 @@ nb_NO.strings = {
|
||||||
zoomOut: 'Zoom ut',
|
zoomOut: 'Zoom ut',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.nb_NO = nb_NO
|
globalThis.Uppy.locales.nb_NO = nb_NO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,9 +247,9 @@ nl_NL.strings = {
|
||||||
zoomOut: 'Zoom uit',
|
zoomOut: 'Zoom uit',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.nl_NL = nl_NL
|
globalThis.Uppy.locales.nl_NL = nl_NL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -243,9 +243,9 @@ pl_PL.strings = {
|
||||||
zoomOut: 'Pomniejsz',
|
zoomOut: 'Pomniejsz',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.pl_PL = pl_PL
|
globalThis.Uppy.locales.pl_PL = pl_PL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -248,9 +248,9 @@ pt_BR.strings = {
|
||||||
zoomOut: 'Diminuir o zoom',
|
zoomOut: 'Diminuir o zoom',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.pt_BR = pt_BR
|
globalThis.Uppy.locales.pt_BR = pt_BR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ pt_PT.strings = {
|
||||||
openFolderNamed: 'Pasta aberta %{name}',
|
openFolderNamed: 'Pasta aberta %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.pt_PT = pt_PT
|
globalThis.Uppy.locales.pt_PT = pt_PT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,9 +154,9 @@ ro_RO.strings = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.ro_RO = ro_RO
|
globalThis.Uppy.locales.ro_RO = ro_RO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,9 +253,9 @@ ru_RU.strings = {
|
||||||
zoomOut: 'Отдалить',
|
zoomOut: 'Отдалить',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.ru_RU = ru_RU
|
globalThis.Uppy.locales.ru_RU = ru_RU
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,9 +177,9 @@ sk_SK.strings = {
|
||||||
zoomOut: 'Oddialiť',
|
zoomOut: 'Oddialiť',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.sk_SK = sk_SK
|
globalThis.Uppy.locales.sk_SK = sk_SK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,9 +143,9 @@ sr_RS_Cyrillic.strings = {
|
||||||
openFolderNamed: 'Отвори фолдер %{name}',
|
openFolderNamed: 'Отвори фолдер %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.sr_RS_Cyrillic = sr_RS_Cyrillic
|
globalThis.Uppy.locales.sr_RS_Cyrillic = sr_RS_Cyrillic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,9 +143,9 @@ sr_RS_Latin.strings = {
|
||||||
openFolderNamed: 'Otvori folder %{name}',
|
openFolderNamed: 'Otvori folder %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.sr_RS_Latin = sr_RS_Latin
|
globalThis.Uppy.locales.sr_RS_Latin = sr_RS_Latin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -244,9 +244,9 @@ sv_SE.strings = {
|
||||||
zoomOut: 'Zooma ut',
|
zoomOut: 'Zooma ut',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.sv_SE = sv_SE
|
globalThis.Uppy.locales.sv_SE = sv_SE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,9 +166,9 @@ th_TH.strings = {
|
||||||
zoomOut: 'ซูมออก',
|
zoomOut: 'ซูมออก',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.th_TH = th_TH
|
globalThis.Uppy.locales.th_TH = th_TH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,9 +141,9 @@ tr_TR.strings = {
|
||||||
openFolderNamed: 'Açık dosya %{name}',
|
openFolderNamed: 'Açık dosya %{name}',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.tr_TR = tr_TR
|
globalThis.Uppy.locales.tr_TR = tr_TR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -238,9 +238,9 @@ uk_UA.strings = {
|
||||||
zoomOut: 'Зменшити',
|
zoomOut: 'Зменшити',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.uk_UA = uk_UA
|
globalThis.Uppy.locales.uk_UA = uk_UA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -221,9 +221,9 @@ uz_UZ.strings = {
|
||||||
zoomOut: 'Kichraytirish',
|
zoomOut: 'Kichraytirish',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.uz_UZ = uz_UZ
|
globalThis.Uppy.locales.uz_UZ = uz_UZ
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -224,9 +224,9 @@ vi_VN.strings = {
|
||||||
zoomOut: 'Thu nhỏ',
|
zoomOut: 'Thu nhỏ',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.vi_VN = vi_VN
|
globalThis.Uppy.locales.vi_VN = vi_VN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,9 +178,9 @@ zh_CN.strings = {
|
||||||
zoomOut: '缩小',
|
zoomOut: '缩小',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.zh_CN = zh_CN
|
globalThis.Uppy.locales.zh_CN = zh_CN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,9 +176,9 @@ zh_TW.strings = {
|
||||||
zoomOut: '縮小',
|
zoomOut: '縮小',
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.zh_TW = zh_TW
|
globalThis.Uppy.locales.zh_TW = zh_TW
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ const en_US: Locale<0 | 1> = {
|
||||||
|
|
||||||
en_US.strings = {}
|
en_US.strings = {}
|
||||||
|
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
if (typeof Uppy !== 'undefined') {
|
if (typeof Uppy !== 'undefined') {
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
globalThis.Uppy.locales.en_US = en_US
|
globalThis.Uppy.locales.en_US = en_US
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,6 @@ function ProgressBarComplete(props: ProgressBarCompleteProps) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="uppy-StatusBar-content"
|
className="uppy-StatusBar-content"
|
||||||
// biome-ignore lint/a11y/useSemanticElements: ...
|
|
||||||
role="status"
|
role="status"
|
||||||
title={i18n('complete')}
|
title={i18n('complete')}
|
||||||
>
|
>
|
||||||
|
|
@ -531,16 +530,17 @@ function ProgressBarError(props: ProgressBarErrorProps) {
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
UploadBtn,
|
|
||||||
RetryBtn,
|
|
||||||
CancelBtn,
|
CancelBtn,
|
||||||
PauseResumeButton,
|
|
||||||
DoneBtn,
|
DoneBtn,
|
||||||
LoadingSpinner,
|
LoadingSpinner,
|
||||||
ProgressDetails,
|
PauseResumeButton,
|
||||||
ProgressBarProcessing,
|
|
||||||
ProgressBarError,
|
|
||||||
ProgressBarUploading,
|
|
||||||
ProgressBarComplete,
|
ProgressBarComplete,
|
||||||
|
ProgressBarError,
|
||||||
|
ProgressBarProcessing,
|
||||||
|
ProgressBarUploading,
|
||||||
|
ProgressDetails,
|
||||||
|
RetryBtn,
|
||||||
|
UploadBtn,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { DefinePluginOpts, UIPluginOptions, Uppy } from '@uppy/core'
|
||||||
import { UIPlugin } from '@uppy/core'
|
import { UIPlugin } from '@uppy/core'
|
||||||
import type { Body, LocalUppyFile, Meta, UppyFile } from '@uppy/utils'
|
import type { Body, LocalUppyFile, Meta, UppyFile } from '@uppy/utils'
|
||||||
import { dataURItoBlob, isObjectURL, isPreviewSupported } from '@uppy/utils'
|
import { dataURItoBlob, isObjectURL, isPreviewSupported } from '@uppy/utils'
|
||||||
// @ts-ignore untyped
|
// @ts-expect-error untyped
|
||||||
import { rotation } from 'exifr/dist/mini.esm.mjs'
|
import { rotation } from 'exifr/dist/mini.esm.mjs'
|
||||||
import packageJson from '../package.json' with { type: 'json' }
|
import packageJson from '../package.json' with { type: 'json' }
|
||||||
import locale from './locale.js'
|
import locale from './locale.js'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
// @ts-ignore untyped
|
|
||||||
import type { RateLimitedQueue, WrapPromiseFunctionType } from '@uppy/utils'
|
import type { RateLimitedQueue, WrapPromiseFunctionType } from '@uppy/utils'
|
||||||
import {
|
import {
|
||||||
fetchWithNetworkError,
|
fetchWithNetworkError,
|
||||||
|
|
@ -299,9 +298,7 @@ class TransloaditAssembly extends Emitter {
|
||||||
const prevResults = prevResultsMap[stepName] ?? []
|
const prevResults = prevResultsMap[stepName] ?? []
|
||||||
|
|
||||||
nextResults
|
nextResults
|
||||||
.filter(
|
.filter((n) => !prevResults?.some((p) => p.id === n.id))
|
||||||
(n) => !prevResults || !prevResults.some((p) => p.id === n.id),
|
|
||||||
)
|
|
||||||
.forEach((result) => {
|
.forEach((result) => {
|
||||||
this.emit('result', stepName, result)
|
this.emit('result', stepName, result)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue