@shiftengineering/folio 0.1.42 → 0.1.47
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
CHANGED
|
@@ -514,10 +514,6 @@ Folio supports deep linking for directories, allowing users to navigate back to
|
|
|
514
514
|
|
|
515
515
|
**Note:** Currently, only directories support deep linking. Individual files do not have deep link functionality.
|
|
516
516
|
|
|
517
|
-
### Configuration
|
|
518
|
-
|
|
519
|
-
Deep linking is controlled by the `VITE_ENABLE_DIRECT_DEEPLINKS` environment variable, which must be provided to the container at runtime. Set this to `true` to enable the feature.
|
|
520
|
-
|
|
521
517
|
### How It Works
|
|
522
518
|
|
|
523
519
|
When a directory is created with a `userProvidedId` (using the `useAddFolioDirectoriesWithFiles` hook), a deep link button (external link icon) will appear next to the directory in:
|
|
@@ -610,16 +606,21 @@ React component to embed Folio in an iframe.
|
|
|
610
606
|
|
|
611
607
|
#### `useFolioProjects()`
|
|
612
608
|
|
|
613
|
-
Hook for getting all projects for the current user.
|
|
609
|
+
Hook for getting all projects for the current user. Each project includes statistics about its size and file count.
|
|
614
610
|
|
|
615
611
|
| Return Property | Type | Description |
|
|
616
612
|
| --------------- | -------------------- | ------------------------------------- |
|
|
617
|
-
| `projects` | `FolioProject[]` | Array of projects
|
|
613
|
+
| `projects` | `FolioProject[]` | Array of projects with stats |
|
|
618
614
|
| `isLoading` | `boolean` | Whether projects are being loaded |
|
|
619
615
|
| `isError` | `boolean` | Whether an error occurred |
|
|
620
616
|
| `error` | `Error \| null` | Error object if an error occurred |
|
|
621
617
|
| `refetch` | `() => Promise<...>` | Function to manually refetch projects |
|
|
622
618
|
|
|
619
|
+
**Project Statistics:**
|
|
620
|
+
Each project in the `projects` array includes:
|
|
621
|
+
- `approximateSizeInBytes`: Approximate total size in bytes (sum of extracted text content character counts for all files, plus metadata character counts for directories)
|
|
622
|
+
- `fileCount`: Total number of files and directories in the project
|
|
623
|
+
|
|
623
624
|
#### `useFolioFiles(projectId?: number)`
|
|
624
625
|
|
|
625
626
|
Hook for getting all files for a specific project.
|
|
@@ -645,6 +646,18 @@ Hook for adding a new project.
|
|
|
645
646
|
| `error` | `Error \| null` | Error object if an error occurred |
|
|
646
647
|
| `newProject` | `FolioProject \| undefined` | The newly created project if available |
|
|
647
648
|
|
|
649
|
+
#### `useDeleteFolioProject()`
|
|
650
|
+
|
|
651
|
+
Hook for deleting a project and all its associated files, directories, and chunks.
|
|
652
|
+
|
|
653
|
+
| Return Property | Type | Description |
|
|
654
|
+
| --------------------- | ----------------------------------- | ---------------------------------------- |
|
|
655
|
+
| `deleteProject` | `(projectId: number) => void` | Function to delete a project |
|
|
656
|
+
| `deleteProjectAsync` | `(projectId: number) => Promise<void>` | Async version returning a promise |
|
|
657
|
+
| `isDeleting` | `boolean` | Whether a project is being deleted |
|
|
658
|
+
| `isError` | `boolean` | Whether an error occurred |
|
|
659
|
+
| `error` | `Error \| null` | Error object if an error occurred |
|
|
660
|
+
|
|
648
661
|
#### `useAddFolioFiles(projectId?: number)`
|
|
649
662
|
|
|
650
663
|
Hook for adding files to a project. Files are always created at the root level (parentId = null) and are not directories.
|
|
@@ -693,7 +706,7 @@ The library exports these TypeScript types:
|
|
|
693
706
|
| Type | Description |
|
|
694
707
|
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
695
708
|
| `FolioFile` | Represents a file in Folio. Contains properties: `id`, `name`, `blobUrl`, `parentId` (null for root items), `isDirectory` (boolean), `userProvidedId` (string), `createdAt` (Date), and `updatedAt` (Date) |
|
|
696
|
-
| `FolioProject` | Represents a project in Folio. Contains properties: `id`, `name`, `createdAt` (Date),
|
|
709
|
+
| `FolioProject` | Represents a project in Folio. Contains properties: `id`, `name`, `createdAt` (Date), `updatedAt` (Date), `approximateSizeInBytes` (number - sum of extracted text content lengths for all files and metadata lengths for directories), and `fileCount` (number - total count of all files and directories) |
|
|
697
710
|
| `MetadataValue` | Represents metadata values that can be nested. Can be a string, number, boolean, null, object, or array of these types. Used for both directory metadata and user metadata. |
|
|
698
711
|
| `DirectoryEntry` | Represents a directory with metadata and files to be added to Folio. Contains properties: `directoryName`, `directoryMetadata` (now supports nested objects), and `files` |
|
|
699
712
|
| `FolioFileInput` | Input type for adding files to Folio. Contains properties: `blobUrl`, `name`, and `userProvidedId` (required for deduplication) |
|