@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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/changes.json +18 -0
  4. package/client/index.cjs +331 -0
  5. package/client/index.d.cts +36 -0
  6. package/client/index.d.cts.map +1 -0
  7. package/client/index.d.ts +36 -0
  8. package/client/index.d.ts.map +1 -0
  9. package/client/index.js +286 -0
  10. package/client/index.js.map +1 -0
  11. package/client-future/index.cjs +426 -0
  12. package/client-future/index.d.cts +373 -0
  13. package/client-future/index.d.cts.map +1 -0
  14. package/client-future/index.d.ts +373 -0
  15. package/client-future/index.d.ts.map +1 -0
  16. package/client-future/index.js +383 -0
  17. package/client-future/index.js.map +1 -0
  18. package/dist/chunk-CUT6urMc.cjs +30 -0
  19. package/dist/deprecations-DPGpmqha.cjs +13 -0
  20. package/dist/deprecations-pLmw6Ytd.js +8 -0
  21. package/dist/deprecations-pLmw6Ytd.js.map +1 -0
  22. package/dist/package-BQ_k22T9.cjs +11 -0
  23. package/dist/package-DpScpvTA.js +6 -0
  24. package/dist/package-DpScpvTA.js.map +1 -0
  25. package/dist/shared-schemas-BmG5ARoX.js +82 -0
  26. package/dist/shared-schemas-BmG5ARoX.js.map +1 -0
  27. package/dist/shared-schemas-CG9VaBtT.cjs +129 -0
  28. package/dist/to-web-request-BQtxSXgE.cjs +98 -0
  29. package/dist/to-web-request-DhP0wXG-.js +87 -0
  30. package/dist/to-web-request-DhP0wXG-.js.map +1 -0
  31. package/dist/types-Bs3w2d_3.d.ts +627 -0
  32. package/dist/types-Bs3w2d_3.d.ts.map +1 -0
  33. package/dist/types-DiVC1t2V.d.cts +625 -0
  34. package/dist/types-DiVC1t2V.d.cts.map +1 -0
  35. package/dist/upload-builder-BUa7tovh.d.cts +32 -0
  36. package/dist/upload-builder-BUa7tovh.d.cts.map +1 -0
  37. package/dist/upload-builder-BcFawEj0.d.ts +32 -0
  38. package/dist/upload-builder-BcFawEj0.d.ts.map +1 -0
  39. package/dist/upload-builder-BlFOAnsv.js +699 -0
  40. package/dist/upload-builder-BlFOAnsv.js.map +1 -0
  41. package/dist/upload-builder-D6Ken9H0.cjs +794 -0
  42. package/dist/ut-reporter-BHoyNnzW.cjs +120 -0
  43. package/dist/ut-reporter-Dlppchbx.js +103 -0
  44. package/dist/ut-reporter-Dlppchbx.js.map +1 -0
  45. package/effect-platform/index.cjs +22 -0
  46. package/effect-platform/index.d.cts +54 -0
  47. package/effect-platform/index.d.cts.map +1 -0
  48. package/effect-platform/index.d.ts +54 -0
  49. package/effect-platform/index.d.ts.map +1 -0
  50. package/effect-platform/index.js +19 -0
  51. package/effect-platform/index.js.map +1 -0
  52. package/express/index.cjs +30 -0
  53. package/express/index.d.cts +28 -0
  54. package/express/index.d.cts.map +1 -0
  55. package/express/index.d.ts +28 -0
  56. package/express/index.d.ts.map +1 -0
  57. package/express/index.js +27 -0
  58. package/express/index.js.map +1 -0
  59. package/fastify/index.cjs +27 -0
  60. package/fastify/index.d.cts +28 -0
  61. package/fastify/index.d.cts.map +1 -0
  62. package/fastify/index.d.ts +28 -0
  63. package/fastify/index.d.ts.map +1 -0
  64. package/fastify/index.js +24 -0
  65. package/fastify/index.js.map +1 -0
  66. package/h3/index.cjs +20 -0
  67. package/h3/index.d.cts +28 -0
  68. package/h3/index.d.cts.map +1 -0
  69. package/h3/index.d.ts +28 -0
  70. package/h3/index.d.ts.map +1 -0
  71. package/h3/index.js +17 -0
  72. package/h3/index.js.map +1 -0
  73. package/next/index.cjs +22 -0
  74. package/next/index.d.cts +30 -0
  75. package/next/index.d.cts.map +1 -0
  76. package/next/index.d.ts +30 -0
  77. package/next/index.d.ts.map +1 -0
  78. package/next/index.js +19 -0
  79. package/next/index.js.map +1 -0
  80. package/next-legacy/index.cjs +28 -0
  81. package/next-legacy/index.d.cts +28 -0
  82. package/next-legacy/index.d.cts.map +1 -0
  83. package/next-legacy/index.d.ts +28 -0
  84. package/next-legacy/index.d.ts.map +1 -0
  85. package/next-legacy/index.js +25 -0
  86. package/next-legacy/index.js.map +1 -0
  87. package/package.json +210 -0
  88. package/remix/index.cjs +22 -0
  89. package/remix/index.d.cts +30 -0
  90. package/remix/index.d.cts.map +1 -0
  91. package/remix/index.d.ts +30 -0
  92. package/remix/index.d.ts.map +1 -0
  93. package/remix/index.js +19 -0
  94. package/remix/index.js.map +1 -0
  95. package/server/index.cjs +414 -0
  96. package/server/index.d.cts +211 -0
  97. package/server/index.d.cts.map +1 -0
  98. package/server/index.d.ts +213 -0
  99. package/server/index.d.ts.map +1 -0
  100. package/server/index.js +405 -0
  101. package/server/index.js.map +1 -0
  102. package/tw/index.cjs +70 -0
  103. package/tw/index.d.cts +29 -0
  104. package/tw/index.d.cts.map +1 -0
  105. package/tw/index.d.ts +29 -0
  106. package/tw/index.d.ts.map +1 -0
  107. package/tw/index.js +74 -0
  108. package/tw/index.js.map +1 -0
  109. package/tw/v4.css +11 -0
  110. package/types/index.cjs +3 -0
  111. package/types/index.d.cts +2 -0
  112. package/types/index.d.ts +2 -0
  113. 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
@@ -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"]);
@@ -0,0 +1,3 @@
1
+ const require_shared_schemas = require('../dist/shared-schemas-CG9VaBtT.cjs');
2
+
3
+ exports.UploadThingToken = require_shared_schemas.UploadThingToken;
@@ -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 };
@@ -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
@@ -0,0 +1,3 @@
1
+ import { UploadThingToken } from "../dist/shared-schemas-BmG5ARoX.js";
2
+
3
+ export { UploadThingToken };