@powerhousedao/vetra 6.1.0 → 6.2.0-dev.1

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 (53) hide show
  1. package/dist/codegen/index.d.ts +4 -4
  2. package/dist/{connect-BRlVKs1s.js → connect-Bbz4cL8F.js} +1 -1
  3. package/dist/{connect-BRlVKs1s.js.map → connect-Bbz4cL8F.js.map} +1 -1
  4. package/dist/document-models/app-module/index.d.ts +1 -1
  5. package/dist/document-models/document-editor/index.d.ts +1 -1
  6. package/dist/document-models/index.d.ts +5 -5
  7. package/dist/document-models/processor-module/index.d.ts +1 -1
  8. package/dist/document-models/subgraph-module/index.d.ts +1 -1
  9. package/dist/document-models/vetra-package/index.d.ts +1 -1
  10. package/dist/{editor-UWE1ab9Y.js → editor-BamOOi9L.js} +1 -1
  11. package/dist/{editor-UWE1ab9Y.js.map → editor-BamOOi9L.js.map} +1 -1
  12. package/dist/{editor-Dw-NohMb.js → editor-CM9tpwzR.js} +2 -2
  13. package/dist/{editor-Dw-NohMb.js.map → editor-CM9tpwzR.js.map} +1 -1
  14. package/dist/{editor-BQxk6LrL.js → editor-D-QqGEkw.js} +1 -1
  15. package/dist/{editor-BQxk6LrL.js.map → editor-D-QqGEkw.js.map} +1 -1
  16. package/dist/{editor-fvDig5Bd.js → editor-Dz3cXtzn.js} +1 -1
  17. package/dist/{editor-fvDig5Bd.js.map → editor-Dz3cXtzn.js.map} +1 -1
  18. package/dist/{editor-DLluDQKM.js → editor-je4HFt2f.js} +2 -2
  19. package/dist/{editor-DLluDQKM.js.map → editor-je4HFt2f.js.map} +1 -1
  20. package/dist/{editor-ClvvgHg3.js → editor-rYCWiter.js} +2 -2
  21. package/dist/{editor-ClvvgHg3.js.map → editor-rYCWiter.js.map} +1 -1
  22. package/dist/editors/index.js +1 -1
  23. package/dist/{factory-4o53XqHE.js → factory-BkA-IvkR.js} +1 -1
  24. package/dist/{factory-4o53XqHE.js.map → factory-BkA-IvkR.js.map} +1 -1
  25. package/dist/factory-DcPyqWkY.js +54 -0
  26. package/dist/factory-DcPyqWkY.js.map +1 -0
  27. package/dist/{index-ClaOdn_F.d.ts → index-6u5B5ORH.d.ts} +1 -1
  28. package/dist/{index-ClaOdn_F.d.ts.map → index-6u5B5ORH.d.ts.map} +1 -1
  29. package/dist/{index-BPoF8P3O.d.ts → index-BL4jGAtJ.d.ts} +1 -1
  30. package/dist/{index-BPoF8P3O.d.ts.map → index-BL4jGAtJ.d.ts.map} +1 -1
  31. package/dist/{index-C4s0aLv3.d.ts → index-BzDZOr5P.d.ts} +1 -1
  32. package/dist/{index-C4s0aLv3.d.ts.map → index-BzDZOr5P.d.ts.map} +1 -1
  33. package/dist/{index-BoGed4Fa.d.ts → index-DE_s19VI.d.ts} +1 -1
  34. package/dist/{index-BoGed4Fa.d.ts.map → index-DE_s19VI.d.ts.map} +1 -1
  35. package/dist/index.d.ts +5 -5
  36. package/dist/index.js +1 -1
  37. package/dist/{module-BTlKlxoV.js → module-DvO77TZz.js} +7 -7
  38. package/dist/{module-BTlKlxoV.js.map → module-DvO77TZz.js.map} +1 -1
  39. package/dist/{module-Drla4Vmn.d.ts → module-rS5YXFpM.d.ts} +1 -1
  40. package/dist/{module-Drla4Vmn.d.ts.map → module-rS5YXFpM.d.ts.map} +1 -1
  41. package/dist/{factory-Dexxeo5C.js → processor-BfQ_DU7u.js} +4 -50
  42. package/dist/processor-BfQ_DU7u.js.map +1 -0
  43. package/dist/processors/codegen/index.d.ts.map +1 -1
  44. package/dist/processors/codegen/index.js +2 -1
  45. package/dist/processors/index.js +1 -1
  46. package/dist/processors/vetra-read-model/index.js +1 -1
  47. package/dist/switchboard-C_BapCdk.js +8 -0
  48. package/dist/{switchboard-C2L9IAfe.js.map → switchboard-C_BapCdk.js.map} +1 -1
  49. package/dist/{useVetraDocument-BQKyels4.js → useVetraDocument-tpjMF571.js} +1 -1
  50. package/dist/{useVetraDocument-BQKyels4.js.map → useVetraDocument-tpjMF571.js.map} +1 -1
  51. package/package.json +8 -8
  52. package/dist/factory-Dexxeo5C.js.map +0 -1
  53. package/dist/switchboard-C2L9IAfe.js +0 -8
@@ -1,7 +1,7 @@
1
- import { tt as AppModuleDocument } from "../index-C4s0aLv3.js";
2
- import { q as DocumentEditorDocument } from "../index-ClaOdn_F.js";
3
- import { nt as ProcessorModuleDocument } from "../index-BoGed4Fa.js";
4
- import { B as SubgraphModuleDocument } from "../index-BPoF8P3O.js";
1
+ import { tt as AppModuleDocument } from "../index-BzDZOr5P.js";
2
+ import { q as DocumentEditorDocument } from "../index-6u5B5ORH.js";
3
+ import { nt as ProcessorModuleDocument } from "../index-DE_s19VI.js";
4
+ import { B as SubgraphModuleDocument } from "../index-BL4jGAtJ.js";
5
5
  import { Action, DocumentModelDocument, DocumentModelGlobalState, PHDocument, Reducer } from "@powerhousedao/shared/document-model";
6
6
  import { Project } from "ts-morph";
7
7
 
@@ -3,4 +3,4 @@ const processorFactoryBuilders = [];
3
3
  //#endregion
4
4
  export { processorFactoryBuilders };
5
5
 
6
- //# sourceMappingURL=connect-BRlVKs1s.js.map
6
+ //# sourceMappingURL=connect-Bbz4cL8F.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect-BRlVKs1s.js","names":[],"sources":["../processors/connect.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { ProcessorFactoryBuilder } from \"@powerhousedao/reactor-browser\";\n\nexport const processorFactoryBuilders: ProcessorFactoryBuilder[] = [];\n"],"mappings":";AAMA,MAAa,2BAAsD,EAAE"}
1
+ {"version":3,"file":"connect-Bbz4cL8F.js","names":[],"sources":["../processors/connect.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { ProcessorFactoryBuilder } from \"@powerhousedao/reactor-browser\";\n\nexport const processorFactoryBuilders: ProcessorFactoryBuilder[] = [];\n"],"mappings":";AAMA,MAAa,2BAAsD,EAAE"}
@@ -1,4 +1,4 @@
1
- import { $ as SetAppStatusAction, A as assertIsAppModuleDocument, B as removeDocumentType, C as defaultGlobalState, D as AppModuleDocumentHeaderSchema, E as appModuleDocumentType, F as AppModuleDndOperationsOperations, G as AppModuleBaseOperationsOperations, H as setAppStatus, I as creators_d_exports$1, J as SetDragAndDropEnabledAction, K as AppModuleAction, L as setDragAndDropEnabled, M as isAppModuleDocument, N as isAppModuleState, O as AppModuleDocumentSchema, P as documentModel, Q as SetAppNameAction, R as addDocumentType, S as createState, T as defaultPHState, U as setDocumentTypes, V as setAppName, W as AppModuleController, X as AppModuleBaseOperationsAction, Y as AddDocumentTypeAction, Z as RemoveDocumentTypeAction, _ as useAppModuleDocumentsInSelectedDrive, _t as SetDocumentTypesInput, a as RemoveDocumentTypeInputSchema, at as AppModuleState, b as actions, c as SetDocumentTypesInputSchema, ct as InputMaybe, d as definedNonNullAnySchema, dt as MakeOptional, et as SetDocumentTypesAction, f as isDefinedNonNullAny, ft as Maybe, g as useAppModuleDocumentById, gt as SetAppStatusInput, h as AppModule, ht as SetAppNameInput, i as AppModuleStateSchema, it as AddDocumentTypeInput, j as assertIsAppModuleState, k as AppModulePHStateSchema, l as SetDragAndDropEnabledInputSchema, lt as MakeEmpty, m as utils, mt as Scalars, n as initialLocalState, nt as AppModuleLocalState, o as SetAppNameInputSchema, ot as Exact, p as reducer, pt as RemoveDocumentTypeInput, q as AppModuleDndOperationsAction, r as AddDocumentTypeInputSchema, rt as AppModulePHState, s as SetAppStatusInputSchema, st as Incremental, t as initialGlobalState, tt as AppModuleDocument, u as StatusTypeSchema, ut as MakeMaybe, v as useAppModuleDocumentsInSelectedFolder, vt as SetDragAndDropEnabledInput, w as defaultLocalState, x as createAppModuleDocument, y as useSelectedAppModuleDocument, yt as StatusType, z as creators_d_exports } from "../../index-C4s0aLv3.js";
1
+ import { $ as SetAppStatusAction, A as assertIsAppModuleDocument, B as removeDocumentType, C as defaultGlobalState, D as AppModuleDocumentHeaderSchema, E as appModuleDocumentType, F as AppModuleDndOperationsOperations, G as AppModuleBaseOperationsOperations, H as setAppStatus, I as creators_d_exports$1, J as SetDragAndDropEnabledAction, K as AppModuleAction, L as setDragAndDropEnabled, M as isAppModuleDocument, N as isAppModuleState, O as AppModuleDocumentSchema, P as documentModel, Q as SetAppNameAction, R as addDocumentType, S as createState, T as defaultPHState, U as setDocumentTypes, V as setAppName, W as AppModuleController, X as AppModuleBaseOperationsAction, Y as AddDocumentTypeAction, Z as RemoveDocumentTypeAction, _ as useAppModuleDocumentsInSelectedDrive, _t as SetDocumentTypesInput, a as RemoveDocumentTypeInputSchema, at as AppModuleState, b as actions, c as SetDocumentTypesInputSchema, ct as InputMaybe, d as definedNonNullAnySchema, dt as MakeOptional, et as SetDocumentTypesAction, f as isDefinedNonNullAny, ft as Maybe, g as useAppModuleDocumentById, gt as SetAppStatusInput, h as AppModule, ht as SetAppNameInput, i as AppModuleStateSchema, it as AddDocumentTypeInput, j as assertIsAppModuleState, k as AppModulePHStateSchema, l as SetDragAndDropEnabledInputSchema, lt as MakeEmpty, m as utils, mt as Scalars, n as initialLocalState, nt as AppModuleLocalState, o as SetAppNameInputSchema, ot as Exact, p as reducer, pt as RemoveDocumentTypeInput, q as AppModuleDndOperationsAction, r as AddDocumentTypeInputSchema, rt as AppModulePHState, s as SetAppStatusInputSchema, st as Incremental, t as initialGlobalState, tt as AppModuleDocument, u as StatusTypeSchema, ut as MakeMaybe, v as useAppModuleDocumentsInSelectedFolder, vt as SetDragAndDropEnabledInput, w as defaultLocalState, x as createAppModuleDocument, y as useSelectedAppModuleDocument, yt as StatusType, z as creators_d_exports } from "../../index-BzDZOr5P.js";
2
2
  import { UpgradeManifest } from "document-model";
