@powerhousedao/vetra 4.1.0-dev.80 → 4.1.0-dev.81

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.
Files changed (93) hide show
  1. package/dist/document-models/app-module/gen/base-operations/actions.d.ts +6 -2
  2. package/dist/document-models/app-module/gen/base-operations/actions.d.ts.map +1 -1
  3. package/dist/document-models/app-module/gen/base-operations/creators.d.ts +3 -2
  4. package/dist/document-models/app-module/gen/base-operations/creators.d.ts.map +1 -1
  5. package/dist/document-models/app-module/gen/base-operations/creators.js +1 -0
  6. package/dist/document-models/app-module/gen/base-operations/operations.d.ts +2 -1
  7. package/dist/document-models/app-module/gen/base-operations/operations.d.ts.map +1 -1
  8. package/dist/document-models/app-module/gen/document-model.d.ts.map +1 -1
  9. package/dist/document-models/app-module/gen/document-model.js +15 -4
  10. package/dist/document-models/app-module/gen/ph-factories.d.ts.map +1 -1
  11. package/dist/document-models/app-module/gen/ph-factories.js +2 -4
  12. package/dist/document-models/app-module/gen/reducer.d.ts.map +1 -1
  13. package/dist/document-models/app-module/gen/reducer.js +4 -0
  14. package/dist/document-models/app-module/gen/schema/types.d.ts +6 -11
  15. package/dist/document-models/app-module/gen/schema/types.d.ts.map +1 -1
  16. package/dist/document-models/app-module/gen/schema/zod.d.ts +2 -3
  17. package/dist/document-models/app-module/gen/schema/zod.d.ts.map +1 -1
  18. package/dist/document-models/app-module/gen/schema/zod.js +8 -17
  19. package/dist/document-models/app-module/gen/utils.d.ts.map +1 -1
  20. package/dist/document-models/app-module/gen/utils.js +2 -4
  21. package/dist/document-models/app-module/index.d.ts +1 -0
  22. package/dist/document-models/app-module/index.d.ts.map +1 -1
  23. package/dist/document-models/app-module/src/reducers/base-operations.d.ts.map +1 -1
  24. package/dist/document-models/app-module/src/reducers/base-operations.js +12 -9
  25. package/dist/document-models/app-module/src/reducers/dnd-operations.d.ts.map +1 -1
  26. package/dist/document-models/app-module/src/reducers/dnd-operations.js +1 -4
  27. package/dist/editors/app-editor/components/AppEditorForm.d.ts +1 -13
  28. package/dist/editors/app-editor/components/AppEditorForm.d.ts.map +1 -1
  29. package/dist/editors/app-editor/components/AppEditorForm.js +82 -52
  30. package/dist/editors/app-editor/config.d.ts +3 -0
  31. package/dist/editors/app-editor/config.d.ts.map +1 -0
  32. package/dist/editors/app-editor/config.js +3 -0
  33. package/dist/editors/app-editor/editor.d.ts.map +1 -1
  34. package/dist/editors/app-editor/editor.js +4 -24
  35. package/dist/editors/app-editor/index.d.ts.map +1 -1
  36. package/dist/editors/app-editor/index.js +1 -3
  37. package/dist/editors/document-editor/config.d.ts +3 -0
  38. package/dist/editors/document-editor/config.d.ts.map +1 -0
  39. package/dist/editors/document-editor/config.js +3 -0
  40. package/dist/editors/document-editor/editor.d.ts.map +1 -1
  41. package/dist/editors/document-editor/editor.js +3 -0
  42. package/dist/editors/document-editor/index.d.ts.map +1 -1
  43. package/dist/editors/document-editor/index.js +1 -3
  44. package/dist/editors/hooks/useAvailableDocumentTypes.d.ts +1 -1
  45. package/dist/editors/hooks/useAvailableDocumentTypes.d.ts.map +1 -1
  46. package/dist/editors/hooks/useAvailableDocumentTypes.js +17 -36
  47. package/dist/editors/processor-editor/config.d.ts +3 -0
  48. package/dist/editors/processor-editor/config.d.ts.map +1 -0
  49. package/dist/editors/processor-editor/config.js +3 -0
  50. package/dist/editors/processor-editor/editor.d.ts.map +1 -1
  51. package/dist/editors/processor-editor/editor.js +3 -0
  52. package/dist/editors/processor-editor/index.d.ts.map +1 -1
  53. package/dist/editors/processor-editor/index.js +1 -3
  54. package/dist/editors/subgraph-editor/config.d.ts +3 -0
  55. package/dist/editors/subgraph-editor/config.d.ts.map +1 -0
  56. package/dist/editors/subgraph-editor/config.js +3 -0
  57. package/dist/editors/subgraph-editor/editor.d.ts.map +1 -1
  58. package/dist/editors/subgraph-editor/editor.js +3 -0
  59. package/dist/editors/subgraph-editor/index.d.ts.map +1 -1
  60. package/dist/editors/subgraph-editor/index.js +1 -3
  61. package/dist/editors/vetra-drive-app/DriveExplorer.d.ts +0 -2
  62. package/dist/editors/vetra-drive-app/DriveExplorer.d.ts.map +1 -1
  63. package/dist/editors/vetra-drive-app/config.d.ts +3 -0
  64. package/dist/editors/vetra-drive-app/config.d.ts.map +1 -0
  65. package/dist/editors/vetra-drive-app/config.js +11 -0
  66. package/dist/editors/vetra-drive-app/editor.d.ts +3 -4
  67. package/dist/editors/vetra-drive-app/editor.d.ts.map +1 -1
  68. package/dist/editors/vetra-drive-app/editor.js +6 -4
  69. package/dist/editors/vetra-drive-app/index.d.ts +2 -2
  70. package/dist/editors/vetra-drive-app/index.d.ts.map +1 -1
  71. package/dist/editors/vetra-drive-app/index.js +0 -14
  72. package/dist/editors/vetra-package/config.d.ts +3 -0
  73. package/dist/editors/vetra-package/config.d.ts.map +1 -0
  74. package/dist/editors/vetra-package/config.js +3 -0
  75. package/dist/editors/vetra-package/editor.d.ts.map +1 -1
  76. package/dist/editors/vetra-package/editor.js +3 -0
  77. package/dist/editors/vetra-package/index.d.ts.map +1 -1
  78. package/dist/editors/vetra-package/index.js +1 -3
  79. package/dist/index.d.ts +1 -2
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -1
  82. package/dist/processors/codegen/document-handlers/generators/app-generator.js +7 -9
  83. package/dist/style.css +0 -3
  84. package/dist/subgraphs/app-module/resolvers.d.ts +1 -1
  85. package/dist/subgraphs/app-module/resolvers.d.ts.map +1 -1
  86. package/dist/subgraphs/app-module/resolvers.js +13 -2
  87. package/dist/subgraphs/app-module/schema.d.ts.map +1 -1
  88. package/dist/subgraphs/app-module/schema.js +11 -13
  89. package/dist/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +14 -14
  91. package/dist/editors/vetra-drive-app/utils/withDropZone.d.ts +0 -4
  92. package/dist/editors/vetra-drive-app/utils/withDropZone.d.ts.map +0 -1
  93. package/dist/editors/vetra-drive-app/utils/withDropZone.js +0 -18
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,4CAoDrB"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names":[],"mappings":"AAIA,wBAAgB,MAAM,4CAIrB"}
@@ -1,28 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback } from "react";
3
- import { actions } from "../../document-models/app-module/index.js";
4
- import { useSelectedAppModuleDocument } from "../hooks/useVetraDocument.js";
2
+ import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
5
3
  import { AppEditorForm } from "./components/AppEditorForm.js";
