@uploadista/react 0.1.2 → 0.1.3-beta.3

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.
@@ -1,3 +1,3 @@
1
- import { a as MultiUploadState, l as UploadState, o as UploadItem, u as UploadStatus } from "../use-uploadista-client-CkzVVmFT.mjs";
2
- import { $ as FlowInputPreviewRenderProps, A as SimpleUploadListItem, B as SimpleFlowUploadListItemProps, C as UploadResetProps, D as UploadStatusRenderProps, E as UploadStatusProps, F as FlowUploadList, G as FlowDropZoneProps, H as Flow, I as FlowUploadListProps, J as FlowErrorRenderProps, K as FlowDropZoneRenderProps, L as FlowUploadListRenderProps, M as UploadList, N as UploadListProps, O as useUploadContext, P as UploadListRenderProps, Q as FlowInputPreviewProps, R as SimpleFlowUploadList, S as UploadProps, T as UploadStartAllProps, U as FlowCancelProps, V as SimpleFlowUploadListProps, W as FlowContextValue, X as FlowInputDropZoneProps, Y as FlowInputContextValue, Z as FlowInputDropZoneRenderProps, _ as UploadItemProps, a as UploadZone, at as FlowProgressRenderProps, b as UploadProgressProps, c as Upload, ct as FlowStatusProps, d as UploadContextValue, dt as useFlowContext, et as FlowInputProps, f as UploadDropZoneProps, ft as useFlowInputContext, g as UploadItemContextValue, h as UploadErrorRenderProps, i as SimpleUploadZoneProps, it as FlowProgressProps, j as SimpleUploadListItemProps, k as useUploadItemContext, l as UploadCancelProps, lt as FlowStatusRenderProps, m as UploadErrorProps, n as useUploadistaContext, nt as FlowInputsProps, o as UploadZoneProps, ot as FlowProps, p as UploadDropZoneRenderProps, q as FlowErrorProps, r as SimpleUploadZone, rt as FlowInputsRenderProps, s as UploadZoneRenderProps, st as FlowResetProps, t as UploadistaProvider, tt as FlowInputUrlFieldProps, u as UploadClearCompletedProps, ut as FlowSubmitProps, v as UploadItemsProps, w as UploadRetryProps, x as UploadProgressRenderProps, y as UploadItemsRenderProps, z as SimpleFlowUploadListItem } from "../uploadista-provider-DwKXudoT.mjs";
1
+ import { a as MultiUploadState, l as UploadState, o as UploadItem, u as UploadStatus } from "../use-uploadista-client-wN0jDK-k.mjs";
2
+ import { $ as FlowInputPreviewRenderProps, A as SimpleUploadListItem, B as SimpleFlowUploadListItemProps, C as UploadResetProps, D as UploadStatusRenderProps, E as UploadStatusProps, F as FlowUploadList, G as FlowDropZoneProps, H as Flow, I as FlowUploadListProps, J as FlowErrorRenderProps, K as FlowDropZoneRenderProps, L as FlowUploadListRenderProps, M as UploadList, N as UploadListProps, O as useUploadContext, P as UploadListRenderProps, Q as FlowInputPreviewProps, R as SimpleFlowUploadList, S as UploadProps, T as UploadStartAllProps, U as FlowCancelProps, V as SimpleFlowUploadListProps, W as FlowContextValue, X as FlowInputDropZoneProps, Y as FlowInputContextValue, Z as FlowInputDropZoneRenderProps, _ as UploadItemProps, a as UploadZone, at as FlowProgressRenderProps, b as UploadProgressProps, c as Upload, ct as FlowStatusProps, d as UploadContextValue, dt as useFlowContext, et as FlowInputProps, f as UploadDropZoneProps, ft as useFlowInputContext, g as UploadItemContextValue, h as UploadErrorRenderProps, i as SimpleUploadZoneProps, it as FlowProgressProps, j as SimpleUploadListItemProps, k as useUploadItemContext, l as UploadCancelProps, lt as FlowStatusRenderProps, m as UploadErrorProps, n as useUploadistaContext, nt as FlowInputsProps, o as UploadZoneProps, ot as FlowProps, p as UploadDropZoneRenderProps, q as FlowErrorProps, r as SimpleUploadZone, rt as FlowInputsRenderProps, s as UploadZoneRenderProps, st as FlowResetProps, t as UploadistaProvider, tt as FlowInputUrlFieldProps, u as UploadClearCompletedProps, ut as FlowSubmitProps, v as UploadItemsProps, w as UploadRetryProps, x as UploadProgressRenderProps, y as UploadItemsRenderProps, z as SimpleFlowUploadListItem } from "../uploadista-provider-dSzfz9mG.mjs";
3
3
  export { Flow, type FlowCancelProps, type FlowContextValue, type FlowDropZoneProps, type FlowDropZoneRenderProps, type FlowErrorProps, type FlowErrorRenderProps, type FlowInputContextValue, type FlowInputDropZoneProps, type FlowInputDropZoneRenderProps, type FlowInputPreviewProps, type FlowInputPreviewRenderProps, type FlowInputProps, type FlowInputUrlFieldProps, type FlowInputsProps, type FlowInputsRenderProps, type FlowProgressProps, type FlowProgressRenderProps, type FlowProps, type FlowResetProps, type FlowStatusProps, type FlowStatusRenderProps, type FlowSubmitProps, FlowUploadList, type FlowUploadListProps, type FlowUploadListRenderProps, type MultiUploadState, SimpleFlowUploadList, SimpleFlowUploadListItem, type SimpleFlowUploadListItemProps, type SimpleFlowUploadListProps, SimpleUploadListItem, type SimpleUploadListItemProps, SimpleUploadZone, type SimpleUploadZoneProps, Upload, type UploadCancelProps, type UploadClearCompletedProps, type UploadContextValue, type UploadDropZoneProps, type UploadDropZoneRenderProps, type UploadErrorProps, type UploadErrorRenderProps, type UploadItem, type UploadItemContextValue, type UploadItemProps, type UploadItemsProps, type UploadItemsRenderProps, UploadList, type UploadListProps, type UploadListRenderProps, type UploadProgressProps, type UploadProgressRenderProps, type UploadProps, type UploadResetProps, type UploadRetryProps, type UploadStartAllProps, type UploadState, type UploadStatus, type UploadStatusProps, type UploadStatusRenderProps, UploadZone, type UploadZoneProps, type UploadZoneRenderProps, UploadistaProvider, useFlowContext, useFlowInputContext, useUploadContext, useUploadItemContext, useUploadistaContext };
