@panneau/fields 5.0.0-alpha.3 → 5.0.0-alpha.5

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 (88) hide show
  1. package/README.md +67 -20
  2. package/dist/file/FileField.css +54 -0
  3. package/dist/file/FileField.d.ts +50 -0
  4. package/dist/file/FileField.d.ts.map +1 -0
  5. package/dist/file/FileField.js +198 -0
  6. package/dist/file/FileField.js.map +1 -0
  7. package/dist/file/FileField.module.js +22 -0
  8. package/dist/file/FileField.module.js.map +1 -0
  9. package/dist/file/index.d.ts +3 -0
  10. package/dist/file/index.d.ts.map +1 -0
  11. package/dist/file/index.js +1 -0
  12. package/dist/index.d.ts +9 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +9 -2
  15. package/dist/localized/LocalizedField.d.ts.map +1 -1
  16. package/dist/localized/LocalizedField.js +1 -0
  17. package/dist/localized/LocalizedField.js.map +1 -1
  18. package/dist/relation/RelationField.d.ts.map +1 -1
  19. package/dist/relation/RelationField.js +24 -24
  20. package/dist/relation/RelationField.js.map +1 -1
  21. package/dist/shared/DefinitionField.d.ts +3 -1
  22. package/dist/shared/DefinitionField.d.ts.map +1 -1
  23. package/dist/shared/DefinitionField.js +80 -72
  24. package/dist/shared/DefinitionField.js.map +1 -1
  25. package/dist/shared/builtIn.d.ts +3 -2
  26. package/dist/shared/builtIn.d.ts.map +1 -1
  27. package/dist/shared/builtIn.js +5 -2
  28. package/dist/shared/builtIn.js.map +1 -1
  29. package/dist/shared/check.d.ts +27 -0
  30. package/dist/shared/check.d.ts.map +1 -0
  31. package/dist/shared/check.js +18 -0
  32. package/dist/shared/check.js.map +1 -0
  33. package/dist/shared/context.d.ts +15 -2
  34. package/dist/shared/context.d.ts.map +1 -1
  35. package/dist/shared/context.js +26 -18
  36. package/dist/shared/context.js.map +1 -1
  37. package/dist/shared/entry.d.ts +4 -0
  38. package/dist/shared/entry.d.ts.map +1 -1
  39. package/dist/shared/entry.js +12 -1
  40. package/dist/shared/entry.js.map +1 -1
  41. package/dist/shared/types.d.ts +2 -0
  42. package/dist/shared/types.d.ts.map +1 -1
  43. package/dist/slug/SlugField.css +18 -0
  44. package/dist/slug/SlugField.d.ts +31 -3
  45. package/dist/slug/SlugField.d.ts.map +1 -1
  46. package/dist/slug/SlugField.js +231 -159
  47. package/dist/slug/SlugField.js.map +1 -1
  48. package/dist/slug/SlugField.module.js +14 -0
  49. package/dist/slug/SlugField.module.js.map +1 -0
  50. package/dist/slug/index.d.ts +1 -1
  51. package/dist/slug/index.d.ts.map +1 -1
  52. package/dist/slug/index.js +1 -1
  53. package/dist/upload/FilePicker.css +24 -0
  54. package/dist/upload/FilePicker.d.ts +14 -0
  55. package/dist/upload/FilePicker.d.ts.map +1 -0
  56. package/dist/upload/FilePicker.js +47 -0
  57. package/dist/upload/FilePicker.js.map +1 -0
  58. package/dist/upload/FilePicker.module.js +12 -0
  59. package/dist/upload/FilePicker.module.js.map +1 -0
  60. package/dist/upload/UploadList.css +93 -0
  61. package/dist/upload/UploadList.d.ts +18 -0
  62. package/dist/upload/UploadList.d.ts.map +1 -0
  63. package/dist/upload/UploadList.js +144 -0
  64. package/dist/upload/UploadList.js.map +1 -0
  65. package/dist/upload/UploadList.module.js +32 -0
  66. package/dist/upload/UploadList.module.js.map +1 -0
  67. package/dist/upload/files.d.ts +5 -0
  68. package/dist/upload/files.d.ts.map +1 -0
  69. package/dist/upload/files.js +26 -0
  70. package/dist/upload/files.js.map +1 -0
  71. package/dist/upload/types.d.ts +58 -0
  72. package/dist/upload/types.d.ts.map +1 -0
  73. package/dist/upload/useRejectionMessage.d.ts +4 -0
  74. package/dist/upload/useRejectionMessage.d.ts.map +1 -0
  75. package/dist/upload/useRejectionMessage.js +25 -0
  76. package/dist/upload/useRejectionMessage.js.map +1 -0
  77. package/dist/upload/useUploads.d.ts +30 -0
  78. package/dist/upload/useUploads.d.ts.map +1 -0
  79. package/dist/upload/useUploads.js +115 -0
  80. package/dist/upload/useUploads.js.map +1 -0
  81. package/dist/uppy/index.d.ts +3 -0
  82. package/dist/uppy/index.d.ts.map +1 -0
  83. package/dist/uppy/index.js +1 -0
  84. package/dist/uppy/uploader.d.ts +44 -0
  85. package/dist/uppy/uploader.d.ts.map +1 -0
  86. package/dist/uppy/uploader.js +139 -0
  87. package/dist/uppy/uploader.js.map +1 -0
  88. package/package.json +30 -5
