@powerhousedao/vetra 4.1.0-dev.22 → 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.
Files changed (184) hide show
  1. package/dist/document-models/app-module/gen/object.d.ts +3 -3
  2. package/dist/document-models/app-module/gen/object.d.ts.map +1 -1
  3. package/dist/document-models/app-module/gen/object.js.map +1 -1
  4. package/dist/document-models/app-module/gen/types.d.ts +2 -2
  5. package/dist/document-models/app-module/gen/types.d.ts.map +1 -1
  6. package/dist/document-models/app-module/gen/utils.d.ts.map +1 -1
  7. package/dist/document-models/app-module/gen/utils.js +2 -1
  8. package/dist/document-models/app-module/gen/utils.js.map +1 -1
  9. package/dist/document-models/document-editor/gen/object.d.ts +3 -3
  10. package/dist/document-models/document-editor/gen/object.d.ts.map +1 -1
  11. package/dist/document-models/document-editor/gen/object.js.map +1 -1
  12. package/dist/document-models/document-editor/gen/types.d.ts +2 -2
  13. package/dist/document-models/document-editor/gen/types.d.ts.map +1 -1
  14. package/dist/document-models/document-editor/gen/utils.d.ts.map +1 -1
  15. package/dist/document-models/document-editor/gen/utils.js +2 -1
  16. package/dist/document-models/document-editor/gen/utils.js.map +1 -1
  17. package/dist/document-models/processor-module/gen/object.d.ts +3 -3
  18. package/dist/document-models/processor-module/gen/object.d.ts.map +1 -1
  19. package/dist/document-models/processor-module/gen/object.js.map +1 -1
  20. package/dist/document-models/processor-module/gen/types.d.ts +2 -2
  21. package/dist/document-models/processor-module/gen/types.d.ts.map +1 -1
  22. package/dist/document-models/processor-module/gen/utils.d.ts.map +1 -1
  23. package/dist/document-models/processor-module/gen/utils.js +2 -1
  24. package/dist/document-models/processor-module/gen/utils.js.map +1 -1
  25. package/dist/document-models/subgraph-module/gen/object.d.ts +3 -3
  26. package/dist/document-models/subgraph-module/gen/object.d.ts.map +1 -1
  27. package/dist/document-models/subgraph-module/gen/object.js.map +1 -1
  28. package/dist/document-models/subgraph-module/gen/types.d.ts +2 -2
  29. package/dist/document-models/subgraph-module/gen/types.d.ts.map +1 -1
  30. package/dist/document-models/subgraph-module/gen/utils.d.ts.map +1 -1
  31. package/dist/document-models/subgraph-module/gen/utils.js +2 -1
  32. package/dist/document-models/subgraph-module/gen/utils.js.map +1 -1
  33. package/dist/document-models/vetra-package/gen/object.d.ts +3 -3
  34. package/dist/document-models/vetra-package/gen/object.d.ts.map +1 -1
  35. package/dist/document-models/vetra-package/gen/object.js.map +1 -1
  36. package/dist/document-models/vetra-package/gen/types.d.ts +2 -2
  37. package/dist/document-models/vetra-package/gen/types.d.ts.map +1 -1
  38. package/dist/document-models/vetra-package/gen/utils.d.ts.map +1 -1
  39. package/dist/document-models/vetra-package/gen/utils.js +2 -1
  40. package/dist/document-models/vetra-package/gen/utils.js.map +1 -1
  41. package/dist/editors/app-editor/editor.d.ts +1 -2
  42. package/dist/editors/app-editor/editor.d.ts.map +1 -1
  43. package/dist/editors/app-editor/editor.js +8 -5
  44. package/dist/editors/app-editor/editor.js.map +1 -1
  45. package/dist/editors/app-editor/index.d.ts +1 -2
  46. package/dist/editors/app-editor/index.d.ts.map +1 -1
  47. package/dist/editors/app-editor/index.js.map +1 -1
  48. package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
  49. package/dist/editors/document-editor/components/DocumentEditorForm.js +37 -15
  50. package/dist/editors/document-editor/components/DocumentEditorForm.js.map +1 -1
  51. package/dist/editors/document-editor/editor.d.ts +1 -2
  52. package/dist/editors/document-editor/editor.d.ts.map +1 -1
  53. package/dist/editors/document-editor/editor.js +12 -6
  54. package/dist/editors/document-editor/editor.js.map +1 -1
  55. package/dist/editors/document-editor/index.d.ts +1 -2
  56. package/dist/editors/document-editor/index.d.ts.map +1 -1
  57. package/dist/editors/document-editor/index.js.map +1 -1
  58. package/dist/editors/processor-editor/components/ProcessorEditorForm.d.ts.map +1 -1
  59. package/dist/editors/processor-editor/components/ProcessorEditorForm.js +22 -23
  60. package/dist/editors/processor-editor/components/ProcessorEditorForm.js.map +1 -1
  61. package/dist/editors/processor-editor/editor.d.ts +1 -2
  62. package/dist/editors/processor-editor/editor.d.ts.map +1 -1
  63. package/dist/editors/processor-editor/editor.js +17 -11
  64. package/dist/editors/processor-editor/editor.js.map +1 -1
  65. package/dist/editors/processor-editor/index.d.ts +1 -2
  66. package/dist/editors/processor-editor/index.d.ts.map +1 -1
  67. package/dist/editors/processor-editor/index.js.map +1 -1
  68. package/dist/editors/subgraph-editor/editor.d.ts +1 -2
  69. package/dist/editors/subgraph-editor/editor.d.ts.map +1 -1
  70. package/dist/editors/subgraph-editor/editor.js +8 -5
  71. package/dist/editors/subgraph-editor/editor.js.map +1 -1
  72. package/dist/editors/subgraph-editor/index.d.ts +1 -2
  73. package/dist/editors/subgraph-editor/index.d.ts.map +1 -1
  74. package/dist/editors/subgraph-editor/index.js.map +1 -1
  75. package/dist/editors/vetra-drive-app/DriveExplorer.d.ts +2 -2
  76. package/dist/editors/vetra-drive-app/DriveExplorer.d.ts.map +1 -1
  77. package/dist/editors/vetra-drive-app/DriveExplorer.js +3 -7
  78. package/dist/editors/vetra-drive-app/DriveExplorer.js.map +1 -1
  79. package/dist/editors/vetra-drive-app/components/EditorContainer.d.ts +4 -5
  80. package/dist/editors/vetra-drive-app/components/EditorContainer.d.ts.map +1 -1
  81. package/dist/editors/vetra-drive-app/components/EditorContainer.js +6 -14
  82. package/dist/editors/vetra-drive-app/components/EditorContainer.js.map +1 -1
  83. package/dist/editors/vetra-drive-app/components/PackageInformationSection.d.ts +4 -5
  84. package/dist/editors/vetra-drive-app/components/PackageInformationSection.d.ts.map +1 -1
  85. package/dist/editors/vetra-drive-app/components/PackageInformationSection.js.map +1 -1
  86. package/dist/editors/vetra-drive-app/editor.d.ts +1 -2
  87. package/dist/editors/vetra-drive-app/editor.d.ts.map +1 -1
  88. package/dist/editors/vetra-drive-app/editor.js +13 -17
  89. package/dist/editors/vetra-drive-app/editor.js.map +1 -1
  90. package/dist/editors/vetra-drive-app/index.d.ts +1 -2
  91. package/dist/editors/vetra-drive-app/index.d.ts.map +1 -1
  92. package/dist/editors/vetra-drive-app/index.js.map +1 -1
  93. package/dist/editors/vetra-package/editor.d.ts +1 -2
  94. package/dist/editors/vetra-package/editor.d.ts.map +1 -1
  95. package/dist/editors/vetra-package/editor.js +29 -26
  96. package/dist/editors/vetra-package/editor.js.map +1 -1
  97. package/dist/editors/vetra-package/index.d.ts +1 -2
  98. package/dist/editors/vetra-package/index.d.ts.map +1 -1
  99. package/dist/editors/vetra-package/index.js.map +1 -1
  100. package/dist/index.d.ts +1 -1
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/processors/codegen/document-handlers/base-document-gen.d.ts +30 -0
  103. package/dist/processors/codegen/document-handlers/base-document-gen.d.ts.map +1 -0
  104. package/dist/processors/codegen/document-handlers/base-document-gen.js +29 -0
  105. package/dist/processors/codegen/document-handlers/base-document-gen.js.map +1 -0
  106. package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts +29 -0
  107. package/dist/processors/codegen/document-handlers/document-codegen-factory.d.ts.map +1 -0
  108. package/dist/processors/codegen/document-handlers/document-codegen-factory.js +50 -0
  109. package/dist/processors/codegen/document-handlers/document-codegen-factory.js.map +1 -0
  110. package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts +50 -0
  111. package/dist/processors/codegen/document-handlers/document-codegen-manager.d.ts.map +1 -0
  112. package/dist/processors/codegen/document-handlers/document-codegen-manager.js +111 -0
  113. package/dist/processors/codegen/document-handlers/document-codegen-manager.js.map +1 -0
  114. package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts +11 -0
  115. package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -0
  116. package/dist/processors/codegen/document-handlers/{app-handler.js → generators/app-generator.js} +17 -12
  117. package/dist/processors/codegen/document-handlers/generators/app-generator.js.map +1 -0
  118. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts +11 -0
  119. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts.map +1 -0
  120. package/dist/processors/codegen/document-handlers/{document-editor-handler.js → generators/document-editor-generator.js} +21 -13
  121. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js.map +1 -0
  122. package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts +11 -0
  123. package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts.map +1 -0
  124. package/dist/processors/codegen/document-handlers/{document-model-handler.js → generators/document-model-generator.js} +21 -15
  125. package/dist/processors/codegen/document-handlers/generators/document-model-generator.js.map +1 -0
  126. package/dist/processors/codegen/document-handlers/generators/index.d.ts +7 -0
  127. package/dist/processors/codegen/document-handlers/generators/index.d.ts.map +1 -0
  128. package/dist/processors/codegen/document-handlers/generators/index.js +7 -0
  129. package/dist/processors/codegen/document-handlers/generators/index.js.map +1 -0
  130. package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts +11 -0
  131. package/dist/processors/codegen/document-handlers/generators/package-generator.d.ts.map +1 -0
  132. package/dist/processors/codegen/document-handlers/{package-handler.js → generators/package-generator.js} +11 -11
  133. package/dist/processors/codegen/document-handlers/generators/package-generator.js.map +1 -0
  134. package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts +11 -0
  135. package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts.map +1 -0
  136. package/dist/processors/codegen/document-handlers/{processor-handler.js → generators/processor-generator.js} +18 -10
  137. package/dist/processors/codegen/document-handlers/generators/processor-generator.js.map +1 -0
  138. package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts +11 -0
  139. package/dist/processors/codegen/document-handlers/generators/subgraph-generator.d.ts.map +1 -0
  140. package/dist/processors/codegen/document-handlers/{subgraph-handler.js → generators/subgraph-generator.js} +18 -13
  141. package/dist/processors/codegen/document-handlers/generators/subgraph-generator.js.map +1 -0
  142. package/dist/processors/codegen/document-handlers/index.d.ts +5 -7
  143. package/dist/processors/codegen/document-handlers/index.d.ts.map +1 -1
  144. package/dist/processors/codegen/document-handlers/index.js +5 -6
  145. package/dist/processors/codegen/document-handlers/index.js.map +1 -1
  146. package/dist/processors/codegen/factory.d.ts +2 -1
  147. package/dist/processors/codegen/factory.d.ts.map +1 -1
  148. package/dist/processors/codegen/factory.js +4 -1
  149. package/dist/processors/codegen/factory.js.map +1 -1
  150. package/dist/processors/codegen/index.d.ts +0 -2
  151. package/dist/processors/codegen/index.d.ts.map +1 -1
  152. package/dist/processors/codegen/index.js +7 -36
  153. package/dist/processors/codegen/index.js.map +1 -1
  154. package/dist/processors/codegen/utils.d.ts +5 -0
  155. package/dist/processors/codegen/utils.d.ts.map +1 -0
  156. package/dist/processors/codegen/utils.js +19 -0
  157. package/dist/processors/codegen/utils.js.map +1 -0
  158. package/dist/processors/factory.d.ts +2 -1
  159. package/dist/processors/factory.d.ts.map +1 -1
  160. package/dist/processors/factory.js +3 -3
  161. package/dist/processors/factory.js.map +1 -1
  162. package/dist/style.css +8 -2
  163. package/dist/tsconfig.tsbuildinfo +1 -1
  164. package/package.json +13 -14
  165. package/dist/package.json +0 -114
  166. package/dist/powerhouse.config.json +0 -12
  167. package/dist/processors/codegen/document-handlers/app-handler.d.ts +0 -10
  168. package/dist/processors/codegen/document-handlers/app-handler.d.ts.map +0 -1
  169. package/dist/processors/codegen/document-handlers/app-handler.js.map +0 -1
  170. package/dist/processors/codegen/document-handlers/document-editor-handler.d.ts +0 -10
  171. package/dist/processors/codegen/document-handlers/document-editor-handler.d.ts.map +0 -1
  172. package/dist/processors/codegen/document-handlers/document-editor-handler.js.map +0 -1
  173. package/dist/processors/codegen/document-handlers/document-model-handler.d.ts +0 -10
  174. package/dist/processors/codegen/document-handlers/document-model-handler.d.ts.map +0 -1
  175. package/dist/processors/codegen/document-handlers/document-model-handler.js.map +0 -1
  176. package/dist/processors/codegen/document-handlers/package-handler.d.ts +0 -10
  177. package/dist/processors/codegen/document-handlers/package-handler.d.ts.map +0 -1
  178. package/dist/processors/codegen/document-handlers/package-handler.js.map +0 -1
  179. package/dist/processors/codegen/document-handlers/processor-handler.d.ts +0 -10
  180. package/dist/processors/codegen/document-handlers/processor-handler.d.ts.map +0 -1
  181. package/dist/processors/codegen/document-handlers/processor-handler.js.map +0 -1
  182. package/dist/processors/codegen/document-handlers/subgraph-handler.d.ts +0 -10
  183. package/dist/processors/codegen/document-handlers/subgraph-handler.d.ts.map +0 -1
  184. package/dist/processors/codegen/document-handlers/subgraph-handler.js.map +0 -1
