@powerhousedao/reactor-browser 5.1.0 → 5.2.0-dev.1
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 +296 -482
- package/dist/src/actions/dispatch.d.ts +16 -2
- package/dist/src/actions/dispatch.d.ts.map +1 -1
- package/dist/src/actions/dispatch.js +20 -2
- package/dist/src/actions/dispatch.js.map +1 -1
- package/dist/src/actions/document.d.ts +7 -4
- package/dist/src/actions/document.d.ts.map +1 -1
- package/dist/src/actions/document.js +302 -131
- package/dist/src/actions/document.js.map +1 -1
- package/dist/src/actions/drive.d.ts +2 -2
- package/dist/src/actions/drive.d.ts.map +1 -1
- package/dist/src/actions/drive.js +153 -50
- package/dist/src/actions/drive.js.map +1 -1
- package/dist/src/actions/queue.d.ts.map +1 -1
- package/dist/src/actions/queue.js +48 -24
- package/dist/src/actions/queue.js.map +1 -1
- package/dist/src/actions/sign.js +1 -1
- package/dist/src/actions/sign.js.map +1 -1
- package/dist/src/document-cache.d.ts +17 -0
- package/dist/src/document-cache.d.ts.map +1 -0
- package/dist/src/document-cache.js +143 -0
- package/dist/src/document-cache.js.map +1 -0
- package/dist/src/errors.js +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/hooks/add-ph-event-handlers.d.ts.map +1 -1
- package/dist/src/hooks/add-ph-event-handlers.js +11 -2
- package/dist/src/hooks/add-ph-event-handlers.js.map +1 -1
- package/dist/src/hooks/config/connect.d.ts +2 -2
- package/dist/src/hooks/connect.d.ts +1 -1
- package/dist/src/hooks/connect.d.ts.map +1 -1
- package/dist/src/hooks/connect.js +1 -1
- package/dist/src/hooks/connect.js.map +1 -1
- package/dist/src/hooks/crypto.d.ts +7 -1
- package/dist/src/hooks/crypto.d.ts.map +1 -1
- package/dist/src/hooks/crypto.js +7 -1
- package/dist/src/hooks/crypto.js.map +1 -1
- package/dist/src/hooks/dispatch.d.ts +7 -2
- package/dist/src/hooks/dispatch.d.ts.map +1 -1
- package/dist/src/hooks/dispatch.js +13 -3
- package/dist/src/hooks/dispatch.js.map +1 -1
- package/dist/src/hooks/document-by-id.d.ts +1 -1
- package/dist/src/hooks/document-by-id.d.ts.map +1 -1
- package/dist/src/hooks/document-by-id.js +3 -3
- package/dist/src/hooks/document-by-id.js.map +1 -1
- package/dist/src/hooks/document-cache.d.ts +19 -3
- package/dist/src/hooks/document-cache.d.ts.map +1 -1
- package/dist/src/hooks/document-cache.js +41 -14
- package/dist/src/hooks/document-cache.js.map +1 -1
- package/dist/src/hooks/features.d.ts +5 -0
- package/dist/src/hooks/features.d.ts.map +1 -0
- package/dist/src/hooks/features.js +6 -0
- package/dist/src/hooks/features.js.map +1 -0
- package/dist/src/hooks/index.d.ts +6 -3
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +6 -3
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/reactor.d.ts +39 -6
- package/dist/src/hooks/reactor.d.ts.map +1 -1
- package/dist/src/hooks/reactor.js +41 -6
- package/dist/src/hooks/reactor.js.map +1 -1
- package/dist/src/hooks/renown.d.ts +3 -2
- package/dist/src/hooks/renown.d.ts.map +1 -1
- package/dist/src/hooks/renown.js.map +1 -1
- package/dist/src/hooks/selected-document.d.ts +3 -1
- package/dist/src/hooks/selected-document.d.ts.map +1 -1
- package/dist/src/hooks/selected-document.js +9 -0
- package/dist/src/hooks/selected-document.js.map +1 -1
- package/dist/src/hooks/selected-drive.d.ts.map +1 -1
- package/dist/src/hooks/selected-drive.js +3 -3
- package/dist/src/hooks/selected-drive.js.map +1 -1
- package/dist/src/hooks/selected-node.d.ts.map +1 -1
- package/dist/src/hooks/selected-node.js +3 -3
- package/dist/src/hooks/selected-node.js.map +1 -1
- package/dist/src/hooks/toast.d.ts +7 -0
- package/dist/src/hooks/toast.d.ts.map +1 -0
- package/dist/src/hooks/toast.js +9 -0
- package/dist/src/hooks/toast.js.map +1 -0
- package/dist/src/hooks/use-feature-flags.d.ts +44 -0
- package/dist/src/hooks/use-feature-flags.d.ts.map +1 -0
- package/dist/src/hooks/use-feature-flags.js +65 -0
- package/dist/src/hooks/use-feature-flags.js.map +1 -0
- package/dist/src/hooks/user.d.ts +7 -1
- package/dist/src/hooks/user.d.ts.map +1 -1
- package/dist/src/hooks/user.js +7 -1
- package/dist/src/hooks/user.js.map +1 -1
- package/dist/src/hooks/vetra-packages.d.ts.map +1 -1
- package/dist/src/hooks/vetra-packages.js +3 -1
- package/dist/src/hooks/vetra-packages.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/pglite/drop.d.ts +3 -0
- package/dist/src/pglite/drop.d.ts.map +1 -0
- package/dist/src/pglite/drop.js +19 -0
- package/dist/src/pglite/drop.js.map +1 -0
- package/dist/src/pglite/index.d.ts +1 -0
- package/dist/src/pglite/index.d.ts.map +1 -1
- package/dist/src/pglite/index.js +1 -0
- package/dist/src/pglite/index.js.map +1 -1
- package/dist/src/reactor-client-document-cache.d.ts +31 -0
- package/dist/src/reactor-client-document-cache.d.ts.map +1 -0
- package/dist/src/reactor-client-document-cache.js +142 -0
- package/dist/src/reactor-client-document-cache.js.map +1 -0
- package/dist/src/reactor.d.ts +5 -6
- package/dist/src/reactor.d.ts.map +1 -1
- package/dist/src/reactor.js +36 -61
- package/dist/src/reactor.js.map +1 -1
- package/dist/src/renown/constants.d.ts +1 -1
- package/dist/src/renown/constants.d.ts.map +1 -1
- package/dist/src/renown/constants.js +1 -1
- package/dist/src/renown/constants.js.map +1 -1
- package/dist/src/renown/utils.d.ts +2 -2
- package/dist/src/renown/utils.d.ts.map +1 -1
- package/dist/src/renown/utils.js +2 -2
- package/dist/src/renown/utils.js.map +1 -1
- package/dist/src/types/documents.d.ts +10 -5
- package/dist/src/types/documents.d.ts.map +1 -1
- package/dist/src/types/global.d.ts +15 -1
- package/dist/src/types/global.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/modals.d.ts +2 -0
- package/dist/src/types/modals.d.ts.map +1 -1
- package/dist/src/types/toast.d.ts +9 -0
- package/dist/src/types/toast.d.ts.map +1 -0
- package/dist/src/types/toast.js +2 -0
- package/dist/src/types/toast.js.map +1 -0
- package/dist/src/utils/drives.d.ts.map +1 -1
- package/dist/src/utils/drives.js +41 -24
- package/dist/src/utils/drives.js.map +1 -1
- package/dist/src/utils/url.d.ts +4 -0
- package/dist/src/utils/url.d.ts.map +1 -1
- package/dist/src/utils/url.js +7 -0
- package/dist/src/utils/url.js.map +1 -1
- package/dist/test/document-cache.test.d.ts +2 -0
- package/dist/test/document-cache.test.d.ts.map +1 -0
- package/dist/test/document-cache.test.js +457 -0
- package/dist/test/document-cache.test.js.map +1 -0
- package/dist/test/drop.test.d.ts +2 -0
- package/dist/test/drop.test.d.ts.map +1 -0
- package/dist/test/drop.test.js +86 -0
- package/dist/test/drop.test.js.map +1 -0
- package/dist/test/getSwitchboardUrl.test.js +3 -1
- package/dist/test/getSwitchboardUrl.test.js.map +1 -1
- package/dist/test/hooks/document-cache.test.d.ts +2 -0
- package/dist/test/hooks/document-cache.test.d.ts.map +1 -0
- package/dist/test/hooks/document-cache.test.js +642 -0
- package/dist/test/hooks/document-cache.test.js.map +1 -0
- package/dist/test/switchboard.test.js +4 -2
- package/dist/test/switchboard.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -1,692 +1,506 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Reactor Browser Hooks API Documentation
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This document contains all documentation comments for the hooks exported from `packages/reactor-browser/src/hooks/index.ts`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Table of Contents
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- [Allowed Document Model Modules](#allowed-document-model-modules)
|
|
8
|
+
- [Child Nodes](#child-nodes)
|
|
9
|
+
- [Config: Editor](#config-editor)
|
|
10
|
+
- [Config: Set Config by Object](#config-set-config-by-object)
|
|
11
|
+
- [Config: Use Value by Key](#config-use-value-by-key)
|
|
12
|
+
- [Document by ID](#document-by-id)
|
|
13
|
+
- [Document Cache](#document-cache)
|
|
14
|
+
- [Document of Type](#document-of-type)
|
|
15
|
+
- [Document Types](#document-types)
|
|
16
|
+
- [Drives](#drives)
|
|
17
|
+
- [Items in Selected Drive](#items-in-selected-drive)
|
|
18
|
+
- [Items in Selected Folder](#items-in-selected-folder)
|
|
19
|
+
- [Modals](#modals)
|
|
20
|
+
- [Node by ID](#node-by-id)
|
|
21
|
+
- [Node Path](#node-path)
|
|
22
|
+
- [Revision History](#revision-history)
|
|
23
|
+
- [Selected Document](#selected-document)
|
|
24
|
+
- [Selected Drive](#selected-drive)
|
|
25
|
+
- [Selected Folder](#selected-folder)
|
|
26
|
+
- [Selected Node](#selected-node)
|
|
27
|
+
- [Selected Timeline Item](#selected-timeline-item)
|
|
28
|
+
- [Supported Document Types](#supported-document-types)
|
|
29
|
+
- [Timeline Revision](#timeline-revision)
|
|
30
|
+
- [Use Get Switchboard Link](#use-get-switchboard-link)
|
|
31
|
+
- [Vetra Packages](#vetra-packages)
|
|
8
32
|
|
|
9
|
-
|
|
33
|
+
---
|
|
10
34
|
|
|
11
|
-
|
|
35
|
+
## Allowed Document Model Modules
|
|
12
36
|
|
|
13
|
-
|
|
37
|
+
### `useAllowedDocumentModelModules`
|
|
14
38
|
|
|
15
|
-
|
|
16
|
-
- selected folder
|
|
17
|
-
- selected document
|
|
39
|
+
No documentation available.
|
|
18
40
|
|
|
19
|
-
|
|
41
|
+
---
|
|
20
42
|
|
|
21
|
-
|
|
22
|
-
`useSelectedFolder`
|
|
23
|
-
`useSelectedDocument`
|
|
43
|
+
## Child Nodes
|
|
24
44
|
|
|
25
|
-
|
|
45
|
+
### `useNodesInSelectedDriveOrFolder`
|
|
26
46
|
|
|
27
|
-
|
|
47
|
+
Returns the child nodes for the selected drive or folder.
|
|
28
48
|
|
|
29
|
-
|
|
49
|
+
---
|
|
30
50
|
|
|
31
|
-
|
|
51
|
+
## Document by ID
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
### `useDocumentById`
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
Returns a document by id.
|
|
36
56
|
|
|
37
|
-
|
|
38
|
-
function useReactor(): Reactor | undefined;
|
|
39
|
-
```
|
|
57
|
+
### `useDocumentsByIds`
|
|
40
58
|
|
|
41
|
-
Returns
|
|
59
|
+
Returns documents by ids.
|
|
42
60
|
|
|
43
|
-
|
|
61
|
+
---
|
|
44
62
|
|
|
45
|
-
|
|
46
|
-
import { useReactor } from '@powerhousedao/state`
|
|
63
|
+
## Document Cache
|
|
47
64
|
|
|
48
|
-
|
|
49
|
-
const reactor = useReactor();
|
|
50
|
-
}
|
|
51
|
-
```
|
|
65
|
+
### `useDocumentCache`
|
|
52
66
|
|
|
53
|
-
|
|
67
|
+
Returns all documents in the reactor.
|
|
54
68
|
|
|
55
|
-
|
|
69
|
+
### `setDocumentCache`
|
|
56
70
|
|
|
57
|
-
|
|
58
|
-
function useDrives(): DocumentDriveDocument[] | undefined;
|
|
59
|
-
```
|
|
71
|
+
Sets all of the documents in the reactor.
|
|
60
72
|
|
|
61
|
-
|
|
73
|
+
### `addDocumentCacheEventHandler`
|
|
62
74
|
|
|
63
|
-
|
|
75
|
+
Adds an event handler for all of the documents in the reactor.
|
|
64
76
|
|
|
65
|
-
|
|
66
|
-
import { useDrives } from "@powerhousedao/state";
|
|
77
|
+
### `useDocument`
|
|
67
78
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
```
|
|
79
|
+
Retrieves a document from the reactor and subscribes to changes using React Suspense.
|
|
80
|
+
This hook will suspend rendering while the document is loading.
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
**Parameters:**
|
|
83
|
+
- `id` - The document ID to retrieve, or null/undefined to skip retrieval
|
|
74
84
|
|
|
75
|
-
|
|
76
|
-
function useDriveById(
|
|
77
|
-
id: string | null | undefined,
|
|
78
|
-
): DocumentDriveDocument | undefined;
|
|
79
|
-
```
|
|
85
|
+
**Returns:** The document if found, or undefined if id is null/undefined
|
|
80
86
|
|
|
81
|
-
|
|
87
|
+
### `useDocuments`
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
Retrieves multiple documents from the reactor using React Suspense.
|
|
90
|
+
This hook will suspend rendering while any of the documents are loading.
|
|
84
91
|
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
**Parameters:**
|
|
93
|
+
- `ids` - Array of document IDs to retrieve, or null/undefined to skip retrieval
|
|
87
94
|
|
|
88
|
-
|
|
89
|
-
const driveById = useDriveById();
|
|
90
|
-
}
|
|
91
|
-
```
|
|
95
|
+
**Returns:** An array of documents if found, or empty array if ids is null/undefined
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
### `useGetDocument`
|
|
94
98
|
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
```
|
|
99
|
+
Returns a function to retrieve a document from the cache.
|
|
100
|
+
The returned function fetches and returns a document by ID.
|
|
98
101
|
|
|
99
|
-
Returns
|
|
102
|
+
**Returns:** A function that takes a document ID and returns a Promise of the document
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
### `useGetDocuments`
|
|
102
105
|
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
Returns a function to retrieve multiple documents from the cache.
|
|
107
|
+
The returned function fetches and returns documents by their IDs.
|
|
105
108
|
|
|
106
|
-
function
|
|
107
|
-
const selectedDrive = useSelectedDrive();
|
|
108
|
-
}
|
|
109
|
-
```
|
|
109
|
+
**Returns:** A function that takes an array of document IDs and returns a Promise of the documents
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
### `useGetDocumentAsync`
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
Retrieves a document from the reactor without suspending rendering.
|
|
114
|
+
Returns the current state of the document loading operation.
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
function useDriveRemoteUrl(
|
|
118
|
-
driveId: string | null | undefined,
|
|
119
|
-
): string | undefined;
|
|
116
|
+
**Parameters:**
|
|
117
|
+
- `id` - The document ID to retrieve, or null/undefined to skip retrieval
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
**Returns:** An object containing:
|
|
120
|
+
- `status`: "initial" | "pending" | "success" | "error"
|
|
121
|
+
- `data`: The document if successfully loaded
|
|
122
|
+
- `isPending`: Boolean indicating if the document is currently loading
|
|
123
|
+
- `error`: Any error that occurred during loading
|
|
124
|
+
- `reload`: Function to force reload the document from cache
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
function useDrivePullResponderUrl(
|
|
128
|
-
driveId: string | null | undefined,
|
|
129
|
-
): string | undefined;
|
|
126
|
+
---
|
|
130
127
|
|
|
131
|
-
|
|
132
|
-
function useDriveIsRemote(driveId: string | null | undefined): boolean;
|
|
128
|
+
## Document of Type
|
|
133
129
|
|
|
134
|
-
|
|
135
|
-
function useDriveSharingType(
|
|
136
|
-
driveId: string | null | undefined,
|
|
137
|
-
): SharingType | undefined;
|
|
130
|
+
### `useDocumentOfType`
|
|
138
131
|
|
|
139
|
-
|
|
140
|
-
function useDriveAvailableOffline(driveId: string | null | undefined): boolean;
|
|
141
|
-
```
|
|
132
|
+
Returns a document of a specific type, throws an error if the found document has a different type.
|
|
142
133
|
|
|
143
|
-
|
|
134
|
+
---
|
|
144
135
|
|
|
145
|
-
|
|
146
|
-
import {
|
|
147
|
-
useDriveRemoteUrl,
|
|
148
|
-
useDrivePullResponderTrigger,
|
|
149
|
-
useDrivePullResponderUrl,
|
|
150
|
-
useDriveIsRemote,
|
|
151
|
-
useDriveSharingType,
|
|
152
|
-
useDriveAvailableOffline,
|
|
153
|
-
} from "@powerhousedao/state";
|
|
136
|
+
## Document Types
|
|
154
137
|
|
|
155
|
-
|
|
156
|
-
const myDriveId = "some-drive-id";
|
|
157
|
-
const driveRemoteUrl = useDriveRemoteUrl(myDriveId);
|
|
158
|
-
const drivePullResponderTrigger = useDrivePullResponderTrigger(myDriveId);
|
|
159
|
-
const drivePullResponderUrl = useDrivePullResponderUrl(myDriveId);
|
|
160
|
-
const driveIsRemote = useDriveIsRemote(myDriveId);
|
|
161
|
-
const driveSharingType = useDriveSharingType(myDriveId);
|
|
162
|
-
const driveAvailableOffline = useDriveAvailableOffline(myDriveId);
|
|
138
|
+
### `useDocumentTypes`
|
|
163
139
|
|
|
164
|
-
|
|
165
|
-
driveRemoteUrl,
|
|
166
|
-
drivePullResponderTrigger,
|
|
167
|
-
drivePullResponderUrl,
|
|
168
|
-
driveIsRemote,
|
|
169
|
-
driveSharingType,
|
|
170
|
-
driveAvailableOffline,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
```
|
|
140
|
+
Returns the document types a drive editor supports.
|
|
174
141
|
|
|
175
|
-
|
|
142
|
+
If present, uses the `allowedDocumentTypes` config value.
|
|
143
|
+
Otherwise, uses the supported document types from the reactor.
|
|
176
144
|
|
|
177
|
-
|
|
145
|
+
---
|
|
178
146
|
|
|
179
|
-
|
|
180
|
-
function useDocumentById(id: string | null | undefined): PHDocument | undefined;
|
|
181
|
-
```
|
|
147
|
+
## Drives
|
|
182
148
|
|
|
183
|
-
|
|
149
|
+
### `useDrives`
|
|
184
150
|
|
|
185
|
-
|
|
151
|
+
Returns all of the drives in the reactor.
|
|
186
152
|
|
|
187
|
-
|
|
188
|
-
import { useDocumentById } from "@powerhousedao/state";
|
|
153
|
+
### `setDrives`
|
|
189
154
|
|
|
190
|
-
|
|
191
|
-
const myDocumentId = "some-document-id";
|
|
192
|
-
const [document, dispatch] = useDocumentById(myDocumentId);
|
|
193
|
-
}
|
|
194
|
-
```
|
|
155
|
+
Sets the drives in the reactor.
|
|
195
156
|
|
|
196
|
-
|
|
157
|
+
### `addDrivesEventHandler`
|
|
197
158
|
|
|
198
|
-
|
|
199
|
-
function useGetDocument(id: string | null | undefined): PHDocument | undefined;
|
|
200
|
-
```
|
|
159
|
+
Adds an event handler for the drives.
|
|
201
160
|
|
|
202
|
-
|
|
161
|
+
---
|
|
203
162
|
|
|
204
|
-
|
|
163
|
+
## Items in Selected Drive
|
|
205
164
|
|
|
206
|
-
|
|
207
|
-
import { useGetDocument } from "@powerhousedao/state";
|
|
165
|
+
### `useNodesInSelectedDrive`
|
|
208
166
|
|
|
209
|
-
|
|
210
|
-
const documentId = "some-document-id";
|
|
211
|
-
const document = useGetDocument(documentId);
|
|
212
|
-
}
|
|
213
|
-
```
|
|
167
|
+
Returns the nodes in the selected drive.
|
|
214
168
|
|
|
215
|
-
|
|
169
|
+
### `useFileNodesInSelectedDrive`
|
|
216
170
|
|
|
217
|
-
|
|
218
|
-
function useGetDocuments(
|
|
219
|
-
ids: string[] | null | undefined,
|
|
220
|
-
): PHDocument[] | undefined;
|
|
221
|
-
```
|
|
171
|
+
Returns the file nodes in the selected drive.
|
|
222
172
|
|
|
223
|
-
|
|
173
|
+
### `useFolderNodesInSelectedDrive`
|
|
224
174
|
|
|
225
|
-
|
|
175
|
+
Returns the folder nodes in the selected drive.
|
|
226
176
|
|
|
227
|
-
|
|
228
|
-
import { useGetDocuments } from "@powerhousedao/state";
|
|
177
|
+
### `useDocumentsInSelectedDrive`
|
|
229
178
|
|
|
230
|
-
|
|
231
|
-
const documentIds = ["doc-id-1", "doc-id-2", "doc-id-3"];
|
|
232
|
-
const documents = useGetDocuments(documentIds);
|
|
233
|
-
}
|
|
234
|
-
```
|
|
179
|
+
Returns the documents in the selected drive.
|
|
235
180
|
|
|
236
|
-
|
|
181
|
+
### `useDocumentTypesInSelectedDrive`
|
|
237
182
|
|
|
238
|
-
|
|
239
|
-
function useGetDocumentAsync(id: string | null | undefined): {
|
|
240
|
-
status: "initial" | "pending" | "success" | "error";
|
|
241
|
-
data: PHDocument | undefined;
|
|
242
|
-
isPending: boolean;
|
|
243
|
-
error: unknown;
|
|
244
|
-
reload: (() => void) | undefined;
|
|
245
|
-
};
|
|
246
|
-
```
|
|
183
|
+
Returns the document types supported by the selected drive, as defined by the document model documents present in the drive.
|
|
247
184
|
|
|
248
|
-
|
|
185
|
+
---
|
|
249
186
|
|
|
250
|
-
|
|
187
|
+
## Items in Selected Folder
|
|
251
188
|
|
|
252
|
-
|
|
253
|
-
import { useGetDocumentAsync } from "@powerhousedao/state";
|
|
189
|
+
### `useNodesInSelectedFolder`
|
|
254
190
|
|
|
255
|
-
|
|
256
|
-
const documentId = "some-document-id";
|
|
257
|
-
const { status, data, isPending, error, reload } =
|
|
258
|
-
useGetDocumentAsync(documentId);
|
|
191
|
+
Returns the nodes in the selected folder.
|
|
259
192
|
|
|
260
|
-
|
|
261
|
-
return <div>Loading...</div>;
|
|
262
|
-
}
|
|
193
|
+
### `useFileNodesInSelectedFolder`
|
|
263
194
|
|
|
264
|
-
|
|
265
|
-
return <div>Error: {error.message}</div>;
|
|
266
|
-
}
|
|
195
|
+
Returns the file nodes in the selected folder.
|
|
267
196
|
|
|
268
|
-
|
|
269
|
-
return <div>Document: {data.name}</div>;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
```
|
|
197
|
+
### `useFolderNodesInSelectedFolder`
|
|
273
198
|
|
|
274
|
-
|
|
199
|
+
Returns the folder nodes in the selected folder.
|
|
275
200
|
|
|
276
|
-
|
|
277
|
-
function useDocumentsInSelectedDrive(): PHDocument[] | undefined;
|
|
278
|
-
```
|
|
201
|
+
### `useDocumentsInSelectedFolder`
|
|
279
202
|
|
|
280
|
-
Returns the documents in the
|
|
203
|
+
Returns the documents in the selected folder.
|
|
281
204
|
|
|
282
|
-
|
|
205
|
+
---
|
|
283
206
|
|
|
284
|
-
|
|
285
|
-
import { useDocumentsInSelectedDrive } from "@powerhousedao/state";
|
|
207
|
+
## Modals
|
|
286
208
|
|
|
287
|
-
|
|
288
|
-
const selectedDriveDocuments = useDocumentsInSelectedDrive();
|
|
289
|
-
}
|
|
290
|
-
```
|
|
209
|
+
### `usePHModal`
|
|
291
210
|
|
|
292
|
-
|
|
211
|
+
Returns the current modal.
|
|
293
212
|
|
|
294
|
-
|
|
295
|
-
function useSelectedDocument(): PHDocument | undefined;
|
|
296
|
-
```
|
|
213
|
+
### `setPHModal`
|
|
297
214
|
|
|
298
|
-
|
|
215
|
+
Sets the current modal.
|
|
299
216
|
|
|
300
|
-
|
|
217
|
+
### `addModalEventHandler`
|
|
301
218
|
|
|
302
|
-
|
|
303
|
-
import { useSelectedDocument } from "@powerhousedao/state";
|
|
219
|
+
Adds an event handler for the modal.
|
|
304
220
|
|
|
305
|
-
|
|
306
|
-
const selectedDocument = useSelectedDocument();
|
|
307
|
-
}
|
|
308
|
-
```
|
|
221
|
+
### `showPHModal`
|
|
309
222
|
|
|
310
|
-
|
|
223
|
+
Shows a modal.
|
|
311
224
|
|
|
312
|
-
|
|
225
|
+
### `closePHModal`
|
|
313
226
|
|
|
314
|
-
|
|
227
|
+
Closes the current modal.
|
|
315
228
|
|
|
316
|
-
|
|
229
|
+
### `showCreateDocumentModal`
|
|
317
230
|
|
|
318
|
-
|
|
231
|
+
Shows the create document modal.
|
|
319
232
|
|
|
320
|
-
|
|
321
|
-
type FileNode = {
|
|
322
|
-
documentType: string;
|
|
323
|
-
id: string;
|
|
324
|
-
kind: string;
|
|
325
|
-
name: string;
|
|
326
|
-
parentFolder: string | null | undefined;
|
|
327
|
-
};
|
|
233
|
+
### `showDeleteNodeModal`
|
|
328
234
|
|
|
329
|
-
|
|
330
|
-
id: string;
|
|
331
|
-
kind: string;
|
|
332
|
-
name: string;
|
|
333
|
-
parentFolder: string | null | undefined;
|
|
334
|
-
};
|
|
235
|
+
Shows the delete node modal.
|
|
335
236
|
|
|
336
|
-
|
|
337
|
-
```
|
|
237
|
+
---
|
|
338
238
|
|
|
339
|
-
|
|
239
|
+
## Node by ID
|
|
340
240
|
|
|
341
|
-
|
|
241
|
+
### `useNodeById`
|
|
342
242
|
|
|
343
|
-
|
|
344
|
-
function useNodes(): Node[] | undefined;
|
|
345
|
-
```
|
|
243
|
+
Returns a node in the selected drive by id.
|
|
346
244
|
|
|
347
|
-
|
|
245
|
+
---
|
|
348
246
|
|
|
349
|
-
|
|
247
|
+
## Node Path
|
|
350
248
|
|
|
351
|
-
|
|
352
|
-
import { useNodes } from "@powerhousedao/state";
|
|
249
|
+
### `useNodePathById`
|
|
353
250
|
|
|
354
|
-
|
|
355
|
-
const nodes = useNodes();
|
|
356
|
-
}
|
|
357
|
-
```
|
|
251
|
+
Returns the path to a node in the selected drive.
|
|
358
252
|
|
|
359
|
-
|
|
253
|
+
### `useSelectedNodePath`
|
|
360
254
|
|
|
361
|
-
|
|
362
|
-
function useNodeById(id: string | null | undefined): Node | undefined;
|
|
363
|
-
```
|
|
255
|
+
Returns the path to the currently selected node in the selected drive.
|
|
364
256
|
|
|
365
|
-
|
|
257
|
+
---
|
|
366
258
|
|
|
367
|
-
|
|
259
|
+
## Revision History
|
|
368
260
|
|
|
369
|
-
|
|
370
|
-
import { useNodeById } from "@powerhousedao/state";
|
|
261
|
+
### `useRevisionHistoryVisible`
|
|
371
262
|
|
|
372
|
-
|
|
373
|
-
const myFolderId = "some-folder-id";
|
|
374
|
-
const myDocumentId = "some-document-id";
|
|
375
|
-
const myFolderNode = useNodeById(myFolderId);
|
|
376
|
-
const myFileNode = useNodeById(myDocumentId);
|
|
377
|
-
}
|
|
378
|
-
```
|
|
263
|
+
Returns whether revision history is visible.
|
|
379
264
|
|
|
380
|
-
|
|
265
|
+
### `setRevisionHistoryVisible`
|
|
381
266
|
|
|
382
|
-
|
|
383
|
-
function useSelectedFolder(): FolderNode | undefined;
|
|
384
|
-
```
|
|
267
|
+
Sets revision history visibility.
|
|
385
268
|
|
|
386
|
-
|
|
269
|
+
### `addRevisionHistoryVisibleEventHandler`
|
|
387
270
|
|
|
388
|
-
|
|
271
|
+
Adds event handler for revision history visibility.
|
|
389
272
|
|
|
390
|
-
|
|
391
|
-
import { useSelectedFolder } from "@powerhousedao/state";
|
|
273
|
+
### `showRevisionHistory`
|
|
392
274
|
|
|
393
|
-
|
|
394
|
-
const selectedFolder = useSelectedFolder();
|
|
395
|
-
}
|
|
396
|
-
```
|
|
275
|
+
Shows the revision history.
|
|
397
276
|
|
|
398
|
-
|
|
277
|
+
### `hideRevisionHistory`
|
|
399
278
|
|
|
400
|
-
|
|
401
|
-
function useSelectedNodePath(): Node[];
|
|
402
|
-
```
|
|
279
|
+
Hides the revision history.
|
|
403
280
|
|
|
404
|
-
|
|
281
|
+
---
|
|
405
282
|
|
|
406
|
-
|
|
283
|
+
## Selected Document
|
|
407
284
|
|
|
408
|
-
|
|
409
|
-
import { useSelectedNodePath } from '@powerhousedao/state';
|
|
285
|
+
### `useSelectedDocumentId`
|
|
410
286
|
|
|
411
|
-
|
|
412
|
-
const nodes = useSelectedNodePath();
|
|
287
|
+
Returns the selected document id.
|
|
413
288
|
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
```
|
|
289
|
+
### `useSelectedDocument`
|
|
417
290
|
|
|
418
|
-
|
|
291
|
+
Returns the selected document.
|
|
419
292
|
|
|
420
|
-
|
|
421
|
-
function useChildNodes(): Node[];
|
|
422
|
-
```
|
|
293
|
+
### `useSelectedDocumentOfType`
|
|
423
294
|
|
|
424
|
-
Returns the
|
|
295
|
+
Returns the selected document of a specific type, throws an error if the found document has a different type.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Selected Drive
|
|
300
|
+
|
|
301
|
+
### `useSelectedDriveId`
|
|
302
|
+
|
|
303
|
+
Returns the selected drive id.
|
|
304
|
+
|
|
305
|
+
### `setSelectedDriveId`
|
|
306
|
+
|
|
307
|
+
Sets the selected drive id.
|
|
308
|
+
|
|
309
|
+
### `addSelectedDriveIdEventHandler`
|
|
310
|
+
|
|
311
|
+
Adds an event handler for the selected drive id.
|
|
312
|
+
|
|
313
|
+
### `useSelectedDrive`
|
|
314
|
+
|
|
315
|
+
Returns the selected drive.
|
|
316
|
+
|
|
317
|
+
### `useSelectedDriveSafe`
|
|
318
|
+
|
|
319
|
+
Returns the selected drive, or undefined if no drive is selected.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Selected Folder
|
|
324
|
+
|
|
325
|
+
### `useSelectedFolder`
|
|
326
|
+
|
|
327
|
+
Returns the selected folder.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Selected Node
|
|
332
|
+
|
|
333
|
+
### `useSelectedNode`
|
|
334
|
+
|
|
335
|
+
Returns the selected node.
|
|
336
|
+
|
|
337
|
+
### `setSelectedNode`
|
|
338
|
+
|
|
339
|
+
Sets the selected node (file or folder).
|
|
425
340
|
|
|
426
|
-
|
|
427
|
-
function useFolderChildNodes(): FolderNode[];
|
|
428
|
-
```
|
|
341
|
+
---
|
|
429
342
|
|
|
430
|
-
|
|
343
|
+
## Selected Timeline Item
|
|
431
344
|
|
|
432
|
-
|
|
433
|
-
function useFileChildNodes(): FileNode[];
|
|
434
|
-
```
|
|
345
|
+
### `useSelectedTimelineItem`
|
|
435
346
|
|
|
436
|
-
Returns the
|
|
347
|
+
Returns the selected timeline item.
|
|
437
348
|
|
|
438
|
-
|
|
349
|
+
### `setSelectedTimelineItem`
|
|
439
350
|
|
|
440
|
-
|
|
441
|
-
import { useChildNodes, useFolderChildNodes, useFileChildNodes } from '@powerhousedao/state';
|
|
351
|
+
Sets the selected timeline item.
|
|
442
352
|
|
|
443
|
-
|
|
444
|
-
const nodes = useChildNodes();
|
|
445
|
-
const fileNodes = useChildFileNodes();
|
|
446
|
-
const folderNodes = useChildFolderNodes();
|
|
353
|
+
### `addSelectedTimelineItemEventHandler`
|
|
447
354
|
|
|
448
|
-
|
|
449
|
-
<div>
|
|
450
|
-
<FilesAndFolders nodes={nodes}>
|
|
451
|
-
<Files fileNodes={fileNodes}>
|
|
452
|
-
<Folders folderNodes={folderNodes}>
|
|
453
|
-
</div>
|
|
454
|
-
)
|
|
455
|
-
}
|
|
456
|
-
```
|
|
355
|
+
Adds event handler for selected timeline item.
|
|
457
356
|
|
|
458
|
-
|
|
357
|
+
---
|
|
459
358
|
|
|
460
|
-
|
|
461
|
-
function useChildNodesForId(id: string | null | undefined): Node[];
|
|
462
|
-
```
|
|
359
|
+
## Supported Document Types
|
|
463
360
|
|
|
464
|
-
|
|
361
|
+
### `useSupportedDocumentTypesInReactor`
|
|
465
362
|
|
|
466
|
-
|
|
467
|
-
function useFolderChildNodesForId(id: string | null | undefined): FolderNode[];
|
|
468
|
-
```
|
|
363
|
+
Returns the supported document types for the reactor (derived from the document model modules).
|
|
469
364
|
|
|
470
|
-
|
|
365
|
+
---
|
|
471
366
|
|
|
472
|
-
|
|
473
|
-
function useFileChildNodesForId(id: string | null | undefined): FileNode[];
|
|
474
|
-
```
|
|
367
|
+
## Timeline Revision
|
|
475
368
|
|
|
476
|
-
|
|
369
|
+
### `useSelectedTimelineRevision`
|
|
477
370
|
|
|
478
|
-
|
|
371
|
+
Returns the selected timeline revision.
|
|
479
372
|
|
|
480
|
-
|
|
481
|
-
import { useChildNodesForId, useFolderChildNodesForId, useFileChildNodesForId } from '@powerhousedao/state';
|
|
373
|
+
### `setSelectedTimelineRevision`
|
|
482
374
|
|
|
483
|
-
|
|
484
|
-
const driveOrFolderId = 'some-drive-or-folder-id';
|
|
485
|
-
const nodes = useChildNodesForId(driveOrFolderId);
|
|
486
|
-
const fileNodes = useFileChildNodesForId(driveOrFolderId);
|
|
487
|
-
const folderNodes = useFolderChildNodesForId(driveOrFolderId);
|
|
375
|
+
Sets the selected timeline revision.
|
|
488
376
|
|
|
489
|
-
|
|
490
|
-
<div>
|
|
491
|
-
<FilesAndFolders nodes={nodes}>
|
|
492
|
-
<Files fileNodes={fileNodes}>
|
|
493
|
-
<Folders folderNodes={folderNodes}>
|
|
494
|
-
</div>
|
|
495
|
-
)
|
|
496
|
-
}
|
|
497
|
-
```
|
|
377
|
+
### `addSelectedTimelineRevisionEventHandler`
|
|
498
378
|
|
|
499
|
-
|
|
379
|
+
Adds an event handler for the selected timeline revision.
|
|
500
380
|
|
|
501
|
-
|
|
502
|
-
function useNodeName(id: string | null | undefined): string | undefined;
|
|
503
|
-
```
|
|
381
|
+
---
|
|
504
382
|
|
|
505
|
-
|
|
383
|
+
## Use Get Switchboard Link
|
|
506
384
|
|
|
507
|
-
|
|
508
|
-
function useNodeKind(id: string | null | undefined): NodeKind | undefined;
|
|
509
|
-
```
|
|
385
|
+
### `useGetSwitchboardLink`
|
|
510
386
|
|
|
511
|
-
|
|
387
|
+
Hook that returns a function to generate a document's switchboard URL.
|
|
388
|
+
Only returns a function for documents in remote drives.
|
|
389
|
+
Returns null for local drives or when the document/drive cannot be determined.
|
|
512
390
|
|
|
513
|
-
|
|
391
|
+
The returned function generates a fresh bearer token and builds the switchboard URL
|
|
392
|
+
with authentication when called.
|
|
514
393
|
|
|
515
|
-
|
|
516
|
-
|
|
394
|
+
**Parameters:**
|
|
395
|
+
- `document` - The document to create a switchboard URL generator for
|
|
517
396
|
|
|
518
|
-
function
|
|
519
|
-
const nodeId = "some-node-id";
|
|
520
|
-
const nodeName = useNodeName(nodeId);
|
|
521
|
-
const nodeKind = useNodeKind(nodeId);
|
|
397
|
+
**Returns:** An async function that returns the switchboard URL, or null if not applicable
|
|
522
398
|
|
|
523
|
-
|
|
524
|
-
return <File name={nodeName} />;
|
|
525
|
-
}
|
|
399
|
+
---
|
|
526
400
|
|
|
527
|
-
|
|
528
|
-
return <Folder name={nodeName} />;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
```
|
|
401
|
+
## Vetra Packages
|
|
532
402
|
|
|
533
|
-
###
|
|
403
|
+
### `useVetraPackages`
|
|
534
404
|
|
|
535
|
-
|
|
405
|
+
Returns all of the Vetra packages loaded by the Connect instance.
|
|
536
406
|
|
|
537
|
-
|
|
407
|
+
### `addVetraPackagesEventHandler`
|
|
538
408
|
|
|
539
|
-
|
|
540
|
-
- editors
|
|
541
|
-
- subgraphs
|
|
542
|
-
- import scripts
|
|
543
|
-
- processors
|
|
409
|
+
Adds the Vetra packages event handler.
|
|
544
410
|
|
|
545
|
-
|
|
411
|
+
### `setVetraPackages`
|
|
546
412
|
|
|
547
|
-
|
|
413
|
+
Sets the Vetra packages for the Connect instance.
|
|
548
414
|
|
|
549
|
-
|
|
550
|
-
function useVetraPackages(): VetraPackage[] | undefined;
|
|
551
|
-
```
|
|
415
|
+
---
|
|
552
416
|
|
|
553
|
-
Returns all of the Vetra packages in your Connect app.
|
|
554
417
|
|
|
555
|
-
|
|
418
|
+
## Config: Editor
|
|
556
419
|
|
|
557
|
-
|
|
558
|
-
import { useVetraPackages } from "@powerhousedao/state";
|
|
420
|
+
### `setIsExternalControlsEnabled`
|
|
559
421
|
|
|
560
|
-
|
|
561
|
-
const vetraPackages = useVetraPackages();
|
|
562
|
-
}
|
|
563
|
-
```
|
|
422
|
+
Sets whether external controls are enabled for a given editor.
|
|
564
423
|
|
|
565
|
-
|
|
424
|
+
### `useIsExternalControlsEnabled`
|
|
566
425
|
|
|
567
|
-
|
|
568
|
-
function useDocumentModelModules(): DocumentModelModule[] | undefined;
|
|
569
|
-
```
|
|
426
|
+
Gets whether external controls are enabled for a given editor.
|
|
570
427
|
|
|
571
|
-
|
|
428
|
+
### `addIsExternalControlsEnabledEventHandler`
|
|
572
429
|
|
|
573
|
-
|
|
430
|
+
Adds an event handler for when the external controls enabled state changes.
|
|
574
431
|
|
|
575
|
-
|
|
576
|
-
import { useDocumentModelModules } from "@powerhousedao/state";
|
|
432
|
+
### `setIsDragAndDropEnabled`
|
|
577
433
|
|
|
578
|
-
|
|
579
|
-
const documentModelModules = useDocumentModelModules();
|
|
580
|
-
}
|
|
581
|
-
```
|
|
434
|
+
Sets whether drag and drop is enabled for a given drive editor.
|
|
582
435
|
|
|
583
|
-
|
|
436
|
+
### `useIsDragAndDropEnabled`
|
|
584
437
|
|
|
585
|
-
|
|
586
|
-
function useDocumentModelModuleById(): DocumentModelModule[] | undefined;
|
|
587
|
-
```
|
|
438
|
+
Gets whether drag and drop is enabled for a given drive editor.
|
|
588
439
|
|
|
589
|
-
|
|
590
|
-
_NOTE_ What we call here an id is really the value in the "document type" field in the document model editor
|
|
591
|
-
_NOTE_ Connect assumes that these document types (ids) are unique. It is your responsibility to enforce this.
|
|
440
|
+
### `addIsDragAndDropEnabledEventHandler`
|
|
592
441
|
|
|
593
|
-
|
|
442
|
+
Adds an event handler for when the drag and drop enabled state changes.
|
|
594
443
|
|
|
595
|
-
|
|
596
|
-
import { useDocumentModelModuleById } from "@powerhousedao/state";
|
|
444
|
+
### `setAllowedDocumentTypes`
|
|
597
445
|
|
|
598
|
-
|
|
599
|
-
const documentType = "my-org/my-document";
|
|
600
|
-
const documentModelModuleById = useDocumentModelModuleById(documentType);
|
|
601
|
-
}
|
|
602
|
-
```
|
|
446
|
+
Sets the allowed document types for a given drive editor.
|
|
603
447
|
|
|
604
|
-
|
|
448
|
+
### `useAllowedDocumentTypes`
|
|
605
449
|
|
|
606
|
-
|
|
607
|
-
function useEditorModules(): EditorModule[] | undefined;
|
|
608
|
-
```
|
|
450
|
+
Defines the document types a drive supports.
|
|
609
451
|
|
|
610
|
-
|
|
452
|
+
Defaults to all of the document types registered in the reactor.
|
|
611
453
|
|
|
612
|
-
|
|
454
|
+
### `addAllowedDocumentTypesEventHandler`
|
|
613
455
|
|
|
614
|
-
|
|
615
|
-
import { useEditorModules } from "@powerhousedao/state";
|
|
456
|
+
Adds an event handler for when the allowed document types for a given drive editor changes.
|
|
616
457
|
|
|
617
|
-
|
|
618
|
-
const editorModules = useEditorModules();
|
|
619
|
-
}
|
|
620
|
-
```
|
|
458
|
+
---
|
|
621
459
|
|
|
622
|
-
|
|
460
|
+
## Config: Set Config by Object
|
|
623
461
|
|
|
624
|
-
|
|
625
|
-
function useDriveEditorModules(): DriveEditorModule[] | undefined;
|
|
626
|
-
```
|
|
462
|
+
### `setPHDriveEditorConfig`
|
|
627
463
|
|
|
628
|
-
|
|
464
|
+
Sets the global drive config.
|
|
629
465
|
|
|
630
|
-
|
|
466
|
+
Pass in a partial object of the global drive config to set.
|
|
631
467
|
|
|
632
|
-
|
|
633
|
-
import { useDriveEditorModules } from "@powerhousedao/state";
|
|
468
|
+
### `setPHDocumentEditorConfig`
|
|
634
469
|
|
|
635
|
-
|
|
636
|
-
const driveEditorModules = useDriveEditorModules();
|
|
637
|
-
}
|
|
638
|
-
```
|
|
470
|
+
Sets the global document config.
|
|
639
471
|
|
|
640
|
-
|
|
472
|
+
Pass in a partial object of the global document config to set.
|
|
641
473
|
|
|
642
|
-
|
|
643
|
-
function useProcessorModules(): ProcessorModule[] | undefined;
|
|
644
|
-
```
|
|
474
|
+
### `useSetPHDriveEditorConfig`
|
|
645
475
|
|
|
646
|
-
|
|
476
|
+
Wrapper hook for setting the global drive editor config.
|
|
647
477
|
|
|
648
|
-
|
|
478
|
+
Automatically sets the global drive editor config when the component mounts.
|
|
649
479
|
|
|
650
|
-
|
|
651
|
-
import { useProcessorModules } from "@powerhousedao/state";
|
|
480
|
+
Pass in a partial object of the global drive editor config to set.
|
|
652
481
|
|
|
653
|
-
|
|
654
|
-
const processorModules = useProcessorModules();
|
|
655
|
-
}
|
|
656
|
-
```
|
|
482
|
+
### `useSetPHDocumentEditorConfig`
|
|
657
483
|
|
|
658
|
-
|
|
484
|
+
Wrapper hook for setting the global document editor config.
|
|
659
485
|
|
|
660
|
-
|
|
661
|
-
function useSubgraphModules(): SubgraphModule[] | undefined;
|
|
662
|
-
```
|
|
486
|
+
Automatically sets the global document editor config when the component mounts.
|
|
663
487
|
|
|
664
|
-
|
|
488
|
+
Pass in a partial object of the global document editor config to set.
|
|
665
489
|
|
|
666
|
-
|
|
490
|
+
---
|
|
667
491
|
|
|
668
|
-
|
|
669
|
-
import { useSubgraphModules } from "@powerhousedao/state";
|
|
492
|
+
## Config: Use Value by Key
|
|
670
493
|
|
|
671
|
-
|
|
672
|
-
const subgraphModules = useSubgraphModules();
|
|
673
|
-
}
|
|
674
|
-
```
|
|
494
|
+
### `usePHDriveEditorConfigByKey`
|
|
675
495
|
|
|
676
|
-
|
|
496
|
+
Gets the value of an item in the global drive config for a given key.
|
|
677
497
|
|
|
678
|
-
|
|
679
|
-
function useImportScriptModules(): ImportScriptModule[] | undefined;
|
|
680
|
-
```
|
|
498
|
+
Strongly typed, inferred from type definition for the key.
|
|
681
499
|
|
|
682
|
-
|
|
500
|
+
### `usePHDocumentEditorConfigByKey`
|
|
683
501
|
|
|
684
|
-
|
|
502
|
+
Gets the value of an item in the global document config for a given key.
|
|
685
503
|
|
|
686
|
-
|
|
687
|
-
import { useImportScriptModules } from "@powerhousedao/state";
|
|
504
|
+
Strongly typed, inferred from type definition for the key.
|
|
688
505
|
|
|
689
|
-
|
|
690
|
-
const importScriptModules = useImportScriptModules();
|
|
691
|
-
}
|
|
692
|
-
```
|
|
506
|
+
---
|