@powerhousedao/vetra 6.2.3-dev.9 → 6.2.3

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 (151) hide show
  1. package/dist/codegen/index.d.ts +19 -19
  2. package/dist/codegen/index.d.ts.map +1 -1
  3. package/dist/codegen/index.js +14 -11
  4. package/dist/codegen/index.js.map +1 -1
  5. package/dist/codegen/spec.d.ts +3 -2
  6. package/dist/codegen/spec.js +1 -1
  7. package/dist/{connect-qpJ9OUaH.js → connect-EqImHuZ2.js} +1 -1
  8. package/dist/{connect-qpJ9OUaH.js.map → connect-EqImHuZ2.js.map} +1 -1
  9. package/dist/document-models/app-module/index.d.ts +29 -6
  10. package/dist/document-models/app-module/index.d.ts.map +1 -1
  11. package/dist/document-models/app-module/index.js +4 -4
  12. package/dist/document-models/app-module/index.js.map +1 -1
  13. package/dist/document-models/document-editor/index.d.ts +27 -6
  14. package/dist/document-models/document-editor/index.d.ts.map +1 -1
  15. package/dist/document-models/document-editor/index.js +4 -4
  16. package/dist/document-models/document-editor/index.js.map +1 -1
  17. package/dist/document-models/index.d.ts +7 -6
  18. package/dist/document-models/index.js +5 -5
  19. package/dist/document-models/processor-module/index.d.ts +30 -6
  20. package/dist/document-models/processor-module/index.d.ts.map +1 -1
  21. package/dist/document-models/processor-module/index.js +4 -4
  22. package/dist/document-models/processor-module/index.js.map +1 -1
  23. package/dist/document-models/subgraph-module/index.d.ts +25 -6
  24. package/dist/document-models/subgraph-module/index.d.ts.map +1 -1
  25. package/dist/document-models/subgraph-module/index.js +4 -4
  26. package/dist/document-models/subgraph-module/index.js.map +1 -1
  27. package/dist/document-models/vetra-package/index.d.ts +33 -6
  28. package/dist/document-models/vetra-package/index.d.ts.map +1 -1
  29. package/dist/document-models/vetra-package/index.js +3 -3
  30. package/dist/{editor-LRAwrgdQ.js → editor-BXOEFIDj.js} +8 -7
  31. package/dist/editor-BXOEFIDj.js.map +1 -0
  32. package/dist/{editor-CLbvu3pG.js → editor-C5a0rBQj.js} +5 -5
  33. package/dist/editor-C5a0rBQj.js.map +1 -0
  34. package/dist/{editor-_0gdltOt.js → editor-CiX3Tq3g.js} +4 -4
  35. package/dist/editor-CiX3Tq3g.js.map +1 -0
  36. package/dist/{editor-C13SvgUy.js → editor-DFEeM_dy.js} +3 -3
  37. package/dist/editor-DFEeM_dy.js.map +1 -0
  38. package/dist/{editor-CCdg1mJL.js → editor-DpZVlVN1.js} +4 -4
  39. package/dist/{editor-CCdg1mJL.js.map → editor-DpZVlVN1.js.map} +1 -1
  40. package/dist/{editor-Fgw7attg.js → editor-DpadPeVq.js} +25 -25
  41. package/dist/{editor-Fgw7attg.js.map → editor-DpadPeVq.js.map} +1 -1
  42. package/dist/editors/components/index.d.ts +3 -3
  43. package/dist/editors/components/index.d.ts.map +1 -1
  44. package/dist/editors/components/index.js.map +1 -1
  45. package/dist/editors/hooks/index.d.ts +3 -3
  46. package/dist/editors/hooks/index.d.ts.map +1 -1
  47. package/dist/editors/hooks/index.js +1 -1
  48. package/dist/editors/index.d.ts +7 -8
  49. package/dist/editors/index.d.ts.map +1 -1
  50. package/dist/editors/index.js +1 -1
  51. package/dist/{factory-DMl8eB3P.js → factory-BWrWHoS5.js} +3 -3
  52. package/dist/{factory-DMl8eB3P.js.map → factory-BWrWHoS5.js.map} +1 -1
  53. package/dist/{factory-5eiZohiv.js → factory-BzUAqoGU.js} +2 -2
  54. package/dist/{factory-5eiZohiv.js.map → factory-BzUAqoGU.js.map} +1 -1
  55. package/dist/{hooks-BIgFcbaF.js → hooks-BbxvC-C3.js} +2 -2
  56. package/dist/{hooks-BIgFcbaF.js.map → hooks-BbxvC-C3.js.map} +1 -1
  57. package/dist/{index-SB-AtQdU.d.ts → index-B52jv-LY.d.ts} +30 -64
  58. package/dist/index-B52jv-LY.d.ts.map +1 -0
  59. package/dist/{index-Dm_gN1DR.d.ts → index-D6Ai0OOc.d.ts} +26 -59
  60. package/dist/index-D6Ai0OOc.d.ts.map +1 -0
  61. package/dist/{index-f_um1g-i.d.ts → index-DPG4u1Ym.d.ts} +26 -62
  62. package/dist/index-DPG4u1Ym.d.ts.map +1 -0
  63. package/dist/{index-B5ijieNt.d.ts → index-DplUuZMT.d.ts} +21 -55
  64. package/dist/index-DplUuZMT.d.ts.map +1 -0
  65. package/dist/index.d.ts +51 -93
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +84 -12
  68. package/dist/index.js.map +1 -1
  69. package/dist/{logger-WHD0fyLm.js → logger-BFxMdimR.js} +1 -1
  70. package/dist/{logger-WHD0fyLm.js.map → logger-BFxMdimR.js.map} +1 -1
  71. package/dist/{module-Chqkdq4U.js → module-2JZcvfVs.js} +3 -3
  72. package/dist/{module-Chqkdq4U.js.map → module-2JZcvfVs.js.map} +1 -1
  73. package/dist/{module-CRq_lUkG.js → module-Caxhis1M.js} +3 -3
  74. package/dist/{module-CRq_lUkG.js.map → module-Caxhis1M.js.map} +1 -1
  75. package/dist/{module-DXT-FMxU.js → module-CdpGkPNN.js} +7 -7
  76. package/dist/{module-DXT-FMxU.js.map → module-CdpGkPNN.js.map} +1 -1
  77. package/dist/{module-ciAK1LUC.d.ts → module-D4lqkHHK.d.ts} +37 -70
  78. package/dist/module-D4lqkHHK.d.ts.map +1 -0
  79. package/dist/{module-bKT_e3CH.js → module-Db8mmgzN.js} +3 -3
  80. package/dist/{module-bKT_e3CH.js.map → module-Db8mmgzN.js.map} +1 -1
  81. package/dist/{module-CRfHlbnq.js → module-FXJRy_1W.js} +2 -2
  82. package/dist/{module-CRfHlbnq.js.map → module-FXJRy_1W.js.map} +1 -1
  83. package/dist/{module-Bx1OEHxF.js → module-hLzF5tCL.js} +3 -3
  84. package/dist/{module-Bx1OEHxF.js.map → module-hLzF5tCL.js.map} +1 -1
  85. package/dist/{ph-factories-CjbIAMgT.js → ph-factories-Bgnr3mK3.js} +2 -2
  86. package/dist/{ph-factories-CjbIAMgT.js.map → ph-factories-Bgnr3mK3.js.map} +1 -1
  87. package/dist/{ph-factories-Ce8oAqs9.js → ph-factories-CgoFCmG0.js} +2 -2
  88. package/dist/{ph-factories-Ce8oAqs9.js.map → ph-factories-CgoFCmG0.js.map} +1 -1
  89. package/dist/{ph-factories-dVj6mIlR.js → ph-factories-DhLtvC7j.js} +2 -2
  90. package/dist/{ph-factories-dVj6mIlR.js.map → ph-factories-DhLtvC7j.js.map} +1 -1
  91. package/dist/{ph-factories-CljTAAVS.js → ph-factories-HuC7_vvF.js} +2 -2
  92. package/dist/{ph-factories-CljTAAVS.js.map → ph-factories-HuC7_vvF.js.map} +1 -1
  93. package/dist/powerhouse.manifest.json +76 -0
  94. package/dist/{processor-trJFuoHh.js → processor-CsiUWh93.js} +11 -4
  95. package/dist/processor-CsiUWh93.js.map +1 -0
  96. package/dist/processors/codegen/index.d.ts +3 -4
  97. package/dist/processors/codegen/index.d.ts.map +1 -1
  98. package/dist/processors/codegen/index.js +2 -2
  99. package/dist/processors/index.d.ts +2 -3
  100. package/dist/processors/index.d.ts.map +1 -1
  101. package/dist/processors/index.js +1 -1
  102. package/dist/processors/index.js.map +1 -1
  103. package/dist/processors/vetra-read-model/index.d.ts +47 -49
  104. package/dist/processors/vetra-read-model/index.d.ts.map +1 -1
  105. package/dist/processors/vetra-read-model/index.js +1 -1
  106. package/dist/{spec-api-DobY5TUJ.js → spec-api-BIJ_jsGp.js} +9 -9
  107. package/dist/{spec-api-DobY5TUJ.js.map → spec-api-BIJ_jsGp.js.map} +1 -1
  108. package/dist/{specs-BeVdfCwg.d.ts → specs-DoTSfuxN.d.ts} +7 -4
  109. package/dist/specs-DoTSfuxN.d.ts.map +1 -0
  110. package/dist/switchboard-kgDm1UIQ.js +8 -0
  111. package/dist/{switchboard-Bf0uvxSu.js.map → switchboard-kgDm1UIQ.js.map} +1 -1
  112. package/dist/{upgrade-manifest-OlS1ALVv.js → upgrade-manifest-BOZ5nmyK.js} +1 -1
  113. package/dist/{upgrade-manifest-OlS1ALVv.js.map → upgrade-manifest-BOZ5nmyK.js.map} +1 -1
  114. package/dist/{upgrade-manifest-BGuy0v65.js → upgrade-manifest-D7xKGmZc.js} +1 -1
  115. package/dist/{upgrade-manifest-BGuy0v65.js.map → upgrade-manifest-D7xKGmZc.js.map} +1 -1
  116. package/dist/{upgrade-manifest-Ck3Mgwhc.js → upgrade-manifest-DLxSL23q.js} +1 -1
  117. package/dist/{upgrade-manifest-Ck3Mgwhc.js.map → upgrade-manifest-DLxSL23q.js.map} +1 -1
  118. package/dist/{upgrade-manifest-XdOLymuP.js → upgrade-manifest-Dv62Cod7.js} +1 -1
  119. package/dist/{upgrade-manifest-XdOLymuP.js.map → upgrade-manifest-Dv62Cod7.js.map} +1 -1
  120. package/dist/{upgrade-manifest-NaS4SWk9.js → upgrade-manifest-d3LquK-H.js} +1 -1
  121. package/dist/{upgrade-manifest-NaS4SWk9.js.map → upgrade-manifest-d3LquK-H.js.map} +1 -1
  122. package/dist/{useVetraDocument-BlLdlhrQ.js → useVetraDocument-B0k3gNtw.js} +1 -1
  123. package/dist/{useVetraDocument-BlLdlhrQ.js.map → useVetraDocument-B0k3gNtw.js.map} +1 -1
  124. package/dist/{utils-DXCsvCXL.js → utils-876N1Sph.js} +2 -2
  125. package/dist/{utils-DXCsvCXL.js.map → utils-876N1Sph.js.map} +1 -1
  126. package/dist/{utils-CkxGmQ2_.js → utils-Al_SGg2a.js} +2 -2
  127. package/dist/{utils-CkxGmQ2_.js.map → utils-Al_SGg2a.js.map} +1 -1
  128. package/dist/{utils-B4KdjDnp.js → utils-COP7hJ-K.js} +2 -2
  129. package/dist/{utils-B4KdjDnp.js.map → utils-COP7hJ-K.js.map} +1 -1
  130. package/dist/{utils-DmOIDVQo.js → utils-w_21RRK6.js} +3 -3
  131. package/dist/{utils-DmOIDVQo.js.map → utils-w_21RRK6.js.map} +1 -1
  132. package/dist/{vetra-package-Bl6TC4wx.js → vetra-package-DSyRtkdJ.js} +2 -2
  133. package/dist/{vetra-package-Bl6TC4wx.js.map → vetra-package-DSyRtkdJ.js.map} +1 -1
  134. package/package.json +13 -12
  135. package/dist/editor-C13SvgUy.js.map +0 -1
  136. package/dist/editor-CLbvu3pG.js.map +0 -1
  137. package/dist/editor-LRAwrgdQ.js.map +0 -1
  138. package/dist/editor-_0gdltOt.js.map +0 -1
  139. package/dist/index-B5ijieNt.d.ts.map +0 -1
  140. package/dist/index-Dm_gN1DR.d.ts.map +0 -1
  141. package/dist/index-SB-AtQdU.d.ts.map +0 -1
  142. package/dist/index-f_um1g-i.d.ts.map +0 -1
  143. package/dist/module-ciAK1LUC.d.ts.map +0 -1
  144. package/dist/powerhouse.manifest.d.ts +0 -34
  145. package/dist/powerhouse.manifest.d.ts.map +0 -1
  146. package/dist/powerhouse.manifest.js +0 -86
  147. package/dist/powerhouse.manifest.js.map +0 -1
  148. package/dist/processor-trJFuoHh.js.map +0 -1
  149. package/dist/specs-BeVdfCwg.d.ts.map +0 -1
  150. package/dist/switchboard-Bf0uvxSu.js +0 -8
  151. /package/dist/{chunk-pbuEa-1d.js → rolldown-runtime-D7D4PA-g.js} +0 -0
