@uploadista/react 0.0.20-beta.2 → 0.0.20-beta.4

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 (37) hide show
  1. package/dist/components/index.d.mts +3 -3
  2. package/dist/components/index.mjs +1 -1
  3. package/dist/flow-upload-list-D6j8JSP8.mjs +2 -0
  4. package/dist/flow-upload-list-D6j8JSP8.mjs.map +1 -0
  5. package/dist/hooks/index.d.mts +3 -3
  6. package/dist/hooks/index.mjs +1 -1
  7. package/dist/index.d.mts +6 -6
  8. package/dist/index.mjs +1 -1
  9. package/dist/{uploadista-provider-D-N-eL2l.d.mts → uploadista-provider-Cb13AK7Z.d.mts} +515 -318
  10. package/dist/uploadista-provider-Cb13AK7Z.d.mts.map +1 -0
  11. package/dist/use-upload-BvvGROMR.mjs +2 -0
  12. package/dist/use-upload-BvvGROMR.mjs.map +1 -0
  13. package/dist/{use-uploadista-client-m9nF-irM.d.mts → use-uploadista-client-CkzVVmFT.d.mts} +121 -286
  14. package/dist/use-uploadista-client-CkzVVmFT.d.mts.map +1 -0
  15. package/dist/use-uploadista-events-BwUD-2Ck.mjs +2 -0
  16. package/dist/use-uploadista-events-BwUD-2Ck.mjs.map +1 -0
  17. package/dist/{use-upload-metrics-DhzS4lhG.d.mts → use-uploadista-events-CtDXJYrR.d.mts} +169 -371
  18. package/dist/use-uploadista-events-CtDXJYrR.d.mts.map +1 -0
  19. package/package.json +6 -6
  20. package/src/components/flow-primitives.tsx +843 -0
  21. package/src/components/index.tsx +31 -13
  22. package/src/hooks/index.ts +25 -37
  23. package/src/hooks/use-drag-drop.ts +1 -0
  24. package/src/index.ts +90 -81
  25. package/dist/upload-zone-BjWHuP7p.mjs +0 -6
  26. package/dist/upload-zone-BjWHuP7p.mjs.map +0 -1
  27. package/dist/uploadista-provider-D-N-eL2l.d.mts.map +0 -1
  28. package/dist/use-upload-BDHVhQsI.mjs +0 -2
  29. package/dist/use-upload-BDHVhQsI.mjs.map +0 -1
  30. package/dist/use-upload-metrics-Df90wIos.mjs +0 -2
  31. package/dist/use-upload-metrics-Df90wIos.mjs.map +0 -1
  32. package/dist/use-upload-metrics-DhzS4lhG.d.mts.map +0 -1
  33. package/dist/use-uploadista-client-m9nF-irM.d.mts.map +0 -1
  34. package/src/components/flow-input.tsx +0 -299
  35. package/src/components/flow-upload-zone.tsx +0 -441
  36. package/src/hooks/use-flow-execution.ts +0 -502
  37. package/src/hooks/use-flow-upload.ts +0 -299
@@ -1,55 +1,522 @@
1
- import { S as FlowInputMetadata, b as UseDragDropReturn, d as UseUploadOptions, f as UseUploadReturn, g as UseFlowUploadReturn, i as MultiUploadOptions, n as UseUploadistaClientReturn, o as UploadItem, s as UseMultiUploadReturn, t as UseUploadistaClientOptions, v as DragDropOptions } from "./use-uploadista-client-m9nF-irM.mjs";
1
+ import { S as UseDragDropReturn, b as DragDropOptions, d as UseUploadOptions, f as UseUploadReturn, i as MultiUploadOptions, m as FlowInputMetadata, n as UseUploadistaClientReturn, o as UploadItem, s as UseMultiUploadReturn, t as UseUploadistaClientOptions, x as DragDropState } from "./use-uploadista-client-CkzVVmFT.mjs";
2
2
  import React$1, { ReactNode } from "react";
3
- import * as react_jsx_runtime3 from "react/jsx-runtime";
4
- import { BrowserUploadInput, FlowUploadConfig, FlowUploadItem, FlowUploadOptions, MultiFlowUploadOptions, UploadistaEvent } from "@uploadista/client-browser";
3
+ import { FlowUploadState, FlowUploadStatus, InputExecutionState } from "@uploadista/client-core";
4
+ import { TypedOutput } from "@uploadista/core/flow";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
+ import { BrowserUploadInput, FlowUploadConfig, FlowUploadItem, MultiFlowUploadOptions, UploadistaEvent as UploadistaEvent$1 } from "@uploadista/client-browser";
5
7
 
