@shipstatic/drop 0.1.10 → 0.1.12
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 +1 -0
- package/dist/index.cjs +8 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -19
- package/dist/index.d.ts +26 -19
- package/dist/index.js +8 -14
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var ship = require('@shipstatic/ship');
|
|
5
|
+
var types = require('@shipstatic/types');
|
|
5
6
|
|
|
6
7
|
var __create = Object.create;
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
@@ -11777,15 +11778,9 @@ function normalizePath(path) {
|
|
|
11777
11778
|
function isZipFile(file) {
|
|
11778
11779
|
return file.type === "application/zip" || file.type === "application/x-zip-compressed" || file.name.toLowerCase().endsWith(".zip");
|
|
11779
11780
|
}
|
|
11780
|
-
|
|
11781
|
-
// src/types.ts
|
|
11782
11781
|
var FILE_STATUSES = {
|
|
11783
|
-
|
|
11782
|
+
...types.FileValidationStatus,
|
|
11784
11783
|
PROCESSING: "processing",
|
|
11785
|
-
VALIDATION_FAILED: "validation_failed",
|
|
11786
|
-
PROCESSING_ERROR: "processing_error",
|
|
11787
|
-
EMPTY_FILE: "empty_file",
|
|
11788
|
-
READY: "ready",
|
|
11789
11784
|
UPLOADING: "uploading",
|
|
11790
11785
|
COMPLETE: "complete",
|
|
11791
11786
|
ERROR: "error"
|
|
@@ -11798,15 +11793,12 @@ async function createProcessedFile(file, options) {
|
|
|
11798
11793
|
const path = options?.path || (webkitPath && webkitPath.trim() ? webkitPath : file.name);
|
|
11799
11794
|
const type = file.type || getMimeType(path);
|
|
11800
11795
|
return {
|
|
11801
|
-
//
|
|
11796
|
+
// ProcessedFile properties
|
|
11802
11797
|
// Note: md5 is intentionally undefined - Ship SDK will calculate it during deployment
|
|
11803
|
-
content: file,
|
|
11804
|
-
path,
|
|
11805
|
-
size: file.size,
|
|
11806
|
-
// ProcessedFile-specific properties (UI functionality)
|
|
11807
11798
|
id: crypto.randomUUID(),
|
|
11808
11799
|
file,
|
|
11809
|
-
|
|
11800
|
+
path,
|
|
11801
|
+
size: file.size,
|
|
11810
11802
|
name: path.split("/").pop() || file.name,
|
|
11811
11803
|
type,
|
|
11812
11804
|
lastModified: file.lastModified,
|
|
@@ -11983,6 +11975,7 @@ function useDrop(options) {
|
|
|
11983
11975
|
const noValidError = {
|
|
11984
11976
|
error: "No Valid Files",
|
|
11985
11977
|
details: "None of the provided files could be processed.",
|
|
11978
|
+
errors: [],
|
|
11986
11979
|
isClientError: true
|
|
11987
11980
|
};
|
|
11988
11981
|
setState({
|
|
@@ -11997,6 +11990,7 @@ function useDrop(options) {
|
|
|
11997
11990
|
const processingError = {
|
|
11998
11991
|
error: "Processing Failed",
|
|
11999
11992
|
details: `Failed to process files: ${error instanceof Error ? error.message : String(error)}`,
|
|
11993
|
+
errors: [],
|
|
12000
11994
|
isClientError: true
|
|
12001
11995
|
};
|
|
12002
11996
|
setState((prev) => ({
|
|
@@ -12155,6 +12149,7 @@ exports.FILE_STATUSES = FILE_STATUSES;
|
|
|
12155
12149
|
exports.createProcessedFile = createProcessedFile;
|
|
12156
12150
|
exports.extractZipToFiles = extractZipToFiles;
|
|
12157
12151
|
exports.formatFileSize = formatFileSize;
|
|
12152
|
+
exports.getMimeType = getMimeType;
|
|
12158
12153
|
exports.isZipFile = isZipFile;
|
|
12159
12154
|
exports.normalizePath = normalizePath;
|
|
12160
12155
|
exports.stripCommonPrefix = stripCommonPrefix;
|