@@ -1,12 +1,34 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useReactor } from "@powerhousedao/reactor-browser";
2
3
  import { useEffect, useState } from "react";
3
4
  import { StatusPill } from "../../components/index.js";
4
5
  import { useDebounce } from "../../hooks/index.js";
5
6
  export const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes: initialDocumentTypes = [], status = "DRAFT", onEditorNameChange, onAddDocumentType, onRemoveDocumentType, onConfirm }) => {
6
7
  const [editorName, setEditorName] = useState(initialEditorName);
7
8
  const [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);
8
- const [documentTypeInput, setDocumentTypeInput] = useState("");
9
+ const [selectedDocumentType, setSelectedDocumentType] = useState("");
9
10
  const [isConfirmed, setIsConfirmed] = useState(false);
11
+ const [availableDocumentTypes, setAvailableDocumentTypes] = useState([]);
12
+ // Get available document types from reactor
13
+ const reactor = useReactor();
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]);
10
32
  // Use the debounce hook for name changes
11
33
  useDebounce(editorName, onEditorNameChange, 300);
12
34
  // Update local state when initial values change
@@ -30,24 +52,24 @@ export const DocumentEditorForm = ({ editorName: initialEditorName = "", documen
30
52
  onConfirm?.();
31
53
  }
32
54
  };