@@ -1 +1 @@
1
- import{a as e,o as t}from"../use-upload-BgaJmdwF.mjs";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"../upload-zone-CH8B2-hl.mjs";export{i as Flow,r as FlowUploadList,s as SimpleFlowUploadList,m as SimpleFlowUploadListItem,l as SimpleUploadListItem,p as SimpleUploadZone,d as Upload,f as UploadList,c as UploadZone,e as UploadistaProvider,a as useFlowContext,u as useFlowInputContext,o as useUploadContext,n as useUploadItemContext,t as useUploadistaContext};
1
+ import{a as e,o as t}from"../use-upload-Ccc_uzbr.mjs";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"../upload-zone-Dz6GwCwO.mjs";export{i as Flow,r as FlowUploadList,s as SimpleFlowUploadList,m as SimpleFlowUploadListItem,l as SimpleUploadListItem,p as SimpleUploadZone,d as Upload,f as UploadList,c as UploadZone,e as UploadistaProvider,a as useFlowContext,u as useFlowInputContext,o as useUploadContext,n as useUploadItemContext,t as useUploadistaContext};
@@ -1,3 +1,3 @@
1
- import { C as useDragDrop, S as UseDragDropReturn, _ as InputExecutionState, a as MultiUploadState, b as DragDropOptions, c as useMultiUpload, d as UseUploadOptions, f as UseUploadReturn, g as FlowUploadStatus, h as FlowUploadState, i as MultiUploadOptions, l as UploadState, m as FlowInputMetadata, n as UseUploadistaClientReturn, o as UploadItem, p as useUpload, r as useUploadistaClient, s as UseMultiUploadReturn, t as UseUploadistaClientOptions, u as UploadStatus, v as UseFlowReturn, x as DragDropState, y as useFlow } from "../use-uploadista-client-CkzVVmFT.mjs";
2
- import { _ as UseFlowEventsOptions, a as UseUploadMetricsReturn, b as isUploadEvent, c as UploadFileEventData, d as UploadValidationSuccessEventData, f as UploadValidationWarningEventData, g as useMultiFlowUpload, h as UseMultiFlowUploadReturn, i as UseUploadMetricsOptions, l as UploadProgressEventData, m as useUploadEvents, n as FileUploadMetrics, o as useUploadMetrics, p as UseUploadEventsOptions, r as UploadMetrics, s as UploadFailedEventData, t as useUploadistaEvents, u as UploadValidationFailedEventData, v as useFlowEvents, y as isFlowEvent } from "../use-uploadista-events-CtDXJYrR.mjs";
1
+ import { C as useDragDrop, S as UseDragDropReturn, _ as InputExecutionState, a as MultiUploadState, b as DragDropOptions, c as useMultiUpload, d as UseUploadOptions, f as UseUploadReturn, g as FlowUploadStatus, h as FlowUploadState, i as MultiUploadOptions, l as UploadState, m as FlowInputMetadata, n as UseUploadistaClientReturn, o as UploadItem, p as useUpload, r as useUploadistaClient, s as UseMultiUploadReturn, t as UseUploadistaClientOptions, u as UploadStatus, v as UseFlowReturn, x as DragDropState, y as useFlow } from "../use-uploadista-client-wN0jDK-k.mjs";
2
+ import { _ as UseFlowEventsOptions, a as UseUploadMetricsReturn, b as isUploadEvent, c as UploadFileEventData, d as UploadValidationSuccessEventData, f as UploadValidationWarningEventData, g as useMultiFlowUpload, h as UseMultiFlowUploadReturn, i as UseUploadMetricsOptions, l as UploadProgressEventData, m as useUploadEvents, n as FileUploadMetrics, o as useUploadMetrics, p as UseUploadEventsOptions, r as UploadMetrics, s as UploadFailedEventData, t as useUploadistaEvents, u as UploadValidationFailedEventData, v as useFlowEvents, y as isFlowEvent } from "../use-uploadista-events-BiqIYgQN.mjs";
3
3
  export { type DragDropOptions, type DragDropState, type FileUploadMetrics, type FlowInputMetadata, type FlowUploadState, type FlowUploadStatus, type InputExecutionState, type MultiUploadOptions, type MultiUploadState, type UploadFailedEventData, type UploadFileEventData, type UploadItem, type UploadMetrics, type UploadProgressEventData, type UploadState, type UploadStatus, type UploadValidationFailedEventData, type UploadValidationSuccessEventData, type UploadValidationWarningEventData, type UseDragDropReturn, type UseFlowEventsOptions, type UseFlowReturn, type UseMultiFlowUploadReturn, type UseMultiUploadReturn, type UseUploadEventsOptions, type UseUploadMetricsOptions, type UseUploadMetricsReturn, type UseUploadOptions, type UseUploadReturn, type UseUploadistaClientOptions, type UseUploadistaClientReturn, isFlowEvent, isUploadEvent, useDragDrop, useFlow, useFlowEvents, useMultiFlowUpload, useMultiUpload, useUpload, useUploadEvents, useUploadMetrics, useUploadistaClient, useUploadistaEvents };
@@ -1 +1 @@
1
- import{i as e,n as t,r as n,s as r,t as i,u as a}from"../use-upload-BgaJmdwF.mjs";import{a as o,i as s,n as c,o as l,r as u,t as d}from"../use-uploadista-events-KhJ4knam.mjs";export{o as isFlowEvent,l as isUploadEvent,a as useDragDrop,e as useFlow,s as useFlowEvents,n as useMultiFlowUpload,t as useMultiUpload,i as useUpload,u as useUploadEvents,c as useUploadMetrics,r as useUploadistaClient,d as useUploadistaEvents};
1
+ import{i as e,n as t,r as n,s as r,t as i,u as a}from"../use-upload-Ccc_uzbr.mjs";import{a as o,i as s,n as c,o as l,r as u,t as d}from"../use-uploadista-events-C5SlouR3.mjs";export{o as isFlowEvent,l as isUploadEvent,a as useDragDrop,e as useFlow,s as useFlowEvents,n as useMultiFlowUpload,t as useMultiUpload,i as useUpload,u as useUploadEvents,c as useUploadMetrics,r as useUploadistaClient,d as useUploadistaEvents};
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as useDragDrop, S as UseDragDropReturn, _ as InputExecutionState, a as MultiUploadState, b as DragDropOptions, c as useMultiUpload, d as UseUploadOptions, f as UseUploadReturn, g as FlowUploadStatus, h as FlowUploadState, i as MultiUploadOptions, l as UploadState, m as FlowInputMetadata, n as UseUploadistaClientReturn, o as UploadItem, p as useUpload, r as useUploadistaClient, s as UseMultiUploadReturn, t as UseUploadistaClientOptions, u as UploadStatus, v as UseFlowReturn, x as DragDropState, y as useFlow } from "./use-uploadista-client-CkzVVmFT.mjs";
2
- import { $ as FlowInputPreviewRenderProps, A as SimpleUploadListItem, B as SimpleFlowUploadListItemProps, C as UploadResetProps, D as UploadStatusRenderProps, E as UploadStatusProps, F as FlowUploadList, G as FlowDropZoneProps, H as Flow, I as FlowUploadListProps, J as FlowErrorRenderProps, K as FlowDropZoneRenderProps, L as FlowUploadListRenderProps, M as UploadList, N as UploadListProps, O as useUploadContext, P as UploadListRenderProps, Q as FlowInputPreviewProps, R as SimpleFlowUploadList, S as UploadProps, T as UploadStartAllProps, U as FlowCancelProps, V as SimpleFlowUploadListProps, W as FlowContextValue, X as FlowInputDropZoneProps, Y as FlowInputContextValue, Z as FlowInputDropZoneRenderProps, _ as UploadItemProps, a as UploadZone, at as FlowProgressRenderProps, b as UploadProgressProps, c as Upload, ct as FlowStatusProps, d as UploadContextValue, dt as useFlowContext, et as FlowInputProps, f as UploadDropZoneProps, ft as useFlowInputContext, g as UploadItemContextValue, h as UploadErrorRenderProps, i as SimpleUploadZoneProps, it as FlowProgressProps, j as SimpleUploadListItemProps, k as useUploadItemContext, l as UploadCancelProps, lt as FlowStatusRenderProps, m as UploadErrorProps, n as useUploadistaContext, nt as FlowInputsProps, o as UploadZoneProps, ot as FlowProps, p as UploadDropZoneRenderProps, q as FlowErrorProps, r as SimpleUploadZone, rt as FlowInputsRenderProps, s as UploadZoneRenderProps, st as FlowResetProps, t as UploadistaProvider, tt as FlowInputUrlFieldProps, u as UploadClearCompletedProps, ut as FlowSubmitProps, v as UploadItemsProps, w as UploadRetryProps, x as UploadProgressRenderProps, y as UploadItemsRenderProps, z as SimpleFlowUploadListItem } from "./uploadista-provider-DwKXudoT.mjs";
3
- import { _ as UseFlowEventsOptions, a as UseUploadMetricsReturn, b as isUploadEvent, c as UploadFileEventData, d as UploadValidationSuccessEventData, f as UploadValidationWarningEventData, g as useMultiFlowUpload, h as UseMultiFlowUploadReturn, i as UseUploadMetricsOptions, l as UploadProgressEventData, m as useUploadEvents, n as FileUploadMetrics, o as useUploadMetrics, p as UseUploadEventsOptions, r as UploadMetrics, s as UploadFailedEventData, t as useUploadistaEvents, u as UploadValidationFailedEventData, v as useFlowEvents, y as isFlowEvent } from "./use-uploadista-events-CtDXJYrR.mjs";
1
+ import { C as useDragDrop, S as UseDragDropReturn, _ as InputExecutionState, a as MultiUploadState, b as DragDropOptions, c as useMultiUpload, d as UseUploadOptions, f as UseUploadReturn, g as FlowUploadStatus, h as FlowUploadState, i as MultiUploadOptions, l as UploadState, m as FlowInputMetadata, n as UseUploadistaClientReturn, o as UploadItem, p as useUpload, r as useUploadistaClient, s as UseMultiUploadReturn, t as UseUploadistaClientOptions, u as UploadStatus, v as UseFlowReturn, x as DragDropState, y as useFlow } from "./use-uploadista-client-wN0jDK-k.mjs";
2
+ import { $ as FlowInputPreviewRenderProps, A as SimpleUploadListItem, B as SimpleFlowUploadListItemProps, C as UploadResetProps, D as UploadStatusRenderProps, E as UploadStatusProps, F as FlowUploadList, G as FlowDropZoneProps, H as Flow, I as FlowUploadListProps, J as FlowErrorRenderProps, K as FlowDropZoneRenderProps, L as FlowUploadListRenderProps, M as UploadList, N as UploadListProps, O as useUploadContext, P as UploadListRenderProps, Q as FlowInputPreviewProps, R as SimpleFlowUploadList, S as UploadProps, T as UploadStartAllProps, U as FlowCancelProps, V as SimpleFlowUploadListProps, W as FlowContextValue, X as FlowInputDropZoneProps, Y as FlowInputContextValue, Z as FlowInputDropZoneRenderProps, _ as UploadItemProps, a as UploadZone, at as FlowProgressRenderProps, b as UploadProgressProps, c as Upload, ct as FlowStatusProps, d as UploadContextValue, dt as useFlowContext, et as FlowInputProps, f as UploadDropZoneProps, ft as useFlowInputContext, g as UploadItemContextValue, h as UploadErrorRenderProps, i as SimpleUploadZoneProps, it as FlowProgressProps, j as SimpleUploadListItemProps, k as useUploadItemContext, l as UploadCancelProps, lt as FlowStatusRenderProps, m as UploadErrorProps, n as useUploadistaContext, nt as FlowInputsProps, o as UploadZoneProps, ot as FlowProps, p as UploadDropZoneRenderProps, q as FlowErrorProps, r as SimpleUploadZone, rt as FlowInputsRenderProps, s as UploadZoneRenderProps, st as FlowResetProps, t as UploadistaProvider, tt as FlowInputUrlFieldProps, u as UploadClearCompletedProps, ut as FlowSubmitProps, v as UploadItemsProps, w as UploadRetryProps, x as UploadProgressRenderProps, y as UploadItemsRenderProps, z as SimpleFlowUploadListItem } from "./uploadista-provider-dSzfz9mG.mjs";
3
+ import { _ as UseFlowEventsOptions, a as UseUploadMetricsReturn, b as isUploadEvent, c as UploadFileEventData, d as UploadValidationSuccessEventData, f as UploadValidationWarningEventData, g as useMultiFlowUpload, h as UseMultiFlowUploadReturn, i as UseUploadMetricsOptions, l as UploadProgressEventData, m as useUploadEvents, n as FileUploadMetrics, o as useUploadMetrics, p as UseUploadEventsOptions, r as UploadMetrics, s as UploadFailedEventData, t as useUploadistaEvents, u as UploadValidationFailedEventData, v as useFlowEvents, y as isFlowEvent } from "./use-uploadista-events-BiqIYgQN.mjs";
4
4
  import { ReactNode } from "react";