6
- //#region src/components/flow-input.d.ts
7
- interface FlowInputProps {
8
+ //#region src/components/flow-primitives.d.ts
9
+
10
+ /**
11
+ * Context value provided by the Flow component root.
12
+ * Contains all flow state and actions.
13
+ */
14
+ interface FlowContextValue {
15
+ /** Current upload state */
16
+ state: FlowUploadState;
17
+ /** Discovered input nodes metadata (null until discovery completes) */
18
+ inputMetadata: FlowInputMetadata[] | null;
19
+ /** Current input values set via setInput() */
20
+ inputs: Record<string, unknown>;
21
+ /** Per-input execution state for multi-input flows */
22
+ inputStates: ReadonlyMap<string, InputExecutionState>;
23
+ /** Set an input value for a specific node */
24
+ setInput: (nodeId: string, value: unknown) => void;
25
+ /** Execute the flow with current inputs */
26
+ execute: () => Promise<void>;
27
+ /** Upload a single file through the flow */
28
+ upload: (file: File | Blob) => Promise<void>;
29
+ /** Abort the current upload */
30
+ abort: () => void;
31
+ /** Pause the current upload */
32
+ pause: () => void;
33
+ /** Reset the upload state and clear all inputs */
34
+ reset: () => void;
35
+ /** Whether an upload or flow execution is in progress */
36
+ isUploading: boolean;
37
+ /** Whether the file is currently being uploaded */
38
+ isUploadingFile: boolean;
39
+ /** Whether the flow is currently processing */
40
+ isProcessing: boolean;
41
+ /** Whether the hook is discovering flow inputs */
42
+ isDiscoveringInputs: boolean;
43
+ }
44
+ /**
45
+ * Hook to access flow context from within a Flow component.
46
+ * @throws Error if used outside of a Flow component
47
+ */
48
+ declare function useFlowContext(): FlowContextValue;
49
+ /**
50
+ * Context value for a specific input node within a Flow.
51
+ */
52
+ interface FlowInputContextValue {
53
+ /** Input node ID */
54
+ nodeId: string;
8
55
  /** Input metadata from flow discovery */
9
- input: FlowInputMetadata;
10
- /** Accepted file types (e.g., "image/*", "video/*") */
56
+ metadata: FlowInputMetadata;
57
+ /** Current value for this input */
58
+ value: unknown;
59
+ /** Set the value for this input */
60
+ setValue: (value: unknown) => void;
61
+ /** Per-input execution state (if available) */
62
+ state: InputExecutionState | undefined;
63
+ }
64
+ /**
65
+ * Hook to access flow input context from within a Flow.Input component.
66
+ * @throws Error if used outside of a Flow.Input component
67
+ */
68
+ declare function useFlowInputContext(): FlowInputContextValue;
69
+ /**
70
+ * Props for the Flow root component.
71
+ */
72
+ interface FlowProps {
73
+ /** Flow ID to execute */
74
+ flowId: string;
75
+ /** Storage ID for file uploads */
76
+ storageId: string;
77
+ /** Optional output node ID to wait for */
78
+ outputNodeId?: string;
79
+ /** Optional metadata to include with the flow execution */
80
+ metadata?: Record<string, string>;
81
+ /** Called when flow completes successfully */
82
+ onSuccess?: (outputs: TypedOutput[]) => void;
83
+ /** Called when flow fails */
84
+ onError?: (error: Error) => void;
85
+ /** Called on upload progress */
86
+ onProgress?: (uploadId: string, bytesUploaded: number, totalBytes: number | null) => void;
87
+ /** Called when flow completes with all outputs */
88
+ onFlowComplete?: (outputs: TypedOutput[]) => void;
89
+ /** Called when upload is aborted */
90
+ onAbort?: () => void;
91
+ /** Children to render */
92
+ children: ReactNode;
93
+ }
94
+ /**
95
+ * Root component for flow-based uploads.
96
+ * Provides context for all Flow sub-components.
97
+ *
98
+ * @example
99
+ * ```tsx
100
+ * <Flow flowId="image-optimizer" storageId="s3" onSuccess={handleSuccess}>
101
+ * <Flow.DropZone accept="image/*">
102
+ * {({ isDragging, getRootProps, getInputProps }) => (
103
+ * <div {...getRootProps()}>
104
+ * <input {...getInputProps()} />
105
+ * {isDragging ? "Drop here" : "Drag or click"}
106
+ * </div>
107
+ * )}
108
+ * </Flow.DropZone>
109
+ * </Flow>
110
+ * ```
111
+ */
112
+ declare function FlowRoot({
113
+ flowId,
114
+ storageId,
115
+ outputNodeId,
116
+ metadata,
117
+ onSuccess,
118
+ onError,
119
+ onProgress,
120
+ onFlowComplete,
121
+ onAbort,
122
+ children
123
+ }: FlowProps): react_jsx_runtime0.JSX.Element;
124
+ /**
125
+ * Render props for Flow.DropZone component.
126
+ */
127
+ interface FlowDropZoneRenderProps {
128
+ /** Whether files are being dragged over */
129
+ isDragging: boolean;
130
+ /** Whether drag is over the zone */
131
+ isOver: boolean;
132
+ /** Upload progress (0-100) */
133
+ progress: number;
134
+ /** Current flow status */
135
+ status: FlowUploadStatus;
136
+ /** Props to spread on the drop zone container */
137
+ getRootProps: () => UseDragDropReturn["dragHandlers"];
138
+ /** Props to spread on the hidden file input */
139
+ getInputProps: () => UseDragDropReturn["inputProps"];
140
+ /** Open file picker programmatically */
141
+ openFilePicker: () => void;
142
+ /** Current drag-drop state */
143
+ dragDropState: DragDropState;
144
+ }
145
+ /**
146
+ * Props for Flow.DropZone component.
147
+ */
148
+ interface FlowDropZoneProps {
149
+ /** Accepted file types (e.g., "image/*", ".pdf") */
11
150
  accept?: string;
12
- /** Whether the input should support URL input */
13
- allowUrl?: boolean;
14
- /** Current value (File or URL string) */
15
- value?: File | string | null;
16
- /** Callback when value changes */
17
- onChange: (value: File | string) => void;
18
- /** Whether the input is disabled */
19
- disabled?: boolean;
20
- /** Additional CSS classes */
21
- className?: string;
151
+ /** Maximum file size in bytes */
152
+ maxFileSize?: number;
153
+ /** Render function receiving drop zone state */
154
+ children: (props: FlowDropZoneRenderProps) => ReactNode;
22
155
  }
23
156
  /**
24
- * Input component for flow execution with file drag-and-drop and URL support.
157
+ * Drop zone for single-file uploads within a Flow.
158
+ * Automatically calls flow.upload() when a file is dropped.
25
159
  *
26
- * Features:
27
- * - File drag-and-drop with visual feedback
28
- * - URL input for remote files
29
- * - Displays node name and description
30
- * - Shows selected file/URL with size
31
- * - Type validation and error display
160
+ * @example
161
+ * ```tsx
162
+ * <Flow.DropZone accept="image/*">
163
+ * {({ isDragging, progress, getRootProps, getInputProps }) => (
164
+ * <div {...getRootProps()}>
165
+ * <input {...getInputProps()} />
166
+ * {isDragging ? "Drop here" : `Progress: ${progress}%`}
167
+ * </div>
168
+ * )}
169
+ * </Flow.DropZone>
170
+ * ```
171
+ */
172
+ declare function FlowDropZone({
173
+ accept,
174
+ maxFileSize,
175
+ children
176
+ }: FlowDropZoneProps): react_jsx_runtime0.JSX.Element;
177
+ /**
178
+ * Render props for Flow.Inputs component.
179
+ */
180
+ interface FlowInputsRenderProps {
181
+ /** Discovered input metadata */
182
+ inputs: FlowInputMetadata[];
183
+ /** Whether inputs are still being discovered */
184
+ isLoading: boolean;
185
+ }
186
+ /**
187
+ * Props for Flow.Inputs component.
188
+ */
189
+ interface FlowInputsProps {
190
+ /** Render function receiving discovered inputs */
191
+ children: (props: FlowInputsRenderProps) => ReactNode;
192
+ }
193
+ /**
194
+ * Auto-discovers flow input nodes and provides them via render props.
32
195
  *
33
196
  * @example
34
197
  * ```tsx
35
- * <FlowInput
36
- * input={inputMetadata}
37
- * accept="image/*"
38
- * allowUrl={true}
39
- * value={selectedValue}
40
- * onChange={(value) => flow.setInput(inputMetadata.nodeId, value)}
41
- * />
198
+ * <Flow.Inputs>
199
+ * {({ inputs, isLoading }) => (
200
+ * isLoading ? <Spinner /> : (
201
+ * inputs.map(input => (
202
+ * <Flow.Input key={input.nodeId} nodeId={input.nodeId}>
203
+ * ...
204
+ * </Flow.Input>
205
+ * ))
206
+ * )
207
+ * )}
208
+ * </Flow.Inputs>
209
+ * ```
210
+ */
211
+ declare function FlowInputs({
212
+ children
213
+ }: FlowInputsProps): react_jsx_runtime0.JSX.Element;
214
+ /**
215
+ * Props for Flow.Input component.
216
+ */
217
+ interface FlowInputProps {
218
+ /** Input node ID */
219
+ nodeId: string;
220
+ /** Children (can be render function or regular children) */
221
+ children: ReactNode | ((props: FlowInputContextValue) => ReactNode);
222
+ }
223
+ /**
224
+ * Scoped input context provider for a specific input node.
225
+ * Children can access input-specific state via useFlowInputContext().
226
+ *
227
+ * @example
228
+ * ```tsx
229
+ * <Flow.Input nodeId="video-input">
230
+ * {({ metadata, value, setValue }) => (
231
+ * <div>
232
+ * <label>{metadata.nodeName}</label>
233
+ * <Flow.Input.DropZone>...</Flow.Input.DropZone>
234
+ * </div>
235
+ * )}
236
+ * </Flow.Input>
42
237
  * ```
43
238
  */
44
239
  declare function FlowInput({
45
- input,
240
+ nodeId,
241
+ children
242
+ }: FlowInputProps): react_jsx_runtime0.JSX.Element | null;
243
+ /**
244
+ * Render props for Flow.Input.DropZone component.
245
+ */
246
+ interface FlowInputDropZoneRenderProps {
247
+ /** Whether files are being dragged over */
248
+ isDragging: boolean;
249
+ /** Whether drag is over the zone */
250
+ isOver: boolean;
251
+ /** Current value for this input */
252
+ value: unknown;
253
+ /** Per-input progress (if available) */
254
+ progress: number;
255
+ /** Per-input status (if available) */
256
+ status: string;
257
+ /** Props to spread on the drop zone container */
258
+ getRootProps: () => UseDragDropReturn["dragHandlers"];
259
+ /** Props to spread on the hidden file input */
260
+ getInputProps: () => UseDragDropReturn["inputProps"];
261
+ /** Open file picker programmatically */
262
+ openFilePicker: () => void;
263
+ /** Current drag-drop state */
264
+ dragDropState: DragDropState;
265
+ }
266
+ /**
267
+ * Props for Flow.Input.DropZone component.
268
+ */
269
+ interface FlowInputDropZoneProps {
270
+ /** Accepted file types (e.g., "image/*", ".pdf") */
271
+ accept?: string;
272
+ /** Maximum file size in bytes */
273
+ maxFileSize?: number;
274
+ /** Render function receiving drop zone state */
275
+ children: (props: FlowInputDropZoneRenderProps) => ReactNode;
276
+ }
277
+ /**
278
+ * Drop zone for a specific input within a Flow.Input.
279
+ * Sets the input value but does NOT trigger upload until Flow.Submit is clicked.
280
+ */
281
+ declare function FlowInputDropZone({
46
282
  accept,
47
- allowUrl,
48
- value,
49
- onChange,
283
+ maxFileSize,
284
+ children
285
+ }: FlowInputDropZoneProps): react_jsx_runtime0.JSX.Element;
286
+ /**
287
+ * Props for Flow.Input.UrlField component.
288
+ */
289
+ interface FlowInputUrlFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "type"> {
290
+ /** Placeholder text */
291
+ placeholder?: string;
292
+ }
293
+ /**
294
+ * URL input field for a specific input within a Flow.Input.
295
+ * Automatically binds to the input context value.
296
+ */
297
+ declare function FlowInputUrlField({
298
+ placeholder,
299
+ ...props
300
+ }: FlowInputUrlFieldProps): react_jsx_runtime0.JSX.Element;
301
+ /**
302
+ * Render props for Flow.Input.Preview component.
303
+ */
304
+ interface FlowInputPreviewRenderProps {
305
+ /** Current value */
306
+ value: unknown;
307
+ /** Whether value is a File */
308
+ isFile: boolean;
309
+ /** Whether value is a URL string */
310
+ isUrl: boolean;
311
+ /** File name (if value is File) */
312
+ fileName: string | null;
313
+ /** File size in bytes (if value is File) */
314
+ fileSize: number | null;
315
+ /** Clear the input value */
316
+ clear: () => void;
317
+ }
318
+ /**
319
+ * Props for Flow.Input.Preview component.
320
+ */
321
+ interface FlowInputPreviewProps {
322
+ /** Render function receiving preview state */
323
+ children: (props: FlowInputPreviewRenderProps) => ReactNode;
324
+ }
325
+ /**
326
+ * Preview component for showing the selected value within a Flow.Input.
327
+ */
328
+ declare function FlowInputPreview({
329
+ children
330
+ }: FlowInputPreviewProps): react_jsx_runtime0.JSX.Element;
331
+ /**
332
+ * Render props for Flow.Progress component.
333
+ */
334
+ interface FlowProgressRenderProps {
335
+ /** Progress percentage (0-100) */
336
+ progress: number;
337
+ /** Bytes uploaded so far */
338
+ bytesUploaded: number;
339
+ /** Total bytes to upload (null if unknown) */
340
+ totalBytes: number | null;
341
+ /** Current status */
342
+ status: FlowUploadStatus;
343
+ }
344
+ /**
345
+ * Props for Flow.Progress component.
346
+ */
347
+ interface FlowProgressProps {
348
+ /** Render function receiving progress state */
349
+ children: (props: FlowProgressRenderProps) => ReactNode;
350
+ }
351
+ /**
352
+ * Progress display component within a Flow.
353
+ */
354
+ declare function FlowProgress({
355
+ children
356
+ }: FlowProgressProps): react_jsx_runtime0.JSX.Element;
357
+ /**
358
+ * Render props for Flow.Status component.
359
+ */
360
+ interface FlowStatusRenderProps {
361
+ /** Current status */
362
+ status: FlowUploadStatus;
363
+ /** Current node being processed (if any) */
364
+ currentNodeName: string | null;
365
+ /** Current node type (if any) */
366
+ currentNodeType: string | null;
367
+ /** Error (if status is error) */
368
+ error: Error | null;
369
+ /** Job ID (if started) */
370
+ jobId: string | null;
371
+ /** Whether flow has started */
372
+ flowStarted: boolean;
373
+ /** Flow outputs (if completed) */
374
+ flowOutputs: TypedOutput[] | null;
375
+ }
376
+ /**
377
+ * Props for Flow.Status component.
378
+ */
379
+ interface FlowStatusProps {
380
+ /** Render function receiving status state */
381
+ children: (props: FlowStatusRenderProps) => ReactNode;
382
+ }
383
+ /**
384
+ * Status display component within a Flow.
385
+ */
386
+ declare function FlowStatus({
387
+ children
388
+ }: FlowStatusProps): react_jsx_runtime0.JSX.Element;
389
+ /**
390
+ * Render props for Flow.Error component.
391
+ */
392
+ interface FlowErrorRenderProps {
393
+ /** Error object (null if no error) */
394
+ error: Error | null;
395
+ /** Whether there is an error */
396
+ hasError: boolean;
397
+ /** Error message */
398
+ message: string | null;
399
+ /** Reset the flow */
400
+ reset: () => void;
401
+ }
402
+ /**
403
+ * Props for Flow.Error component.
404
+ */
405
+ interface FlowErrorProps {
406
+ /** Render function receiving error state */
407
+ children: (props: FlowErrorRenderProps) => ReactNode;
408
+ }
409
+ /**
410
+ * Error display component within a Flow.
411
+ */
412
+ declare function FlowError({
413
+ children
414
+ }: FlowErrorProps): react_jsx_runtime0.JSX.Element;
415
+ /**
416
+ * Props for Flow.Submit component.
417
+ */
418
+ interface FlowSubmitProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
419
+ /** Button content */
420
+ children: ReactNode;
421
+ }
422
+ /**
423
+ * Submit button that executes the flow with current inputs.
424
+ * Automatically disabled when uploading.
425
+ */
426
+ declare function FlowSubmit({
427
+ children,
50
428
  disabled,
51
- className
52
- }: FlowInputProps): react_jsx_runtime3.JSX.Element;
429
+ ...props
430
+ }: FlowSubmitProps): react_jsx_runtime0.JSX.Element;
431
+ /**
432
+ * Props for Flow.Cancel component.
433
+ */
434
+ interface FlowCancelProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
435
+ /** Button content */
436
+ children: ReactNode;
437
+ }
438
+ /**
439
+ * Cancel button that aborts the current upload.
440
+ */
441
+ declare function FlowCancel({
442
+ children,
443
+ ...props
444
+ }: FlowCancelProps): react_jsx_runtime0.JSX.Element;
445
+ /**
446
+ * Props for Flow.Reset component.
447
+ */
448
+ interface FlowResetProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
449
+ /** Button content */
450
+ children: ReactNode;
451
+ }
452
+ /**
453
+ * Reset button that clears all inputs and resets to idle state.
454
+ */
455
+ declare function FlowReset({
456
+ children,
457
+ ...props
458
+ }: FlowResetProps): react_jsx_runtime0.JSX.Element;
459
+ /**
460
+ * Flow compound component for flow-based file uploads.
461
+ *
462
+ * Provides a composable, headless API for building flow upload interfaces.
463
+ * All sub-components use render props for complete UI control.
464
+ *
465
+ * @example Simple Drop Zone
466
+ * ```tsx
467
+ * <Flow flowId="image-optimizer" storageId="s3" onSuccess={handleSuccess}>
468
+ * <Flow.DropZone accept="image/*">
469
+ * {({ isDragging, progress, getRootProps, getInputProps }) => (
470
+ * <div {...getRootProps()}>
471
+ * <input {...getInputProps()} />
472
+ * {isDragging ? "Drop here" : "Drag or click"}
473
+ * {progress > 0 && <progress value={progress} max={100} />}
474
+ * </div>
475
+ * )}
476
+ * </Flow.DropZone>
477
+ * </Flow>
478
+ * ```
479
+ *
480
+ * @example Multi-Input Flow
481
+ * ```tsx
482
+ * <Flow flowId="video-processor" storageId="s3">
483
+ * <Flow.Inputs>
484
+ * {({ inputs }) => inputs.map(input => (
485
+ * <Flow.Input key={input.nodeId} nodeId={input.nodeId}>
486
+ * {({ metadata }) => (
487
+ * <div>
488
+ * <label>{metadata.nodeName}</label>
489
+ * <Flow.Input.DropZone accept="video/*">
490
+ * {({ getRootProps, getInputProps }) => (
491
+ * <div {...getRootProps()}>
492
+ * <input {...getInputProps()} />
493
+ * </div>
494
+ * )}
495
+ * </Flow.Input.DropZone>
496
+ * </div>
497
+ * )}
498
+ * </Flow.Input>
499
+ * ))}
500
+ * </Flow.Inputs>
501
+ * <Flow.Submit>Process</Flow.Submit>
502
+ * </Flow>
503
+ * ```
504
+ */
505
+ declare const Flow: typeof FlowRoot & {
506
+ DropZone: typeof FlowDropZone;
507
+ Inputs: typeof FlowInputs;
508
+ Input: typeof FlowInput & {
509
+ DropZone: typeof FlowInputDropZone;
510
+ UrlField: typeof FlowInputUrlField;
511
+ Preview: typeof FlowInputPreview;
512
+ };
513
+ Progress: typeof FlowProgress;
514
+ Status: typeof FlowStatus;
515
+ Error: typeof FlowError;
516
+ Submit: typeof FlowSubmit;
517
+ Cancel: typeof FlowCancel;
518
+ Reset: typeof FlowReset;
519
+ };
53
520
  //#endregion
