@powerhousedao/academy 5.0.0-staging.8 → 5.0.1-staging.2
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/.vscode/settings.json +1 -1
- package/CHANGELOG.md +404 -0
- package/README.md +3 -3
- package/babel.config.js +1 -1
- package/blog/BeyondCommunication-ABlueprintForDevelopment.md +25 -24
- package/blog/TheChallengeOfChange.md +21 -21
- package/docs/academy/01-GetStarted/00-ExploreDemoPackage.mdx +67 -30
- package/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md +38 -21
- package/docs/academy/01-GetStarted/02-DefineToDoListDocumentModel.md +24 -19
- package/docs/academy/01-GetStarted/03-ImplementOperationReducers.md +44 -41
- package/docs/academy/01-GetStarted/04-BuildToDoListEditor.md +10 -10
- package/docs/academy/01-GetStarted/05-VetraStudio.md +164 -0
- package/docs/academy/01-GetStarted/06-ReactorMCP.md +58 -0
- package/docs/academy/01-GetStarted/home.mdx +185 -90
- package/docs/academy/01-GetStarted/images/Modules.png +0 -0
- package/docs/academy/01-GetStarted/images/VetraStudioDrive.png +0 -0
- package/docs/academy/01-GetStarted/styles.module.css +5 -5
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md +46 -18
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md +118 -68
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/03-BuilderTools.md +75 -33
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/_category_.json +6 -6
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/01-WhatIsADocumentModel.md +30 -21
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/02-SpecifyTheStateSchema.md +41 -37
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/03-SpecifyDocumentOperations.md +29 -25
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/04-UseTheDocumentModelGenerator.md +36 -37
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/05-ImplementDocumentReducers.md +128 -109
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/06-ImplementDocumentModelTests.md +95 -86
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/07-ExampleToDoListRepository.md +7 -9
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/_category_.json +6 -6
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/01-BuildingDocumentEditors.md +65 -47
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/02-ConfiguringDrives.md +77 -62
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +360 -349
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/00-DocumentToolbar.mdx +16 -10
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/01-OperationHistory.md +10 -7
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/02-RevisionHistoryTimeline.md +25 -17
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/_category_.json +6 -6
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-Authorization/01-RenownAuthenticationFlow.md +14 -7
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-Authorization/02-Authorization.md +0 -1
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-Authorization/_category_.json +5 -5
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/_category_.json +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/01-GraphQLAtPowerhouse.md +45 -33
- package/docs/academy/02-MasteryTrack/04-WorkWithData/02-UsingTheAPI.mdx +61 -18
- package/docs/academy/02-MasteryTrack/04-WorkWithData/03-UsingSubgraphs.md +50 -54
- package/docs/academy/02-MasteryTrack/04-WorkWithData/04-analytics-processor.md +126 -110
- package/docs/academy/02-MasteryTrack/04-WorkWithData/05-RelationalDbProcessor.md +75 -45
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/GraphQL References/QueryingADocumentWithGraphQL.md +23 -21
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/best-practices.md +9 -9
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/graphql/index.md +11 -23
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/graphql/integration.md +25 -9
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/intro.md +10 -10
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/benchmarks.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/index.md +16 -11
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/memory.md +6 -5
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/schema.md +2 -2
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/utilities.md +7 -5
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/use-cases/maker.md +32 -58
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/use-cases/processors.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/07-drive-analytics.md +105 -71
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_01-SetupBuilderEnvironment.md +22 -0
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_02-CreateNewPowerhouseProject.md +9 -8
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_03-GenerateAnAnalyticsProcessor.md +28 -32
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_04-UpdateAnalyticsProcessor.md +25 -26
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_category_.json +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_category_.json +7 -7
- package/docs/academy/02-MasteryTrack/05-Launch/01-IntroductionToPackages.md +3 -4
- package/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md +69 -45
- package/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md +70 -40
- package/docs/academy/02-MasteryTrack/05-Launch/04-ConfigureEnvironment.md +1 -0
- package/docs/academy/02-MasteryTrack/05-Launch/_category_.json +7 -7
- package/docs/academy/02-MasteryTrack/_category_.json +6 -6
- package/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md +5 -3
- package/docs/academy/03-ExampleUsecases/Chatroom/03-DefineChatroomDocumentModel.md +38 -37
- package/docs/academy/03-ExampleUsecases/Chatroom/04-ImplementOperationReducers.md +45 -41
- package/docs/academy/03-ExampleUsecases/Chatroom/05-ImplementChatroomEditor.md +14 -14
- package/docs/academy/03-ExampleUsecases/Chatroom/06-LaunchALocalReactor.md +6 -6
- package/docs/academy/03-ExampleUsecases/Chatroom/_category_.json +1 -1
- package/docs/academy/04-APIReferences/00-PowerhouseCLI.md +104 -43
- package/docs/academy/04-APIReferences/01-ReactHooks.md +177 -129
- package/docs/academy/04-APIReferences/04-RelationalDatabase.md +121 -113
- package/docs/academy/04-APIReferences/05-PHDocumentMigrationGuide.md +48 -41
- package/docs/academy/04-APIReferences/_category_.json +6 -6
- package/docs/academy/05-Architecture/00-PowerhouseArchitecture.md +1 -2
- package/docs/academy/05-Architecture/01-WorkingWithTheReactor.md +11 -8
- package/docs/academy/05-Architecture/05-DocumentModelTheory/_category_.json +1 -1
- package/docs/academy/05-Architecture/_category_.json +6 -6
- package/docs/academy/06-ComponentLibrary/00-DocumentEngineering.md +25 -23
- package/docs/academy/06-ComponentLibrary/02-CreateCustomScalars.md +105 -93
- package/docs/academy/06-ComponentLibrary/03-IntegrateIntoAReactComponent.md +1 -0
- package/docs/academy/06-ComponentLibrary/_category_.json +7 -7
- package/docs/academy/07-Cookbook.md +268 -35
- package/docs/academy/08-Glossary.md +7 -1
- package/docs/bookofpowerhouse/01-Overview.md +2 -2
- package/docs/bookofpowerhouse/02-GeneralFrameworkAndPhilosophy.md +1 -7
- package/docs/bookofpowerhouse/03-PowerhouseSoftwareArchitecture.md +10 -7
- package/docs/bookofpowerhouse/04-DevelopmentApproaches.md +10 -4
- package/docs/bookofpowerhouse/05-SNOsandANewModelForOSSandPublicGoods.md +23 -30
- package/docs/bookofpowerhouse/06-SNOsInActionAndPlatformEconomies.md +0 -7
- package/docusaurus.config.ts +64 -66
- package/package.json +9 -7
- package/scripts/generate-combined-cli-docs.ts +43 -13
- package/sidebars.ts +2 -0
- package/src/components/HomepageFeatures/index.tsx +171 -78
- package/src/components/HomepageFeatures/styles.module.css +1 -2
- package/src/css/custom.css +89 -89
- package/src/pages/_archive-homepage.tsx +17 -16
- package/src/theme/DocCardList/index.tsx +9 -8
- package/static.json +6 -6
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# React Hooks
|
|
2
2
|
|
|
3
|
-
On this page we're providing an overview of the available hooks you can make use of as a builder.
|
|
3
|
+
On this page we're providing an overview of the available hooks you can make use of as a builder.
|
|
4
4
|
|
|
5
5
|
<details>
|
|
6
6
|
<summary>Need a refresher on React Hooks?</summary>
|
|
@@ -9,11 +9,13 @@ React Hooks allow you to use various React features directly within your functio
|
|
|
9
9
|
|
|
10
10
|
**What are Custom Hooks?**
|
|
11
11
|
A custom hook is a JavaScript function whose name starts with "use" and that calls other Hooks. They are used to:
|
|
12
|
+
|
|
12
13
|
- Reuse stateful logic between components.
|
|
13
14
|
- Abstract complex logic into a simpler interface.
|
|
14
15
|
- Isolate side effects, particularly those managed by `useEffect`.
|
|
15
16
|
|
|
16
17
|
**Key Built-in Hooks Examples:**
|
|
18
|
+
|
|
17
19
|
- `useState`: Lets a component "remember" information (state).
|
|
18
20
|
- `useEffect`: Lets a component perform side effects (e.g., data fetching, subscriptions, manually changing the DOM).
|
|
19
21
|
- `useContext`: Lets a component receive information from distant parent components without explicitly passing props through every level of the component tree.
|
|
@@ -22,6 +24,7 @@ A custom hook is a JavaScript function whose name starts with "use" and that cal
|
|
|
22
24
|
Hook names must always start with `use` followed by a capital letter (e.g., `useState`, `useOnlineStatus`).
|
|
23
25
|
|
|
24
26
|
**Rules of Hooks:**
|
|
27
|
+
|
|
25
28
|
1. **Only Call Hooks at the Top Level**: Don't call Hooks inside loops, conditions, or nested functions.
|
|
26
29
|
2. **Only Call Hooks from React Functions**: Call Hooks from React functional components or from custom Hooks.
|
|
27
30
|
|
|
@@ -42,46 +45,25 @@ Learn more about the [Drive Editors](/academy/MasteryTrack/BuildingUserExperienc
|
|
|
42
45
|
|
|
43
46
|
All of the data used by these hooks is ultimately derived from the `Reactor`, which manages the asynchronous eventually consistent state of drives and documents. Learn more about the [Reactor](/academy/Architecture/WorkingWithTheReactor)
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
### Selected drives, folders and documents
|
|
47
|
-
In the application, there are certain items that can be set as "selected".
|
|
48
|
-
|
|
49
|
-
- selected drive
|
|
50
|
-
- selected folder
|
|
51
|
-
- selected document
|
|
52
|
-
|
|
53
|
-
We provide hooks for getting the selected item for each:
|
|
54
|
-
|
|
55
|
-
`useSelectedDrive`
|
|
56
|
-
`useSelectedFolder`
|
|
57
|
-
`useSelectedDocument`
|
|
58
|
-
|
|
59
|
-
Folders and documents are part of a given drive, so they will both be undefined if the selected drive is undefined.
|
|
60
|
-
|
|
61
|
-
_Either_ a folder or a document can be selected but not both, so if one is defined then the other will be undefined.
|
|
62
|
-
|
|
63
|
-
To set the selected drive, we provide a function `setSelectedDrive` which takes either a `DocumentDriveDocument` or a `DocumentDriveDocument['header']['slug']`.
|
|
64
|
-
|
|
65
|
-
To set the selected document/folder, we provide a function `setSelectedNode` which returns a setter function which can be used for _both_ documents and folders. This function takes either a `Node` or a slug which can be the url slug or the node's id.
|
|
66
|
-
|
|
67
|
-
## Hooks
|
|
68
|
-
|
|
69
48
|
<details>
|
|
70
|
-
<summary>
|
|
49
|
+
<summary>useReactor</summary>
|
|
50
|
+
|
|
71
51
|
```ts
|
|
72
|
-
function useReactor(): Reactor | undefined
|
|
52
|
+
function useReactor(): Reactor | undefined;
|
|
73
53
|
```
|
|
74
54
|
|
|
75
|
-
Returns the reactor instance.
|
|
55
|
+
Returns the reactor instance.
|
|
76
56
|
|
|
77
57
|
Usage
|
|
58
|
+
|
|
78
59
|
```jsx
|
|
79
|
-
import { useReactor } from
|
|
60
|
+
import { useReactor } from "@powerhousedao/state";
|
|
80
61
|
|
|
81
62
|
function MyEditorComponent() {
|
|
82
63
|
const reactor = useReactor();
|
|
83
64
|
}
|
|
84
65
|
```
|
|
66
|
+
|
|
85
67
|
</details>
|
|
86
68
|
|
|
87
69
|
### Drives
|
|
@@ -90,26 +72,30 @@ function MyEditorComponent() {
|
|
|
90
72
|
<summary>useDrives</summary>
|
|
91
73
|
|
|
92
74
|
```ts
|
|
93
|
-
function useDrives(): DocumentDriveDocument[] | undefined
|
|
75
|
+
function useDrives(): DocumentDriveDocument[] | undefined;
|
|
94
76
|
```
|
|
77
|
+
|
|
95
78
|
Returns the drives for a reactor.
|
|
96
79
|
|
|
97
80
|
Usage
|
|
98
81
|
|
|
99
82
|
```jsx
|
|
100
|
-
import { useDrives } from
|
|
83
|
+
import { useDrives } from "@powerhousedao/state";
|
|
101
84
|
|
|
102
85
|
function MyEditorComponent() {
|
|
103
86
|
const drives = useDrives();
|
|
104
87
|
}
|
|
105
88
|
```
|
|
89
|
+
|
|
106
90
|
</details>
|
|
107
91
|
|
|
108
92
|
<details>
|
|
109
93
|
<summary>useDriveById</summary>
|
|
110
94
|
|
|
111
95
|
```ts
|
|
112
|
-
function useDriveById(
|
|
96
|
+
function useDriveById(
|
|
97
|
+
id: string | null | undefined,
|
|
98
|
+
): DocumentDriveDocument | undefined;
|
|
113
99
|
```
|
|
114
100
|
|
|
115
101
|
Returns a drive by id.
|
|
@@ -117,72 +103,80 @@ Returns a drive by id.
|
|
|
117
103
|
Usage
|
|
118
104
|
|
|
119
105
|
```jsx
|
|
120
|
-
import { useDriveById } from
|
|
106
|
+
import { useDriveById } from "@powerhousedao/state";
|
|
121
107
|
|
|
122
108
|
function MyEditorComponent() {
|
|
123
|
-
const driveById = useDriveById();
|
|
109
|
+
const driveById = useDriveById("some-id");
|
|
124
110
|
}
|
|
125
111
|
```
|
|
112
|
+
|
|
126
113
|
</details>
|
|
127
114
|
|
|
128
115
|
<details>
|
|
129
116
|
<summary>useSelectedDrive</summary>
|
|
130
117
|
|
|
131
118
|
```ts
|
|
132
|
-
function useSelectedDrive(): DocumentDriveDocument | undefined
|
|
119
|
+
function useSelectedDrive(): DocumentDriveDocument | undefined;
|
|
133
120
|
```
|
|
134
121
|
|
|
135
|
-
Returns the selected drive. You can
|
|
122
|
+
Returns the selected drive. You can set the selected drive with `setSelectedDrive`.
|
|
136
123
|
|
|
137
124
|
Usage
|
|
138
125
|
|
|
139
126
|
```jsx
|
|
140
|
-
import { useSelectedDrive } from
|
|
127
|
+
import { useSelectedDrive } from "@powerhousedao/state";
|
|
141
128
|
|
|
142
129
|
function MyEditorComponent() {
|
|
143
130
|
const selectedDrive = useSelectedDrive();
|
|
144
131
|
}
|
|
145
132
|
```
|
|
133
|
+
|
|
146
134
|
</details>
|
|
147
135
|
|
|
148
136
|
<details>
|
|
149
|
-
<summary>
|
|
137
|
+
<summary>Drive Properties Convenience Hooks</summary>
|
|
150
138
|
|
|
151
139
|
We provide hooks for accessing various properties on the drive object for your convenience. These use the above hooks to get a drive and then return properties in the object.
|
|
152
140
|
|
|
153
141
|
```ts
|
|
154
142
|
/** Returns the remote URL for a drive. */
|
|
155
|
-
function useDriveRemoteUrl(
|
|
143
|
+
function useDriveRemoteUrl(
|
|
144
|
+
driveId: string | null | undefined,
|
|
145
|
+
): string | undefined;
|
|
156
146
|
|
|
157
147
|
/** Returns the pull responder trigger for a drive. */
|
|
158
148
|
function useDrivePullResponderTrigger(
|
|
159
149
|
driveId: string | null | undefined,
|
|
160
|
-
): Trigger | undefined
|
|
150
|
+
): Trigger | undefined;
|
|
161
151
|
|
|
162
152
|
/** Returns the pull responder URL for a drive. */
|
|
163
|
-
function useDrivePullResponderUrl(
|
|
153
|
+
function useDrivePullResponderUrl(
|
|
154
|
+
driveId: string | null | undefined,
|
|
155
|
+
): string | undefined;
|
|
164
156
|
|
|
165
157
|
/** Returns whether a drive is remote. */
|
|
166
|
-
function useDriveIsRemote(driveId: string | null | undefined): boolean
|
|
158
|
+
function useDriveIsRemote(driveId: string | null | undefined): boolean;
|
|
167
159
|
|
|
168
160
|
/** Returns the sharing type for a drive. */
|
|
169
|
-
function useDriveSharingType(
|
|
161
|
+
function useDriveSharingType(
|
|
162
|
+
driveId: string | null | undefined,
|
|
163
|
+
): SharingType | undefined;
|
|
170
164
|
|
|
171
|
-
/** Returns
|
|
172
|
-
function useDriveAvailableOffline(driveId: string | null | undefined): boolean
|
|
165
|
+
/** Returns whether a drive is available offline. */
|
|
166
|
+
function useDriveAvailableOffline(driveId: string | null | undefined): boolean;
|
|
173
167
|
```
|
|
174
168
|
|
|
175
169
|
Usage
|
|
176
170
|
|
|
177
171
|
```jsx
|
|
178
|
-
import {
|
|
172
|
+
import {
|
|
179
173
|
useDriveRemoteUrl,
|
|
180
174
|
useDrivePullResponderTrigger,
|
|
181
175
|
useDrivePullResponderUrl,
|
|
182
176
|
useDriveIsRemote,
|
|
183
177
|
useDriveSharingType,
|
|
184
178
|
useDriveAvailableOffline,
|
|
185
|
-
} from
|
|
179
|
+
} from "@powerhousedao/state";
|
|
186
180
|
|
|
187
181
|
function MyEditorComponent() {
|
|
188
182
|
const myDriveId = "some-drive-id";
|
|
@@ -200,9 +194,10 @@ function MyEditorComponent() {
|
|
|
200
194
|
driveIsRemote,
|
|
201
195
|
driveSharingType,
|
|
202
196
|
driveAvailableOffline,
|
|
203
|
-
})
|
|
197
|
+
});
|
|
204
198
|
}
|
|
205
199
|
```
|
|
200
|
+
|
|
206
201
|
</details>
|
|
207
202
|
|
|
208
203
|
### Documents
|
|
@@ -211,64 +206,74 @@ function MyEditorComponent() {
|
|
|
211
206
|
<summary>useAllDocuments/useSelectedDriveDocuments</summary>
|
|
212
207
|
|
|
213
208
|
```ts
|
|
214
|
-
function useAllDocuments(): PHDocument[] | undefined
|
|
209
|
+
function useAllDocuments(): PHDocument[] | undefined;
|
|
215
210
|
```
|
|
211
|
+
|
|
216
212
|
Returns all of the documents in the reactor.
|
|
217
213
|
|
|
218
214
|
```ts
|
|
219
|
-
function useSelectedDriveDocuments(): PHDocument[] | undefined
|
|
215
|
+
function useSelectedDriveDocuments(): PHDocument[] | undefined;
|
|
220
216
|
```
|
|
217
|
+
|
|
221
218
|
Returns the documents in the reactor for the selected drive.
|
|
222
219
|
|
|
223
220
|
Usage
|
|
224
221
|
|
|
225
222
|
```jsx
|
|
226
|
-
import {
|
|
223
|
+
import {
|
|
224
|
+
useAllDocuments,
|
|
225
|
+
useSelectedDriveDocuments,
|
|
226
|
+
} from "@powerhousedao/state";
|
|
227
227
|
|
|
228
228
|
function MyEditorComponent() {
|
|
229
229
|
const allDocuments = useAllDocuments();
|
|
230
230
|
const selectedDriveDocuments = useSelectedDriveDocuments();
|
|
231
231
|
}
|
|
232
232
|
```
|
|
233
|
+
|
|
233
234
|
</details>
|
|
234
235
|
|
|
235
236
|
<details>
|
|
236
237
|
<summary>useSelectedDocument</summary>
|
|
237
238
|
|
|
238
239
|
```ts
|
|
239
|
-
function useSelectedDocument(): PHDocument | undefined
|
|
240
|
+
function useSelectedDocument(): PHDocument | undefined;
|
|
240
241
|
```
|
|
242
|
+
|
|
241
243
|
Returns the selected document. You can set the selected document with `setSelectedNode`.
|
|
242
244
|
|
|
243
245
|
Usage
|
|
244
246
|
|
|
245
247
|
```jsx
|
|
246
|
-
import { useSelectedDocument } from
|
|
248
|
+
import { useSelectedDocument } from "@powerhousedao/state";
|
|
247
249
|
|
|
248
250
|
function MyEditorComponent() {
|
|
249
251
|
const selectedDocument = useSelectedDocument();
|
|
250
252
|
}
|
|
251
253
|
```
|
|
254
|
+
|
|
252
255
|
</details>
|
|
253
256
|
|
|
254
257
|
<details>
|
|
255
258
|
<summary>useDocumentById</summary>
|
|
256
259
|
|
|
257
260
|
```ts
|
|
258
|
-
function useDocumentById(id: string | null | undefined): PHDocument | undefined
|
|
261
|
+
function useDocumentById(id: string | null | undefined): PHDocument | undefined;
|
|
259
262
|
```
|
|
263
|
+
|
|
260
264
|
Returns a document by id.
|
|
261
265
|
|
|
262
266
|
Usage
|
|
263
267
|
|
|
264
268
|
```jsx
|
|
265
|
-
import { useDocumentById } from
|
|
269
|
+
import { useDocumentById } from "@powerhousedao/state";
|
|
266
270
|
|
|
267
271
|
function MyEditorComponent() {
|
|
268
|
-
const myDocumentId =
|
|
272
|
+
const myDocumentId = "some-document-id";
|
|
269
273
|
const documentById = useDocumentById(myDocumentId);
|
|
270
274
|
}
|
|
271
275
|
```
|
|
276
|
+
|
|
272
277
|
</details>
|
|
273
278
|
|
|
274
279
|
### Nodes
|
|
@@ -288,14 +293,14 @@ type FileNode = {
|
|
|
288
293
|
kind: string;
|
|
289
294
|
name: string;
|
|
290
295
|
parentFolder: string | null | undefined;
|
|
291
|
-
}
|
|
296
|
+
};
|
|
292
297
|
|
|
293
298
|
type FolderNode = {
|
|
294
299
|
id: string;
|
|
295
300
|
kind: string;
|
|
296
301
|
name: string;
|
|
297
302
|
parentFolder: string | null | undefined;
|
|
298
|
-
}
|
|
303
|
+
};
|
|
299
304
|
|
|
300
305
|
type Node = FileNode | FolderNode;
|
|
301
306
|
```
|
|
@@ -306,194 +311,224 @@ type Node = FileNode | FolderNode;
|
|
|
306
311
|
Ideally you should not need to handle the list of nodes directly, since we already provide documents and folders. But these hooks are provided just in case.
|
|
307
312
|
|
|
308
313
|
```ts
|
|
309
|
-
function useNodes(): Node[] | undefined
|
|
314
|
+
function useNodes(): Node[] | undefined;
|
|
310
315
|
```
|
|
316
|
+
|
|
311
317
|
Returns the nodes for a drive.
|
|
312
318
|
|
|
313
319
|
Usage
|
|
314
320
|
|
|
315
321
|
```jsx
|
|
316
|
-
import { useNodes} from
|
|
322
|
+
import { useNodes } from "@powerhousedao/state";
|
|
317
323
|
|
|
318
324
|
function MyEditorComponent() {
|
|
319
325
|
const nodes = useNodes();
|
|
320
326
|
}
|
|
321
327
|
```
|
|
328
|
+
|
|
322
329
|
</details>
|
|
323
330
|
|
|
324
331
|
<details>
|
|
325
332
|
<summary>useNodeById</summary>
|
|
326
333
|
|
|
327
334
|
```ts
|
|
328
|
-
function useNodeById(id: string | null | undefined): Node | undefined
|
|
335
|
+
function useNodeById(id: string | null | undefined): Node | undefined;
|
|
329
336
|
```
|
|
337
|
+
|
|
330
338
|
Returns a node in the selected drive by id.
|
|
331
339
|
|
|
332
340
|
Usage
|
|
333
341
|
|
|
334
342
|
```jsx
|
|
335
|
-
import { useNodeById } from
|
|
343
|
+
import { useNodeById } from "@powerhousedao/state";
|
|
336
344
|
|
|
337
345
|
function MyEditorComponent() {
|
|
338
|
-
const myFolderId =
|
|
339
|
-
const myDocumentId =
|
|
346
|
+
const myFolderId = "some-folder-id";
|
|
347
|
+
const myDocumentId = "some-document-id";
|
|
340
348
|
const myFolderNode = useNodeById(myFolderId);
|
|
341
349
|
const myFileNode = useNodeById(myDocumentId);
|
|
342
350
|
}
|
|
343
351
|
```
|
|
352
|
+
|
|
344
353
|
</details>
|
|
345
354
|
|
|
346
355
|
<details>
|
|
347
356
|
<summary>useSelectedFolder</summary>
|
|
348
357
|
|
|
349
358
|
```ts
|
|
350
|
-
function useSelectedFolder(): FolderNode | undefined
|
|
359
|
+
function useSelectedFolder(): FolderNode | undefined;
|
|
351
360
|
```
|
|
361
|
+
|
|
352
362
|
Returns the selected folder. You can set the selected folder with `setSelectedNode`
|
|
353
363
|
|
|
354
364
|
Usage
|
|
355
365
|
|
|
356
366
|
```jsx
|
|
357
|
-
import { useSelectedFolder } from
|
|
367
|
+
import { useSelectedFolder } from "@powerhousedao/state";
|
|
358
368
|
|
|
359
369
|
function MyEditorComponent() {
|
|
360
370
|
const selectedFolder = useSelectedFolder();
|
|
361
371
|
}
|
|
362
372
|
```
|
|
373
|
+
|
|
363
374
|
</details>
|
|
364
375
|
|
|
365
376
|
<details>
|
|
366
377
|
<summary>useSelectedNodePath</summary>
|
|
367
378
|
|
|
368
379
|
```ts
|
|
369
|
-
function useSelectedNodePath(): Node[]
|
|
380
|
+
function useSelectedNodePath(): Node[];
|
|
370
381
|
```
|
|
382
|
+
|
|
371
383
|
Returns the path to the selected node. Useful for navigational components like breadcrumbs.
|
|
372
384
|
|
|
373
385
|
Usage
|
|
374
386
|
|
|
375
387
|
```jsx
|
|
376
|
-
import { useSelectedNodePath } from
|
|
388
|
+
import { useSelectedNodePath } from "@powerhousedao/state";
|
|
377
389
|
|
|
378
390
|
function MyEditorComponent() {
|
|
379
391
|
const nodes = useSelectedNodePath();
|
|
380
392
|
|
|
381
|
-
return <Breadcrumbs nodes={nodes}
|
|
393
|
+
return <Breadcrumbs nodes={nodes} />;
|
|
382
394
|
}
|
|
383
395
|
```
|
|
396
|
+
|
|
384
397
|
</details>
|
|
385
398
|
|
|
386
399
|
<details>
|
|
387
400
|
<summary>useChildNodes/useFolderChildNodes/useFileChildNodes</summary>
|
|
388
401
|
|
|
389
402
|
```ts
|
|
390
|
-
function useChildNodes(): Node[]
|
|
403
|
+
function useChildNodes(): Node[];
|
|
391
404
|
```
|
|
405
|
+
|
|
392
406
|
Returns the child nodes for the selected drive or folder.
|
|
393
407
|
|
|
394
408
|
```ts
|
|
395
|
-
function useFolderChildNodes(): FolderNode[]
|
|
409
|
+
function useFolderChildNodes(): FolderNode[];
|
|
396
410
|
```
|
|
411
|
+
|
|
397
412
|
Returns the folder child nodes for the selected drive or folder.
|
|
398
413
|
|
|
399
414
|
```ts
|
|
400
|
-
function useFileChildNodes(): FileNode[]
|
|
415
|
+
function useFileChildNodes(): FileNode[];
|
|
401
416
|
```
|
|
417
|
+
|
|
402
418
|
Returns the file (document) child nodes for the selected drive or folder.
|
|
403
419
|
|
|
404
420
|
Usage
|
|
405
421
|
|
|
406
422
|
```jsx
|
|
407
|
-
import {
|
|
423
|
+
import {
|
|
424
|
+
useChildNodes,
|
|
425
|
+
useFolderChildNodes,
|
|
426
|
+
useFileChildNodes,
|
|
427
|
+
} from "@powerhousedao/state";
|
|
408
428
|
|
|
409
429
|
function MyEditorComponent() {
|
|
410
430
|
const nodes = useChildNodes();
|
|
411
|
-
const fileNodes =
|
|
412
|
-
const folderNodes =
|
|
431
|
+
const fileNodes = useFileChildNodes();
|
|
432
|
+
const folderNodes = useFolderChildNodes();
|
|
413
433
|
|
|
414
434
|
return (
|
|
415
435
|
<div>
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
436
|
+
<FilesAndFolders nodes={nodes} />
|
|
437
|
+
<Files fileNodes={fileNodes} />
|
|
438
|
+
<Folders folderNodes={folderNodes} />
|
|
419
439
|
</div>
|
|
420
|
-
|
|
440
|
+
);
|
|
421
441
|
}
|
|
422
442
|
```
|
|
443
|
+
|
|
423
444
|
</details>
|
|
424
445
|
|
|
425
446
|
<details>
|
|
426
447
|
<summary>useChildNodesForId/useFolderChildNodesForId/useFileChildNodesForId</summary>
|
|
427
448
|
|
|
428
449
|
```ts
|
|
429
|
-
function useChildNodesForId(id: string | null | undefined): Node[]
|
|
450
|
+
function useChildNodesForId(id: string | null | undefined): Node[];
|
|
430
451
|
```
|
|
452
|
+
|
|
431
453
|
Returns the child nodes for a drive or folder by id.
|
|
454
|
+
|
|
432
455
|
```ts
|
|
433
|
-
function useFolderChildNodesForId(id: string | null | undefined): FolderNode[]
|
|
456
|
+
function useFolderChildNodesForId(id: string | null | undefined): FolderNode[];
|
|
434
457
|
```
|
|
458
|
+
|
|
435
459
|
Returns the folder child nodes for a drive or folder by id.
|
|
460
|
+
|
|
436
461
|
```ts
|
|
437
|
-
function useFileChildNodesForId(id: string | null | undefined): FileNode[]
|
|
462
|
+
function useFileChildNodesForId(id: string | null | undefined): FileNode[];
|
|
438
463
|
```
|
|
464
|
+
|
|
439
465
|
Returns the file (document) child nodes for a drive or folder by id.
|
|
440
466
|
|
|
441
467
|
Usage
|
|
442
468
|
|
|
443
469
|
```jsx
|
|
444
|
-
import {
|
|
470
|
+
import {
|
|
471
|
+
useChildNodesForId,
|
|
472
|
+
useFolderChildNodesForId,
|
|
473
|
+
useFileChildNodesForId,
|
|
474
|
+
} from "@powerhousedao/state";
|
|
445
475
|
|
|
446
476
|
function MyEditorComponent() {
|
|
447
|
-
const driveOrFolderId =
|
|
477
|
+
const driveOrFolderId = "some-drive-or-folder-id";
|
|
448
478
|
const nodes = useChildNodesForId(driveOrFolderId);
|
|
449
479
|
const fileNodes = useFileChildNodesForId(driveOrFolderId);
|
|
450
480
|
const folderNodes = useFolderChildNodesForId(driveOrFolderId);
|
|
451
481
|
|
|
452
482
|
return (
|
|
453
483
|
<div>
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
484
|
+
<FilesAndFolders nodes={nodes} />
|
|
485
|
+
<Files fileNodes={fileNodes} />
|
|
486
|
+
<Folders folderNodes={folderNodes} />
|
|
457
487
|
</div>
|
|
458
|
-
|
|
488
|
+
);
|
|
459
489
|
}
|
|
460
490
|
```
|
|
491
|
+
|
|
461
492
|
</details>
|
|
462
493
|
|
|
463
494
|
<details>
|
|
464
495
|
<summary>useNodeName/useNodeKind</summary>
|
|
465
496
|
|
|
466
497
|
```ts
|
|
467
|
-
function useNodeName(id: string | null | undefined): string | undefined
|
|
498
|
+
function useNodeName(id: string | null | undefined): string | undefined;
|
|
468
499
|
```
|
|
500
|
+
|
|
469
501
|
Returns the name of a node.
|
|
502
|
+
|
|
470
503
|
```ts
|
|
471
|
-
function useNodeKind(id: string | null | undefined): NodeKind | undefined
|
|
504
|
+
function useNodeKind(id: string | null | undefined): NodeKind | undefined;
|
|
472
505
|
```
|
|
506
|
+
|
|
473
507
|
Returns the kind of a node.
|
|
474
508
|
|
|
475
509
|
Usage
|
|
476
510
|
|
|
477
511
|
```jsx
|
|
478
|
-
import { useNodeName, useNodeKind } from
|
|
512
|
+
import { useNodeName, useNodeKind } from "@powerhousedao/state";
|
|
479
513
|
|
|
480
514
|
function MyEditorComponent() {
|
|
481
|
-
const nodeId =
|
|
515
|
+
const nodeId = "some-node-id";
|
|
482
516
|
const nodeName = useNodeName(nodeId);
|
|
483
517
|
const nodeKind = useNodeKind(nodeId);
|
|
484
518
|
|
|
485
|
-
if (nodeKind ===
|
|
519
|
+
if (nodeKind === "file") {
|
|
486
520
|
return <File name={nodeName} />;
|
|
487
521
|
}
|
|
488
522
|
|
|
489
|
-
if (nodeKind ===
|
|
523
|
+
if (nodeKind === "folder") {
|
|
490
524
|
return <Folder name={nodeName} />;
|
|
491
525
|
}
|
|
492
526
|
}
|
|
493
527
|
```
|
|
528
|
+
|
|
494
529
|
</details>
|
|
495
530
|
|
|
496
|
-
### Vetra
|
|
531
|
+
### Vetra Packages and Modules
|
|
497
532
|
|
|
498
533
|
Vetra packages hold code which can plug into your Connect application. This includes common default modules like the document model document model editor and document drive document model, as well as the modules from your local project and the various packages you have installed.
|
|
499
534
|
|
|
@@ -511,7 +546,7 @@ Each Vetra package contains a `modules` field which optionally contains lists of
|
|
|
511
546
|
<summary>useVetraPackages</summary>
|
|
512
547
|
|
|
513
548
|
```ts
|
|
514
|
-
function useVetraPackages(): VetraPackage[] | undefined
|
|
549
|
+
function useVetraPackages(): VetraPackage[] | undefined;
|
|
515
550
|
```
|
|
516
551
|
|
|
517
552
|
Returns all of the Vetra packages in your Connect app.
|
|
@@ -519,19 +554,20 @@ Returns all of the Vetra packages in your Connect app.
|
|
|
519
554
|
Usage
|
|
520
555
|
|
|
521
556
|
```jsx
|
|
522
|
-
import { useVetraPackages } from
|
|
557
|
+
import { useVetraPackages } from "@powerhousedao/state";
|
|
523
558
|
|
|
524
559
|
function MyEditorComponent() {
|
|
525
|
-
const vetraPackages = useVetraPackages()
|
|
560
|
+
const vetraPackages = useVetraPackages();
|
|
526
561
|
}
|
|
527
562
|
```
|
|
563
|
+
|
|
528
564
|
</details>
|
|
529
565
|
|
|
530
566
|
<details>
|
|
531
567
|
<summary>useDocumentModelModules</summary>
|
|
532
568
|
|
|
533
569
|
```ts
|
|
534
|
-
function useDocumentModelModules(): DocumentModelModule[] | undefined
|
|
570
|
+
function useDocumentModelModules(): DocumentModelModule[] | undefined;
|
|
535
571
|
```
|
|
536
572
|
|
|
537
573
|
Returns the document model modules from your Vetra packages.
|
|
@@ -539,42 +575,44 @@ Returns the document model modules from your Vetra packages.
|
|
|
539
575
|
Usage
|
|
540
576
|
|
|
541
577
|
```jsx
|
|
542
|
-
import { useDocumentModelModules } from
|
|
578
|
+
import { useDocumentModelModules } from "@powerhousedao/state";
|
|
543
579
|
|
|
544
580
|
function MyEditorComponent() {
|
|
545
|
-
const documentModelModules = useDocumentModelModules()
|
|
581
|
+
const documentModelModules = useDocumentModelModules();
|
|
546
582
|
}
|
|
547
583
|
```
|
|
584
|
+
|
|
548
585
|
</details>
|
|
549
586
|
|
|
550
587
|
<details>
|
|
551
588
|
<summary>useDocumentModelModuleById</summary>
|
|
552
589
|
|
|
553
590
|
```ts
|
|
554
|
-
function useDocumentModelModuleById(): DocumentModelModule[] | undefined
|
|
591
|
+
function useDocumentModelModuleById(): DocumentModelModule[] | undefined;
|
|
555
592
|
```
|
|
556
593
|
|
|
557
594
|
Returns the document model for a given id (document type).
|
|
558
|
-
|
|
559
|
-
|
|
595
|
+
_NOTE_ What we call here an id is really the value in the "document type" field in the document model editor
|
|
596
|
+
_NOTE_ Connect assumes that these document types (ids) are unique. It is your responsibility to enforce this.
|
|
560
597
|
|
|
561
598
|
Usage
|
|
562
599
|
|
|
563
600
|
```jsx
|
|
564
|
-
import { useDocumentModelModuleById } from
|
|
601
|
+
import { useDocumentModelModuleById } from "@powerhousedao/state";
|
|
565
602
|
|
|
566
603
|
function MyEditorComponent() {
|
|
567
|
-
const documentType =
|
|
568
|
-
const documentModelModuleById = useDocumentModelModuleById(documentType)
|
|
604
|
+
const documentType = "my-org/my-document";
|
|
605
|
+
const documentModelModuleById = useDocumentModelModuleById(documentType);
|
|
569
606
|
}
|
|
570
607
|
```
|
|
608
|
+
|
|
571
609
|
</details>
|
|
572
610
|
|
|
573
611
|
<details>
|
|
574
612
|
<summary>useEditorModules</summary>
|
|
575
613
|
|
|
576
614
|
```ts
|
|
577
|
-
function useEditorModules(): EditorModule[] | undefined
|
|
615
|
+
function useEditorModules(): EditorModule[] | undefined;
|
|
578
616
|
```
|
|
579
617
|
|
|
580
618
|
Returns the editor modules from your Vetra packages.
|
|
@@ -582,19 +620,20 @@ Returns the editor modules from your Vetra packages.
|
|
|
582
620
|
Usage
|
|
583
621
|
|
|
584
622
|
```jsx
|
|
585
|
-
import { useEditorModules } from
|
|
623
|
+
import { useEditorModules } from "@powerhousedao/state";
|
|
586
624
|
|
|
587
625
|
function MyEditorComponent() {
|
|
588
|
-
const editorModules = useEditorModules()
|
|
626
|
+
const editorModules = useEditorModules();
|
|
589
627
|
}
|
|
590
628
|
```
|
|
629
|
+
|
|
591
630
|
</details>
|
|
592
631
|
|
|
593
632
|
<details>
|
|
594
633
|
<summary>useDriveEditorModules</summary>
|
|
595
634
|
|
|
596
635
|
```ts
|
|
597
|
-
function useDriveEditorModules(): DriveEditorModule[] | undefined
|
|
636
|
+
function useDriveEditorModules(): DriveEditorModule[] | undefined;
|
|
598
637
|
```
|
|
599
638
|
|
|
600
639
|
Returns the drive editor modules from your Vetra packages.
|
|
@@ -602,19 +641,20 @@ Returns the drive editor modules from your Vetra packages.
|
|
|
602
641
|
Usage
|
|
603
642
|
|
|
604
643
|
```jsx
|
|
605
|
-
import { useDriveEditorModules } from
|
|
644
|
+
import { useDriveEditorModules } from "@powerhousedao/state";
|
|
606
645
|
|
|
607
646
|
function MyDriveEditorComponent() {
|
|
608
|
-
const driveEditorModules = useDriveEditorModules()
|
|
647
|
+
const driveEditorModules = useDriveEditorModules();
|
|
609
648
|
}
|
|
610
649
|
```
|
|
650
|
+
|
|
611
651
|
</details>
|
|
612
652
|
|
|
613
653
|
<details>
|
|
614
654
|
<summary>useProcessorModules</summary>
|
|
615
655
|
|
|
616
656
|
```ts
|
|
617
|
-
function useProcessorModules(): ProcessorModule[] | undefined
|
|
657
|
+
function useProcessorModules(): ProcessorModule[] | undefined;
|
|
618
658
|
```
|
|
619
659
|
|
|
620
660
|
Returns the processor modules from your Vetra packages.
|
|
@@ -622,19 +662,20 @@ Returns the processor modules from your Vetra packages.
|
|
|
622
662
|
Usage
|
|
623
663
|
|
|
624
664
|
```jsx
|
|
625
|
-
import { useProcessorModules } from
|
|
665
|
+
import { useProcessorModules } from "@powerhousedao/state";
|
|
626
666
|
|
|
627
667
|
function MyProcessorComponent() {
|
|
628
|
-
const processorModules = useProcessorModules()
|
|
668
|
+
const processorModules = useProcessorModules();
|
|
629
669
|
}
|
|
630
670
|
```
|
|
671
|
+
|
|
631
672
|
</details>
|
|
632
673
|
|
|
633
674
|
<details>
|
|
634
675
|
<summary>useSubgraphModules</summary>
|
|
635
676
|
|
|
636
677
|
```ts
|
|
637
|
-
function useSubgraphModules(): SubgraphModule[] | undefined
|
|
678
|
+
function useSubgraphModules(): SubgraphModule[] | undefined;
|
|
638
679
|
```
|
|
639
680
|
|
|
640
681
|
Returns the subgraph modules from your Vetra packages.
|
|
@@ -642,19 +683,20 @@ Returns the subgraph modules from your Vetra packages.
|
|
|
642
683
|
Usage
|
|
643
684
|
|
|
644
685
|
```jsx
|
|
645
|
-
import { useSubgraphModules } from
|
|
686
|
+
import { useSubgraphModules } from "@powerhousedao/state";
|
|
646
687
|
|
|
647
688
|
function MySubgraphComponent() {
|
|
648
|
-
const subgraphModules = useSubgraphModules()
|
|
689
|
+
const subgraphModules = useSubgraphModules();
|
|
649
690
|
}
|
|
650
691
|
```
|
|
692
|
+
|
|
651
693
|
</details>
|
|
652
694
|
|
|
653
695
|
<details>
|
|
654
696
|
<summary>useImportScriptModules</summary>
|
|
655
697
|
|
|
656
698
|
```ts
|
|
657
|
-
function useImportScriptModules(): ImportScriptModule[] | undefined
|
|
699
|
+
function useImportScriptModules(): ImportScriptModule[] | undefined;
|
|
658
700
|
```
|
|
659
701
|
|
|
660
702
|
Returns the import script modules from your Vetra packages.
|
|
@@ -662,12 +704,13 @@ Returns the import script modules from your Vetra packages.
|
|
|
662
704
|
Usage
|
|
663
705
|
|
|
664
706
|
```jsx
|
|
665
|
-
import { useImportScriptModules } from
|
|
707
|
+
import { useImportScriptModules } from "@powerhousedao/state";
|
|
666
708
|
|
|
667
709
|
function MyImportScriptComponent() {
|
|
668
|
-
const importScriptModules = useImportScriptModules()
|
|
710
|
+
const importScriptModules = useImportScriptModules();
|
|
669
711
|
}
|
|
670
712
|
```
|
|
713
|
+
|
|
671
714
|
</details>
|
|
672
715
|
|
|
673
716
|
## More documentation coming soon!
|
|
@@ -676,25 +719,30 @@ Global access to drive state: A top-level, possibly context-based, way to intros
|
|
|
676
719
|
|
|
677
720
|
Global dispatcher access: A utility or API (probably a hook or service function) where they give a document ID and get back all the relevant dispatch functions — kind of like a command palette for document ops.
|
|
678
721
|
|
|
679
|
-
### Core Hooks & Patterns
|
|
722
|
+
### Core Hooks & Patterns
|
|
723
|
+
|
|
680
724
|
- useDocumentField
|
|
681
725
|
- useReadDocumentField
|
|
682
726
|
- useUpdateDocumentField
|
|
683
|
-
- useDocumentDispatch(docId):
|
|
727
|
+
- useDocumentDispatch(docId): updateX, delete, ...
|
|
728
|
+
|
|
729
|
+
### Global Drive Access
|
|
684
730
|
|
|
685
|
-
### Global Drive Access
|
|
686
731
|
- How to access and manipulate the global document tree
|
|
687
732
|
- How to inspect children from parent context
|
|
688
733
|
- Tree traversal utilities (if any)
|
|
689
734
|
|
|
690
|
-
### Convenience APIs
|
|
735
|
+
### Convenience APIs
|
|
736
|
+
|
|
691
737
|
- Utility functions like getDispatchFunctions(docId)
|
|
692
738
|
- "Quick Start" to manipulate any document like a pro
|
|
693
739
|
|
|
694
|
-
### Working with Context
|
|
740
|
+
### Working with Context
|
|
741
|
+
|
|
695
742
|
- DriveContext: what lives there, how to use it
|
|
696
743
|
- Example: using context to get current doc, sibling docs
|
|
697
744
|
|
|
698
|
-
### Best Practices & Patterns
|
|
745
|
+
### Best Practices & Patterns
|
|
746
|
+
|
|
699
747
|
- When to use useDocumentField vs getDispatch
|
|
700
|
-
- Composing document fields into custom logic
|
|
748
|
+
- Composing document fields into custom logic
|