From da3b1cb8c2f386c803ae9376375bac444e405ab9 Mon Sep 17 00:00:00 2001 From: Rajesh Babu Date: Tue, 1 Oct 2024 19:55:43 +0200 Subject: [PATCH] CHORE: Integrating uppy --- app/globals.css | 6 + components/uploader/upload-image.tsx | 12 +- components/uploader/uppy-uploader.tsx | 66 ++++ package-lock.json | 445 ++++++++++++++++++++++++++ package.json | 5 + tailwind.config.ts | 1 + 6 files changed, 527 insertions(+), 8 deletions(-) create mode 100644 components/uploader/uppy-uploader.tsx diff --git a/app/globals.css b/app/globals.css index 0bbddf7..66f26ae 100644 --- a/app/globals.css +++ b/app/globals.css @@ -80,3 +80,9 @@ @apply px-4; } } + +@layer components { + .uppy-Dashboard-inner { + @apply !w-full !max-w-none; + } +} \ No newline at end of file diff --git a/components/uploader/upload-image.tsx b/components/uploader/upload-image.tsx index 4892843..43afa4f 100644 --- a/components/uploader/upload-image.tsx +++ b/components/uploader/upload-image.tsx @@ -11,7 +11,8 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { FileUploader } from "@/components/uploader/file-uploader"; + +import { UppyUploader } from "./uppy-uploader"; export function UploadImage() { const { data: session } = useSession(); @@ -24,19 +25,14 @@ export function UploadImage() { - + Upload files Drag and drop your files here or click to browse. - + ); diff --git a/components/uploader/uppy-uploader.tsx b/components/uploader/uppy-uploader.tsx new file mode 100644 index 0000000..4618010 --- /dev/null +++ b/components/uploader/uppy-uploader.tsx @@ -0,0 +1,66 @@ +"use client"; + +import Uppy from "@uppy/core"; +import { Dashboard } from "@uppy/react"; +import AwsS3 from "@uppy/aws-s3"; + +import "@uppy/core/dist/style.min.css"; +import "@uppy/dashboard/dist/style.min.css"; + +import { useState } from "react"; +import { getS3UploadParams, uploadFilesToDB } from "@/lib/s3/action"; +import { toast } from "sonner"; + +function createUppy() { + const uppy = new Uppy(); + + // @ts-ignore + return uppy.use(AwsS3, { + async getUploadParameters(fileObject, options) { + const file = fileObject.data as File; + + const { url, fields } = await getS3UploadParams( + file.name, + file.type, + file.size + ); + + if (!url || !fields) { + throw new Error("Upload URL is undefined"); + } + + uppy.setFileMeta(fileObject.id, { fileKey: fields.key }); + + return { + url, + method: "POST", + fields, + }; + }, + }); +} + +export function UppyUploader() { + const [uppy] = useState(createUppy()); + + uppy.on("complete", async (result) => { + console.log("complete", result); + + const { successful = [], failed } = result; + + const validUploads = successful.map((file) => { + return { + name: file.name as string, + key: file.meta.fileKey as string, + size: file.size as number, + type: file.type as string, + }; + }); + + const messageDB = await uploadFilesToDB(validUploads); + + toast.success(`${validUploads.length} files uploaded successfully!`); + }); + + return ; +} diff --git a/package-lock.json b/package-lock.json index 9409dd1..ede675d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,10 @@ "@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.2", + "@uppy/aws-s3": "^4.1.0", + "@uppy/core": "^4.2.1", + "@uppy/react": "^4.0.2", + "@uppy/xhr-upload": "^4.2.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "dotenv": "^16.4.5", @@ -33,6 +37,7 @@ "react": "^18", "react-dom": "^18", "react-dropzone": "^14.2.3", + "react-filepond": "^7.1.2", "react-intersection-observer": "^9.13.1", "sonner": "^1.5.0", "tailwind-merge": "^2.5.2", @@ -3570,6 +3575,11 @@ "tslib": "^2.4.0" } }, + "node_modules/@transloadit/prettier-bytes": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@transloadit/prettier-bytes/-/prettier-bytes-0.3.4.tgz", + "integrity": "sha512-8/SnIF9Q2k52mbjRVAYLranwkaDTLb+O9r4Z/uo8uNw//SjygKvvbF4BHSOuReufaAyum1q13602VcNud25Dfg==" + }, "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", @@ -3615,6 +3625,11 @@ "@types/react": "*" } }, + "node_modules/@types/retry": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz", + "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==" + }, "node_modules/@types/uuid": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", @@ -3833,6 +3848,289 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, + "node_modules/@uppy/aws-s3": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@uppy/aws-s3/-/aws-s3-4.1.0.tgz", + "integrity": "sha512-xRip1Lo3He+3J3fP/SooEFQJKWMCVADTl8J375PzvpaeNnDFKa6W2XLEEl/fGy/K7vI4sH8Znz4+omdtSFCPSQ==", + "dependencies": { + "@uppy/companion-client": "^4.1.0", + "@uppy/utils": "^6.0.2" + }, + "peerDependencies": { + "@uppy/core": "^4.2.0" + } + }, + "node_modules/@uppy/companion-client": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@uppy/companion-client/-/companion-client-4.1.0.tgz", + "integrity": "sha512-nQ8CQfZcYVBNtFQ6ePj7FDIq38DXlH0YpzP/91LR9gnDVISJKKUuvWfr6tPktj1lRw9FZV8jLmlMKT2ituVKiw==", + "dependencies": { + "@uppy/utils": "^6.0.2", + "namespace-emitter": "^2.0.1", + "p-retry": "^6.1.0" + }, + "peerDependencies": { + "@uppy/core": "^4.2.0" + } + }, + "node_modules/@uppy/core": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@uppy/core/-/core-4.2.1.tgz", + "integrity": "sha512-5u6hoyESYbAswnSevo5mHnOQANqiEk1X3y4/JobmQEMdPJegbWgbZ0hpTx7zk/rBpEj5hr+xxNPF3LqqkC369g==", + "dependencies": { + "@transloadit/prettier-bytes": "^0.3.4", + "@uppy/store-default": "^4.1.0", + "@uppy/utils": "^6.0.2", + "lodash": "^4.17.21", + "mime-match": "^1.0.2", + "namespace-emitter": "^2.0.1", + "nanoid": "^5.0.0", + "preact": "^10.5.13" + } + }, + "node_modules/@uppy/core/node_modules/nanoid": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.7.tgz", + "integrity": "sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/@uppy/dashboard": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@uppy/dashboard/-/dashboard-4.1.0.tgz", + "integrity": "sha512-TSwgW1x0YDnZP4yJwxVrxO6vsW3GrWoqXwOdpcTGDwdIOvZZJBAajqr3QrVdkbz1L4YfQAgTtHZlyUhm5qMuzg==", + "optional": true, + "peer": true, + "dependencies": { + "@transloadit/prettier-bytes": "^0.3.4", + "@uppy/informer": "^4.1.0", + "@uppy/provider-views": "^4.0.1", + "@uppy/status-bar": "^4.0.3", + "@uppy/thumbnail-generator": "^4.0.0", + "@uppy/utils": "^6.0.2", + "classnames": "^2.2.6", + "lodash": "^4.17.21", + "memoize-one": "^6.0.0", + "nanoid": "^5.0.0", + "preact": "^10.5.13", + "shallow-equal": "^3.0.0" + }, + "peerDependencies": { + "@uppy/core": "^4.2.0" + } + }, + "node_modules/@uppy/dashboard/node_modules/nanoid": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.7.tgz", + "integrity": "sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "optional": true, + "peer": true, + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/@uppy/drag-drop": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@uppy/drag-drop/-/drag-drop-4.0.2.tgz", + "integrity": "sha512-0/b8hBAX8tDBikkr2tORtKT3gEcCxQlygSBCJrbLTQTDh4poTpmHWyquqvsCcBtW7AqULhQn5h/xSSacBnEf/Q==", + "optional": true, + "peer": true, + "dependencies": { + "@uppy/utils": "^6.0.2", + "preact": "^10.5.13" + }, + "peerDependencies": { + "@uppy/core": "^4.1.1" + } + }, + "node_modules/@uppy/file-input": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@uppy/file-input/-/file-input-4.0.1.tgz", + "integrity": "sha512-UKZXl3089OVserkSA52TkPVBjJUsqEWcT9+UxuPUz/m+lS51uXonK0yl9ZrSCqkY+4yhLcdEdH0xW1XrJXNHYg==", + "optional": true, + "peer": true, + "dependencies": { + "@uppy/utils": "^6.0.2", + "preact": "^10.5.13" + }, + "peerDependencies": { + "@uppy/core": "^4.1.1" + } + }, + "node_modules/@uppy/informer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@uppy/informer/-/informer-4.1.0.tgz", + "integrity": "sha512-Dzq7bEnUUePd7Syy6bDgzwSc16Re1tDYqP/sivtvPDrqINz8gUIST6IxN0GxRoSH732EjGiMlSf3OjwV/N18xQ==", + "optional": true, + "peer": true, + "dependencies": { + "@uppy/utils": "^6.0.2", + "preact": "^10.5.13" + }, + "peerDependencies": { + "@uppy/core": "^4.2.0" + } + }, + "node_modules/@uppy/progress-bar": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@uppy/progress-bar/-/progress-bar-4.0.0.tgz", + "integrity": "sha512-hCUjlfGWHlvBPQDO5YBH/8HEr+3+ZEobTblBg0Wbn3ecJSiKkSRi0GkDVp3OMnwfqgK2wm8Ve+tR/5Gds7vE0A==", + "optional": true, + "peer": true, + "dependencies": { + "@uppy/utils": "^6.0.0", + "preact": "^10.5.13" + }, + "peerDependencies": { + "@uppy/core": "^4.0.0" + } + }, + "node_modules/@uppy/provider-views": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@uppy/provider-views/-/provider-views-4.0.1.tgz", + "integrity": "sha512-oAOIVdCSPIpDZJXwU83o+13+qWYrIfRzJaXom7ZsJpj+WDbtFjML5iF3evDmqt22V3HwOC0N187lZvcO/9RwFA==", + "optional": true, + "peer": true, + "dependencies": { + "@uppy/utils": "^6.0.2", + "classnames": "^2.2.6", + "nanoid": "^5.0.0", + "p-queue": "^8.0.0", + "preact": "^10.5.13" + }, + "peerDependencies": { + "@uppy/core": "^4.1.1" + } + }, + "node_modules/@uppy/provider-views/node_modules/nanoid": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.7.tgz", + "integrity": "sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "optional": true, + "peer": true, + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/@uppy/react": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@uppy/react/-/react-4.0.2.tgz", + "integrity": "sha512-q0IKlldfAmAWhpDyx19U3nCDO/aRXkjP/E3e/k1uWNMRTCBEtYdXPN/UIaYMsn3NcUwae/g/jOOV79OiB5WW0w==", + "dependencies": { + "@uppy/utils": "^6.0.2", + "use-sync-external-store": "^1.2.0" + }, + "peerDependencies": { + "@uppy/core": "^4.1.2", + "@uppy/dashboard": "^4.0.3", + "@uppy/drag-drop": "^4.0.2", + "@uppy/file-input": "^4.0.1", + "@uppy/progress-bar": "^4.0.0", + "@uppy/status-bar": "^4.0.3", + "react": "^18.0.0" + }, + "peerDependenciesMeta": { + "@uppy/dashboard": { + "optional": true + }, + "@uppy/drag-drop": { + "optional": true + }, + "@uppy/file-input": { + "optional": true + }, + "@uppy/progress-bar": { + "optional": true + }, + "@uppy/status-bar": { + "optional": true + } + } + }, + "node_modules/@uppy/status-bar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@uppy/status-bar/-/status-bar-4.0.3.tgz", + "integrity": "sha512-ckujiEQwHgpJGa5Q6OZF+hJ+3JSMgs/7vyl4aeBvV0zSWoPSg/W10TpyGeNvMaaAsbAs4UB+0LuUjVu/vSmFcw==", + "optional": true, + "peer": true, + "dependencies": { + "@transloadit/prettier-bytes": "^0.3.4", + "@uppy/utils": "^6.0.2", + "classnames": "^2.2.6", + "preact": "^10.5.13" + }, + "peerDependencies": { + "@uppy/core": "^4.1.2" + } + }, + "node_modules/@uppy/store-default": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@uppy/store-default/-/store-default-4.1.0.tgz", + "integrity": "sha512-z5VSc4PNXpAtrrUPg5hdKJO5Ul7u4ZYLyK+tYzvEgzgR4nLVZmpGzj/d4N90jXpUqEibWKXvevODEB5VlTLHzg==" + }, + "node_modules/@uppy/thumbnail-generator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@uppy/thumbnail-generator/-/thumbnail-generator-4.0.0.tgz", + "integrity": "sha512-nwgRO/LHLzUqzyB1TDl6g8LNmqtkswXpvRNcPij0gOrPTTWjGY6ULv+ywXYiF5baWF2aGS+K62jJSUGBWonx0w==", + "optional": true, + "peer": true, + "dependencies": { + "@uppy/utils": "^6.0.0", + "exifr": "^7.0.0" + }, + "peerDependencies": { + "@uppy/core": "^4.0.0" + } + }, + "node_modules/@uppy/utils": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-6.0.2.tgz", + "integrity": "sha512-ZoNeAa1YTKSlcvXe1SP3POjzjRZ9jSojorbst03vwd1Ks9vHPGf6pne61DowTXHZ3HMj1vpcIaQ1VIEWeeADlA==", + "dependencies": { + "lodash": "^4.17.21", + "preact": "^10.5.13" + } + }, + "node_modules/@uppy/xhr-upload": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@uppy/xhr-upload/-/xhr-upload-4.2.0.tgz", + "integrity": "sha512-MhpazjMEjFgEyB9Ewiz+ba4U3uZ6yBDrylBeMI0XSxJD5ZwygYBzqpacB6eoVZqHqyb9He90fdZnod5dD9Cc0g==", + "dependencies": { + "@uppy/companion-client": "^4.1.0", + "@uppy/utils": "^6.0.2" + }, + "peerDependencies": { + "@uppy/core": "^4.2.0" + } + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -4363,6 +4661,13 @@ "node": ">=6" } }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "optional": true, + "peer": true + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -5457,6 +5762,20 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "optional": true, + "peer": true + }, + "node_modules/exifr": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/exifr/-/exifr-7.1.3.tgz", + "integrity": "sha512-g/aje2noHivrRSLbAUtBPWFbxKdKhgj/xr1vATDdUXPOFYJlQ62Ft0oy+72V6XLIpDJfHs6gXLbBLAolqOXYRw==", + "optional": true, + "peer": true + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -5558,6 +5877,12 @@ "node": ">= 12" } }, + "node_modules/filepond": { + "version": "4.31.4", + "resolved": "https://registry.npmjs.org/filepond/-/filepond-4.31.4.tgz", + "integrity": "sha512-3kR87Rsw2OP8CktlIehdbFjWB33GEH5iLs8izl2OcZGOszUFWYTjRY6pffLpjz/gRE61u1F67rZ2++ujFiUxPQ==", + "peer": true + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -6308,6 +6633,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-network-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz", + "integrity": "sha512-tUdRRAnhT+OtCZR/LxZelH/C7QtjtFrTu5tXCA8pl55eTUElUHT+GPYV8MBMBvea/j+NxQqVt3LbWMRir7Gx9g==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -6693,6 +7029,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -6723,6 +7064,13 @@ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" } }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==", + "optional": true, + "peer": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -6743,6 +7091,14 @@ "node": ">=8.6" } }, + "node_modules/mime-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mime-match/-/mime-match-1.0.2.tgz", + "integrity": "sha512-VXp/ugGDVh3eCLOBCiHZMYWQaTNUHv2IJrut+yXA6+JbLPXHglHwfS/5A5L0ll+jkCY7fIzRJcH6OIunF+c6Cg==", + "dependencies": { + "wildcard": "^1.1.0" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -6787,6 +7143,11 @@ "thenify-all": "^1.0.0" } }, + "node_modules/namespace-emitter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/namespace-emitter/-/namespace-emitter-2.0.1.tgz", + "integrity": "sha512-N/sMKHniSDJBjfrkbS/tpkPj4RAbvW3mr8UAzvlMHyun93XEm83IAvhWtJVHo+RHn/oO8Job5YN4b+wRjSVp5g==" + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -7146,6 +7507,52 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-queue": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", + "optional": true, + "peer": true, + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-retry": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz", + "integrity": "sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA==", + "dependencies": { + "@types/retry": "0.12.2", + "is-network-error": "^1.0.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", + "optional": true, + "peer": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -7530,6 +7937,16 @@ "react": ">= 16.8 || 18.0.0" } }, + "node_modules/react-filepond": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/react-filepond/-/react-filepond-7.1.2.tgz", + "integrity": "sha512-vrlx9o/n+jGikh6jLey+PpUGYtEZn8MdeB6JFeX/5/N/Mu75IHG+MFQbv8R27bNXvS41mDtV9Fo5DG+s6siVIA==", + "peerDependencies": { + "filepond": ">=3.7.x < 5.x", + "react": "16 - 18", + "react-dom": "16 - 18" + } + }, "node_modules/react-intersection-observer": { "version": "9.13.1", "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.13.1.tgz", @@ -7708,6 +8125,14 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -7882,6 +8307,13 @@ "node": ">= 0.4" } }, + "node_modules/shallow-equal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-3.1.0.tgz", + "integrity": "sha512-pfVOw8QZIXpMbhBWvzBISicvToTiM5WBF1EeAUZDDSb5Dt29yl4AYbyywbJFSEsRUMr7gJaxqCdr4L3tQf9wVg==", + "optional": true, + "peer": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -9000,6 +9432,14 @@ } } }, + "node_modules/use-sync-external-store": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", + "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -9124,6 +9564,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wildcard": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-1.1.2.tgz", + "integrity": "sha512-DXukZJxpHA8LuotRwL0pP1+rS6CS7FF2qStDDE1C7DDg2rLud2PXRMuEDYIPhgEezwnlHNL4c+N6MfMTjCGTng==" + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", diff --git a/package.json b/package.json index 349d595..fb9c304 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,10 @@ "@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.2", + "@uppy/aws-s3": "^4.1.0", + "@uppy/core": "^4.2.1", + "@uppy/react": "^4.0.2", + "@uppy/xhr-upload": "^4.2.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "dotenv": "^16.4.5", @@ -42,6 +46,7 @@ "react": "^18", "react-dom": "^18", "react-dropzone": "^14.2.3", + "react-filepond": "^7.1.2", "react-intersection-observer": "^9.13.1", "sonner": "^1.5.0", "tailwind-merge": "^2.5.2", diff --git a/tailwind.config.ts b/tailwind.config.ts index 7fb6934..439ad1e 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -97,6 +97,7 @@ const config = { }, }, plugins: [require("tailwindcss-animate")], + safelist: ["uppy-Dashboard-inner"], } satisfies Config; export default config;