4
+ import { editorConfig } from "./config.js";
6
5
  export function Editor() {
7
- const [document, dispatch] = useSelectedAppModuleDocument();
8
- const onNameChange = useCallback((name) => {
9
- if (name === document.state.global.name)
10
- return;
11
- dispatch(actions.setAppName({ name }));
12
- }, [document.state.global.name, dispatch]);
13
- const onConfirm = useCallback(() => {
14
- dispatch(actions.setAppStatus({ status: "CONFIRMED" }));
15
- }, [dispatch]);
16
- const onDragAndDropToggle = useCallback((enabled) => {
17
- if (enabled === document.state.global.dragAndDrop?.enabled)
18
- return;
19
- dispatch(actions.setDragAndDropEnabled({ enabled }));
20
- }, [document.state.global.dragAndDrop?.enabled, dispatch]);
21
- const onAddDocumentType = useCallback((id, documentType) => {
22
- dispatch(actions.addDocumentType({ id, documentType }));
23
- }, [dispatch]);
24
- const onRemoveDocumentType = useCallback((id) => {
25
- dispatch(actions.removeDocumentType({ id }));
26
- }, [dispatch]);
27
- return (_jsx("div", { children: _jsx(AppEditorForm, { appName: document.state.global.name ?? "", status: document.state.global.status, dragAndDropEnabled: document.state.global.dragAndDrop?.enabled ?? false, documentTypes: document.state.global.documentTypes ?? [], onNameChange: onNameChange, onDragAndDropToggle: onDragAndDropToggle, onAddDocumentType: onAddDocumentType, onRemoveDocumentType: onRemoveDocumentType, onConfirm: onConfirm }) }));
6
+ useSetPHDocumentEditorConfig(editorConfig);
7
+ return _jsx(AppEditorForm, {});
28
8
  }