54
521
  //#region src/components/flow-upload-list.d.ts
55
522
  /**
@@ -255,7 +722,7 @@ declare function FlowUploadList({
255
722
  flowConfig,
256
723
  options,
257
724
  children
258
- }: FlowUploadListProps): react_jsx_runtime3.JSX.Element;
725
+ }: FlowUploadListProps): react_jsx_runtime0.JSX.Element;
259
726
  /**
260
727
  * Props for the SimpleFlowUploadListItem component.
261
728
  *
@@ -310,7 +777,7 @@ declare function SimpleFlowUploadListItem({
310
777
  onAbort,
311
778
  onRetry,
312
779
  onRemove
313
- }: SimpleFlowUploadListItemProps): react_jsx_runtime3.JSX.Element;
780
+ }: SimpleFlowUploadListItemProps): react_jsx_runtime0.JSX.Element;
314
781
  /**
315
782
  * Props for the SimpleFlowUploadList component.
316
783
  *
@@ -398,277 +865,7 @@ declare function SimpleFlowUploadList({
398
865
  className,
399
866
  showFileInput,
400
867
  accept
401
- }: SimpleFlowUploadListProps): react_jsx_runtime3.JSX.Element;
402
- //#endregion
403
- //#region src/components/flow-upload-zone.d.ts
404
- /**
405
- * Render props passed to the FlowUploadZone children function.
406
- * Provides access to flow upload state, drag-drop handlers, and helper functions.
407
- *
408
- * @property dragDrop - Complete drag-and-drop state and handlers
409
- * @property flowUpload - Flow upload hook with upload state and controls
410
- * @property isActive - True when dragging over zone
411
- * @property openFilePicker - Programmatically open file selection dialog
412
- * @property getRootProps - Returns props to spread on the drop zone container
413
- * @property getInputProps - Returns props to spread on the hidden file input
414
- */
415
- interface FlowUploadZoneRenderProps {
416
- /**
417
- * Drag and drop state and handlers
418
- */
419
- dragDrop: UseDragDropReturn;
420
- /**
421
- * Flow upload functionality
422
- */
423
- flowUpload: UseFlowUploadReturn;
424
- /**
425
- * Whether the zone is currently active (dragging or uploading)
426
- */
427
- isActive: boolean;
428
- /**
429
- * Open file picker
430
- */
431
- openFilePicker: () => void;
432
- /**
433
- * Props to spread on the drop zone element
434
- */
435
- getRootProps: () => {
436
- onDragEnter: (e: React.DragEvent) => void;
437
- onDragOver: (e: React.DragEvent) => void;
438
- onDragLeave: (e: React.DragEvent) => void;
439
- onDrop: (e: React.DragEvent) => void;
440
- };
441
- /**
442
- * Props to spread on the file input element
443
- */
444
- getInputProps: () => React.InputHTMLAttributes<HTMLInputElement>;
445
- }
446
- /**
447
- * Props for the FlowUploadZone component.
448
- *
449
- * @property flowConfig - Flow execution configuration (flowId, storageId, etc.)
450
- * @property options - Flow upload options (callbacks, metadata, etc.)
451
- * @property accept - Accepted file types (e.g., "image/*", ".pdf")
452
- * @property multiple - Allow multiple file selection (default: false)
453
- * @property children - Render function receiving flow upload zone state
454
- */
455
- interface FlowUploadZoneProps {
456
- /**
457
- * Flow configuration
458
- */
459
- flowConfig: FlowUploadConfig;
460
- /**
461
- * Upload options
462
- */
463
- options?: Omit<FlowUploadOptions, "flowConfig">;
464
- /**
465
- * Accepted file types (e.g., "image/*", ".pdf", etc.)
466
- */
467
- accept?: string;
468
- /**
469
- * Whether to allow multiple files (uses multi-upload internally)
470
- */
471
- multiple?: boolean;
472
- /**
473
- * Render function for the drop zone
474
- */
475
- children: (props: FlowUploadZoneRenderProps) => ReactNode;
476
- }
477
- /**
478
- * Headless flow upload zone component with drag-and-drop support.
479
- * Combines drag-drop functionality with flow processing, using render props
480
- * for complete UI control.
481
- *
482
- * Files uploaded through this zone are automatically processed through the
483
- * specified flow, which can perform operations like image optimization,
484
- * storage saving, webhooks, etc.
485
- *
486
- * Must be used within an UploadistaProvider.
487
- *
488
- * @param props - Flow upload zone configuration and render prop
489
- * @returns Rendered flow upload zone using the provided render prop
490
- *
491
- * @example
492
- * ```tsx
493
- * // Image upload with flow processing
494
- * <FlowUploadZone
495
- * flowConfig={{
496
- * flowId: "image-processing-flow",
497
- * storageId: "s3-images",
498
- * outputNodeId: "optimized-image",
499
- * }}
500
- * options={{
501
- * onSuccess: (result) => console.log('Processed:', result),
502
- * onFlowComplete: (outputs) => {
503
- * console.log('All outputs:', outputs);
504
- * },
505
- * }}
506
- * accept="image/*"
507
- * >
508
- * {({ dragDrop, flowUpload, getRootProps, getInputProps, openFilePicker }) => (
509
- * <div {...getRootProps()} style={{
510
- * border: dragDrop.state.isDragging ? '2px solid blue' : '2px dashed gray',
511
- * padding: '2rem',
512
- * textAlign: 'center'
513
- * }}>
514
- * <input {...getInputProps()} />
515
- *
516
- * {dragDrop.state.isDragging && (
517
- * <p>Drop image here...</p>
518
- * )}
519
- *
520
- * {!dragDrop.state.isDragging && !flowUpload.isUploading && (
521
- * <div>
522
- * <p>Drag an image or click to browse</p>
523
- * <button onClick={openFilePicker}>Choose File</button>
524
- * </div>
525
- * )}
526
- *
527
- * {flowUpload.isUploadingFile && (
528
- * <div>
529
- * <p>Uploading...</p>
530
- * <progress value={flowUpload.state.progress} max={100} />
531
- * <span>{flowUpload.state.progress}%</span>
532
- * </div>
533
- * )}
534
- *
535
- * {flowUpload.isProcessing && (
536
- * <div>
537
- * <p>Processing image...</p>
538
- * {flowUpload.state.currentNodeName && (
539
- * <span>Step: {flowUpload.state.currentNodeName}</span>
540
- * )}
541
- * </div>
542
- * )}
543
- *
544
- * {flowUpload.state.status === "success" && (
545
- * <div>
546
- * <p>✓ Upload complete!</p>
547
- * {flowUpload.state.result && (
548
- * <img src={flowUpload.state.result.url} alt="Uploaded" />
549
- * )}
550
- * </div>
551
- * )}
552
- *
553
- * {flowUpload.state.status === "error" && (
554
- * <div>
555
- * <p>Error: {flowUpload.state.error?.message}</p>
556
- * <button onClick={flowUpload.reset}>Try Again</button>
557
- * </div>
558
- * )}
559
- *
560
- * {flowUpload.isUploading && (
561
- * <button onClick={flowUpload.abort}>Cancel</button>
562
- * )}
563
- * </div>
564
- * )}
565
- * </FlowUploadZone>
566
- * ```
567
- *
568
- * @see {@link SimpleFlowUploadZone} for a pre-styled version
569
- * @see {@link useFlowUpload} for the underlying hook
570
- */
571
- declare function FlowUploadZone({
572
- flowConfig,
573
- options,
574
- accept,
575
- multiple,
576
- children
577
- }: FlowUploadZoneProps): react_jsx_runtime3.JSX.Element;
578
- /**
579
- * Props for the SimpleFlowUploadZone component.
580
- *
581
- * @property flowConfig - Flow execution configuration
582
- * @property options - Flow upload options (callbacks, metadata)
583
- * @property accept - Accepted file types
584
- * @property className - CSS class name for custom styling
585
- * @property dragText - Text displayed when dragging files over zone
586
- * @property idleText - Text displayed when zone is idle
587
- */
588
- interface SimpleFlowUploadZoneProps {
589
- /**
590
- * Flow configuration
591
- */
592
- flowConfig: FlowUploadConfig;
593
- /**
594
- * Upload options
595
- */
596
- options?: Omit<FlowUploadOptions, "flowConfig">;
597
- /**
598
- * Accepted file types
599
- */
600
- accept?: string;
601
- /**
602
- * CSS class for the container
603
- */
604
- className?: string;
605
- /**
606
- * Custom drag overlay text
607
- */
608
- dragText?: string;
609
- /**
610
- * Custom idle text
611
- */
612
- idleText?: string;
613
- }
614
- /**
615
- * Simple pre-styled flow upload zone component with built-in UI.
616
- * Provides a ready-to-use drag-and-drop interface for flow uploads.
617
- *
618
- * Features:
619
- * - Built-in drag-and-drop visual feedback
620
- * - Automatic progress display for upload and processing phases
621
- * - Success and error state display
622
- * - Cancel button during upload
623
- * - Customizable text labels
624
- *
625
- * @param props - Flow upload zone configuration with styling options
626
- * @returns Styled flow upload zone component
627
- *
628
- * @example
629
- * ```tsx
630
- * // Basic image upload with flow processing
631
- * <SimpleFlowUploadZone
632
- * flowConfig={{
633
- * flowId: "image-optimization-flow",
634
- * storageId: "s3-images",
635
- * }}
636
- * accept="image/*"
637
- * options={{
638
- * onSuccess: (result) => console.log("Image processed:", result),
639
- * onError: (error) => console.error("Processing failed:", error),
640
- * }}
641
- * idleText="Drop an image to optimize and upload"
642
- * dragText="Release to start processing"
643
- * className="my-upload-zone"
644
- * />
645
- *
646
- * // Document upload with custom flow
647
- * <SimpleFlowUploadZone
648
- * flowConfig={{
649
- * flowId: "document-processing-flow",
650
- * storageId: "docs",
651
- * outputNodeId: "processed-doc",
652
- * }}
653
- * accept=".pdf,.doc,.docx"
654
- * options={{
655
- * onFlowComplete: (outputs) => {
656
- * console.log('Processing outputs:', outputs);
657
- * },
658
- * }}
659
- * />
660
- * ```
661
- *
662
- * @see {@link FlowUploadZone} for the headless version with full control
663
- */
664
- declare function SimpleFlowUploadZone({
665
- flowConfig,
666
- options,
667
- accept,
668
- className,
669
- dragText,
670
- idleText
671
- }: SimpleFlowUploadZoneProps): react_jsx_runtime3.JSX.Element;
868
+ }: SimpleFlowUploadListProps): react_jsx_runtime0.JSX.Element;
672
869
  //#endregion
