mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
From Babel to TS (#5792)
This commit is contained in:
parent
c16657e075
commit
d408570373
201 changed files with 670 additions and 774 deletions
18
.eslintrc.js
18
.eslintrc.js
|
|
@ -22,7 +22,6 @@ module.exports = {
|
|||
window: true,
|
||||
},
|
||||
plugins: [
|
||||
'@babel/eslint-plugin',
|
||||
'jest',
|
||||
'markdown',
|
||||
'node',
|
||||
|
|
@ -30,12 +29,11 @@ module.exports = {
|
|||
'promise',
|
||||
'react',
|
||||
// extra:
|
||||
'compat',
|
||||
'jsdoc',
|
||||
'no-only-tests',
|
||||
'unicorn',
|
||||
],
|
||||
parser: '@babel/eslint-parser',
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
sourceType: 'script',
|
||||
ecmaVersion: 2022,
|
||||
|
|
@ -107,9 +105,6 @@ module.exports = {
|
|||
'jsx-a11y/no-noninteractive-element-interactions': 'error',
|
||||
'jsx-a11y/no-static-element-interactions': 'error',
|
||||
|
||||
// compat
|
||||
'compat/compat': ['error'],
|
||||
|
||||
// jsdoc
|
||||
'jsdoc/check-alignment': 'error',
|
||||
'jsdoc/check-examples': 'off', // cannot yet be supported for ESLint 8, see https://github.com/eslint/eslint/issues/14745
|
||||
|
|
@ -310,17 +305,6 @@ module.exports = {
|
|||
'no-underscore-dangle': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'*.test.js',
|
||||
'*.test.ts',
|
||||
'test/endtoend/*.js',
|
||||
'bin/**.js',
|
||||
],
|
||||
rules: {
|
||||
'compat/compat': ['off'],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'bin/**.js',
|
||||
|
|
|
|||
6
.github/workflows/bundlers.yml
vendored
6
.github/workflows/bundlers.yml
vendored
|
|
@ -97,12 +97,13 @@ jobs:
|
|||
- name: Add Rollup as a dev dependency
|
||||
run: >-
|
||||
npm i --save-dev @rollup/plugin-commonjs @rollup/plugin-node-resolve
|
||||
rollup@${{matrix.bundler-version}}
|
||||
@rollup/plugin-json rollup@${{matrix.bundler-version}}
|
||||
- run: npx rollup --version
|
||||
- name: Create Rollup config file
|
||||
run: >-
|
||||
echo ' import cjs from "@rollup/plugin-commonjs"; import { nodeResolve
|
||||
} from "@rollup/plugin-node-resolve";
|
||||
} from "@rollup/plugin-node-resolve"; import json from
|
||||
"@rollup/plugin-json";
|
||||
|
||||
export default {
|
||||
input: "./lib/index.js",
|
||||
|
|
@ -110,6 +111,7 @@ jobs:
|
|||
file: "/dev/null",
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
cjs(),
|
||||
nodeResolve({ browser: true, exportConditions: ["browser"] }),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
diff --git a/debug/package.json b/debug/package.json
|
||||
index 054944f5478a0a5cf7b6b8791950c595f956157b..06a4fe2719605eb42c5ee795101c21cfd10b59ce 100644
|
||||
--- a/debug/package.json
|
||||
+++ b/debug/package.json
|
||||
@@ -9,6 +9,7 @@
|
||||
"umd:main": "dist/debug.umd.js",
|
||||
"source": "src/index.js",
|
||||
"license": "MIT",
|
||||
+ "type": "module",
|
||||
"mangle": {
|
||||
"regex": "^(?!_renderer)^_"
|
||||
},
|
||||
diff --git a/devtools/package.json b/devtools/package.json
|
||||
index 09b04a77690bdfba01083939ff9eaf987dd50bcb..92c159fbb3cf312c6674202085fb237d6fb921ad 100644
|
||||
--- a/devtools/package.json
|
||||
+++ b/devtools/package.json
|
||||
@@ -10,6 +10,7 @@
|
||||
"source": "src/index.js",
|
||||
"license": "MIT",
|
||||
"types": "src/index.d.ts",
|
||||
+ "type": "module",
|
||||
"peerDependencies": {
|
||||
"preact": "^10.0.0"
|
||||
},
|
||||
diff --git a/hooks/package.json b/hooks/package.json
|
||||
index 74807025bf3de273ebada2cd355428a2c972503d..98501726ffbfe55ffa09928e56a9dcafb9a348ff 100644
|
||||
--- a/hooks/package.json
|
||||
+++ b/hooks/package.json
|
||||
@@ -10,6 +10,7 @@
|
||||
"source": "src/index.js",
|
||||
"license": "MIT",
|
||||
"types": "src/index.d.ts",
|
||||
+ "type": "module",
|
||||
"scripts": {
|
||||
"build": "microbundle build --raw",
|
||||
"dev": "microbundle watch --raw --format cjs",
|
||||
diff --git a/jsx-runtime/package.json b/jsx-runtime/package.json
|
||||
index 7a4027831223f16519a74e3028c34f2f8f5f011a..6b58d17dbacce81894467ef43c0a8e2435e388c4 100644
|
||||
--- a/jsx-runtime/package.json
|
||||
+++ b/jsx-runtime/package.json
|
||||
@@ -10,6 +10,7 @@
|
||||
"source": "src/index.js",
|
||||
"types": "src/index.d.ts",
|
||||
"license": "MIT",
|
||||
+ "type": "module",
|
||||
"peerDependencies": {
|
||||
"preact": "^10.0.0"
|
||||
},
|
||||
diff --git a/package.json b/package.json
|
||||
index 60279c24a08b808ffbf7dc64a038272bddb6785d..088f35fb2c92f2e9b7248557857af2839988d1aa 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -9,6 +9,7 @@
|
||||
"umd:main": "dist/preact.umd.js",
|
||||
"unpkg": "dist/preact.min.js",
|
||||
"source": "src/index.js",
|
||||
+ "type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.d.ts",
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
module.exports = (api) => {
|
||||
const targets = {}
|
||||
if (api.env('test')) {
|
||||
targets.node = 'current'
|
||||
}
|
||||
|
||||
return {
|
||||
presets: [
|
||||
['@babel/preset-env', {
|
||||
include: [
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
'@babel/plugin-proposal-numeric-separator',
|
||||
],
|
||||
loose: true,
|
||||
targets,
|
||||
useBuiltIns: false, // Don't add polyfills automatically.
|
||||
modules: false,
|
||||
}],
|
||||
],
|
||||
plugins: [
|
||||
['@babel/plugin-transform-react-jsx', { pragma: 'h', pragmaFrag: 'Fragment' }],
|
||||
process.env.NODE_ENV !== 'dev' && 'babel-plugin-inline-package-json',
|
||||
].filter(Boolean),
|
||||
}
|
||||
}
|
||||
|
|
@ -1,145 +0,0 @@
|
|||
import babel from '@babel/core'
|
||||
import t from '@babel/types'
|
||||
import { promisify } from 'node:util'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import globRaw from 'glob'
|
||||
import { mkdir, stat, writeFile, readFile } from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
|
||||
const glob = promisify(globRaw)
|
||||
|
||||
|
||||
const PACKAGE_JSON_IMPORT = /^\..*\/package.json$/
|
||||
const SOURCE = 'packages/{*,@uppy/*}/src/**/*.{js,ts}?(x)'
|
||||
// Files not to build (such as tests)
|
||||
const IGNORE = /\.test\.jsx?$|\.test\.tsx?$|__mocks__|svelte|angular|companion\//;
|
||||
// Files that should trigger a rebuild of everything on change
|
||||
const META_FILES = [
|
||||
'babel.config.js',
|
||||
'package.json',
|
||||
'package-lock.json',
|
||||
'yarn.lock',
|
||||
'bin/build-lib.js',
|
||||
]
|
||||
|
||||
function lastModified (file, createParentDir = false) {
|
||||
return stat(file).then((s) => s.mtime, async (err) => {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (createParentDir) {
|
||||
await mkdir(path.dirname(file), { recursive: true })
|
||||
}
|
||||
return 0
|
||||
}
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
||||
const versionCache = new Map()
|
||||
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
async function preparePackage (file) {
|
||||
const packageFolder = file.slice(0, file.indexOf('/src/'))
|
||||
if (versionCache.has(packageFolder)) return
|
||||
|
||||
// eslint-disable-next-line import/no-dynamic-require, global-require
|
||||
const { version } = JSON.parse(await readFile(path.join(__dirname, '..', packageFolder, 'package.json'), 'utf8'))
|
||||
if (process.env.FRESH) {
|
||||
// in case it hasn't been done before.
|
||||
await mkdir(path.join(packageFolder, 'lib'), { recursive: true })
|
||||
}
|
||||
versionCache.set(packageFolder, version)
|
||||
}
|
||||
|
||||
const nonJSImport = /^\.\.?\/.+\.([jt]sx|ts)$/
|
||||
// eslint-disable-next-line no-shadow
|
||||
function rewriteNonJSImportsToJS (path) {
|
||||
const match = nonJSImport.exec(path.node.source.value)
|
||||
if (match) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
path.node.source.value = `${match[0].slice(0, -match[1].length)}js`
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Using Babel version:', JSON.parse(await readFile(fileURLToPath(import.meta.resolve('@babel/core/package.json')), 'utf8')).version)
|
||||
|
||||
const metaMtimes = await Promise.all(META_FILES.map((filename) => lastModified(path.join(__dirname, '..', filename))))
|
||||
const metaMtime = Math.max(...metaMtimes)
|
||||
|
||||
const files = await glob(SOURCE)
|
||||
/* eslint-disable no-continue */
|
||||
for (const file of files) {
|
||||
if (IGNORE.test(file)) {
|
||||
continue
|
||||
}
|
||||
await preparePackage(file)
|
||||
const libFile = file.replace('/src/', '/lib/').replace(/\.[jt]sx?$/, '.js')
|
||||
|
||||
// on a fresh build, rebuild everything.
|
||||
if (!process.env.FRESH) {
|
||||
const [srcMtime, libMtime] = await Promise.all([
|
||||
lastModified(file),
|
||||
lastModified(libFile, true),
|
||||
])
|
||||
// Skip files that haven't changed
|
||||
if (srcMtime < libMtime && metaMtime < libMtime) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
const plugins = [{
|
||||
visitor: {
|
||||
// eslint-disable-next-line no-shadow
|
||||
ImportDeclaration (path) {
|
||||
rewriteNonJSImportsToJS(path)
|
||||
if (PACKAGE_JSON_IMPORT.test(path.node.source.value)
|
||||
&& path.node.specifiers.length === 1
|
||||
&& path.node.specifiers[0].type === 'ImportDefaultSpecifier') {
|
||||
// Vendor-in version number from package.json files:
|
||||
const version = versionCache.get(file.slice(0, file.indexOf('/src/')))
|
||||
if (version != null) {
|
||||
const [{ local }] = path.node.specifiers
|
||||
path.replaceWith(
|
||||
t.variableDeclaration('const', [t.variableDeclarator(local,
|
||||
t.objectExpression([
|
||||
t.objectProperty(t.stringLiteral('version'), t.stringLiteral(version)),
|
||||
]))]),
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ExportAllDeclaration: rewriteNonJSImportsToJS,
|
||||
// eslint-disable-next-line no-shadow
|
||||
ExportNamedDeclaration (path) {
|
||||
if (path.node.source != null) {
|
||||
rewriteNonJSImportsToJS(path)
|
||||
}
|
||||
},
|
||||
},
|
||||
}]
|
||||
const isTSX = file.endsWith('.tsx')
|
||||
if (isTSX || file.endsWith('.ts')) {
|
||||
plugins.push(['@babel/plugin-transform-typescript', {
|
||||
disallowAmbiguousJSXLike: true,
|
||||
isTSX,
|
||||
jsxPragma: 'h',
|
||||
jsxPragmaFrag: 'Fragment',
|
||||
}])
|
||||
}
|
||||
|
||||
const { code, map } = await babel.transformFileAsync(file, {
|
||||
sourceMaps: true,
|
||||
plugins,
|
||||
// no comments because https://github.com/transloadit/uppy/pull/4868#issuecomment-1897717779
|
||||
comments: !process.env.DIFF_BUILDER,
|
||||
})
|
||||
const [{ default: chalk }] = await Promise.all([
|
||||
import('chalk'),
|
||||
writeFile(libFile, code),
|
||||
writeFile(`${libFile}.map`, JSON.stringify(map)),
|
||||
])
|
||||
console.log(chalk.green('Compiled lib:'), chalk.magenta(libFile))
|
||||
}
|
||||
/* eslint-enable no-continue */
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { Uppy } from '@uppy/core'
|
||||
import Dashboard from '@uppy/dashboard'
|
||||
import AwsS3Multipart from '@uppy/aws-s3-multipart'
|
||||
import AwsS3Multipart from '@uppy/aws-s3'
|
||||
|
||||
import '@uppy/core/dist/style.css'
|
||||
import '@uppy/dashboard/dist/style.css'
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ uppy.on('complete', (result) => {
|
|||
|
||||
// uncomment if you enable Golden Retriever
|
||||
//
|
||||
/* eslint-disable compat/compat */
|
||||
// if ('serviceWorker' in navigator) {
|
||||
// navigator.serviceWorker
|
||||
// .register('/sw.js')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/* eslint-disable compat/compat */
|
||||
|
||||
import http from 'node:http'
|
||||
import qs from 'node:querystring'
|
||||
import he from 'he'
|
||||
|
|
|
|||
39
package.json
39
package.json
|
|
@ -14,19 +14,18 @@
|
|||
"e2e"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "npm-run-all --serial build:ts --parallel build:js build:css --serial build:components size",
|
||||
"build": "yarn build:lib && npm-run-all --parallel build:js build:css --serial build:components size",
|
||||
"build:lib": "tsc --build tsconfig.build.json",
|
||||
"build:angular": "yarn workspace angular build",
|
||||
"build:bundle": "yarn node ./bin/build-bundle.mjs",
|
||||
"build:bundle": "yarn workspace uppy build:bundle",
|
||||
"build:clean": "cp .gitignore .gitignore.bak && printf '!node_modules\n!**/node_modules/**/*\n' >> .gitignore; git clean -Xfd packages e2e .parcel-cache coverage; mv .gitignore.bak .gitignore",
|
||||
"build:companion": "yarn workspace @uppy/companion build",
|
||||
"build:components": "node bin/build-components.mjs",
|
||||
"build:css": "yarn node ./bin/build-css.js && yarn workspace @uppy/components build:tailwind && yarn node ./bin/copy-tailwind-css.mjs",
|
||||
"build:js": "npm-run-all build:js:typeless build:locale-pack build:angular build:bundle",
|
||||
"build:js:typeless": "npm-run-all build:lib build:companion build:svelte",
|
||||
"build:lib": "yarn build:ts && yarn node ./bin/build-lib.mjs && yarn build:css",
|
||||
"build:js:typeless": "npm-run-all build:companion build:svelte",
|
||||
"build:locale-pack": "yarn workspace @uppy-dev/locale-pack build && eslint packages/@uppy/locales/src/en_US.ts --fix && yarn workspace @uppy-dev/locale-pack test unused",
|
||||
"build:svelte": "yarn workspace @uppy/svelte build",
|
||||
"build:ts": "yarn tsc -b tsconfig.build.json && yarn workspace @uppy/svelte build",
|
||||
"contributors:save": "yarn node ./bin/update-contributors.mjs",
|
||||
"dev": "yarn workspace @uppy-dev/dev dev",
|
||||
"dev:with-companion": "npm-run-all --parallel start:companion dev",
|
||||
|
|
@ -57,13 +56,13 @@
|
|||
"test:locale-packs:unused": "yarn workspace @uppy-dev/locale-pack test unused",
|
||||
"test:locale-packs:warnings": "yarn workspace @uppy-dev/locale-pack test warnings",
|
||||
"test:ts": "yarn tsc -b && yarn workspace @uppy/svelte check",
|
||||
"test:unit": "yarn run build:lib && yarn test:watch --run",
|
||||
"test:unit": "yarn run build && yarn test:watch --run",
|
||||
"test:watch": "vitest --environment jsdom --dir packages/@uppy",
|
||||
"uploadcdn": "yarn node ./private/upload-to-cdn/index.js",
|
||||
"version": "yarn node ./bin/after-version-bump.js",
|
||||
"watch": "npm-run-all --parallel watch:js:bundle watch:js:lib",
|
||||
"watch:js:bundle": "onchange 'packages/{@uppy/,}*/src/**/*.{js,ts,jsx,tsx,svelte,scss,css}' --initial --verbose -- yarn run build:bundle",
|
||||
"watch:js:lib": "onchange 'packages/{@uppy/,}*/src/**/*.{js,ts,jsx,tsx,svelte,scss,css}' --initial --verbose -- yarn run build:lib"
|
||||
"watch:js:lib": "onchange 'packages/{@uppy/,}*/src/**/*.{js,ts,jsx,tsx,svelte,scss,css}' --initial --verbose -- yarn run build"
|
||||
},
|
||||
"pre-commit": "lint:staged",
|
||||
"lint-staged": {
|
||||
|
|
@ -78,9 +77,6 @@
|
|||
"eslint --fix",
|
||||
"prettier -w",
|
||||
"eslint"
|
||||
],
|
||||
"*.mdx": [
|
||||
"prettier -w"
|
||||
]
|
||||
},
|
||||
"resolutions": {
|
||||
|
|
@ -90,7 +86,6 @@
|
|||
"@vitest/utils": "patch:@vitest/utils@npm%3A1.2.1#./.yarn/patches/@vitest-utils-npm-1.2.1-3028846845.patch",
|
||||
"p-queue": "patch:p-queue@npm%3A8.0.1#~/.yarn/patches/p-queue-npm-8.0.1-fe1ddcd827.patch",
|
||||
"pre-commit": "patch:pre-commit@npm:1.2.2#.yarn/patches/pre-commit-npm-1.2.2-f30af83877.patch",
|
||||
"preact": "patch:preact@npm:10.10.0#.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch",
|
||||
"resize-observer-polyfill": "patch:resize-observer-polyfill@npm%3A1.5.1#./.yarn/patches/resize-observer-polyfill-npm-1.5.1-603120e8a0.patch",
|
||||
"start-server-and-test": "patch:start-server-and-test@npm:1.14.0#.yarn/patches/start-server-and-test-npm-1.14.0-841aa34fdf.patch",
|
||||
"stylelint-order": "^6.0.0",
|
||||
|
|
@ -98,29 +93,16 @@
|
|||
"uuid@^8.3.2": "patch:uuid@npm:8.3.2#.yarn/patches/uuid-npm-8.3.2-eca0baba53.patch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.14.5",
|
||||
"@babel/core": "^7.14.6",
|
||||
"@babel/eslint-parser": "^7.11.3",
|
||||
"@babel/eslint-plugin": "^7.11.3",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.16.8",
|
||||
"@babel/plugin-transform-react-jsx": "^7.10.4",
|
||||
"@babel/plugin-transform-typescript": "^7.22.10",
|
||||
"@babel/preset-env": "^7.14.7",
|
||||
"@babel/register": "^7.10.5",
|
||||
"@babel/types": "^7.17.0",
|
||||
"@babel/eslint-plugin": "^7.27.1",
|
||||
"@types/jasmine": "file:./private/@types/jasmine",
|
||||
"@types/jasminewd2": "file:./private/@types/jasmine",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
||||
"@typescript-eslint/parser": "^7.0.0",
|
||||
"@typescript-eslint/parser": "^8.35.0",
|
||||
"autoprefixer": "^10.2.6",
|
||||
"babel-plugin-inline-package-json": "^2.0.0",
|
||||
"chalk": "^5.0.0",
|
||||
"cssnano": "^7.0.0",
|
||||
"dotenv": "^16.0.0",
|
||||
"esbuild": "^0.25.0",
|
||||
"esbuild-plugin-babel": "^0.2.3",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-config-transloadit": "^2.0.0",
|
||||
|
|
@ -157,7 +139,7 @@
|
|||
"stylelint-config-rational-order": "^0.1.2",
|
||||
"stylelint-config-standard": "^36.0.0",
|
||||
"stylelint-config-standard-scss": "^13.0.0",
|
||||
"typescript": "~5.4",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.6.1",
|
||||
"vue-template-compiler": "workspace:*"
|
||||
},
|
||||
|
|
@ -165,8 +147,5 @@
|
|||
"engines": {
|
||||
"node": "^16.15.0 || >=18.0.0",
|
||||
"yarn": "3.6.1"
|
||||
},
|
||||
"alias": {
|
||||
"preact/jsx-dev-runtime": "preact/jsx-runtime"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
"preact": "^10.5.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.6.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
@ -36,5 +37,8 @@
|
|||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,10 @@ import type {
|
|||
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
|
||||
import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
|
||||
import supportsMediaRecorder from './supportsMediaRecorder.js'
|
||||
import RecordingScreen from './RecordingScreen.jsx'
|
||||
import PermissionsScreen from './PermissionsScreen.jsx'
|
||||
import RecordingScreen from './RecordingScreen.js'
|
||||
import PermissionsScreen from './PermissionsScreen.js'
|
||||
import locale from './locale.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
export interface AudioOptions extends UIPluginOptions {
|
||||
showAudioSourceDropdown?: boolean
|
||||
|
|
@ -165,7 +163,6 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
|
|||
|
||||
#startRecording = (): void => {
|
||||
// only used if supportsMediaRecorder() returned true
|
||||
// eslint-disable-next-line compat/compat
|
||||
this.#recorder = new MediaRecorder(this.#stream!)
|
||||
this.#recordingChunks = []
|
||||
let stoppingBecauseOfMaxSize = false
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
import { h } from 'preact'
|
||||
import { useEffect, useRef } from 'preact/hooks'
|
||||
import type { I18n } from '@uppy/utils/lib/Translator'
|
||||
import RecordButton from './RecordButton.jsx'
|
||||
import RecordingLength from './RecordingLength.jsx'
|
||||
import RecordButton from './RecordButton.js'
|
||||
import RecordingLength from './RecordingLength.js'
|
||||
import AudioSourceSelect, {
|
||||
type AudioSourceSelectProps,
|
||||
} from './AudioSourceSelect.jsx'
|
||||
} from './AudioSourceSelect.js'
|
||||
import AudioOscilloscope from './audio-oscilloscope/index.js'
|
||||
import SubmitButton from './SubmitButton.jsx'
|
||||
import DiscardButton from './DiscardButton.jsx'
|
||||
import SubmitButton from './SubmitButton.js'
|
||||
import DiscardButton from './DiscardButton.js'
|
||||
|
||||
interface RecordingScreenProps extends AudioSourceSelectProps {
|
||||
stream: MediaStream | null | undefined
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ function isFunction(v: any): v is Function {
|
|||
return typeof v === 'function'
|
||||
}
|
||||
|
||||
function result<T>(v: T): T extends (...args: any) => any ? ReturnType<T> : T {
|
||||
function result<T>(v: T | (() => T)): T {
|
||||
return isFunction(v) ? v() : v
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './Audio.jsx'
|
||||
export type { AudioOptions } from './Audio.jsx'
|
||||
export { default } from './Audio.js'
|
||||
export type { AudioOptions } from './Audio.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-disable max-classes-per-file, compat/compat */
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import supportsMediaRecorder from './supportsMediaRecorder.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
export default function supportsMediaRecorder(): boolean {
|
||||
/* eslint-disable compat/compat */
|
||||
return (
|
||||
typeof MediaRecorder === 'function' &&
|
||||
typeof MediaRecorder.prototype?.start === 'function'
|
||||
)
|
||||
/* eslint-enable compat/compat */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"aws s3",
|
||||
|
|
@ -24,5 +27,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@uppy/aws-s3": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"aws s3",
|
||||
|
|
@ -30,6 +33,7 @@
|
|||
"@aws-sdk/client-s3": "^3.362.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.362.0",
|
||||
"nock": "^13.1.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.6.1",
|
||||
"whatwg-fetch": "3.6.2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,9 +25,7 @@ import type {
|
|||
} from './utils.js'
|
||||
import createSignedURL from './createSignedURL.js'
|
||||
import { HTTPCommunicationQueue } from './HTTPCommunicationQueue.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
interface MultipartFile<M extends Meta, B extends Body> extends UppyFile<M, B> {
|
||||
s3Multipart: UploadResult
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -30,5 +33,8 @@
|
|||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ import type {
|
|||
UnknownProviderPluginState,
|
||||
} from '@uppy/core'
|
||||
import locale from './locale.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
export type BoxOptions = CompanionPluginOptions & {
|
||||
locale?: LocaleStrings<typeof locale>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './Box.jsx'
|
||||
export type { BoxOptions } from './Box.jsx'
|
||||
export { default } from './Box.js'
|
||||
export type { BoxOptions } from './Box.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -26,6 +29,7 @@
|
|||
"p-retry": "^6.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.6.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,7 @@ import type Uppy from '@uppy/core'
|
|||
import type { UppyFile, Meta, Body } from '@uppy/utils/lib/UppyFile'
|
||||
import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider'
|
||||
import AuthError from './AuthError.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
type CompanionHeaders = Record<string, string> | undefined
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
"jest": "^29.0.0",
|
||||
"nock": "^13.1.3",
|
||||
"supertest": "6.2.4",
|
||||
"typescript": "~5.4"
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
|
|
|
|||
|
|
@ -393,7 +393,6 @@ class Uploader {
|
|||
logger.debug('waiting for socket connection', 'uploader.socket.wait', this.shortToken)
|
||||
|
||||
const eventName = `connection:${this.token}`
|
||||
// eslint-disable-next-line compat/compat
|
||||
await once(emitter(), eventName, timeout && { signal: AbortSignal.timeout(timeout) })
|
||||
|
||||
logger.debug('socket connection received', 'uploader.socket.wait', this.shortToken)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
"url": "git+https://github.com/transloadit/uppy.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json",
|
||||
"build:tailwind": "tailwindcss -i ./src/input.css -o ./dist/styles.css"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -59,5 +60,8 @@
|
|||
"@uppy/webcam": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable react/destructuring-assignment */
|
||||
import { h } from 'preact'
|
||||
import type { UppyContext } from './types'
|
||||
import type { UppyContext } from './types.js'
|
||||
|
||||
export type ProviderIconProps = {
|
||||
provider:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { h } from 'preact'
|
||||
import { useMemo, useEffect } from 'preact/hooks'
|
||||
import type { Body, Meta, UppyFile } from '@uppy/core'
|
||||
import type { UppyContext } from './types'
|
||||
import type { UppyContext } from './types.js'
|
||||
|
||||
export type ThumbnailProps = {
|
||||
file: UppyFile<Meta, Body>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* eslint-disable react/destructuring-assignment */
|
||||
import { h } from 'preact'
|
||||
import { clsx } from 'clsx'
|
||||
import type { UppyContext } from './types'
|
||||
import type { UppyContext } from './types.js'
|
||||
|
||||
export type UploadButtonProps = {
|
||||
ctx: UppyContext
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import Uppy, { type UppyEventMap } from '@uppy/core'
|
||||
import type { UploadStatus } from './types'
|
||||
import type { UploadStatus } from './types.js'
|
||||
|
||||
export function createUppyEventAdapter({
|
||||
uppy,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@
|
|||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.6.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
"sideEffects": [
|
||||
"*.css"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -33,6 +36,7 @@
|
|||
"preact": "^10.5.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.6.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,9 +40,7 @@ import {
|
|||
defaultOptions as defaultRestrictionOptions,
|
||||
RestrictionError,
|
||||
} from './Restricter.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
import locale from './locale.js'
|
||||
|
||||
import type BasePlugin from './BasePlugin.js'
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"resolveJsonModule": false
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
"exclude": ["./src/**/*.test.ts"],
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -30,7 +33,6 @@
|
|||
"@uppy/utils": "workspace:^",
|
||||
"classnames": "^2.2.6",
|
||||
"lodash": "^4.17.21",
|
||||
"memoize-one": "^6.0.0",
|
||||
"nanoid": "^5.0.9",
|
||||
"preact": "^10.5.13",
|
||||
"shallow-equal": "^3.0.0"
|
||||
|
|
@ -41,6 +43,7 @@
|
|||
"@uppy/url": "workspace:^",
|
||||
"@uppy/webcam": "workspace:^",
|
||||
"resize-observer-polyfill": "^1.5.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.6.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
|||
|
|
@ -23,14 +23,11 @@ import type StatusBarLocale from '@uppy/status-bar/lib/locale.js'
|
|||
|
||||
import type { TargetedEvent } from 'preact/compat'
|
||||
import { nanoid } from 'nanoid/non-secure'
|
||||
import memoizeOne from 'memoize-one'
|
||||
import * as trapFocus from './utils/trapFocus.js'
|
||||
import createSuperFocus from './utils/createSuperFocus.js'
|
||||
import DashboardUI from './components/Dashboard.jsx'
|
||||
import DashboardUI from './components/Dashboard.js'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
import locale from './locale.js'
|
||||
|
||||
type GenericEventCallback = () => void
|
||||
|
|
@ -60,8 +57,6 @@ interface PromiseWithResolvers<T> {
|
|||
reject: (reason?: any) => void
|
||||
}
|
||||
|
||||
const memoize = ((memoizeOne as any).default as false) || memoizeOne
|
||||
|
||||
const TAB_KEY = 9
|
||||
const ESC_KEY = 27
|
||||
|
||||
|
|
@ -1132,26 +1127,26 @@ export default class Dashboard<M extends Meta, B extends Body> extends UIPlugin<
|
|||
return plugin.isSupported()
|
||||
}
|
||||
|
||||
#getAcquirers = memoize((targets: Target[]) => {
|
||||
#getAcquirers = (targets: Target[]) => {
|
||||
return targets
|
||||
.filter(
|
||||
(target) =>
|
||||
target.type === 'acquirer' && this.#isTargetSupported(target),
|
||||
)
|
||||
.map(this.#attachRenderFunctionToTarget)
|
||||
})
|
||||
}
|
||||
|
||||
#getProgressIndicators = memoize((targets: Target[]) => {
|
||||
#getProgressIndicators = (targets: Target[]) => {
|
||||
return targets
|
||||
.filter((target) => target.type === 'progressindicator')
|
||||
.map(this.#attachRenderFunctionToTarget)
|
||||
})
|
||||
}
|
||||
|
||||
#getEditors = memoize((targets: Target[]) => {
|
||||
#getEditors = (targets: Target[]) => {
|
||||
return targets
|
||||
.filter((target) => target.type === 'editor')
|
||||
.map(this.#attachRenderFunctionToTarget)
|
||||
})
|
||||
}
|
||||
|
||||
render = (state: State<M, B>) => {
|
||||
const pluginState = this.getPluginState()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { h, Component, Fragment, type ComponentChild } from 'preact'
|
|||
import type { I18n } from '@uppy/utils/lib/Translator'
|
||||
import type Translator from '@uppy/utils/lib/Translator'
|
||||
import type { TargetedEvent } from 'preact/compat'
|
||||
import type { DashboardState, TargetWithRender } from '../Dashboard'
|
||||
import type { DashboardState, TargetWithRender } from '../Dashboard.js'
|
||||
|
||||
interface AddFilesProps {
|
||||
i18n: I18n
|
||||
|
|
@ -98,7 +98,9 @@ class AddFiles extends Component<AddFilesProps> {
|
|||
type="file"
|
||||
name={`camera-${type}`}
|
||||
onChange={this.onFileInputChange}
|
||||
capture={nativeCameraFacingMode}
|
||||
capture={
|
||||
nativeCameraFacingMode === '' ? 'environment' : nativeCameraFacingMode
|
||||
}
|
||||
accept={accept}
|
||||
ref={refCallback}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable react/destructuring-assignment */
|
||||
import { h } from 'preact'
|
||||
import classNames from 'classnames'
|
||||
import AddFiles from './AddFiles.jsx'
|
||||
import AddFiles from './AddFiles.js'
|
||||
|
||||
type $TSFixMe = any
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ const AddFilesPanel = (props: $TSFixMe): $TSFixMe => {
|
|||
<div
|
||||
className="uppy-DashboardContent-title"
|
||||
role="heading"
|
||||
aria-level="1"
|
||||
aria-level={1}
|
||||
>
|
||||
{props.i18n('addingMoreFiles')}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -14,15 +14,15 @@ import type {
|
|||
import type { I18n } from '@uppy/utils/lib/Translator'
|
||||
import type Translator from '@uppy/utils/lib/Translator'
|
||||
import type { TargetedEvent } from 'preact/compat'
|
||||
import FileList from './FileList.jsx'
|
||||
import AddFiles from './AddFiles.jsx'
|
||||
import AddFilesPanel from './AddFilesPanel.jsx'
|
||||
import PickerPanelContent from './PickerPanelContent.jsx'
|
||||
import EditorPanel from './EditorPanel.jsx'
|
||||
import PanelTopBar from './PickerPanelTopBar.jsx'
|
||||
import FileCard from './FileCard/index.jsx'
|
||||
import Slide from './Slide.jsx'
|
||||
import type { DashboardState, TargetWithRender } from '../Dashboard'
|
||||
import FileList from './FileList.js'
|
||||
import AddFiles from './AddFiles.js'
|
||||
import AddFilesPanel from './AddFilesPanel.js'
|
||||
import PickerPanelContent from './PickerPanelContent.js'
|
||||
import EditorPanel from './EditorPanel.js'
|
||||
import PanelTopBar from './PickerPanelTopBar.js'
|
||||
import FileCard from './FileCard/index.js'
|
||||
import Slide from './Slide.js'
|
||||
import type { DashboardState, TargetWithRender } from '../Dashboard.js'
|
||||
|
||||
// http://dev.edenspiekermann.com/2016/02/11/introducing-accessible-modal-dialog
|
||||
// https://github.com/ghosh/micromodal
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ function EditorPanel(props: $TSFixMe) {
|
|||
<div
|
||||
className="uppy-DashboardContent-title"
|
||||
role="heading"
|
||||
aria-level="1"
|
||||
aria-level={1}
|
||||
>
|
||||
{props.i18nArray('editing', {
|
||||
file: (
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import { h } from 'preact'
|
|||
import { useEffect, useState, useCallback } from 'preact/hooks'
|
||||
import classNames from 'classnames'
|
||||
import { nanoid } from 'nanoid/non-secure'
|
||||
import getFileTypeIcon from '../../utils/getFileTypeIcon.jsx'
|
||||
import getFileTypeIcon from '../../utils/getFileTypeIcon.js'
|
||||
import ignoreEvent from '../../utils/ignoreEvent.js'
|
||||
import FilePreview from '../FilePreview.jsx'
|
||||
import RenderMetaFields from './RenderMetaFields.jsx'
|
||||
import FilePreview from '../FilePreview.js'
|
||||
import RenderMetaFields from './RenderMetaFields.js'
|
||||
|
||||
type $TSFixMe = any
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ export default function FileCard(props: $TSFixMe) {
|
|||
<div
|
||||
className="uppy-DashboardContent-title"
|
||||
role="heading"
|
||||
aria-level="1"
|
||||
aria-level={1}
|
||||
>
|
||||
{i18nArray('editing', {
|
||||
file: (
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import prettierBytes from '@transloadit/prettier-bytes'
|
|||
import truncateString from '@uppy/utils/lib/truncateString'
|
||||
import type { I18n } from '@uppy/utils/lib/Translator'
|
||||
import type { UppyFile } from '@uppy/core'
|
||||
import MetaErrorMessage from '../MetaErrorMessage.jsx'
|
||||
import MetaErrorMessage from '../MetaErrorMessage.js'
|
||||
import type { DashboardState } from '../../../Dashboard.js'
|
||||
|
||||
const renderFileName = (props: {
|
||||
|
|
@ -150,6 +150,7 @@ export default function FileInfo(props: FileInfoProps) {
|
|||
containerHeight,
|
||||
containerWidth,
|
||||
})}
|
||||
{/* eslint-disable-next-line no-alert */}
|
||||
<ErrorButton file={file} onClick={() => alert(file.error)} />
|
||||
</div>
|
||||
<div className="uppy-Dashboard-Item-status">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { h } from 'preact'
|
||||
import FilePreview from '../../FilePreview.jsx'
|
||||
import MetaErrorMessage from '../MetaErrorMessage.jsx'
|
||||
import getFileTypeIcon from '../../../utils/getFileTypeIcon.jsx'
|
||||
import FilePreview from '../../FilePreview.js'
|
||||
import MetaErrorMessage from '../MetaErrorMessage.js'
|
||||
import getFileTypeIcon from '../../../utils/getFileTypeIcon.js'
|
||||
|
||||
type $TSFixMe = any
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import { shallowEqualObjects } from 'shallow-equal'
|
|||
import type { UppyFile, Body, Meta, State } from '@uppy/core'
|
||||
import type { I18n } from '@uppy/utils/lib/Translator'
|
||||
import type Uppy from '@uppy/core'
|
||||
import FilePreviewAndLink from './FilePreviewAndLink/index.jsx'
|
||||
import FileProgress from './FileProgress/index.jsx'
|
||||
import FileInfo from './FileInfo/index.jsx'
|
||||
import Buttons from './Buttons/index.jsx'
|
||||
import FilePreviewAndLink from './FilePreviewAndLink/index.js'
|
||||
import FileProgress from './FileProgress/index.js'
|
||||
import FileInfo from './FileInfo/index.js'
|
||||
import Buttons from './Buttons/index.js'
|
||||
import type { DashboardState } from '../../Dashboard.js'
|
||||
|
||||
type Props<M extends Meta, B extends Body> = {
|
||||
|
|
@ -108,7 +108,7 @@ export default class FileItem<M extends Meta, B extends Body> extends Component<
|
|||
<div
|
||||
className={dashboardItemClass}
|
||||
id={`uppy_${file.id}`}
|
||||
role={this.props.role}
|
||||
role={this.props.role as h.JSX.AriaRole}
|
||||
>
|
||||
<div className="uppy-Dashboard-Item-preview">
|
||||
<FilePreviewAndLink
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { useMemo } from 'preact/hooks'
|
|||
import VirtualList from '@uppy/utils/lib/VirtualList'
|
||||
import type { UppyFile, Uppy, State, Body, Meta } from '@uppy/core'
|
||||
import type { I18n } from '@uppy/utils/lib/Translator'
|
||||
import FileItem from './FileItem/index.jsx'
|
||||
import FileItem from './FileItem/index.js'
|
||||
import type { DashboardState } from '../Dashboard.js'
|
||||
|
||||
type FileListProps<M extends Meta, B extends Body> = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { h } from 'preact'
|
||||
import getFileTypeIcon from '../utils/getFileTypeIcon.jsx'
|
||||
import getFileTypeIcon from '../utils/getFileTypeIcon.js'
|
||||
|
||||
type $TSFixMe = any
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function PickerPanelContent({
|
|||
<div
|
||||
className="uppy-DashboardContent-title"
|
||||
role="heading"
|
||||
aria-level="1"
|
||||
aria-level={1}
|
||||
>
|
||||
{i18n('importFrom', { name: activePickerPanel.name })}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ function PanelTopBar(props: $TSFixMe) {
|
|||
uppy,
|
||||
} = props
|
||||
let { allowNewUpload } = props
|
||||
// TODO maybe this should be done in ../Dashboard.jsx, then just pass that down as `allowNewUpload`
|
||||
// TODO maybe this should be done in ../Dashboard.js, then just pass that down as `allowNewUpload`
|
||||
if (allowNewUpload && maxNumberOfFiles) {
|
||||
// eslint-disable-next-line react/destructuring-assignment
|
||||
allowNewUpload = props.totalFileCount < props.maxNumberOfFiles
|
||||
|
|
@ -125,7 +125,7 @@ function PanelTopBar(props: $TSFixMe) {
|
|||
<div
|
||||
className="uppy-DashboardContent-title"
|
||||
role="heading"
|
||||
aria-level="1"
|
||||
aria-level={1}
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||
<UploadStatus {...props} />
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './Dashboard.jsx'
|
||||
export type { DashboardOptions } from './Dashboard.jsx'
|
||||
export { default } from './Dashboard.js'
|
||||
export type { DashboardOptions } from './Dashboard.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -30,5 +33,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles'
|
|||
import { h, type ComponentChild } from 'preact'
|
||||
|
||||
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
import locale from './locale.js'
|
||||
|
||||
export interface DragDropOptions extends UIPluginOptions {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './DragDrop.jsx'
|
||||
export type { DragDropOptions } from './DragDrop.jsx'
|
||||
export { default } from './DragDrop.js'
|
||||
export type { DragDropOptions } from './DragDrop.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -31,5 +34,8 @@
|
|||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@ import type { Uppy, Body, Meta, DefinePluginOpts, PluginOpts } from '@uppy/core'
|
|||
import { BasePlugin } from '@uppy/core'
|
||||
import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles'
|
||||
import toArray from '@uppy/utils/lib/toArray'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
export interface DropTargetOptions extends PluginOpts {
|
||||
target?: HTMLElement | string | null
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -27,5 +30,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ import type {
|
|||
UnknownProviderPluginState,
|
||||
} from '@uppy/core'
|
||||
import locale from './locale.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
export type DropboxOptions = CompanionPluginOptions & {
|
||||
locale?: LocaleStrings<typeof locale>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './Dropbox.jsx'
|
||||
export type { DropboxOptions } from './Dropbox.jsx'
|
||||
export { default } from './Dropbox.js'
|
||||
export type { DropboxOptions } from './Dropbox.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -27,5 +30,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ import type {
|
|||
UnknownProviderPluginState,
|
||||
} from '@uppy/core'
|
||||
import locale from './locale.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
export type FacebookOptions = CompanionPluginOptions & {
|
||||
locale?: LocaleStrings<typeof locale>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './Facebook.jsx'
|
||||
export type { FacebookOptions } from './Facebook.jsx'
|
||||
export { default } from './Facebook.js'
|
||||
export type { FacebookOptions } from './Facebook.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"upload",
|
||||
|
|
@ -27,5 +30,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ import type {
|
|||
} from '@uppy/core'
|
||||
import toArray from '@uppy/utils/lib/toArray'
|
||||
import type { TargetedEvent } from 'preact/compat'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
import locale from './locale.js'
|
||||
|
||||
export interface FileInputOptions extends UIPluginOptions {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './FileInput.jsx'
|
||||
export type { FileInputOptions } from './FileInput.jsx'
|
||||
export { default } from './FileInput.js'
|
||||
export type { FileInputOptions } from './FileInput.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -25,5 +28,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,7 @@ import toArray from '@uppy/utils/lib/toArray'
|
|||
// @ts-ignore untyped
|
||||
import getFormData from 'get-form-data'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
type Result<M extends Meta, B extends Body> = Parameters<
|
||||
UppyEventMap<M, B>['complete']
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"restore files",
|
||||
|
|
@ -28,5 +31,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@ import ServiceWorkerStore, {
|
|||
import IndexedDBStore from './IndexedDBStore.js'
|
||||
import MetaDataStore from './MetaDataStore.js'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
declare module '@uppy/core' {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"google drive",
|
||||
|
|
@ -29,5 +32,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@ import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePic
|
|||
import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core'
|
||||
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
import locale from './locale.js'
|
||||
|
||||
export type GoogleDrivePickerOptions = CompanionPluginOptions & {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export { default } from './GoogleDrivePicker.jsx'
|
||||
export { default } from './GoogleDrivePicker.js'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
"compilerOptions": {
|
||||
"noImplicitAny": false,
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"google drive",
|
||||
|
|
@ -28,5 +31,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@ import type {
|
|||
} from '@uppy/core'
|
||||
import DriveProviderViews from './DriveProviderViews.js'
|
||||
import locale from './locale.js'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
|
||||
export type GoogleDriveOptions = CompanionPluginOptions & {
|
||||
locale?: LocaleStrings<typeof locale>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './GoogleDrive.jsx'
|
||||
export type { GoogleDriveOptions } from './GoogleDrive.jsx'
|
||||
export { default } from './GoogleDrive.js'
|
||||
export type { GoogleDriveOptions } from './GoogleDrive.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"google photos",
|
||||
|
|
@ -29,5 +32,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@ import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePic
|
|||
import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core'
|
||||
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
import locale from './locale.js'
|
||||
|
||||
export type GooglePhotosPickerOptions = CompanionPluginOptions & {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
export { default } from './GooglePhotosPicker.jsx'
|
||||
export { default } from './GooglePhotosPicker.js'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
"compilerOptions": {
|
||||
"noImplicitAny": false,
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"upload",
|
||||
|
|
@ -35,5 +38,8 @@
|
|||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
className="uppy-u-reset uppy-c-btn"
|
||||
|
|
@ -203,7 +202,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
className="uppy-u-reset uppy-c-btn"
|
||||
|
|
@ -229,7 +227,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
className="uppy-u-reset uppy-c-btn"
|
||||
|
|
@ -257,7 +254,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
className="uppy-u-reset uppy-c-btn"
|
||||
|
|
@ -284,7 +280,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
className="uppy-u-reset uppy-c-btn"
|
||||
|
|
@ -310,7 +305,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
className="uppy-u-reset uppy-c-btn"
|
||||
|
|
@ -336,7 +330,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
className="uppy-u-reset uppy-c-btn"
|
||||
|
|
@ -362,7 +355,6 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
|
|||
|
||||
return (
|
||||
<button
|
||||
role="button tooltip"
|
||||
data-microtip-position="top"
|
||||
type="button"
|
||||
aria-label={i18n('aspectRatioPortrait')}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,8 @@ import type Cropper from 'cropperjs'
|
|||
import { h } from 'preact'
|
||||
|
||||
import type { LocaleStrings } from '@uppy/utils/lib/Translator'
|
||||
import Editor from './Editor.jsx'
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore We don't want TS to generate types for the package.json
|
||||
import packageJson from '../package.json'
|
||||
import Editor from './Editor.js'
|
||||
import packageJson from '../package.json' with { type: 'json' }
|
||||
import locale from './locale.js'
|
||||
|
||||
declare global {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { default } from './ImageEditor.jsx'
|
||||
export type { Opts as ImageEditorOptions } from './ImageEditor.jsx'
|
||||
export { default } from './ImageEditor.js'
|
||||
export type { Opts as ImageEditorOptions } from './ImageEditor.js'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"extends": "../../../tsconfig.shared",
|
||||
"compilerOptions": {
|
||||
"outDir": "./lib",
|
||||
"resolveJsonModule": false,
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src/**/*.*"],
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
"main": "lib/index.js",
|
||||
"style": "dist/style.min.css",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --build tsconfig.build.json"
|
||||
},
|
||||
"keywords": [
|
||||
"file uploader",
|
||||
"uppy",
|
||||
|
|
@ -28,5 +31,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
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