@unciatech/file-manager 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -32
- package/dist/chunk-DXJH5W7A.js +18 -0
- package/dist/chunk-SV5VFLC2.cjs +18 -0
- package/dist/cli.cjs +274 -164
- package/dist/cli.js +273 -140
- package/dist/index.cjs +18 -7714
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +18 -7666
- package/dist/{mock-provider-nCBvw7nl.d.cts → mock-provider-DrtiUc3h.d.cts} +32 -4
- package/dist/{mock-provider-nCBvw7nl.d.ts → mock-provider-DrtiUc3h.d.ts} +32 -4
- package/dist/mock.cjs +1 -1395
- package/dist/mock.d.cts +1 -1
- package/dist/mock.d.ts +1 -1
- package/dist/mock.js +1 -1361
- package/dist/styles.css +75 -56
- package/dist/styles.d.ts +1 -0
- package/package.json +8 -6
- package/styles.css +0 -62
|
@@ -172,7 +172,20 @@ interface FileManagerPageProps {
|
|
|
172
172
|
viewMode: ViewMode;
|
|
173
173
|
initialFolderId?: FolderId;
|
|
174
174
|
provider: IFileManagerProvider;
|
|
175
|
-
basePath
|
|
175
|
+
basePath: string;
|
|
176
|
+
/**
|
|
177
|
+
* Optional navigation callback. When provided, the library delegates all
|
|
178
|
+
* URL navigation to this function instead of calling history.pushState
|
|
179
|
+
* directly. Use this to plug in your own router:
|
|
180
|
+
* - React Router: onNavigate={(url, opts) => navigate(url, { replace: opts?.replace })}
|
|
181
|
+
* - Next.js: onNavigate={(url, opts) => opts?.replace ? router.replace(url) : router.push(url)}
|
|
182
|
+
* - TanStack Router: onNavigate={(url, opts) => router.navigate({ href: url, replace: opts?.replace })}
|
|
183
|
+
* If omitted, falls back to history.pushState (works in any bare React app).
|
|
184
|
+
*/
|
|
185
|
+
onNavigate?: (url: string, options?: {
|
|
186
|
+
replace?: boolean;
|
|
187
|
+
scroll?: boolean;
|
|
188
|
+
}) => void;
|
|
176
189
|
}
|
|
177
190
|
interface FileManagerModalProps {
|
|
178
191
|
open: boolean;
|
|
@@ -184,7 +197,12 @@ interface FileManagerModalProps {
|
|
|
184
197
|
viewMode?: ViewMode;
|
|
185
198
|
initialFolderId?: FolderId;
|
|
186
199
|
provider: IFileManagerProvider;
|
|
187
|
-
basePath
|
|
200
|
+
basePath: string;
|
|
201
|
+
/** @see FileManagerPageProps.onNavigate */
|
|
202
|
+
onNavigate?: (url: string, options?: {
|
|
203
|
+
replace?: boolean;
|
|
204
|
+
scroll?: boolean;
|
|
205
|
+
}) => void;
|
|
188
206
|
}
|
|
189
207
|
interface FileManagerRootProps {
|
|
190
208
|
mode: Mode;
|
|
@@ -194,11 +212,16 @@ interface FileManagerRootProps {
|
|
|
194
212
|
initialFolderId?: FolderId;
|
|
195
213
|
acceptedFileTypesForModal?: FileType[];
|
|
196
214
|
provider: IFileManagerProvider;
|
|
197
|
-
basePath
|
|
215
|
+
basePath: string;
|
|
198
216
|
onFilesSelected?: (files: FileMetaData[]) => void;
|
|
199
217
|
onClose?: () => void;
|
|
200
218
|
maxUploadFiles?: number;
|
|
201
219
|
maxUploadSize?: number;
|
|
220
|
+
/** @see FileManagerPageProps.onNavigate */
|
|
221
|
+
onNavigate?: (url: string, options?: {
|
|
222
|
+
replace?: boolean;
|
|
223
|
+
scroll?: boolean;
|
|
224
|
+
}) => void;
|
|
202
225
|
}
|
|
203
226
|
interface FileStateOptions {
|
|
204
227
|
mode: Mode;
|
|
@@ -207,9 +230,14 @@ interface FileStateOptions {
|
|
|
207
230
|
acceptedFileTypesForModal?: FileType[];
|
|
208
231
|
allowedFileTypes?: FileType[];
|
|
209
232
|
provider: IFileManagerProvider;
|
|
210
|
-
basePath
|
|
233
|
+
basePath: string;
|
|
211
234
|
onFilesSelected?: (files: FileMetaData[]) => void;
|
|
212
235
|
onClose?: () => void;
|
|
236
|
+
/** @see FileManagerPageProps.onNavigate */
|
|
237
|
+
onNavigate?: (url: string, options?: {
|
|
238
|
+
replace?: boolean;
|
|
239
|
+
scroll?: boolean;
|
|
240
|
+
}) => void;
|
|
213
241
|
}
|
|
214
242
|
|
|
215
243
|
declare class MockProvider implements IFileManagerProvider {
|
|
@@ -172,7 +172,20 @@ interface FileManagerPageProps {
|
|
|
172
172
|
viewMode: ViewMode;
|
|
173
173
|
initialFolderId?: FolderId;
|
|
174
174
|
provider: IFileManagerProvider;
|
|
175
|
-
basePath
|
|
175
|
+
basePath: string;
|
|
176
|
+
/**
|
|
177
|
+
* Optional navigation callback. When provided, the library delegates all
|
|
178
|
+
* URL navigation to this function instead of calling history.pushState
|
|
179
|
+
* directly. Use this to plug in your own router:
|
|
180
|
+
* - React Router: onNavigate={(url, opts) => navigate(url, { replace: opts?.replace })}
|
|
181
|
+
* - Next.js: onNavigate={(url, opts) => opts?.replace ? router.replace(url) : router.push(url)}
|
|
182
|
+
* - TanStack Router: onNavigate={(url, opts) => router.navigate({ href: url, replace: opts?.replace })}
|
|
183
|
+
* If omitted, falls back to history.pushState (works in any bare React app).
|
|
184
|
+
*/
|
|
185
|
+
onNavigate?: (url: string, options?: {
|
|
186
|
+
replace?: boolean;
|
|
187
|
+
scroll?: boolean;
|
|
188
|
+
}) => void;
|
|
176
189
|
}
|
|
177
190
|
interface FileManagerModalProps {
|
|
178
191
|
open: boolean;
|
|
@@ -184,7 +197,12 @@ interface FileManagerModalProps {
|
|
|
184
197
|
viewMode?: ViewMode;
|
|
185
198
|
initialFolderId?: FolderId;
|
|
186
199
|
provider: IFileManagerProvider;
|
|
187
|
-
basePath
|
|
200
|
+
basePath: string;
|
|
201
|
+
/** @see FileManagerPageProps.onNavigate */
|
|
202
|
+
onNavigate?: (url: string, options?: {
|
|
203
|
+
replace?: boolean;
|
|
204
|
+
scroll?: boolean;
|
|
205
|
+
}) => void;
|
|
188
206
|
}
|
|
189
207
|
interface FileManagerRootProps {
|
|
190
208
|
mode: Mode;
|
|
@@ -194,11 +212,16 @@ interface FileManagerRootProps {
|
|
|
194
212
|
initialFolderId?: FolderId;
|
|
195
213
|
acceptedFileTypesForModal?: FileType[];
|
|
196
214
|
provider: IFileManagerProvider;
|
|
197
|
-
basePath
|
|
215
|
+
basePath: string;
|
|
198
216
|
onFilesSelected?: (files: FileMetaData[]) => void;
|
|
199
217
|
onClose?: () => void;
|
|
200
218
|
maxUploadFiles?: number;
|
|
201
219
|
maxUploadSize?: number;
|
|
220
|
+
/** @see FileManagerPageProps.onNavigate */
|
|
221
|
+
onNavigate?: (url: string, options?: {
|
|
222
|
+
replace?: boolean;
|
|
223
|
+
scroll?: boolean;
|
|
224
|
+
}) => void;
|
|
202
225
|
}
|
|
203
226
|
interface FileStateOptions {
|
|
204
227
|
mode: Mode;
|
|
@@ -207,9 +230,14 @@ interface FileStateOptions {
|
|
|
207
230
|
acceptedFileTypesForModal?: FileType[];
|
|
208
231
|
allowedFileTypes?: FileType[];
|
|
209
232
|
provider: IFileManagerProvider;
|
|
210
|
-
basePath
|
|
233
|
+
basePath: string;
|
|
211
234
|
onFilesSelected?: (files: FileMetaData[]) => void;
|
|
212
235
|
onClose?: () => void;
|
|
236
|
+
/** @see FileManagerPageProps.onNavigate */
|
|
237
|
+
onNavigate?: (url: string, options?: {
|
|
238
|
+
replace?: boolean;
|
|
239
|
+
scroll?: boolean;
|
|
240
|
+
}) => void;
|
|
213
241
|
}
|
|
214
242
|
|
|
215
243
|
declare class MockProvider implements IFileManagerProvider {
|