@@ -1,12 +1,31 @@
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-B5ijieNt.js";
1
+ import { A as setSubgraphName, B as SubgraphModulePHState, C as SubgraphModulePHStateSchema, D as isSubgraphModuleState, E as isSubgraphModuleDocument, F as SetSubgraphNameAction, G as MakeMaybe, H as Incremental, I as SetSubgraphStatusAction, J as Scalars, K as MakeOptional, L as SubgraphModuleBaseOperationsAction, M as SubgraphModuleController, N as SubgraphModuleBaseOperationsOperations, O as documentModel, P as SubgraphModuleAction, Q as SubgraphModuleState, R as SubgraphModuleDocument, S as SubgraphModuleDocumentSchema, T as assertIsSubgraphModuleState, U as InputMaybe, V as Exact, W as MakeEmpty, X as SetSubgraphStatusInput, Y as SetSubgraphNameInput, Z as StatusType, _ as createSubgraphModuleDocument, a as StatusTypeSchema, b as defaultPHState, c as isDefinedNonNullAny, d as SubgraphModule, f as useSelectedSubgraphModuleDocument, g as createState, h as useSubgraphModuleDocumentsInSelectedFolder, i as SetSubgraphStatusInputSchema, j as setSubgraphStatus, k as creators_d_exports, l as reducer, m as useSubgraphModuleDocumentsInSelectedDrive, n as initialLocalState, o as SubgraphModuleStateSchema, p as useSubgraphModuleDocumentById, q as Maybe, r as SetSubgraphNameInputSchema, s as definedNonNullAnySchema, t as initialGlobalState, u as utils, v as defaultGlobalState, w as assertIsSubgraphModuleDocument, x as SubgraphModuleDocumentHeaderSchema, y as defaultLocalState, z as SubgraphModuleLocalState } from "../../index-DplUuZMT.js";
2
2
  import { UpgradeManifest } from "document-model";
3
-
3
+ //#region document-models/subgraph-module/v1/gen/document-type.d.ts
4
+ /**
5
+ * WARNING: DO NOT EDIT
6
+ * This file is auto-generated and updated by codegen
7
+ */
8
+ export declare const subgraphModuleDocumentType = "powerhouse/subgraph";
9
+ //#endregion
10
+ //#region document-models/subgraph-module/v1/actions.d.ts
11
+ /** Actions for the SubgraphModule document model */
12
+ export declare const actions: {
13
+ setName: typeof import("document-model").setName;
14
+ setPreferredEditor: typeof import("document-model").setPreferredEditor;
15
+ undo: typeof import("document-model").undo;
16
+ redo: typeof import("document-model").redo;
17
+ noop: typeof import("document-model").noop;
18
+ setSubgraphName: (input: SetSubgraphNameInput) => SetSubgraphNameAction;
19
+ setSubgraphStatus: (input: SetSubgraphStatusInput) => SetSubgraphStatusAction;
20
+ };
21
+ //#endregion
4
22
  //#region document-models/subgraph-module/upgrades/versions.d.ts
5
- declare const supportedVersions: readonly [1];
6
- declare const latestVersion: 1;
23
+ export declare const supportedVersions: readonly [1];
24
+ export declare const latestVersion: 1;
7
25
  //#endregion
8
26
  //#region document-models/subgraph-module/upgrades/upgrade-manifest.d.ts
9
- declare const subgraphModuleUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
27
+ export declare const subgraphModuleUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
10
28
  //#endregion
11
- export { Exact, Incremental, InputMaybe, MakeEmpty, MakeMaybe, MakeOptional, Maybe, Scalars, SetSubgraphNameAction, SetSubgraphNameInput, SetSubgraphNameInputSchema, SetSubgraphStatusAction, SetSubgraphStatusInput, SetSubgraphStatusInputSchema, StatusType, StatusTypeSchema, SubgraphModule, SubgraphModuleAction, SubgraphModuleBaseOperationsAction, SubgraphModuleBaseOperationsOperations, SubgraphModuleController, SubgraphModuleDocument, SubgraphModuleDocumentHeaderSchema, SubgraphModuleDocumentSchema, SubgraphModuleState as SubgraphModuleGlobalState, SubgraphModuleState, SubgraphModuleLocalState, SubgraphModulePHState, SubgraphModulePHStateSchema, SubgraphModuleStateSchema, actions, assertIsSubgraphModuleDocument, assertIsSubgraphModuleState, createState, createSubgraphModuleDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isSubgraphModuleDocument, isSubgraphModuleState, latestVersion, reducer, setSubgraphName, setSubgraphStatus, creators_d_exports as subgraphModuleBaseOperationsActions, subgraphModuleDocumentType, subgraphModuleUpgradeManifest, supportedVersions, useSelectedSubgraphModuleDocument, useSubgraphModuleDocumentById, useSubgraphModuleDocumentsInSelectedDrive, useSubgraphModuleDocumentsInSelectedFolder, utils };
29
+ export { Exact, Incremental, InputMaybe, MakeEmpty, MakeMaybe, MakeOptional, Maybe, Scalars, SetSubgraphNameAction, SetSubgraphNameInput, SetSubgraphNameInputSchema, SetSubgraphStatusAction, SetSubgraphStatusInput, SetSubgraphStatusInputSchema, StatusType, StatusTypeSchema, SubgraphModule, SubgraphModuleAction, SubgraphModuleBaseOperationsAction, SubgraphModuleBaseOperationsOperations, SubgraphModuleController, type SubgraphModuleDocument, SubgraphModuleDocumentHeaderSchema, SubgraphModuleDocumentSchema, type SubgraphModuleState as SubgraphModuleGlobalState, SubgraphModuleState, type SubgraphModuleLocalState, type SubgraphModulePHState, SubgraphModulePHStateSchema, SubgraphModuleStateSchema, assertIsSubgraphModuleDocument, assertIsSubgraphModuleState, createState, createSubgraphModuleDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isSubgraphModuleDocument, isSubgraphModuleState, reducer, setSubgraphName, setSubgraphStatus, creators_d_exports as subgraphModuleBaseOperationsActions, useSelectedSubgraphModuleDocument, useSubgraphModuleDocumentById, useSubgraphModuleDocumentsInSelectedDrive, useSubgraphModuleDocumentsInSelectedFolder, utils };
30
+ export {};
12
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../document-models/subgraph-module/upgrades/versions.ts","../../../document-models/subgraph-module/upgrades/upgrade-manifest.ts"],"mappings":";;;;cAAa,iBAAA;AAAA,cAEA,aAAA;;;cCKA,6BAAA,EAA+B,eAAA,QACnC,iBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../document-models/subgraph-module/v1/gen/document-type.ts","../../../document-models/subgraph-module/v1/actions.ts","../../../document-models/subgraph-module/upgrades/versions.ts","../../../document-models/subgraph-module/upgrades/upgrade-manifest.ts"],"mappings":";;;;;;;qBAIa;;;;qBCKA;;;;;;2BAAA;;;;;qBCTA;qBAEA;;;qBCKA,+BAA+B,uBACnC"}
@@ -1,7 +1,7 @@
1
- import { S as isDefinedNonNullAny, _ as SetSubgraphNameInputSchema, a as SubgraphModuleDocumentSchema, b as SubgraphModuleStateSchema, c as assertIsSubgraphModuleState, d as subgraphModuleDocumentType, f as reducer, g as setSubgraphStatus, h as setSubgraphName, i as SubgraphModuleDocumentHeaderSchema, l as isSubgraphModuleDocument, m as creators_exports, n as initialLocalState, o as SubgraphModulePHStateSchema, p as actions, s as assertIsSubgraphModuleDocument, t as initialGlobalState, u as isSubgraphModuleState, v as SetSubgraphStatusInputSchema, x as definedNonNullAnySchema, y as StatusTypeSchema } from "../../utils-CkxGmQ2_.js";
2
- import { n as utils, r as documentModel, t as SubgraphModule } from "../../module-Bx1OEHxF.js";
3
- import { a as defaultPHState, i as defaultLocalState, n as createSubgraphModuleDocument, r as defaultGlobalState, t as createState } from "../../ph-factories-dVj6mIlR.js";
4
- import { n as latestVersion, r as supportedVersions, t as subgraphModuleUpgradeManifest } from "../../upgrade-manifest-XdOLymuP.js";
1
+ import { S as isDefinedNonNullAny, _ as SetSubgraphNameInputSchema, a as SubgraphModuleDocumentSchema, b as SubgraphModuleStateSchema, c as assertIsSubgraphModuleState, d as subgraphModuleDocumentType, f as reducer, g as setSubgraphStatus, h as setSubgraphName, i as SubgraphModuleDocumentHeaderSchema, l as isSubgraphModuleDocument, m as creators_exports, n as initialLocalState, o as SubgraphModulePHStateSchema, p as actions, s as assertIsSubgraphModuleDocument, t as initialGlobalState, u as isSubgraphModuleState, v as SetSubgraphStatusInputSchema, x as definedNonNullAnySchema, y as StatusTypeSchema } from "../../utils-Al_SGg2a.js";
2
+ import { n as utils, r as documentModel, t as SubgraphModule } from "../../module-hLzF5tCL.js";
3
+ import { a as defaultPHState, i as defaultLocalState, n as createSubgraphModuleDocument, r as defaultGlobalState, t as createState } from "../../ph-factories-DhLtvC7j.js";
4
+ import { n as latestVersion, r as supportedVersions, t as subgraphModuleUpgradeManifest } from "../../upgrade-manifest-Dv62Cod7.js";
5
5
  import { PHDocumentController } from "document-model";
