@depup/uploadthing 7.7.4-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/changes.json +18 -0
- package/client/index.cjs +331 -0
- package/client/index.d.cts +36 -0
- package/client/index.d.cts.map +1 -0
- package/client/index.d.ts +36 -0
- package/client/index.d.ts.map +1 -0
- package/client/index.js +286 -0
- package/client/index.js.map +1 -0
- package/client-future/index.cjs +426 -0
- package/client-future/index.d.cts +373 -0
- package/client-future/index.d.cts.map +1 -0
- package/client-future/index.d.ts +373 -0
- package/client-future/index.d.ts.map +1 -0
- package/client-future/index.js +383 -0
- package/client-future/index.js.map +1 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/deprecations-DPGpmqha.cjs +13 -0
- package/dist/deprecations-pLmw6Ytd.js +8 -0
- package/dist/deprecations-pLmw6Ytd.js.map +1 -0
- package/dist/package-BQ_k22T9.cjs +11 -0
- package/dist/package-DpScpvTA.js +6 -0
- package/dist/package-DpScpvTA.js.map +1 -0
- package/dist/shared-schemas-BmG5ARoX.js +82 -0
- package/dist/shared-schemas-BmG5ARoX.js.map +1 -0
- package/dist/shared-schemas-CG9VaBtT.cjs +129 -0
- package/dist/to-web-request-BQtxSXgE.cjs +98 -0
- package/dist/to-web-request-DhP0wXG-.js +87 -0
- package/dist/to-web-request-DhP0wXG-.js.map +1 -0
- package/dist/types-Bs3w2d_3.d.ts +627 -0
- package/dist/types-Bs3w2d_3.d.ts.map +1 -0
- package/dist/types-DiVC1t2V.d.cts +625 -0
- package/dist/types-DiVC1t2V.d.cts.map +1 -0
- package/dist/upload-builder-BUa7tovh.d.cts +32 -0
- package/dist/upload-builder-BUa7tovh.d.cts.map +1 -0
- package/dist/upload-builder-BcFawEj0.d.ts +32 -0
- package/dist/upload-builder-BcFawEj0.d.ts.map +1 -0
- package/dist/upload-builder-BlFOAnsv.js +699 -0
- package/dist/upload-builder-BlFOAnsv.js.map +1 -0
- package/dist/upload-builder-D6Ken9H0.cjs +794 -0
- package/dist/ut-reporter-BHoyNnzW.cjs +120 -0
- package/dist/ut-reporter-Dlppchbx.js +103 -0
- package/dist/ut-reporter-Dlppchbx.js.map +1 -0
- package/effect-platform/index.cjs +22 -0
- package/effect-platform/index.d.cts +54 -0
- package/effect-platform/index.d.cts.map +1 -0
- package/effect-platform/index.d.ts +54 -0
- package/effect-platform/index.d.ts.map +1 -0
- package/effect-platform/index.js +19 -0
- package/effect-platform/index.js.map +1 -0
- package/express/index.cjs +30 -0
- package/express/index.d.cts +28 -0
- package/express/index.d.cts.map +1 -0
- package/express/index.d.ts +28 -0
- package/express/index.d.ts.map +1 -0
- package/express/index.js +27 -0
- package/express/index.js.map +1 -0
- package/fastify/index.cjs +27 -0
- package/fastify/index.d.cts +28 -0
- package/fastify/index.d.cts.map +1 -0
- package/fastify/index.d.ts +28 -0
- package/fastify/index.d.ts.map +1 -0
- package/fastify/index.js +24 -0
- package/fastify/index.js.map +1 -0
- package/h3/index.cjs +20 -0
- package/h3/index.d.cts +28 -0
- package/h3/index.d.cts.map +1 -0
- package/h3/index.d.ts +28 -0
- package/h3/index.d.ts.map +1 -0
- package/h3/index.js +17 -0
- package/h3/index.js.map +1 -0
- package/next/index.cjs +22 -0
- package/next/index.d.cts +30 -0
- package/next/index.d.cts.map +1 -0
- package/next/index.d.ts +30 -0
- package/next/index.d.ts.map +1 -0
- package/next/index.js +19 -0
- package/next/index.js.map +1 -0
- package/next-legacy/index.cjs +28 -0
- package/next-legacy/index.d.cts +28 -0
- package/next-legacy/index.d.cts.map +1 -0
- package/next-legacy/index.d.ts +28 -0
- package/next-legacy/index.d.ts.map +1 -0
- package/next-legacy/index.js +25 -0
- package/next-legacy/index.js.map +1 -0
- package/package.json +210 -0
- package/remix/index.cjs +22 -0
- package/remix/index.d.cts +30 -0
- package/remix/index.d.cts.map +1 -0
- package/remix/index.d.ts +30 -0
- package/remix/index.d.ts.map +1 -0
- package/remix/index.js +19 -0
- package/remix/index.js.map +1 -0
- package/server/index.cjs +414 -0
- package/server/index.d.cts +211 -0
- package/server/index.d.cts.map +1 -0
- package/server/index.d.ts +213 -0
- package/server/index.d.ts.map +1 -0
- package/server/index.js +405 -0
- package/server/index.js.map +1 -0
- package/tw/index.cjs +70 -0
- package/tw/index.d.cts +29 -0
- package/tw/index.d.cts.map +1 -0
- package/tw/index.d.ts +29 -0
- package/tw/index.d.ts.map +1 -0
- package/tw/index.js +74 -0
- package/tw/index.js.map +1 -0
- package/tw/v4.css +11 -0
- package/types/index.cjs +3 -0
- package/types/index.d.cts +2 -0
- package/types/index.d.ts +2 -0
- package/types/index.js +3 -0
package/tw/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { dirname, sep } from "node:path";
|
|
3
|
+
import plugin from "tailwindcss/plugin";
|
|
4
|
+
|
|
5
|
+
//#region rolldown:runtime
|
|
6
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/tw/plugin.ts
|
|
10
|
+
/**
|
|
11
|
+
* UploadThing Tailwind plugin which injects custom variants
|
|
12
|
+
* for the built-in UI components
|
|
13
|
+
* @see https://docs.uploadthing.com/concepts/theming#theming-with-tailwind-css
|
|
14
|
+
*
|
|
15
|
+
* When using this, you need to specify `content` manually. For automatic
|
|
16
|
+
* detection, see {@link withUt}.
|
|
17
|
+
*/
|
|
18
|
+
const uploadthingPlugin = plugin(($) => {
|
|
19
|
+
$.addVariant("ut-button", "&>*[data-ut-element=\"button\"]");
|
|
20
|
+
$.addVariant("ut-allowed-content", "&>*[data-ut-element=\"allowed-content\"]");
|
|
21
|
+
$.addVariant("ut-label", "&>*[data-ut-element=\"label\"]");
|
|
22
|
+
$.addVariant("ut-upload-icon", "&>*[data-ut-element=\"upload-icon\"]");
|
|
23
|
+
$.addVariant("ut-clear-btn", "&>*[data-ut-element=\"clear-btn\"]");
|
|
24
|
+
$.addVariant("ut-readying", "&[data-state=\"readying\"]");
|
|
25
|
+
$.addVariant("ut-ready", "&[data-state=\"ready\"]");
|
|
26
|
+
$.addVariant("ut-uploading", "&[data-state=\"uploading\"]");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/tw/index.ts
|
|
31
|
+
/**
|
|
32
|
+
* Add more here when additional UI packages are added
|
|
33
|
+
*/
|
|
34
|
+
const PACKAGES = [
|
|
35
|
+
"react",
|
|
36
|
+
"solid",
|
|
37
|
+
"svelte",
|
|
38
|
+
"vue"
|
|
39
|
+
];
|
|
40
|
+
/**
|
|
41
|
+
* HOF for Tailwind config that adds the
|
|
42
|
+
* {@link uploadthingPlugin} to the Tailwind config
|
|
43
|
+
* as well as adds content paths to detect the necessary
|
|
44
|
+
* classnames
|
|
45
|
+
*/
|
|
46
|
+
function withUt(twConfig) {
|
|
47
|
+
const contentPaths = PACKAGES.map((pkg) => {
|
|
48
|
+
try {
|
|
49
|
+
const resolved = __require.resolve(`@uploadthing/${pkg}`, { paths: [...module.paths, process.cwd()] });
|
|
50
|
+
return dirname(resolved) + sep + "**";
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}).filter((s) => s != null);
|
|
55
|
+
if (contentPaths.length === 0) console.warn(`
|
|
56
|
+
[uploadthing]: Unable to resolve path for uploadthing UI packages. As a workaround, you can manually add the paths to your content paths:
|
|
57
|
+
- Find where your package manager has installed the distribution files, e.g. './node_modules/@uploadthing/react'.
|
|
58
|
+
Note: If you have a monorepo, you may need to look up the tree to find the correct path.
|
|
59
|
+
- Add the path to the 'content' field in your Tailwind configuration:
|
|
60
|
+
content: [
|
|
61
|
+
// your other content paths
|
|
62
|
+
'./node_modules/@uploadthing/react/dist**' // <-- add this line
|
|
63
|
+
]
|
|
64
|
+
`);
|
|
65
|
+
if (Array.isArray(twConfig.content)) twConfig.content.push(...contentPaths);
|
|
66
|
+
else twConfig.content.files.push(...contentPaths);
|
|
67
|
+
twConfig.plugins ??= [];
|
|
68
|
+
twConfig.plugins.push(uploadthingPlugin);
|
|
69
|
+
return twConfig;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { uploadthingPlugin, withUt };
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
package/tw/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["twConfig: Config"],"sources":["../src/tw/plugin.ts","../src/tw/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\n/**\n * UploadThing Tailwind plugin which injects custom variants\n * for the built-in UI components\n * @see https://docs.uploadthing.com/concepts/theming#theming-with-tailwind-css\n *\n * When using this, you need to specify `content` manually. For automatic\n * detection, see {@link withUt}.\n */\nexport const uploadthingPlugin = plugin(($) => {\n // Variants to select specific underlying element\n $.addVariant(\"ut-button\", '&>*[data-ut-element=\"button\"]');\n $.addVariant(\"ut-allowed-content\", '&>*[data-ut-element=\"allowed-content\"]');\n $.addVariant(\"ut-label\", '&>*[data-ut-element=\"label\"]');\n $.addVariant(\"ut-upload-icon\", '&>*[data-ut-element=\"upload-icon\"]');\n $.addVariant(\"ut-clear-btn\", '&>*[data-ut-element=\"clear-btn\"]');\n\n // Variants to select specific state\n $.addVariant(\"ut-readying\", '&[data-state=\"readying\"]');\n $.addVariant(\"ut-ready\", '&[data-state=\"ready\"]');\n $.addVariant(\"ut-uploading\", '&[data-state=\"uploading\"]');\n});\n","import { dirname, sep } from \"node:path\";\nimport type { Config } from \"tailwindcss\";\n\nimport { uploadthingPlugin } from \"./plugin\";\n\nexport { uploadthingPlugin };\n\n/**\n * Add more here when additional UI packages are added\n */\nconst PACKAGES = [\"react\", \"solid\", \"svelte\", \"vue\"];\n\n/**\n * HOF for Tailwind config that adds the\n * {@link uploadthingPlugin} to the Tailwind config\n * as well as adds content paths to detect the necessary\n * classnames\n */\nexport function withUt(twConfig: Config) {\n const contentPaths = PACKAGES.map((pkg) => {\n try {\n const resolved = require.resolve(`@uploadthing/${pkg}`, {\n paths: [...module.paths, process.cwd()],\n });\n\n return dirname(resolved) + sep + \"**\";\n } catch {\n return null;\n }\n }).filter((s) => s != null);\n\n if (contentPaths.length === 0) {\n // eslint-disable-next-line no-console\n console.warn(`\n [uploadthing]: Unable to resolve path for uploadthing UI packages. As a workaround, you can manually add the paths to your content paths: \n - Find where your package manager has installed the distribution files, e.g. './node_modules/@uploadthing/react'.\n Note: If you have a monorepo, you may need to look up the tree to find the correct path.\n - Add the path to the 'content' field in your Tailwind configuration: \n content: [\n // your other content paths\n './node_modules/@uploadthing/react/dist**' // <-- add this line\n ]\n `);\n }\n\n if (Array.isArray(twConfig.content)) {\n twConfig.content.push(...contentPaths);\n } else {\n // content can be an object too with `files` property\n twConfig.content.files.push(...contentPaths);\n }\n\n twConfig.plugins ??= [];\n twConfig.plugins.push(uploadthingPlugin);\n\n return twConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,MAAa,oBAAoB,OAAO,CAAC,MAAM;CAE7C,EAAE,WAAW,aAAa,kCAAgC;CAC1D,EAAE,WAAW,sBAAsB,2CAAyC;CAC5E,EAAE,WAAW,YAAY,iCAA+B;CACxD,EAAE,WAAW,kBAAkB,uCAAqC;CACpE,EAAE,WAAW,gBAAgB,qCAAmC;CAGhE,EAAE,WAAW,eAAe,6BAA2B;CACvD,EAAE,WAAW,YAAY,0BAAwB;CACjD,EAAE,WAAW,gBAAgB,8BAA4B;AAC1D,EAAC;;;;;;;ACZF,MAAM,WAAW;CAAC;CAAS;CAAS;CAAU;AAAM;;;;;;;AAQpD,SAAgB,OAAOA,UAAkB;CACvC,MAAM,eAAe,SAAS,IAAI,CAAC,QAAQ;AACzC,MAAI;GACF,MAAM,qBAAmB,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE,EACtD,OAAO,CAAC,GAAG,OAAO,OAAO,QAAQ,KAAK,AAAC,EACxC,EAAC;AAEF,UAAO,QAAQ,SAAS,GAAG,MAAM;EAClC,QAAO;AACN,UAAO;EACR;CACF,EAAC,CAAC,OAAO,CAAC,MAAM,KAAK,KAAK;AAE3B,KAAI,aAAa,WAAW,GAE1B,QAAQ,KAAK,CAAC;;;;;;;;;IASd,CAAC,CAAC;AAGJ,KAAI,MAAM,QAAQ,SAAS,QAAQ,EACjC,SAAS,QAAQ,KAAK,GAAG,aAAa;MAGtC,SAAS,QAAQ,MAAM,KAAK,GAAG,aAAa;CAG9C,SAAS,YAAY,CAAE;CACvB,SAAS,QAAQ,KAAK,kBAAkB;AAExC,QAAO;AACR"}
|
package/tw/v4.css
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* Elements */
|
|
2
|
+
@custom-variant ut-button (&>*[data-ut-element="button"]);
|
|
3
|
+
@custom-variant ut-allowed-content (&>*[data-ut-element="allowed-content"]);
|
|
4
|
+
@custom-variant ut-label (&>*[data-ut-element="label"]);
|
|
5
|
+
@custom-variant ut-upload-icon (&>*[data-ut-element="upload-icon"]);
|
|
6
|
+
@custom-variant ut-clear-btn (&>*[data-ut-element="clear-btn"]);
|
|
7
|
+
|
|
8
|
+
/* States */
|
|
9
|
+
@custom-variant ut-readying (&[data-state="readying"]);
|
|
10
|
+
@custom-variant ut-ready (&[data-state="ready"]);
|
|
11
|
+
@custom-variant ut-uploading (&[data-state="uploading"]);
|
package/types/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ACLUpdateOptions, AnyFileRoute, ClientUploadedFileData, CreateUploadOptions, DeleteFilesOptions, EndpointArg, EndpointMetadata, ExpandedRouteConfig, FileEsque, FileRoute, FileRouter, FileUploadData, FileUploadDataWithCustomId, GenerateSignedURLOptions, GenerateUploaderOptions, GetFileUrlsOptions, GetSignedURLOptions, ListFilesOptions, NewPresignedUrl, RenameFileUpdate, RouteHandlerConfig, RouteHandlerOptions, RouteRegistry, UTApiOptions, UTRegionAlias, UploadFileResult, UploadFilesOptions, UploadThingToken, UploadedFileData, UrlWithOverrides, inferEndpointInput, inferEndpointOutput, inferErrorShape } from "../dist/types-DiVC1t2V.cjs";
|
|
2
|
+
export { ACLUpdateOptions, AnyFileRoute, ClientUploadedFileData, CreateUploadOptions, DeleteFilesOptions, EndpointArg, EndpointMetadata, ExpandedRouteConfig, FileEsque, FileRoute, FileRouter, FileUploadData, FileUploadDataWithCustomId, GenerateSignedURLOptions, GenerateUploaderOptions, GetFileUrlsOptions, GetSignedURLOptions, ListFilesOptions, NewPresignedUrl, RenameFileUpdate, RouteHandlerConfig, RouteHandlerOptions, RouteRegistry, UTApiOptions, UTRegionAlias, UploadFileResult, UploadFilesOptions, UploadThingToken, UploadedFileData, UrlWithOverrides, inferEndpointInput, inferEndpointOutput, inferErrorShape };
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ACLUpdateOptions, AnyFileRoute, ClientUploadedFileData, CreateUploadOptions, DeleteFilesOptions, EndpointArg, EndpointMetadata, ExpandedRouteConfig, FileEsque, FileRoute, FileRouter, FileUploadData, FileUploadDataWithCustomId, GenerateSignedURLOptions, GenerateUploaderOptions, GetFileUrlsOptions, GetSignedURLOptions, ListFilesOptions, NewPresignedUrl, RenameFileUpdate, RouteHandlerConfig, RouteHandlerOptions, RouteRegistry, UTApiOptions, UTRegionAlias, UploadFileResult, UploadFilesOptions, UploadThingToken, UploadedFileData, UrlWithOverrides, inferEndpointInput, inferEndpointOutput, inferErrorShape } from "../dist/types-Bs3w2d_3.js";
|
|
2
|
+
export { ACLUpdateOptions, AnyFileRoute, ClientUploadedFileData, CreateUploadOptions, DeleteFilesOptions, EndpointArg, EndpointMetadata, ExpandedRouteConfig, FileEsque, FileRoute, FileRouter, FileUploadData, FileUploadDataWithCustomId, GenerateSignedURLOptions, GenerateUploaderOptions, GetFileUrlsOptions, GetSignedURLOptions, ListFilesOptions, NewPresignedUrl, RenameFileUpdate, RouteHandlerConfig, RouteHandlerOptions, RouteRegistry, UTApiOptions, UTRegionAlias, UploadFileResult, UploadFilesOptions, UploadThingToken, UploadedFileData, UrlWithOverrides, inferEndpointInput, inferEndpointOutput, inferErrorShape };
|
package/types/index.js
ADDED