diff --git a/package.json b/package.json index a875ab7..8ac41db 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@uppy/core": "^3.3.1", "@uppy/dashboard": "^3.5.0", "@uppy/golden-retriever": "^3.1.0", + "@uppy/image-editor": "^2.1.2", "hono": "^3.4.1", "mime": "^3.0.0", "ofetch": "^1.1.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59ed2fe..ca8a0ad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ dependencies: '@uppy/golden-retriever': specifier: ^3.1.0 version: 3.1.0(@uppy/core@3.3.1) + '@uppy/image-editor': + specifier: ^2.1.2 + version: 2.1.2(@uppy/core@3.3.1) hono: specifier: ^3.4.1 version: 3.4.1 @@ -1606,6 +1609,17 @@ packages: lodash: 4.17.21 dev: false + /@uppy/image-editor@2.1.2(@uppy/core@3.3.1): + resolution: {integrity: sha512-nWg9kFh+9OelYnY6fr1Hto2Fx6Fy1MyQAsCZAzy9umAQMkGrIs3Ql2iYDap4gm9IdiBI8ajzX57qTepLXbKPXg==} + peerDependencies: + '@uppy/core': ^3.2.0 + dependencies: + '@uppy/core': 3.3.1 + '@uppy/utils': 5.4.3 + cropperjs: 1.5.7 + preact: 10.16.0 + dev: false + /@uppy/informer@3.0.2(@uppy/core@3.3.1): resolution: {integrity: sha512-WPOEZCxAaw9JBhkneIW3bm6SqceUtZGxDT++3SlwKUyn4kr0p808LrCVITooUkyqrd0lOn9TAFKFNjinUxbCGw==} peerDependencies: @@ -1871,6 +1885,10 @@ packages: engines: {node: '>= 0.6'} dev: true + /cropperjs@1.5.7: + resolution: {integrity: sha512-sGj+G/ofKh+f6A4BtXLJwtcKJgMUsXYVUubfTo9grERiDGXncttefmue/fyQFvn8wfdyoD1KhDRYLfjkJFl0yw==} + dev: false + /cross-spawn@6.0.5: resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} engines: {node: '>=4.8'} diff --git a/src/client/index.ts b/src/client/index.ts index 5ac6a31..7c7c1cd 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -1,11 +1,13 @@ import Uppy from "@uppy/core"; import Dashboard from "@uppy/dashboard"; import GoldenRetriever from "@uppy/golden-retriever"; +import ImageEditor from "@uppy/image-editor"; import S3 from "@uppy/aws-s3"; import { ofetch } from "ofetch"; import "@uppy/core/dist/style.min.css"; import "@uppy/dashboard/dist/style.min.css"; +import "@uppy/image-editor/dist/style.min.css"; new Uppy() .use(Dashboard, { @@ -15,6 +17,7 @@ new Uppy() showLinkToFileUploadResult: true, }) .use(GoldenRetriever, { serviceWorker: true }) + .use(ImageEditor, { target: Dashboard, quality: 1.0 }) .use(S3, { // Only use multipart uploads for files larger than 100 MB. shouldUseMultipart: true, // TODO: (file) => file.size > 100 * 2 ** 20,