@powerhousedao/vetra 5.1.0-dev.40 → 5.1.0-dev.42
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/document-models/app-module/hooks.d.ts +5 -2
- package/dist/document-models/app-module/hooks.d.ts.map +1 -1
- package/dist/document-models/app-module/hooks.js +3 -4
- package/dist/document-models/document-editor/hooks.d.ts +5 -2
- package/dist/document-models/document-editor/hooks.d.ts.map +1 -1
- package/dist/document-models/document-editor/hooks.js +3 -4
- package/dist/document-models/processor-module/hooks.d.ts +5 -2
- package/dist/document-models/processor-module/hooks.d.ts.map +1 -1
- package/dist/document-models/processor-module/hooks.js +3 -4
- package/dist/document-models/subgraph-module/hooks.d.ts +5 -2
- package/dist/document-models/subgraph-module/hooks.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/hooks.js +3 -4
- package/dist/document-models/vetra-package/hooks.d.ts +5 -2
- package/dist/document-models/vetra-package/hooks.d.ts.map +1 -1
- package/dist/document-models/vetra-package/hooks.js +3 -4
- package/dist/editors/app-editor/components/AppEditorForm.js +1 -1
- package/dist/editors/app-editor/editor.test.js +3 -2
- package/dist/editors/document-editor/editor.js +1 -1
- package/dist/editors/document-editor/editor.test.js +2 -2
- package/dist/setupTests.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppModuleAction, AppModuleDocument } from "@powerhousedao/vetra/document-models/app-module";
|
|
3
3
|
/** Hook to get a AppModule document by its id */
|
|
4
4
|
export declare function useAppModuleDocumentById(documentId: string | null | undefined): [AppModuleDocument, DocumentDispatch<AppModuleAction>] | [undefined, undefined];
|
|
5
5
|
/** Hook to get the selected AppModule document */
|
|
6
|
-
export declare function useSelectedAppModuleDocument(): [
|
|
6
|
+
export declare function useSelectedAppModuleDocument(): [
|
|
7
|
+
AppModuleDocument,
|
|
8
|
+
DocumentDispatch<AppModuleAction>
|
|
9
|
+
];
|
|
7
10
|
/** Hook to get all AppModule documents in the selected drive */
|
|
8
11
|
export declare function useAppModuleDocumentsInSelectedDrive(): AppModuleDocument[] | undefined;
|
|
9
12
|
/** Hook to get all AppModule documents in the selected folder */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/app-module/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,iDAAiD,CAAC;AAMzD,iDAAiD;AACjD,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAEnC,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC,GACtD,CAAC,SAAS,EAAE,SAAS,CAAC,CAIzB;AAED,kDAAkD;AAClD,wBAAgB,4BAA4B,IAAI;IAC9C,iBAAiB;IACjB,gBAAgB,CAAC,eAAe,CAAC;CAClC,CAIA;AAED,gEAAgE;AAChE,wBAAgB,oCAAoC,oCAGnD;AAED,iEAAiE;AACjE,wBAAgB,qCAAqC,oCAGpD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useDocumentsInSelectedDrive, useDocumentsInSelectedFolder,
|
|
2
|
-
import { isAppModuleDocument } from "./gen/document-schema.js";
|
|
1
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { assertIsAppModuleDocument, isAppModuleDocument, } from "./gen/document-schema.js";
|
|
3
3
|
/** Hook to get a AppModule document by its id */
|
|
4
4
|
export function useAppModuleDocumentById(documentId) {
|
|
5
5
|
const [document, dispatch] = useDocumentById(documentId);
|
|
@@ -10,8 +10,7 @@ export function useAppModuleDocumentById(documentId) {
|
|
|
10
10
|
/** Hook to get the selected AppModule document */
|
|
11
11
|
export function useSelectedAppModuleDocument() {
|
|
12
12
|
const [document, dispatch] = useSelectedDocument();
|
|
13
|
-
|
|
14
|
-
return [undefined, undefined];
|
|
13
|
+
assertIsAppModuleDocument(document);
|
|
15
14
|
return [document, dispatch];
|
|
16
15
|
}
|
|
17
16
|
/** Hook to get all AppModule documents in the selected drive */
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DocumentEditorAction, DocumentEditorDocument } from "@powerhousedao/vetra/document-models/document-editor";
|
|
3
3
|
/** Hook to get a DocumentEditor document by its id */
|
|
4
4
|
export declare function useDocumentEditorDocumentById(documentId: string | null | undefined): [DocumentEditorDocument, DocumentDispatch<DocumentEditorAction>] | [undefined, undefined];
|
|
5
5
|
/** Hook to get the selected DocumentEditor document */
|
|
6
|
-
export declare function useSelectedDocumentEditorDocument(): [
|
|
6
|
+
export declare function useSelectedDocumentEditorDocument(): [
|
|
7
|
+
DocumentEditorDocument,
|
|
8
|
+
DocumentDispatch<DocumentEditorAction>
|
|
9
|
+
];
|
|
7
10
|
/** Hook to get all DocumentEditor documents in the selected drive */
|
|
8
11
|
export declare function useDocumentEditorDocumentsInSelectedDrive(): DocumentEditorDocument[] | undefined;
|
|
9
12
|
/** Hook to get all DocumentEditor documents in the selected folder */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/document-editor/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/document-editor/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,sDAAsD,CAAC;AAM9D,sDAAsD;AACtD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAEnC,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,SAAS,CAAC,CAIzB;AAED,uDAAuD;AACvD,wBAAgB,iCAAiC,IAAI;IACnD,sBAAsB;IACtB,gBAAgB,CAAC,oBAAoB,CAAC;CACvC,CAIA;AAED,qEAAqE;AACrE,wBAAgB,yCAAyC,yCAGxD;AAED,sEAAsE;AACtE,wBAAgB,0CAA0C,yCAGzD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useDocumentsInSelectedDrive, useDocumentsInSelectedFolder,
|
|
2
|
-
import { isDocumentEditorDocument } from "./gen/document-schema.js";
|
|
1
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { assertIsDocumentEditorDocument, isDocumentEditorDocument, } from "./gen/document-schema.js";
|
|
3
3
|
/** Hook to get a DocumentEditor document by its id */
|
|
4
4
|
export function useDocumentEditorDocumentById(documentId) {
|
|
5
5
|
const [document, dispatch] = useDocumentById(documentId);
|
|
@@ -10,8 +10,7 @@ export function useDocumentEditorDocumentById(documentId) {
|
|
|
10
10
|
/** Hook to get the selected DocumentEditor document */
|
|
11
11
|
export function useSelectedDocumentEditorDocument() {
|
|
12
12
|
const [document, dispatch] = useSelectedDocument();
|
|
13
|
-
|
|
14
|
-
return [undefined, undefined];
|
|
13
|
+
assertIsDocumentEditorDocument(document);
|
|
15
14
|
return [document, dispatch];
|
|
16
15
|
}
|
|
17
16
|
/** Hook to get all DocumentEditor documents in the selected drive */
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProcessorModuleAction, ProcessorModuleDocument } from "@powerhousedao/vetra/document-models/processor-module";
|
|
3
3
|
/** Hook to get a ProcessorModule document by its id */
|
|
4
4
|
export declare function useProcessorModuleDocumentById(documentId: string | null | undefined): [ProcessorModuleDocument, DocumentDispatch<ProcessorModuleAction>] | [undefined, undefined];
|
|
5
5
|
/** Hook to get the selected ProcessorModule document */
|
|
6
|
-
export declare function useSelectedProcessorModuleDocument(): [
|
|
6
|
+
export declare function useSelectedProcessorModuleDocument(): [
|
|
7
|
+
ProcessorModuleDocument,
|
|
8
|
+
DocumentDispatch<ProcessorModuleAction>
|
|
9
|
+
];
|
|
7
10
|
/** Hook to get all ProcessorModule documents in the selected drive */
|
|
8
11
|
export declare function useProcessorModuleDocumentsInSelectedDrive(): ProcessorModuleDocument[] | undefined;
|
|
9
12
|
/** Hook to get all ProcessorModule documents in the selected folder */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/processor-module/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/processor-module/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,uDAAuD,CAAC;AAM/D,uDAAuD;AACvD,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAEnC,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,GAClE,CAAC,SAAS,EAAE,SAAS,CAAC,CAIzB;AAED,wDAAwD;AACxD,wBAAgB,kCAAkC,IAAI;IACpD,uBAAuB;IACvB,gBAAgB,CAAC,qBAAqB,CAAC;CACxC,CAIA;AAED,sEAAsE;AACtE,wBAAgB,0CAA0C,0CAGzD;AAED,uEAAuE;AACvE,wBAAgB,2CAA2C,0CAG1D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useDocumentsInSelectedDrive, useDocumentsInSelectedFolder,
|
|
2
|
-
import { isProcessorModuleDocument } from "./gen/document-schema.js";
|
|
1
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { assertIsProcessorModuleDocument, isProcessorModuleDocument, } from "./gen/document-schema.js";
|
|
3
3
|
/** Hook to get a ProcessorModule document by its id */
|
|
4
4
|
export function useProcessorModuleDocumentById(documentId) {
|
|
5
5
|
const [document, dispatch] = useDocumentById(documentId);
|
|
@@ -10,8 +10,7 @@ export function useProcessorModuleDocumentById(documentId) {
|
|
|
10
10
|
/** Hook to get the selected ProcessorModule document */
|
|
11
11
|
export function useSelectedProcessorModuleDocument() {
|
|
12
12
|
const [document, dispatch] = useSelectedDocument();
|
|
13
|
-
|
|
14
|
-
return [undefined, undefined];
|
|
13
|
+
assertIsProcessorModuleDocument(document);
|
|
15
14
|
return [document, dispatch];
|
|
16
15
|
}
|
|
17
16
|
/** Hook to get all ProcessorModule documents in the selected drive */
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SubgraphModuleAction, SubgraphModuleDocument } from "@powerhousedao/vetra/document-models/subgraph-module";
|
|
3
3
|
/** Hook to get a SubgraphModule document by its id */
|
|
4
4
|
export declare function useSubgraphModuleDocumentById(documentId: string | null | undefined): [SubgraphModuleDocument, DocumentDispatch<SubgraphModuleAction>] | [undefined, undefined];
|
|
5
5
|
/** Hook to get the selected SubgraphModule document */
|
|
6
|
-
export declare function useSelectedSubgraphModuleDocument(): [
|
|
6
|
+
export declare function useSelectedSubgraphModuleDocument(): [
|
|
7
|
+
SubgraphModuleDocument,
|
|
8
|
+
DocumentDispatch<SubgraphModuleAction>
|
|
9
|
+
];
|
|
7
10
|
/** Hook to get all SubgraphModule documents in the selected drive */
|
|
8
11
|
export declare function useSubgraphModuleDocumentsInSelectedDrive(): SubgraphModuleDocument[] | undefined;
|
|
9
12
|
/** Hook to get all SubgraphModule documents in the selected folder */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/subgraph-module/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/subgraph-module/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,sDAAsD,CAAC;AAM9D,sDAAsD;AACtD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAEnC,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,SAAS,CAAC,CAIzB;AAED,uDAAuD;AACvD,wBAAgB,iCAAiC,IAAI;IACnD,sBAAsB;IACtB,gBAAgB,CAAC,oBAAoB,CAAC;CACvC,CAIA;AAED,qEAAqE;AACrE,wBAAgB,yCAAyC,yCAGxD;AAED,sEAAsE;AACtE,wBAAgB,0CAA0C,yCAGzD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useDocumentsInSelectedDrive, useDocumentsInSelectedFolder,
|
|
2
|
-
import { isSubgraphModuleDocument } from "./gen/document-schema.js";
|
|
1
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { assertIsSubgraphModuleDocument, isSubgraphModuleDocument, } from "./gen/document-schema.js";
|
|
3
3
|
/** Hook to get a SubgraphModule document by its id */
|
|
4
4
|
export function useSubgraphModuleDocumentById(documentId) {
|
|
5
5
|
const [document, dispatch] = useDocumentById(documentId);
|
|
@@ -10,8 +10,7 @@ export function useSubgraphModuleDocumentById(documentId) {
|
|
|
10
10
|
/** Hook to get the selected SubgraphModule document */
|
|
11
11
|
export function useSelectedSubgraphModuleDocument() {
|
|
12
12
|
const [document, dispatch] = useSelectedDocument();
|
|
13
|
-
|
|
14
|
-
return [undefined, undefined];
|
|
13
|
+
assertIsSubgraphModuleDocument(document);
|
|
15
14
|
return [document, dispatch];
|
|
16
15
|
}
|
|
17
16
|
/** Hook to get all SubgraphModule documents in the selected drive */
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
2
|
-
import type {
|
|
2
|
+
import type { VetraPackageAction, VetraPackageDocument } from "@powerhousedao/vetra/document-models/vetra-package";
|
|
3
3
|
/** Hook to get a VetraPackage document by its id */
|
|
4
4
|
export declare function useVetraPackageDocumentById(documentId: string | null | undefined): [VetraPackageDocument, DocumentDispatch<VetraPackageAction>] | [undefined, undefined];
|
|
5
5
|
/** Hook to get the selected VetraPackage document */
|
|
6
|
-
export declare function useSelectedVetraPackageDocument(): [
|
|
6
|
+
export declare function useSelectedVetraPackageDocument(): [
|
|
7
|
+
VetraPackageDocument,
|
|
8
|
+
DocumentDispatch<VetraPackageAction>
|
|
9
|
+
];
|
|
7
10
|
/** Hook to get all VetraPackage documents in the selected drive */
|
|
8
11
|
export declare function useVetraPackageDocumentsInSelectedDrive(): VetraPackageDocument[] | undefined;
|
|
9
12
|
/** Hook to get all VetraPackage documents in the selected folder */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/vetra-package/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/vetra-package/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,oDAAoD,CAAC;AAM5D,oDAAoD;AACpD,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAEnC,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,GAC5D,CAAC,SAAS,EAAE,SAAS,CAAC,CAIzB;AAED,qDAAqD;AACrD,wBAAgB,+BAA+B,IAAI;IACjD,oBAAoB;IACpB,gBAAgB,CAAC,kBAAkB,CAAC;CACrC,CAIA;AAED,mEAAmE;AACnE,wBAAgB,uCAAuC,uCAGtD;AAED,oEAAoE;AACpE,wBAAgB,wCAAwC,uCAGvD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useDocumentsInSelectedDrive, useDocumentsInSelectedFolder,
|
|
2
|
-
import { isVetraPackageDocument } from "./gen/document-schema.js";
|
|
1
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { assertIsVetraPackageDocument, isVetraPackageDocument, } from "./gen/document-schema.js";
|
|
3
3
|
/** Hook to get a VetraPackage document by its id */
|
|
4
4
|
export function useVetraPackageDocumentById(documentId) {
|
|
5
5
|
const [document, dispatch] = useDocumentById(documentId);
|
|
@@ -10,8 +10,7 @@ export function useVetraPackageDocumentById(documentId) {
|
|
|
10
10
|
/** Hook to get the selected VetraPackage document */
|
|
11
11
|
export function useSelectedVetraPackageDocument() {
|
|
12
12
|
const [document, dispatch] = useSelectedDocument();
|
|
13
|
-
|
|
14
|
-
return [undefined, undefined];
|
|
13
|
+
assertIsVetraPackageDocument(document);
|
|
15
14
|
return [document, dispatch];
|
|
16
15
|
}
|
|
17
16
|
/** Hook to get all VetraPackage documents in the selected drive */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useDocumentTypesInSelectedDrive, useSupportedDocumentTypesInReactor, } from "@powerhousedao/reactor-browser";
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
|
+
import { useSelectedAppModuleDocument } from "../../../document-models/app-module/hooks.js";
|
|
4
5
|
import { actions } from "../../../document-models/app-module/index.js";
|
|
5
6
|
import { StatusPill } from "../../components/index.js";
|
|
6
7
|
import { useDebounce } from "../../hooks/index.js";
|
|
7
|
-
import { useSelectedAppModuleDocument } from "../../hooks/useVetraDocument.js";
|
|
8
8
|
const ALL_IN_DRIVE = "all-in-drive";
|
|
9
9
|
const ALL_IN_REACTOR = "all-in-reactor";
|
|
10
10
|
const ALLOW_ANY = "allow-any";
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { render, screen, waitFor } from "@testing-library/react";
|
|
3
3
|
import { userEvent } from "@testing-library/user-event";
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { useSelectedAppModuleDocument } from "
|
|
5
|
+
import { useSelectedAppModuleDocument } from "../../document-models/app-module/hooks.js";
|
|
6
6
|
import Editor from "./editor.js";
|
|
7
|
-
vi.mock("
|
|
7
|
+
vi.mock("../../document-models/app-module/hooks.js", () => ({
|
|
8
8
|
useSelectedAppModuleDocument: vi.fn(),
|
|
9
9
|
}));
|
|
10
10
|
vi.mock("@powerhousedao/reactor-browser", async (importOriginal) => {
|
|
@@ -20,6 +20,7 @@ vi.mock("@powerhousedao/reactor-browser", async (importOriginal) => {
|
|
|
20
20
|
useSetPHDocumentEditorConfig: vi.fn(),
|
|
21
21
|
// These are needed by DocumentToolbar but mocked in setupTests
|
|
22
22
|
useSelectedDocument: vi.fn(() => [null, vi.fn()]),
|
|
23
|
+
useSelectedDocumentSafe: vi.fn(() => [null, vi.fn()]),
|
|
23
24
|
useDocumentById: vi.fn(() => [null, vi.fn()]),
|
|
24
25
|
useDocumentTimeline: vi.fn(() => []),
|
|
25
26
|
useNodeParentFolderById: vi.fn(() => null),
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
3
3
|
import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
|
+
import { useSelectedDocumentEditorDocument } from "../../document-models/document-editor/hooks.js";
|
|
5
6
|
import { actions } from "../../document-models/document-editor/index.js";
|
|
6
|
-
import { useSelectedDocumentEditorDocument } from "../hooks/useVetraDocument.js";
|
|
7
7
|
import { DocumentEditorForm } from "./components/DocumentEditorForm.js";
|
|
8
8
|
import { editorConfig } from "./config.js";
|
|
9
9
|
export default function Editor() {
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { render, screen, waitFor } from "@testing-library/react";
|
|
3
3
|
import { userEvent } from "@testing-library/user-event";
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { useSelectedDocumentEditorDocument } from "
|
|
5
|
+
import { useSelectedDocumentEditorDocument } from "../../document-models/document-editor/hooks.js";
|
|
6
6
|
import Editor from "./editor.js";
|
|
7
|
-
vi.mock("
|
|
7
|
+
vi.mock("../../document-models/document-editor/hooks.js", () => ({
|
|
8
8
|
useSelectedDocumentEditorDocument: vi.fn(),
|
|
9
9
|
}));
|
|
10
10
|
vi.mock("../hooks/useAvailableDocumentTypes.js", () => ({
|
package/dist/setupTests.js
CHANGED
|
@@ -3,6 +3,7 @@ import { vi } from "vitest";
|
|
|
3
3
|
vi.mock("@powerhousedao/reactor-browser", () => ({
|
|
4
4
|
// Mock hooks
|
|
5
5
|
useSelectedDocument: vi.fn(() => [null, vi.fn()]),
|
|
6
|
+
useSelectedDocumentSafe: vi.fn(() => [null, vi.fn()]),
|
|
6
7
|
useSetPHDocumentEditorConfig: vi.fn(),
|
|
7
8
|
useSetPHDriveEditorConfig: vi.fn(),
|
|
8
9
|
useDocumentById: vi.fn(() => [null, vi.fn()]),
|