3
3
 
4
4
  //#region document-models/app-module/upgrades/versions.d.ts
@@ -1,4 +1,4 @@
1
- import { $ as Exact, A as assertIsDocumentEditorState, B as DocumentEditorBaseOperationsOperations, C as defaultLocalState, D as DocumentEditorDocumentSchema, E as DocumentEditorDocumentHeaderSchema, F as creators_d_exports, G as SetEditorNameAction, H as AddDocumentTypeAction, I as removeDocumentType, J as DocumentEditorLocalState, K as SetEditorStatusAction, L as setEditorName, M as isDocumentEditorState, N as documentModel, O as DocumentEditorPHStateSchema, P as addDocumentType, Q as DocumentTypeItem, R as setEditorStatus, S as defaultGlobalState, T as documentEditorDocumentType, U as DocumentEditorBaseOperationsAction, V as DocumentEditorAction, W as RemoveDocumentTypeAction, X as AddDocumentTypeInput, Y as DocumentEditorPHState, Z as DocumentEditorState, _ as useDocumentEditorDocumentsInSelectedFolder, a as DocumentTypeItemSchema, at as Maybe, b as createDocumentEditorDocument, c as SetEditorStatusInputSchema, ct as SetEditorNameInput, d as isDefinedNonNullAny, et as Incremental, f as reducer, g as useDocumentEditorDocumentsInSelectedDrive, h as useDocumentEditorDocumentById, i as DocumentEditorStateSchema, it as MakeOptional, j as isDocumentEditorDocument, k as assertIsDocumentEditorDocument, l as StatusTypeSchema, lt as SetEditorStatusInput, m as DocumentEditor, n as initialLocalState, nt as MakeEmpty, o as RemoveDocumentTypeInputSchema, ot as RemoveDocumentTypeInput, p as utils, q as DocumentEditorDocument, r as AddDocumentTypeInputSchema, rt as MakeMaybe, s as SetEditorNameInputSchema, st as Scalars, t as initialGlobalState, tt as InputMaybe, u as definedNonNullAnySchema, ut as StatusType, v as useSelectedDocumentEditorDocument, w as defaultPHState, x as createState, y as actions, z as DocumentEditorController } from "../../index-ClaOdn_F.js";
1
+ import { $ as Exact, A as assertIsDocumentEditorState, B as DocumentEditorBaseOperationsOperations, C as defaultLocalState, D as DocumentEditorDocumentSchema, E as DocumentEditorDocumentHeaderSchema, F as creators_d_exports, G as SetEditorNameAction, H as AddDocumentTypeAction, I as removeDocumentType, J as DocumentEditorLocalState, K as SetEditorStatusAction, L as setEditorName, M as isDocumentEditorState, N as documentModel, O as DocumentEditorPHStateSchema, P as addDocumentType, Q as DocumentTypeItem, R as setEditorStatus, S as defaultGlobalState, T as documentEditorDocumentType, U as DocumentEditorBaseOperationsAction, V as DocumentEditorAction, W as RemoveDocumentTypeAction, X as AddDocumentTypeInput, Y as DocumentEditorPHState, Z as DocumentEditorState, _ as useDocumentEditorDocumentsInSelectedFolder, a as DocumentTypeItemSchema, at as Maybe, b as createDocumentEditorDocument, c as SetEditorStatusInputSchema, ct as SetEditorNameInput, d as isDefinedNonNullAny, et as Incremental, f as reducer, g as useDocumentEditorDocumentsInSelectedDrive, h as useDocumentEditorDocumentById, i as DocumentEditorStateSchema, it as MakeOptional, j as isDocumentEditorDocument, k as assertIsDocumentEditorDocument, l as StatusTypeSchema, lt as SetEditorStatusInput, m as DocumentEditor, n as initialLocalState, nt as MakeEmpty, o as RemoveDocumentTypeInputSchema, ot as RemoveDocumentTypeInput, p as utils, q as DocumentEditorDocument, r as AddDocumentTypeInputSchema, rt as MakeMaybe, s as SetEditorNameInputSchema, st as Scalars, t as initialGlobalState, tt as InputMaybe, u as definedNonNullAnySchema, ut as StatusType, v as useSelectedDocumentEditorDocument, w as defaultPHState, x as createState, y as actions, z as DocumentEditorController } from "../../index-6u5B5ORH.js";
2
2
  import { UpgradeManifest } from "document-model";
3
3
 
4
4
  //#region document-models/document-editor/upgrades/versions.d.ts
@@ -1,6 +1,6 @@
1
- import { h as AppModule } from "../index-C4s0aLv3.js";
2
- import { m as DocumentEditor } from "../index-ClaOdn_F.js";
3
- import { _ as ProcessorModule } from "../index-BoGed4Fa.js";
4
- import { d as SubgraphModule } from "../index-BPoF8P3O.js";
5
- import { t as VetraPackage } from "../module-Drla4Vmn.js";
1
+ import { h as AppModule } from "../index-BzDZOr5P.js";
2
+ import { m as DocumentEditor } from "../index-6u5B5ORH.js";
3
+ import { _ as ProcessorModule } from "../index-DE_s19VI.js";
4
+ import { d as SubgraphModule } from "../index-BL4jGAtJ.js";
5
+ import { t as VetraPackage } from "../module-rS5YXFpM.js";
6
6
  export { AppModule as AppModuleV1, DocumentEditor as DocumentEditorV1, ProcessorModule as ProcessorModuleV1, SubgraphModule as SubgraphModuleV1, VetraPackage as VetraPackageV1 };
@@ -1,4 +1,4 @@
1
- import { $ as SetProcessorNameAction, A as ProcessorModuleDocumentSchema, B as removeDocumentType, C as createProcessorModuleDocument, D as defaultPHState, E as defaultLocalState, F as isProcessorModuleState, G as ProcessorModuleController, H as setProcessorName, I as documentModel, J as AddDocumentTypeAction, K as ProcessorModuleBaseOperationsOperations, L as addDocumentType, M as assertIsProcessorModuleDocument, N as assertIsProcessorModuleState, O as processorModuleDocumentType, P as isProcessorModuleDocument, Q as RemoveProcessorAppAction, R as addProcessorApp, S as actions, St as StatusType, T as defaultGlobalState, U as setProcessorStatus, V as removeProcessorApp, W as setProcessorType, X as ProcessorModuleBaseOperationsAction, Y as AddProcessorAppAction, Z as RemoveDocumentTypeAction, _ as ProcessorModule, _t as RemoveProcessorAppInput, a as DocumentTypeItemSchema, at as AddDocumentTypeInput, b as useProcessorModuleDocumentsInSelectedFolder, bt as SetProcessorStatusInput, c as RemoveProcessorAppInputSchema, ct as Exact, d as SetProcessorTypeInputSchema, dt as MakeEmpty, et as SetProcessorStatusAction, f as StatusTypeSchema, ft as MakeMaybe, g as utils, gt as RemoveDocumentTypeInput, h as reducer, ht as ProcessorModuleState, i as AddProcessorAppInputSchema, it as ProcessorModulePHState, j as ProcessorModulePHStateSchema, k as ProcessorModuleDocumentHeaderSchema, l as SetProcessorNameInputSchema, lt as Incremental, m as isDefinedNonNullAny, mt as Maybe, n as initialLocalState, nt as ProcessorModuleDocument, o as ProcessorModuleStateSchema, ot as AddProcessorAppInput, p as definedNonNullAnySchema, pt as MakeOptional, q as ProcessorModuleAction, r as AddDocumentTypeInputSchema, rt as ProcessorModuleLocalState, s as RemoveDocumentTypeInputSchema, st as DocumentTypeItem, t as initialGlobalState, tt as SetProcessorTypeAction, u as SetProcessorStatusInputSchema, ut as InputMaybe, v as useProcessorModuleDocumentById, vt as Scalars, w as createState, x as useSelectedProcessorModuleDocument, xt as SetProcessorTypeInput, y as useProcessorModuleDocumentsInSelectedDrive, yt as SetProcessorNameInput, z as creators_d_exports } from "../../index-BoGed4Fa.js";
1
+ import { $ as SetProcessorNameAction, A as ProcessorModuleDocumentSchema, B as removeDocumentType, C as createProcessorModuleDocument, D as defaultPHState, E as defaultLocalState, F as isProcessorModuleState, G as ProcessorModuleController, H as setProcessorName, I as documentModel, J as AddDocumentTypeAction, K as ProcessorModuleBaseOperationsOperations, L as addDocumentType, M as assertIsProcessorModuleDocument, N as assertIsProcessorModuleState, O as processorModuleDocumentType, P as isProcessorModuleDocument, Q as RemoveProcessorAppAction, R as addProcessorApp, S as actions, St as StatusType, T as defaultGlobalState, U as setProcessorStatus, V as removeProcessorApp, W as setProcessorType, X as ProcessorModuleBaseOperationsAction, Y as AddProcessorAppAction, Z as RemoveDocumentTypeAction, _ as ProcessorModule, _t as RemoveProcessorAppInput, a as DocumentTypeItemSchema, at as AddDocumentTypeInput, b as useProcessorModuleDocumentsInSelectedFolder, bt as SetProcessorStatusInput, c as RemoveProcessorAppInputSchema, ct as Exact, d as SetProcessorTypeInputSchema, dt as MakeEmpty, et as SetProcessorStatusAction, f as StatusTypeSchema, ft as MakeMaybe, g as utils, gt as RemoveDocumentTypeInput, h as reducer, ht as ProcessorModuleState, i as AddProcessorAppInputSchema, it as ProcessorModulePHState, j as ProcessorModulePHStateSchema, k as ProcessorModuleDocumentHeaderSchema, l as SetProcessorNameInputSchema, lt as Incremental, m as isDefinedNonNullAny, mt as Maybe, n as initialLocalState, nt as ProcessorModuleDocument, o as ProcessorModuleStateSchema, ot as AddProcessorAppInput, p as definedNonNullAnySchema, pt as MakeOptional, q as ProcessorModuleAction, r as AddDocumentTypeInputSchema, rt as ProcessorModuleLocalState, s as RemoveDocumentTypeInputSchema, st as DocumentTypeItem, t as initialGlobalState, tt as SetProcessorTypeAction, u as SetProcessorStatusInputSchema, ut as InputMaybe, v as useProcessorModuleDocumentById, vt as Scalars, w as createState, x as useSelectedProcessorModuleDocument, xt as SetProcessorTypeInput, y as useProcessorModuleDocumentsInSelectedDrive, yt as SetProcessorNameInput, z as creators_d_exports } from "../../index-DE_s19VI.js";
2
2
  import { UpgradeManifest } from "document-model";