673
870
  //#region src/components/upload-list.d.ts
674
871
  /**
@@ -855,7 +1052,7 @@ declare function UploadList({
855
1052
  filter,
856
1053
  sortBy,
857
1054
  children
858
- }: UploadListProps): react_jsx_runtime3.JSX.Element;
1055
+ }: UploadListProps): react_jsx_runtime0.JSX.Element;
859
1056
  /**
860
1057
  * Props for the SimpleUploadListItem component.
861
1058
  *
@@ -935,7 +1132,7 @@ declare function SimpleUploadListItem({
935
1132
  className,
936
1133
  style,
937
1134
  showDetails
938
- }: SimpleUploadListItemProps): react_jsx_runtime3.JSX.Element;
1135
+ }: SimpleUploadListItemProps): react_jsx_runtime0.JSX.Element;
939
1136
  //#endregion
940
1137
  //#region src/components/upload-zone.d.ts
941
1138
  /**
@@ -1071,7 +1268,7 @@ declare function UploadZone({
1071
1268
  onUploadStart,
1072
1269
  onValidationError,
1073
1270
  ...dragDropOptions
1074
- }: UploadZoneProps): react_jsx_runtime3.JSX.Element;
1271
+ }: UploadZoneProps): react_jsx_runtime0.JSX.Element;
1075
1272
  /**
1076
1273
  * Props for the SimpleUploadZone component with built-in styling.
1077
1274
  *
@@ -1174,7 +1371,7 @@ declare function SimpleUploadZone({
1174
1371
  errorStyle,
1175
1372
  children,
1176
1373
  ...uploadZoneProps
1177
- }: SimpleUploadZoneProps): react_jsx_runtime3.JSX.Element;
1374
+ }: SimpleUploadZoneProps): react_jsx_runtime0.JSX.Element;
1178
1375
  //#endregion
1179
1376
  //#region src/components/uploadista-provider.d.ts
1180
1377
  /**
@@ -1198,7 +1395,7 @@ type UploadistaContextValue = UseUploadistaClientReturn & {
1198
1395
  * Subscribe to events (used internally by hooks)
1199
1396
  * @internal
1200
1397
  */