33
- return (_jsxs("div", { className: "space-y-6 p-6 bg-white", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Editor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Editor Name" }), _jsx("input", { type: "text", value: editorName, onChange: (e) => setEditorName(e.target.value), disabled: isReadOnly, className: `w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${isReadOnly ? 'bg-gray-100 cursor-not-allowed' : ''}` })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Supported Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && (_jsx("input", { type: "text", value: documentTypeInput, onChange: (e) => setDocumentTypeInput(e.target.value), onKeyDown: (e) => {
34
- if (e.key === 'Enter' && documentTypeInput.trim()) {
35
- e.preventDefault();
55
+ return (_jsxs("div", { className: "space-y-6 p-6 bg-white", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Editor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Editor Name" }), _jsx("input", { type: "text", value: editorName, onChange: (e) => setEditorName(e.target.value), disabled: isReadOnly, className: `w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${isReadOnly ? 'bg-gray-100 cursor-not-allowed' : ''}` })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Supported Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && availableDocumentTypes.length > 0 && (_jsxs("select", { value: selectedDocumentType, onChange: (e) => {
56
+ const selectedValue = e.target.value;
57
+ if (selectedValue && !documentTypes.some(dt => dt.documentType === selectedValue)) {
36
58
  const newTypeInput = {
37
59
  id: Date.now().toString(), // Generate a unique ID
38
- documentType: documentTypeInput.trim()
60
+ documentType: selectedValue
61
+ };
62
+ const newType = {
63
+ id: newTypeInput.id,
64
+ documentType: newTypeInput.documentType
39
65
  };
40
- if (!documentTypes.some(dt => dt.documentType === newTypeInput.documentType)) {
41
- const newType = {
42
- id: newTypeInput.id,
43
- documentType: newTypeInput.documentType
44
- };
45
- setDocumentTypes([...documentTypes, newType]);
46
- onAddDocumentType?.(newTypeInput);
47
- }
48
- setDocumentTypeInput('');
66
+ setDocumentTypes([...documentTypes, newType]);
67
+ onAddDocumentType?.(newTypeInput);
49
68
  }
50
- }, placeholder: "Type a document type and press Enter", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => {
69
+ setSelectedDocumentType('');
70
+ }, className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", children: [_jsx("option", { value: "", children: "Select a document type to add" }), availableDocumentTypes
71
+ .filter(docType => !documentTypes.some(dt => dt.documentType === docType))
72
+ .map((docType) => (_jsx("option", { value: docType, children: docType }, docType)))] })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => {
51
73
  setDocumentTypes(documentTypes.filter((dt) => dt.id !== type.id));
52
74
  onRemoveDocumentType?.({ id: type.id });
53
75
  }, className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type.id))) })] })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !editorName.trim() || documentTypes.length === 0, className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:cursor-not-allowed", children: "Confirm" }) }))] }));
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentEditorForm.js","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":";AAAA,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,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAChE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAqB,oBAAoB,CAAC,CAAC;IAC7F,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,yCAAyC;IACzC,WAA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C,sCAAsC,EAClD,SAAS,EAAC,iIAAiI,GAC3I,CACH,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
+ {"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,G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DocumentEditorDocument } from "../../document-models/document-editor/index.js";
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":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,KAAK,sBAAsB,EAI5B,MAAM,gDAAgD,CAAC;AAIxD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAiC3C"}
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 { actions, } from "../../document-models/document-editor/index.js";
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, dispatch } = props;
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 (name === document.state.global.name)
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
- }, [document.state.global.name, dispatch]);
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: document.state.global.name ?? "", documentTypes: document.state.global.documentTypes, status: document.state.global.status, onEditorNameChange: onEditorNameChange, onAddDocumentType: onAddDocumentType, onRemoveDocumentType: onRemoveDocumentType, onConfirm: onConfirm }) }));
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":";AACA,OAAO,EAIL,OAAO,GACR,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIpC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,MAAM,kBAAkB,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QACtD,IAAI,IAAI,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,EAAE;QAC1E,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,wBACE,KAAC,kBAAkB,IACjB,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAChD,UAAU,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EACxD,aAAa,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,EAC9D,kBAAkB,EAAE,kBAAkB,EACtC,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
- import type { DocumentEditorDocument } from "../../document-models/document-editor/index.js";
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;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAG7F,eAAO,MAAM,MAAM,EAAE,YAAY,CAAC,sBAAsB,CASvD,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,YASpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/document-editor/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAyC;IAC1D,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
+ {"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":"AACA,OAAO,KAAK,EACV,gBAAgB,EAEjB,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,CAwLlE,CAAC"}
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,13 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { useDebounce } from "../../hooks/index.js";
2
+ import { useReactor } from "@powerhousedao/reactor-browser";
3
+ import { useEffect, useState } from "react";
4
4
  import { StatusPill } from "../../components/index.js";