@@ -0,0 +1,3 @@
1
+ export { type PresignedUploadsLike, type UppyUploadSourceOptions, createUppyUploadSource, createUppyUploader, } from './uploader';
2
+ export type { UploadItem, UploadItemStatus, UploadSource, UploadedFile, Uploader, } from '../upload/types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uppy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,sBAAsB,EACtB,kBAAkB,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EACR,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,QAAQ,GACX,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ export { createUppyUploadSource, createUppyUploader } from "./uploader.js";
@@ -0,0 +1,44 @@
1
+ import Uppy, { type Body, type Meta } from '@uppy/core';
2
+ import type { Upload, UploadSignRequest } from '@panneau/protocol';
3
+ import type { UploadSource, UploadedFile, Uploader } from '../upload/types';
4
+ /**
5
+ * Signs and completes direct uploads: `adapter.presignedUploads()` of `@panneau/data` (or
6
+ * `createPresignedUploads()`) gives one.
7
+ */
8
+ export interface PresignedUploadsLike {
9
+ signRequest(request: UploadSignRequest): Promise<{
10
+ url: string;
11
+ key?: string;
12
+ headers?: Record<string, string>;
13
+ }>;
14
+ complete(key: string, options?: {
15
+ name?: string;
16
+ }): Promise<Upload>;
17
+ }
18
+ export interface UppyUploadSourceOptions {
19
+ /** Files larger than this, in bytes, are sent in parts, which can pause and resume. Defaults to 10 MB. */
20
+ multipartThreshold?: number;
21
+ /**
22
+ * Installs what sends files on each Uppy instance: `@uppy/aws-s3` with the backend's
23
+ * signatures by default. Tests install a fake one.
24
+ */
25
+ install?: (uppy: Uppy<Meta, Body>, uploads: PresignedUploadsLike) => void;
26
+ }
27
+ /**
28
+ * An uploader on Uppy 6: files go to S3-compatible storage with URLs that the backend signs, in
29
+ * parts when they are large, then each upload is completed with the backend.
30
+ */
31
+ export declare function createUppyUploader(uploads: PresignedUploadsLike, { onUploaded, multipartThreshold, install, }: UppyUploadSourceOptions & {
32
+ onUploaded: (file: UploadedFile, upload: Upload) => void;
33
+ }): Uploader;
34
+ /**
35
+ * The upload source of fields on Uppy 6 (`@uppy/core` and `@uppy/aws-s3`, optional peer
36
+ * dependencies of this entry point): pass it as `uploadSource` to `FieldsProvider` or
37
+ * `FormView`, with the signing routes of the backend.
38
+ *
39
+ * ```ts
40
+ * const uploadSource = createUppyUploadSource(adapter.presignedUploads());
41
+ * ```
42
+ */
43
+ export declare function createUppyUploadSource(uploads: PresignedUploadsLike, options?: UppyUploadSourceOptions): UploadSource;
44
+ //# sourceMappingURL=uploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/uppy/uploader.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAiB,MAAM,YAAY,CAAC;AAEvE,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAGR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACX,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,WAAW,CACP,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC,CAAC;IAC5E,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvE;AAED,MAAM,WAAW,uBAAuB;IACpC,0GAA0G;IAC1G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC7E;AAgBD;;;GAGG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,oBAAoB,EAC7B,EACI,UAAU,EACV,kBAA4B,EAC5B,OAAgF,GACnF,EAAE,uBAAuB,GAAG;IAAE,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC1F,QAAQ,CA+HV;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,GAAE,uBAA4B,GACtC,YAAY,CAId"}
@@ -0,0 +1,139 @@
1
+ import AwsS3 from "@uppy/aws-s3";
2
+ import Uppy from "@uppy/core";
3
+ //#region src/uppy/uploader.ts
4
+ var MB = 1048576;
5
+ function errorMessage(error) {
6
+ return error instanceof Error ? error.message : String(error);
7
+ }
8
+ function installAwsS3(uppy, uploads, threshold) {
9
+ uppy.use(AwsS3, {
10
+ signRequest: (request) => uploads.signRequest({ ...request }),
11
+ shouldUseMultipart: (file) => (file.size ?? 0) > threshold
12
+ });
13
+ }
14
+ /**
15
+ * An uploader on Uppy 6: files go to S3-compatible storage with URLs that the backend signs, in
16
+ * parts when they are large, then each upload is completed with the backend.
17
+ */
18
+ function createUppyUploader(uploads, { onUploaded, multipartThreshold = 10 * MB, install = (uppy, presigned) => installAwsS3(uppy, presigned, multipartThreshold) }) {
19
+ const uppy = new Uppy({
20
+ autoProceed: true,
21
+ allowMultipleUploadBatches: true
22
+ });
23
+ install(uppy, uploads);
24
+ const completing = /* @__PURE__ */ new Set();
25
+ const failures = /* @__PURE__ */ new Map();
26
+ const listeners = /* @__PURE__ */ new Set();
27
+ let items = [];
28
+ const toItem = (file) => {
29
+ const { bytesUploaded, bytesTotal } = file.progress;
30
+ const failure = failures.get(file.id) ?? null;
31
+ let status = "uploading";
32
+ if (failure !== null) status = "failed";
33
+ else if (completing.has(file.id)) status = "completing";
34
+ else if (file.isPaused === true) status = "paused";
35
+ return {
36
+ id: file.id,
37
+ name: file.name,
38
+ size: file.size,
39
+ mime: file.type !== "" ? file.type : null,
40
+ progress: typeof bytesUploaded === "number" && bytesTotal !== null && bytesTotal > 0 ? Math.min(1, bytesUploaded / bytesTotal) : null,
41
+ status,
42
+ error: failure,
43
+ canPause: (file.size ?? 0) > multipartThreshold
44
+ };
45
+ };
46
+ const update = () => {
47
+ items = uppy.getFiles().map(toItem);
48
+ listeners.forEach((listener) => listener());
49
+ };
50
+ const forget = (id) => {
51
+ completing.delete(id);
52
+ failures.delete(id);
53
+ if (uppy.getFile(id) !== void 0) uppy.removeFile(id);
54
+ };
55
+ uppy.on("state-update", update);
56
+ uppy.on("upload-error", (file, error) => {
57
+ if (file !== void 0) {
58
+ failures.set(file.id, errorMessage(error));
59
+ update();
60
+ }
61
+ });
62
+ uppy.on("upload-success", (file, response) => {
63
+ if (file === void 0) return;
64
+ const key = typeof response.body?.key === "string" ? response.body.key : null;
65
+ if (key === null) {
66
+ failures.set(file.id, "The storage gave no key for this file.");
67
+ update();
68
+ return;
69
+ }
70
+ completing.add(file.id);
71
+ update();
72
+ uploads.complete(key, { name: file.name }).then((upload) => {
73
+ forget(file.id);
74
+ onUploaded({
75
+ upload: upload.id,
76
+ name: upload.name ?? file.name,
77
+ mime: upload.mime ?? (file.type !== "" ? file.type : null),
78
+ size: upload.size ?? file.size
79
+ }, upload);
80
+ }).catch((error) => {
81
+ completing.delete(file.id);
82
+ failures.set(file.id, errorMessage(error));
83
+ update();
84
+ });
85
+ });
86
+ return {
87
+ getItems: () => items,
88
+ subscribe(listener) {
89
+ listeners.add(listener);
90
+ return () => listeners.delete(listener);
91
+ },
92
+ add(files) {
93
+ for (const file of files) uppy.addFile({
94
+ name: file.name,
95
+ type: file.type,
96
+ data: file
97
+ });
98
+ },
99
+ pause(id) {
100
+ if (uppy.getFile(id)?.isPaused !== true) uppy.pauseResume(id);
101
+ },
102
+ resume(id) {
103
+ if (uppy.getFile(id)?.isPaused === true) uppy.pauseResume(id);
104
+ },
105
+ cancel(id) {
106
+ forget(id);
107
+ update();
108
+ },
109
+ retry(id) {
110
+ if (!failures.has(id)) return;
111
+ failures.delete(id);
112
+ update();
113
+ uppy.retryUpload(id);
114
+ },
115
+ destroy() {
116
+ listeners.clear();
117
+ uppy.destroy();
118
+ }
119
+ };
120
+ }
121
+ /**
122
+ * The upload source of fields on Uppy 6 (`@uppy/core` and `@uppy/aws-s3`, optional peer
123
+ * dependencies of this entry point): pass it as `uploadSource` to `FieldsProvider` or
124
+ * `FormView`, with the signing routes of the backend.
125
+ *
126
+ * ```ts
127
+ * const uploadSource = createUppyUploadSource(adapter.presignedUploads());
128
+ * ```
129
+ */
130
+ function createUppyUploadSource(uploads, options = {}) {
131
+ return { createUploader: ({ onUploaded }) => createUppyUploader(uploads, {
132
+ ...options,
133
+ onUploaded
134
+ }) };
135
+ }
136
+ //#endregion
137
+ export { createUppyUploadSource, createUppyUploader };
138
+
139
+ //# sourceMappingURL=uploader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploader.js","names":[],"sources":["../../src/uppy/uploader.ts"],"sourcesContent":["import AwsS3 from '@uppy/aws-s3';\nimport Uppy, { type Body, type Meta, type UppyFile } from '@uppy/core';\n\nimport type { Upload, UploadSignRequest } from '@panneau/protocol';\n\nimport type {\n UploadItem,\n UploadItemStatus,\n UploadSource,\n UploadedFile,\n Uploader,\n} from '../upload/types';\n\n/**\n * Signs and completes direct uploads: `adapter.presignedUploads()` of `@panneau/data` (or\n * `createPresignedUploads()`) gives one.\n */\nexport interface PresignedUploadsLike {\n signRequest(\n request: UploadSignRequest,\n ): Promise<{ url: string; key?: string; headers?: Record<string, string> }>;\n complete(key: string, options?: { name?: string }): Promise<Upload>;\n}\n\nexport interface UppyUploadSourceOptions {\n /** Files larger than this, in bytes, are sent in parts, which can pause and resume. Defaults to 10 MB. */\n multipartThreshold?: number;\n /**\n * Installs what sends files on each Uppy instance: `@uppy/aws-s3` with the backend's\n * signatures by default. Tests install a fake one.\n */\n install?: (uppy: Uppy<Meta, Body>, uploads: PresignedUploadsLike) => void;\n}\n\nconst MB = 1024 * 1024;\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction installAwsS3(uppy: Uppy<Meta, Body>, uploads: PresignedUploadsLike, threshold: number) {\n uppy.use(AwsS3<Meta, Body>, {\n // Uppy's request types are interfaces; the protocol's schema is an open object.\n signRequest: (request) => uploads.signRequest({ ...request }),\n shouldUseMultipart: (file) => (file.size ?? 0) > threshold,\n });\n}\n\n/**\n * An uploader on Uppy 6: files go to S3-compatible storage with URLs that the backend signs, in\n * parts when they are large, then each upload is completed with the backend.\n */\nexport function createUppyUploader(\n uploads: PresignedUploadsLike,\n {\n onUploaded,\n multipartThreshold = 10 * MB,\n install = (uppy, presigned) => installAwsS3(uppy, presigned, multipartThreshold),\n }: UppyUploadSourceOptions & { onUploaded: (file: UploadedFile, upload: Upload) => void },\n): Uploader {\n const uppy = new Uppy<Meta, Body>({ autoProceed: true, allowMultipleUploadBatches: true });\n install(uppy, uploads);\n\n // What Uppy doesn't track: files being completed with the backend, and why one failed.\n const completing = new Set<string>();\n const failures = new Map<string, string>();\n const listeners = new Set<() => void>();\n let items: readonly UploadItem[] = [];\n\n const toItem = (file: UppyFile<Meta, Body>): UploadItem => {\n const { bytesUploaded, bytesTotal } = file.progress;\n const failure = failures.get(file.id) ?? null;\n let status: UploadItemStatus = 'uploading';\n if (failure !== null) {\n status = 'failed';\n } else if (completing.has(file.id)) {\n status = 'completing';\n } else if (file.isPaused === true) {\n status = 'paused';\n }\n return {\n id: file.id,\n name: file.name,\n size: file.size,\n mime: file.type !== '' ? file.type : null,\n progress:\n typeof bytesUploaded === 'number' && bytesTotal !== null && bytesTotal > 0\n ? Math.min(1, bytesUploaded / bytesTotal)\n : null,\n status,\n error: failure,\n canPause: (file.size ?? 0) > multipartThreshold,\n };\n };\n\n const update = () => {\n items = uppy.getFiles().map(toItem);\n listeners.forEach((listener) => listener());\n };\n\n const forget = (id: string) => {\n completing.delete(id);\n failures.delete(id);\n if (uppy.getFile(id) !== undefined) {\n uppy.removeFile(id);\n }\n };\n\n uppy.on('state-update', update);\n uppy.on('upload-error', (file, error) => {\n if (file !== undefined) {\n failures.set(file.id, errorMessage(error));\n update();\n }\n });\n uppy.on('upload-success', (file, response) => {\n if (file === undefined) {\n return;\n }\n const key = typeof response.body?.key === 'string' ? response.body.key : null;\n if (key === null) {\n failures.set(file.id, 'The storage gave no key for this file.');\n update();\n return;\n }\n completing.add(file.id);\n update();\n uploads\n .complete(key, { name: file.name })\n .then((upload) => {\n forget(file.id);\n onUploaded(\n {\n upload: upload.id,\n name: upload.name ?? file.name,\n mime: upload.mime ?? (file.type !== '' ? file.type : null),\n size: upload.size ?? file.size,\n },\n upload,\n );\n })\n .catch((error: unknown) => {\n completing.delete(file.id);\n failures.set(file.id, errorMessage(error));\n update();\n });\n });\n\n return {\n getItems: () => items,\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n add(files) {\n for (const file of files) {\n uppy.addFile({ name: file.name, type: file.type, data: file });\n }\n },\n pause(id) {\n if (uppy.getFile(id)?.isPaused !== true) {\n uppy.pauseResume(id);\n }\n },\n resume(id) {\n if (uppy.getFile(id)?.isPaused === true) {\n uppy.pauseResume(id);\n }\n },\n cancel(id) {\n forget(id);\n update();\n },\n retry(id) {\n if (!failures.has(id)) {\n return;\n }\n failures.delete(id);\n update();\n void uppy.retryUpload(id);\n },\n destroy() {\n listeners.clear();\n uppy.destroy();\n },\n };\n}\n\n/**\n * The upload source of fields on Uppy 6 (`@uppy/core` and `@uppy/aws-s3`, optional peer\n * dependencies of this entry point): pass it as `uploadSource` to `FieldsProvider` or\n * `FormView`, with the signing routes of the backend.\n *\n * ```ts\n * const uploadSource = createUppyUploadSource(adapter.presignedUploads());\n * ```\n */\nexport function createUppyUploadSource(\n uploads: PresignedUploadsLike,\n options: UppyUploadSourceOptions = {},\n): UploadSource {\n return {\n createUploader: ({ onUploaded }) => createUppyUploader(uploads, { ...options, onUploaded }),\n };\n}\n"],"mappings":"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"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@panneau/fields",
3
- "version": "5.0.0-alpha.3",
4
- "description": "Controlled field components of Panneau for the protocol's built-in field types, one subpath per field.",
3
+ "version": "5.0.0-alpha.5",
4
+ "description": "Controlled field components of Panneau for the protocol's built-in field types, one subpath per field, and uploads to storage (Uppy 6 in its own entry point).",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -98,11 +98,21 @@
98
98
  "types": "./dist/relation/index.d.ts",