1201
- subscribeToEvents: (handler: (event: UploadistaEvent) => void) => () => void;
1398
+ subscribeToEvents: (handler: (event: UploadistaEvent$1) => void) => () => void;
1202
1399
  };
1203
1400
  /**
1204
1401
  * Context provider that provides uploadista client functionality to child components.
@@ -1245,7 +1442,7 @@ type UploadistaContextValue = UseUploadistaClientReturn & {
1245
1442
  declare function UploadistaProvider({
1246
1443
  children,
1247
1444
  ...options
1248
- }: UploadistaProviderProps): react_jsx_runtime3.JSX.Element;
1445
+ }: UploadistaProviderProps): react_jsx_runtime0.JSX.Element;
1249
1446
  /**
1250
1447
  * Hook to access the uploadista client from the UploadistaProvider context.
1251
1448
  * Must be used within an UploadistaProvider component.
@@ -1279,5 +1476,5 @@ declare function UploadistaProvider({
1279
1476
  */
1280
1477
  declare function useUploadistaContext(): UploadistaContextValue;
1281
1478
  //#endregion
1282
- export { SimpleFlowUploadListItemProps as C, FlowInputProps as E, SimpleFlowUploadListItem as S, FlowInput as T, SimpleFlowUploadZoneProps as _, UploadZone as a, FlowUploadListRenderProps as b, SimpleUploadListItem as c, UploadListProps as d, UploadListRenderProps as f, SimpleFlowUploadZone as g, FlowUploadZoneRenderProps as h, SimpleUploadZoneProps as i, SimpleUploadListItemProps as l, FlowUploadZoneProps as m, useUploadistaContext as n, UploadZoneProps as o, FlowUploadZone as p, SimpleUploadZone as r, UploadZoneRenderProps as s, UploadistaProvider as t, UploadList as u, FlowUploadList as v, SimpleFlowUploadListProps as w, SimpleFlowUploadList as x, FlowUploadListProps as y };
1283
- //# sourceMappingURL=uploadista-provider-D-N-eL2l.d.mts.map
1479
+ export { FlowInputPreviewProps as A, FlowStatusProps as B, FlowDropZoneProps as C, FlowInputContextValue as D, FlowErrorRenderProps as E, FlowInputsRenderProps as F, FlowSubmitProps as H, FlowProgressProps as I, FlowProgressRenderProps as L, FlowInputProps as M, FlowInputUrlFieldProps as N, FlowInputDropZoneProps as O, FlowInputsProps as P, FlowProps as R, FlowContextValue as S, FlowErrorProps as T, useFlowContext as U, FlowStatusRenderProps as V, useFlowInputContext as W, SimpleFlowUploadListItem as _, UploadZone as a, Flow as b, SimpleUploadListItem as c, UploadListProps as d, UploadListRenderProps as f, SimpleFlowUploadList as g, FlowUploadListRenderProps as h, SimpleUploadZoneProps as i, FlowInputPreviewRenderProps as j, FlowInputDropZoneRenderProps as k, SimpleUploadListItemProps as l, FlowUploadListProps as m, useUploadistaContext as n, UploadZoneProps as o, FlowUploadList as p, SimpleUploadZone as r, UploadZoneRenderProps as s, UploadistaProvider as t, UploadList as u, SimpleFlowUploadListItemProps as v, FlowDropZoneRenderProps as w, FlowCancelProps as x, SimpleFlowUploadListProps as y, FlowResetProps as z };
1480
+ //# sourceMappingURL=uploadista-provider-Cb13AK7Z.d.mts.map