5
+ import { useDebounce } from "../../hooks/index.js";
5
6
  export const ProcessorEditorForm = ({ processorName: initialProcessorName = "", processorType: initialProcessorType = "", documentTypes: initialDocumentTypes = [], status = "DRAFT", onNameChange, onTypeChange, onAddDocumentType, onRemoveDocumentType, onConfirm, }) => {
6
7
  const [processorName, setProcessorName] = useState(initialProcessorName);
7
8
  const [processorType, setProcessorType] = useState(initialProcessorType);
8
9
  const [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);
9
- const [documentTypeInput, setDocumentTypeInput] = useState("");
10
+ const [selectedDocumentType, setSelectedDocumentType] = useState("");
10
11
  const [isConfirmed, setIsConfirmed] = useState(false);
12
+ // Get available document types from reactor
13
+ const reactor = useReactor();
14
+ const docModels = reactor?.getDocumentModelModules() ?? [];
15
+ const availableDocumentTypes = docModels.map((model) => model.documentModel.id);
11
16
  // Use the debounce hook for name and type changes
12
17
  useDebounce(processorName, onNameChange, 300);
13
18
  useDebounce(processorType, onTypeChange, 300);
@@ -35,31 +40,25 @@ export const ProcessorEditorForm = ({ processorName: initialProcessorName = "",
35
40
  onConfirm?.();
36
41
  }
37
42
  };
38
- const handleAddDocumentType = () => {
39
- if (documentTypeInput.trim()) {
40
- const id = Date.now().toString();
41
- const documentType = documentTypeInput.trim();
42
- if (!documentTypes.some((dt) => dt.documentType === documentType)) {
43
- const newType = {
44
- id,
45
- documentType,
46
- };
47
- setDocumentTypes([...documentTypes, newType]);
48
- onAddDocumentType?.(id, documentType);
49
- }
50
- setDocumentTypeInput("");
51
- }
52
- };
53
43
  const handleRemoveDocumentType = (id) => {
54
44
  setDocumentTypes(documentTypes.filter((dt) => dt.id !== id));
55
45
  onRemoveDocumentType?.(id);
56
46
  };
57
47
  const canConfirm = processorName.trim() && processorType && documentTypes.length > 0;
58
- return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Processor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Processor Name" }), _jsx("input", { type: "text", value: processorName, onChange: (e) => setProcessorName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter processor name" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Type" }), _jsxs("select", { value: processorType, onChange: (e) => setProcessorType(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, children: [_jsx("option", { value: "", children: "Select type..." }), _jsx("option", { value: "analytics", children: "Analytics" }), _jsx("option", { value: "relational", children: "Relational Database" })] })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && (_jsx("input", { type: "text", value: documentTypeInput, onChange: (e) => setDocumentTypeInput(e.target.value), onKeyDown: (e) => {
59
- if (e.key === "Enter") {
60
- e.preventDefault();
61
- handleAddDocumentType();
48
+ return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Processor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Processor Name" }), _jsx("input", { type: "text", value: processorName, onChange: (e) => setProcessorName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter processor name" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Type" }), _jsxs("select", { value: processorType, onChange: (e) => setProcessorType(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, children: [_jsx("option", { value: "", children: "Select type..." }), _jsx("option", { value: "analytics", children: "Analytics" }), _jsx("option", { value: "relational", children: "Relational Database" })] })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && availableDocumentTypes.length > 0 && (_jsxs("select", { value: selectedDocumentType, onChange: (e) => {
49
+ const selectedValue = e.target.value;
50
+ if (selectedValue && !documentTypes.some(dt => dt.documentType === selectedValue)) {
51
+ const id = Date.now().toString();
52
+ const newType = {
53
+ id,
54
+ documentType: selectedValue
55
+ };
56
+ setDocumentTypes([...documentTypes, newType]);
57
+ onAddDocumentType?.(id, selectedValue);
62
58
  }
63
- }, placeholder: "Type a document type and press Enter", className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500" })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => handleRemoveDocumentType(type.id), className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type.id))) })] })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !canConfirm, className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:bg-gray-300", children: "Confirm" }) }))] }));
59
+ setSelectedDocumentType('');
60
+ }, className: "w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500", children: [_jsx("option", { value: "", children: "Select a document type to add" }), availableDocumentTypes
61
+ .filter(docType => !documentTypes.some(dt => dt.documentType === docType))
62
+ .map((docType) => (_jsx("option", { value: docType, children: docType }, docType)))] })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => handleRemoveDocumentType(type.id), className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type.id))) })] })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !canConfirm, className: "rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:bg-gray-300", children: "Confirm" }) }))] }));
64
63
  };