6
6
  import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument } from "@powerhousedao/reactor-browser";
7
7
  //#region document-models/subgraph-module/v1/gen/controller.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../document-models/subgraph-module/v1/gen/controller.ts","../../../document-models/subgraph-module/v1/hooks.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { SubgraphModule } from \"../module.js\";\nimport type { SubgraphModuleAction, SubgraphModulePHState } from \"./types.js\";\n\nexport const SubgraphModuleController = PHDocumentController.forDocumentModel<\n SubgraphModulePHState,\n SubgraphModuleAction\n>(SubgraphModule);\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport {\n useDocumentById,\n useDocumentsInSelectedDrive,\n useDocumentsInSelectedFolder,\n useSelectedDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n SubgraphModuleAction,\n SubgraphModuleDocument,\n} from \"document-models/subgraph-module/v1\";\nimport {\n assertIsSubgraphModuleDocument,\n isSubgraphModuleDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a SubgraphModule document by its id */\nexport function useSubgraphModuleDocumentById(\n documentId: string | null | undefined,\n):\n | [SubgraphModuleDocument, DocumentDispatch<SubgraphModuleAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isSubgraphModuleDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected SubgraphModule document */\nexport function useSelectedSubgraphModuleDocument(): [\n SubgraphModuleDocument,\n DocumentDispatch<SubgraphModuleAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsSubgraphModuleDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all SubgraphModule documents in the selected drive */\nexport function useSubgraphModuleDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isSubgraphModuleDocument);\n}\n\n/** Hook to get all SubgraphModule documents in the selected folder */\nexport function useSubgraphModuleDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isSubgraphModuleDocument);\n}\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,2BAA2B,qBAAqB,iBAG3D,eAAe;;;;ACUjB,SAAgB,8BACd,YAGyB;CACzB,MAAM,CAAC,UAAU,YAAY,gBAAgB,WAAW;AACxD,KAAI,CAAC,yBAAyB,SAAS,CAAE,QAAO,CAAC,KAAA,GAAW,KAAA,EAAU;AACtE,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,oCAGd;CACA,MAAM,CAAC,UAAU,YAAY,qBAAqB;AAElD,gCAA+B,SAAS;AACxC,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,4CAA4C;AAE1D,QADiC,6BAA6B,EAC7B,OAAO,yBAAyB;;;AAInE,SAAgB,6CAA6C;AAE3D,QADkC,8BAA8B,EAC9B,OAAO,yBAAyB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../document-models/subgraph-module/v1/gen/controller.ts","../../../document-models/subgraph-module/v1/hooks.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { SubgraphModule } from \"../module.js\";\nimport type { SubgraphModuleAction, SubgraphModulePHState } from \"./types.js\";\n\nexport const SubgraphModuleController = PHDocumentController.forDocumentModel<\n SubgraphModulePHState,\n SubgraphModuleAction\n>(SubgraphModule);\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport {\n useDocumentById,\n useDocumentsInSelectedDrive,\n useDocumentsInSelectedFolder,\n useSelectedDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n SubgraphModuleAction,\n SubgraphModuleDocument,\n} from \"document-models/subgraph-module/v1\";\nimport {\n assertIsSubgraphModuleDocument,\n isSubgraphModuleDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a SubgraphModule document by its id */\nexport function useSubgraphModuleDocumentById(\n documentId: string | null | undefined,\n):\n | [SubgraphModuleDocument, DocumentDispatch<SubgraphModuleAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isSubgraphModuleDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected SubgraphModule document */\nexport function useSelectedSubgraphModuleDocument(): [\n SubgraphModuleDocument,\n DocumentDispatch<SubgraphModuleAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsSubgraphModuleDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all SubgraphModule documents in the selected drive */\nexport function useSubgraphModuleDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isSubgraphModuleDocument);\n}\n\n/** Hook to get all SubgraphModule documents in the selected folder */\nexport function useSubgraphModuleDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isSubgraphModuleDocument);\n}\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,2BAA2B,qBAAqB,iBAG3D,cAAc;;;;ACUhB,SAAgB,8BACd,YAGyB;CACzB,MAAM,CAAC,UAAU,YAAY,gBAAgB,UAAU;CACvD,IAAI,CAAC,yBAAyB,QAAQ,GAAG,OAAO,CAAC,KAAA,GAAW,KAAA,CAAS;CACrE,OAAO,CAAC,UAAU,QAAQ;AAC5B;;AAGA,SAAgB,oCAGd;CACA,MAAM,CAAC,UAAU,YAAY,oBAAoB;CAEjD,+BAA+B,QAAQ;CACvC,OAAO,CAAC,UAAU,QAAQ;AAC5B;;AAGA,SAAgB,4CAA4C;CAE1D,OADiC,4BACH,CAAC,EAAE,OAAO,wBAAwB;AAClE;;AAGA,SAAgB,6CAA6C;CAE3D,OADkC,6BACH,CAAC,EAAE,OAAO,wBAAwB;AACnE"}
@@ -1,12 +1,39 @@
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-ciAK1LUC.js";
1
+ import { $ as VetraPackagePHState, A as VetraPackageDocumentHeaderSchema, At as SetPackageNameAction, B as removePackageKeyword, C as isDefinedNonNullAny, Ct as RemovePackageKeywordAction, D as defaultGlobalState, Dt as SetPackageCategoryAction, E as createVetraPackageDocument, Et as SetPackageAuthorWebsiteAction, F as isVetraPackageDocument, G as setPackageDescription, H as setPackageAuthorName, I as isVetraPackageState, J as setPackageNpmUrl, K as setPackageGithubUrl, L as documentModel, M as VetraPackagePHStateSchema, Mt as VetraPackageBaseOperationsAction, N as assertIsVetraPackageDocument, O as defaultLocalState, Ot as SetPackageDescriptionAction, P as assertIsVetraPackageState, Q as VetraPackageLocalState, R as addPackageKeyword, S as definedNonNullAnySchema, St as AddPackageKeywordAction, T as createState, Tt as SetPackageAuthorNameAction, U as setPackageAuthorWebsite, V as setPackageAuthor, W as setPackageCategory, X as VetraPackageBaseOperationsOperations, Y as VetraPackageController, Z as VetraPackageDocument, _ as SetPackageDescriptionInputSchema, _t as SetPackageGithubUrlInput, a as useVetraPackageDocumentsInSelectedDrive, at as Keyword, b as SetPackageNpmUrlInputSchema, bt as VetraPackageState, c as initialLocalState, ct as MakeOptional, d as KeywordSchema, dt as Scalars, et as AddPackageKeywordInput, f as RemovePackageKeywordInputSchema, ft as SetPackageAuthorInput, g as SetPackageCategoryInputSchema, gt as SetPackageDescriptionInput, h as SetPackageAuthorWebsiteInputSchema, ht as SetPackageCategoryInput, i as useVetraPackageDocumentById, it as InputMaybe, j as VetraPackageDocumentSchema, jt as SetPackageNpmUrlAction, k as defaultPHState, kt as SetPackageGithubUrlAction, l as AddPackageKeywordInputSchema, lt as Maybe, m as SetPackageAuthorNameInputSchema, mt as SetPackageAuthorWebsiteInput, n as utils, nt as Exact, o as useVetraPackageDocumentsInSelectedFolder, ot as MakeEmpty, p as SetPackageAuthorInputSchema, pt as SetPackageAuthorNameInput, q as setPackageName, r as useSelectedVetraPackageDocument, rt as Incremental, s as initialGlobalState, st as MakeMaybe, t as VetraPackage, tt as Author, u as AuthorSchema, ut as RemovePackageKeywordInput, v as SetPackageGithubUrlInputSchema, vt as SetPackageNameInput, w as reducer, wt as SetPackageAuthorAction, x as VetraPackageStateSchema, xt as VetraPackageAction, y as SetPackageNameInputSchema, yt as SetPackageNpmUrlInput, z as creators_d_exports } from "../../module-D4lqkHHK.js";
2
2
  import { UpgradeManifest } from "document-model";
3
-
3
+ //#region document-models/vetra-package/v1/actions.d.ts
4
+ /** Actions for the VetraPackage document model */
5
+ export declare const actions: {
6
+ setName: typeof import("document-model").setName;
7
+ setPreferredEditor: typeof import("document-model").setPreferredEditor;
8
+ undo: typeof import("document-model").undo;
9
+ redo: typeof import("document-model").redo;
10
+ noop: typeof import("document-model").noop;
11
+ setPackageName: (input: SetPackageNameInput) => SetPackageNameAction;
12
+ setPackageDescription: (input: SetPackageDescriptionInput) => SetPackageDescriptionAction;
13
+ setPackageCategory: (input: SetPackageCategoryInput) => SetPackageCategoryAction;
14
+ setPackageAuthor: (input: SetPackageAuthorInput) => SetPackageAuthorAction;
15
+ setPackageAuthorName: (input: SetPackageAuthorNameInput) => SetPackageAuthorNameAction;
16
+ setPackageAuthorWebsite: (input: SetPackageAuthorWebsiteInput) => SetPackageAuthorWebsiteAction;
17
+ addPackageKeyword: (input: AddPackageKeywordInput) => AddPackageKeywordAction;
18
+ removePackageKeyword: (input: RemovePackageKeywordInput) => RemovePackageKeywordAction;
19
+ setPackageGithubUrl: (input: SetPackageGithubUrlInput) => SetPackageGithubUrlAction;
20
+ setPackageNpmUrl: (input: SetPackageNpmUrlInput) => SetPackageNpmUrlAction;
21
+ };
22
+ //#endregion
23
+ //#region document-models/vetra-package/v1/gen/document-type.d.ts
24
+ /**
25
+ * WARNING: DO NOT EDIT
26
+ * This file is auto-generated and updated by codegen
27
+ */
28
+ export declare const vetraPackageDocumentType = "powerhouse/package";
29
+ //#endregion
4
30
  //#region document-models/vetra-package/upgrades/versions.d.ts