3
3
 
4
4
  //#region document-models/processor-module/upgrades/versions.d.ts
@@ -1,4 +1,4 @@
1
- import { $ as StatusType, A as documentModel, B as SubgraphModuleDocument, C as SubgraphModuleDocumentHeaderSchema, D as assertIsSubgraphModuleState, E as assertIsSubgraphModuleDocument, F as SubgraphModuleBaseOperationsOperations, G as InputMaybe, H as SubgraphModulePHState, I as SubgraphModuleAction, J as MakeOptional, K as MakeEmpty, L as SetSubgraphNameAction, M as setSubgraphName, N as setSubgraphStatus, O as isSubgraphModuleDocument, P as SubgraphModuleController, Q as SetSubgraphStatusInput, R as SetSubgraphStatusAction, S as subgraphModuleDocumentType, T as SubgraphModulePHStateSchema, U as Exact, V as SubgraphModuleLocalState, W as Incremental, X as Scalars, Y as Maybe, Z as SetSubgraphNameInput, _ as createState, a as StatusTypeSchema, b as defaultLocalState, c as isDefinedNonNullAny, d as SubgraphModule, et as SubgraphModuleState, f as useSelectedSubgraphModuleDocument, g as actions, h as useSubgraphModuleDocumentsInSelectedFolder, i as SetSubgraphStatusInputSchema, j as creators_d_exports, k as isSubgraphModuleState, l as reducer, m as useSubgraphModuleDocumentsInSelectedDrive, n as initialLocalState, o as SubgraphModuleStateSchema, p as useSubgraphModuleDocumentById, q as MakeMaybe, r as SetSubgraphNameInputSchema, s as definedNonNullAnySchema, t as initialGlobalState, u as utils, v as createSubgraphModuleDocument, w as SubgraphModuleDocumentSchema, x as defaultPHState, y as defaultGlobalState, z as SubgraphModuleBaseOperationsAction } from "../../index-BPoF8P3O.js";
1
+ import { $ as StatusType, A as documentModel, B as SubgraphModuleDocument, C as SubgraphModuleDocumentHeaderSchema, D as assertIsSubgraphModuleState, E as assertIsSubgraphModuleDocument, F as SubgraphModuleBaseOperationsOperations, G as InputMaybe, H as SubgraphModulePHState, I as SubgraphModuleAction, J as MakeOptional, K as MakeEmpty, L as SetSubgraphNameAction, M as setSubgraphName, N as setSubgraphStatus, O as isSubgraphModuleDocument, P as SubgraphModuleController, Q as SetSubgraphStatusInput, R as SetSubgraphStatusAction, S as subgraphModuleDocumentType, T as SubgraphModulePHStateSchema, U as Exact, V as SubgraphModuleLocalState, W as Incremental, X as Scalars, Y as Maybe, Z as SetSubgraphNameInput, _ as createState, a as StatusTypeSchema, b as defaultLocalState, c as isDefinedNonNullAny, d as SubgraphModule, et as SubgraphModuleState, f as useSelectedSubgraphModuleDocument, g as actions, h as useSubgraphModuleDocumentsInSelectedFolder, i as SetSubgraphStatusInputSchema, j as creators_d_exports, k as isSubgraphModuleState, l as reducer, m as useSubgraphModuleDocumentsInSelectedDrive, n as initialLocalState, o as SubgraphModuleStateSchema, p as useSubgraphModuleDocumentById, q as MakeMaybe, r as SetSubgraphNameInputSchema, s as definedNonNullAnySchema, t as initialGlobalState, u as utils, v as createSubgraphModuleDocument, w as SubgraphModuleDocumentSchema, x as defaultPHState, y as defaultGlobalState, z as SubgraphModuleBaseOperationsAction } from "../../index-BL4jGAtJ.js";
2
2
  import { UpgradeManifest } from "document-model";
3
3
 
4
4
  //#region document-models/subgraph-module/upgrades/versions.d.ts
@@ -1,4 +1,4 @@
1
- import { $ as VetraPackageDocument, A as vetraPackageDocumentType, At as SetPackageDescriptionAction, B as creators_d_exports, C as isDefinedNonNullAny, Ct as VetraPackageAction, D as defaultGlobalState, Dt as SetPackageAuthorNameAction, E as createVetraPackageDocument, Et as SetPackageAuthorAction, F as assertIsVetraPackageState, G as setPackageCategory, H as setPackageAuthor, I as isVetraPackageDocument, J as setPackageName, K as setPackageDescription, L as isVetraPackageState, M as VetraPackageDocumentSchema, Mt as SetPackageNameAction, N as VetraPackagePHStateSchema, Nt as SetPackageNpmUrlAction, O as defaultLocalState, Ot as SetPackageAuthorWebsiteAction, P as assertIsVetraPackageDocument, Pt as VetraPackageBaseOperationsAction, Q as actions, R as documentModel, S as definedNonNullAnySchema, St as VetraPackageState, T as createState, Tt as RemovePackageKeywordAction, U as setPackageAuthorName, V as removePackageKeyword, W as setPackageAuthorWebsite, X as VetraPackageController, Y as setPackageNpmUrl, Z as VetraPackageBaseOperationsOperations, _ as SetPackageDescriptionInputSchema, _t as SetPackageCategoryInput, a as useVetraPackageDocumentsInSelectedDrive, at as Incremental, b as SetPackageNpmUrlInputSchema, bt as SetPackageNameInput, c as initialLocalState, ct as MakeEmpty, d as KeywordSchema, dt as Maybe, et as VetraPackageLocalState, f as RemovePackageKeywordInputSchema, ft as RemovePackageKeywordInput, g as SetPackageCategoryInputSchema, gt as SetPackageAuthorWebsiteInput, h as SetPackageAuthorWebsiteInputSchema, ht as SetPackageAuthorNameInput, i as useVetraPackageDocumentById, it as Exact, j as VetraPackageDocumentHeaderSchema, jt as SetPackageGithubUrlAction, k as defaultPHState, kt as SetPackageCategoryAction, l as AddPackageKeywordInputSchema, lt as MakeMaybe, m as SetPackageAuthorNameInputSchema, mt as SetPackageAuthorInput, n as utils, nt as AddPackageKeywordInput, o as useVetraPackageDocumentsInSelectedFolder, ot as InputMaybe, p as SetPackageAuthorInputSchema, pt as Scalars, q as setPackageGithubUrl, r as useSelectedVetraPackageDocument, rt as Author, s as initialGlobalState, st as Keyword, t as VetraPackage, tt as VetraPackagePHState, u as AuthorSchema, ut as MakeOptional, v as SetPackageGithubUrlInputSchema, vt as SetPackageDescriptionInput, w as reducer, wt as AddPackageKeywordAction, x as VetraPackageStateSchema, xt as SetPackageNpmUrlInput, y as SetPackageNameInputSchema, yt as SetPackageGithubUrlInput, z as addPackageKeyword } from "../../module-Drla4Vmn.js";
1
+ import { $ as VetraPackageDocument, A as vetraPackageDocumentType, At as SetPackageDescriptionAction, B as creators_d_exports, C as isDefinedNonNullAny, Ct as VetraPackageAction, D as defaultGlobalState, Dt as SetPackageAuthorNameAction, E as createVetraPackageDocument, Et as SetPackageAuthorAction, F as assertIsVetraPackageState, G as setPackageCategory, H as setPackageAuthor, I as isVetraPackageDocument, J as setPackageName, K as setPackageDescription, L as isVetraPackageState, M as VetraPackageDocumentSchema, Mt as SetPackageNameAction, N as VetraPackagePHStateSchema, Nt as SetPackageNpmUrlAction, O as defaultLocalState, Ot as SetPackageAuthorWebsiteAction, P as assertIsVetraPackageDocument, Pt as VetraPackageBaseOperationsAction, Q as actions, R as documentModel, S as definedNonNullAnySchema, St as VetraPackageState, T as createState, Tt as RemovePackageKeywordAction, U as setPackageAuthorName, V as removePackageKeyword, W as setPackageAuthorWebsite, X as VetraPackageController, Y as setPackageNpmUrl, Z as VetraPackageBaseOperationsOperations, _ as SetPackageDescriptionInputSchema, _t as SetPackageCategoryInput, a as useVetraPackageDocumentsInSelectedDrive, at as Incremental, b as SetPackageNpmUrlInputSchema, bt as SetPackageNameInput, c as initialLocalState, ct as MakeEmpty, d as KeywordSchema, dt as Maybe, et as VetraPackageLocalState, f as RemovePackageKeywordInputSchema, ft as RemovePackageKeywordInput, g as SetPackageCategoryInputSchema, gt as SetPackageAuthorWebsiteInput, h as SetPackageAuthorWebsiteInputSchema, ht as SetPackageAuthorNameInput, i as useVetraPackageDocumentById, it as Exact, j as VetraPackageDocumentHeaderSchema, jt as SetPackageGithubUrlAction, k as defaultPHState, kt as SetPackageCategoryAction, l as AddPackageKeywordInputSchema, lt as MakeMaybe, m as SetPackageAuthorNameInputSchema, mt as SetPackageAuthorInput, n as utils, nt as AddPackageKeywordInput, o as useVetraPackageDocumentsInSelectedFolder, ot as InputMaybe, p as SetPackageAuthorInputSchema, pt as Scalars, q as setPackageGithubUrl, r as useSelectedVetraPackageDocument, rt as Author, s as initialGlobalState, st as Keyword, t as VetraPackage, tt as VetraPackagePHState, u as AuthorSchema, ut as MakeOptional, v as SetPackageGithubUrlInputSchema, vt as SetPackageDescriptionInput, w as reducer, wt as AddPackageKeywordAction, x as VetraPackageStateSchema, xt as SetPackageNpmUrlInput, y as SetPackageNameInputSchema, yt as SetPackageGithubUrlInput, z as addPackageKeyword } from "../../module-rS5YXFpM.js";
2
2
  import { UpgradeManifest } from "document-model";