65
64
  //# sourceMappingURL=ProcessorEditorForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProcessorEditorForm.js","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;A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C,iBAAQ,KAAK,EAAC,WAAW,0BAAmB,EAC5C,iBAAQ,KAAK,EAAC,YAAY,oCAA6B,IAChD,IACL,EAGN,0BACE,gBAAO,SAAS,EAAC,8CAA8C,+BAEvD,EACR,eAAK,SAAS,EAAC,WAAW,aACvB,CAAC,UAAU,IAAI,CACd,gBACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACrD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;oCACf,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;wCACtB,CAAC,CAAC,cAAc,EAAE,CAAC;wCACnB,qBAAqB,EAAE,CAAC;oCAC1B,CAAC;gCACH,CAAC,EACD,WAAW,EAAC,sCAAsC,EAClD,SAAS,EAAC,iIAAiI,GAC3I,CACH,EACD,cAAK,SAAS,EAAC,WAAW,YACvB,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,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
+ {"version":3,"file":"ProcessorEditorForm.js","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.ts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,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
- import { type ProcessorModuleDocument } from "../../document-models/processor-module/index.js";
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":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,iDAAiD,CAAC;AAIzD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAwC3C"}
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 { actions, } from "../../document-models/processor-module/index.js";
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, dispatch } = props;
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 === document.state.global.name)
17
+ if (name === unsafeCastOfDocument.state.global.name)
9
18
  return;