5
- declare const supportedVersions: readonly [1];
6
- declare const latestVersion: 1;
31
+ export declare const supportedVersions: readonly [1];
32
+ export declare const latestVersion: 1;
7
33
  //#endregion
8
34
  //#region document-models/vetra-package/upgrades/upgrade-manifest.d.ts
9
- declare const vetraPackageUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
35
+ export declare const vetraPackageUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
10
36
  //#endregion
11
- export { AddPackageKeywordAction, AddPackageKeywordInput, AddPackageKeywordInputSchema, Author, AuthorSchema, Exact, Incremental, InputMaybe, Keyword, KeywordSchema, MakeEmpty, MakeMaybe, MakeOptional, Maybe, RemovePackageKeywordAction, RemovePackageKeywordInput, RemovePackageKeywordInputSchema, Scalars, SetPackageAuthorAction, SetPackageAuthorInput, SetPackageAuthorInputSchema, SetPackageAuthorNameAction, SetPackageAuthorNameInput, SetPackageAuthorNameInputSchema, SetPackageAuthorWebsiteAction, SetPackageAuthorWebsiteInput, SetPackageAuthorWebsiteInputSchema, SetPackageCategoryAction, SetPackageCategoryInput, SetPackageCategoryInputSchema, SetPackageDescriptionAction, SetPackageDescriptionInput, SetPackageDescriptionInputSchema, SetPackageGithubUrlAction, SetPackageGithubUrlInput, SetPackageGithubUrlInputSchema, SetPackageNameAction, SetPackageNameInput, SetPackageNameInputSchema, SetPackageNpmUrlAction, SetPackageNpmUrlInput, SetPackageNpmUrlInputSchema, VetraPackage, VetraPackageAction, VetraPackageBaseOperationsAction, VetraPackageBaseOperationsOperations, VetraPackageController, VetraPackageDocument, VetraPackageDocumentHeaderSchema, VetraPackageDocumentSchema, VetraPackageState as VetraPackageGlobalState, VetraPackageState, VetraPackageLocalState, VetraPackagePHState, VetraPackagePHStateSchema, VetraPackageStateSchema, actions, addPackageKeyword, assertIsVetraPackageDocument, assertIsVetraPackageState, createState, createVetraPackageDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isVetraPackageDocument, isVetraPackageState, latestVersion, reducer, removePackageKeyword, setPackageAuthor, setPackageAuthorName, setPackageAuthorWebsite, setPackageCategory, setPackageDescription, setPackageGithubUrl, setPackageName, setPackageNpmUrl, supportedVersions, useSelectedVetraPackageDocument, useVetraPackageDocumentById, useVetraPackageDocumentsInSelectedDrive, useVetraPackageDocumentsInSelectedFolder, utils, creators_d_exports as vetraPackageBaseOperationsActions, vetraPackageDocumentType, vetraPackageUpgradeManifest };
37
+ export { AddPackageKeywordAction, AddPackageKeywordInput, AddPackageKeywordInputSchema, Author, AuthorSchema, Exact, Incremental, InputMaybe, Keyword, KeywordSchema, MakeEmpty, MakeMaybe, MakeOptional, Maybe, RemovePackageKeywordAction, RemovePackageKeywordInput, RemovePackageKeywordInputSchema, Scalars, SetPackageAuthorAction, SetPackageAuthorInput, SetPackageAuthorInputSchema, SetPackageAuthorNameAction, SetPackageAuthorNameInput, SetPackageAuthorNameInputSchema, SetPackageAuthorWebsiteAction, SetPackageAuthorWebsiteInput, SetPackageAuthorWebsiteInputSchema, SetPackageCategoryAction, SetPackageCategoryInput, SetPackageCategoryInputSchema, SetPackageDescriptionAction, SetPackageDescriptionInput, SetPackageDescriptionInputSchema, SetPackageGithubUrlAction, SetPackageGithubUrlInput, SetPackageGithubUrlInputSchema, SetPackageNameAction, SetPackageNameInput, SetPackageNameInputSchema, SetPackageNpmUrlAction, SetPackageNpmUrlInput, SetPackageNpmUrlInputSchema, VetraPackage, VetraPackageAction, VetraPackageBaseOperationsAction, VetraPackageBaseOperationsOperations, VetraPackageController, type VetraPackageDocument, VetraPackageDocumentHeaderSchema, VetraPackageDocumentSchema, type VetraPackageState as VetraPackageGlobalState, VetraPackageState, type VetraPackageLocalState, type VetraPackagePHState, VetraPackagePHStateSchema, VetraPackageStateSchema, addPackageKeyword, assertIsVetraPackageDocument, assertIsVetraPackageState, createState, createVetraPackageDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isVetraPackageDocument, isVetraPackageState, reducer, removePackageKeyword, setPackageAuthor, setPackageAuthorName, setPackageAuthorWebsite, setPackageCategory, setPackageDescription, setPackageGithubUrl, setPackageName, setPackageNpmUrl, useSelectedVetraPackageDocument, useVetraPackageDocumentById, useVetraPackageDocumentsInSelectedDrive, useVetraPackageDocumentsInSelectedFolder, utils, creators_d_exports as vetraPackageBaseOperationsActions };
38
+ export {};
12
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../document-models/vetra-package/upgrades/versions.ts","../../../document-models/vetra-package/upgrades/upgrade-manifest.ts"],"mappings":";;;;cAAa,iBAAA;AAAA,cAEA,aAAA;;;cCKA,2BAAA,EAA6B,eAAA,QACjC,iBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../document-models/vetra-package/v1/actions.ts","../../../document-models/vetra-package/v1/gen/document-type.ts","../../../document-models/vetra-package/upgrades/versions.ts","../../../document-models/vetra-package/upgrades/upgrade-manifest.ts"],"mappings":";;;;qBASa;;;;;;0BAAA;;;;;;;;;;;;;;;;;qBCLA;;;qBCJA;qBAEA;;;qBCKA,6BAA6B,uBACjC"}
@@ -1,4 +1,4 @@
1
- import { A as KeywordSchema, B as VetraPackageStateSchema, C as setPackageCategory, D as setPackageNpmUrl, E as setPackageName, F as SetPackageCategoryInputSchema, H as isDefinedNonNullAny, I as SetPackageDescriptionInputSchema, L as SetPackageGithubUrlInputSchema, M as SetPackageAuthorInputSchema, N as SetPackageAuthorNameInputSchema, O as AddPackageKeywordInputSchema, P as SetPackageAuthorWebsiteInputSchema, R as SetPackageNameInputSchema, S as setPackageAuthorWebsite, T as setPackageGithubUrl, V as definedNonNullAnySchema, _ as addPackageKeyword, b as setPackageAuthor, c as VetraPackagePHStateSchema, d as isVetraPackageDocument, f as isVetraPackageState, g as actions, h as documentModel, i as initialLocalState, j as RemovePackageKeywordInputSchema, k as AuthorSchema, l as assertIsVetraPackageDocument, m as reducer, n as utils, o as VetraPackageDocumentHeaderSchema, p as vetraPackageDocumentType, r as initialGlobalState, s as VetraPackageDocumentSchema, t as VetraPackage, u as assertIsVetraPackageState, v as creators_exports, w as setPackageDescription, x as setPackageAuthorName, y as removePackageKeyword, z as SetPackageNpmUrlInputSchema } from "../../module-CRfHlbnq.js";
2
- import { a as createState, c as defaultLocalState, i as useVetraPackageDocumentsInSelectedFolder, l as defaultPHState, n as useVetraPackageDocumentById, o as createVetraPackageDocument, r as useVetraPackageDocumentsInSelectedDrive, s as defaultGlobalState, t as useSelectedVetraPackageDocument, u as VetraPackageController } from "../../vetra-package-Bl6TC4wx.js";
3
- import { n as latestVersion, r as supportedVersions, t as vetraPackageUpgradeManifest } from "../../upgrade-manifest-OlS1ALVv.js";
1
+ import { A as KeywordSchema, B as VetraPackageStateSchema, C as setPackageCategory, D as setPackageNpmUrl, E as setPackageName, F as SetPackageCategoryInputSchema, H as isDefinedNonNullAny, I as SetPackageDescriptionInputSchema, L as SetPackageGithubUrlInputSchema, M as SetPackageAuthorInputSchema, N as SetPackageAuthorNameInputSchema, O as AddPackageKeywordInputSchema, P as SetPackageAuthorWebsiteInputSchema, R as SetPackageNameInputSchema, S as setPackageAuthorWebsite, T as setPackageGithubUrl, V as definedNonNullAnySchema, _ as addPackageKeyword, b as setPackageAuthor, c as VetraPackagePHStateSchema, d as isVetraPackageDocument, f as isVetraPackageState, g as actions, h as documentModel, i as initialLocalState, j as RemovePackageKeywordInputSchema, k as AuthorSchema, l as assertIsVetraPackageDocument, m as reducer, n as utils, o as VetraPackageDocumentHeaderSchema, p as vetraPackageDocumentType, r as initialGlobalState, s as VetraPackageDocumentSchema, t as VetraPackage, u as assertIsVetraPackageState, v as creators_exports, w as setPackageDescription, x as setPackageAuthorName, y as removePackageKeyword, z as SetPackageNpmUrlInputSchema } from "../../module-FXJRy_1W.js";
2
+ import { a as createState, c as defaultLocalState, i as useVetraPackageDocumentsInSelectedFolder, l as defaultPHState, n as useVetraPackageDocumentById, o as createVetraPackageDocument, r as useVetraPackageDocumentsInSelectedDrive, s as defaultGlobalState, t as useSelectedVetraPackageDocument, u as VetraPackageController } from "../../vetra-package-DSyRtkdJ.js";
3
+ import { n as latestVersion, r as supportedVersions, t as vetraPackageUpgradeManifest } from "../../upgrade-manifest-BOZ5nmyK.js";
4
4
  export { AddPackageKeywordInputSchema, AuthorSchema, KeywordSchema, RemovePackageKeywordInputSchema, SetPackageAuthorInputSchema, SetPackageAuthorNameInputSchema, SetPackageAuthorWebsiteInputSchema, SetPackageCategoryInputSchema, SetPackageDescriptionInputSchema, SetPackageGithubUrlInputSchema, SetPackageNameInputSchema, SetPackageNpmUrlInputSchema, VetraPackage, VetraPackageController, VetraPackageDocumentHeaderSchema, VetraPackageDocumentSchema, VetraPackagePHStateSchema, VetraPackageStateSchema, actions, addPackageKeyword, assertIsVetraPackageDocument, assertIsVetraPackageState, createState, createVetraPackageDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isVetraPackageDocument, isVetraPackageState, latestVersion, reducer, removePackageKeyword, setPackageAuthor, setPackageAuthorName, setPackageAuthorWebsite, setPackageCategory, setPackageDescription, setPackageGithubUrl, setPackageName, setPackageNpmUrl, supportedVersions, useSelectedVetraPackageDocument, useVetraPackageDocumentById, useVetraPackageDocumentsInSelectedDrive, useVetraPackageDocumentsInSelectedFolder, utils, creators_exports as vetraPackageBaseOperationsActions, vetraPackageDocumentType, vetraPackageUpgradeManifest };