@@ -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;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,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,YAOpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -4,9 +4,7 @@ export const module = {
4
4
  documentTypes: ["powerhouse/app"],
5
5
  config: {
6
6
  id: "app-module-editor",
7
- disableExternalControls: true,
8
- documentToolbarEnabled: true,
9
- showSwitchboardLink: true,
7
+ name: "App Module Editor",
10
8
  },
11
9
  };
12
10
  export default module;
@@ -0,0 +1,3 @@
1
+ import type { PHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
+ export declare const editorConfig: PHDocumentEditorConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,eAAO,MAAM,YAAY,EAAE,sBAE1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const editorConfig = {
2
+ isExternalControlsEnabled: false,
3
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":"AASA,wBAAgB,MAAM,4CA4CrB"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":"AAWA,wBAAgB,MAAM,4CA6CrB"}
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
3
  import { useCallback } from "react";
3
4
  import { actions } from "../../document-models/document-editor/index.js";
4
5
  import { useSelectedDocumentEditorDocument } from "../hooks/useVetraDocument.js";
5
6
  import { DocumentEditorForm } from "./components/DocumentEditorForm.js";
7
+ import { editorConfig } from "./config.js";
6
8
  export function Editor() {
9
+ useSetPHDocumentEditorConfig(editorConfig);
7
10
  const [document, dispatch] = useSelectedDocumentEditorDocument();
8
11
  const onEditorNameChange = useCallback((name) => {
9
12
  if (!document.state.global.name && !name)
@@ -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;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,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,YAOpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -4,9 +4,7 @@ export const module = {
4
4
  documentTypes: ["powerhouse/document-editor"],
5
5
  config: {
6
6
  id: "document-editor-editor",
7
- disableExternalControls: true,
8
- documentToolbarEnabled: true,
9
- showSwitchboardLink: true,
7
+ name: "Document Editor Editor",
10
8
  },
11
9
  };
12
10
  export default module;
@@ -1,2 +1,2 @@
1
- export declare function useAvailableDocumentTypes(onlyVetraDocuments?: boolean): string[];
1
+ export declare function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments?: boolean): string[];
2
2
  //# sourceMappingURL=useAvailableDocumentTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAvailableDocumentTypes.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useAvailableDocumentTypes.ts"],"names":[],"mappings":"AAMA,wBAAgB,yBAAyB,CACvC,kBAAkB,UAAQ,GACzB,MAAM,EAAE,CA8CV"}
1
+ {"version":3,"file":"useAvailableDocumentTypes.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useAvailableDocumentTypes.ts"],"names":[],"mappings":"AAYA,wBAAgB,yBAAyB,CACvC,mCAAmC,UAAQ,GAC1C,MAAM,EAAE,CAkBV"}
@@ -1,37 +1,18 @@
1
- import { useReactor, useSelectedDriveId } from "@powerhousedao/reactor-browser";
2
- import { useEffect, useState } from "react";
3
- const DEFAULT_DRIVE_ID = "vetra";
4
- export function useAvailableDocumentTypes(onlyVetraDocuments = false) {
5
- const [availableDocumentTypes, setAvailableDocumentTypes] = useState([]);
6
- const reactor = useReactor();
7
- const selectedDriveId = useSelectedDriveId();
8
- useEffect(() => {
9
- async function loadDocumentTypes() {
10
- const moduleDocIds = [];
11
- // Get from reactor document model modules (if not onlyVetraDocuments)
12
- if (!onlyVetraDocuments) {
13
- const docModels = reactor?.getDocumentModelModules() ?? [];
14
- moduleDocIds.push(...docModels.map((model) => model.documentModel.global.id));
15
- }
16
- // Get from vetra drive
17
- const driveDocIds = [];
18
- const driveDocs = await reactor?.getDocuments(selectedDriveId ?? DEFAULT_DRIVE_ID);
19
- if (driveDocs) {
20
- for (const docId of driveDocs) {
21
- const document = await reactor?.getDocument(docId);
22
- if (document?.header.documentType === "powerhouse/document-model") {
23
- const documentModel = document;
24
- driveDocIds.push(documentModel.state.global.id);
25
- }
26
- }
27
- }
28
- // Combine and deduplicate (or just use driveDocIds if onlyVetraDocuments)
29
- const uniqueIds = onlyVetraDocuments
30
- ? driveDocIds
31
- : [...new Set([...moduleDocIds, ...driveDocIds])];
32
- setAvailableDocumentTypes(uniqueIds);
33
- }
34
- void loadDocumentTypes();
35
- }, [reactor, selectedDriveId, onlyVetraDocuments]);
36
- return availableDocumentTypes;
1
+ import { useDocumentsInSelectedDrive, useSupportedDocumentTypesInReactor, } from "@powerhousedao/reactor-browser";
2
+ function isDocumentModelDocument(document) {
3
+ return document.header.documentType === "powerhouse/document-model";
4
+ }
5
+ export function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments = false) {
6
+ const supportedDocumentTypes = useSupportedDocumentTypesInReactor() ?? [];
7
+ const documents = useDocumentsInSelectedDrive() ?? [];
8
+ const documentModelDocumentsInSelectedDrive = documents.filter(isDocumentModelDocument);
9
+ const documentTypesFromDocumentModelDocuments = documentModelDocumentsInSelectedDrive.map((doc) => doc.state.global.id);
10
+ if (onlyDocumentTypesFromDriveDocuments)
11
+ return [...new Set(documentTypesFromDocumentModelDocuments)];
12
+ return [
13
+ ...new Set([
14
+ ...supportedDocumentTypes,
15
+ ...documentTypesFromDocumentModelDocuments,
16
+ ]),
17
+ ];
37
18
  }
@@ -0,0 +1,3 @@
1
+ import type { PHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
+ export declare const editorConfig: PHDocumentEditorConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,eAAO,MAAM,YAAY,EAAE,sBAE1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const editorConfig = {
2
+ isExternalControlsEnabled: false,
3
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,4CAqDrB"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":"AAOA,wBAAgB,MAAM,4CAsDrB"}
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
3
  import { useCallback } from "react";
3
4
  import { actions } from "../../document-models/processor-module/index.js";
4
5
  import { useSelectedProcessorModuleDocument } from "../hooks/useVetraDocument.js";
5
6
  import { ProcessorEditorForm } from "./components/ProcessorEditorForm.js";
7
+ import { editorConfig } from "./config.js";
6
8
  export function Editor() {
9
+ useSetPHDocumentEditorConfig(editorConfig);
7
10
  const [document, dispatch] = useSelectedProcessorModuleDocument();
8
11
  const onConfirm = useCallback(() => {
9
12
  // Dispatch all actions at once
@@ -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;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,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,YAOpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -4,9 +4,7 @@ export const module = {
4
4
  documentTypes: ["powerhouse/processor"],
5
5
  config: {
6
6
  id: "processor-module-editor",
7
- disableExternalControls: true,
8
- documentToolbarEnabled: true,
9
- showSwitchboardLink: true,
7
+ name: "Processor Module Editor",
10
8
  },
11
9
  };
12
10
  export default module;
@@ -0,0 +1,3 @@
1
+ import type { PHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
+ export declare const editorConfig: PHDocumentEditorConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,eAAO,MAAM,YAAY,EAAE,sBAE1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const editorConfig = {
2
+ isExternalControlsEnabled: false,
3
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,4CAyBrB"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":"AAOA,wBAAgB,MAAM,4CA0BrB"}
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
3
  import { useCallback } from "react";
3
4
  import { actions } from "../../document-models/subgraph-module/index.js";
4
5
  import { useSelectedSubgraphModuleDocument } from "../hooks/useVetraDocument.js";
5
6
  import { SubgraphEditorForm } from "./components/SubgraphEditorForm.js";
7
+ import { editorConfig } from "./config.js";
6
8
  export function Editor() {
9
+ useSetPHDocumentEditorConfig(editorConfig);
7
10
  const [document, dispatch] = useSelectedSubgraphModuleDocument();
8
11
  const onNameChange = useCallback((name) => {
9
12
  if (name === document.state.global.name)
@@ -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;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC;AAEF,eAAe,MAAM,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,YAOpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -4,9 +4,7 @@ export const module = {
4
4
  documentTypes: ["powerhouse/subgraph"],
5
5
  config: {
6
6
  id: "subgraph-module-editor",
7
- disableExternalControls: true,
8
- documentToolbarEnabled: true,
9
- showSwitchboardLink: true,
7
+ name: "Subgraph Module Editor",
10
8
  },
11
9
  };
12
10
  export default module;
@@ -1,8 +1,6 @@
1
1
  import type { FileNode } from "document-drive";
2
- import type { EditorContext } from "document-model";
3
2
  import type React from "react";
4
3
  interface DriveExplorerProps {
5
- context?: EditorContext;
6
4
  documentModels?: FileNode[];
7
5
  editors?: FileNode[];
8
6
  apps?: FileNode[];
@@ -1 +1 @@
1
- {"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/DriveExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,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,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkDtD,CAAC"}
1
+ {"version":3,"file":"DriveExplorer.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/DriveExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,kBAAkB;IAC1B,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,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkDtD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { PHDriveEditorConfig } from "@powerhousedao/reactor-browser";
2
+ export declare const editorConfig: PHDriveEditorConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,YAAY,EAAE,mBAU1B,CAAC"}
@@ -0,0 +1,11 @@
1
+ export const editorConfig = {
2
+ allowedDocumentTypes: [
3
+ "powerhouse/document-model",
4
+ "powerhouse/app",
5
+ "powerhouse/document-editor",
6
+ "powerhouse/processor",
7
+ "powerhouse/subgraph",
8
+ "powerhouse/package",
9
+ ],
10
+ isDragAndDropEnabled: true,
11
+ };
@@ -1,5 +1,4 @@
1
- import type { DriveEditorProps } from "@powerhousedao/reactor-browser";
2
- export type IProps = DriveEditorProps;
3
- export declare function BaseEditor(props: IProps): string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
4
- export declare function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { EditorProps } from "document-model";
2
+ export declare function BaseEditor(props: EditorProps): string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
3
+ export declare function Editor(props: EditorProps): 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/vetra-drive-app/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAiBvE,MAAM,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAEtC,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qVA8FvC;AAID,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,2CASnC"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/editor.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,qVA8F5C;AAQD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAUxC"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { WagmiContext } from "@powerhousedao/design-system";
3
- import { addDocument, AnalyticsProvider, setSelectedNode, showCreateDocumentModal, showDeleteNodeModal, useAnalyticsDatabaseName, useDocumentModelModules, useSelectedDrive, } from "@powerhousedao/reactor-browser";
2
+ import { DropZoneWrapper, WagmiContext } from "@powerhousedao/design-system";
3
+ import { addDocument, AnalyticsProvider, setSelectedNode, showCreateDocumentModal, showDeleteNodeModal, useDocumentModelModules, useSelectedDrive, useSetPHDriveEditorConfig, } from "@powerhousedao/reactor-browser";
4
+ import { useAnalyticsDatabaseName } from "@powerhousedao/reactor-browser/connect";
4
5
  import { useCallback } from "react";
6
+ import { editorConfig } from "./config.js";
5
7
  import { DOCUMENT_TYPES } from "./document-types.js";
6
8
  import { DriveExplorer } from "./DriveExplorer.js";
7
- import { withDropZone } from "./utils/withDropZone.js";
8
9
  export function BaseEditor(props) {
9
10
  const { children } = props;
10
11
  const [document] = useSelectedDrive();
@@ -38,8 +39,9 @@ export function BaseEditor(props) {
38
39
  const showDocumentEditor = !!children;
39
40
  return showDocumentEditor ? (children) : (_jsx("div", { style: { height: "100%" }, className: "bg-white after:pointer-events-none after:absolute after:inset-0 after:bg-blue-500 after:opacity-0 after:transition after:content-['']", children: _jsx(DriveExplorer, { documentModels: docModelsNodes, editors: docEditorsNodes, apps: docAppsNodes, subgraphs: docSubgraphsNodes, processors: docProcessorsNodes, codegenProcessors: [], onAddDocumentModel: () => onCreateDocument(DOCUMENT_TYPES.documentModel), onAddEditor: () => onCreateDocument(DOCUMENT_TYPES.documentEditor), onAddApp: () => onCreateDocument(DOCUMENT_TYPES.documentApp), onAddSubgraph: () => onCreateDocument(DOCUMENT_TYPES.documentSubgraph), onAddProcessor: () => onCreateDocument(DOCUMENT_TYPES.documentProcessor), onAddCodegenProcessor: () => console.log("add codegen processor"), packageDocumentId: packageDocumentId, onAddPackageDocument: onCreatePackageFile, onOpenPackageDocument: onOpenPackageDocument, onOpenDocument: (node) => setSelectedNode(node), onDelete: onDeleteDocument }) }));
40
41
  }
41
- const BaseEditorWithDropZone = withDropZone(BaseEditor);
42
+ const BaseEditorWithDropZone = (props) => (_jsx(DropZoneWrapper, { children: _jsx(BaseEditor, { ...props }) }));
42
43
  export function Editor(props) {
44
+ useSetPHDriveEditorConfig(editorConfig);
43
45
  const analyticsDatabaseName = useAnalyticsDatabaseName();
44
46
  return (_jsx(WagmiContext, { children: _jsx(AnalyticsProvider, { databaseName: analyticsDatabaseName, children: _jsx(BaseEditorWithDropZone, { ...props }) }) }));
45
47
  }
@@ -1,4 +1,4 @@
1
- import type { DriveEditorModule } from "@powerhousedao/reactor-browser";
2
- export declare const module: DriveEditorModule;
1
+ import type { EditorModule } from "document-model";
2
+ export declare const module: EditorModule;
3
3
  export default module;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,eAAO,MAAM,MAAM,EAAE,iBAqBpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/vetra-drive-app/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YAOpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -5,20 +5,6 @@ export const module = {
5
5
  config: {
6
6
  id: "vetra-drive-app",
7
7
  name: "Vetra Drive App",
8
- disableExternalControls: true,
9
- documentToolbarEnabled: true,
10
- showSwitchboardLink: true,
11
- documentTypes: [
12
- "powerhouse/document-model",
13
- "powerhouse/app",
14
- "powerhouse/document-editor",
15
- "powerhouse/processor",
16
- "powerhouse/subgraph",
17
- "powerhouse/package",
18
- ],
19
- dragAndDrop: {
20
- enabled: true,
21
- },
22
8
  },
23
9
  };
24
10
  export default module;
@@ -0,0 +1,3 @@
1
+ import type { PHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
+ export declare const editorConfig: PHDocumentEditorConfig;
3
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/vetra-package/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAE7E,eAAO,MAAM,YAAY,EAAE,sBAE1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const editorConfig = {
2
+ isExternalControlsEnabled: false,
3
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/vetra-package/editor.tsx"],"names":[],"mappings":"AAKA,wBAAgB,MAAM,4CAwGrB"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/vetra-package/editor.tsx"],"names":[],"mappings":"AAOA,wBAAgB,MAAM,4CAyGrB"}
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
2
3
  import { useCallback } from "react";
3
4
  import { actions } from "../../document-models/vetra-package/index.js";
4
5
  import { useSelectedDriveVetraPackage } from "../hooks/useVetraDocument.js";
5
6
  import { MetaForm } from "./components/MetaForm.js";
7
+ import { editorConfig } from "./config.js";
6
8
  export function Editor() {
9
+ useSetPHDocumentEditorConfig(editorConfig);
7
10
  const [document, dispatch] = useSelectedDriveVetraPackage();
8
11
  const onNameChange = useCallback((name) => {
9
12
  if (!document.state.global.name && !name)
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/vetra-package/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
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/vetra-package/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YAOpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -4,9 +4,7 @@ export const module = {
4
4
  documentTypes: ["powerhouse/package"],
5
5
  config: {
6
6
  id: "vetra-package-editor",
7
- disableExternalControls: true,
8
- documentToolbarEnabled: true,
9
- showSwitchboardLink: true,
7
+ name: "Vetra Package Editor",
10
8
  },
11
9
  };
12
10
  export default module;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { DriveEditorModule } from "@powerhousedao/reactor-browser";
2
1
  import type { DocumentModelModule, EditorModule, Manifest } from "document-model";
3
2
  import type { AppModulePHState } from "./document-models/app-module/gen/types.js";
4
3
  import type { DocumentEditorPHState } from "./document-models/document-editor/gen/types.js";
@@ -7,6 +6,6 @@ import type { SubgraphModulePHState } from "./document-models/subgraph-module/ge
7
6
  import type { VetraPackagePHState } from "./document-models/vetra-package/gen/types.js";
8
7
  export declare const manifest: Manifest;
9
8
  export declare const documentModels: (DocumentModelModule<DocumentEditorPHState> | DocumentModelModule<VetraPackagePHState> | DocumentModelModule<SubgraphModulePHState> | DocumentModelModule<ProcessorModulePHState> | DocumentModelModule<AppModulePHState>)[];
10
- export declare const editors: (EditorModule | DriveEditorModule)[];
9
+ export declare const editors: EditorModule[];
11
10
  export * from "./editors/hooks/useVetraDocument.js";
12
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAE5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAIxF,eAAO,MAAM,QAAQ,EAAE,QAAuB,CAAC;AAC/C,eAAO,MAAM,cAAc,EAAE,CACzB,mBAAmB,CAAC,qBAAqB,CAAC,GAC1C,mBAAmB,CAAC,mBAAmB,CAAC,GACxC,mBAAmB,CAAC,qBAAqB,CAAC,GAC1C,mBAAmB,CAAC,sBAAsB,CAAC,GAC3C,mBAAmB,CAAC,gBAAgB,CAAC,CACxC,EAAyC,CAAC;AAC3C,eAAO,MAAM,OAAO,EAAE,CAAC,YAAY,GAAG,iBAAiB,CAAC,EACzB,CAAC;AAEhC,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAE5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAIxF,eAAO,MAAM,QAAQ,EAAE,QAAuB,CAAC;AAC/C,eAAO,MAAM,cAAc,EAAE,CACzB,mBAAmB,CAAC,qBAAqB,CAAC,GAC1C,mBAAmB,CAAC,mBAAmB,CAAC,GACxC,mBAAmB,CAAC,qBAAqB,CAAC,GAC1C,mBAAmB,CAAC,sBAAsB,CAAC,GAC3C,mBAAmB,CAAC,gBAAgB,CAAC,CACxC,EAAyC,CAAC;AAC3C,eAAO,MAAM,OAAO,EAAE,YAAY,EAAkC,CAAC;AAErE,cAAc,qCAAqC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/app-generator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,eAAe;IAC/C,QAAQ,CAAC,sBAAsB,oBAAoB;IAEnD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO;IA4BnD,QAAQ,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;CAsFjE"}
1
+ {"version":3,"file":"app-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/app-generator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,eAAe;IAC/C,QAAQ,CAAC,sBAAsB,oBAAoB;IAEnD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO;IA4BnD,QAAQ,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;CA0EjE"}
@@ -39,16 +39,14 @@ export class AppGenerator extends BaseDocumentGen {
39
39
  try {
40
40
  // Generate app ID using kebabCase
41
41
  const appId = kebabCase(state.name);
42
- // Extract editor settings if available
43
- let editorOptions;
44
- if (state.dragAndDrop?.enabled) {
45
- editorOptions = {
46
- enabled: state.dragAndDrop.enabled,
47
- documentTypes: state.documentTypes?.map((item) => item.documentType) || [],
48
- };
49
- }
50
42
  // Generate the drive editor using the codegen function
51
- await generateDriveEditor(state.name, this.config.PH_CONFIG, appId, editorOptions);
43
+ await generateDriveEditor({
44
+ name: state.name,
45
+ config: this.config.PH_CONFIG,
46
+ appId: appId,
47
+ allowedDocumentTypes: state.allowedDocumentTypes?.join(","),
48
+ isDragAndDropEnabled: state.isDragAndDropEnabled,
49
+ });
52
50
  logger.info(`✅ Drive editor generation completed successfully for app: ${state.name}`);
53
51
  // Update the manifest with the new app
54
52
  try {
package/dist/style.css CHANGED
@@ -525,9 +525,6 @@
525
525
  .text-yellow-800 {
526
526
  color: var(--color-yellow-800);
527
527
  }
528
- .italic {
529
- font-style: italic;
530
- }
531
528
  .filter {
532
529
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
533
530
  }
@@ -1,3 +1,3 @@
1
- import { type BaseSubgraph } from "@powerhousedao/reactor-api";
1
+ import type { BaseSubgraph } from "@powerhousedao/reactor-api";
2
2
  export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/app-module/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAa/D,eAAO,MAAM,YAAY,GACvB,UAAU,YAAY,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CA0MxB,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/app-module/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAc/D,eAAO,MAAM,YAAY,GACvB,UAAU,YAAY,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAkOxB,CAAC"}
@@ -1,7 +1,6 @@
1
- import {} from "@powerhousedao/reactor-api";
2
1
  import { addFile } from "document-drive";
3
- import { setName } from "document-model";
4
2
  import { actions, } from "../../document-models/app-module/index.js";
3
+ import { setName } from "document-model";
5
4
  export const getResolvers = (subgraph) => {
6
5
  const reactor = subgraph.reactor;
7
6
  return {
@@ -116,6 +115,18 @@ export const getResolvers = (subgraph) => {
116
115
  }
117
116
  return true;
118
117
  },
118
+ AppModule_setDocumentTypes: async (_, args) => {
119
+ const { docId, input } = args;
120
+ const doc = await reactor.getDocument(docId);
121
+ if (!doc) {
122
+ throw new Error("Document not found");
123
+ }
124
+ const result = await reactor.addAction(docId, actions.setDocumentTypes(input));
125
+ if (result.status !== "SUCCESS") {
126
+ throw new Error(result.error?.message ?? "Failed to setDocumentTypes");
127
+ }
128
+ return true;
129
+ },
119
130
  AppModule_setDragAndDropEnabled: async (_, args) => {
120
131
  const { docId, input } = args;
121
132
  const doc = await reactor.getDocument(docId);
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/app-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA6FpB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/app-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA2FpB,CAAC"}
@@ -6,8 +6,8 @@ export const schema = gql `
6
6
  type AppModuleState {
7
7
  name: String!
8
8
  status: StatusType!
9
- documentTypes: [DocumentTypeItem!]
10
- dragAndDrop: DragAndDropSettings
9
+ allowedDocumentTypes: [String!]
10
+ isDragAndDropEnabled: Boolean!
11
11
  }
12
12
 
13
13
  enum StatusType {
@@ -15,15 +15,6 @@ export const schema = gql `
15
15
  CONFIRMED
16
16
  }
17
17
 
18
- type DocumentTypeItem {
19
- id: OID!
20
- documentType: String!
21
- }
22
-
23
- type DragAndDropSettings {
24
- enabled: Boolean!
25
- }
26
-
27
18
  """
28
19
  Queries: AppModule
29
20
  """
@@ -62,6 +53,11 @@ export const schema = gql `
62
53
  docId: PHID
63
54
  input: AppModule_RemoveDocumentTypeInput
64
55
  ): Int
56
+ AppModule_setDocumentTypes(
57
+ driveId: String
58
+ docId: PHID
59
+ input: AppModule_SetDocumentTypesInput
60
+ ): Int
65
61
  AppModule_setDragAndDropEnabled(
66
62
  driveId: String
67
63
  docId: PHID
@@ -79,11 +75,13 @@ export const schema = gql `
79
75
  status: StatusType!
80
76
  }
81
77
  input AppModule_AddDocumentTypeInput {
82
- id: OID!
83
78
  documentType: String!
84
79
  }
85
80
  input AppModule_RemoveDocumentTypeInput {
86
- id: OID!
81
+ documentType: String!
82
+ }
83
+ input AppModule_SetDocumentTypesInput {
84
+ documentTypes: [String!]!
87
85
  }
88
86
 
89
87
  """