5
5
  import { FlowManager, FlowManagerCallbacks } from "@uploadista/client-core";
6
- import * as react_jsx_runtime32 from "react/jsx-runtime";
6
+ import * as react_jsx_runtime30 from "react/jsx-runtime";
7
7
  import { FlowUploadOptions } from "@uploadista/client-browser";
8
8
 
9
9
  //#region src/contexts/flow-manager-context.d.ts
@@ -54,7 +54,7 @@ interface FlowManagerProviderProps {
54
54
  */
55
55
  declare function FlowManagerProvider({
56
56
  children
57
- }: FlowManagerProviderProps): react_jsx_runtime32.JSX.Element;
57
+ }: FlowManagerProviderProps): react_jsx_runtime30.JSX.Element;
58
58
  /**
59
59
  * Hook to access the FlowManager context.
60
60
  * Must be used within a FlowManagerProvider.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/contexts/flow-manager-context.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;;UAkDU,uBAAA;;;AAvC6B;;;;;AAqDrB;AAuClB;EAAsC,UAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,SAAA,EAzCvB,oBAyCuB,EAAA,OAAA,EAxCzB,iBAwCyB,EAAA,GAvC/B,WAuC+B,CAAA,OAAA,CAAA;EAAY;;;AAuGlD;;;;;;;;UA5HU,wBAAA;YACE;;;;;;;;;;;;;;;;;;;iBAoBI,mBAAA;;GAAkC,2BAAwB,mBAAA,CAAA,GAAA,CAAA;;;;;;;;;;;;;;;;iBAuG1D,qBAAA,CAAA,GAAyB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/contexts/flow-manager-context.tsx"],"mappings":";;;;;;;;;;;;UAkDU,uBAAA;;;AAvC6B;;;;;;;EAiDrC,UAAA,GACE,MAAA,UACA,SAAA,EAAW,oBAAA,EACX,OAAA,EAAS,iBAAA,KACN,WAAA;EAJL;;;;;;EAYA,cAAA,GAAiB,MAAA;AAAA;;;;UAUT,wBAAA;EACR,QAAA,EAAU,SAAA;AAAA;;;AAoBZ;;;;;;;;;;;;;;;iBAAgB,mBAAA,CAAA;EAAsB;AAAA,GAAY,wBAAA,GAAwB,mBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;;;;;;;;;iBAuG1D,qBAAA,CAAA,GAAyB,uBAAA"}
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./use-upload-BgaJmdwF.mjs";import{a as u,c as d,d as f,f as p,i as m,l as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./upload-zone-CH8B2-hl.mjs";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./use-uploadista-events-KhJ4knam.mjs";export{f as Flow,t as FlowManagerProvider,d as FlowUploadList,h as SimpleFlowUploadList,S as SimpleFlowUploadListItem,_ as SimpleUploadListItem,x as SimpleUploadZone,y as Upload,b as UploadList,g as UploadZone,e as UploadistaProvider,C as isFlowEvent,E as isUploadEvent,l as useDragDrop,n as useFlow,p as useFlowContext,w as useFlowEvents,v as useFlowInputContext,r as useFlowManagerContext,o as useMultiFlowUpload,i as useMultiUpload,c as useUpload,m as useUploadContext,D as useUploadEvents,u as useUploadItemContext,T as useUploadMetrics,s as useUploadistaClient,a as useUploadistaContext,O as useUploadistaEvents};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./use-upload-Ccc_uzbr.mjs";import{a as u,c as d,d as f,f as p,i as m,l as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./upload-zone-Dz6GwCwO.mjs";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./use-uploadista-events-C5SlouR3.mjs";export{f as Flow,t as FlowManagerProvider,d as FlowUploadList,h as SimpleFlowUploadList,S as SimpleFlowUploadListItem,_ as SimpleUploadListItem,x as SimpleUploadZone,y as Upload,b as UploadList,g as UploadZone,e as UploadistaProvider,C as isFlowEvent,E as isUploadEvent,l as useDragDrop,n as useFlow,p as useFlowContext,w as useFlowEvents,v as useFlowInputContext,r as useFlowManagerContext,o as useMultiFlowUpload,i as useMultiUpload,c as useUpload,m as useUploadContext,D as useUploadEvents,u as useUploadItemContext,T as useUploadMetrics,s as useUploadistaClient,a as useUploadistaContext,O as useUploadistaEvents};
@@ -1,2 +1,2 @@
1
- import{i as e,n as t,r as n,t as r,u as i}from"./use-upload-BgaJmdwF.mjs";import{createContext as a,useCallback as o,useContext as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";const d=a(null);function f(){let e=s(d);if(!e)throw Error(`useFlowContext must be used within a <Flow> component. Wrap your component tree with <Flow flowId="..." storageId="...">`);return e}const p=a(null);function m(){let e=s(p);if(!e)throw Error(`useFlowInputContext must be used within a <Flow.Input> component. Wrap your component with <Flow.Input nodeId="...">`);return e}function h({flowId:t,storageId:n,outputNodeId:r,metadata:i,onSuccess:a,onError:o,onProgress:s,onFlowComplete:c,onAbort:u,children:f}){let p=e({flowConfig:{flowId:t,storageId:n,outputNodeId:r,metadata:i},onSuccess:a,onError:o,onProgress:s,onFlowComplete:c,onAbort:u}),m={state:p.state,inputMetadata:p.inputMetadata,inputs:p.inputs,inputStates:p.inputStates,setInput:p.setInput,execute:p.execute,upload:p.upload,abort:p.abort,pause:p.pause,reset:p.reset,isUploading:p.isUploading,isUploadingFile:p.isUploadingFile,isProcessing:p.isProcessing,isDiscoveringInputs:p.isDiscoveringInputs};return l(d.Provider,{value:m,children:f})}function g({accept:e,maxFileSize:t,children:n}){let r=f(),a=i({onFilesReceived:e=>{let t=e[0];t&&r.upload(t)},accept:e?e.split(`,`).map(e=>e.trim()):void 0,maxFileSize:t,multiple:!1});return l(c,{children:n({isDragging:a.state.isDragging,isOver:a.state.isOver,progress:r.state.progress,status:r.state.status,getRootProps:()=>a.dragHandlers,getInputProps:()=>a.inputProps,openFilePicker:a.openFilePicker,dragDropState:a.state})})}function _({children:e}){let t=f();return l(c,{children:e({inputs:t.inputMetadata??[],isLoading:t.isDiscoveringInputs})})}function v({nodeId:e,children:t}){let n=f(),r=n.inputMetadata?.find(t=>t.nodeId===e);if(!r)return null;let i={nodeId:e,metadata:r,value:n.inputs[e],setValue:t=>n.setInput(e,t),state:n.inputStates.get(e)};return l(p.Provider,{value:i,children:typeof t==`function`?t(i):t})}function y({accept:e,maxFileSize:t,children:n}){let r=m(),a=i({onFilesReceived:e=>{let t=e[0];t&&r.setValue(t)},accept:e?e.split(`,`).map(e=>e.trim()):void 0,maxFileSize:t,multiple:!1});return l(c,{children:n({isDragging:a.state.isDragging,isOver:a.state.isOver,value:r.value,progress:r.state?.progress??0,status:r.state?.status??`idle`,getRootProps:()=>a.dragHandlers,getInputProps:()=>a.inputProps,openFilePicker:a.openFilePicker,dragDropState:a.state})})}function b({placeholder:e=`https://example.com/file`,...t}){let n=m();return l(`input`,{type:`url`,value:typeof n.value==`string`?n.value:``,onChange:e=>n.setValue(e.target.value),placeholder:e,...t})}function x({children:e}){let t=m(),n=t.value instanceof File,r=typeof t.value==`string`&&t.value.length>0;return l(c,{children:e({value:t.value,isFile:n,isUrl:r,fileName:n?t.value.name:null,fileSize:n?t.value.size:null,clear:()=>t.setValue(void 0)})})}function S({children:e}){let t=f();return l(c,{children:e({progress:t.state.progress,bytesUploaded:t.state.bytesUploaded,totalBytes:t.state.totalBytes,status:t.state.status})})}function C({children:e}){let t=f();return l(c,{children:e({status:t.state.status,currentNodeName:t.state.currentNodeName,currentNodeType:t.state.currentNodeType,error:t.state.error,jobId:t.state.jobId,flowStarted:t.state.flowStarted,flowOutputs:t.state.flowOutputs})})}function w({children:e}){let t=f();return l(c,{children:e({error:t.state.error,hasError:t.state.status===`error`,message:t.state.error?.message??null,reset:t.reset})})}function T({children:e,disabled:t,...n}){let r=f();return l(`button`,{type:`button`,onClick:o(()=>{r.execute()},[r]),disabled:t||r.isUploading,...n,children:e})}function E({children:e,...t}){let n=f();return l(`button`,{type:`button`,onClick:o(()=>{n.abort()},[n]),...t,children:e})}function D({children:e,...t}){let n=f();return l(`button`,{type:`button`,onClick:o(()=>{n.reset()},[n]),...t,children:e})}const O=Object.assign(h,{DropZone:g,Inputs:_,Input:Object.assign(v,{DropZone:y,UrlField:b,Preview:x}),Progress:S,Status:C,Error:w,Submit:T,Cancel:E,Reset:D});function k({flowConfig:e,options:t,children:r}){let i=n({...t,flowConfig:e});return l(c,{children:r({items:i.state.items,totalProgress:i.state.totalProgress,activeUploads:i.state.activeUploads,completedUploads:i.state.completedUploads,failedUploads:i.state.failedUploads,isUploading:i.isUploading,addFiles:i.addFiles,removeFile:i.removeFile,startUpload:i.startUpload,abortUpload:i.abortUpload,abortAll:i.abortAll,clear:i.clear,retryUpload:i.retryUpload})})}function A({item:e,onAbort:t,onRetry:n,onRemove:r}){return u(`div`,{style:{display:`flex`,alignItems:`center`,gap:`12px`,padding:`8px`,borderBottom:`1px solid #eee`},children:[l(`span`,{style:{color:(()=>{switch(e.status){case`success`:return`green`;case`error`:return`red`;case`uploading`:return`blue`;case`aborted`:return`gray`;default:return`black`}})(),fontSize:`18px`},children:(()=>{switch(e.status){case`success`:return`✓`;case`error`:return`✗`;case`uploading`:return`⟳`;case`aborted`:return`⊘`;default:return`○`}})()}),u(`div`,{style:{flex:1,minWidth:0},children:[l(`div`,{style:{fontSize:`14px`,fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.file instanceof File?e.file.name:`Upload`}),e.status===`uploading`&&u(`div`,{style:{marginTop:`4px`},children:[l(`progress`,{value:e.progress,max:100,style:{width:`100%`,height:`4px`}}),u(`div`,{style:{fontSize:`12px`,color:`#666`,marginTop:`2px`},children:[e.progress,`% • `,Math.round(e.bytesUploaded/1024),` KB /`,` `,Math.round(e.totalBytes/1024),` KB`]})]}),e.status===`error`&&l(`div`,{style:{fontSize:`12px`,color:`red`,marginTop:`2px`},children:e.error?.message||`Upload failed`}),e.status===`success`&&l(`div`,{style:{fontSize:`12px`,color:`green`,marginTop:`2px`},children:`Upload complete`})]}),u(`div`,{style:{display:`flex`,gap:`8px`},children:[e.status===`uploading`&&l(`button`,{type:`button`,onClick:t,style:{padding:`4px 8px`,fontSize:`12px`,borderRadius:`4px`,border:`1px solid #ccc`,backgroundColor:`#fff`,cursor:`pointer`},children:`Cancel`}),e.status===`error`&&l(`button`,{type:`button`,onClick:n,style:{padding:`4px 8px`,fontSize:`12px`,borderRadius:`4px`,border:`1px solid #ccc`,backgroundColor:`#fff`,cursor:`pointer`},children:`Retry`}),(e.status===`pending`||e.status===`error`||e.status===`aborted`)&&l(`button`,{type:`button`,onClick:r,style:{padding:`4px 8px`,fontSize:`12px`,borderRadius:`4px`,border:`1px solid #ccc`,backgroundColor:`#fff`,cursor:`pointer`},children:`Remove`})]})]})}function j({flowConfig:e,options:t,className:n=``,showFileInput:r=!0,accept:i}){return l(k,{flowConfig:e,options:t,children:({items:e,addFiles:t,startUpload:a,abortUpload:o,retryUpload:s,removeFile:c,totalProgress:d})=>u(`div`,{className:n,children:[r&&l(`div`,{style:{marginBottom:`16px`},children:l(`input`,{type:`file`,multiple:!0,accept:i,onChange:e=>{e.target.files&&(t(e.target.files),a())},style:{padding:`8px`,border:`1px solid #ccc`,borderRadius:`4px`}})}),e.length>0&&u(`div`,{children:[u(`div`,{style:{marginBottom:`8px`,fontSize:`14px`,color:`#666`},children:[`Total Progress: `,d,`%`]}),l(`div`,{style:{border:`1px solid #eee`,borderRadius:`8px`,overflow:`hidden`},children:e.map(e=>l(A,{item:e,onAbort:()=>o(e.id),onRetry:()=>s(e.id),onRemove:()=>c(e.id)},e.id))})]})]})})}function M({multiUpload:e,filter:t,sortBy:n,children:r}){let i=e.items;t&&(i=i.filter(t)),n&&(i=[...i].sort(n));let a={idle:i.filter(e=>e.state.status===`idle`),uploading:i.filter(e=>e.state.status===`uploading`),success:i.filter(e=>e.state.status===`success`),error:i.filter(e=>e.state.status===`error`),aborted:i.filter(e=>e.state.status===`aborted`)};return l(c,{children:r({items:i,itemsByStatus:a,multiUpload:e,actions:{removeItem:t=>{e.removeItem(t)},retryItem:t=>{e.retryFailed()},abortItem:t=>{e.removeItem(t.id)},startItem:t=>{e.startAll()}}})})}function N({item:e,actions:t,className:n=``,style:r={},showDetails:i=!0}){let a=e=>{switch(e){case`idle`:return`#6c757d`;case`uploading`:return`#007bff`;case`success`:return`#28a745`;case`error`:return`#dc3545`;case`aborted`:return`#6c757d`;default:return`#6c757d`}},o=e=>{switch(e){case`idle`:return`⏳`;case`uploading`:return`📤`;case`success`:return`✅`;case`error`:return`❌`;case`aborted`:return`⏹️`;default:return`❓`}},s=e=>{if(e===0)return`0 Bytes`;let t=1024,n=[`Bytes`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/t**r).toFixed(2))} ${n[r]}`};return u(`div`,{className:`upload-list-item upload-list-item--${e.state.status} ${n}`,style:{padding:`12px`,border:`1px solid #e0e0e0`,borderRadius:`6px`,marginBottom:`8px`,backgroundColor:`#fff`,transition:`all 0.2s ease`,...r},children:[u(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`8px`},children:[u(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,flex:1},children:[l(`span`,{style:{fontSize:`16px`},children:o(e.state.status)}),l(`span`,{style:{fontWeight:`500`,flex:1},children:e.file instanceof File?e.file.name:`File`})]}),l(`span`,{style:{fontSize:`12px`,color:a(e.state.status),fontWeight:`500`,textTransform:`uppercase`},children:e.state.status})]}),e.state.status===`uploading`&&u(`div`,{style:{marginBottom:`8px`},children:[u(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`4px`},children:[u(`span`,{style:{fontSize:`12px`,color:`#666`},children:[e.state.progress,`%`]}),i&&e.state.totalBytes&&u(`span`,{style:{fontSize:`12px`,color:`#666`},children:[s(e.state.bytesUploaded),` /`,` `,s(e.state.totalBytes)]})]}),l(`div`,{style:{width:`100%`,height:`6px`,backgroundColor:`#e0e0e0`,borderRadius:`3px`,overflow:`hidden`},children:l(`div`,{style:{width:`${e.state.progress}%`,height:`100%`,backgroundColor:`#007bff`,transition:`width 0.2s ease`}})})]}),i&&u(`div`,{style:{fontSize:`12px`,color:`#666`,marginBottom:`8px`},children:[e.state.totalBytes&&l(`span`,{children:s(e.state.totalBytes)}),e.state.status===`uploading`&&e.state.progress>0&&u(`span`,{children:[` • Progress: `,e.state.progress,`%`]}),e.state.status===`error`&&e.state.error&&l(`div`,{style:{color:`#dc3545`,marginTop:`4px`},children:e.state.error.message})]}),u(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[e.state.status===`idle`&&u(c,{children:[l(`button`,{type:`button`,onClick:()=>t.startItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #007bff`,backgroundColor:`#007bff`,color:`white`,borderRadius:`4px`,cursor:`pointer`},children:`Start`}),l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`})]}),e.state.status===`uploading`&&l(`button`,{type:`button`,onClick:()=>t.abortItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #dc3545`,backgroundColor:`transparent`,color:`#dc3545`,borderRadius:`4px`,cursor:`pointer`},children:`Cancel`}),e.state.status===`error`&&u(c,{children:[l(`button`,{type:`button`,onClick:()=>t.retryItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #28a745`,backgroundColor:`#28a745`,color:`white`,borderRadius:`4px`,cursor:`pointer`},children:`Retry`}),l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`})]}),e.state.status===`success`&&l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`}),e.state.status===`aborted`&&u(c,{children:[l(`button`,{type:`button`,onClick:()=>t.retryItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #007bff`,backgroundColor:`#007bff`,color:`white`,borderRadius:`4px`,cursor:`pointer`},children:`Retry`}),l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`})]})]})]})}const P=a(null);function F(){let e=s(P);if(!e)throw Error(`useUploadContext must be used within an <Upload> component. Wrap your component tree with <Upload onSuccess={...}>`);return e}const I=a(null);function L(){let e=s(I);if(!e)throw Error(`useUploadItemContext must be used within an <Upload.Item> component. Wrap your component with <Upload.Item id="...">`);return e}function R({multiple:e=!1,maxConcurrent:n=3,autoStart:r=!0,metadata:i,onSuccess:a,onError:s,onComplete:c,onUploadStart:u,onProgress:d,children:f}){let p=t({maxConcurrent:n,metadata:i,onUploadStart:u,onUploadProgress:d,onUploadSuccess:(t,n)=>{e||a?.(n)},onUploadError:(e,t)=>{s?.(t,e)},onComplete:c}),m=o(t=>{e||p.clearAll(),p.addFiles(t),r&&setTimeout(()=>p.startAll(),0)},[e,r,p]),h={mode:e?`multi`:`single`,state:p.state,items:p.items,autoStart:r,addFiles:p.addFiles,removeItem:p.removeItem,startAll:p.startAll,abortUpload:p.abortUpload,abortAll:p.abortAll,retryUpload:p.retryUpload,retryFailed:p.retryFailed,clearCompleted:p.clearCompleted,clearAll:p.clearAll,handleFilesReceived:m};return l(P.Provider,{value:h,children:f})}function z({accept:e,maxFileSize:t,maxFiles:n,children:r}){let a=F(),o=i({onFilesReceived:a.handleFilesReceived,accept:e?e.split(`,`).map(e=>e.trim()):void 0,maxFileSize:t,maxFiles:a.mode===`multi`?n:1,multiple:a.mode===`multi`});return l(c,{children:r({isDragging:o.state.isDragging,isOver:o.state.isOver,errors:o.state.errors,getRootProps:()=>o.dragHandlers,getInputProps:()=>o.inputProps,openFilePicker:o.openFilePicker,dragDropState:o.state})})}function B({children:e}){let t=F();return l(c,{children:e({items:t.items,hasItems:t.items.length>0,isEmpty:t.items.length===0})})}function V({id:e,children:t}){let n=F(),r=n.items.find(t=>t.id===e);if(!r)return null;let i={id:e,file:r.file,state:r.state,abort:()=>n.abortUpload(e),retry:()=>n.retryUpload(e),remove:()=>n.removeItem(e)};return l(I.Provider,{value:i,children:typeof t==`function`?t(i):t})}function H({children:e}){let t=F();return l(c,{children:e({progress:t.state.progress,bytesUploaded:t.state.totalBytesUploaded,totalBytes:t.state.totalBytes,isUploading:t.state.isUploading})})}function U({children:e}){let{state:t}=F(),n=`idle`;return t.isUploading?n=`uploading`:t.isComplete&&(n=t.failed>0?`error`:`success`),l(c,{children:e({status:n,isIdle:n===`idle`,isUploading:t.isUploading,isSuccess:t.isComplete&&t.failed===0,isError:t.failed>0,isComplete:t.isComplete,total:t.total,successful:t.successful,failed:t.failed,uploading:t.uploading})})}function W({children:e}){let t=F(),n=t.items.filter(e=>[`error`,`aborted`].includes(e.state.status));return l(c,{children:e({hasError:n.length>0,failedCount:n.length,failedItems:n,reset:t.clearCompleted})})}function G({children:e,disabled:t,...n}){let r=F();return l(`button`,{type:`button`,onClick:o(()=>{r.abortAll()},[r]),disabled:t||!r.state.isUploading,...n,children:e})}function K({children:e,disabled:t,...n}){let r=F();return l(`button`,{type:`button`,onClick:o(()=>{r.retryFailed()},[r]),disabled:t||r.state.failed===0,...n,children:e})}function q({children:e,...t}){let n=F();return l(`button`,{type:`button`,onClick:o(()=>{n.clearAll()},[n]),...t,children:e})}function J({children:e,disabled:t,...n}){let r=F(),i=o(()=>{r.startAll()},[r]),a=r.items.filter(e=>e.state.status===`idle`).length;return l(`button`,{type:`button`,onClick:i,disabled:t||r.state.isUploading||a===0,...n,children:e})}function Y({children:e,disabled:t,...n}){let r=F();return l(`button`,{type:`button`,onClick:o(()=>{r.clearCompleted()},[r]),disabled:t||r.state.completed===0,...n,children:e})}const X=Object.assign(R,{DropZone:z,Items:B,Item:V,Progress:H,Status:U,Error:W,Cancel:G,Retry:K,Reset:q,StartAll:J,ClearCompleted:Y});function Z({children:e,multiple:n=!0,multiUploadOptions:a={},uploadOptions:s={},onUploadStart:u,onValidationError:d,...f}){let p=r(s),m=t(a),h=o(e=>{let t=[];if(!n&&e.length>1&&t.push(`Single file mode is enabled. Please select only one file. You selected ${e.length} files.`),f.accept&&f.accept.length>0){let n=e.filter(e=>!f.accept?.some(t=>{if(t.startsWith(`.`))return e.name.toLowerCase().endsWith(t.toLowerCase());if(t.endsWith(`/*`)){let n=t.slice(0,-2);return e.type.startsWith(n)}else return e.type===t}));if(n.length>0){let e=n.map(e=>`"${e.name}" (${e.type})`).join(`, `),r=f.accept.join(`, `);t.push(`Invalid file type(s): ${e}. Accepted types: ${r}.`)}}return t.length>0?t:null},[n,f.accept]),g=e=>{u?.(e),n&&m?(m.addFiles(e),setTimeout(()=>m.startAll(),0)):!n&&p&&e.length>0&&e[0]&&p.upload(e[0])},_=o(e=>{console.error(`Upload zone validation errors:`,e),d?.(e)},[d]),v=i({...f,multiple:n,validator:h,onFilesReceived:g,onValidationError:_}),y=v.state.isDragging||v.state.isOver,b=n?m?.state.isUploading??!1:p?.isUploading??!1;return l(c,{children:e({dragDrop:v,upload:p,multiUpload:m,openFilePicker:v.openFilePicker,isActive:y,isProcessing:b})})}function Q({className:e=``,style:t={},text:n={},errorStyle:r={},children:i,...a}){let o={idle:a.multiple?`Drag files here or click to select`:`Drag a file here or click to select`,dragging:a.multiple?`Drop files here...`:`Drop file here...`,uploading:`Uploading...`,...n};return i?l(Z,{...a,children:i}):l(Z,{...a,children:({dragDrop:n,upload:i,multiUpload:a,openFilePicker:s,isActive:c,isProcessing:d})=>u(`button`,{type:`button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&s()},onKeyUp:e=>{(e.key===`Enter`||e.key===` `)&&s()},...n.dragHandlers,onClick:s,className:`upload-zone ${c?`upload-zone--active`:``} ${d?`upload-zone--processing`:``} ${e}`,style:{border:c?`2px dashed #007bff`:`2px dashed #ccc`,borderRadius:`8px`,padding:`2rem`,textAlign:`center`,cursor:`pointer`,backgroundColor:c?`#f8f9fa`:`transparent`,transition:`all 0.2s ease`,minHeight:`120px`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,...t},children:[n.state.isDragging?l(`p`,{style:{margin:0,fontSize:`16px`,color:`#007bff`},children:o.dragging}):d?u(`div`,{style:{textAlign:`center`},children:[l(`p`,{style:{margin:`0 0 10px 0`,fontSize:`14px`},children:o.uploading}),i&&u(`div`,{children:[l(`progress`,{value:i.state.progress,max:100,style:{width:`200px`,height:`8px`}}),u(`p`,{style:{margin:`5px 0 0 0`,fontSize:`12px`,color:`#666`},children:[i.state.progress,`%`]})]}),a&&u(`div`,{children:[l(`progress`,{value:a.state.progress,max:100,style:{width:`200px`,height:`8px`}}),u(`p`,{style:{margin:`5px 0 0 0`,fontSize:`12px`,color:`#666`},children:[a.state.progress,`% (`,a.state.uploading,` `,`uploading, `,a.state.successful,` completed)`]})]})]}):l(`p`,{style:{margin:0,fontSize:`16px`,color:`#666`},children:o.idle}),n.state.errors.length>0&&u(`div`,{style:{marginTop:`10px`,padding:`8px 12px`,backgroundColor:`#f8d7da`,border:`1px solid #f5c6cb`,borderRadius:`4px`,maxWidth:`100%`,...r},children:[l(`p`,{style:{margin:`0 0 5px 0`,fontSize:`12px`,fontWeight:`bold`,color:`#721c24`},children:`Validation Errors:`}),n.state.errors.map((e,t)=>u(`p`,{style:{color:`#721c24`,fontSize:`11px`,margin:`2px 0`,lineHeight:`1.3`},children:[`• `,e]},`${e}-${t}`))]}),l(`input`,{...n.inputProps})]})})}export{L as a,k as c,O as d,f,F as i,j as l,Z as n,N as o,m as p,X as r,M as s,Q as t,A as u};
2
- //# sourceMappingURL=upload-zone-CH8B2-hl.mjs.map
1
+ import{i as e,n as t,r as n,t as r,u as i}from"./use-upload-Ccc_uzbr.mjs";import{createContext as a,useCallback as o,useContext as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";const d=a(null);function f(){let e=s(d);if(!e)throw Error(`useFlowContext must be used within a <Flow> component. Wrap your component tree with <Flow flowId="..." storageId="...">`);return e}const p=a(null);function m(){let e=s(p);if(!e)throw Error(`useFlowInputContext must be used within a <Flow.Input> component. Wrap your component with <Flow.Input nodeId="...">`);return e}function h({flowId:t,storageId:n,outputNodeId:r,metadata:i,onSuccess:a,onError:o,onProgress:s,onFlowComplete:c,onAbort:u,children:f}){let p=e({flowConfig:{flowId:t,storageId:n,outputNodeId:r,metadata:i},onSuccess:a,onError:o,onProgress:s,onFlowComplete:c,onAbort:u}),m={state:p.state,inputMetadata:p.inputMetadata,inputs:p.inputs,inputStates:p.inputStates,setInput:p.setInput,execute:p.execute,upload:p.upload,abort:p.abort,pause:p.pause,reset:p.reset,isUploading:p.isUploading,isUploadingFile:p.isUploadingFile,isProcessing:p.isProcessing,isDiscoveringInputs:p.isDiscoveringInputs};return l(d.Provider,{value:m,children:f})}function g({accept:e,maxFileSize:t,children:n}){let r=f(),a=i({onFilesReceived:e=>{let t=e[0];t&&r.upload(t)},accept:e?e.split(`,`).map(e=>e.trim()):void 0,maxFileSize:t,multiple:!1});return l(c,{children:n({isDragging:a.state.isDragging,isOver:a.state.isOver,progress:r.state.progress,status:r.state.status,getRootProps:()=>a.dragHandlers,getInputProps:()=>a.inputProps,openFilePicker:a.openFilePicker,dragDropState:a.state})})}function _({children:e}){let t=f();return l(c,{children:e({inputs:t.inputMetadata??[],isLoading:t.isDiscoveringInputs})})}function v({nodeId:e,children:t}){let n=f(),r=n.inputMetadata?.find(t=>t.nodeId===e);if(!r)return null;let i={nodeId:e,metadata:r,value:n.inputs[e],setValue:t=>n.setInput(e,t),state:n.inputStates.get(e)};return l(p.Provider,{value:i,children:typeof t==`function`?t(i):t})}function y({accept:e,maxFileSize:t,children:n}){let r=m(),a=i({onFilesReceived:e=>{let t=e[0];t&&r.setValue(t)},accept:e?e.split(`,`).map(e=>e.trim()):void 0,maxFileSize:t,multiple:!1});return l(c,{children:n({isDragging:a.state.isDragging,isOver:a.state.isOver,value:r.value,progress:r.state?.progress??0,status:r.state?.status??`idle`,getRootProps:()=>a.dragHandlers,getInputProps:()=>a.inputProps,openFilePicker:a.openFilePicker,dragDropState:a.state})})}function b({placeholder:e=`https://example.com/file`,...t}){let n=m();return l(`input`,{type:`url`,value:typeof n.value==`string`?n.value:``,onChange:e=>n.setValue(e.target.value),placeholder:e,...t})}function x({children:e}){let t=m(),n=t.value instanceof File,r=typeof t.value==`string`&&t.value.length>0;return l(c,{children:e({value:t.value,isFile:n,isUrl:r,fileName:n?t.value.name:null,fileSize:n?t.value.size:null,clear:()=>t.setValue(void 0)})})}function S({children:e}){let t=f();return l(c,{children:e({progress:t.state.progress,bytesUploaded:t.state.bytesUploaded,totalBytes:t.state.totalBytes,status:t.state.status})})}function C({children:e}){let t=f();return l(c,{children:e({status:t.state.status,currentNodeName:t.state.currentNodeName,currentNodeType:t.state.currentNodeType,error:t.state.error,jobId:t.state.jobId,flowStarted:t.state.flowStarted,flowOutputs:t.state.flowOutputs})})}function w({children:e}){let t=f();return l(c,{children:e({error:t.state.error,hasError:t.state.status===`error`,message:t.state.error?.message??null,reset:t.reset})})}function T({children:e,disabled:t,...n}){let r=f();return l(`button`,{type:`button`,onClick:o(()=>{r.execute()},[r]),disabled:t||r.isUploading,...n,children:e})}function E({children:e,...t}){let n=f();return l(`button`,{type:`button`,onClick:o(()=>{n.abort()},[n]),...t,children:e})}function D({children:e,...t}){let n=f();return l(`button`,{type:`button`,onClick:o(()=>{n.reset()},[n]),...t,children:e})}const O=Object.assign(h,{DropZone:g,Inputs:_,Input:Object.assign(v,{DropZone:y,UrlField:b,Preview:x}),Progress:S,Status:C,Error:w,Submit:T,Cancel:E,Reset:D});function k({flowConfig:e,options:t,children:r}){let i=n({...t,flowConfig:e});return l(c,{children:r({items:i.state.items,totalProgress:i.state.totalProgress,activeUploads:i.state.activeUploads,completedUploads:i.state.completedUploads,failedUploads:i.state.failedUploads,isUploading:i.isUploading,addFiles:i.addFiles,removeFile:i.removeFile,startUpload:i.startUpload,abortUpload:i.abortUpload,abortAll:i.abortAll,clear:i.clear,retryUpload:i.retryUpload})})}function A({item:e,onAbort:t,onRetry:n,onRemove:r}){return u(`div`,{style:{display:`flex`,alignItems:`center`,gap:`12px`,padding:`8px`,borderBottom:`1px solid #eee`},children:[l(`span`,{style:{color:(()=>{switch(e.status){case`success`:return`green`;case`error`:return`red`;case`uploading`:return`blue`;case`aborted`:return`gray`;default:return`black`}})(),fontSize:`18px`},children:(()=>{switch(e.status){case`success`:return`✓`;case`error`:return`✗`;case`uploading`:return`⟳`;case`aborted`:return`⊘`;default:return`○`}})()}),u(`div`,{style:{flex:1,minWidth:0},children:[l(`div`,{style:{fontSize:`14px`,fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.file instanceof File?e.file.name:`Upload`}),e.status===`uploading`&&u(`div`,{style:{marginTop:`4px`},children:[l(`progress`,{value:e.progress,max:100,style:{width:`100%`,height:`4px`}}),u(`div`,{style:{fontSize:`12px`,color:`#666`,marginTop:`2px`},children:[e.progress,`% • `,Math.round(e.bytesUploaded/1024),` KB /`,` `,Math.round(e.totalBytes/1024),` KB`]})]}),e.status===`error`&&l(`div`,{style:{fontSize:`12px`,color:`red`,marginTop:`2px`},children:e.error?.message||`Upload failed`}),e.status===`success`&&l(`div`,{style:{fontSize:`12px`,color:`green`,marginTop:`2px`},children:`Upload complete`})]}),u(`div`,{style:{display:`flex`,gap:`8px`},children:[e.status===`uploading`&&l(`button`,{type:`button`,onClick:t,style:{padding:`4px 8px`,fontSize:`12px`,borderRadius:`4px`,border:`1px solid #ccc`,backgroundColor:`#fff`,cursor:`pointer`},children:`Cancel`}),e.status===`error`&&l(`button`,{type:`button`,onClick:n,style:{padding:`4px 8px`,fontSize:`12px`,borderRadius:`4px`,border:`1px solid #ccc`,backgroundColor:`#fff`,cursor:`pointer`},children:`Retry`}),(e.status===`pending`||e.status===`error`||e.status===`aborted`)&&l(`button`,{type:`button`,onClick:r,style:{padding:`4px 8px`,fontSize:`12px`,borderRadius:`4px`,border:`1px solid #ccc`,backgroundColor:`#fff`,cursor:`pointer`},children:`Remove`})]})]})}function j({flowConfig:e,options:t,className:n=``,showFileInput:r=!0,accept:i}){return l(k,{flowConfig:e,options:t,children:({items:e,addFiles:t,startUpload:a,abortUpload:o,retryUpload:s,removeFile:c,totalProgress:d})=>u(`div`,{className:n,children:[r&&l(`div`,{style:{marginBottom:`16px`},children:l(`input`,{type:`file`,multiple:!0,accept:i,onChange:e=>{e.target.files&&(t(e.target.files),a())},style:{padding:`8px`,border:`1px solid #ccc`,borderRadius:`4px`}})}),e.length>0&&u(`div`,{children:[u(`div`,{style:{marginBottom:`8px`,fontSize:`14px`,color:`#666`},children:[`Total Progress: `,d,`%`]}),l(`div`,{style:{border:`1px solid #eee`,borderRadius:`8px`,overflow:`hidden`},children:e.map(e=>l(A,{item:e,onAbort:()=>o(e.id),onRetry:()=>s(e.id),onRemove:()=>c(e.id)},e.id))})]})]})})}function M({multiUpload:e,filter:t,sortBy:n,children:r}){let i=e.items;t&&(i=i.filter(t)),n&&(i=[...i].sort(n));let a={idle:i.filter(e=>e.state.status===`idle`),uploading:i.filter(e=>e.state.status===`uploading`),success:i.filter(e=>e.state.status===`success`),error:i.filter(e=>e.state.status===`error`),aborted:i.filter(e=>e.state.status===`aborted`)};return l(c,{children:r({items:i,itemsByStatus:a,multiUpload:e,actions:{removeItem:t=>{e.removeItem(t)},retryItem:t=>{e.retryFailed()},abortItem:t=>{e.removeItem(t.id)},startItem:t=>{e.startAll()}}})})}function N({item:e,actions:t,className:n=``,style:r={},showDetails:i=!0}){let a=e=>{switch(e){case`idle`:return`#6c757d`;case`uploading`:return`#007bff`;case`success`:return`#28a745`;case`error`:return`#dc3545`;case`aborted`:return`#6c757d`;default:return`#6c757d`}},o=e=>{switch(e){case`idle`:return`⏳`;case`uploading`:return`📤`;case`success`:return`✅`;case`error`:return`❌`;case`aborted`:return`⏹️`;default:return`❓`}},s=e=>{if(e===0)return`0 Bytes`;let t=1024,n=[`Bytes`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/t**r).toFixed(2))} ${n[r]}`};return u(`div`,{className:`upload-list-item upload-list-item--${e.state.status} ${n}`,style:{padding:`12px`,border:`1px solid #e0e0e0`,borderRadius:`6px`,marginBottom:`8px`,backgroundColor:`#fff`,transition:`all 0.2s ease`,...r},children:[u(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`8px`},children:[u(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,flex:1},children:[l(`span`,{style:{fontSize:`16px`},children:o(e.state.status)}),l(`span`,{style:{fontWeight:`500`,flex:1},children:e.file instanceof File?e.file.name:`File`})]}),l(`span`,{style:{fontSize:`12px`,color:a(e.state.status),fontWeight:`500`,textTransform:`uppercase`},children:e.state.status})]}),e.state.status===`uploading`&&u(`div`,{style:{marginBottom:`8px`},children:[u(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`4px`},children:[u(`span`,{style:{fontSize:`12px`,color:`#666`},children:[e.state.progress,`%`]}),i&&e.state.totalBytes&&u(`span`,{style:{fontSize:`12px`,color:`#666`},children:[s(e.state.bytesUploaded),` /`,` `,s(e.state.totalBytes)]})]}),l(`div`,{style:{width:`100%`,height:`6px`,backgroundColor:`#e0e0e0`,borderRadius:`3px`,overflow:`hidden`},children:l(`div`,{style:{width:`${e.state.progress}%`,height:`100%`,backgroundColor:`#007bff`,transition:`width 0.2s ease`}})})]}),i&&u(`div`,{style:{fontSize:`12px`,color:`#666`,marginBottom:`8px`},children:[e.state.totalBytes&&l(`span`,{children:s(e.state.totalBytes)}),e.state.status===`uploading`&&e.state.progress>0&&u(`span`,{children:[` • Progress: `,e.state.progress,`%`]}),e.state.status===`error`&&e.state.error&&l(`div`,{style:{color:`#dc3545`,marginTop:`4px`},children:e.state.error.message})]}),u(`div`,{style:{display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[e.state.status===`idle`&&u(c,{children:[l(`button`,{type:`button`,onClick:()=>t.startItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #007bff`,backgroundColor:`#007bff`,color:`white`,borderRadius:`4px`,cursor:`pointer`},children:`Start`}),l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`})]}),e.state.status===`uploading`&&l(`button`,{type:`button`,onClick:()=>t.abortItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #dc3545`,backgroundColor:`transparent`,color:`#dc3545`,borderRadius:`4px`,cursor:`pointer`},children:`Cancel`}),e.state.status===`error`&&u(c,{children:[l(`button`,{type:`button`,onClick:()=>t.retryItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #28a745`,backgroundColor:`#28a745`,color:`white`,borderRadius:`4px`,cursor:`pointer`},children:`Retry`}),l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`})]}),e.state.status===`success`&&l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`}),e.state.status===`aborted`&&u(c,{children:[l(`button`,{type:`button`,onClick:()=>t.retryItem(e),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #007bff`,backgroundColor:`#007bff`,color:`white`,borderRadius:`4px`,cursor:`pointer`},children:`Retry`}),l(`button`,{type:`button`,onClick:()=>t.removeItem(e.id),style:{padding:`4px 8px`,fontSize:`12px`,border:`1px solid #6c757d`,backgroundColor:`transparent`,color:`#6c757d`,borderRadius:`4px`,cursor:`pointer`},children:`Remove`})]})]})]})}const P=a(null);function F(){let e=s(P);if(!e)throw Error(`useUploadContext must be used within an <Upload> component. Wrap your component tree with <Upload onSuccess={...}>`);return e}const I=a(null);function L(){let e=s(I);if(!e)throw Error(`useUploadItemContext must be used within an <Upload.Item> component. Wrap your component with <Upload.Item id="...">`);return e}function R({multiple:e=!1,maxConcurrent:n=3,autoStart:r=!0,metadata:i,onSuccess:a,onError:s,onComplete:c,onUploadStart:u,onProgress:d,children:f}){let p=t({maxConcurrent:n,metadata:i,onUploadStart:u,onUploadProgress:d,onUploadSuccess:(t,n)=>{e||a?.(n)},onUploadError:(e,t)=>{s?.(t,e)},onComplete:c}),m=o(t=>{e||p.clearAll(),p.addFiles(t),r&&setTimeout(()=>p.startAll(),0)},[e,r,p]),h={mode:e?`multi`:`single`,state:p.state,items:p.items,autoStart:r,addFiles:p.addFiles,removeItem:p.removeItem,startAll:p.startAll,abortUpload:p.abortUpload,abortAll:p.abortAll,retryUpload:p.retryUpload,retryFailed:p.retryFailed,clearCompleted:p.clearCompleted,clearAll:p.clearAll,handleFilesReceived:m};return l(P.Provider,{value:h,children:f})}function z({accept:e,maxFileSize:t,maxFiles:n,children:r}){let a=F(),o=i({onFilesReceived:a.handleFilesReceived,accept:e?e.split(`,`).map(e=>e.trim()):void 0,maxFileSize:t,maxFiles:a.mode===`multi`?n:1,multiple:a.mode===`multi`});return l(c,{children:r({isDragging:o.state.isDragging,isOver:o.state.isOver,errors:o.state.errors,getRootProps:()=>o.dragHandlers,getInputProps:()=>o.inputProps,openFilePicker:o.openFilePicker,dragDropState:o.state})})}function B({children:e}){let t=F();return l(c,{children:e({items:t.items,hasItems:t.items.length>0,isEmpty:t.items.length===0})})}function V({id:e,children:t}){let n=F(),r=n.items.find(t=>t.id===e);if(!r)return null;let i={id:e,file:r.file,state:r.state,abort:()=>n.abortUpload(e),retry:()=>n.retryUpload(e),remove:()=>n.removeItem(e)};return l(I.Provider,{value:i,children:typeof t==`function`?t(i):t})}function H({children:e}){let t=F();return l(c,{children:e({progress:t.state.progress,bytesUploaded:t.state.totalBytesUploaded,totalBytes:t.state.totalBytes,isUploading:t.state.isUploading})})}function U({children:e}){let{state:t}=F(),n=`idle`;return t.isUploading?n=`uploading`:t.isComplete&&(n=t.failed>0?`error`:`success`),l(c,{children:e({status:n,isIdle:n===`idle`,isUploading:t.isUploading,isSuccess:t.isComplete&&t.failed===0,isError:t.failed>0,isComplete:t.isComplete,total:t.total,successful:t.successful,failed:t.failed,uploading:t.uploading})})}function W({children:e}){let t=F(),n=t.items.filter(e=>[`error`,`aborted`].includes(e.state.status));return l(c,{children:e({hasError:n.length>0,failedCount:n.length,failedItems:n,reset:t.clearCompleted})})}function G({children:e,disabled:t,...n}){let r=F();return l(`button`,{type:`button`,onClick:o(()=>{r.abortAll()},[r]),disabled:t||!r.state.isUploading,...n,children:e})}function K({children:e,disabled:t,...n}){let r=F();return l(`button`,{type:`button`,onClick:o(()=>{r.retryFailed()},[r]),disabled:t||r.state.failed===0,...n,children:e})}function q({children:e,...t}){let n=F();return l(`button`,{type:`button`,onClick:o(()=>{n.clearAll()},[n]),...t,children:e})}function J({children:e,disabled:t,...n}){let r=F(),i=o(()=>{r.startAll()},[r]),a=r.items.filter(e=>e.state.status===`idle`).length;return l(`button`,{type:`button`,onClick:i,disabled:t||r.state.isUploading||a===0,...n,children:e})}function Y({children:e,disabled:t,...n}){let r=F();return l(`button`,{type:`button`,onClick:o(()=>{r.clearCompleted()},[r]),disabled:t||r.state.completed===0,...n,children:e})}const X=Object.assign(R,{DropZone:z,Items:B,Item:V,Progress:H,Status:U,Error:W,Cancel:G,Retry:K,Reset:q,StartAll:J,ClearCompleted:Y});function Z({children:e,multiple:n=!0,multiUploadOptions:a={},uploadOptions:s={},onUploadStart:u,onValidationError:d,...f}){let p=r(s),m=t(a),h=o(e=>{let t=[];if(!n&&e.length>1&&t.push(`Single file mode is enabled. Please select only one file. You selected ${e.length} files.`),f.accept&&f.accept.length>0){let n=e.filter(e=>!f.accept?.some(t=>{if(t.startsWith(`.`))return e.name.toLowerCase().endsWith(t.toLowerCase());if(t.endsWith(`/*`)){let n=t.slice(0,-2);return e.type.startsWith(n)}else return e.type===t}));if(n.length>0){let e=n.map(e=>`"${e.name}" (${e.type})`).join(`, `),r=f.accept.join(`, `);t.push(`Invalid file type(s): ${e}. Accepted types: ${r}.`)}}return t.length>0?t:null},[n,f.accept]),g=e=>{u?.(e),n&&m?(m.addFiles(e),setTimeout(()=>m.startAll(),0)):!n&&p&&e.length>0&&e[0]&&p.upload(e[0])},_=o(e=>{console.error(`Upload zone validation errors:`,e),d?.(e)},[d]),v=i({...f,multiple:n,validator:h,onFilesReceived:g,onValidationError:_}),y=v.state.isDragging||v.state.isOver,b=n?m?.state.isUploading??!1:p?.isUploading??!1;return l(c,{children:e({dragDrop:v,upload:p,multiUpload:m,openFilePicker:v.openFilePicker,isActive:y,isProcessing:b})})}function Q({className:e=``,style:t={},text:n={},errorStyle:r={},children:i,...a}){let o={idle:a.multiple?`Drag files here or click to select`:`Drag a file here or click to select`,dragging:a.multiple?`Drop files here...`:`Drop file here...`,uploading:`Uploading...`,...n};return i?l(Z,{...a,children:i}):l(Z,{...a,children:({dragDrop:n,upload:i,multiUpload:a,openFilePicker:s,isActive:c,isProcessing:d})=>u(`button`,{type:`button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&s()},onKeyUp:e=>{(e.key===`Enter`||e.key===` `)&&s()},...n.dragHandlers,onClick:s,className:`upload-zone ${c?`upload-zone--active`:``} ${d?`upload-zone--processing`:``} ${e}`,style:{border:c?`2px dashed #007bff`:`2px dashed #ccc`,borderRadius:`8px`,padding:`2rem`,textAlign:`center`,cursor:`pointer`,backgroundColor:c?`#f8f9fa`:`transparent`,transition:`all 0.2s ease`,minHeight:`120px`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,...t},children:[n.state.isDragging?l(`p`,{style:{margin:0,fontSize:`16px`,color:`#007bff`},children:o.dragging}):d?u(`div`,{style:{textAlign:`center`},children:[l(`p`,{style:{margin:`0 0 10px 0`,fontSize:`14px`},children:o.uploading}),i&&u(`div`,{children:[l(`progress`,{value:i.state.progress,max:100,style:{width:`200px`,height:`8px`}}),u(`p`,{style:{margin:`5px 0 0 0`,fontSize:`12px`,color:`#666`},children:[i.state.progress,`%`]})]}),a&&u(`div`,{children:[l(`progress`,{value:a.state.progress,max:100,style:{width:`200px`,height:`8px`}}),u(`p`,{style:{margin:`5px 0 0 0`,fontSize:`12px`,color:`#666`},children:[a.state.progress,`% (`,a.state.uploading,` `,`uploading, `,a.state.successful,` completed)`]})]})]}):l(`p`,{style:{margin:0,fontSize:`16px`,color:`#666`},children:o.idle}),n.state.errors.length>0&&u(`div`,{style:{marginTop:`10px`,padding:`8px 12px`,backgroundColor:`#f8d7da`,border:`1px solid #f5c6cb`,borderRadius:`4px`,maxWidth:`100%`,...r},children:[l(`p`,{style:{margin:`0 0 5px 0`,fontSize:`12px`,fontWeight:`bold`,color:`#721c24`},children:`Validation Errors:`}),n.state.errors.map((e,t)=>u(`p`,{style:{color:`#721c24`,fontSize:`11px`,margin:`2px 0`,lineHeight:`1.3`},children:[`• `,e]},`${e}-${t}`))]}),l(`input`,{...n.inputProps})]})})}export{L as a,k as c,O as d,f,F as i,j as l,Z as n,N as o,m as p,X as r,M as s,Q as t,A as u};
2
+ //# sourceMappingURL=upload-zone-Dz6GwCwO.mjs.map