react-reason-editor-sidebar 0.1.216 → 0.1.218
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/dist/app-types/fileSource.d.ts +9 -0
- package/dist/app-ui/FileTypeIcon.d.ts +3 -1
- package/dist/app-utils/file-sources/sources.d.ts +8 -0
- package/dist/documents/DocumentTree.d.ts +32 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +2183 -2172
- package/package.json +1 -1
|
@@ -65,6 +65,15 @@ export interface GoogleDocsCredentials {
|
|
|
65
65
|
/** Connected Google account email. */
|
|
66
66
|
email?: string;
|
|
67
67
|
folderIds?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* The synced folders with their display names, in the order they were
|
|
70
|
+
* added. `id` is a Drive folder ID, or `root` for all of My Drive.
|
|
71
|
+
* `folderIds` mirrors the IDs for older readers.
|
|
72
|
+
*/
|
|
73
|
+
folders?: Array<{
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
}>;
|
|
68
77
|
/** Indicates whether the Google connection is active. */
|
|
69
78
|
isAuthenticated: boolean;
|
|
70
79
|
}
|
|
@@ -5,7 +5,9 @@ declare const SIZES: {
|
|
|
5
5
|
};
|
|
6
6
|
interface FileTypeIconProps {
|
|
7
7
|
filename: string;
|
|
8
|
+
/** Overrides the extension read from `filename`. */
|
|
9
|
+
extension?: string;
|
|
8
10
|
size?: keyof typeof SIZES | number;
|
|
9
11
|
}
|
|
10
|
-
export declare function FileTypeIcon({ filename, size }: FileTypeIconProps): import("react").JSX.Element;
|
|
12
|
+
export declare function FileTypeIcon({ filename, extension, size }: FileTypeIconProps): import("react").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
* get/add/update/delete operations.
|
|
6
6
|
*/
|
|
7
7
|
import { AnyFileSource } from '../../app-types/fileSource';
|
|
8
|
+
/**
|
|
9
|
+
* Dispatched on `window` whenever the saved source list changes, so a mounted
|
|
10
|
+
* sidebar picks up a source added in settings without a reload. The name is
|
|
11
|
+
* shared with the other copy of these helpers (research-agent-ui's
|
|
12
|
+
* `file-sources` and react-reason-editor-sidebar's) — both write the same
|
|
13
|
+
* localStorage key.
|
|
14
|
+
*/
|
|
15
|
+
export declare const FILE_SOURCES_CHANGED_EVENT = "reason-file-sources-changed";
|
|
8
16
|
/**
|
|
9
17
|
* Get all file sources from localStorage
|
|
10
18
|
*/
|
|
@@ -41,6 +41,38 @@ export interface Document {
|
|
|
41
41
|
/** Linked Google Docs file identifier. */
|
|
42
42
|
googleDocId?: string;
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Set on documents listed from an external storage source (a synced
|
|
46
|
+
* Google Drive folder) instead of the local document store. They are
|
|
47
|
+
* read-only mirrors: never written to local storage or the database, and
|
|
48
|
+
* the tree refuses to move, rename or delete them.
|
|
49
|
+
*/
|
|
50
|
+
external?: ExternalDocumentRef;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* How a document mirrored from an external storage source opens: `editor`
|
|
54
|
+
* renders its HTML `content` (a Google Doc), `pdf` and `image` render the
|
|
55
|
+
* bytes at `contentUrl` in a viewer, `unsupported` offers only a link out.
|
|
56
|
+
*/
|
|
57
|
+
export type ExternalDocumentView = 'editor' | 'pdf' | 'image' | 'unsupported';
|
|
58
|
+
/** Where an externally sourced {@link Document} lives and how to show it. */
|
|
59
|
+
export interface ExternalDocumentRef {
|
|
60
|
+
/** ID of the file source (an `AnyFileSource`) it was listed from. */
|
|
61
|
+
sourceId: string;
|
|
62
|
+
/** The file's own ID in that source, e.g. a Google Drive file ID. */
|
|
63
|
+
fileId: string;
|
|
64
|
+
/** The file's MIME type in the source. */
|
|
65
|
+
mimeType: string;
|
|
66
|
+
/** How the document opens. */
|
|
67
|
+
view: ExternalDocumentView;
|
|
68
|
+
/** Extension used to pick the file-type icon (`pdf`, `docx`, `png`…). */
|
|
69
|
+
extension?: string;
|
|
70
|
+
/** URL the viewer (or the content loader) fetches the file from. */
|
|
71
|
+
contentUrl?: string;
|
|
72
|
+
/** The file's page in the source's own UI, opened in a new tab. */
|
|
73
|
+
webViewLink?: string;
|
|
74
|
+
/** For `editor` documents: whether `content` has been fetched yet. */
|
|
75
|
+
contentLoaded?: boolean;
|
|
44
76
|
}
|
|
45
77
|
/** Props for the {@link DocumentTree} component. */
|
|
46
78
|
interface DocumentTreeProps {
|