99
99
  "default": "./dist/relation/index.js"
100
100
  },
101
+ "./file": {
102
+ "@panneau/source": "./src/file/index.ts",
103
+ "types": "./dist/file/index.d.ts",
104
+ "default": "./dist/file/index.js"
105
+ },
101
106
  "./locales": {
102
107
  "@panneau/source": "./src/locales/index.ts",
103
108
  "types": "./dist/locales/index.d.ts",
104
109
  "default": "./dist/locales/index.js"
105
110
  },
111
+ "./uppy": {
112
+ "@panneau/source": "./src/uppy/index.ts",
113
+ "types": "./dist/uppy/index.d.ts",
114
+ "default": "./dist/uppy/index.js"
115
+ },
106
116
  "./package.json": "./package.json"
107
117
  },
108
118
  "files": [
@@ -117,14 +127,29 @@
117
127
  "access": "public"
118
128
  },
119
129
  "peerDependencies": {
130
+ "@uppy/aws-s3": "^6.3.0",
131
+ "@uppy/core": "^6.3.0",
120
132
  "react": "^19.2.0",
133
+ "react-aria-components": "^1.22.0",
121
134
  "react-intl": "^12.0.0"
122
135
  },
136
+ "peerDependenciesMeta": {
137
+ "@uppy/aws-s3": {
138
+ "optional": true
139
+ },
140
+ "@uppy/core": {
141
+ "optional": true
142
+ }
143
+ },
123
144
  "dependencies": {
124
145
  "@internationalized/date": "^3.12.4",
125
- "@panneau/intl": "5.0.0-alpha.3",
126
- "@panneau/protocol": "5.0.0-alpha.3",
127
- "@panneau/ui": "5.0.0-alpha.3",
146
+ "@panneau/intl": "5.0.0-alpha.5",
147
+ "@panneau/protocol": "5.0.0-alpha.5",
148
+ "@panneau/ui": "5.0.0-alpha.5",
128
149
  "lucide-react": "^1.57.0"
150
+ },
151
+ "devDependencies": {
152
+ "@uppy/aws-s3": "^6.3.0",
153
+ "@uppy/core": "^6.3.0"
129
154
  }
130
155
  }