@powerhousedao/vetra 4.1.0-dev.23 → 4.1.0-dev.24
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/editors/app-editor/editor.d.ts +1 -2
- package/dist/editors/app-editor/editor.d.ts.map +1 -1
- package/dist/editors/app-editor/editor.js +8 -5
- package/dist/editors/app-editor/editor.js.map +1 -1
- package/dist/editors/app-editor/index.d.ts +1 -2
- package/dist/editors/app-editor/index.d.ts.map +1 -1
- package/dist/editors/app-editor/index.js.map +1 -1
- package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
- package/dist/editors/document-editor/components/DocumentEditorForm.js +20 -3
- package/dist/editors/document-editor/components/DocumentEditorForm.js.map +1 -1
- package/dist/editors/document-editor/editor.d.ts +1 -2
- package/dist/editors/document-editor/editor.d.ts.map +1 -1
- package/dist/editors/document-editor/editor.js +12 -6
- package/dist/editors/document-editor/editor.js.map +1 -1
- package/dist/editors/document-editor/index.d.ts +1 -2
- package/dist/editors/document-editor/index.d.ts.map +1 -1
- package/dist/editors/document-editor/index.js.map +1 -1
- package/dist/editors/processor-editor/components/ProcessorEditorForm.d.ts.map +1 -1
- package/dist/editors/processor-editor/components/ProcessorEditorForm.js +1 -1
- package/dist/editors/processor-editor/components/ProcessorEditorForm.js.map +1 -1
- package/dist/editors/processor-editor/editor.d.ts +1 -2
- package/dist/editors/processor-editor/editor.d.ts.map +1 -1
- package/dist/editors/processor-editor/editor.js +17 -11
- package/dist/editors/processor-editor/editor.js.map +1 -1
- package/dist/editors/processor-editor/index.d.ts +1 -2
- package/dist/editors/processor-editor/index.d.ts.map +1 -1
- package/dist/editors/processor-editor/index.js.map +1 -1
- package/dist/editors/subgraph-editor/editor.d.ts +1 -2
- package/dist/editors/subgraph-editor/editor.d.ts.map +1 -1
- package/dist/editors/subgraph-editor/editor.js +8 -5
- package/dist/editors/subgraph-editor/editor.js.map +1 -1
- package/dist/editors/subgraph-editor/index.d.ts +1 -2
- package/dist/editors/subgraph-editor/index.d.ts.map +1 -1
- package/dist/editors/subgraph-editor/index.js.map +1 -1
- package/dist/editors/vetra-drive-app/DriveExplorer.d.ts +2 -2
- package/dist/editors/vetra-drive-app/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/DriveExplorer.js +3 -7
- package/dist/editors/vetra-drive-app/DriveExplorer.js.map +1 -1
- package/dist/editors/vetra-drive-app/components/EditorContainer.d.ts +4 -5
- package/dist/editors/vetra-drive-app/components/EditorContainer.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/components/EditorContainer.js +6 -14
- package/dist/editors/vetra-drive-app/components/EditorContainer.js.map +1 -1
- package/dist/editors/vetra-drive-app/components/PackageInformationSection.d.ts +4 -5
- package/dist/editors/vetra-drive-app/components/PackageInformationSection.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/components/PackageInformationSection.js.map +1 -1
- package/dist/editors/vetra-drive-app/editor.d.ts +1 -2
- package/dist/editors/vetra-drive-app/editor.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/editor.js +13 -17
- package/dist/editors/vetra-drive-app/editor.js.map +1 -1
- package/dist/editors/vetra-drive-app/index.d.ts +1 -2
- package/dist/editors/vetra-drive-app/index.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/index.js.map +1 -1
- package/dist/editors/vetra-package/editor.d.ts +1 -2
- package/dist/editors/vetra-package/editor.d.ts.map +1 -1
- package/dist/editors/vetra-package/editor.js +29 -26
- package/dist/editors/vetra-package/editor.js.map +1 -1
- package/dist/editors/vetra-package/index.d.ts +1 -2
- package/dist/editors/vetra-package/index.d.ts.map +1 -1
- package/dist/editors/vetra-package/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/base-document-gen.d.ts +30 -0
- package/dist/processors/codegen/document-handlers/base-document-gen.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/base-document-gen.js +29 -0
- package/dist/processors/codegen/document-handlers/base-document-gen.js.map +1 -0
- package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts +29 -0
- package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/document-codegen-factory.js +50 -0
- package/dist/processors/codegen/document-handlers/document-codegen-factory.js.map +1 -0
- package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts +50 -0
- package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/document-codegen-manager.js +111 -0
- package/dist/processors/codegen/document-handlers/document-codegen-manager.js.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts +11 -0
- package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/{app-handler.js → generators/app-generator.js} +17 -12
- package/dist/processors/codegen/document-handlers/generators/app-generator.js.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts +11 -0
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/{document-editor-handler.js → generators/document-editor-generator.js} +21 -13
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts +11 -0
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/{document-model-handler.js → generators/document-model-generator.js} +21 -15
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.js.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/index.d.ts +7 -0
- package/dist/processors/codegen/document-handlers/generators/index.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/index.js +7 -0
- package/dist/processors/codegen/document-handlers/generators/index.js.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts +11 -0
- package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/{package-handler.js → generators/package-generator.js} +9 -9
- package/dist/processors/codegen/document-handlers/generators/package-generator.js.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts +11 -0
- package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/{processor-handler.js → generators/processor-generator.js} +18 -10
- package/dist/processors/codegen/document-handlers/generators/processor-generator.js.map +1 -0
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts +11 -0
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/{subgraph-handler.js → generators/subgraph-generator.js} +18 -13
- package/dist/processors/codegen/document-handlers/generators/subgraph-generator.js.map +1 -0
- package/dist/processors/codegen/document-handlers/index.d.ts +5 -7
- package/dist/processors/codegen/document-handlers/index.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/index.js +5 -6
- package/dist/processors/codegen/document-handlers/index.js.map +1 -1
- package/dist/processors/codegen/factory.d.ts +2 -1
- package/dist/processors/codegen/factory.d.ts.map +1 -1
- package/dist/processors/codegen/factory.js +4 -1
- package/dist/processors/codegen/factory.js.map +1 -1
- package/dist/processors/codegen/index.d.ts +0 -2
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +7 -36
- package/dist/processors/codegen/index.js.map +1 -1
- package/dist/processors/codegen/utils.d.ts +5 -0
- package/dist/processors/codegen/utils.d.ts.map +1 -0
- package/dist/processors/codegen/utils.js +19 -0
- package/dist/processors/codegen/utils.js.map +1 -0
- package/dist/processors/factory.d.ts +2 -1
- package/dist/processors/factory.d.ts.map +1 -1
- package/dist/processors/factory.js +3 -3
- package/dist/processors/factory.js.map +1 -1
- package/dist/style.css +8 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -14
- package/dist/package.json +0 -114
- package/dist/powerhouse.config.json +0 -12
- package/dist/processors/codegen/document-handlers/app-handler.d.ts +0 -10
- package/dist/processors/codegen/document-handlers/app-handler.d.ts.map +0 -1
- package/dist/processors/codegen/document-handlers/app-handler.js.map +0 -1
- package/dist/processors/codegen/document-handlers/document-editor-handler.d.ts +0 -10
- package/dist/processors/codegen/document-handlers/document-editor-handler.d.ts.map +0 -1
- package/dist/processors/codegen/document-handlers/document-editor-handler.js.map +0 -1
- package/dist/processors/codegen/document-handlers/document-model-handler.d.ts +0 -10
- package/dist/processors/codegen/document-handlers/document-model-handler.d.ts.map +0 -1
- package/dist/processors/codegen/document-handlers/document-model-handler.js.map +0 -1
- package/dist/processors/codegen/document-handlers/package-handler.d.ts +0 -10
- package/dist/processors/codegen/document-handlers/package-handler.d.ts.map +0 -1
- package/dist/processors/codegen/document-handlers/package-handler.js.map +0 -1
- package/dist/processors/codegen/document-handlers/processor-handler.d.ts +0 -10
- package/dist/processors/codegen/document-handlers/processor-handler.d.ts.map +0 -1
- package/dist/processors/codegen/document-handlers/processor-handler.js.map +0 -1
- package/dist/processors/codegen/document-handlers/subgraph-handler.d.ts +0 -10
- package/dist/processors/codegen/document-handlers/subgraph-handler.d.ts.map +0 -1
- package/dist/processors/codegen/document-handlers/subgraph-handler.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorProps } from "document-model";
|
|
2
|
-
|
|
3
|
-
export type IProps = EditorProps<AppModuleDocument>;
|
|
2
|
+
export type IProps = EditorProps;
|
|
4
3
|
export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAwB3C"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useDocumentById } from "@powerhousedao/reactor-browser";
|
|
3
|
+
import { useCallback } from "react";
|
|
2
4
|
import { actions, } from "../../document-models/app-module/index.js";
|
|
3
5
|
import { AppEditorForm } from "./components/AppEditorForm.js";
|
|
4
|
-
import { useCallback } from "react";
|
|
5
6
|
export default function Editor(props) {
|
|
6
|
-
const { document
|
|
7
|
+
const { document: initialDocument } = props;
|
|
8
|
+
const [document, dispatch] = useDocumentById(initialDocument.header.id);
|
|
9
|
+
const unsafeCastOfDocument = document;
|
|
7
10
|
const onNameChange = useCallback((name) => {
|
|
8
|
-
if (name ===
|
|
11
|
+
if (name === unsafeCastOfDocument.state.global.name)
|
|
9
12
|
return;
|
|
10
13
|
dispatch(actions.setAppName({ name }));
|
|
11
|
-
}, [
|
|
14
|
+
}, [unsafeCastOfDocument.state.global.name, dispatch]);
|
|
12
15
|
const onConfirm = useCallback(() => {
|
|
13
16
|
dispatch(actions.setAppStatus({ status: "CONFIRMED" }));
|
|
14
17
|
}, [dispatch]);
|
|
15
|
-
return (_jsx("div", { children: _jsx(AppEditorForm, { appName:
|
|
18
|
+
return (_jsx("div", { children: _jsx(AppEditorForm, { appName: unsafeCastOfDocument.state.global.name ?? "", status: unsafeCastOfDocument.state.global.status, onNameChange: onNameChange, onConfirm: onConfirm }) }));
|
|
16
19
|
}
|
|
17
20
|
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names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AAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorModule } from "document-model";
|
|
2
|
-
|
|
3
|
-
export declare const module: EditorModule<AppModuleDocument>;
|
|
2
|
+
export declare const module: EditorModule;
|
|
4
3
|
export default module;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/app-editor/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/app-editor/index.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,CAAC,gBAAgB,CAAC;IACjC,MAAM,EAAE;QACN,EAAE,EAAE,mBAAmB;QACvB,uBAAuB,EAAE,IAAI;QAC7B,sBAAsB,EAAE,IAAI;QAC5B,mBAAmB,EAAE,IAAI;KAC1B;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAIzI,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAyKhE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useReactor } from "@powerhousedao/
|
|
2
|
+
import { useReactor } from "@powerhousedao/reactor-browser";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { StatusPill } from "../../components/index.js";
|
|
5
5
|
import { useDebounce } from "../../hooks/index.js";
|
|
@@ -8,10 +8,27 @@ export const DocumentEditorForm = ({ editorName: initialEditorName = "", documen
|
|
|
8
8
|
const [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);
|
|
9
9
|
const [selectedDocumentType, setSelectedDocumentType] = useState("");
|
|
10
10
|
const [isConfirmed, setIsConfirmed] = useState(false);
|
|
11
|
+
const [availableDocumentTypes, setAvailableDocumentTypes] = useState([]);
|
|
11
12
|
// Get available document types from reactor
|
|
12
13
|
const reactor = useReactor();
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
async function loadData() {
|
|
16
|
+
const driveDocs = await reactor?.getDocuments("vetra");
|
|
17
|
+
if (!driveDocs) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const docTypes = (await Promise.all(driveDocs.map(async (docId) => {
|
|
21
|
+
const document = await reactor?.getDocument(docId);
|
|
22
|
+
if (document?.header.documentType === "powerhouse/document-model") {
|
|
23
|
+
const documentModel = document;
|
|
24
|
+
return documentModel.state.global.id;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}))).filter(e => e !== null);
|
|
28
|
+
setAvailableDocumentTypes(docTypes);
|
|
29
|
+
}
|
|
30
|
+
loadData();
|
|
31
|
+
}, [reactor]);
|
|
15
32
|
// Use the debounce hook for name changes
|
|
16
33
|
useDebounce(editorName, onEditorNameChange, 300);
|
|
17
34
|
// Update local state when initial values change
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentEditorForm.js","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"DocumentEditorForm.js","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAYnD,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,UAAU,EAAE,iBAAiB,GAAG,EAAE,EAClC,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,MAAM,GAAG,OAAO,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACV,EAA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AAC,EAAE,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,KAAK,OAAO,CAAC,CAAC;yCACzE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAChB,iBAAsB,KAAK,EAAE,OAAO,YACjC,OAAO,IADG,OAAO,CAEX,CACV,CAAC,IAEG,CACV,EACD,cAAK,SAAS,EAAC,WAAW,YACvB,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,eAEE,SAAS,EAAC,wBAAwB,aAElC,eAAM,SAAS,EAAC,uBAAuB,YAAE,IAAI,CAAC,YAAY,GAAQ,EACjE,CAAC,UAAU,IAAI,CACd,iBACE,OAAO,EAAE,GAAG,EAAE;gDACZ,gBAAgB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gDAClE,oBAAoB,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;4CAC1C,CAAC,EACD,SAAS,EAAC,2DAA2D,uBAG9D,CACV,KAdI,IAAI,CAAC,EAAE,CAeR,CACP,CAAC,GACE,IACF,IACF,EAGL,CAAC,UAAU,IAAI,CACd,wBACE,iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAC1D,SAAS,EAAC,wLAAwL,wBAG3L,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorProps } from "document-model";
|
|
2
|
-
|
|
3
|
-
export type IProps = EditorProps<DocumentEditorDocument>;
|
|
2
|
+
export type IProps = EditorProps;
|
|
4
3
|
export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AASlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAsC3C"}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { DocumentEditorForm } from "./components/DocumentEditorForm.js";
|
|
2
|
+
import { useDocumentById } from "@powerhousedao/reactor-browser";
|
|
4
3
|
import { useCallback } from "react";
|
|
4
|
+
import { actions } from "../../document-models/document-editor/index.js";
|
|
5
|
+
import { DocumentEditorForm } from "./components/DocumentEditorForm.js";
|
|
5
6
|
export default function Editor(props) {
|
|
6
|
-
const { document
|
|
7
|
+
const { document: initialDocument } = props;
|
|
8
|
+
const [document, dispatch] = useDocumentById(initialDocument.header.id);
|
|
9
|
+
const unsafeCastOfDocument = document;
|
|
10
|
+
console.log(">>>>> document:", unsafeCastOfDocument.state.global);
|
|
7
11
|
const onEditorNameChange = useCallback((name) => {
|
|
8
|
-
if (
|
|
12
|
+
if (!unsafeCastOfDocument.state.global.name && !name)
|
|
13
|
+
return;
|
|
14
|
+
if (name === unsafeCastOfDocument.state.global.name)
|
|
9
15
|
return;
|
|
10
16
|
dispatch(actions.setEditorName({ name }));
|
|
11
|
-
}, [
|
|
17
|
+
}, [unsafeCastOfDocument.state.global.name, dispatch]);
|
|
12
18
|
const onAddDocumentType = useCallback((input) => {
|
|
13
19
|
dispatch(actions.addDocumentType(input));
|
|
14
20
|
}, [dispatch]);
|
|
@@ -18,6 +24,6 @@ export default function Editor(props) {
|
|
|
18
24
|
const onConfirm = useCallback(() => {
|
|
19
25
|
dispatch(actions.setEditorStatus({ status: "CONFIRMED" }));
|
|
20
26
|
}, [dispatch]);
|
|
21
|
-
return (_jsx("div", { children: _jsx(DocumentEditorForm, { editorName:
|
|
27
|
+
return (_jsx("div", { children: _jsx(DocumentEditorForm, { status: unsafeCastOfDocument.state.global.status, editorName: unsafeCastOfDocument.state.global.name ?? "", documentTypes: unsafeCastOfDocument.state.global.documentTypes, onEditorNameChange: onEditorNameChange, onAddDocumentType: onAddDocumentType, onRemoveDocumentType: onRemoveDocumentType, onConfirm: onConfirm }) }));
|
|
22
28
|
}
|
|
23
29
|
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAGL,OAAO,EACR,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAIxE,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC5C,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACzE,MAAM,oBAAoB,GAAG,QAAkC,CAAA;IAC9D,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAElE,MAAM,kB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tC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,SAAS,GACpB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorModule } from "document-model";
|
|
2
|
-
|
|
3
|
-
export declare const module: EditorModule<DocumentEditorDocument>;
|
|
2
|
+
export declare const module: EditorModule;
|
|
4
3
|
export default module;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/document-editor/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/document-editor/index.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,CAAC,4BAA4B,CAAC;IAC7C,MAAM,EAAE;QACN,EAAE,EAAE,wBAAwB;QAC5B,uBAAuB,EAAE,IAAI;QAC7B,sBAAsB,EAAE,IAAI;QAC5B,mBAAmB,EAAE,IAAI;KAC1B;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessorEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ProcessorEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,gBAAgB,EACnB,MAAM,oDAAoD,CAAC;AAI5D,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAsLlE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useReactor } from "@powerhousedao/
|
|
2
|
+
import { useReactor } from "@powerhousedao/reactor-browser";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { StatusPill } from "../../components/index.js";
|
|
5
5
|
import { useDebounce } from "../../hooks/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessorEditorForm.js","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ProcessorEditorForm.js","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAcnD,MAAM,CAAC,MAAM,mBAAmB,GAAuC,CAAC,EACtE,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,MAAM,GAAG,OAAO,EAChB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACV,EAAE,EAAE;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACzE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACzE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GACrC,QAAQ,CAAqB,oBAAoB,CAAC,CAAC;IACrD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,4CAA4C;IAC5C,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;IAC3D,MAAM,sBAAsB,GAAG,SAAS,CAAC,GAAG,CA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AE,EAAE,CAAC,CAC3B,eAAmB,SAAS,EAAC,wBAAwB,aACnD,eAAM,SAAS,EAAC,uBAAuB,YACpC,IAAI,CAAC,YAAY,GACb,EACN,CAAC,UAAU,IAAI,CACd,iBACE,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,EAChD,SAAS,EAAC,2DAA2D,uBAG9D,CACV,KAXO,IAAI,CAAC,EAAE,CAYX,CACP,CAAC,GACE,IACF,IACF,EAGL,CAAC,UAAU,IAAI,CACd,wBACE,iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,UAAU,EACrB,SAAS,EAAC,wLAAwL,wBAG3L,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorProps } from "document-model";
|
|
2
|
-
|
|
3
|
-
export type IProps = EditorProps<ProcessorModuleDocument>;
|
|
2
|
+
export type IProps = EditorProps;
|
|
4
3
|
export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CA+C3C"}
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { ProcessorEditorForm } from "./components/ProcessorEditorForm.js";
|
|
2
|
+
import { useDocumentById } from "@powerhousedao/reactor-browser";
|
|
4
3
|
import { useCallback } from "react";
|
|
4
|
+
import { actions } from "../../document-models/processor-module/index.js";
|
|
5
|
+
import { ProcessorEditorForm } from "./components/ProcessorEditorForm.js";
|
|
5
6
|
export default function Editor(props) {
|
|
6
|
-
const { document
|
|
7
|
+
const { document: initialDocument } = props;
|
|
8
|
+
const [document, dispatch] = useDocumentById(initialDocument.header.id);
|
|
9
|
+
const unsafeCastOfDocument = document;
|
|
10
|
+
const onConfirm = useCallback(() => {
|
|
11
|
+
// Dispatch all actions at once
|
|
12
|
+
dispatch([
|
|
13
|
+
actions.setProcessorStatus({ status: "CONFIRMED" }),
|
|
14
|
+
]);
|
|
15
|
+
}, [dispatch]);
|
|
7
16
|
const onNameChange = useCallback((name) => {
|
|
8
|
-
if (name ===
|
|
17
|
+
if (name === unsafeCastOfDocument.state.global.name)
|
|
9
18
|
return;
|
|
10
19
|
dispatch(actions.setProcessorName({ name }));
|
|
11
|
-
}, [
|
|
20
|
+
}, [unsafeCastOfDocument.state.global.name, dispatch]);
|
|
12
21
|
const onTypeChange = useCallback((type) => {
|
|
13
|
-
if (type ===
|
|
22
|
+
if (type === unsafeCastOfDocument.state.global.type)
|
|
14
23
|
return;
|
|
15
24
|
dispatch(actions.setProcessorType({ type }));
|
|
16
|
-
}, [
|
|
25
|
+
}, [unsafeCastOfDocument.state.global.type, dispatch]);
|
|
17
26
|
const onAddDocumentType = useCallback((id, documentType) => {
|
|
18
27
|
dispatch(actions.addDocumentType({ id, documentType }));
|
|
19
28
|
}, [dispatch]);
|
|
20
29
|
const onRemoveDocumentType = useCallback((id) => {
|
|
21
30
|
dispatch(actions.removeDocumentType({ id }));
|
|
22
31
|
}, [dispatch]);
|
|
23
|
-
|
|
24
|
-
dispatch(actions.setProcessorStatus({ status: "CONFIRMED" }));
|
|
25
|
-
}, [dispatch]);
|
|
26
|
-
return (_jsx("div", { children: _jsx(ProcessorEditorForm, { processorName: document.state.global.name ?? "", processorType: document.state.global.type ?? "", documentTypes: document.state.global.documentTypes ?? [], status: document.state.global.status, onNameChange: onNameChange, onTypeChange: onTypeChange, onAddDocumentType: onAddDocumentType, onRemoveDocumentType: onRemoveDocumentType, onConfirm: onConfirm }) }));
|
|
32
|
+
return (_jsx("div", { children: _jsx(ProcessorEditorForm, { onNameChange: onNameChange, onTypeChange: onTypeChange, onAddDocumentType: onAddDocumentType, onRemoveDocumentType: onRemoveDocumentType, status: unsafeCastOfDocument.state.global.status, processorName: unsafeCastOfDocument.state.global.name ?? "", processorType: unsafeCastOfDocument.state.global.type ?? "", documentTypes: unsafeCastOfDocument.state.global.documentTypes ?? [], onConfirm: onConfirm }) }));
|
|
27
33
|
}
|
|
28
34
|
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EACL,OAAO,EACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI1E,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC5C,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACzE,MAAM,oBAAoB,GAAG,QAAmC,CAAA;IAC/D,MAAM,SAAS,GAAG,WAAW,CAC3B,GAAG,EAAE;QACH,+BAA+B;QAC/B,QAAQ,CAAC;YACP,OAAO,CAAC,kBAAkB,CAAC,EAAE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Y,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAChD,aAAa,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAC3D,aAAa,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAC3D,aAAa,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,EACpE,SAAS,EAAE,SAAS,GACpB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorModule } from "document-model";
|
|
2
|
-
|
|
3
|
-
export declare const module: EditorModule<ProcessorModuleDocument>;
|
|
2
|
+
export declare const module: EditorModule;
|
|
4
3
|
export default module;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/processor-editor/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/processor-editor/index.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,CAAC,sBAAsB,CAAC;IACvC,MAAM,EAAE;QACN,EAAE,EAAE,yBAAyB;QAC7B,uBAAuB,EAAE,IAAI;QAC7B,sBAAsB,EAAE,IAAI;QAC5B,mBAAmB,EAAE,IAAI;KAC1B;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorProps } from "document-model";
|
|
2
|
-
|
|
3
|
-
export type IProps = EditorProps<SubgraphModuleDocument>;
|
|
2
|
+
export type IProps = EditorProps;
|
|
4
3
|
export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAwB3C"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useDocumentById } from "@powerhousedao/reactor-browser";
|
|
2
3
|
import { useCallback } from "react";
|
|
3
|
-
import { actions
|
|
4
|
+
import { actions } from "../../document-models/subgraph-module/index.js";
|
|
4
5
|
import { SubgraphEditorForm } from "./components/SubgraphEditorForm.js";
|
|
5
6
|
export default function Editor(props) {
|
|
6
|
-
const { document
|
|
7
|
+
const { document: initialDocument } = props;
|
|
8
|
+
const [document, dispatch] = useDocumentById(initialDocument.header.id);
|
|
9
|
+
const unsafeCastOfDocument = document;
|
|
7
10
|
const onNameChange = useCallback((name) => {
|
|
8
|
-
if (name ===
|
|
11
|
+
if (name === unsafeCastOfDocument.state.global.name)
|
|
9
12
|
return;
|
|
10
13
|
dispatch(actions.setSubgraphName({ name }));
|
|
11
|
-
}, [
|
|
14
|
+
}, [unsafeCastOfDocument.state.global.name, dispatch]);
|
|
12
15
|
const onConfirm = useCallback(() => {
|
|
13
16
|
dispatch(actions.setSubgraphStatus({ status: "CONFIRMED" }));
|
|
14
17
|
}, [dispatch]);
|
|
15
|
-
return (_jsx("div", { children: _jsx(SubgraphEditorForm, { subgraphName:
|
|
18
|
+
return (_jsx("div", { children: _jsx(SubgraphEditorForm, { subgraphName: unsafeCastOfDocument.state.global.name ?? "", status: unsafeCastOfDocument.state.global.status, onNameChange: onNameChange, onConfirm: onConfirm }) }));
|
|
16
19
|
}
|
|
17
20
|
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,OAAO,EACR,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAIxE,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC5C,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACxE,MAAM,oBAAoB,GAAG,QAAkC,CAAC;IAEhE,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QAChD,IAAI,IAAI,KAAK,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO;QAC5D,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvD,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,wBACE,KAAC,kBAAkB,IACjB,YAAY,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAC1D,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAChD,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,GACpB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorModule } from "document-model";
|
|
2
|
-
|
|
3
|
-
export declare const module: EditorModule<SubgraphModuleDocument>;
|
|
2
|
+
export declare const module: EditorModule;
|
|
4
3
|
export default module;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/subgraph-editor/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/subgraph-editor/index.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,CAAC,qBAAqB,CAAC;IACtC,MAAM,EAAE;QACN,EAAE,EAAE,wBAAwB;QAC5B,uBAAuB,EAAE,IAAI;QAC7B,sBAAsB,EAAE,IAAI;QAC5B,mBAAmB,EAAE,IAAI;KAC1B;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IDriveContext } from '@powerhousedao/reactor-browser';
|
|
2
2
|
import { type FileNode } from "document-drive";
|
|
3
3
|
import type React from 'react';
|
|
4
4
|
interface DriveExplorerProps {
|
|
5
|
-
context:
|
|
5
|
+
context: IDriveContext;
|
|
6
6
|
documentModels?: FileNode[];
|
|
7
7
|
editors?: FileNode[];
|
|
8
8
|
apps?: FileNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/DriveExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/DriveExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAmD,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,kBAAkB;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;IACxB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuDtD,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useDocumentModelModuleById, useEditorModuleById } from '@powerhousedao/reactor-browser';
|
|
2
3
|
import { DriveHeader } from './components/DriveHeader.js';
|
|
3
4
|
import { ModuleSpecificationsSection } from './components/ModuleSpecificationsSection.js';
|
|
4
5
|
import { PackageInformationSection } from './components/PackageInformationSection.js';
|
|
5
|
-
import { DOCUMENT_TYPES } from './document-types.js';
|
|
6
6
|
export const DriveExplorer = ({ documentModels = [], editors = [], apps = [], subgraphs = [], processors = [], codegenProcessors = [], onShareDrive, onAddDocumentModel, onAddEditor, onAddApp, onAddSubgraph, onAddProcessor, onAddCodegenProcessor, context, packageDocumentId, onAddPackageDocument, driveId, onOpenDocument, }) => {
|
|
7
|
-
const documentModuleModule = packageDocumentId
|
|
8
|
-
|
|
9
|
-
: null;
|
|
10
|
-
const editorModule = packageDocumentId
|
|
11
|
-
? context.getEditor(DOCUMENT_TYPES.documentPackage)
|
|
12
|
-
: null;
|
|
7
|
+
const documentModuleModule = useDocumentModelModuleById(packageDocumentId);
|
|
8
|
+
const editorModule = useEditorModuleById(packageDocumentId);
|
|
13
9
|
return (_jsxs("div", { className: "min-h-screen bg-white", children: [_jsx(DriveHeader, { onShareClick: onShareDrive }), _jsxs("div", { className: "bg-white mx-6 mt-6 ", children: [_jsx(PackageInformationSection, { className: "mb-6", context: context, packageDocumentId: packageDocumentId, onAddPackageDocument: onAddPackageDocument, documentModelModule: documentModuleModule, editorModule: editorModule, driveId: driveId }), _jsx(ModuleSpecificationsSection, { documentModels: documentModels, editors: editors, apps: apps, subgraphs: subgraphs, processors: processors, codegenProcessors: codegenProcessors, onAddDocumentModel: onAddDocumentModel, onAddEditor: onAddEditor, onAddApp: onAddApp, onAddSubgraph: onAddSubgraph, onAddProcessor: onAddProcessor, onAddCodegenProcessor: onAddCodegenProcessor, onOpenDocument: onOpenDocument })] })] }));
|
|
14
10
|
};
|
|
15
11
|
//# sourceMappingURL=DriveExplorer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DriveExplorer.js","sourceRoot":"","sources":["../../../editors/vetra-drive-app/DriveExplorer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DriveExplorer.js","sourceRoot":"","sources":["../../../editors/vetra-drive-app/DriveExplorer.tsx"],"names":[],"mappings":";AA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AAkB,EACtC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,qBAAqB,EAAE,qBAAqB,EAC5C,cAAc,EAAE,cAAc,GAC9B,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type DocumentModelModule, type EditorContext, type PHDocument, type EditorModule } from "document-model";
|
|
1
|
+
import { type IDriveContext, type VetraDocumentModelModule, type VetraEditorModule } from "@powerhousedao/reactor-browser";
|
|
3
2
|
export interface EditorContainerProps {
|
|
4
3
|
driveId: string;
|
|
5
4
|
documentId: string;
|
|
6
5
|
documentType: string;
|
|
7
|
-
context:
|
|
8
|
-
documentModelModule:
|
|
9
|
-
editorModule:
|
|
6
|
+
context: IDriveContext;
|
|
7
|
+
documentModelModule: VetraDocumentModelModule;
|
|
8
|
+
editorModule: VetraEditorModule;
|
|
10
9
|
}
|
|
11
10
|
export declare const EditorContainer: React.FC<EditorContainerProps>;
|
|
12
11
|
//# sourceMappingURL=EditorContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorContainer.d.ts","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/EditorContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EditorContainer.d.ts","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/EditorContainer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAAE,KAAK,iBAAiB,EACtD,MAAM,gCAAgC,CAAC;AAItC,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwB1D,CAAC"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useDriveContext, } from "@powerhousedao/reactor-browser";
|
|
3
2
|
import { DefaultEditorLoader, } from "@powerhousedao/design-system";
|
|
3
|
+
import { useSelectedDrive } from "@powerhousedao/reactor-browser";
|
|
4
|
+
import { error } from "console";
|
|
4
5
|
import { Suspense } from "react";
|
|
5
6
|
export const EditorContainer = (props) => {
|
|
6
|
-
const {
|
|
7
|
-
const
|
|
8
|
-
const user = context.user;
|
|
9
|
-
const { dispatch, error, document } = useDocumentEditorProps({
|
|
10
|
-
documentId,
|
|
11
|
-
documentType,
|
|
12
|
-
driveId,
|
|
13
|
-
documentModelModule,
|
|
14
|
-
user,
|
|
15
|
-
});
|
|
7
|
+
const { context, editorModule } = props;
|
|
8
|
+
const drive = useSelectedDrive();
|
|
16
9
|
const loadingContent = (_jsx("div", { className: "flex-1 flex justify-center items-center h-full", children: _jsx(DefaultEditorLoader, {}) }));
|
|
17
10
|
if (!document)
|
|
18
11
|
return loadingContent;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
return (_jsx(Suspense, { fallback: loadingContent, children: _jsx(EditorComponent, { context: context, dispatch: dispatch, document: document, error: error }) }));
|
|
12
|
+
const EditorComponent = editorModule.Component;
|
|
13
|
+
return (_jsx(Suspense, { fallback: loadingContent, children: _jsx(EditorComponent, { context: context, document: drive, error: error }) }));
|
|
22
14
|
};
|
|
23
15
|
//# sourceMappingURL=EditorContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorContainer.js","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/EditorContainer.tsx"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"EditorContainer.js","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/EditorContainer.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,gBAAgB,EAGjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAW/B,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IAGjC,MAAM,cAAc,GAAG,CACrB,cAAK,SAAS,EAAC,gDAAgD,YAC7D,KAAC,mBAAmB,KAAG,GACnB,CACP,CAAC;IAEF,IAAI,CAAC,QAAQ;QAAE,OAAO,cAAc,CAAC;IAErC,MAAM,eAAe,GAAG,YAAY,CAAC,SAAS,CAAC;IAE/C,OAAO,CACL,KAAC,QAAQ,IAAC,QAAQ,EAAE,cAAc,YAChC,KAAC,eAAe,IACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,KAAK,EACf,KAAK,EAAE,KAAK,GACZ,GACO,CACZ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type DocumentModelModule, type EditorModule, type PHDocument } from 'document-model';
|
|
1
|
+
import { IDriveContext, type VetraDocumentModelModule, type VetraEditorModule } from '@powerhousedao/reactor-browser';
|
|
3
2
|
import type React from 'react';
|
|
4
3
|
interface PackageInformationSectionProps {
|
|
5
4
|
className?: string;
|
|
6
|
-
context:
|
|
5
|
+
context: IDriveContext;
|
|
7
6
|
packageDocumentId?: string;
|
|
8
7
|
onAddPackageDocument?: () => void;
|
|
9
|
-
documentModelModule?:
|
|
10
|
-
editorModule?:
|
|
8
|
+
documentModelModule?: VetraDocumentModelModule;
|
|
9
|
+
editorModule?: VetraEditorModule;
|
|
11
10
|
driveId: string;
|
|
12
11
|
}
|
|
13
12
|
export declare const PackageInformationSection: React.FC<PackageInformationSectionProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageInformationSection.d.ts","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/PackageInformationSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PackageInformationSection.d.ts","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/PackageInformationSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,wBAAwB,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACtH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,8BAA8B;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAoC9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageInformationSection.js","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/PackageInformationSection.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PackageInformationSection.js","sourceRoot":"","sources":["../../../../editors/vetra-drive-app/components/PackageInformationSection.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAYzD,MAAM,CAAC,MAAM,yBAAyB,GAA6C,CAAC,EAClF,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,OAAO,GACR,EAAE,EAAE;IACH,MAAM,oBAAoB,GAAG,CAC3B,iBACE,SAAS,EAAC,kFAAkF,EAC5F,OAAO,EAAE,oBAAoB,iDAGtB,CACV,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,IAAC,KAAK,EAAC,qBAAqB,EAAC,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,YACnF,cAAK,SAAS,EAAC,EAAE,YACd,iBAAiB,IAAI,mBAAmB,IAAI,YAAY,CAAC,CAAC,CAAC,CAC1D,KAAC,eAAe,IACd,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,OAAO,EAChB,mBAAmB,EAAE,mBAAmB,EACxC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,cAAc,CAAC,eAAe,GAC5C,CACH,CAAC,CAAC,CAAC,CACF,oBAAoB,CACrB,GACG,GACW,CACpB,CAAC;AACJ,CAAC,CAAC"}
|