Run biome check on main (#5896)

this time on main
closes #5891

also: fix a11y tabIndex (key event handler)
This commit is contained in:
Mikael Finstad 2025-08-11 10:06:21 +02:00 committed by GitHub
parent 2f62f4001f
commit d31c90e443
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
98 changed files with 72 additions and 124 deletions

View file

@ -47,7 +47,6 @@
"correctness": {
"useExhaustiveDependencies": "error",
"useHookAtTopLevel": "error",
"noUnusedImports": "off",
"noUnusedFunctionParameters": "off",
"noUnusedVariables": {
"level": "error",

View file

@ -3,7 +3,6 @@
import { getAllowedHosts, Provider, tokenStorage } from '@uppy/companion-client'
import { UIPlugin } from '@uppy/core'
import { ProviderViews } from '@uppy/provider-views'
import { h } from 'preact'
const defaultOptions = {}

View file

@ -2,7 +2,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage'
import Uppy from '@uppy/core'
import FilePicker from '@uppy/react-native'
import Tus from '@uppy/tus'
import React, { useCallback, useEffect, useState } from 'react'
import { useCallback, useEffect, useState } from 'react'
import { Image, StyleSheet, Text, View } from 'react-native'
import FileList from './FileList'
import PauseResumeButton from './PauseResumeButton'

View file

@ -1,6 +1,5 @@
import getFileTypeIcon from '@uppy/dashboard/lib/utils/getFileTypeIcon.js'
import renderStringFromJSX from 'preact-render-to-string'
import React from 'react'
import { FlatList, Image, StyleSheet, Text, View } from 'react-native'
const fileIcon = require('./assets/file-icon.png')

View file

@ -1,4 +1,3 @@
import React from 'react'
import { StyleSheet, Text, TouchableHighlight } from 'react-native'
export default function PauseResumeButton({

View file

@ -1,4 +1,3 @@
import React from 'react'
import { StyleSheet, Text, View } from 'react-native'
const colorGreen = '#0b8600'

View file

@ -1,4 +1,3 @@
import React from 'react'
import { StyleSheet, Text, TouchableHighlight } from 'react-native'
export default function SelectFiles({ showFilePicker }) {

View file

@ -1,5 +1,3 @@
import React from 'react'
type ButtonProps = {
type: 'button'
onClick: () => void

View file

@ -1,5 +1,5 @@
import { useScreenCapture } from '@uppy/react'
import React, { useEffect } from 'react'
import { useEffect } from 'react'
import MediaCapture from './MediaCapture.tsx'
export interface ScreenCaptureProps {

View file

@ -1,5 +1,5 @@
import { useWebcam } from '@uppy/react'
import React, { useEffect } from 'react'
import { useEffect } from 'react'
import MediaCapture from './MediaCapture.tsx'
export interface WebcamProps {

View file

@ -36,6 +36,7 @@ function Footer() {
}
function FormFields(fields) {
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
function Field([name, value]) {
if (name === 'transloadit') return ''
let isValueJSON = false
@ -75,6 +76,7 @@ function FormFields(fields) {
}
function UploadsList(uploads) {
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
function Upload(upload) {
return `<li>${e(upload.name)}</li>`
}
@ -87,10 +89,12 @@ function UploadsList(uploads) {
}
function ResultsList(results) {
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
function Result(result) {
return `<li>${e(result.name)} <a href="${result.ssl_url}" target="_blank">View</a></li>`
}
// biome-ignore lint/nursery/noNestedComponentDefinitions: not a react component
function ResultsSection(stepName) {
return `
<h2>${e(stepName)}</h2>

View file

@ -10,7 +10,6 @@ import { UIPlugin } from '@uppy/core'
import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'
import PermissionsScreen from './PermissionsScreen.js'

View file

@ -1,5 +1,3 @@
import { h } from 'preact'
export interface AudioSourceSelectProps {
currentDeviceId: string | MediaStreamTrack | null | undefined
audioSources: MediaDeviceInfo[]

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
interface DiscardButtonProps {
onDiscard: () => void

View file

@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import type { h } from 'preact'
interface PermissionsScreenProps {
icon: () => h.JSX.Element | null

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
interface RecordButtonProps {
recording: boolean

View file

@ -1,4 +1,3 @@
import { h } from 'preact'
import formatSeconds from './formatSeconds.js'
interface RecordingLengthProps {

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import { useEffect, useRef } from 'preact/hooks'
import AudioSourceSelect, {
type AudioSourceSelectProps,

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
interface SubmitButtonProps {
onSubmit: () => void

View file

@ -1,5 +1,4 @@
import { clsx } from 'clsx'
import { h } from 'preact'
import { useMemo } from 'preact/hooks'
import { createDropzone } from './hooks/dropzone.js'
import type { NonNullableUppyContext, UppyContext } from './types.js'
@ -29,7 +28,6 @@ export default function Dropzone(props: DropzoneProps) {
className="uppy-reset"
data-uppy-element="dropzone"
role="presentation"
tabIndex={0}
>
<input
{...getInputProps()}
@ -39,6 +37,8 @@ export default function Dropzone(props: DropzoneProps) {
/>
<div
{...getRootProps()}
// biome-ignore lint/a11y/noNoninteractiveTabindex: it is also a button. getRootProps returns keyboard event handlers
tabIndex={0}
style={{
width: width || '100%',
height: height || '100%',

View file

@ -1,6 +1,6 @@
import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core'
import { clsx } from 'clsx'
import { Fragment, h } from 'preact'
import { Fragment } from 'preact'
import { useEffect, useState } from 'preact/hooks'
import prettyBytes from 'pretty-bytes'
import { Thumbnail } from './index.js'

View file

@ -1,6 +1,6 @@
import type { Body, Meta, UppyEventMap, UppyFile } from '@uppy/core'
import { clsx } from 'clsx'
import { Fragment, h } from 'preact'
import { Fragment } from 'preact'
import { useEffect, useState } from 'preact/hooks'
import prettyBytes from 'pretty-bytes'
import { Thumbnail, type UppyContext } from './index.js'

View file

@ -1,4 +1,3 @@
import { h } from 'preact'
import type { UppyContext } from './types.js'
export type ProviderIconProps = {

View file

@ -1,5 +1,4 @@
import type { Body, Meta, UppyFile } from '@uppy/core'
import { h } from 'preact'
import { useEffect, useMemo } from 'preact/hooks'
import type { UppyContext } from './types.js'

View file

@ -1,5 +1,4 @@
import { clsx } from 'clsx'
import { h } from 'preact'
import type { UppyContext } from './types.js'
export type UploadButtonProps = {

View file

@ -76,6 +76,18 @@ export function createDropzone<
input?.click()
}
const handleKeyPress = (event: KeyboardEvent) => {
// taken from https://github.com/react-dropzone/react-dropzone/blob/d6911c991e077151e302b599b92269432ab0472b/src/index.js#L830C1-L836C1
if (
event.key === ' ' ||
event.key === 'Enter' ||
event.keyCode === 32 ||
event.keyCode === 13
) {
handleClick()
}
}
const handleFileInputChange = (event: ChangeEventType) => {
const input = event.target as HTMLInputElement
const files = Array.from(input.files ?? [])
@ -103,6 +115,7 @@ export function createDropzone<
onDragLeave: handleDragLeave,
onDrop: handleDrop,
onClick: handleClick,
onKeyPress: handleKeyPress,
}),
getInputProps: () => ({
id: fileInputId,

View file

@ -21,7 +21,6 @@ import type { LocaleStrings } from '@uppy/utils/lib/Translator'
import toArray from '@uppy/utils/lib/toArray'
import { nanoid } from 'nanoid/non-secure'
import type { ComponentChild, VNode } from 'preact'
import { h } from 'preact'
import type { TargetedEvent } from 'preact/compat'
import packageJson from '../package.json' with { type: 'json' }
import DashboardUI from './components/Dashboard.js'

View file

@ -1,6 +1,6 @@
import type Translator from '@uppy/utils/lib/Translator'
import type { I18n } from '@uppy/utils/lib/Translator'
import { Component, type ComponentChild, Fragment, h } from 'preact'
import { Component, type ComponentChild, Fragment } from 'preact'
import type { TargetedEvent } from 'preact/compat'
import type { DashboardState, TargetWithRender } from '../Dashboard.js'

View file

@ -1,5 +1,4 @@
import classNames from 'classnames'
import { h } from 'preact'
import AddFiles from './AddFiles.js'
type $TSFixMe = any

View file

@ -11,7 +11,6 @@ import isDragDropSupported from '@uppy/utils/lib/isDragDropSupported'
import type Translator from '@uppy/utils/lib/Translator'
import type { I18n } from '@uppy/utils/lib/Translator'
import classNames from 'classnames'
import { h } from 'preact'
import type { TargetedEvent } from 'preact/compat'
import type { DashboardState, TargetWithRender } from '../Dashboard.js'
import AddFiles from './AddFiles.js'

View file

@ -1,5 +1,4 @@
import classNames from 'classnames'
import { h } from 'preact'
type $TSFixMe = any

View file

@ -1,6 +1,5 @@
import classNames from 'classnames'
import { nanoid } from 'nanoid/non-secure'
import { h } from 'preact'
import { useCallback, useEffect, useState } from 'preact/hooks'
import getFileTypeIcon from '../../utils/getFileTypeIcon.js'
import ignoreEvent from '../../utils/ignoreEvent.js'

View file

@ -1,7 +1,6 @@
import type Uppy from '@uppy/core'
import type { Body, Meta, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import type { DashboardState } from '../../../Dashboard.js'
import copyToClipboard from '../../../utils/copyToClipboard.js'

View file

@ -2,7 +2,6 @@ import prettierBytes from '@transloadit/prettier-bytes'
import type { UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import truncateString from '@uppy/utils/lib/truncateString'
import { h } from 'preact'
import type { DashboardState } from '../../../Dashboard.js'
import MetaErrorMessage from '../MetaErrorMessage.js'

View file

@ -1,4 +1,3 @@
import { h } from 'preact'
import getFileTypeIcon from '../../../utils/getFileTypeIcon.js'
import FilePreview from '../../FilePreview.js'
import MetaErrorMessage from '../MetaErrorMessage.js'

View file

@ -1,6 +1,6 @@
import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
interface Props<M extends Meta, B extends Body> {
uppy: Uppy<M, B>

View file

@ -1,5 +1,3 @@
import { h } from 'preact'
type $TSFixMe = any
const metaFieldIdToName = (metaFieldId: $TSFixMe, metaFields: $TSFixMe) => {

View file

@ -2,7 +2,6 @@ import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
// @ts-ignore untyped
import VirtualList from '@uppy/utils/lib/VirtualList'
import { h } from 'preact'
import { useMemo } from 'preact/hooks'
import type { DashboardState } from '../Dashboard.js'
import FileItem from './FileItem/index.js'

View file

@ -1,4 +1,3 @@
import { h } from 'preact'
import getFileTypeIcon from '../utils/getFileTypeIcon.js'
type $TSFixMe = any

View file

@ -1,5 +1,4 @@
import classNames from 'classnames'
import { h } from 'preact'
import { useRef } from 'preact/hooks'
import ignoreEvent from '../utils/ignoreEvent.js'

View file

@ -1,5 +1,4 @@
import type { UppyFile } from '@uppy/core'
import { h } from 'preact'
type $TSFixMe = any

View file

@ -2,11 +2,10 @@ import classNames from 'classnames'
import {
type ComponentChildren,
cloneElement,
h,
toChildArray,
type VNode,
} from 'preact'
import { useEffect, useRef, useState } from 'preact/hooks'
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
const transitionName = 'uppy-transition-slideDownUp'
const duration = 250
@ -29,7 +28,7 @@ function Slide({ children }: { children: ComponentChildren }) {
const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout>>()
const animationFrameRef = useRef<ReturnType<typeof requestAnimationFrame>>()
const handleEnterTransition = () => {
const handleEnterTransition = useCallback(() => {
setClassName(`${transitionName}-enter`)
cancelAnimationFrame(animationFrameRef.current!)
@ -43,9 +42,9 @@ function Slide({ children }: { children: ComponentChildren }) {
setClassName('')
}, duration)
})
}
}, [])
const handleLeaveTransition = () => {
const handleLeaveTransition = useCallback(() => {
setClassName(`${transitionName}-leave`)
cancelAnimationFrame(animationFrameRef.current!)
@ -60,7 +59,7 @@ function Slide({ children }: { children: ComponentChildren }) {
setClassName('')
}, duration)
})
}
}, [])
useEffect(() => {
const child = toChildArray(children)[0] as VNode
@ -73,7 +72,7 @@ function Slide({ children }: { children: ComponentChildren }) {
}
setCachedChildren(child)
}, [children, cachedChildren]) // Dependency array to trigger effect on children change
}, [children, cachedChildren, handleEnterTransition, handleLeaveTransition]) // Dependency array to trigger effect on children change
useEffect(() => {
return () => {

View file

@ -1,5 +1,3 @@
import { h } from 'preact'
type $TSFixMe = any
function iconImage() {

View file

@ -10,7 +10,7 @@ import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles'
import isDragDropSupported from '@uppy/utils/lib/isDragDropSupported'
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
import toArray from '@uppy/utils/lib/toArray'
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
import type { TargetedEvent } from 'preact/compat'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'

View file

@ -9,7 +9,6 @@ import { GooglePickerView } from '@uppy/provider-views'
import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js'
import { GoogleDriveIcon } from '@uppy/provider-views/lib/GooglePicker/icons.js'
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'

View file

@ -9,7 +9,6 @@ import { GooglePickerView } from '@uppy/provider-views'
import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js'
import { GooglePhotosIcon } from '@uppy/provider-views/lib/GooglePicker/icons.js'
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'

View file

@ -1,7 +1,7 @@
import type { Body, Meta, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import Cropper from 'cropperjs'
import { Component, h } from 'preact'
import { Component } from 'preact'
import type ImageEditor from './ImageEditor.js'
import getCanvasDataThatFitsPerfectlyIntoContainer from './utils/getCanvasDataThatFitsPerfectlyIntoContainer.js'
import getScaleFactorThatRemovesDarkCorners from './utils/getScaleFactorThatRemovesDarkCorners.js'

View file

@ -9,7 +9,6 @@ import type {
import { UIPlugin } from '@uppy/core'
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
import type Cropper from 'cropperjs'
import { h } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import Editor from './Editor.js'
import locale from './locale.js'

View file

@ -1,4 +1,4 @@
import { Component, type ComponentChild, createRef, h } from 'preact'
import { Component, type ComponentChild, createRef } from 'preact'
const TRANSITION_MS = 300

View file

@ -1,6 +1,6 @@
import type { Body, Meta, State, UIPluginOptions, Uppy } from '@uppy/core'
import { UIPlugin } from '@uppy/core'
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import FadeIn from './FadeIn.js'
import TransitionGroup from './TransitionGroup.js'
@ -37,7 +37,7 @@ export default class Informer<M extends Meta, B extends Body> extends UIPlugin<
<p role="alert">
{info.message}{' '}
{info.details && (
// biome-ignore lint/a11y/useKeyWithClickEvents: ...
// biome-ignore lint/a11y/useKeyWithClickEvents: don't think it's needed
<span
aria-label={info.details as string}
data-microtip-position="top-left"

View file

@ -7,7 +7,7 @@ import type {
Uppy,
} from '@uppy/core'
import { UIPlugin } from '@uppy/core'
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
import packageJson from '../package.json' with { type: 'json' }

View file

@ -1,5 +1,5 @@
import type { Body, Meta, PartialTreeFolder } from '@uppy/core'
import { Fragment, h } from 'preact'
import { Fragment, type h } from 'preact'
import type ProviderView from './ProviderView/index.js'
type BreadcrumbsProps<M extends Meta, B extends Body> = {

View file

@ -5,9 +5,7 @@ import type {
PartialTreeFolderNode,
} from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
// @ts-ignore untyped
import VirtualList from '@uppy/utils/lib/VirtualList'
import { h } from 'preact'
import { useEffect, useState } from 'preact/hooks'
import Item from './Item/index.js'
import type ProviderView from './ProviderView/ProviderView.js'

View file

@ -1,7 +1,6 @@
import type { Body, Meta, PartialTree } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import classNames from 'classnames'
import { h } from 'preact'
import { useMemo } from 'preact/hooks'
import type ProviderView from './ProviderView/ProviderView.js'
import getNumberOfSelectedFiles from './utils/PartialTreeUtils/getNumberOfSelectedFiles.js'

View file

@ -1,6 +1,5 @@
import type { AsyncStore, Uppy } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
import AuthView from '../ProviderView/AuthView.js'
import {

View file

@ -1,5 +1,3 @@
import { h } from 'preact'
export const GooglePhotosIcon = () => (
<svg
aria-hidden="true"

View file

@ -1,5 +1,5 @@
import type { PartialTreeFile, PartialTreeFolderNode } from '@uppy/core'
import { h } from 'preact'
import type { h } from 'preact'
import ItemIcon from './ItemIcon.js'
type GridItemProps = {

View file

@ -1,4 +1,4 @@
import { h } from 'preact'
import type { h } from 'preact'
function FileIcon() {
return (

View file

@ -3,7 +3,7 @@ import type {
PartialTreeFolderNode,
PartialTreeId,
} from '@uppy/core'
import { h } from 'preact'
import type { h } from 'preact'
import ItemIcon from './ItemIcon.js'
// if folder:

View file

@ -5,7 +5,7 @@ import type {
} from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import classNames from 'classnames'
import { h } from 'preact'
import type { h } from 'preact'
import GridItem from './components/GridItem.js'
import ListItem from './components/ListItem.js'

View file

@ -1,6 +1,6 @@
import type { Body, Meta } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import type { h } from 'preact'
import { useCallback } from 'preact/hooks'
import type ProviderViews from './ProviderView.js'
import type { Opts } from './ProviderView.js'

View file

@ -1,7 +1,7 @@
import type { Body, Meta, PartialTreeFolder } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import classNames from 'classnames'
import { h } from 'preact'
import type { h } from 'preact'
import Breadcrumbs from '../Breadcrumbs.js'
import type ProviderView from './ProviderView.js'
import User from './User.js'

View file

@ -14,7 +14,7 @@ import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
import remoteFileObjToLocal from '@uppy/utils/lib/remoteFileObjToLocal'
import type { I18n } from '@uppy/utils/lib/Translator'
import classNames from 'classnames'
import { h } from 'preact'
import type { h } from 'preact'
import packageJson from '../../package.json' with { type: 'json' }
import Browser from '../Browser.js'
import FooterActions from '../FooterActions.js'

View file

@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'
import { Fragment } from 'preact'
type UserProps = {
i18n: (phrase: string) => string

View file

@ -1,5 +1,4 @@
import { nanoid } from 'nanoid/non-secure'
import { h } from 'preact'
import type { ChangeEvent } from 'preact/compat'
import { useCallback, useEffect, useState } from 'preact/hooks'

View file

@ -13,7 +13,7 @@ import type { ValidateableFile } from '@uppy/core/lib/Restricter.js'
import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
import remoteFileObjToLocal from '@uppy/utils/lib/remoteFileObjToLocal'
import classNames from 'classnames'
import { h } from 'preact'
import type { h } from 'preact'
import packageJson from '../../package.json' with { type: 'json' }
import Browser from '../Browser.js'
import FooterActions from '../FooterActions.js'

View file

@ -5,13 +5,7 @@ import {
} from '@uppy/components'
import type Uppy from '@uppy/core'
import type React from 'react'
import {
createContext,
createElement as h,
useContext,
useEffect,
useState,
} from 'react'
import { createContext, useContext, useEffect, useState } from 'react'
interface UppyContextValue {
uppy: Uppy | undefined

View file

@ -7,7 +7,7 @@ import {
} from '@uppy/components'
import { h as preactH } from 'preact'
import { render as preactRender } from 'preact/compat'
import { createElement as h, useContext, useEffect, useRef } from 'react'
import { useContext, useEffect, useRef } from 'react'
import { UppyContext } from '../UppyContextProvider.js'
export default function Dropzone(props: Omit<DropzoneProps, 'ctx'>) {

View file

@ -7,7 +7,7 @@ import {
} from '@uppy/components'
import { h as preactH } from 'preact'
import { render as preactRender } from 'preact/compat'
import { createElement as h, useContext, useEffect, useRef } from 'react'
import { useContext, useEffect, useRef } from 'react'
import { UppyContext } from '../UppyContextProvider.js'
export default function FilesGrid(props: Omit<FilesGridProps, 'ctx'>) {

View file

@ -7,7 +7,7 @@ import {
} from '@uppy/components'
import { h as preactH } from 'preact'
import { render as preactRender } from 'preact/compat'
import { createElement as h, useContext, useEffect, useRef } from 'react'
import { useContext, useEffect, useRef } from 'react'
import { UppyContext } from '../UppyContextProvider.js'
export default function FilesList(props: Omit<FilesListProps, 'ctx'>) {

View file

@ -7,7 +7,7 @@ import {
} from '@uppy/components'
import { h as preactH } from 'preact'
import { render as preactRender } from 'preact/compat'
import { createElement as h, useContext, useEffect, useRef } from 'react'
import { useContext, useEffect, useRef } from 'react'
import { UppyContext } from '../UppyContextProvider.js'
export default function ProviderIcon(props: Omit<ProviderIconProps, 'ctx'>) {

View file

@ -7,7 +7,7 @@ import {
} from '@uppy/components'
import { h as preactH } from 'preact'
import { render as preactRender } from 'preact/compat'
import { createElement as h, useContext, useEffect, useRef } from 'react'
import { useContext, useEffect, useRef } from 'react'
import { UppyContext } from '../UppyContextProvider.js'
export default function Thumbnail(props: Omit<ThumbnailProps, 'ctx'>) {

View file

@ -7,7 +7,7 @@ import {
} from '@uppy/components'
import { h as preactH } from 'preact'
import { render as preactRender } from 'preact/compat'
import { createElement as h, useContext, useEffect, useRef } from 'react'
import { useContext, useEffect, useRef } from 'react'
import { UppyContext } from '../UppyContextProvider.js'
export default function UploadButton(props: Omit<UploadButtonProps, 'ctx'>) {

View file

@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import type { h } from 'preact'
interface DiscardButtonProps {
onDiscard: () => void

View file

@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import type { h } from 'preact'
interface RecordButtonProps {
recording: boolean | undefined

View file

@ -1,5 +1,5 @@
import type { Body, Meta } from '@uppy/core'
import { Component, type ComponentChild, Fragment, h } from 'preact'
import { Component, type ComponentChild, Fragment } from 'preact'
import DiscardButton from './DiscardButton.js'
import RecordButton from './RecordButton.js'
import type ScreenCapture from './ScreenCapture.js'

View file

@ -8,7 +8,7 @@ import type {
import { UIPlugin } from '@uppy/core'
import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'
import RecorderScreen from './RecorderScreen.js'

View file

@ -1,5 +1,3 @@
import { h } from 'preact'
export default function ScreenRecIcon() {
return (
<svg

View file

@ -1,5 +1,3 @@
import { h } from 'preact'
interface ScreenshotButtonProps {
onScreenshot: () => void
i18n: (key: string) => string

View file

@ -1,4 +1,4 @@
import { Component, h } from 'preact'
import { Component } from 'preact'
type $TSFixMe = any

View file

@ -1,5 +1,3 @@
import { h } from 'preact'
type $TSFixMe = any
export default function StreamStatus({ streamActive, i18n }: $TSFixMe) {

View file

@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import type { h } from 'preact'
interface SubmitButtonProps {
recording: boolean

View file

@ -4,7 +4,6 @@ import type { FileProcessingInfo } from '@uppy/utils/lib/FileProgress'
import prettyETA from '@uppy/utils/lib/prettyETA'
import type { I18n } from '@uppy/utils/lib/Translator'
import classNames from 'classnames'
import { h } from 'preact'
import statusBarStates from './StatusBarStates.js'

View file

@ -10,7 +10,6 @@ import { UIPlugin } from '@uppy/core'
import emaFilter from '@uppy/utils/lib/emaFilter'
import getTextDirection from '@uppy/utils/lib/getTextDirection'
import type { ComponentChild } from 'preact'
import { h } from 'preact'
import packageJson from '../package.json' with { type: 'json' }
import locale from './locale.js'
import type { StatusBarOptions } from './StatusBarOptions.js'

View file

@ -1,7 +1,6 @@
import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils/lib/Translator'
import classNames from 'classnames'
import { h } from 'preact'
import {
CancelBtn,
DoneBtn,

View file

@ -77,13 +77,10 @@ describe('Transloadit', () => {
})
it('should complete when resuming after pause', async () => {
let assemblyCallCount = 0
let firstUploadCallCount = 0
let secondUploadCallCount = 0
const server = setupServer(
http.post('*/assemblies', ({ request }) => {
assemblyCallCount++
return HttpResponse.json({
assembly_id: 'test-assembly-id',
websocket_url: 'ws://localhost:8080',
@ -107,7 +104,6 @@ describe('Transloadit', () => {
})
}),
http.patch('*/resumable/files/*', () => {
secondUploadCallCount++
return HttpResponse.json({
ok: 'RESUMABLE_FILE_UPLOADED',
})

View file

@ -1,5 +1,5 @@
import Uppy from '@uppy/core'
import { page, userEvent } from '@vitest/browser/context'
import { page } from '@vitest/browser/context'
import { expect, test } from 'vitest'
import Url from './Url.js'

View file

@ -1,6 +1,6 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { nanoid } from 'nanoid/non-secure'
import { Component, type ComponentChild, h } from 'preact'
import { Component, type ComponentChild } from 'preact'
type UrlUIProps = {
i18n: I18n

View file

@ -3,7 +3,7 @@ import { createServer } from 'node:http'
import { dirname, join } from 'node:path'
import { setTimeout } from 'node:timers/promises'
import { fileURLToPath } from 'node:url'
import { TestProject } from 'vitest/node'
import type { TestProject } from 'vitest/node'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

View file

@ -1,4 +1,4 @@
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
export default function CameraIcon(): ComponentChild {
return (

View file

@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { Component, type ComponentChild, type ComponentProps, h } from 'preact'
import { Component, type ComponentChild, type ComponentProps } from 'preact'
import DiscardButton from './DiscardButton.js'
import RecordButton from './RecordButton.js'
import RecordingLength from './RecordingLength.js'
@ -119,8 +119,9 @@ class CameraScreen extends Component<CameraScreenProps> {
) : (
// eslint-disable-next-line jsx-a11y/media-has-caption
<video
/* eslint-disable-next-line no-return-assign */
ref={(videoElement) => (this.videoElement = videoElement!)}
ref={(videoElement) => {
this.videoElement = videoElement!
}}
className={`uppy-Webcam-video ${
mirror ? 'uppy-Webcam-video--mirrored' : ''
}`}

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
interface DiscardButtonProps {
onDiscard: () => void

View file

@ -1,5 +1,5 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
interface PermissionScreenProps {
hasCamera: boolean

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
interface RecordButtonProps {
recording: boolean

View file

@ -1,4 +1,3 @@
import { h } from 'preact'
import formatSeconds from './formatSeconds.js'
interface RecordingLengthProps {

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
import CameraIcon from './CameraIcon.js'
interface SnapshotButtonProps {

View file

@ -1,5 +1,4 @@
import type { I18n } from '@uppy/utils/lib/Translator'
import { h } from 'preact'
interface SubmitButtonProps {
onSubmit: () => void

View file

@ -1,4 +1,4 @@
import { type ComponentChild, h } from 'preact'
import type { ComponentChild } from 'preact'
export interface VideoSourceSelectProps {
currentDeviceId: string | MediaStreamTrack | null | undefined