10
19
  dispatch(actions.setProcessorName({ name }));
11
- }, [document.state.global.name, dispatch]);
20
+ }, [unsafeCastOfDocument.state.global.name, dispatch]);
12
21
  const onTypeChange = useCallback((type) => {
13
- if (type === document.state.global.type)
22
+ if (type === unsafeCastOfDocument.state.global.type)
14
23
  return;
15
24
  dispatch(actions.setProcessorType({ type }));
16
- }, [document.state.global.type, dispatch]);
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
- const onConfirm = useCallback(() => {
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":";AACA,OAAO,EAGL,OAAO,GACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIpC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QAChD,IAAI,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO;QAChD,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3C,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QAChD,IAAI,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO;QAChD,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/C,C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AAE,CAAC,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvD,MAAM,iBAAiB,GAAG,WAAW,CAAC,CAAC,EAAU,EAAE,YAAoB,EAAE,EAAE;QACzE,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,oBAAoB,GAAG,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QACtD,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,wBACE,KAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,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
- import type { ProcessorModuleDocument } from "../../document-models/processor-module/index.js";
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;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAG/F,eAAO,MAAM,MAAM,EAAE,YAAY,CAAC,uBAAuB,CASxD,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,YASpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/processor-editor/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAA0C;IAC3D,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
+ {"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
- import { type SubgraphModuleDocument } from "../../document-models/subgraph-module/index.js";
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":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,gDAAgD,CAAC;AAGxD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAsB3C"}
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, } from "../../document-models/subgraph-module/index.js";
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, dispatch } = props;
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 === document.state.global.name)
11
+ if (name === unsafeCastOfDocument.state.global.name)
9
12
  return;
