@powerhousedao/vetra 5.0.0-staging.20 → 5.0.0-staging.21
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVetraDocument.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useVetraDocument.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useVetraDocument.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useVetraDocument.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,8CAA8C,CAAC;AAOtD,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,6GAKzE;AAED,wBAAgB,4BAA4B,8GAG3C;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,oMAMtC;AAED,wBAAgB,iCAAiC,qMAGhD;AAED,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,uMAMtC;AAED,wBAAgB,kCAAkC,wMAGjD;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,oMAMtC;AAED,wBAAgB,iCAAiC,qMAGhD;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,8LAK5E;AAED,wBAAgB,+BAA+B,+LAQ9C"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { useDocumentOfType, useSelectedDocumentId, } from "@powerhousedao/reactor-browser";
|
|
1
|
+
import { useDocumentOfType, useSelectedDocumentId, useSelectedDrive, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { isFileNode } from "document-drive";
|
|
3
|
+
const VETRA_PACKAGE_DOCUMENT_TYPE = "powerhouse/package";
|
|
4
|
+
const DOCUMENT_EDITOR_DOCUMENT_TYPE = "powerhouse/document-editor";
|
|
5
|
+
const SUBGRAPH_MODULE_DOCUMENT_TYPE = "powerhouse/subgraph";
|
|
6
|
+
const PROCESSOR_MODULE_DOCUMENT_TYPE = "powerhouse/processor";
|
|
2
7
|
export function useAppModuleDocument(documentId) {
|
|
3
8
|
return useDocumentOfType(documentId, "powerhouse/app");
|
|
4
9
|
}
|
|
@@ -7,31 +12,32 @@ export function useSelectedAppModuleDocument() {
|
|
|
7
12
|
return useAppModuleDocument(documentId);
|
|
8
13
|
}
|
|
9
14
|
export function useDocumentEditorDocument(documentId) {
|
|
10
|
-
return useDocumentOfType(documentId,
|
|
15
|
+
return useDocumentOfType(documentId, DOCUMENT_EDITOR_DOCUMENT_TYPE);
|
|
11
16
|
}
|
|
12
17
|
export function useSelectedDocumentEditorDocument() {
|
|
13
18
|
const documentId = useSelectedDocumentId();
|
|
14
19
|
return useDocumentEditorDocument(documentId);
|
|
15
20
|
}
|
|
16
21
|
export function useProcessorModuleDocument(documentId) {
|
|
17
|
-
return useDocumentOfType(documentId,
|
|
22
|
+
return useDocumentOfType(documentId, PROCESSOR_MODULE_DOCUMENT_TYPE);
|
|
18
23
|
}
|
|
19
24
|
export function useSelectedProcessorModuleDocument() {
|
|
20
25
|
const documentId = useSelectedDocumentId();
|
|
21
26
|
return useProcessorModuleDocument(documentId);
|
|
22
27
|
}
|
|
23
28
|
export function useSubgraphModuleDocument(documentId) {
|
|
24
|
-
return useDocumentOfType(documentId,
|
|
29
|
+
return useDocumentOfType(documentId, SUBGRAPH_MODULE_DOCUMENT_TYPE);
|
|
25
30
|
}
|
|
26
31
|
export function useSelectedSubgraphModuleDocument() {
|
|
27
32
|
const documentId = useSelectedDocumentId();
|
|
28
33
|
return useSubgraphModuleDocument(documentId);
|
|
29
34
|
}
|
|
30
35
|
export function useVetraPackageDocument(documentId) {
|
|
31
|
-
return useDocumentOfType(documentId,
|
|
36
|
+
return useDocumentOfType(documentId, VETRA_PACKAGE_DOCUMENT_TYPE);
|
|
32
37
|
}
|
|
33
38
|
export function useSelectedVetraPackageDocument() {
|
|
34
|
-
const
|
|
39
|
+
const [selectedDrive] = useSelectedDrive();
|
|
40
|
+
const documentId = selectedDrive?.state.global.nodes.find((node) => isFileNode(node) && node.documentType === VETRA_PACKAGE_DOCUMENT_TYPE)?.id;
|
|
35
41
|
return useVetraPackageDocument(documentId);
|
|
36
42
|
}
|
|
37
43
|
//# sourceMappingURL=useVetraDocument.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVetraDocument.js","sourceRoot":"","sources":["../../../editors/hooks/useVetraDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"useVetraDocument.js","sourceRoot":"","sources":["../../../editors/hooks/useVetraDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAsB5C,MAAM,2BAA2B,GAAG,oBAAoB,CAAC;AACzD,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AACnE,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAC5D,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AAE9D,MAAM,UAAU,oBAAoB,CAAC,UAAqC;IACxE,OAAO,iBAAiB,CACtB,UAAU,EACV,gBAAgB,CACjB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,MAAM,UAAU,GAAG,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