@@ -1,7 +1,7 @@
1
- import { b as setAppStatus, g as addDocumentType, h as setDragAndDropEnabled, v as removeDocumentType, x as setDocumentTypes, y as setAppName } from "./utils-B4KdjDnp.js";
1
+ import { b as setAppStatus, g as addDocumentType, h as setDragAndDropEnabled, v as removeDocumentType, x as setDocumentTypes, y as setAppName } from "./utils-COP7hJ-K.js";
2
2
  import { useSelectedAppModuleDocument } from "./document-models/app-module/index.js";
3
3
  import { StatusPill } from "./editors/components/index.js";
4
- import { t as useDebounce } from "./hooks-BIgFcbaF.js";
4
+ import { t as useDebounce } from "./hooks-BbxvC-C3.js";
5
5
  import { useDocumentTypesInSelectedDrive, useSetPHDocumentEditorConfig, useSupportedDocumentTypesInReactor } from "@powerhousedao/reactor-browser";
6
6
  import { useCallback, useEffect, useState } from "react";
7
7
  import { twMerge } from "tailwind-merge";
@@ -22,11 +22,12 @@ const AppEditorForm = () => {
22
22
  const documentTypesInSelectedDrive = useDocumentTypesInSelectedDrive();
23
23
  const supportedDocumentTypesInReactor = useSupportedDocumentTypesInReactor();
24
24
  const [selectedDocumentTypes, setSelectedDocumentTypes] = useState(allowedDocumentTypes ?? []);
25
- useDebounce(appName, useCallback((name) => {
25
+ const onNameChange = useCallback((name) => {
26
26
  if (name === documentName) return;
27
27
  console.log("onNameChange", name);
28
28
  dispatch(setAppName({ name }));
29
- }, [documentName, dispatch]), 300);
29
+ }, [documentName, dispatch]);
30
+ useDebounce(appName, onNameChange, 300);
30
31
  const onConfirm = () => {
31
32
  dispatch(setAppStatus({ status: "CONFIRMED" }));
32
33
  };
@@ -54,12 +55,12 @@ const AppEditorForm = () => {
54
55
  dispatch(removeDocumentType({ documentType }));
55
56
  };
56
57
  const handleAddAllDocumentTypesInDrive = () => {
57
- const newDocumentTypes = [...new Set([...selectedDocumentTypes, ...documentTypesInSelectedDrive ?? []])];
58
+ const newDocumentTypes = [.../* @__PURE__ */ new Set([...selectedDocumentTypes, ...documentTypesInSelectedDrive ?? []])];
58
59
  setSelectedDocumentTypes(newDocumentTypes);
59
60
  dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));
60
61
  };
61
62
  const handleAddAllDocumentTypesInReactor = () => {
62
- const newDocumentTypes = [...new Set([...selectedDocumentTypes, ...supportedDocumentTypesInReactor ?? []])];
63
+ const newDocumentTypes = [.../* @__PURE__ */ new Set([...selectedDocumentTypes, ...supportedDocumentTypesInReactor ?? []])];
63
64
  setSelectedDocumentTypes(newDocumentTypes);
64
65
  dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));
65
66
  };