10
13
  dispatch(actions.setSubgraphName({ name }));
11
- }, [document.state.global.name, dispatch]);
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: document.state.global.name ?? "", status: document.state.global.status, onNameChange: onNameChange, onConfirm: onConfirm }) }));
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":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,OAAO,GACR,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAIxE,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QAChD,IAAI,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO;QAChD,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3C,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE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I,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
- import type { SubgraphModuleDocument } from "../../document-models/subgraph-module/index.js";
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;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAG7F,eAAO,MAAM,MAAM,EAAE,YAAY,CAAC,sBAAsB,CASvD,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,YASpB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/subgraph-editor/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAyC;IAC1D,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
+ {"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 DriveEditorContext } from '@powerhousedao/reactor-browser';
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: DriveEditorContext;
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,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,KAAK,M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C,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
- context.getDocumentModelModule(DOCUMENT_TYPES.documentPackage)
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":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAuBrD,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,cAAc,GAAG,EAAE,EACnB,OAAO,GAAG,EAAE,EACZ,IAAI,GAAG,EAAE,EACT,SAAS,GAAG,EAAE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EACpB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,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 DriveEditorContext } from "@powerhousedao/reactor-browser";
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: Omit<DriveEditorContext, "getDocumentRevision"> & Pick<EditorContext, "getDocumentRevision">;
8
- documentModelModule: DocumentModelModule<PHDocument>;
9
- editorModule: 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":"AAEA,OAAO,EAGH,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GACtD,IAAI,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IAC7C,mBAAmB,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACrD,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmC1D,CAAC"}
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 { driveId, documentId, documentType, context, documentModelModule, editorModule } = props;
7
- const { useDocumentEditorProps } = useDriveContext();
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 moduleWithComponent = editorModule;
20
- const EditorComponent = moduleWithComponent.Component;
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