@photoroom/ui 0.1.281 → 0.1.283
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/components/editor/ObjectItem/ObjectItem.d.ts.map +1 -1
- package/components/unsorted/FileUploader/useFileUploader.d.ts +3 -2
- package/components/unsorted/FileUploader/useFileUploader.d.ts.map +1 -1
- package/components/unsorted/FileUploader/utils/files.d.ts +30 -0
- package/components/unsorted/FileUploader/utils/files.d.ts.map +1 -1
- package/index.mjs +9756 -9687
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectItem.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/ObjectItem/ObjectItem.tsx"],"names":[],"mappings":"AAQA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;AAEjD,eAAO,MAAM,UAAU;8PAiBpB,eAAe;;
|
|
1
|
+
{"version":3,"file":"ObjectItem.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/ObjectItem/ObjectItem.tsx"],"names":[],"mappings":"AAQA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;AAEjD,eAAO,MAAM,UAAU;8PAiBpB,eAAe;;CAyFjB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type AnyDragEvent } from "../../../hooks";
|
|
2
|
+
import { type FolderGroup } from "./utils/files";
|
|
3
|
+
export type { FolderGroup } from "./utils/files";
|
|
2
4
|
export type UseFileUploaderProps = {
|
|
3
5
|
withCopyPaste?: boolean;
|
|
4
6
|
disabled?: boolean;
|
|
5
7
|
allowFolders?: boolean;
|
|
6
8
|
acceptedFileTypes?: string[];
|
|
7
9
|
onDrag?: () => void;
|
|
8
|
-
onFileChange?: (files: FileList, isShiftPressed?: boolean, isFolder?: boolean) => void | Promise<void>;
|
|
10
|
+
onFileChange?: (files: FileList, isShiftPressed?: boolean, isFolder?: boolean, folders?: FolderGroup[]) => void | Promise<void>;
|
|
9
11
|
onCancel?: () => void;
|
|
10
12
|
};
|
|
11
13
|
type WaitForFilesOptions = {
|
|
@@ -35,5 +37,4 @@ export declare const useFileUploader: ({ withCopyPaste, disabled, allowFolders,
|
|
|
35
37
|
waitForFile: ({ accept, }?: Pick<WaitForFilesOptions, "accept">) => Promise<File>;
|
|
36
38
|
};
|
|
37
39
|
export type FileUploader = ReturnType<typeof useFileUploader>;
|
|
38
|
-
export {};
|
|
39
40
|
//# sourceMappingURL=useFileUploader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUploader.d.ts","sourceRoot":"","sources":["../../../../src/components/unsorted/FileUploader/useFileUploader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"useFileUploader.d.ts","sourceRoot":"","sources":["../../../../src/components/unsorted/FileUploader/useFileUploader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EACL,KAAK,WAAW,EAKjB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,QAAQ,EACf,cAAc,CAAC,EAAE,OAAO,EACxB,QAAQ,CAAC,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,WAAW,EAAE,KACpB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,+FAQ7B,oBAAoB;;;;0BAiNX,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;gCAmCnC,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;6BAtKnC,YAAY;6BAasB,YAAY;4BAKb,YAAY;wBAKvC,YAAY;;;;2CA9EvB,mBAAmB,KAAQ,OAAO,CAAC,QAAQ,CAAC;gCAgC5C,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,KAAQ,OAAO,CAAC,IAAI,CAAC;CAmP9D,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
export declare const isFileSystemFileEntry: (entry: FileSystemEntry) => entry is FileSystemFileEntry;
|
|
2
2
|
export declare const isFileSystemDirectoryEntry: (entry: FileSystemEntry) => entry is FileSystemDirectoryEntry;
|
|
3
|
+
export type FolderGroup = {
|
|
4
|
+
/** The subfolder name, or an empty string for files sitting at the dropped folder's root. */
|
|
5
|
+
folderName: string;
|
|
6
|
+
files: File[];
|
|
7
|
+
};
|
|
8
|
+
export declare const sortFolderGroups: (groups: FolderGroup[]) => FolderGroup[];
|
|
3
9
|
export declare const readDirectoryFiles: (directoryEntry: FileSystemDirectoryEntry) => Promise<File[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Groups already-collected files (e.g. from a `webkitdirectory` folder picker) by their top-most
|
|
12
|
+
* subfolder, mirroring {@link readDirectoryFolders}. Grouping uses each file's
|
|
13
|
+
* `webkitRelativePath`, whose first segment is the picked folder itself:
|
|
14
|
+
*
|
|
15
|
+
* - Files under an immediate subfolder are grouped under that subfolder's name (deeper nesting is
|
|
16
|
+
* flattened into it).
|
|
17
|
+
* - Files sitting directly in the picked folder go into a trailing group with an empty
|
|
18
|
+
* `folderName` (a default, unnamed section).
|
|
19
|
+
*
|
|
20
|
+
* Expects the input to already be filtered to accepted file types.
|
|
21
|
+
*/
|
|
22
|
+
export declare const groupFilesBySubfolder: (files: File[]) => FolderGroup[];
|
|
23
|
+
/**
|
|
24
|
+
* Reads a dropped directory and groups its files by top-level subfolder, so a batch can be laid
|
|
25
|
+
* out as one section per subfolder.
|
|
26
|
+
*
|
|
27
|
+
* - Each immediate subfolder becomes a group named verbatim after it, containing every accepted
|
|
28
|
+
* file found recursively within it (flattened).
|
|
29
|
+
* - Accepted files sitting directly in the dropped folder are returned in a trailing group with an
|
|
30
|
+
* empty `folderName` (a default, unnamed section).
|
|
31
|
+
* - Empty subfolders (no accepted file anywhere inside) are skipped.
|
|
32
|
+
*/
|
|
33
|
+
export declare const readDirectoryFolders: (directoryEntry: FileSystemDirectoryEntry) => Promise<FolderGroup[]>;
|
|
4
34
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../src/components/unsorted/FileUploader/utils/files.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,GAAI,OAAO,eAAe,KAAG,KAAK,IAAI,mBACjD,CAAC;AAExB,eAAO,MAAM,0BAA0B,GACrC,OAAO,eAAe,KACrB,KAAK,IAAI,wBAEgB,CAAC;AAE7B,eAAO,MAAM,kBAAkB,GAC7B,gBAAgB,wBAAwB,KACvC,OAAO,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../../src/components/unsorted/FileUploader/utils/files.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,GAAI,OAAO,eAAe,KAAG,KAAK,IAAI,mBACjD,CAAC;AAExB,eAAO,MAAM,0BAA0B,GACrC,OAAO,eAAe,KACrB,KAAK,IAAI,wBAEgB,CAAC;AAE7B,MAAM,MAAM,WAAW,GAAG;IACxB,6FAA6F;IAC7F,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAUF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,WAAW,EAAE,KAAG,WAAW,EAiB9D,CAAC;AAEP,eAAO,MAAM,kBAAkB,GAC7B,gBAAgB,wBAAwB,KACvC,OAAO,CAAC,IAAI,EAAE,CA4ChB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,IAAI,EAAE,KAAG,WAAW,EA8BhE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAC/B,gBAAgB,wBAAwB,KACvC,OAAO,CAAC,WAAW,EAAE,CAiDvB,CAAC"}
|