@shipstatic/drop 0.1.0 → 0.1.2
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/README.md +29 -29
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -61,7 +61,7 @@ type ValidationConfig = ConfigResponse;
|
|
|
61
61
|
*/
|
|
62
62
|
declare const DEFAULT_VALIDATION: ConfigResponse;
|
|
63
63
|
|
|
64
|
-
interface
|
|
64
|
+
interface DropOptions {
|
|
65
65
|
/** Validation configuration (from ship.getConfig()) */
|
|
66
66
|
config?: Partial<ValidationConfig>;
|
|
67
67
|
/** Callback when validation fails */
|
|
@@ -71,7 +71,7 @@ interface DropzoneManagerOptions {
|
|
|
71
71
|
/** Whether to strip common directory prefix from paths (default: true) */
|
|
72
72
|
stripPrefix?: boolean;
|
|
73
73
|
}
|
|
74
|
-
interface
|
|
74
|
+
interface DropReturn {
|
|
75
75
|
/** All processed files with their status */
|
|
76
76
|
files: ProcessedFile[];
|
|
77
77
|
/** Current status text */
|
|
@@ -82,7 +82,7 @@ interface DropzoneManagerReturn {
|
|
|
82
82
|
validationError: ClientError | null;
|
|
83
83
|
/** Whether all valid files have MD5 checksums calculated */
|
|
84
84
|
hasChecksums: boolean;
|
|
85
|
-
/** Process files from
|
|
85
|
+
/** Process files from drop (resets and replaces existing files) */
|
|
86
86
|
processFiles: (files: File[]) => Promise<void>;
|
|
87
87
|
/** Remove a specific file */
|
|
88
88
|
removeFile: (fileId: string) => void;
|
|
@@ -98,11 +98,11 @@ interface DropzoneManagerReturn {
|
|
|
98
98
|
}) => void;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
* Headless
|
|
101
|
+
* Headless drop hook
|
|
102
102
|
* Handles file processing, ZIP extraction, and validation
|
|
103
103
|
* Does NOT handle uploading - that's the consumer's responsibility
|
|
104
104
|
*/
|
|
105
|
-
declare function
|
|
105
|
+
declare function useDrop(options?: DropOptions): DropReturn;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* Calculate MD5 hash from ArrayBuffer
|
|
@@ -197,4 +197,4 @@ declare function isJunkFile(path: string): boolean;
|
|
|
197
197
|
*/
|
|
198
198
|
declare function isZipFile(file: File): boolean;
|
|
199
199
|
|
|
200
|
-
export { type ClientError, DEFAULT_VALIDATION, type
|
|
200
|
+
export { type ClientError, DEFAULT_VALIDATION, type DropOptions, type DropReturn, FILE_STATUSES, type FileStatus, type ProcessedFile, type ValidationConfig, type ValidationResult, type ZipExtractionResult, allValidFilesHaveChecksums, calculateMD5, createProcessedFile, extractZipToFiles, formatFileSize, getValidFiles, isJunkFile, isZipFile, normalizePath, stripCommonPrefix, useDrop, validateFiles };
|
package/dist/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ type ValidationConfig = ConfigResponse;
|
|
|
61
61
|
*/
|
|
62
62
|
declare const DEFAULT_VALIDATION: ConfigResponse;
|
|
63
63
|
|
|
64
|
-
interface
|
|
64
|
+
interface DropOptions {
|
|
65
65
|
/** Validation configuration (from ship.getConfig()) */
|
|
66
66
|
config?: Partial<ValidationConfig>;
|
|
67
67
|
/** Callback when validation fails */
|
|
@@ -71,7 +71,7 @@ interface DropzoneManagerOptions {
|
|
|
71
71
|
/** Whether to strip common directory prefix from paths (default: true) */
|
|
72
72
|
stripPrefix?: boolean;
|
|
73
73
|
}
|
|
74
|
-
interface
|
|
74
|
+
interface DropReturn {
|
|
75
75
|
/** All processed files with their status */
|
|
76
76
|
files: ProcessedFile[];
|
|
77
77
|
/** Current status text */
|
|
@@ -82,7 +82,7 @@ interface DropzoneManagerReturn {
|
|
|
82
82
|
validationError: ClientError | null;
|
|
83
83
|
/** Whether all valid files have MD5 checksums calculated */
|
|
84
84
|
hasChecksums: boolean;
|
|
85
|
-
/** Process files from
|
|
85
|
+
/** Process files from drop (resets and replaces existing files) */
|
|
86
86
|
processFiles: (files: File[]) => Promise<void>;
|
|
87
87
|
/** Remove a specific file */
|
|
88
88
|
removeFile: (fileId: string) => void;
|
|
@@ -98,11 +98,11 @@ interface DropzoneManagerReturn {
|
|
|
98
98
|
}) => void;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
* Headless
|
|
101
|
+
* Headless drop hook
|
|
102
102
|
* Handles file processing, ZIP extraction, and validation
|
|
103
103
|
* Does NOT handle uploading - that's the consumer's responsibility
|
|
104
104
|
*/
|
|
105
|
-
declare function
|
|
105
|
+
declare function useDrop(options?: DropOptions): DropReturn;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* Calculate MD5 hash from ArrayBuffer
|
|
@@ -197,4 +197,4 @@ declare function isJunkFile(path: string): boolean;
|
|
|
197
197
|
*/
|
|
198
198
|
declare function isZipFile(file: File): boolean;
|
|
199
199
|
|
|
200
|
-
export { type ClientError, DEFAULT_VALIDATION, type
|
|
200
|
+
export { type ClientError, DEFAULT_VALIDATION, type DropOptions, type DropReturn, FILE_STATUSES, type FileStatus, type ProcessedFile, type ValidationConfig, type ValidationResult, type ZipExtractionResult, allValidFilesHaveChecksums, calculateMD5, createProcessedFile, extractZipToFiles, formatFileSize, getValidFiles, isJunkFile, isZipFile, normalizePath, stripCommonPrefix, useDrop, validateFiles };
|
package/dist/index.js
CHANGED
|
@@ -12392,8 +12392,8 @@ function stripCommonPrefix(files) {
|
|
|
12392
12392
|
}));
|
|
12393
12393
|
}
|
|
12394
12394
|
|
|
12395
|
-
// src/hooks/
|
|
12396
|
-
function
|
|
12395
|
+
// src/hooks/useDrop.ts
|
|
12396
|
+
function useDrop(options = {}) {
|
|
12397
12397
|
const {
|
|
12398
12398
|
config: customConfig,
|
|
12399
12399
|
onValidationError,
|
|
@@ -12528,6 +12528,6 @@ mime-db/index.js:
|
|
|
12528
12528
|
*)
|
|
12529
12529
|
*/
|
|
12530
12530
|
|
|
12531
|
-
export { DEFAULT_VALIDATION, FILE_STATUSES, allValidFilesHaveChecksums, calculateMD5, createProcessedFile, extractZipToFiles, formatFileSize, getValidFiles, isJunkFile, isZipFile, normalizePath, stripCommonPrefix,
|
|
12531
|
+
export { DEFAULT_VALIDATION, FILE_STATUSES, allValidFilesHaveChecksums, calculateMD5, createProcessedFile, extractZipToFiles, formatFileSize, getValidFiles, isJunkFile, isZipFile, normalizePath, stripCommonPrefix, useDrop, validateFiles };
|
|
12532
12532
|
//# sourceMappingURL=index.js.map
|
|
12533
12533
|
//# sourceMappingURL=index.js.map
|