3
3
 
4
4
  //#region document-models/vetra-package/upgrades/versions.d.ts
@@ -172,4 +172,4 @@ function Editor() {
172
172
  //#endregion
173
173
  export { Editor as default };
174
174
 
175
- //# sourceMappingURL=editor-UWE1ab9Y.js.map
175
+ //# sourceMappingURL=editor-BamOOi9L.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-UWE1ab9Y.js","names":[],"sources":["../editors/document-editor/components/DocumentEditorForm.tsx","../editors/document-editor/config.ts","../editors/document-editor/editor.tsx"],"sourcesContent":["import { Suspense, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n {...props}\n >\n <option value=\"\">Select a document type</option>\n {props.children}\n </select>\n );\n}\n\nfunction DocumentTypeSelect({\n documentTypes,\n setDocumentTypes,\n onAddDocumentType,\n onRemoveDocumentType,\n}: {\n setDocumentTypes: (documentTypes: DocumentTypeItem[]) => void;\n} & Pick<\n DocumentEditorFormProps,\n \"documentTypes\" | \"onAddDocumentType\" | \"onRemoveDocumentType\"\n>) {\n // Get available document types from the hook (vetra drive only for document editor)\n const availableDocumentTypes = useAvailableDocumentTypes(true);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\n return (\n <DocumentTypeSelectUI\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (selectedValue) {\n // Remove existing document type if any\n\n const existingType = documentTypes?.at(0);\n if (existingType) {\n onRemoveDocumentType?.({ id: existingType.id });\n }\n\n // Add the new document type\n const newTypeInput: AddDocumentTypeInput = {\n id: Date.now().toString(), // Generate a unique ID\n documentType: selectedValue,\n };\n const newType: DocumentTypeItem = {\n id: newTypeInput.id,\n documentType: newTypeInput.documentType,\n };\n setDocumentTypes([newType]); // Replace with single item array\n onAddDocumentType?.(newTypeInput);\n }\n setSelectedDocumentType(\"\");\n }}\n >\n {availableDocumentTypes.map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </DocumentTypeSelectUI>\n );\n}\n\nexport const DocumentEditorForm: React.FC<DocumentEditorFormProps> = ({\n editorName: initialEditorName = \"\",\n documentTypes: initialDocumentTypes = [],\n status = \"DRAFT\",\n onEditorNameChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onConfirm,\n}) => {\n const [editorName, setEditorName] = useState(initialEditorName);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(editorName, onEditorNameChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Editor Name\n </label>\n <input\n id=\"editor-name\"\n type=\"text\"\n value={editorName}\n onChange={(e) => setEditorName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\nimport { useSelectedDocumentEditorDocument } from \"../../document-models/document-editor/index.js\";\nimport {\n addDocumentType,\n removeDocumentType,\n setEditorName,\n setEditorStatus,\n type AddDocumentTypeInput,\n type RemoveDocumentTypeInput,\n} from \"../../document-models/document-editor/index.js\";\nimport { DocumentEditorForm } from \"./components/DocumentEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDocumentEditorDocument();\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAS,qBACP,OACA;AACA,QACE,qBAAC,UAAD;EACE,IAAG;EACH,WAAU;EACV,GAAI;YAHN,CAKE,oBAAC,UAAD;GAAQ,OAAM;aAAG;GAA+B,CAAA,EAC/C,MAAM,SACA;;;AAIb,SAAS,mBAAmB,EAC1B,eACA,kBACA,mBACA,wBAMC;CAED,MAAM,yBAAyB,0BAA0B,KAAK;CAC9D,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;AAEpE,QACE,oBAAC,sBAAD;EACE,OAAO;EACP,WAAW,MAAM;GACf,MAAM,gBAAgB,EAAE,OAAO;AAC/B,OAAI,eAAe;IAGjB,MAAM,eAAe,eAAe,GAAG,EAAE;AACzC,QAAI,aACF,wBAAuB,EAAE,IAAI,aAAa,IAAI,CAAC;IAIjD,MAAM,eAAqC;KACzC,IAAI,KAAK,KAAK,CAAC,UAAU;KACzB,cAAc;KACf;AAKD,qBAAiB,CAJiB;KAChC,IAAI,aAAa;KACjB,cAAc,aAAa;KAC5B,CACyB,CAAC;AAC3B,wBAAoB,aAAa;;AAEnC,2BAAwB,GAAG;;YAG5B,uBAAuB,KAAK,YAC3B,oBAAC,UAAD;GAAsB,OAAO;aAC1B;GACM,EAFI,QAEJ,CACT;EACmB,CAAA;;AAI3B,MAAa,sBAAyD,EACpE,YAAY,oBAAoB,IAChC,e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C;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,QAAQ,SAAS,MAAM,OAAO;GAC9B,YAAY,SAAS,MAAM,OAAO,QAAQ;GAC1C,eAAe,SAAS,MAAM,OAAO;GACjB;GACD;GACG;GACX;GACX,CAAA,CACE"}
1
+ {"version":3,"file":"editor-BamOOi9L.js","names":[],"sources":["../editors/document-editor/components/DocumentEditorForm.tsx","../editors/document-editor/config.ts","../editors/document-editor/editor.tsx"],"sourcesContent":["import { Suspense, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n {...props}\n >\n <option value=\"\">Select a document type</option>\n {props.children}\n </select>\n );\n}\n\nfunction DocumentTypeSelect({\n documentTypes,\n setDocumentTypes,\n onAddDocumentType,\n onRemoveDocumentType,\n}: {\n setDocumentTypes: (documentTypes: DocumentTypeItem[]) => void;\n} & Pick<\n DocumentEditorFormProps,\n \"documentTypes\" | \"onAddDocumentType\" | \"onRemoveDocumentType\"\n>) {\n // Get available document types from the hook (vetra drive only for document editor)\n const availableDocumentTypes = useAvailableDocumentTypes(true);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\n return (\n <DocumentTypeSelectUI\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (selectedValue) {\n // Remove existing document type if any\n\n const existingType = documentTypes?.at(0);\n if (existingType) {\n onRemoveDocumentType?.({ id: existingType.id });\n }\n\n // Add the new document type\n const newTypeInput: AddDocumentTypeInput = {\n id: Date.now().toString(), // Generate a unique ID\n documentType: selectedValue,\n };\n const newType: DocumentTypeItem = {\n id: newTypeInput.id,\n documentType: newTypeInput.documentType,\n };\n setDocumentTypes([newType]); // Replace with single item array\n onAddDocumentType?.(newTypeInput);\n }\n setSelectedDocumentType(\"\");\n }}\n >\n {availableDocumentTypes.map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </DocumentTypeSelectUI>\n );\n}\n\nexport const DocumentEditorForm: React.FC<DocumentEditorFormProps> = ({\n editorName: initialEditorName = \"\",\n documentTypes: initialDocumentTypes = [],\n status = \"DRAFT\",\n onEditorNameChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onConfirm,\n}) => {\n const [editorName, setEditorName] = useState(initialEditorName);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(editorName, onEditorNameChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Editor Name\n </label>\n <input\n id=\"editor-name\"\n type=\"text\"\n value={editorName}\n onChange={(e) => setEditorName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\nimport { useSelectedDocumentEditorDocument } from \"../../document-models/document-editor/index.js\";\nimport {\n addDocumentType,\n removeDocumentType,\n setEditorName,\n setEditorStatus,\n type AddDocumentTypeInput,\n type RemoveDocumentTypeInput,\n} from \"../../document-models/document-editor/index.js\";\nimport { DocumentEditorForm } from \"./components/DocumentEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDocumentEditorDocument();\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAS,qBACP,OACA;AACA,QACE,qBAAC,UAAD;EACE,IAAG;EACH,WAAU;EACV,GAAI;YAHN,CAKE,oBAAC,UAAD;GAAQ,OAAM;aAAG;GAA+B,CAAA,EAC/C,MAAM,SACA;;;AAIb,SAAS,mBAAmB,EAC1B,eACA,kBACA,mBACA,wBAMC;CAED,MAAM,yBAAyB,0BAA0B,KAAK;CAC9D,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;AAEpE,QACE,oBAAC,sBAAD;EACE,OAAO;EACP,WAAW,MAAM;GACf,MAAM,gBAAgB,EAAE,OAAO;AAC/B,OAAI,eAAe;IAGjB,MAAM,eAAe,eAAe,GAAG,EAAE;AACzC,QAAI,aACF,wBAAuB,EAAE,IAAI,aAAa,IAAI,CAAC;IAIjD,MAAM,eAAqC;KACzC,IAAI,KAAK,KAAK,CAAC,UAAU;KACzB,cAAc;KACf;AAKD,qBAAiB,CAJiB;KAChC,IAAI,aAAa;KACjB,cAAc,aAAa;KAC5B,CACyB,CAAC;AAC3B,wBAAoB,aAAa;;AAEnC,2BAAwB,GAAG;;YAG5B,uBAAuB,KAAK,YAC3B,oBAAC,UAAD;GAAsB,OAAO;aAC1B;GACM,EAFI,QAEJ,CACT;EACmB,CAAA;;AAI3B,M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,aAAa,CAAC,CAAC;IACjD,CAAC,SAAS,CAAC;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,QAAQ,SAAS,MAAM,OAAO;GAC9B,YAAY,SAAS,MAAM,OAAO,QAAQ;GAC1C,eAAe,SAAS,MAAM,OAAO;GACjB;GACD;GACG;GACX;GACX,CAAA,CACE"}
@@ -1,7 +1,7 @@
1
1
  import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from "./utils-CkWB3DRk.js";
2
2
  import { StatusPill } from "./editors/components/index.js";
3
3
  import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Btogj1f0.js";
4
- import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-BQKyels4.js";
4
+ import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-tpjMF571.js";
5
5
  import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
6
6
  import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
7
7
  import { useCallback, useEffect, useState } from "react";
@@ -241,4 +241,4 @@ function Editor() {
241
241
  //#endregion
242
242
  export { Editor as default };
243
243
 
244
- //# sourceMappingURL=editor-Dw-NohMb.js.map
244
+ //# sourceMappingURL=editor-CM9tpwzR.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-Dw-NohMb.js","names":[],"sources":["../editors/processor-editor/components/ProcessorEditorForm.tsx","../editors/processor-editor/config.ts","../editors/processor-editor/editor.tsx"],"sourcesContent":["import {\n PROCESSOR_APPS,\n type ProcessorApp,\n type ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport type { DocumentTypeItem } from \"../../../document-models/processor-module/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface ProcessorEditorFormProps {\n processorName?: string;\n processorType?: string;\n documentTypes?: DocumentTypeItem[];\n processorApps?: ProcessorApps;\n status?: string;\n onNameChange?: (name: string) => void;\n onTypeChange?: (type: string) => void;\n onAddDocumentType?: (id: string, documentType: string) => void;\n onRemoveDocumentType?: (id: string) => void;\n onAddProcessorApp?: (processorApp: ProcessorApp) => void;\n onRemoveProcessorApp?: (processorApp: ProcessorApp) => void;\n onConfirm?: () => void;\n}\n\nexport const ProcessorEditorForm: React.FC<ProcessorEditorFormProps> = ({\n processorName: initialProcessorName = \"\",\n processorType: initialProcessorType = \"\",\n documentTypes: initialDocumentTypes = [],\n processorApps: initialProcessorApps = [],\n status = \"DRAFT\",\n onNameChange,\n onTypeChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onAddProcessorApp,\n onRemoveProcessorApp,\n onConfirm,\n}) => {\n const [processorName, setProcessorName] = useState(initialProcessorName);\n const [processorType, setProcessorType] = useState(initialProcessorType);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n const [processorApps, setProcessorApps] = useState(initialProcessorApps);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Get available document types from the hook (combines reactor and vetra drive)\n const availableDocumentTypes = useAvailableDocumentTypes();\n\n // Use the debounce hook for name and type changes\n useDebounce(processorName, onNameChange, 300);\n useDebounce(processorType, onTypeChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorName(initialProcessorName);\n }, [initialProcessorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorType(initialProcessorType);\n }, [initialProcessorType]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorApps(initialProcessorApps);\n }, [initialProcessorApps]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (\n processorName.trim() &&\n processorType &&\n documentTypes.length > 0 &&\n processorApps.length > 0\n ) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n const handleRemoveDocumentType = (id: string) => {\n setDocumentTypes(documentTypes.filter((dt) => dt.id !== id));\n onRemoveDocumentType?.(id);\n };\n\n const canConfirm =\n !!processorName.trim() &&\n !!processorType &&\n documentTypes.length > 0 &&\n processorApps.length > 0;\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n Processor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Processor Name Field */}\n <div>\n <label\n htmlFor=\"processor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Processor Name\n </label>\n <input\n id=\"processor-name\"\n type=\"text\"\n value={processorName}\n onChange={(e) => setProcessorName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n placeholder=\"Enter processor name\"\n />\n </div>\n\n {/* Processor Type Dropdown */}\n <div>\n <label\n htmlFor=\"processor-type\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Type\n </label>\n <select\n id=\"processor-type\"\n value={processorType}\n onChange={(e) => setProcessorType(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n >\n <option value=\"\">Select type...</option>\n <option value=\"analytics\">Analytics</option>\n <option value=\"relational\">Relational Database</option>\n </select>\n </div>\n\n {/* Document Types Field */}\n <div>\n <label\n htmlFor=\"document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && availableDocumentTypes.length > 0 && (\n <select\n id=\"document-types\"\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (\n selectedValue &&\n !documentTypes.some((dt) => dt.documentType === selectedValue)\n ) {\n const id = Date.now().toString();\n const newType: DocumentTypeItem = {\n id,\n documentType: selectedValue,\n };\n setDocumentTypes([...documentTypes, newType]);\n onAddDocumentType?.(id, selectedValue);\n }\n setSelectedDocumentType(\"\");\n }}\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n >\n <option value=\"\">Select a document type to add</option>\n {availableDocumentTypes\n .filter(\n (docType) =>\n !documentTypes.some((dt) => dt.documentType === docType),\n )\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </select>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type.id)}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n {/* Processor Apps Field */}\n <div>\n <label\n htmlFor=\"processor-apps\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Processor Apps\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <>\n {PROCESSOR_APPS.map((processorApp) => (\n <div key={processorApp} className=\"flex gap-1\">\n <input\n type=\"checkbox\"\n name={processorApp}\n id={processorApp}\n checked={processorApps.includes(processorApp)}\n onChange={(event) => {\n const isChecked = event.target.checked;\n if (isChecked) {\n setProcessorApps((processorApps) => [\n ...new Set([...processorApps, processorApp]),\n ]);\n onAddProcessorApp?.(processorApp);\n } else {\n if (processorApps.length > 1) {\n setProcessorApps((processorApps) =>\n processorApps.filter((p) => p !== processorApp),\n );\n onRemoveProcessorApp?.(processorApp);\n }\n }\n }}\n />\n <label\n htmlFor={processorApp}\n className=\"text-gray-700 dark:text-slate-200\"\n >\n {processorApp}\n </label>\n </div>\n ))}\n </>\n )}\n <div className=\"space-y-1\">\n {isReadOnly &&\n processorApps.map((processorApp) => (\n <span\n key={processorApp}\n className=\"text-sm text-gray-700 dark:text-slate-200\"\n >\n {processorApp}\n </span>\n ))}\n </div>\n </div>\n </div>\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!canConfirm}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport type {\n ProcessorApp,\n ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { useCallback } from \"react\";\nimport {\n addDocumentType,\n addProcessorApp,\n removeDocumentType,\n removeProcessorApp,\n setProcessorName,\n setProcessorStatus,\n setProcessorType,\n} from \"../../document-models/processor-module/index.js\";\nimport { useSelectedProcessorModuleDocument } from \"../hooks/useVetraDocument.js\";\nimport { ProcessorEditorForm } from \"./components/ProcessorEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedProcessorModuleDocument();\n\n const onConfirm = useCallback(() => {\n // Dispatch all actions at once\n dispatch([setProcessorStatus({ status: \"CONFIRMED\" })]);\n }, [dispatch]);\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === document.state.global.name) return;\n dispatch(setProcessorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onTypeChange = useCallback(\n (type: string) => {\n if (type === document.state.global.type) return;\n dispatch(setProcessorType({ type }));\n },\n [document.state.global.type, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (id: string, documentType: string) => {\n dispatch(addDocumentType({ id, documentType }));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (id: string) => {\n dispatch(removeDocumentType({ id }));\n },\n [dispatch],\n );\n\n const onAddProcessorApp = useCallback(\n (processorApp: ProcessorApp) => {\n dispatch(addProcessorApp({ processorApp }));\n },\n [dispatch],\n );\n\n const onRemoveProcessorApp = useCallback(\n (processorApp: ProcessorApp) => {\n dispatch(removeProcessorApp({ processorApp }));\n },\n [dispatch],\n );\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <ProcessorEditorForm\n onNameChange={onNameChange}\n onTypeChange={onTypeChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onAddProcessorApp={onAddProcessorApp}\n onRemoveProcessorApp={onRemoveProcessorApp}\n status={document.state.global.status}\n processorName={document.state.global.name ?? \"\"}\n processorType={document.state.global.type ?? \"\"}\n documentTypes={document.state.global.documentTypes ?? []}\n processorApps={document.state.global.processorApps as ProcessorApps}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,uBAA2D,EACtE,eAAe,uBAAuB,IACtC,eAAe,uBAAuB,IACtC,eAAe,uBAAuB,EAAE,EACxC,eAAe,uBAAuB,EAAE,EACxC,SAAS,SACT,cACA,cACA,mBACA,sBACA,mBACA,sBACA,gBACI;CACJ,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,eAAe,oBACpB,SAA6B,qBAAqB;CACpD,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;CACpE,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CAGrD,MAAM,yBAAyB,2BAA2B;AAG1D,aAAY,eAAe,cAAc,IAAI;AAC7C,aAAY,eAAe,cAAc,IAAI;AAG7C,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAE1B,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAE1B,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAE1B,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAG1B,iBAAgB;AACd,MAAI,WAAW,QAEb,gBAAe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AAM,eAAe,aAClB,SAAiB;AAChB,MAAI,SAAS,SAAS,MAAM,OAAO,KAAM;AACzC,WAAS,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAEtC,CAAC,SAAS,MAAM,OAAO,MAAM,SAAS,CACvC;CAED,MAAM,oBAAoB,aACvB,IAAY,iBAAyB;AACpC,WAAS,gBAAgB;GAAE;GAAI;GAAc,CAAC,CAAC;IAEjD,CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,OAAe;AACd,WAAS,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAEtC,CAAC,SAAS,CACX;CAED,MAAM,oBAAoB,aACvB,iBAA+B;AAC9B,WAAS,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAE7C,CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,iBAA+B;AAC9B,WAAS,mBAAmB,EAAE,cAAc,CAAC,CAAC;IAEhD,CAAC,SAAS,CACX;AAED,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,qBAAD;GACgB;GACA;GACK;GACG;GACH;GACG;GACtB,QAAQ,SAAS,MAAM,OAAO;GAC9B,eAAe,SAAS,MAAM,OAAO,QAAQ;GAC7C,eAAe,SAAS,MAAM,OAAO,QAAQ;GAC7C,eAAe,SAAS,MAAM,OAAO,iBAAiB,EAAE;GACxD,eAAe,SAAS,MAAM,OAAO;GAC1B;GACX,CAAA,CACE"}
1
+ {"version":3,"file":"editor-CM9tpwzR.js","names":[],"sources":["../editors/processor-editor/components/ProcessorEditorForm.tsx","../editors/processor-editor/config.ts","../editors/processor-editor/editor.tsx"],"sourcesContent":["import {\n PROCESSOR_APPS,\n type ProcessorApp,\n type ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport type { DocumentTypeItem } from \"../../../document-models/processor-module/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface ProcessorEditorFormProps {\n processorName?: string;\n processorType?: string;\n documentTypes?: DocumentTypeItem[];\n processorApps?: ProcessorApps;\n status?: string;\n onNameChange?: (name: string) => void;\n onTypeChange?: (type: string) => void;\n onAddDocumentType?: (id: string, documentType: string) => void;\n onRemoveDocumentType?: (id: string) => void;\n onAddProcessorApp?: (processorApp: ProcessorApp) => void;\n onRemoveProcessorApp?: (processorApp: ProcessorApp) => void;\n onConfirm?: () => void;\n}\n\nexport const ProcessorEditorForm: React.FC<ProcessorEditorFormProps> = ({\n processorName: initialProcessorName = \"\",\n processorType: initialProcessorType = \"\",\n documentTypes: initialDocumentTypes = [],\n processorApps: initialProcessorApps = [],\n status = \"DRAFT\",\n onNameChange,\n onTypeChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onAddProcessorApp,\n onRemoveProcessorApp,\n onConfirm,\n}) => {\n const [processorName, setProcessorName] = useState(initialProcessorName);\n const [processorType, setProcessorType] = useState(initialProcessorType);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n const [processorApps, setProcessorApps] = useState(initialProcessorApps);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Get available document types from the hook (combines reactor and vetra drive)\n const availableDocumentTypes = useAvailableDocumentTypes();\n\n // Use the debounce hook for name and type changes\n useDebounce(processorName, onNameChange, 300);\n useDebounce(processorType, onTypeChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorName(initialProcessorName);\n }, [initialProcessorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorType(initialProcessorType);\n }, [initialProcessorType]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setProcessorApps(initialProcessorApps);\n }, [initialProcessorApps]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (\n processorName.trim() &&\n processorType &&\n documentTypes.length > 0 &&\n processorApps.length > 0\n ) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n const handleRemoveDocumentType = (id: string) => {\n setDocumentTypes(documentTypes.filter((dt) => dt.id !== id));\n onRemoveDocumentType?.(id);\n };\n\n const canConfirm =\n !!processorName.trim() &&\n !!processorType &&\n documentTypes.length > 0 &&\n processorApps.length > 0;\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n Processor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Processor Name Field */}\n <div>\n <label\n htmlFor=\"processor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Processor Name\n </label>\n <input\n id=\"processor-name\"\n type=\"text\"\n value={processorName}\n onChange={(e) => setProcessorName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 placeholder:text-gray-700 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-200\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n placeholder=\"Enter processor name\"\n />\n </div>\n\n {/* Processor Type Dropdown */}\n <div>\n <label\n htmlFor=\"processor-type\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Type\n </label>\n <select\n id=\"processor-type\"\n value={processorType}\n onChange={(e) => setProcessorType(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n >\n <option value=\"\">Select type...</option>\n <option value=\"analytics\">Analytics</option>\n <option value=\"relational\">Relational Database</option>\n </select>\n </div>\n\n {/* Document Types Field */}\n <div>\n <label\n htmlFor=\"document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && availableDocumentTypes.length > 0 && (\n <select\n id=\"document-types\"\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (\n selectedValue &&\n !documentTypes.some((dt) => dt.documentType === selectedValue)\n ) {\n const id = Date.now().toString();\n const newType: DocumentTypeItem = {\n id,\n documentType: selectedValue,\n };\n setDocumentTypes([...documentTypes, newType]);\n onAddDocumentType?.(id, selectedValue);\n }\n setSelectedDocumentType(\"\");\n }}\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n >\n <option value=\"\">Select a document type to add</option>\n {availableDocumentTypes\n .filter(\n (docType) =>\n !documentTypes.some((dt) => dt.documentType === docType),\n )\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </select>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type.id)}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n {/* Processor Apps Field */}\n <div>\n <label\n htmlFor=\"processor-apps\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Processor Apps\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <>\n {PROCESSOR_APPS.map((processorApp) => (\n <div key={processorApp} className=\"flex gap-1\">\n <input\n type=\"checkbox\"\n name={processorApp}\n id={processorApp}\n checked={processorApps.includes(processorApp)}\n onChange={(event) => {\n const isChecked = event.target.checked;\n if (isChecked) {\n setProcessorApps((processorApps) => [\n ...new Set([...processorApps, processorApp]),\n ]);\n onAddProcessorApp?.(processorApp);\n } else {\n if (processorApps.length > 1) {\n setProcessorApps((processorApps) =>\n processorApps.filter((p) => p !== processorApp),\n );\n onRemoveProcessorApp?.(processorApp);\n }\n }\n }}\n />\n <label\n htmlFor={processorApp}\n className=\"text-gray-700 dark:text-slate-200\"\n >\n {processorApp}\n </label>\n </div>\n ))}\n </>\n )}\n <div className=\"space-y-1\">\n {isReadOnly &&\n processorApps.map((processorApp) => (\n <span\n key={processorApp}\n className=\"text-sm text-gray-700 dark:text-slate-200\"\n >\n {processorApp}\n </span>\n ))}\n </div>\n </div>\n </div>\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!canConfirm}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport type {\n ProcessorApp,\n ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { useCallback } from \"react\";\nimport {\n addDocumentType,\n addProcessorApp,\n removeDocumentType,\n removeProcessorApp,\n setProcessorName,\n setProcessorStatus,\n setProcessorType,\n} from \"../../document-models/processor-module/index.js\";\nimport { useSelectedProcessorModuleDocument } from \"../hooks/useVetraDocument.js\";\nimport { ProcessorEditorForm } from \"./components/ProcessorEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedProcessorModuleDocument();\n\n const onConfirm = useCallback(() => {\n // Dispatch all actions at once\n dispatch([setProcessorStatus({ status: \"CONFIRMED\" })]);\n }, [dispatch]);\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === document.state.global.name) return;\n dispatch(setProcessorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onTypeChange = useCallback(\n (type: string) => {\n if (type === document.state.global.type) return;\n dispatch(setProcessorType({ type }));\n },\n [document.state.global.type, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (id: string, documentType: string) => {\n dispatch(addDocumentType({ id, documentType }));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (id: string) => {\n dispatch(removeDocumentType({ id }));\n },\n [dispatch],\n );\n\n const onAddProcessorApp = useCallback(\n (processorApp: ProcessorApp) => {\n dispatch(addProcessorApp({ processorApp }));\n },\n [dispatch],\n );\n\n const onRemoveProcessorApp = useCallback(\n (processorApp: ProcessorApp) => {\n dispatch(removeProcessorApp({ processorApp }));\n },\n [dispatch],\n );\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <ProcessorEditorForm\n onNameChange={onNameChange}\n onTypeChange={onTypeChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onAddProcessorApp={onAddProcessorApp}\n onRemoveProcessorApp={onRemoveProcessorApp}\n status={document.state.global.status}\n processorName={document.state.global.name ?? \"\"}\n processorType={document.state.global.type ?? \"\"}\n documentTypes={document.state.global.documentTypes ?? []}\n processorApps={document.state.global.processorApps as ProcessorApps}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,uBAA2D,EACtE,eAAe,uBAAuB,IACtC,eAAe,uBAAuB,IACtC,eAAe,uBAAuB,EAAE,EACxC,eAAe,uBAAuB,EAAE,EACxC,SAAS,SACT,cACA,cACA,mBACA,sBACA,mBACA,sBACA,gBACI;CACJ,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,eAAe,oBACpB,SAA6B,qBAAqB;CACpD,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;CACpE,MAAM,CAAC,eAAe,oBAAoB,SAAS,qBAAqB;CACxE,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CAGrD,MAAM,yBAAyB,2BAA2B;AAG1D,aAAY,eAAe,cAAc,IAAI;AAC7C,aAAY,eAAe,cAAc,IAAI;AAG7C,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAE1B,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAE1B,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAE1B,iBAAgB;AAEd,mBAAiB,qBAAqB;IACrC,CAAC,qBAAqB,CAAC;AAG1B,iB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AAM,OAAO,MAAM,SAAS,CACvC;CAED,MAAM,eAAe,aAClB,SAAiB;AAChB,MAAI,SAAS,SAAS,MAAM,OAAO,KAAM;AACzC,WAAS,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAEtC,CAAC,SAAS,MAAM,OAAO,MAAM,SAAS,CACvC;CAED,MAAM,oBAAoB,aACvB,IAAY,iBAAyB;AACpC,WAAS,gBAAgB;GAAE;GAAI;GAAc,CAAC,CAAC;IAEjD,CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,OAAe;AACd,WAAS,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAEtC,CAAC,SAAS,CACX;CAED,MAAM,oBAAoB,aACvB,iBAA+B;AAC9B,WAAS,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAE7C,CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,iBAA+B;AAC9B,WAAS,mBAAmB,EAAE,cAAc,CAAC,CAAC;IAEhD,CAAC,SAAS,CACX;AAED,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,qBAAD;GACgB;GACA;GACK;GACG;GACH;GACG;GACtB,QAAQ,SAAS,MAAM,OAAO;GAC9B,eAAe,SAAS,MAAM,OAAO,QAAQ;GAC7C,eAAe,SAAS,MAAM,OAAO,QAAQ;GAC7C,eAAe,SAAS,MAAM,OAAO,iBAAiB,EAAE;GACxD,eAAe,SAAS,MAAM,OAAO;GAC1B;GACX,CAAA,CACE"}
@@ -197,4 +197,4 @@ function Editor() {
197
197
  //#endregion
198
198
  export { Editor as default };
199
199
 
200
- //# sourceMappingURL=editor-BQxk6LrL.js.map
200
+ //# sourceMappingURL=editor-D-QqGEkw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-BQxk6LrL.js","names":[],"sources":["../editors/app-editor/components/AppEditorForm.tsx","../editors/app-editor/config.ts","../editors/app-editor/editor.tsx"],"sourcesContent":["import {\n useDocumentTypesInSelectedDrive,\n useSupportedDocumentTypesInReactor,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addDocumentType,\n removeDocumentType,\n setAppName,\n setAppStatus,\n setDocumentTypes,\n setDragAndDropEnabled,\n} from \"@powerhousedao/vetra/document-models/app-module\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { useSelectedAppModuleDocument } from \"../../../document-models/app-module/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nconst ALL_IN_DRIVE = \"all-in-drive\";\nconst ALL_IN_REACTOR = \"all-in-reactor\";\nconst ALLOW_ANY = \"allow-any\";\n\nexport const AppEditorForm = () => {\n const [document, dispatch] = useSelectedAppModuleDocument();\n const documentName = document.state.global.name;\n const status = document.state.global.status;\n const isDragAndDropEnabled = document.state.global.isDragAndDropEnabled;\n const allowedDocumentTypes = document.state.global.allowedDocumentTypes;\n const [appName, handleSetAppName] = useState(documentName);\n const [isConfirmed, setIsConfirmed] = useState(status === \"CONFIRMED\");\n const documentTypesInSelectedDrive = useDocumentTypesInSelectedDrive();\n const supportedDocumentTypesInReactor = useSupportedDocumentTypesInReactor();\n const [selectedDocumentTypes, setSelectedDocumentTypes] = useState(\n allowedDocumentTypes ?? [],\n );\n\n // Use the debounce hook for name changes\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === documentName) return;\n console.log(\"onNameChange\", name);\n dispatch(setAppName({ name }));\n },\n [documentName, dispatch],\n );\n\n useDebounce(appName, onNameChange, 300);\n\n const onConfirm = () => {\n dispatch(setAppStatus({ status: \"CONFIRMED\" }));\n };\n\n const onDragAndDropToggle = (enabled: boolean) => {\n if (enabled === isDragAndDropEnabled) return;\n dispatch(setDragAndDropEnabled({ enabled }));\n };\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (appName.trim()) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm();\n }\n };\n\n const handleAddDocumentType = (documentType: string) => {\n if (!documentType || selectedDocumentTypes.includes(documentType)) return;\n setSelectedDocumentTypes([...selectedDocumentTypes, documentType]);\n dispatch(addDocumentType({ documentType }));\n };\n\n const handleRemoveDocumentType = (documentType: string) => {\n setSelectedDocumentTypes(\n selectedDocumentTypes.filter((dt) => dt !== documentType),\n );\n dispatch(removeDocumentType({ documentType }));\n };\n\n const handleAddAllDocumentTypesInDrive = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(documentTypesInSelectedDrive ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAddAllDocumentTypesInReactor = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(supportedDocumentTypesInReactor ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAllowAnyDocumentType = () => {\n setSelectedDocumentTypes([]);\n dispatch(setDocumentTypes({ documentTypes: [] }));\n };\n\n const handleDocumentTypeSelection = (selectedValue: string) => {\n if (selectedValue === ALL_IN_DRIVE) {\n handleAddAllDocumentTypesInDrive();\n } else if (selectedValue === ALL_IN_REACTOR) {\n handleAddAllDocumentTypesInReactor();\n } else if (selectedValue === ALLOW_ANY) {\n handleAllowAnyDocumentType();\n } else {\n handleAddDocumentType(selectedValue);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n App Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* App Name Field */}\n <div>\n <label\n htmlFor=\"app-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n App Name\n </label>\n <input\n id=\"app-name\"\n type=\"text\"\n value={appName}\n onChange={(e) => handleSetAppName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-50 placeholder:text-gray-400 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-400\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n placeholder=\"Enter app name\"\n />\n </div>\n\n {/* Document Types Field */}\n <div>\n <label\n htmlFor=\"document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <select\n onChange={(e) => handleDocumentTypeSelection(e.target.value)}\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n >\n <option>Select a document type to add</option>\n <option>--- Vetra drive document types ---</option>\n <option value={ALL_IN_DRIVE}>\n Add all document types in Vetra drive\n </option>\n {documentTypesInSelectedDrive\n ?.filter((dt) => !selectedDocumentTypes.includes(dt))\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n <option>--- Reactor document types ---</option>\n <option value={ALL_IN_REACTOR}>\n Add all document types in Reactor\n </option>\n {supportedDocumentTypesInReactor\n ?.filter((dt) => !selectedDocumentTypes.includes(dt))\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n <option>--- Allow any document type ---</option>\n <option value={ALLOW_ANY}>Allow any document type</option>\n </select>\n )}\n <div className=\"space-y-1\">\n {selectedDocumentTypes.length > 0 ? (\n selectedDocumentTypes.map((type) => (\n <div key={type} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type)}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))\n ) : (\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n All documents (*)\n </span>\n )}\n </div>\n </div>\n </div>\n\n {/* Drag and Drop Settings */}\n <div>\n <h3 className=\"mb-4 text-base font-medium text-gray-900 dark:text-slate-50\">\n Drag and Drop Settings\n </h3>\n\n {/* Enable/Disable Switch */}\n <div className=\"mb-4\">\n <label htmlFor=\"drag-and-drop-enabled\" className=\"flex items-center\">\n <input\n id=\"drag-and-drop-enabled\"\n type=\"checkbox\"\n checked={isDragAndDropEnabled}\n onChange={(e) => onDragAndDropToggle(e.target.checked)}\n disabled={isReadOnly}\n className={twMerge(\n \"mr-2 size-4 rounded-sm border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\",\n isReadOnly ? \"cursor-not-allowed\" : \"\",\n )}\n />\n <span className=\"text-sm font-medium text-gray-700 dark:text-slate-200\">\n Enable drag and drop\n </span>\n </label>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!appName.trim()}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { AppEditorForm } from \"./components/AppEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <AppEditorForm />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAElB,MAAa,sBAAsB;CACjC,MAAM,CAAC,UAAU,YAAY,8BAA8B;CAC3D,MAAM,eAAe,SAAS,MAAM,OAAO;CAC3C,MAAM,SAAS,SAAS,MAAM,OAAO;CACrC,MAAM,uBAAuB,SAAS,MAAM,OAAO;CACnD,MAAM,uBAAuB,SAAS,MAAM,OAAO;CACnD,MAAM,CAAC,SAAS,oBAAoB,SAAS,aAAa;CAC1D,MAAM,CAAC,aAAa,kBAAkB,SAAS,WAAW,YAAY;CACtE,MAAM,+BAA+B,iCAAiC;CACtE,MAAM,kCAAkC,oCAAoC;CAC5E,MAAM,CAAC,uBAAuB,4BAA4B,SACxD,wBAAwB,EAAE,CAC3B;AAaD,aAAY,SATS,aAClB,SAAiB;AAChB,MAAI,SAAS,aAAc;AAC3B,UAAQ,IAAI,gBAAgB,KAAK;AACjC,WAAS,WAAW,EAAE,MAAM,CAAC,CAAC;IAEhC,CAAC,cAAc,SAAS,CACzB,EAEkC,IAAI;CAEvC,MAAM,kBAAkB;AACtB,WAAS,aAAa,EAAE,QAAQ,aAAa,CAAC,CAAC;;CAGjD,MAAM,uBAAuB,YAAqB;AAChD,MAAI,YAAY,qBAAsB;AACtC,WAAS,sBAAsB,EAAE,SAAS,CAAC,CAAC;;AAI9C,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W;OAAgC,CAAA;MACnD;QAEX,oBAAC,OAAD;KAAK,WAAU;eACZ,sBAAsB,SAAS,IAC9B,sBAAsB,KAAK,SACzB,qBAAC,OAAD;MAAgB,WAAU;gBAA1B,CACE,oBAAC,QAAD;OAAM,WAAU;iBACb;OACI,CAAA,EACN,CAAC,cACA,oBAAC,UAAD;OACE,eAAe,yBAAyB,KAAK;OAC7C,WAAU;iBACX;OAEQ,CAAA,CAEP;QAZI,KAYJ,CACN,GAEF,oBAAC,QAAD;MAAM,WAAU;gBAA4C;MAErD,CAAA;KAEL,CAAA,CACF;MACF,EAAA,CAAA;GAGN,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,MAAD;IAAI,WAAU;cAA8D;IAEvE,CAAA,EAGL,oBAAC,OAAD;IAAK,WAAU;cACb,qBAAC,SAAD;KAAO,SAAQ;KAAwB,WAAU;eAAjD,CACE,oBAAC,SAAD;MACE,IAAG;MACH,MAAK;MACL,SAAS;MACT,WAAW,MAAM,oBAAoB,EAAE,OAAO,QAAQ;MACtD,UAAU;MACV,WAAW,QACT,wIACA,aAAa,uBAAuB,GACrC;MACD,CAAA,EACF,oBAAC,QAAD;MAAM,WAAU;gBAAwD;MAEjE,CAAA,CACD;;IACJ,CAAA,CACF,EAAA,CAAA;GAGL,CAAC,cACA,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,QAAQ,MAAM;IACzB,WAAU;cACX;IAEQ,CAAA,EACL,CAAA;GAEJ;;;;;AC5QV,MAAa,eAAuC,EAClD,2BAA2B,OAC5B;;;ACCD,SAAwB,SAAS;AAC/B,8BAA6B,aAAa;AAE1C,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,eAAD,EAAiB,CAAA,CACb"}
1
+ {"version":3,"file":"editor-D-QqGEkw.js","names":[],"sources":["../editors/app-editor/components/AppEditorForm.tsx","../editors/app-editor/config.ts","../editors/app-editor/editor.tsx"],"sourcesContent":["import {\n useDocumentTypesInSelectedDrive,\n useSupportedDocumentTypesInReactor,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addDocumentType,\n removeDocumentType,\n setAppName,\n setAppStatus,\n setDocumentTypes,\n setDragAndDropEnabled,\n} from \"@powerhousedao/vetra/document-models/app-module\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { useSelectedAppModuleDocument } from \"../../../document-models/app-module/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nconst ALL_IN_DRIVE = \"all-in-drive\";\nconst ALL_IN_REACTOR = \"all-in-reactor\";\nconst ALLOW_ANY = \"allow-any\";\n\nexport const AppEditorForm = () => {\n const [document, dispatch] = useSelectedAppModuleDocument();\n const documentName = document.state.global.name;\n const status = document.state.global.status;\n const isDragAndDropEnabled = document.state.global.isDragAndDropEnabled;\n const allowedDocumentTypes = document.state.global.allowedDocumentTypes;\n const [appName, handleSetAppName] = useState(documentName);\n const [isConfirmed, setIsConfirmed] = useState(status === \"CONFIRMED\");\n const documentTypesInSelectedDrive = useDocumentTypesInSelectedDrive();\n const supportedDocumentTypesInReactor = useSupportedDocumentTypesInReactor();\n const [selectedDocumentTypes, setSelectedDocumentTypes] = useState(\n allowedDocumentTypes ?? [],\n );\n\n // Use the debounce hook for name changes\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === documentName) return;\n console.log(\"onNameChange\", name);\n dispatch(setAppName({ name }));\n },\n [documentName, dispatch],\n );\n\n useDebounce(appName, onNameChange, 300);\n\n const onConfirm = () => {\n dispatch(setAppStatus({ status: \"CONFIRMED\" }));\n };\n\n const onDragAndDropToggle = (enabled: boolean) => {\n if (enabled === isDragAndDropEnabled) return;\n dispatch(setDragAndDropEnabled({ enabled }));\n };\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (appName.trim()) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm();\n }\n };\n\n const handleAddDocumentType = (documentType: string) => {\n if (!documentType || selectedDocumentTypes.includes(documentType)) return;\n setSelectedDocumentTypes([...selectedDocumentTypes, documentType]);\n dispatch(addDocumentType({ documentType }));\n };\n\n const handleRemoveDocumentType = (documentType: string) => {\n setSelectedDocumentTypes(\n selectedDocumentTypes.filter((dt) => dt !== documentType),\n );\n dispatch(removeDocumentType({ documentType }));\n };\n\n const handleAddAllDocumentTypesInDrive = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(documentTypesInSelectedDrive ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAddAllDocumentTypesInReactor = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(supportedDocumentTypesInReactor ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAllowAnyDocumentType = () => {\n setSelectedDocumentTypes([]);\n dispatch(setDocumentTypes({ documentTypes: [] }));\n };\n\n const handleDocumentTypeSelection = (selectedValue: string) => {\n if (selectedValue === ALL_IN_DRIVE) {\n handleAddAllDocumentTypesInDrive();\n } else if (selectedValue === ALL_IN_REACTOR) {\n handleAddAllDocumentTypesInReactor();\n } else if (selectedValue === ALLOW_ANY) {\n handleAllowAnyDocumentType();\n } else {\n handleAddDocumentType(selectedValue);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900 dark:text-slate-50\">\n App Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* App Name Field */}\n <div>\n <label\n htmlFor=\"app-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n App Name\n </label>\n <input\n id=\"app-name\"\n type=\"text\"\n value={appName}\n onChange={(e) => handleSetAppName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-50 placeholder:text-gray-400 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100 dark:placeholder:text-slate-400\",\n isReadOnly\n ? \"cursor-not-allowed bg-gray-100 dark:bg-slate-700\"\n : \"\",\n )}\n placeholder=\"Enter app name\"\n />\n </div>\n\n {/* Document Types Field */}\n <div>\n <label\n htmlFor=\"document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700 dark:text-slate-200\"\n >\n Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <select\n onChange={(e) => handleDocumentTypeSelection(e.target.value)}\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\"\n >\n <option>Select a document type to add</option>\n <option>--- Vetra drive document types ---</option>\n <option value={ALL_IN_DRIVE}>\n Add all document types in Vetra drive\n </option>\n {documentTypesInSelectedDrive\n ?.filter((dt) => !selectedDocumentTypes.includes(dt))\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n <option>--- Reactor document types ---</option>\n <option value={ALL_IN_REACTOR}>\n Add all document types in Reactor\n </option>\n {supportedDocumentTypesInReactor\n ?.filter((dt) => !selectedDocumentTypes.includes(dt))\n .map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n <option>--- Allow any document type ---</option>\n <option value={ALLOW_ANY}>Allow any document type</option>\n </select>\n )}\n <div className=\"space-y-1\">\n {selectedDocumentTypes.length > 0 ? (\n selectedDocumentTypes.map((type) => (\n <div key={type} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n {type}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type)}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none dark:text-slate-500 dark:hover:text-slate-300\"\n >\n ×\n </button>\n )}\n </div>\n ))\n ) : (\n <span className=\"text-sm text-gray-700 dark:text-slate-200\">\n All documents (*)\n </span>\n )}\n </div>\n </div>\n </div>\n\n {/* Drag and Drop Settings */}\n <div>\n <h3 className=\"mb-4 text-base font-medium text-gray-900 dark:text-slate-50\">\n Drag and Drop Settings\n </h3>\n\n {/* Enable/Disable Switch */}\n <div className=\"mb-4\">\n <label htmlFor=\"drag-and-drop-enabled\" className=\"flex items-center\">\n <input\n id=\"drag-and-drop-enabled\"\n type=\"checkbox\"\n checked={isDragAndDropEnabled}\n onChange={(e) => onDragAndDropToggle(e.target.checked)}\n disabled={isReadOnly}\n className={twMerge(\n \"mr-2 size-4 rounded-sm border-gray-300 text-blue-600 focus:ring-blue-500 dark:border-slate-500 dark:bg-slate-600 dark:text-slate-100\",\n isReadOnly ? \"cursor-not-allowed\" : \"\",\n )}\n />\n <span className=\"text-sm font-medium text-gray-700 dark:text-slate-200\">\n Enable drag and drop\n </span>\n </label>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!appName.trim()}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300 dark:bg-blue-300 dark:text-slate-900 dark:hover:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-100\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { AppEditorForm } from \"./components/AppEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n\n return (\n <div className=\"bg-gray-50 p-6 dark:bg-slate-800\">\n <DocumentToolbar />\n <AppEditorForm />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAElB,MAAa,sBAAsB;CACjC,MAAM,CAAC,UAAU,YAAY,8BAA8B;CAC3D,MAAM,eAAe,SAAS,MAAM,OAAO;CAC3C,MAAM,SAAS,SAAS,MAAM,OAAO;CACrC,MAAM,uBAAuB,SAAS,MAAM,OAAO;CACnD,MAAM,uBAAuB,SAAS,MAAM,OAAO;CACnD,MAAM,CAAC,SAAS,oBAAoB,SAAS,aAAa;CAC1D,MAAM,CAAC,aAAa,kBAAkB,SAAS,WAAW,YAAY;CACtE,MAAM,+BAA+B,iCAAiC;CACtE,MAAM,kCAAkC,oCAAoC;CAC5E,MAAM,CAAC,uBAAuB,4BAA4B,SACxD,wBAAwB,EAAE,CAC3B;AAaD,aAAY,SATS,aAClB,SAAiB;AAChB,MAAI,SAAS,aAAc;AAC3B,UAAQ,IAAI,gBAAgB,KAAK;AACjC,WAAS,WAAW,EAAE,MAAM,CAAC,CAAC;IAEhC,CAAC,cAAc,SAAS,CACzB,EAEkC,IAAI;CAEvC,MAAM,kBAAkB;AACtB,WAAS,aAAa,EAAE,QAAQ,aAAa,CAAC,CAAC;;CAGjD,MAAM,uBAAuB,YAAqB;AAChD,MAAI,YAAY,qBAAsB;AACtC,WAAS,sBA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  export { BaseEditor, Editor as default };
1771
1771
 
1772
- //# sourceMappingURL=editor-fvDig5Bd.js.map
1772
+ //# sourceMappingURL=editor-Dz3cXtzn.js.map