@muhgholy/next-drive 4.23.10 → 4.23.13

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,5 +1,5 @@
1
1
  import type { TDriveUploadState } from '../../types/client';
2
- export declare const useUpload: (apiEndpoint: string, activeAccountId: string | null, withCredentials?: boolean, onUploadComplete?: (item: unknown) => void, unauthenticated?: boolean) => {
2
+ export declare const useUpload: (apiEndpoint: string, activeAccountId: string | null, withCredentials?: boolean, onUploadComplete?: (item: unknown) => void) => {
3
3
  uploads: TDriveUploadState[];
4
4
  uploadFiles: (files: File[], folderId: string | null) => Promise<void>;
5
5
  cancelUpload: (id: string) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../../src/client/hooks/use-upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAYxD,eAAO,MAAM,SAAS,GAAI,aAAa,MAAM,EAAE,iBAAiB,MAAM,GAAG,IAAI,EAAE,kBAAiB,OAAe,EAAE,mBAAmB,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,kBAAiB,OAAe;;yBAmK3I,IAAI,EAAE,YAAY,MAAM,GAAG,IAAI;uBAuB9D,MAAM;;CA+CxB,CAAC"}
1
+ {"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../../src/client/hooks/use-upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAYxD,eAAO,MAAM,SAAS,GAAI,aAAa,MAAM,EAAE,iBAAiB,MAAM,GAAG,IAAI,EAAE,kBAAiB,OAAe,EAAE,mBAAmB,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;;yBAkKzG,IAAI,EAAE,YAAY,MAAM,GAAG,IAAI;uBAuB9D,MAAM;;CA+CxB,CAAC"}
@@ -322,7 +322,7 @@ var getChunkSize = (fileSize) => {
322
322
  if (fileSize < 1024 * 1024 * 1024) return 8 * 1024 * 1024;
323
323
  return 16 * 1024 * 1024;
324
324
  };
325
- var useUpload = (apiEndpoint, activeAccountId, withCredentials = false, onUploadComplete, unauthenticated = false) => {
325
+ var useUpload = (apiEndpoint, activeAccountId, withCredentials = false, onUploadComplete) => {
326
326
  const [uploads, setUploads] = React3.useState([]);
327
327
  const abortControllers = React3.useRef(/* @__PURE__ */ new Map());
328
328
  const filesRef = React3.useRef(/* @__PURE__ */ new Map());
@@ -406,7 +406,6 @@ var useUpload = (apiEndpoint, activeAccountId, withCredentials = false, onUpload
406
406
  formData.append("fileType", file.type);
407
407
  formData.append("folderId", folderId || "root");
408
408
  if (driveId) formData.append("driveId", driveId);
409
- if (unauthenticated) formData.append("unauthenticated", "true");
410
409
  let attempts = 0;
411
410
  let success = false;
412
411
  while (!success && attempts < 3 && !controller.signal.aborted) {
@@ -3156,7 +3155,7 @@ var DriveFileChooser = (props) => {
3156
3155
  onChange(uploaded);
3157
3156
  }
3158
3157
  }, [multiple, onChange]);
3159
- const { uploads, uploadFiles } = useUpload(apiEndpoint, activeAccountId, withCredentials, handleUploaded, unauthenticatedMode);
3158
+ const { uploads, uploadFiles } = useUpload(apiEndpoint, activeAccountId, withCredentials, handleUploaded);
3160
3159
  const openPicker = React3.useCallback(() => {
3161
3160
  if (unauthenticatedMode) fileInputRef.current?.click();
3162
3161
  else setIsOpen(true);