@uploadista/react-native-core 0.0.20-beta.6 → 0.0.20-beta.8
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/dist/index.d.mts +747 -222
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/flow-primitives.tsx +840 -0
- package/src/components/index.ts +32 -0
- package/src/hooks/use-multi-upload.ts +10 -6
- package/src/index.ts +29 -0
- package/src/types/platform-types.ts +7 -4
package/src/components/index.ts
CHANGED
|
@@ -17,3 +17,35 @@ export {
|
|
|
17
17
|
} from "./GalleryUploadButton";
|
|
18
18
|
export { UploadList, type UploadListProps } from "./UploadList";
|
|
19
19
|
export { UploadProgress, type UploadProgressProps } from "./UploadProgress";
|
|
20
|
+
|
|
21
|
+
// Flow compound components
|
|
22
|
+
export {
|
|
23
|
+
Flow,
|
|
24
|
+
useFlowContext,
|
|
25
|
+
useFlowInputContext,
|
|
26
|
+
type FlowProps,
|
|
27
|
+
type FlowRenderProps,
|
|
28
|
+
type FlowContextValue,
|
|
29
|
+
type FlowInputContextValue,
|
|
30
|
+
type FlowInputsProps,
|
|
31
|
+
type FlowInputsRenderProps,
|
|
32
|
+
type FlowInputProps,
|
|
33
|
+
type FlowInputFilePickerProps,
|
|
34
|
+
type FlowInputFilePickerRenderProps,
|
|
35
|
+
type FlowInputPreviewProps,
|
|
36
|
+
type FlowInputPreviewRenderProps,
|
|
37
|
+
type FlowProgressProps,
|
|
38
|
+
type FlowProgressRenderProps,
|
|
39
|
+
type FlowStatusProps,
|
|
40
|
+
type FlowStatusRenderProps,
|
|
41
|
+
type FlowErrorProps,
|
|
42
|
+
type FlowErrorRenderProps,
|
|
43
|
+
type FlowSubmitProps,
|
|
44
|
+
type FlowSubmitRenderProps,
|
|
45
|
+
type FlowCancelProps,
|
|
46
|
+
type FlowCancelRenderProps,
|
|
47
|
+
type FlowResetProps,
|
|
48
|
+
type FlowResetRenderProps,
|
|
49
|
+
type FlowQuickUploadProps,
|
|
50
|
+
type FlowQuickUploadRenderProps,
|
|
51
|
+
} from "./flow-primitives";
|
|
@@ -170,12 +170,16 @@ export function useMultiUpload(options: UseMultiUploadOptions = {}) {
|
|
|
170
170
|
const blob = await response.blob();
|
|
171
171
|
|
|
172
172
|
// Override blob type if we have mimeType from picker
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
// Use type assertion to handle differences between Expo's BlobOptions and standard BlobPropertyBag
|
|
174
|
+
let uploadInput: Blob = blob;
|
|
175
|
+
if (item.file.data.mimeType) {
|
|
176
|
+
const blobOptions = {
|
|
177
|
+
type: item.file.data.mimeType,
|
|
178
|
+
lastModified: Date.now(),
|
|
179
|
+
};
|
|
180
|
+
// biome-ignore lint/suspicious/noExplicitAny: Expo and bare RN have incompatible Blob types
|
|
181
|
+
uploadInput = new Blob([blob], blobOptions as any);
|
|
182
|
+
}
|
|
179
183
|
|
|
180
184
|
// Start upload using the client
|
|
181
185
|
console.log("Uploading input:", uploadInput);
|
package/src/index.ts
CHANGED
|
@@ -39,6 +39,35 @@ export {
|
|
|
39
39
|
type UploadListProps,
|
|
40
40
|
UploadProgress,
|
|
41
41
|
type UploadProgressProps,
|
|
42
|
+
// Flow compound components
|
|
43
|
+
Flow,
|
|
44
|
+
useFlowContext,
|
|
45
|
+
useFlowInputContext,
|
|
46
|
+
type FlowProps,
|
|
47
|
+
type FlowRenderProps,
|
|
48
|
+
type FlowContextValue,
|
|
49
|
+
type FlowInputContextValue,
|
|
50
|
+
type FlowInputsProps,
|
|
51
|
+
type FlowInputsRenderProps,
|
|
52
|
+
type FlowInputProps,
|
|
53
|
+
type FlowInputFilePickerProps,
|
|
54
|
+
type FlowInputFilePickerRenderProps,
|
|
55
|
+
type FlowInputPreviewProps,
|
|
56
|
+
type FlowInputPreviewRenderProps,
|
|
57
|
+
type FlowProgressProps,
|
|
58
|
+
type FlowProgressRenderProps,
|
|
59
|
+
type FlowStatusProps,
|
|
60
|
+
type FlowStatusRenderProps,
|
|
61
|
+
type FlowErrorProps,
|
|
62
|
+
type FlowErrorRenderProps,
|
|
63
|
+
type FlowSubmitProps,
|
|
64
|
+
type FlowSubmitRenderProps,
|
|
65
|
+
type FlowCancelProps,
|
|
66
|
+
type FlowCancelRenderProps,
|
|
67
|
+
type FlowResetProps,
|
|
68
|
+
type FlowResetRenderProps,
|
|
69
|
+
type FlowQuickUploadProps,
|
|
70
|
+
type FlowQuickUploadRenderProps,
|
|
42
71
|
} from "./components";
|
|
43
72
|
// Export contexts
|
|
44
73
|
export {
|
|
@@ -62,13 +62,16 @@ export function isBufferSource(value: unknown): value is BufferSource {
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Type guard to check if we're in React Native environment
|
|
65
|
-
* (checks for
|
|
65
|
+
* (checks for navigator.product === 'ReactNative')
|
|
66
66
|
*/
|
|
67
67
|
export function isReactNativeEnvironment(): boolean {
|
|
68
|
+
const g = globalThis as typeof globalThis & {
|
|
69
|
+
navigator?: { product?: string };
|
|
70
|
+
};
|
|
68
71
|
return (
|
|
69
|
-
typeof
|
|
70
|
-
typeof
|
|
71
|
-
|
|
72
|
+
typeof g !== "undefined" &&
|
|
73
|
+
typeof g.navigator !== "undefined" &&
|
|
74
|
+
g.navigator.product === "ReactNative"
|
|
72
75
|
);
|
|
73
76
|
}
|
|
74
77
|
|