@@ -197,4 +198,4 @@ function Editor() {
197
198
  //#endregion
198
199
  export { Editor as default };
199
200
 
200
- //# sourceMappingURL=editor-LRAwrgdQ.js.map
201
+ //# sourceMappingURL=editor-BXOEFIDj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-BXOEFIDj.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-extra/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-foreground\">\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-foreground\"\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-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\",\n isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\",\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-foreground\"\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-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\"\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-foreground\">{type}</span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type)}\n className=\"ml-2 text-muted-foreground hover:hover-effect focus:outline-none\"\n >\n ×\n </button>\n )}\n </div>\n ))\n ) : (\n <span className=\"text-sm text-foreground\">All documents (*)</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-foreground\">\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-border text-info focus:ring-ring\",\n isReadOnly ? \"cursor-not-allowed\" : \"\",\n )}\n />\n <span className=\"text-sm font-medium text-foreground\">\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-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\"\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-background p-6\">\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,6BAA6B;CAC1D,MAAM,eAAe,SAAS,MAAM,OAAO;CAC3C,MAAM,SA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CAAA,CACF;GACF,CAAA,CAAA,EAAA,CAAA;GAGL,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,MAAD;IAAI,WAAU;IAA6C,UAAA;GAEvD,CAAA,GAGJ,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,qBAAC,SAAD;KAAO,SAAQ;KAAwB,WAAU;KAAjD,UAAA,CACE,oBAAC,SAAD;MACE,IAAG;MACH,MAAK;MACL,SAAS;MACT,WAAW,MAAM,oBAAoB,EAAE,OAAO,OAAO;MACrD,UAAU;MACV,WAAW,QACT,kEACA,aAAa,uBAAuB,EACtC;KACD,CAAA,GACD,oBAAC,QAAD;MAAM,WAAU;MAAsC,UAAA;KAEhD,CAAA,CACD;;GACJ,CAAA,CACF,EAAA,CAAA;GAGJ,CAAC,cACA,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,QAAQ,KAAK;IACxB,WAAU;IACX,UAAA;GAEO,CAAA,EACL,CAAA;EAEJ;;AAET;;;ACxQA,MAAa,eAAuC,EAClD,2BAA2B,MAC7B;;;ACCA,SAAwB,SAAS;CAC/B,6BAA6B,YAAY;CAEzC,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,iBAAD,CAAkB,CAAA,GAClB,oBAAC,eAAD,CAAgB,CAAA,CACb;;AAET"}
@@ -1,7 +1,7 @@
1
- import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from "./utils-DmOIDVQo.js";
1
+ import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from "./utils-w_21RRK6.js";
2
2
  import { StatusPill } from "./editors/components/index.js";
3
- import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-BIgFcbaF.js";
4
- import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-BlLdlhrQ.js";
3
+ import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-BbxvC-C3.js";
4
+ import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-B0k3gNtw.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";
@@ -157,7 +157,7 @@ const ProcessorEditorForm = ({ processorName: initialProcessorName = "", process
157
157
  checked: processorApps.includes(processorApp),
158
158
  onChange: (event) => {
159
159
  if (event.target.checked) {
160
- setProcessorApps((processorApps) => [...new Set([...processorApps, processorApp])]);
160
+ setProcessorApps((processorApps) => [.../* @__PURE__ */ new Set([...processorApps, processorApp])]);
161
161
  onAddProcessorApp?.(processorApp);
162
162
  } else if (processorApps.length > 1) {
163
163
  setProcessorApps((processorApps) => processorApps.filter((p) => p !== processorApp));
@@ -241,4 +241,4 @@ function Editor() {
241
241
  //#endregion
242
242
  export { Editor as default };
243
243
 
244
- //# sourceMappingURL=editor-CLbvu3pG.js.map
244
+ //# sourceMappingURL=editor-C5a0rBQj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-C5a0rBQj.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-extra/set-state-in-effect\n setProcessorName(initialProcessorName);\n }, [initialProcessorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setProcessorType(initialProcessorType);\n }, [initialProcessorType]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks-extra/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-extra/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-foreground\">\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-foreground\"\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-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\",\n isReadOnly\n ? \"cursor-not-allowed bg-muted text-muted-foreground\"\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-foreground\"\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-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\",\n isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\",\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-foreground\"\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-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\"\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-foreground\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type.id)}\n className=\"ml-2 text-muted-foreground hover:hover-effect focus:outline-none\"\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-foreground\"\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 htmlFor={processorApp} className=\"text-foreground\">\n {processorApp}\n </label>\n </div>\n ))}\n </>\n )}\n <div className=\"space-y-1\">\n {isReadOnly &&\n processorApps.map((processorApp) => (\n <span key={processorApp} className=\"text-sm text-foreground\">\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-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\"\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-background p-6\">\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,CAAC,GACvC,eAAe,uBAAuB,CAAC,GACvC,SAAS,SACT,cACA,cACA,mBACA,sBACA,mBACA,sBACA,gBACI;CACJ,MAAM,CAAC,eAA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ACX;CAEA,MAAM,uBAAuB,aAC1B,OAAe;EACd,SAAS,mBAAmB,EAAE,GAAG,CAAC,CAAC;CACrC,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,oBAAoB,aACvB,iBAA+B;EAC9B,SAAS,gBAAgB,EAAE,aAAa,CAAC,CAAC;CAC5C,GACA,CAAC,QAAQ,CACX;CAEA,MAAM,uBAAuB,aAC1B,iBAA+B;EAC9B,SAAS,mBAAmB,EAAE,aAAa,CAAC,CAAC;CAC/C,GACA,CAAC,QAAQ,CACX;CAEA,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,iBAAD,CAAkB,CAAA,GAClB,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,CAAC;GACvD,eAAe,SAAS,MAAM,OAAO;GAC1B;EACZ,CAAA,CACE;;AAET"}
@@ -1,7 +1,7 @@
1
- import { g as setSubgraphStatus, h as setSubgraphName } from "./utils-CkxGmQ2_.js";
1
+ import { g as setSubgraphStatus, h as setSubgraphName } from "./utils-Al_SGg2a.js";
2
2
  import { StatusPill } from "./editors/components/index.js";
3
- import { t as useDebounce } from "./hooks-BIgFcbaF.js";
4
- import { r as useSelectedSubgraphModuleDocument } from "./useVetraDocument-BlLdlhrQ.js";
3
+ import { t as useDebounce } from "./hooks-BbxvC-C3.js";
4
+ import { r as useSelectedSubgraphModuleDocument } from "./useVetraDocument-B0k3gNtw.js";
5
5
  import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
6
6
  import { useCallback, useEffect, useState } from "react";
7
7
  import { twMerge } from "tailwind-merge";
@@ -88,4 +88,4 @@ function Editor() {
88
88
  //#endregion
89
89
  export { Editor as default };
90
90
 
91
- //# sourceMappingURL=editor-_0gdltOt.js.map
91
+ //# sourceMappingURL=editor-CiX3Tq3g.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-CiX3Tq3g.js","names":[],"sources":["../editors/subgraph-editor/components/SubgraphEditorForm.tsx","../editors/subgraph-editor/config.ts","../editors/subgraph-editor/editor.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nexport interface SubgraphEditorFormProps {\n subgraphName?: string;\n status?: string;\n onNameChange?: (name: string) => void;\n onConfirm?: () => void;\n}\n\nexport const SubgraphEditorForm: React.FC<SubgraphEditorFormProps> = ({\n subgraphName: initialSubgraphName = \"\",\n status = \"DRAFT\",\n onNameChange,\n onConfirm,\n}) => {\n const [subgraphName, setSubgraphName] = useState(initialSubgraphName);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(subgraphName, onNameChange, 300);\n\n // Update local state when initialSubgraphName changes\n useEffect(() => {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setSubgraphName(initialSubgraphName);\n }, [initialSubgraphName]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks-extra/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 (subgraphName.trim()) {\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-foreground\">\n Subgraph Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Subgraph Name Field */}\n <div>\n <label\n htmlFor=\"subgraph-name\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Subgraph Name\n </label>\n <input\n id=\"subgraph-name\"\n type=\"text\"\n value={subgraphName}\n onChange={(e) => setSubgraphName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\",\n isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\",\n )}\n placeholder=\"Enter subgraph name\"\n />\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={!subgraphName.trim()}\n className=\"rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\"\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 {\n setSubgraphName,\n setSubgraphStatus,\n} from \"@powerhousedao/vetra/document-models/subgraph-module\";\nimport { useCallback } from \"react\";\nimport { useSelectedSubgraphModuleDocument } from \"../hooks/useVetraDocument.js\";\nimport { SubgraphEditorForm } from \"./components/SubgraphEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedSubgraphModuleDocument();\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === document.state.global.name) return;\n dispatch(setSubgraphName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setSubgraphStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-background p-6\">\n <DocumentToolbar />\n <SubgraphEditorForm\n subgraphName={document.state.global.name ?? \"\"}\n status={document.state.global.status}\n onNameChange={onNameChange}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,MAAa,sBAAyD,EACpE,cAAc,sBAAsB,IACpC,SAAS,SACT,cACA,gBACI;CACJ,MAAM,CAAC,cAAc,mBAAmB,SAAS,mBAAmB;CACpE,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CAGpD,YAAY,cAAc,cAAc,GAAG;CAG3C,gBAAgB;EAEd,gBAAgB,mBAAmB;CACrC,GAAG,CAAC,mBAAmB,CAAC;CAGxB,gBAAgB;EACd,IAAI,WAAW,SAEb,eAAe,KAAK;CAExB,GAAG,CAAC,MAAM,CAAC;CAGX,MAAM,aAAa,eAAe,WAAW;CAE7C,MAAM,sBAAsB;EAC1B,IAAI,aAAa,KAAK,GAAG;GACvB,eAAe,IAAI;GACnB,YAAY;EACd;CACF;CAEA,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,MAAD;KAAI,WAAU;KAAsC,UAAA;IAEhD,CAAA,GACJ,oBAAC,YAAD;KACE,QAAQ,WAAW,cAAc,cAAc;KAC/C,OAAO,WAAW,cAAc,cAAc;IAC/C,CAAA,CACE;;GAGL,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,SAAD;IACE,SAAQ;IACR,WAAU;IACX,UAAA;GAEM,CAAA,GACP,oBAAC,SAAD;IACE,IAAG;IACH,MAAK;IACL,OAAO;IACP,WAAW,MAAM,gBAAgB,EAAE,OAAO,KAAK;IAC/C,UAAU;IACV,WAAW,QACT,wMACA,aAAa,gCAAgC,EAC/C;IACA,aAAY;GACb,CAAA,CACE,EAAA,CAAA;GAGJ,CAAC,cACA,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,aAAa,KAAK;IAC7B,WAAU;IACX,UAAA;GAEO,CAAA,EACL,CAAA;EAEJ;;AAET;;;AC9FA,MAAa,eAAuC,EAClD,2BAA2B,MAC7B;;;ACOA,SAAwB,SAAS;CAC/B,6BAA6B,YAAY;CACzC,MAAM,CAAC,UAAU,YAAY,kCAAkC;CAE/D,MAAM,eAAe,aAClB,SAAiB;EAChB,IAAI,SAAS,SAAS,MAAM,OAAO,MAAM;EACzC,SAAS,gBAAgB,EAAE,KAAK,CAAC,CAAC;CACpC,GACA,CAAC,SAAS,MAAM,OAAO,MAAM,QAAQ,CACvC;CAEA,MAAM,YAAY,kBAAkB;EAClC,SAAS,kBAAkB,EAAE,QAAQ,YAAY,CAAC,CAAC;CACrD,GAAG,CAAC,QAAQ,CAAC;CAEb,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,iBAAD,CAAkB,CAAA,GAClB,oBAAC,oBAAD;GACE,cAAc,SAAS,MAAM,OAAO,QAAQ;GAC5C,QAAQ,SAAS,MAAM,OAAO;GAChB;GACH;EACZ,CAAA,CACE;;AAET"}
@@ -1,7 +1,7 @@
1
- import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-DXCsvCXL.js";
1
+ import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-876N1Sph.js";
2
2
  import { useSelectedDocumentEditorDocument } from "./document-models/document-editor/index.js";
3
3
  import { StatusPill } from "./editors/components/index.js";
4
- import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-BIgFcbaF.js";
4
+ import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-BbxvC-C3.js";
5
5
  import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
6
6
  import { Suspense, useCallback, useEffect, useState } from "react";
7
7
  import { twMerge } from "tailwind-merge";
@@ -172,4 +172,4 @@ function Editor() {
172
172
  //#endregion
173
173
  export { Editor as default };
174
174
 
175
- //# sourceMappingURL=editor-C13SvgUy.js.map
175
+ //# sourceMappingURL=editor-DFEeM_dy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-DFEeM_dy.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-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\"\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-extra/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks-extra/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-extra/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-foreground\">\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-foreground\"\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-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\",\n isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\",\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-foreground\"\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-foreground\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-muted-foreground hover:hover-effect focus:outline-none\"\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-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\"\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-background p-6\">\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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MAAM,OAAO;GACjB;GACD;GACG;GACX;EACZ,CAAA,CACE;;AAET"}
@@ -1,6 +1,6 @@
1
- import { C as setPackageCategory, D as setPackageNpmUrl, E as setPackageName, S as setPackageAuthorWebsite, T as setPackageGithubUrl, _ as addPackageKeyword, w as setPackageDescription, x as setPackageAuthorName, y as removePackageKeyword } from "./module-CRfHlbnq.js";
2
- import { t as useDebounce } from "./hooks-BIgFcbaF.js";
3
- import { t as useSelectedDriveVetraPackage } from "./useVetraDocument-BlLdlhrQ.js";
1
+ import { C as setPackageCategory, D as setPackageNpmUrl, E as setPackageName, S as setPackageAuthorWebsite, T as setPackageGithubUrl, _ as addPackageKeyword, w as setPackageDescription, x as setPackageAuthorName, y as removePackageKeyword } from "./module-FXJRy_1W.js";
2
+ import { t as useDebounce } from "./hooks-BbxvC-C3.js";
3
+ import { t as useSelectedDriveVetraPackage } from "./useVetraDocument-B0k3gNtw.js";
4
4
  import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
5
5
  import { useCallback, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -304,4 +304,4 @@ function Editor(props) {
304
304
  //#endregion
305
305
  export { Editor as default };
306
306
 
307
- //# sourceMappingURL=editor-CCdg1mJL.js.map
307
+ //# sourceMappingURL=editor-DpZVlVN1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-CCdg1mJL.js","names":[],"sources":["../editors/vetra-package/components/MetaForm.tsx","../editors/vetra-package/config.ts","../editors/vetra-package/editor.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { Keyword } from \"../../../document-models/vetra-package/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nexport interface MetaFormProps {\n name: string;\n description: string;\n category: string;\n publisher: string;\n publisherUrl: string;\n githubRepository: string;\n npmPackage: string;\n keywords: Keyword[];\n onNameChange?: (name: string) => void;\n onDescriptionChange?: (description: string) => void;\n onCategoryChange?: (category: string) => void;\n onPublisherChange?: (publisher: string) => void;\n onPublisherUrlChange?: (publisherUrl: string) => void;\n onGithubRepositoryChange?: (githubRepository: string) => void;\n onNpmPackageChange?: (npmPackage: string) => void;\n onAddKeyword?: (keyword: { id: string; label: string }) => void;\n onRemoveKeyword?: (id: string) => void;\n}\n\nexport const MetaForm: React.FC<MetaFormProps> = (props) => {\n const {\n name: initialName,\n description: initialDescription,\n category: initialCategory,\n publisher: initialPublisher,\n publisherUrl: initialPublisherUrl,\n githubRepository: initialGithubRepository,\n npmPackage: initialNpmPackage,\n keywords: initialKeywords,\n onNameChange,\n onDescriptionChange,\n onCategoryChange,\n onPublisherChange,\n onPublisherUrlChange,\n onGithubRepositoryChange,\n onNpmPackageChange,\n onAddKeyword,\n onRemoveKeyword,\n } = props;\n\n const [name, setName] = useState(initialName);\n const [description, setDescription] = useState(initialDescription);\n const [category, setCategory] = useState(initialCategory);\n const [publisher, setPublisher] = useState(initialPublisher);\n const [publisherUrl, setPublisherUrl] = useState(initialPublisherUrl);\n const [githubRepository, setGithubRepository] = useState(\n initialGithubRepository,\n );\n const [npmPackage, setNpmPackage] = useState(initialNpmPackage);\n\n // Keywords state\n const [keywords, setKeywords] = useState<Keyword[]>(initialKeywords);\n const [keywordInput, setKeywordInput] = useState(\"\");\n\n // Use the debounce hook with callbacks\n useDebounce(name, onNameChange, 300);\n useDebounce(description, onDescriptionChange, 300);\n useDebounce(publisher, onPublisherChange, 300);\n useDebounce(publisherUrl, onPublisherUrlChange, 300);\n useDebounce(githubRepository, onGithubRepositoryChange, 300);\n useDebounce(npmPackage, onNpmPackageChange, 300);\n\n return (\n <div className=\"grid grid-cols-1 gap-6 p-6 lg:grid-cols-3\">\n {/* Left Column */}\n <div className=\"space-y-6\">\n {/* Name Field */}\n <div>\n <label\n htmlFor=\"package-name\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Name\n </label>\n <input\n id=\"package-name\"\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Description Field */}\n <div>\n <label\n htmlFor=\"package-description\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Description\n </label>\n <textarea\n id=\"package-description\"\n rows={6}\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n className=\"w-full resize-none rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n </div>\n\n {/* Middle Column */}\n <div className=\"space-y-6\">\n {/* Category Field */}\n <div>\n <label\n htmlFor=\"package-category\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Category\n </label>\n <select\n id=\"package-category\"\n value={category}\n onChange={(e) => {\n const newValue = e.target.value;\n setCategory(newValue);\n onCategoryChange?.(newValue);\n }}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n >\n <option value=\"\">Not selected</option>\n <option value=\"Productivity\">Productivity</option>\n <option value=\"Governance\">Governance</option>\n <option value=\"Project Management\">Project Management</option>\n <option value=\"Finance\">Finance</option>\n <option value=\"Legal\">Legal</option>\n <option value=\"People & Culture\">People & Culture</option>\n <option value=\"Engineering\">Engineering</option>\n </select>\n </div>\n\n {/* Publisher Field */}\n <div>\n <label\n htmlFor=\"package-publisher\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Publisher\n </label>\n <input\n id=\"package-publisher\"\n type=\"text\"\n value={publisher}\n onChange={(e) => setPublisher(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Publisher URL Field */}\n <div>\n <label\n htmlFor=\"package-publisher-url\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Publisher URL\n </label>\n <input\n id=\"package-publisher-url\"\n type=\"text\"\n value={publisherUrl}\n onChange={(e) => setPublisherUrl(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Keywords Field */}\n <div>\n <label\n htmlFor=\"package-keywords\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Keywords\n </label>\n <div className=\"space-y-2\">\n <input\n id=\"package-keywords\"\n type=\"text\"\n value={keywordInput}\n onChange={(e) => setKeywordInput(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && keywordInput.trim()) {\n e.preventDefault();\n const newKeyword = {\n id: Date.now().toString(), // Generate a unique ID\n label: keywordInput.trim(),\n };\n setKeywords([...keywords, newKeyword]);\n onAddKeyword?.(newKeyword);\n setKeywordInput(\"\");\n }\n }}\n placeholder=\"Type a keyword and press Enter\"\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n <div className=\"flex min-h-[80px] flex-wrap gap-2 rounded-md border border-border p-3\">\n {keywords.map((keyword) => (\n <span\n key={keyword.id}\n className=\"inline-flex items-center rounded-sm border border-info bg-info/10 px-2 py-0.5 text-xs text-info\"\n >\n {keyword.label}\n <button\n onClick={() => {\n setKeywords(keywords.filter((k) => k.id !== keyword.id));\n onRemoveKeyword?.(keyword.id);\n }}\n className=\"ml-1 text-info hover:hover-effect focus:outline-none\"\n >\n ×\n </button>\n </span>\n ))}\n </div>\n </div>\n </div>\n </div>\n\n {/* Right Column */}\n <div className=\"space-y-6\">\n {/* Github Repository Field */}\n <div>\n <label\n htmlFor=\"package-github\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Github Repository\n </label>\n <input\n id=\"package-github\"\n type=\"text\"\n value={githubRepository}\n onChange={(e) => setGithubRepository(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* NPM-package Field */}\n <div>\n <label\n htmlFor=\"package-npm\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n NPM-package\n </label>\n <input\n id=\"package-npm\"\n type=\"text\"\n value={npmPackage}\n onChange={(e) => setNpmPackage(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Version Field */}\n <div>\n <label\n htmlFor=\"package-version\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Version\n </label>\n <input\n id=\"package-version\"\n type=\"text\"\n placeholder=\"1.0.0-dev\"\n disabled\n className=\"w-full cursor-not-allowed rounded-md border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground disabled:disabled-effect\"\n />\n </div>\n\n {/* License Field */}\n <div>\n <label\n htmlFor=\"package-license\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n License\n </label>\n <input\n id=\"package-license\"\n type=\"text\"\n placeholder=\"AGPL-3.0-only\"\n disabled\n className=\"w-full cursor-not-allowed rounded-md border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground disabled:disabled-effect\"\n />\n </div>\n\n {/* Install with Field */}\n <div>\n <label\n htmlFor=\"package-install\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Install with:\n </label>\n <input\n id=\"package-install\"\n type=\"text\"\n placeholder=\"@powerhousedao/todo-demo-package\"\n disabled\n className=\"w-full cursor-not-allowed rounded-md border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground disabled:disabled-effect\"\n />\n </div>\n </div>\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 {\n addPackageKeyword,\n removePackageKeyword,\n setPackageAuthorName,\n setPackageAuthorWebsite,\n setPackageCategory,\n setPackageDescription,\n setPackageGithubUrl,\n setPackageName,\n setPackageNpmUrl,\n} from \"../../document-models/vetra-package/index.js\";\nimport { useSelectedDriveVetraPackage } from \"../hooks/useVetraDocument.js\";\nimport { MetaForm } from \"./components/MetaForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport type EditorProps = {\n displayToolbar?: boolean;\n};\n\nexport default function Editor(props: EditorProps) {\n const { displayToolbar = true } = props;\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDriveVetraPackage();\n\n const onNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setPackageName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onDescriptionChange = useCallback(\n (description: string) => {\n if (!document.state.global.description && !description) return;\n if (description === document.state.global.description) return;\n\n dispatch(setPackageDescription({ description }));\n },\n [document.state.global.description, dispatch],\n );\n\n const onCategoryChange = useCallback(\n (category: string) => {\n if (!document.state.global.category && !category) return;\n if (category === document.state.global.category) return;\n\n dispatch(setPackageCategory({ category }));\n },\n [document.state.global.category, dispatch],\n );\n\n const onPublisherChange = useCallback(\n (name: string) => {\n if (!document.state.global.author.name && !name) return;\n if (name === document.state.global.author.name) return;\n\n dispatch(setPackageAuthorName({ name }));\n },\n [document.state.global.author.name, dispatch],\n );\n\n const onPublisherUrlChange = useCallback(\n (website: string) => {\n if (!document.state.global.author.website && !website) return;\n if (website === document.state.global.author.website) return;\n\n dispatch(setPackageAuthorWebsite({ website }));\n },\n [document.state.global.author.website, dispatch],\n );\n\n const onGithubRepositoryChange = useCallback(\n (url: string) => {\n if (!document.state.global.githubUrl && !url) return;\n if (url === document.state.global.githubUrl) return;\n\n dispatch(setPackageGithubUrl({ url }));\n },\n [document.state.global.githubUrl, dispatch],\n );\n\n const onNpmPackageChange = useCallback(\n (url: string) => {\n if (!document.state.global.npmUrl && !url) return;\n if (url === document.state.global.npmUrl) return;\n\n dispatch(setPackageNpmUrl({ url }));\n },\n [document.state.global.npmUrl, dispatch],\n );\n\n const onAddKeyword = useCallback(\n (keyword: { id: string; label: string }) => {\n dispatch(addPackageKeyword(keyword));\n },\n [dispatch],\n );\n\n const onRemoveKeyword = useCallback(\n (id: string) => {\n dispatch(removePackageKeyword({ id }));\n },\n [dispatch],\n );\n\n return (\n <div className=\"bg-background p-6\">\n {displayToolbar && <DocumentToolbar />}\n <MetaForm\n name={document.state.global.name ?? \"\"}\n description={document.state.global.description ?? \"\"}\n category={document.state.global.category ?? \"\"}\n publisher={document.state.global.author.name ?? \"\"}\n publisherUrl={document.state.global.author.website ?? \"\"}\n githubRepository={document.state.global.githubUrl ?? \"\"}\n npmPackage={document.state.global.npmUrl ?? \"\"}\n keywords={document.state.global.keywords}\n onNameChange={onNameChange}\n onDescriptionChange={onDescriptionChange}\n onCategoryChange={onCategoryChange}\n onPublisherChange={onPublisherChange}\n onPublisherUrlChange={onPublisherUrlChange}\n onGithubRepositoryChange={onGithubRepositoryChange}\n onNpmPackageChange={onNpmPackageChange}\n onAddKeyword={onAddKeyword}\n onRemoveKeyword={onRemoveKeyword}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAwBA,MAAa,YAAqC,UAAU;CAC1D,MAAM,EACJ,MAAM,aACN,aAAa,oBACb,UAAU,iBACV,WAAW,kBACX,cAAc,qBACd,kBAAkB,yBAClB,YAAY,mBACZ,UAAU,iBACV,cACA,qBACA,kBACA,mBACA,sBACA,0BACA,oBACA,cACA,oBACE;CAEJ,MAAM,CAAC,MAAM,WAAW,SAAS,YAAY;C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ACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,kBAAkB,oBAAC,iBAAD,EAAmB,CAAA,EACtC,oBAAC,UAAD;GACE,MAAM,SAAS,MAAM,OAAO,QAAQ;GACpC,aAAa,SAAS,MAAM,OAAO,eAAe;GAClD,UAAU,SAAS,MAAM,OAAO,YAAY;GAC5C,WAAW,SAAS,MAAM,OAAO,OAAO,QAAQ;GAChD,cAAc,SAAS,MAAM,OAAO,OAAO,WAAW;GACtD,kBAAkB,SAAS,MAAM,OAAO,aAAa;GACrD,YAAY,SAAS,MAAM,OAAO,UAAU;GAC5C,UAAU,SAAS,MAAM,OAAO;GAClB;GACO;GACH;GACC;GACG;GACI;GACN;GACN;GACG;GACjB,CAAA,CACE"}
1
+ {"version":3,"file":"editor-DpZVlVN1.js","names":[],"sources":["../editors/vetra-package/components/MetaForm.tsx","../editors/vetra-package/config.ts","../editors/vetra-package/editor.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { Keyword } from \"../../../document-models/vetra-package/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nexport interface MetaFormProps {\n name: string;\n description: string;\n category: string;\n publisher: string;\n publisherUrl: string;\n githubRepository: string;\n npmPackage: string;\n keywords: Keyword[];\n onNameChange?: (name: string) => void;\n onDescriptionChange?: (description: string) => void;\n onCategoryChange?: (category: string) => void;\n onPublisherChange?: (publisher: string) => void;\n onPublisherUrlChange?: (publisherUrl: string) => void;\n onGithubRepositoryChange?: (githubRepository: string) => void;\n onNpmPackageChange?: (npmPackage: string) => void;\n onAddKeyword?: (keyword: { id: string; label: string }) => void;\n onRemoveKeyword?: (id: string) => void;\n}\n\nexport const MetaForm: React.FC<MetaFormProps> = (props) => {\n const {\n name: initialName,\n description: initialDescription,\n category: initialCategory,\n publisher: initialPublisher,\n publisherUrl: initialPublisherUrl,\n githubRepository: initialGithubRepository,\n npmPackage: initialNpmPackage,\n keywords: initialKeywords,\n onNameChange,\n onDescriptionChange,\n onCategoryChange,\n onPublisherChange,\n onPublisherUrlChange,\n onGithubRepositoryChange,\n onNpmPackageChange,\n onAddKeyword,\n onRemoveKeyword,\n } = props;\n\n const [name, setName] = useState(initialName);\n const [description, setDescription] = useState(initialDescription);\n const [category, setCategory] = useState(initialCategory);\n const [publisher, setPublisher] = useState(initialPublisher);\n const [publisherUrl, setPublisherUrl] = useState(initialPublisherUrl);\n const [githubRepository, setGithubRepository] = useState(\n initialGithubRepository,\n );\n const [npmPackage, setNpmPackage] = useState(initialNpmPackage);\n\n // Keywords state\n const [keywords, setKeywords] = useState<Keyword[]>(initialKeywords);\n const [keywordInput, setKeywordInput] = useState(\"\");\n\n // Use the debounce hook with callbacks\n useDebounce(name, onNameChange, 300);\n useDebounce(description, onDescriptionChange, 300);\n useDebounce(publisher, onPublisherChange, 300);\n useDebounce(publisherUrl, onPublisherUrlChange, 300);\n useDebounce(githubRepository, onGithubRepositoryChange, 300);\n useDebounce(npmPackage, onNpmPackageChange, 300);\n\n return (\n <div className=\"grid grid-cols-1 gap-6 p-6 lg:grid-cols-3\">\n {/* Left Column */}\n <div className=\"space-y-6\">\n {/* Name Field */}\n <div>\n <label\n htmlFor=\"package-name\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Name\n </label>\n <input\n id=\"package-name\"\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Description Field */}\n <div>\n <label\n htmlFor=\"package-description\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Description\n </label>\n <textarea\n id=\"package-description\"\n rows={6}\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n className=\"w-full resize-none rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n </div>\n\n {/* Middle Column */}\n <div className=\"space-y-6\">\n {/* Category Field */}\n <div>\n <label\n htmlFor=\"package-category\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Category\n </label>\n <select\n id=\"package-category\"\n value={category}\n onChange={(e) => {\n const newValue = e.target.value;\n setCategory(newValue);\n onCategoryChange?.(newValue);\n }}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n >\n <option value=\"\">Not selected</option>\n <option value=\"Productivity\">Productivity</option>\n <option value=\"Governance\">Governance</option>\n <option value=\"Project Management\">Project Management</option>\n <option value=\"Finance\">Finance</option>\n <option value=\"Legal\">Legal</option>\n <option value=\"People & Culture\">People & Culture</option>\n <option value=\"Engineering\">Engineering</option>\n </select>\n </div>\n\n {/* Publisher Field */}\n <div>\n <label\n htmlFor=\"package-publisher\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Publisher\n </label>\n <input\n id=\"package-publisher\"\n type=\"text\"\n value={publisher}\n onChange={(e) => setPublisher(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Publisher URL Field */}\n <div>\n <label\n htmlFor=\"package-publisher-url\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Publisher URL\n </label>\n <input\n id=\"package-publisher-url\"\n type=\"text\"\n value={publisherUrl}\n onChange={(e) => setPublisherUrl(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Keywords Field */}\n <div>\n <label\n htmlFor=\"package-keywords\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Keywords\n </label>\n <div className=\"space-y-2\">\n <input\n id=\"package-keywords\"\n type=\"text\"\n value={keywordInput}\n onChange={(e) => setKeywordInput(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && keywordInput.trim()) {\n e.preventDefault();\n const newKeyword = {\n id: Date.now().toString(), // Generate a unique ID\n label: keywordInput.trim(),\n };\n setKeywords([...keywords, newKeyword]);\n onAddKeyword?.(newKeyword);\n setKeywordInput(\"\");\n }\n }}\n placeholder=\"Type a keyword and press Enter\"\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n <div className=\"flex min-h-[80px] flex-wrap gap-2 rounded-md border border-border p-3\">\n {keywords.map((keyword) => (\n <span\n key={keyword.id}\n className=\"inline-flex items-center rounded-sm border border-info bg-info/10 px-2 py-0.5 text-xs text-info\"\n >\n {keyword.label}\n <button\n onClick={() => {\n setKeywords(keywords.filter((k) => k.id !== keyword.id));\n onRemoveKeyword?.(keyword.id);\n }}\n className=\"ml-1 text-info hover:hover-effect focus:outline-none\"\n >\n ×\n </button>\n </span>\n ))}\n </div>\n </div>\n </div>\n </div>\n\n {/* Right Column */}\n <div className=\"space-y-6\">\n {/* Github Repository Field */}\n <div>\n <label\n htmlFor=\"package-github\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Github Repository\n </label>\n <input\n id=\"package-github\"\n type=\"text\"\n value={githubRepository}\n onChange={(e) => setGithubRepository(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* NPM-package Field */}\n <div>\n <label\n htmlFor=\"package-npm\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n NPM-package\n </label>\n <input\n id=\"package-npm\"\n type=\"text\"\n value={npmPackage}\n onChange={(e) => setNpmPackage(e.target.value)}\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\"\n />\n </div>\n\n {/* Version Field */}\n <div>\n <label\n htmlFor=\"package-version\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Version\n </label>\n <input\n id=\"package-version\"\n type=\"text\"\n placeholder=\"1.0.0-dev\"\n disabled\n className=\"w-full cursor-not-allowed rounded-md border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground disabled:disabled-effect\"\n />\n </div>\n\n {/* License Field */}\n <div>\n <label\n htmlFor=\"package-license\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n License\n </label>\n <input\n id=\"package-license\"\n type=\"text\"\n placeholder=\"AGPL-3.0-only\"\n disabled\n className=\"w-full cursor-not-allowed rounded-md border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground disabled:disabled-effect\"\n />\n </div>\n\n {/* Install with Field */}\n <div>\n <label\n htmlFor=\"package-install\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Install with:\n </label>\n <input\n id=\"package-install\"\n type=\"text\"\n placeholder=\"@powerhousedao/todo-demo-package\"\n disabled\n className=\"w-full cursor-not-allowed rounded-md border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground disabled:disabled-effect\"\n />\n </div>\n </div>\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 {\n addPackageKeyword,\n removePackageKeyword,\n setPackageAuthorName,\n setPackageAuthorWebsite,\n setPackageCategory,\n setPackageDescription,\n setPackageGithubUrl,\n setPackageName,\n setPackageNpmUrl,\n} from \"../../document-models/vetra-package/index.js\";\nimport { useSelectedDriveVetraPackage } from \"../hooks/useVetraDocument.js\";\nimport { MetaForm } from \"./components/MetaForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport type EditorProps = {\n displayToolbar?: boolean;\n};\n\nexport default function Editor(props: EditorProps) {\n const { displayToolbar = true } = props;\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDriveVetraPackage();\n\n const onNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setPackageName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onDescriptionChange = useCallback(\n (description: string) => {\n if (!document.state.global.description && !description) return;\n if (description === document.state.global.description) return;\n\n dispatch(setPackageDescription({ description }));\n },\n [document.state.global.description, dispatch],\n );\n\n const onCategoryChange = useCallback(\n (category: string) => {\n if (!document.state.global.category && !category) return;\n if (category === document.state.global.category) return;\n\n dispatch(setPackageCategory({ category }));\n },\n [document.state.global.category, dispatch],\n );\n\n const onPublisherChange = useCallback(\n (name: string) => {\n if (!document.state.global.author.name && !name) return;\n if (name === document.state.global.author.name) return;\n\n dispatch(setPackageAuthorName({ name }));\n },\n [document.state.global.author.name, dispatch],\n );\n\n const onPublisherUrlChange = useCallback(\n (website: string) => {\n if (!document.state.global.author.website && !website) return;\n if (website === document.state.global.author.website) return;\n\n dispatch(setPackageAuthorWebsite({ website }));\n },\n [document.state.global.author.website, dispatch],\n );\n\n const onGithubRepositoryChange = useCallback(\n (url: string) => {\n if (!document.state.global.githubUrl && !url) return;\n if (url === document.state.global.githubUrl) return;\n\n dispatch(setPackageGithubUrl({ url }));\n },\n [document.state.global.githubUrl, dispatch],\n );\n\n const onNpmPackageChange = useCallback(\n (url: string) => {\n if (!document.state.global.npmUrl && !url) return;\n if (url === document.state.global.npmUrl) return;\n\n dispatch(setPackageNpmUrl({ url }));\n },\n [document.state.global.npmUrl, dispatch],\n );\n\n const onAddKeyword = useCallback(\n (keyword: { id: string; label: string }) => {\n dispatch(addPackageKeyword(keyword));\n },\n [dispatch],\n );\n\n const onRemoveKeyword = useCallback(\n (id: string) => {\n dispatch(removePackageKeyword({ id }));\n },\n [dispatch],\n );\n\n return (\n <div className=\"bg-background p-6\">\n {displayToolbar && <DocumentToolbar />}\n <MetaForm\n name={document.state.global.name ?? \"\"}\n description={document.state.global.description ?? \"\"}\n category={document.state.global.category ?? \"\"}\n publisher={document.state.global.author.name ?? \"\"}\n publisherUrl={document.state.global.author.website ?? \"\"}\n githubRepository={document.state.global.githubUrl ?? \"\"}\n npmPackage={document.state.global.npmUrl ?? \"\"}\n keywords={document.state.global.keywords}\n onNameChange={onNameChange}\n onDescriptionChange={onDescriptionChange}\n onCategoryChange={onCategoryChange}\n onPublisherChange={onPublisherChange}\n onPublisherUrlChange={onPublisherUrlChange}\n onGithubRepositoryChange={onGithubRepositoryChange}\n onNpmPackageChange={onNpmPackageChange}\n onAddKeyword={onAddKeyword}\n onRemoveKeyword={onRemoveKeyword}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAwBA,MAAa,YAAqC,UAAU;CAC1D,MAAM,EACJ,MAAM,aACN,aAAa,oBACb,UAAU,iBACV,WAAW,kBACX,cAAc,qBACd,kBAAkB,yBAClB,YAAY,mBACZ,UAAU,iBACV,cACA,qBACA,kBACA,mBACA,sBACA,0BACA,oBACA,cACA,oBACE;CAEJ,MAAM,CAAC,MAAM,WAAW,SAAS,WAAW;CAC5C,MAAM,CAAC,aAAa,kBAAkB,SAAS,kBAAkB;CACjE,MAAM,CAAC,UAAU,eAAe,SAAS,eAAe;CACxD,MAAM,CAAC,WAAW,gBAAgB,SAAS,gBAAgB;CAC3D,MAAM,CAAC,cAAc,mBAAmB,SAAS,mBAAmB;CACpE,MAAM,CAAC,kBAAkB,uBAAuB,SAC9C,uBACF;CACA,MAAM,CAAC,YAAY,iBAAiB,SAAS,iBAAiB;CAG9D,MAAM,CAAC,UAAU,eAAe,SAAoB,eAAe;CACnE,MAAM,CAAC,cAAc,mBAAmB,SAAS,EAAE;CAGnD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