@powerhousedao/vetra 6.1.0-dev.1 → 6.1.0-dev.11

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 (82) hide show
  1. package/dist/{app-module-D_cAVvt0.js → app-module-CHTbm_9a.js} +3 -3
  2. package/dist/{app-module-D_cAVvt0.js.map → app-module-CHTbm_9a.js.map} +1 -1
  3. package/dist/codegen/index.js +8 -8
  4. package/dist/{document-editor-1NFr9t3a.js → document-editor--pHInvi3.js} +3 -3
  5. package/dist/{document-editor-1NFr9t3a.js.map → document-editor--pHInvi3.js.map} +1 -1
  6. package/dist/document-models/app-module/index.js +4 -4
  7. package/dist/document-models/document-editor/index.js +4 -4
  8. package/dist/document-models/index.js +5 -5
  9. package/dist/document-models/processor-module/index.js +4 -4
  10. package/dist/document-models/subgraph-module/index.js +4 -4
  11. package/dist/document-models/vetra-package/index.js +2 -2
  12. package/dist/{editor-BwbJ65NZ.js → editor-Bba0kIIP.js} +4 -4
  13. package/dist/editor-Bba0kIIP.js.map +1 -0
  14. package/dist/{editor-DWufJcmG.js → editor-BsM-iHdN.js} +2 -2
  15. package/dist/{editor-DWufJcmG.js.map → editor-BsM-iHdN.js.map} +1 -1
  16. package/dist/{editor-CJAn9WTA.js → editor-BuV8eJum.js} +3 -3
  17. package/dist/{editor-CJAn9WTA.js.map → editor-BuV8eJum.js.map} +1 -1
  18. package/dist/{editor-DabfMxkF.js → editor-CsLmxkXj.js} +11 -11
  19. package/dist/{editor-DabfMxkF.js.map → editor-CsLmxkXj.js.map} +1 -1
  20. package/dist/{editor-WWMGVelM.js → editor-D-IzvjvS.js} +2 -2
  21. package/dist/{editor-WWMGVelM.js.map → editor-D-IzvjvS.js.map} +1 -1
  22. package/dist/editors/index.js +1 -1
  23. package/dist/{factory-CjFOr45i.js → factory-4o53XqHE.js} +3 -3
  24. package/dist/{factory-CjFOr45i.js.map → factory-4o53XqHE.js.map} +1 -1
  25. package/dist/{factory-KNJv2C2k.js → factory-Dexxeo5C.js} +5 -4
  26. package/dist/factory-Dexxeo5C.js.map +1 -0
  27. package/dist/index-BPoF8P3O.d.ts.map +1 -1
  28. package/dist/index-BoGed4Fa.d.ts.map +1 -1
  29. package/dist/index-C4s0aLv3.d.ts.map +1 -1
  30. package/dist/index-ClaOdn_F.d.ts.map +1 -1
  31. package/dist/index.js +6 -6
  32. package/dist/{logger-DLnGUZk9.js → logger-CYkStoEb.js} +1 -1
  33. package/dist/{logger-DLnGUZk9.js.map → logger-CYkStoEb.js.map} +1 -1
  34. package/dist/{module-pK0hpO6c.js → module-BAE-Cdy6.js} +2 -2
  35. package/dist/{module-pK0hpO6c.js.map → module-BAE-Cdy6.js.map} +1 -1
  36. package/dist/{module-ryHOwQp-.js → module-BSpVJEfF.js} +2 -2
  37. package/dist/{module-ryHOwQp-.js.map → module-BSpVJEfF.js.map} +1 -1
  38. package/dist/{module-dDKBr6QY.js → module-BV5uKc_X.js} +11 -11
  39. package/dist/module-BV5uKc_X.js.map +1 -0
  40. package/dist/{module-jWN6gsmi.js → module-CC1BnDod.js} +6 -6
  41. package/dist/{module-jWN6gsmi.js.map → module-CC1BnDod.js.map} +1 -1
  42. package/dist/{module-x2Liyk0-.js → module-D8H1Oetz.js} +2 -2
  43. package/dist/{module-x2Liyk0-.js.map → module-D8H1Oetz.js.map} +1 -1
  44. package/dist/module-Drla4Vmn.d.ts.map +1 -1
  45. package/dist/{module-DPyV2vUY.js → module-wcMEGEcg.js} +2 -2
  46. package/dist/{module-DPyV2vUY.js.map → module-wcMEGEcg.js.map} +1 -1
  47. package/dist/{ph-factories-B6PSPkPQ.js → ph-factories-4ifueM1H.js} +2 -2
  48. package/dist/{ph-factories-B6PSPkPQ.js.map → ph-factories-4ifueM1H.js.map} +1 -1
  49. package/dist/{ph-factories-CJXfT_Z1.js → ph-factories-BIe1kTJb.js} +2 -2
  50. package/dist/{ph-factories-CJXfT_Z1.js.map → ph-factories-BIe1kTJb.js.map} +1 -1
  51. package/dist/{ph-factories-B0_E6LY6.js → ph-factories-Bep45EPP.js} +2 -2
  52. package/dist/{ph-factories-B0_E6LY6.js.map → ph-factories-Bep45EPP.js.map} +1 -1
  53. package/dist/{ph-factories-Bn_HTUfT.js → ph-factories-D6cQKmns.js} +2 -2
  54. package/dist/{ph-factories-Bn_HTUfT.js.map → ph-factories-D6cQKmns.js.map} +1 -1
  55. package/dist/{processor-module-B7IAItXQ.js → processor-module-D7kxj_HT.js} +3 -3
  56. package/dist/{processor-module-B7IAItXQ.js.map → processor-module-D7kxj_HT.js.map} +1 -1
  57. package/dist/processors/codegen/index.js +1 -1
  58. package/dist/processors/index.js +1 -1
  59. package/dist/processors/vetra-read-model/index.js +1 -1
  60. package/dist/{subgraph-module-CfzSZTNC.js → subgraph-module-DqsecQjc.js} +3 -3
  61. package/dist/{subgraph-module-CfzSZTNC.js.map → subgraph-module-DqsecQjc.js.map} +1 -1
  62. package/dist/switchboard-C2L9IAfe.js +8 -0
  63. package/dist/{switchboard-Ciqw67L4.js.map → switchboard-C2L9IAfe.js.map} +1 -1
  64. package/dist/{utils-BRx88WW3.js → utils-A2M9gfq4.js} +7 -7
  65. package/dist/utils-A2M9gfq4.js.map +1 -0
  66. package/dist/{utils-Byjf33qt.js → utils-CSA5LPj9.js} +6 -6
  67. package/dist/utils-CSA5LPj9.js.map +1 -0
  68. package/dist/{utils-CnZc-0E4.js → utils-D3lwZ3L6.js} +5 -5
  69. package/dist/utils-D3lwZ3L6.js.map +1 -0
  70. package/dist/{utils-CWO5kDus.js → utils-DL6w0tV1.js} +3 -3
  71. package/dist/utils-DL6w0tV1.js.map +1 -0
  72. package/dist/{vetra-package-BgTjv343.js → vetra-package-C0hmmUZX.js} +2 -2
  73. package/dist/{vetra-package-BgTjv343.js.map → vetra-package-C0hmmUZX.js.map} +1 -1
  74. package/package.json +10 -8
  75. package/dist/editor-BwbJ65NZ.js.map +0 -1
  76. package/dist/factory-KNJv2C2k.js.map +0 -1
  77. package/dist/module-dDKBr6QY.js.map +0 -1
  78. package/dist/switchboard-Ciqw67L4.js +0 -8
  79. package/dist/utils-BRx88WW3.js.map +0 -1
  80. package/dist/utils-Byjf33qt.js.map +0 -1
  81. package/dist/utils-CWO5kDus.js.map +0 -1
  82. package/dist/utils-CnZc-0E4.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { l as isAppModuleDocument, s as assertIsAppModuleDocument } from "./utils-BRx88WW3.js";
2
- import { t as AppModule } from "./module-pK0hpO6c.js";
1
+ import { l as isAppModuleDocument, s as assertIsAppModuleDocument } from "./utils-A2M9gfq4.js";
2
+ import { t as AppModule } from "./module-BAE-Cdy6.js";
3
3
  import { PHDocumentController } from "document-model";
4
4
  import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument } from "@powerhousedao/reactor-browser";
5
5
  //#region document-models/app-module/v1/gen/controller.ts
@@ -45,4 +45,4 @@ const appModuleUpgradeManifest = {
45
45
  //#endregion
46
46
  export { useAppModuleDocumentsInSelectedDrive as a, AppModuleController as c, useAppModuleDocumentById as i, latestVersion as n, useAppModuleDocumentsInSelectedFolder as o, supportedVersions as r, useSelectedAppModuleDocument as s, appModuleUpgradeManifest as t };
47
47
 
48
- //# sourceMappingURL=app-module-D_cAVvt0.js.map
48
+ //# sourceMappingURL=app-module-CHTbm_9a.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-module-D_cAVvt0.js","names":[],"sources":["../document-models/app-module/v1/gen/controller.ts","../document-models/app-module/v1/hooks.ts","../document-models/app-module/upgrades/versions.ts","../document-models/app-module/upgrades/upgrade-manifest.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { AppModule } from \"../module.js\";\nimport type { AppModuleAction, AppModulePHState } from \"./types.js\";\n\nexport const AppModuleController = PHDocumentController.forDocumentModel<\n AppModulePHState,\n AppModuleAction\n>(AppModule);\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 AppModuleAction,\n AppModuleDocument,\n} from \"document-models/app-module/v1\";\nimport {\n assertIsAppModuleDocument,\n isAppModuleDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a AppModule document by its id */\nexport function useAppModuleDocumentById(\n documentId: string | null | undefined,\n):\n | [AppModuleDocument, DocumentDispatch<AppModuleAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isAppModuleDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected AppModule document */\nexport function useSelectedAppModuleDocument(): [\n AppModuleDocument,\n DocumentDispatch<AppModuleAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsAppModuleDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all AppModule documents in the selected drive */\nexport function useAppModuleDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isAppModuleDocument);\n}\n\n/** Hook to get all AppModule documents in the selected folder */\nexport function useAppModuleDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isAppModuleDocument);\n}\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const appModuleUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/app\",\n latestVersion,\n supportedVersions,\n upgrades: {},\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,sBAAsB,qBAAqB,iBAGtD,UAAU;;;;ACUZ,SAAgB,yBACd,YAGyB;CACzB,MAAM,CAAC,UAAU,YAAY,gBAAgB,WAAW;AACxD,KAAI,CAAC,oBAAoB,SAAS,CAAE,QAAO,CAAC,KAAA,GAAW,KAAA,EAAU;AACjE,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,+BAGd;CACA,MAAM,CAAC,UAAU,YAAY,qBAAqB;AAElD,2BAA0B,SAAS;AACnC,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,uCAAuC;AAErD,QADiC,6BAA6B,EAC7B,OAAO,oBAAoB;;;AAI9D,SAAgB,wCAAwC;AAEtD,QADkC,8BAA8B,EAC9B,OAAO,oBAAoB;;;;ACnD/D,MAAa,oBAAoB,CAAC,EAAE;AAEpC,MAAa,gBAAgB,kBAAkB;;;ACK/C,MAAa,2BAET;CACF,cAAc;CACd;CACA;CACA,UAAU,EAAE;CACb"}
1
+ {"version":3,"file":"app-module-CHTbm_9a.js","names":[],"sources":["../document-models/app-module/v1/gen/controller.ts","../document-models/app-module/v1/hooks.ts","../document-models/app-module/upgrades/versions.ts","../document-models/app-module/upgrades/upgrade-manifest.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { AppModule } from \"../module.js\";\nimport type { AppModuleAction, AppModulePHState } from \"./types.js\";\n\nexport const AppModuleController = PHDocumentController.forDocumentModel<\n AppModulePHState,\n AppModuleAction\n>(AppModule);\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 AppModuleAction,\n AppModuleDocument,\n} from \"document-models/app-module/v1\";\nimport {\n assertIsAppModuleDocument,\n isAppModuleDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a AppModule document by its id */\nexport function useAppModuleDocumentById(\n documentId: string | null | undefined,\n):\n | [AppModuleDocument, DocumentDispatch<AppModuleAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isAppModuleDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected AppModule document */\nexport function useSelectedAppModuleDocument(): [\n AppModuleDocument,\n DocumentDispatch<AppModuleAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsAppModuleDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all AppModule documents in the selected drive */\nexport function useAppModuleDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isAppModuleDocument);\n}\n\n/** Hook to get all AppModule documents in the selected folder */\nexport function useAppModuleDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isAppModuleDocument);\n}\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const appModuleUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/app\",\n latestVersion,\n supportedVersions,\n upgrades: {},\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,sBAAsB,qBAAqB,iBAGtD,UAAU;;;;ACUZ,SAAgB,yBACd,YAGyB;CACzB,MAAM,CAAC,UAAU,YAAY,gBAAgB,WAAW;AACxD,KAAI,CAAC,oBAAoB,SAAS,CAAE,QAAO,CAAC,KAAA,GAAW,KAAA,EAAU;AACjE,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,+BAGd;CACA,MAAM,CAAC,UAAU,YAAY,qBAAqB;AAElD,2BAA0B,SAAS;AACnC,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,uCAAuC;AAErD,QADiC,6BAA6B,EAC7B,OAAO,oBAAoB;;;AAI9D,SAAgB,wCAAwC;AAEtD,QADkC,8BAA8B,EAC9B,OAAO,oBAAoB;;;;ACnD/D,MAAa,oBAAoB,CAAC,EAAE;AAEpC,MAAa,gBAAgB,kBAAkB;;;ACK/C,MAAa,2BAET;CACF,cAAc;CACd;CACA;CACA,UAAU,EAAE;CACb"}
@@ -1,11 +1,11 @@
1
- import { d as appModuleDocumentType, f as reducer, p as actions, r as utils } from "../utils-BRx88WW3.js";
2
- import { t as createAppModuleDocument } from "../ph-factories-B6PSPkPQ.js";
3
- import { d as documentEditorDocumentType, f as reducer$1, p as actions$1, r as utils$1 } from "../utils-CnZc-0E4.js";
4
- import { t as createDocumentEditorDocument } from "../ph-factories-CJXfT_Z1.js";
5
- import { d as processorModuleDocumentType, f as reducer$2, p as actions$2, r as utils$2 } from "../utils-Byjf33qt.js";
6
- import { t as createProcessorModuleDocument } from "../ph-factories-B0_E6LY6.js";
7
- import { d as subgraphModuleDocumentType, f as reducer$3, p as actions$3, r as utils$3 } from "../utils-CWO5kDus.js";
8
- import { n as createSubgraphModuleDocument } from "../ph-factories-Bn_HTUfT.js";
1
+ import { d as appModuleDocumentType, f as reducer, p as actions, r as utils } from "../utils-A2M9gfq4.js";
2
+ import { t as createAppModuleDocument } from "../ph-factories-4ifueM1H.js";
3
+ import { d as documentEditorDocumentType, f as reducer$1, p as actions$1, r as utils$1 } from "../utils-D3lwZ3L6.js";
4
+ import { t as createDocumentEditorDocument } from "../ph-factories-BIe1kTJb.js";
5
+ import { d as processorModuleDocumentType, f as reducer$2, p as actions$2, r as utils$2 } from "../utils-CSA5LPj9.js";
6
+ import { t as createProcessorModuleDocument } from "../ph-factories-Bep45EPP.js";
7
+ import { d as subgraphModuleDocumentType, f as reducer$3, p as actions$3, r as utils$3 } from "../utils-DL6w0tV1.js";
8
+ import { n as createSubgraphModuleDocument } from "../ph-factories-D6cQKmns.js";
9
9
  import { documentModelDocumentModelModule } from "document-model";
10
10
  import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
11
11
  import { generateId as generateId$1 } from "@powerhousedao/shared/document-model";
@@ -1,5 +1,5 @@
1
- import { l as isDocumentEditorDocument, s as assertIsDocumentEditorDocument } from "./utils-CnZc-0E4.js";
2
- import { t as DocumentEditor } from "./module-ryHOwQp-.js";
1
+ import { l as isDocumentEditorDocument, s as assertIsDocumentEditorDocument } from "./utils-D3lwZ3L6.js";
2
+ import { t as DocumentEditor } from "./module-BSpVJEfF.js";
3
3
  import { PHDocumentController } from "document-model";
4
4
  import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument } from "@powerhousedao/reactor-browser";
5
5
  //#region document-models/document-editor/v1/gen/controller.ts
@@ -45,4 +45,4 @@ const documentEditorUpgradeManifest = {
45
45
  //#endregion
46
46
  export { useDocumentEditorDocumentsInSelectedDrive as a, DocumentEditorController as c, useDocumentEditorDocumentById as i, latestVersion as n, useDocumentEditorDocumentsInSelectedFolder as o, supportedVersions as r, useSelectedDocumentEditorDocument as s, documentEditorUpgradeManifest as t };
47
47
 
48
- //# sourceMappingURL=document-editor-1NFr9t3a.js.map
48
+ //# sourceMappingURL=document-editor--pHInvi3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"document-editor-1NFr9t3a.js","names":[],"sources":["../document-models/document-editor/v1/gen/controller.ts","../document-models/document-editor/v1/hooks.ts","../document-models/document-editor/upgrades/versions.ts","../document-models/document-editor/upgrades/upgrade-manifest.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { DocumentEditor } from \"../module.js\";\nimport type { DocumentEditorAction, DocumentEditorPHState } from \"./types.js\";\n\nexport const DocumentEditorController = PHDocumentController.forDocumentModel<\n DocumentEditorPHState,\n DocumentEditorAction\n>(DocumentEditor);\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 DocumentEditorAction,\n DocumentEditorDocument,\n} from \"document-models/document-editor/v1\";\nimport {\n assertIsDocumentEditorDocument,\n isDocumentEditorDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a DocumentEditor document by its id */\nexport function useDocumentEditorDocumentById(\n documentId: string | null | undefined,\n):\n | [DocumentEditorDocument, DocumentDispatch<DocumentEditorAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isDocumentEditorDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected DocumentEditor document */\nexport function useSelectedDocumentEditorDocument(): [\n DocumentEditorDocument,\n DocumentDispatch<DocumentEditorAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsDocumentEditorDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all DocumentEditor documents in the selected drive */\nexport function useDocumentEditorDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isDocumentEditorDocument);\n}\n\n/** Hook to get all DocumentEditor documents in the selected folder */\nexport function useDocumentEditorDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isDocumentEditorDocument);\n}\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const documentEditorUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/document-editor\",\n latestVersion,\n supportedVersions,\n upgrades: {},\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;;;;ACnDpE,MAAa,oBAAoB,CAAC,EAAE;AAEpC,MAAa,gBAAgB,kBAAkB;;;ACK/C,MAAa,gCAET;CACF,cAAc;CACd;CACA;CACA,UAAU,EAAE;CACb"}
1
+ {"version":3,"file":"document-editor--pHInvi3.js","names":[],"sources":["../document-models/document-editor/v1/gen/controller.ts","../document-models/document-editor/v1/hooks.ts","../document-models/document-editor/upgrades/versions.ts","../document-models/document-editor/upgrades/upgrade-manifest.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { DocumentEditor } from \"../module.js\";\nimport type { DocumentEditorAction, DocumentEditorPHState } from \"./types.js\";\n\nexport const DocumentEditorController = PHDocumentController.forDocumentModel<\n DocumentEditorPHState,\n DocumentEditorAction\n>(DocumentEditor);\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 DocumentEditorAction,\n DocumentEditorDocument,\n} from \"document-models/document-editor/v1\";\nimport {\n assertIsDocumentEditorDocument,\n isDocumentEditorDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a DocumentEditor document by its id */\nexport function useDocumentEditorDocumentById(\n documentId: string | null | undefined,\n):\n | [DocumentEditorDocument, DocumentDispatch<DocumentEditorAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isDocumentEditorDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected DocumentEditor document */\nexport function useSelectedDocumentEditorDocument(): [\n DocumentEditorDocument,\n DocumentDispatch<DocumentEditorAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsDocumentEditorDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all DocumentEditor documents in the selected drive */\nexport function useDocumentEditorDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isDocumentEditorDocument);\n}\n\n/** Hook to get all DocumentEditor documents in the selected folder */\nexport function useDocumentEditorDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isDocumentEditorDocument);\n}\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const documentEditorUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/document-editor\",\n latestVersion,\n supportedVersions,\n upgrades: {},\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;;;;ACnDpE,MAAa,oBAAoB,CAAC,EAAE;AAEpC,MAAa,gBAAgB,kBAAkB;;;ACK/C,MAAa,gCAET;CACF,cAAc;CACd;CACA;CACA,UAAU,EAAE;CACb"}
@@ -1,5 +1,5 @@
1
- import { A as definedNonNullAnySchema, C as AppModuleStateSchema, D as SetDocumentTypesInputSchema, E as SetAppStatusInputSchema, O as SetDragAndDropEnabledInputSchema, S as AddDocumentTypeInputSchema, T as SetAppNameInputSchema, _ as creators_exports, a as AppModuleDocumentSchema, b as setAppStatus, c as assertIsAppModuleState, d as appModuleDocumentType, f as reducer, g as addDocumentType, h as setDragAndDropEnabled, i as AppModuleDocumentHeaderSchema, j as isDefinedNonNullAny, k as StatusTypeSchema, l as isAppModuleDocument, m as creators_exports$1, n as initialLocalState, o as AppModulePHStateSchema, p as actions, s as assertIsAppModuleDocument, t as initialGlobalState, u as isAppModuleState, v as removeDocumentType, w as RemoveDocumentTypeInputSchema, x as setDocumentTypes, y as setAppName } from "../../utils-BRx88WW3.js";
2
- import { n as utils, r as documentModel, t as AppModule } from "../../module-pK0hpO6c.js";
3
- import { a as useAppModuleDocumentsInSelectedDrive, c as AppModuleController, i as useAppModuleDocumentById, n as latestVersion, o as useAppModuleDocumentsInSelectedFolder, r as supportedVersions, s as useSelectedAppModuleDocument, t as appModuleUpgradeManifest } from "../../app-module-D_cAVvt0.js";
4
- import { a as defaultPHState, i as defaultLocalState, n as createState, r as defaultGlobalState, t as createAppModuleDocument } from "../../ph-factories-B6PSPkPQ.js";
1
+ import { A as definedNonNullAnySchema, C as AppModuleStateSchema, D as SetDocumentTypesInputSchema, E as SetAppStatusInputSchema, O as SetDragAndDropEnabledInputSchema, S as AddDocumentTypeInputSchema, T as SetAppNameInputSchema, _ as creators_exports, a as AppModuleDocumentSchema, b as setAppStatus, c as assertIsAppModuleState, d as appModuleDocumentType, f as reducer, g as addDocumentType, h as setDragAndDropEnabled, i as AppModuleDocumentHeaderSchema, j as isDefinedNonNullAny, k as StatusTypeSchema, l as isAppModuleDocument, m as creators_exports$1, n as initialLocalState, o as AppModulePHStateSchema, p as actions, s as assertIsAppModuleDocument, t as initialGlobalState, u as isAppModuleState, v as removeDocumentType, w as RemoveDocumentTypeInputSchema, x as setDocumentTypes, y as setAppName } from "../../utils-A2M9gfq4.js";
2
+ import { n as utils, r as documentModel, t as AppModule } from "../../module-BAE-Cdy6.js";
3
+ import { a as useAppModuleDocumentsInSelectedDrive, c as AppModuleController, i as useAppModuleDocumentById, n as latestVersion, o as useAppModuleDocumentsInSelectedFolder, r as supportedVersions, s as useSelectedAppModuleDocument, t as appModuleUpgradeManifest } from "../../app-module-CHTbm_9a.js";
4
+ import { a as defaultPHState, i as defaultLocalState, n as createState, r as defaultGlobalState, t as createAppModuleDocument } from "../../ph-factories-4ifueM1H.js";
5
5
  export { AddDocumentTypeInputSchema, AppModule, AppModuleController, AppModuleDocumentHeaderSchema, AppModuleDocumentSchema, AppModulePHStateSchema, AppModuleStateSchema, RemoveDocumentTypeInputSchema, SetAppNameInputSchema, SetAppStatusInputSchema, SetDocumentTypesInputSchema, SetDragAndDropEnabledInputSchema, StatusTypeSchema, actions, addDocumentType, creators_exports as appModuleBaseOperationsActions, creators_exports$1 as appModuleDndOperationsActions, appModuleDocumentType, appModuleUpgradeManifest, assertIsAppModuleDocument, assertIsAppModuleState, createAppModuleDocument, createState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isAppModuleDocument, isAppModuleState, isDefinedNonNullAny, latestVersion, reducer, removeDocumentType, setAppName, setAppStatus, setDocumentTypes, setDragAndDropEnabled, supportedVersions, useAppModuleDocumentById, useAppModuleDocumentsInSelectedDrive, useAppModuleDocumentsInSelectedFolder, useSelectedAppModuleDocument, utils };
@@ -1,5 +1,5 @@
1
- import { C as SetEditorNameInputSchema, D as isDefinedNonNullAny, E as definedNonNullAnySchema, S as RemoveDocumentTypeInputSchema, T as StatusTypeSchema, _ as setEditorName, a as DocumentEditorDocumentSchema, b as DocumentEditorStateSchema, c as assertIsDocumentEditorState, d as documentEditorDocumentType, f as reducer, g as removeDocumentType, h as creators_exports, i as DocumentEditorDocumentHeaderSchema, l as isDocumentEditorDocument, m as addDocumentType, n as initialLocalState, o as DocumentEditorPHStateSchema, p as actions, s as assertIsDocumentEditorDocument, t as initialGlobalState, u as isDocumentEditorState, v as setEditorStatus, w as SetEditorStatusInputSchema, x as DocumentTypeItemSchema, y as AddDocumentTypeInputSchema } from "../../utils-CnZc-0E4.js";
2
- import { n as utils, r as documentModel, t as DocumentEditor } from "../../module-ryHOwQp-.js";
3
- import { a as useDocumentEditorDocumentsInSelectedDrive, c as DocumentEditorController, i as useDocumentEditorDocumentById, n as latestVersion, o as useDocumentEditorDocumentsInSelectedFolder, r as supportedVersions, s as useSelectedDocumentEditorDocument, t as documentEditorUpgradeManifest } from "../../document-editor-1NFr9t3a.js";
4
- import { a as defaultPHState, i as defaultLocalState, n as createState, r as defaultGlobalState, t as createDocumentEditorDocument } from "../../ph-factories-CJXfT_Z1.js";
1
+ import { C as SetEditorNameInputSchema, D as isDefinedNonNullAny, E as definedNonNullAnySchema, S as RemoveDocumentTypeInputSchema, T as StatusTypeSchema, _ as setEditorName, a as DocumentEditorDocumentSchema, b as DocumentEditorStateSchema, c as assertIsDocumentEditorState, d as documentEditorDocumentType, f as reducer, g as removeDocumentType, h as creators_exports, i as DocumentEditorDocumentHeaderSchema, l as isDocumentEditorDocument, m as addDocumentType, n as initialLocalState, o as DocumentEditorPHStateSchema, p as actions, s as assertIsDocumentEditorDocument, t as initialGlobalState, u as isDocumentEditorState, v as setEditorStatus, w as SetEditorStatusInputSchema, x as DocumentTypeItemSchema, y as AddDocumentTypeInputSchema } from "../../utils-D3lwZ3L6.js";
2
+ import { n as utils, r as documentModel, t as DocumentEditor } from "../../module-BSpVJEfF.js";
3
+ import { a as useDocumentEditorDocumentsInSelectedDrive, c as DocumentEditorController, i as useDocumentEditorDocumentById, n as latestVersion, o as useDocumentEditorDocumentsInSelectedFolder, r as supportedVersions, s as useSelectedDocumentEditorDocument, t as documentEditorUpgradeManifest } from "../../document-editor--pHInvi3.js";
4
+ import { a as defaultPHState, i as defaultLocalState, n as createState, r as defaultGlobalState, t as createDocumentEditorDocument } from "../../ph-factories-BIe1kTJb.js";
5
5
  export { AddDocumentTypeInputSchema, DocumentEditor, DocumentEditorController, DocumentEditorDocumentHeaderSchema, DocumentEditorDocumentSchema, DocumentEditorPHStateSchema, DocumentEditorStateSchema, DocumentTypeItemSchema, RemoveDocumentTypeInputSchema, SetEditorNameInputSchema, SetEditorStatusInputSchema, StatusTypeSchema, actions, addDocumentType, assertIsDocumentEditorDocument, assertIsDocumentEditorState, createDocumentEditorDocument, createState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, creators_exports as documentEditorBaseOperationsActions, documentEditorDocumentType, documentEditorUpgradeManifest, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isDocumentEditorDocument, isDocumentEditorState, latestVersion, reducer, removeDocumentType, setEditorName, setEditorStatus, supportedVersions, useDocumentEditorDocumentById, useDocumentEditorDocumentsInSelectedDrive, useDocumentEditorDocumentsInSelectedFolder, useSelectedDocumentEditorDocument, utils };
@@ -1,6 +1,6 @@
1
- import { t as AppModule } from "../module-pK0hpO6c.js";
2
- import { t as DocumentEditor } from "../module-ryHOwQp-.js";
3
- import { t as ProcessorModule } from "../module-DPyV2vUY.js";
4
- import { t as SubgraphModule } from "../module-x2Liyk0-.js";
5
- import { t as VetraPackage } from "../module-dDKBr6QY.js";
1
+ import { t as AppModule } from "../module-BAE-Cdy6.js";
2
+ import { t as DocumentEditor } from "../module-BSpVJEfF.js";
3
+ import { t as ProcessorModule } from "../module-wcMEGEcg.js";
4
+ import { t as SubgraphModule } from "../module-D8H1Oetz.js";
5
+ import { t as VetraPackage } from "../module-BV5uKc_X.js";
6
6
  export { AppModule as AppModuleV1, DocumentEditor as DocumentEditorV1, ProcessorModule as ProcessorModuleV1, SubgraphModule as SubgraphModuleV1, VetraPackage as VetraPackageV1 };
@@ -1,5 +1,5 @@
1
- import { A as SetProcessorTypeInputSchema, C as AddProcessorAppInputSchema, D as RemoveProcessorAppInputSchema, E as RemoveDocumentTypeInputSchema, M as definedNonNullAnySchema, N as isDefinedNonNullAny, O as SetProcessorNameInputSchema, S as AddDocumentTypeInputSchema, T as ProcessorModuleStateSchema, _ as removeDocumentType, a as ProcessorModuleDocumentSchema, b as setProcessorStatus, c as assertIsProcessorModuleState, d as processorModuleDocumentType, f as reducer, g as creators_exports, h as addProcessorApp, i as ProcessorModuleDocumentHeaderSchema, j as StatusTypeSchema, k as SetProcessorStatusInputSchema, l as isProcessorModuleDocument, m as addDocumentType, n as initialLocalState, o as ProcessorModulePHStateSchema, p as actions, s as assertIsProcessorModuleDocument, t as initialGlobalState, u as isProcessorModuleState, v as removeProcessorApp, w as DocumentTypeItemSchema, x as setProcessorType, y as setProcessorName } from "../../utils-Byjf33qt.js";
2
- import { n as utils, r as documentModel, t as ProcessorModule } from "../../module-DPyV2vUY.js";
3
- import { a as useProcessorModuleDocumentsInSelectedDrive, c as ProcessorModuleController, i as useProcessorModuleDocumentById, n as latestVersion, o as useProcessorModuleDocumentsInSelectedFolder, r as supportedVersions, s as useSelectedProcessorModuleDocument, t as processorModuleUpgradeManifest } from "../../processor-module-B7IAItXQ.js";
4
- import { a as defaultPHState, i as defaultLocalState, n as createState, r as defaultGlobalState, t as createProcessorModuleDocument } from "../../ph-factories-B0_E6LY6.js";
1
+ import { A as SetProcessorTypeInputSchema, C as AddProcessorAppInputSchema, D as RemoveProcessorAppInputSchema, E as RemoveDocumentTypeInputSchema, M as definedNonNullAnySchema, N as isDefinedNonNullAny, O as SetProcessorNameInputSchema, S as AddDocumentTypeInputSchema, T as ProcessorModuleStateSchema, _ as removeDocumentType, a as ProcessorModuleDocumentSchema, b as setProcessorStatus, c as assertIsProcessorModuleState, d as processorModuleDocumentType, f as reducer, g as creators_exports, h as addProcessorApp, i as ProcessorModuleDocumentHeaderSchema, j as StatusTypeSchema, k as SetProcessorStatusInputSchema, l as isProcessorModuleDocument, m as addDocumentType, n as initialLocalState, o as ProcessorModulePHStateSchema, p as actions, s as assertIsProcessorModuleDocument, t as initialGlobalState, u as isProcessorModuleState, v as removeProcessorApp, w as DocumentTypeItemSchema, x as setProcessorType, y as setProcessorName } from "../../utils-CSA5LPj9.js";
2
+ import { n as utils, r as documentModel, t as ProcessorModule } from "../../module-wcMEGEcg.js";
3
+ import { a as useProcessorModuleDocumentsInSelectedDrive, c as ProcessorModuleController, i as useProcessorModuleDocumentById, n as latestVersion, o as useProcessorModuleDocumentsInSelectedFolder, r as supportedVersions, s as useSelectedProcessorModuleDocument, t as processorModuleUpgradeManifest } from "../../processor-module-D7kxj_HT.js";
4
+ import { a as defaultPHState, i as defaultLocalState, n as createState, r as defaultGlobalState, t as createProcessorModuleDocument } from "../../ph-factories-Bep45EPP.js";
5
5
  export { AddDocumentTypeInputSchema, AddProcessorAppInputSchema, DocumentTypeItemSchema, ProcessorModule, ProcessorModuleController, ProcessorModuleDocumentHeaderSchema, ProcessorModuleDocumentSchema, ProcessorModulePHStateSchema, ProcessorModuleStateSchema, RemoveDocumentTypeInputSchema, RemoveProcessorAppInputSchema, SetProcessorNameInputSchema, SetProcessorStatusInputSchema, SetProcessorTypeInputSchema, StatusTypeSchema, actions, addDocumentType, addProcessorApp, assertIsProcessorModuleDocument, assertIsProcessorModuleState, createProcessorModuleDocument, createState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isProcessorModuleDocument, isProcessorModuleState, latestVersion, creators_exports as processorModuleBaseOperationsActions, processorModuleDocumentType, processorModuleUpgradeManifest, reducer, removeDocumentType, removeProcessorApp, setProcessorName, setProcessorStatus, setProcessorType, supportedVersions, useProcessorModuleDocumentById, useProcessorModuleDocumentsInSelectedDrive, useProcessorModuleDocumentsInSelectedFolder, useSelectedProcessorModuleDocument, utils };
@@ -1,5 +1,5 @@
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-CWO5kDus.js";
2
- import { n as utils, r as documentModel, t as SubgraphModule } from "../../module-x2Liyk0-.js";
3
- import { a as useSubgraphModuleDocumentById, c as SubgraphModuleController, i as useSelectedSubgraphModuleDocument, n as latestVersion, o as useSubgraphModuleDocumentsInSelectedDrive, r as supportedVersions, s as useSubgraphModuleDocumentsInSelectedFolder, t as subgraphModuleUpgradeManifest } from "../../subgraph-module-CfzSZTNC.js";
4
- import { a as defaultPHState, i as defaultLocalState, n as createSubgraphModuleDocument, r as defaultGlobalState, t as createState } from "../../ph-factories-Bn_HTUfT.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-DL6w0tV1.js";
2
+ import { n as utils, r as documentModel, t as SubgraphModule } from "../../module-D8H1Oetz.js";
3
+ import { a as useSubgraphModuleDocumentById, c as SubgraphModuleController, i as useSelectedSubgraphModuleDocument, n as latestVersion, o as useSubgraphModuleDocumentsInSelectedDrive, r as supportedVersions, s as useSubgraphModuleDocumentsInSelectedFolder, t as subgraphModuleUpgradeManifest } from "../../subgraph-module-DqsecQjc.js";
4
+ import { a as defaultPHState, i as defaultLocalState, n as createSubgraphModuleDocument, r as defaultGlobalState, t as createState } from "../../ph-factories-D6cQKmns.js";
5
5
  export { SetSubgraphNameInputSchema, SetSubgraphStatusInputSchema, StatusTypeSchema, SubgraphModule, SubgraphModuleController, SubgraphModuleDocumentHeaderSchema, SubgraphModuleDocumentSchema, SubgraphModulePHStateSchema, SubgraphModuleStateSchema, actions, assertIsSubgraphModuleDocument, assertIsSubgraphModuleState, createState, createSubgraphModuleDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isSubgraphModuleDocument, isSubgraphModuleState, latestVersion, reducer, setSubgraphName, setSubgraphStatus, creators_exports as subgraphModuleBaseOperationsActions, subgraphModuleDocumentType, subgraphModuleUpgradeManifest, supportedVersions, useSelectedSubgraphModuleDocument, useSubgraphModuleDocumentById, useSubgraphModuleDocumentsInSelectedDrive, useSubgraphModuleDocumentsInSelectedFolder, utils };
@@ -1,3 +1,3 @@
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-dDKBr6QY.js";
2
- import { a as useVetraPackageDocumentById, c as createState, d as defaultLocalState, f as defaultPHState, i as useSelectedVetraPackageDocument, l as createVetraPackageDocument, n as latestVersion, o as useVetraPackageDocumentsInSelectedDrive, p as VetraPackageController, r as supportedVersions, s as useVetraPackageDocumentsInSelectedFolder, t as vetraPackageUpgradeManifest, u as defaultGlobalState } from "../../vetra-package-BgTjv343.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-BV5uKc_X.js";
2
+ import { a as useVetraPackageDocumentById, c as createState, d as defaultLocalState, f as defaultPHState, i as useSelectedVetraPackageDocument, l as createVetraPackageDocument, n as latestVersion, o as useVetraPackageDocumentsInSelectedDrive, p as VetraPackageController, r as supportedVersions, s as useVetraPackageDocumentsInSelectedFolder, t as vetraPackageUpgradeManifest, u as defaultGlobalState } from "../../vetra-package-C0hmmUZX.js";
3
3
  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,5 +1,5 @@
1
- import { b as setAppStatus, g as addDocumentType, h as setDragAndDropEnabled, v as removeDocumentType, x as setDocumentTypes, y as setAppName } from "./utils-BRx88WW3.js";
2
- import { s as useSelectedAppModuleDocument } from "./app-module-D_cAVvt0.js";
1
+ import { b as setAppStatus, g as addDocumentType, h as setDragAndDropEnabled, v as removeDocumentType, x as setDocumentTypes, y as setAppName } from "./utils-A2M9gfq4.js";
2
+ import { s as useSelectedAppModuleDocument } from "./app-module-CHTbm_9a.js";
3
3
  import { StatusPill } from "./editors/components/index.js";
4
4
  import { t as useDebounce } from "./hooks-Btogj1f0.js";
5
5
  import { useDocumentTypesInSelectedDrive, useSetPHDocumentEditorConfig, useSupportedDocumentTypesInReactor } from "@powerhousedao/reactor-browser";
@@ -25,7 +25,7 @@ const AppEditorForm = () => {
25
25
  if (name === documentName) return;
26
26
  console.log("onNameChange", name);
27
27
  dispatch(setAppName({ name }));
28
- }, [documentName]), 300);
28
+ }, [documentName, dispatch]), 300);
29
29
  const onConfirm = () => {
30
30
  dispatch(setAppStatus({ status: "CONFIRMED" }));
31
31
  };
@@ -196,4 +196,4 @@ function Editor() {
196
196
  //#endregion
197
197
  export { Editor as default };
198
198
 
199
- //# sourceMappingURL=editor-BwbJ65NZ.js.map
199
+ //# sourceMappingURL=editor-Bba0kIIP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-Bba0kIIP.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 { useSelectedAppModuleDocument } from \"../../../document-models/app-module/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useDebounce } from \"../../hooks/index.js\";\n\nconst ALL_IN_DRIVE = \"all-in-drive\";\nconst ALL_IN_REACTOR = \"all-in-reactor\";\nconst ALLOW_ANY = \"allow-any\";\n\nexport const AppEditorForm = () => {\n const [document, dispatch] = useSelectedAppModuleDocument();\n const documentName = document.state.global.name;\n const status = document.state.global.status;\n const isDragAndDropEnabled = document.state.global.isDragAndDropEnabled;\n const allowedDocumentTypes = document.state.global.allowedDocumentTypes;\n const [appName, handleSetAppName] = useState(documentName);\n const [isConfirmed, setIsConfirmed] = useState(status === \"CONFIRMED\");\n const documentTypesInSelectedDrive = useDocumentTypesInSelectedDrive();\n const supportedDocumentTypesInReactor = useSupportedDocumentTypesInReactor();\n const [selectedDocumentTypes, setSelectedDocumentTypes] = useState(\n allowedDocumentTypes ?? [],\n );\n\n // Use the debounce hook for name changes\n\n const onNameChange = useCallback(\n (name: string) => {\n if (name === documentName) return;\n console.log(\"onNameChange\", name);\n dispatch(setAppName({ name }));\n },\n [documentName, dispatch],\n );\n\n useDebounce(appName, onNameChange, 300);\n\n const onConfirm = () => {\n dispatch(setAppStatus({ status: \"CONFIRMED\" }));\n };\n\n const onDragAndDropToggle = (enabled: boolean) => {\n if (enabled === isDragAndDropEnabled) return;\n dispatch(setDragAndDropEnabled({ enabled }));\n };\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (appName.trim()) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm();\n }\n };\n\n const handleAddDocumentType = (documentType: string) => {\n if (!documentType || selectedDocumentTypes.includes(documentType)) return;\n setSelectedDocumentTypes([...selectedDocumentTypes, documentType]);\n dispatch(addDocumentType({ documentType }));\n };\n\n const handleRemoveDocumentType = (documentType: string) => {\n setSelectedDocumentTypes(\n selectedDocumentTypes.filter((dt) => dt !== documentType),\n );\n dispatch(removeDocumentType({ documentType }));\n };\n\n const handleAddAllDocumentTypesInDrive = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(documentTypesInSelectedDrive ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAddAllDocumentTypesInReactor = () => {\n const newDocumentTypes = [\n ...new Set([\n ...selectedDocumentTypes,\n ...(supportedDocumentTypesInReactor ?? []),\n ]),\n ];\n setSelectedDocumentTypes(newDocumentTypes);\n dispatch(setDocumentTypes({ documentTypes: newDocumentTypes }));\n };\n\n const handleAllowAnyDocumentType = () => {\n setSelectedDocumentTypes([]);\n dispatch(setDocumentTypes({ documentTypes: [] }));\n };\n\n const handleDocumentTypeSelection = (selectedValue: string) => {\n if (selectedValue === ALL_IN_DRIVE) {\n handleAddAllDocumentTypesInDrive();\n } else if (selectedValue === ALL_IN_REACTOR) {\n handleAddAllDocumentTypesInReactor();\n } else if (selectedValue === ALLOW_ANY) {\n handleAllowAnyDocumentType();\n } else {\n handleAddDocumentType(selectedValue);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900\">App Configuration</h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* App Name Field */}\n <div>\n <label\n htmlFor=\"app-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\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={`w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\n }`}\n placeholder=\"Enter app name\"\n />\n </div>\n\n {/* Document Types Field */}\n <div>\n <label\n htmlFor=\"document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\n >\n Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <select\n onChange={(e) => handleDocumentTypeSelection(e.target.value)}\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 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-gray-700\">{type}</span>\n {!isReadOnly && (\n <button\n onClick={() => handleRemoveDocumentType(type)}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none\"\n >\n ×\n </button>\n )}\n </div>\n ))\n ) : (\n <span className=\"text-sm text-gray-700\">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-gray-900\">\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={`mr-2 size-4 rounded-sm border-gray-300 text-blue-600 focus:ring-blue-500 ${\n isReadOnly ? \"cursor-not-allowed\" : \"\"\n }`}\n />\n <span className=\"text-sm font-medium text-gray-700\">\n Enable drag and drop\n </span>\n </label>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!appName.trim()}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { AppEditorForm } from \"./components/AppEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n\n return (\n <div className=\"bg-gray-50 p-6\">\n <DocumentToolbar />\n <AppEditorForm />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAiBA,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,YAAY;AAElB,MAAa,sBAAsB;CACjC,MAAM,CAAC,UAAU,YAAY,8BAA8B;CAC3D,MAAM,eAAe,SAAS,MAAM,OAAO;CAC3C,MAAM,SAAS,SAAS,MAAM,OAAO;CACrC,MAAM,uBAAuB,SAAS,MAAM,OAAO;CACnD,MAAM,uBAAuB,SAAS,MAAM,OAAO;CACnD,MAAM,CAAC,SAAS,oBAAoB,SAAS,a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,EACF,oBAAC,QAAD;MAAM,WAAU;gBAAoC;MAE7C,CAAA,CACD;;IACJ,CAAA,CACF,EAAA,CAAA;GAGL,CAAC,cACA,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,QAAQ,MAAM;IACzB,WAAU;cACX;IAEQ,CAAA,EACL,CAAA;GAEJ;;;;;ACjQV,MAAa,eAAuC,EAClD,2BAA2B,OAC5B;;;ACCD,SAAwB,SAAS;AAC/B,8BAA6B,aAAa;AAE1C,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,eAAD,EAAiB,CAAA,CACb"}
@@ -1,4 +1,4 @@
1
- import { g as setSubgraphStatus, h as setSubgraphName } from "./utils-CWO5kDus.js";
1
+ import { g as setSubgraphStatus, h as setSubgraphName } from "./utils-DL6w0tV1.js";
2
2
  import { StatusPill } from "./editors/components/index.js";
3
3
  import { t as useDebounce } from "./hooks-Btogj1f0.js";
4
4
  import { r as useSelectedSubgraphModuleDocument } from "./useVetraDocument-BQKyels4.js";
@@ -87,4 +87,4 @@ function Editor() {
87
87
  //#endregion
88
88
  export { Editor as default };
89
89
 
90
- //# sourceMappingURL=editor-DWufJcmG.js.map
90
+ //# sourceMappingURL=editor-BsM-iHdN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-DWufJcmG.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 { 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/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/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-gray-900\">\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-gray-700\"\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={`w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\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-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300\"\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-gray-50 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":";;;;;;;;;AAWA,MAAa,sBAAyD,EACpE,cAAc,sBAAsB,IACpC,SAAS,SACT,cACA,gBACI;CACJ,MAAM,CAAC,cAAc,mBAAmB,SAAS,oBAAoB;CACrE,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;AAGrD,aAAY,cAAc,cAAc,IAAI;AAG5C,iBAAgB;AAEd,kBAAgB,oBAAoB;IACnC,CAAC,oBAAoB,CAAC;AAGzB,iBAAgB;AACd,MAAI,WAAW,QAEb,gBAAe,MAAM;IA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,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,cAAc,SAAS,MAAM,OAAO,QAAQ;GAC5C,QAAQ,SAAS,MAAM,OAAO;GAChB;GACH;GACX,CAAA,CACE"}
1
+ {"version":3,"file":"editor-BsM-iHdN.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 { 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/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/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-gray-900\">\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-gray-700\"\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={`w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\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-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300\"\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-gray-50 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":";;;;;;;;;AAWA,MAAa,sBAAyD,EACpE,cAAc,sBAAsB,IACpC,SAAS,SACT,cACA,gBACI;CACJ,MAAM,CAAC,cAAc,mBAAmB,SAAS,oBAAoB;CACrE,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;AAGrD,aAAY,cAAc,cAAc,IAAI;AAG5C,iBAAgB;AAEd,kBAAgB,oBAAoB;IACnC,CAAC,oBAAoB,CAAC;AAGzB,iBAAgB;AACd,MAAI,WAAW,QAEb,gBAAe,MAAM;IAEtB,CAAC,OAAO,CAAC;CAGZ,MAAM,aAAa,eAAe,WAAW;CAE7C,MAAM,sBAAsB;AAC1B,MAAI,aAAa,MAAM,EAAE;AACvB,kBAAe,KAAK;AACpB,gBAAa;;;AAIjB,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACE,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,MAAD;KAAI,WAAU;eAAoC;KAE7C,CAAA,EACL,oBAAC,YAAD;KACE,QAAQ,WAAW,cAAc,cAAc;KAC/C,OAAO,WAAW,cAAc,cAAc;KAC9C,CAAA,CACE;;GAGN,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,SAAD;IACE,SAAQ;IACR,WAAU;cACX;IAEO,CAAA,EACR,oBAAC,SAAD;IACE,IAAG;IACH,MAAK;IACL,OAAO;IACP,WAAW,MAAM,gBAAgB,EAAE,OAAO,MAAM;IAChD,UAAU;IACV,WAAW,mIACT,aAAa,mCAAmC;IAElD,aAAY;IACZ,CAAA,CACE,EAAA,CAAA;GAGL,CAAC,cACA,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,aAAa,MAAM;IAC9B,WAAU;cACX;IAEQ,CAAA,EACL,CAAA;GAEJ;;;;;AC1FV,MAAa,eAAuC,EAClD,2BAA2B,OAC5B;;;ACOD,SAAwB,SAAS;AAC/B,8BAA6B,aAAa;CAC1C,MAAM,CAAC,UAAU,YAAY,mCAAmC;CAEhE,MAAM,eAAe,aAClB,SAAiB;AAChB,MAAI,SAAS,SAAS,MAAM,OAAO,KAAM;AACzC,WAAS,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAErC,CAAC,SAAS,MAAM,OAAO,MAAM,SAAS,CACvC;CAED,MAAM,YAAY,kBAAkB;AAClC,WAAS,kBAAkB,EAAE,QAAQ,aAAa,CAAC,CAAC;IACnD,CAAC,SAAS,CAAC;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,cAAc,SAAS,MAAM,OAAO,QAAQ;GAC5C,QAAQ,SAAS,MAAM,OAAO;GAChB;GACH;GACX,CAAA,CACE"}
@@ -1,5 +1,5 @@
1
- import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-CnZc-0E4.js";
2
- import { s as useSelectedDocumentEditorDocument } from "./document-editor-1NFr9t3a.js";
1
+ import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-D3lwZ3L6.js";
2
+ import { s as useSelectedDocumentEditorDocument } from "./document-editor--pHInvi3.js";
3
3
  import { StatusPill } from "./editors/components/index.js";
4
4
  import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Btogj1f0.js";
5
5
  import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
@@ -171,4 +171,4 @@ function Editor() {
171
171
  //#endregion
172
172
  export { Editor as default };
173
173
 
174
- //# sourceMappingURL=editor-CJAn9WTA.js.map
174
+ //# sourceMappingURL=editor-BuV8eJum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-CJAn9WTA.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 type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 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/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\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={`w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\n }`}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\nimport { useSelectedDocumentEditorDocument } from \"../../document-models/document-editor/index.js\";\nimport {\n addDocumentType,\n removeDocumentType,\n setEditorName,\n setEditorStatus,\n type AddDocumentTypeInput,\n type RemoveDocumentTypeInput,\n} from \"../../document-models/document-editor/index.js\";\nimport { DocumentEditorForm } from \"./components/DocumentEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDocumentEditorDocument();\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6\">\n <DocumentToolbar />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,SAAS,qBACP,OACA;AACA,QACE,qBAAC,UAAD;EACE,IAAG;EACH,WAAU;EACV,GAAI;YAHN,CAKE,oBAAC,UAAD;GAAQ,OAAM;aAAG;GAA+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IAAI,cAAc,WAAW;IACzD,WAAU;cACX;IAEQ,CAAA,EACL,CAAA;GAEJ;;;;;ACxNV,MAAa,eAAuC,EAClD,2BAA2B,OAC5B;;;ACWD,SAAwB,SAAS;AAC/B,8BAA6B,aAAa;CAC1C,MAAM,CAAC,UAAU,YAAY,mCAAmC;CAEhE,MAAM,qBAAqB,aACxB,SAAiB;AAChB,MAAI,CAAC,SAAS,MAAM,OAAO,QAAQ,CAAC,KAAM;AAC1C,MAAI,SAAS,SAAS,MAAM,OAAO,KAAM;AAEzC,WAAS,cAAc,EAAE,MAAM,CAAC,CAAC;IAEnC,CAAC,SAAS,MAAM,OAAO,MAAM,SAAS,CACvC;CAED,MAAM,oBAAoB,aACvB,UAAgC;AAC/B,WAAS,gBAAgB,MAAM,CAAC;IAElC,CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,UAAmC;AAClC,WAAS,mBAAmB,MAAM,CAAC;IAErC,CAAC,SAAS,CACX;CAED,MAAM,YAAY,kBAAkB;AAClC,WAAS,gBAAgB,EAAE,QAAQ,aAAa,CAAC,CAAC;IACjD,CAAC,SAAS,CAAC;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,QAAQ,SAAS,MAAM,OAAO;GAC9B,YAAY,SAAS,MAAM,OAAO,QAAQ;GAC1C,eAAe,SAAS,MAAM,OAAO;GACjB;GACD;GACG;GACX;GACX,CAAA,CACE"}
1
+ {"version":3,"file":"editor-BuV8eJum.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 type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 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/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\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={`w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\n }`}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\nimport { useSelectedDocumentEditorDocument } from \"../../document-models/document-editor/index.js\";\nimport {\n addDocumentType,\n removeDocumentType,\n setEditorName,\n setEditorStatus,\n type AddDocumentTypeInput,\n type RemoveDocumentTypeInput,\n} from \"../../document-models/document-editor/index.js\";\nimport { DocumentEditorForm } from \"./components/DocumentEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDocumentEditorDocument();\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6\">\n <DocumentToolbar />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,SAAS,qBACP,OACA;AACA,QACE,qBAAC,UAAD;EACE,IAAG;EACH,WAAU;EACV,GAAI;YAHN,CAKE,oBAAC,UAAD;GAAQ,OAAM;aAAG;GAA+B,CAAA,EAC/C,MAAM,SACA;;;AAIb,SAAS,mBAAmB,EAC1B,eACA,kBACA,mBACA,wBAMC;CAED,MAAM,yBAAyB,0BAA0B,KAAK;CAC9D,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;AAEpE,QACE,oBAAC,sBAAD;EACE,OAAO;EACP,WAAW,MAAM;GACf,MAAM,gBAAgB,EAAE,OAAO;AAC/B,OAAI,eAAe;IAGjB,MAAM,eAAe,eAAe,GAA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AI,SAAS,SAAS,MAAM,OAAO,KAAM;AAEzC,WAAS,cAAc,EAAE,MAAM,CAAC,CAAC;IAEnC,CAAC,SAAS,MAAM,OAAO,MAAM,SAAS,CACvC;CAED,MAAM,oBAAoB,aACvB,UAAgC;AAC/B,WAAS,gBAAgB,MAAM,CAAC;IAElC,CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,UAAmC;AAClC,WAAS,mBAAmB,MAAM,CAAC;IAErC,CAAC,SAAS,CACX;CAED,MAAM,YAAY,kBAAkB;AAClC,WAAS,gBAAgB,EAAE,QAAQ,aAAa,CAAC,CAAC;IACjD,CAAC,SAAS,CAAC;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,QAAQ,SAAS,MAAM,OAAO;GAC9B,YAAY,SAAS,MAAM,OAAO,QAAQ;GAC1C,eAAe,SAAS,MAAM,OAAO;GACjB;GACD;GACG;GACX;GACX,CAAA,CACE"}
@@ -1,4 +1,4 @@
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-dDKBr6QY.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-BV5uKc_X.js";
2
2
  import { t as useDebounce } from "./hooks-Btogj1f0.js";
3
3
  import { t as useSelectedDriveVetraPackage } from "./useVetraDocument-BQKyels4.js";
4
4
  import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
@@ -241,43 +241,43 @@ function Editor(props) {
241
241
  if (!document.state.global.name && !name) return;
242
242
  if (name === document.state.global.name) return;
243
243
  dispatch(setPackageName({ name }));
244
- }, [document.state.global.name]);
244
+ }, [document.state.global.name, dispatch]);
245
245
  const onDescriptionChange = useCallback((description) => {
246
246
  if (!document.state.global.description && !description) return;
247
247
  if (description === document.state.global.description) return;
248
248
  dispatch(setPackageDescription({ description }));
249
- }, [document.state.global.description]);
249
+ }, [document.state.global.description, dispatch]);
250
250
  const onCategoryChange = useCallback((category) => {
251
251
  if (!document.state.global.category && !category) return;
252
252
  if (category === document.state.global.category) return;
253
253
  dispatch(setPackageCategory({ category }));
254
- }, [document.state.global.category]);
254
+ }, [document.state.global.category, dispatch]);
255
255
  const onPublisherChange = useCallback((name) => {
256
256
  if (!document.state.global.author.name && !name) return;
257
257
  if (name === document.state.global.author.name) return;
258
258
  dispatch(setPackageAuthorName({ name }));
259
- }, [document.state.global.author.name]);
259
+ }, [document.state.global.author.name, dispatch]);
260
260
  const onPublisherUrlChange = useCallback((website) => {
261
261
  if (!document.state.global.author.website && !website) return;
262
262
  if (website === document.state.global.author.website) return;
263
263
  dispatch(setPackageAuthorWebsite({ website }));
264
- }, [document.state.global.author.website]);
264
+ }, [document.state.global.author.website, dispatch]);
265
265
  const onGithubRepositoryChange = useCallback((url) => {
266
266
  if (!document.state.global.githubUrl && !url) return;
267
267
  if (url === document.state.global.githubUrl) return;
268
268
  dispatch(setPackageGithubUrl({ url }));
269
- }, [document.state.global.githubUrl]);
269
+ }, [document.state.global.githubUrl, dispatch]);
270
270
  const onNpmPackageChange = useCallback((url) => {
271
271
  if (!document.state.global.npmUrl && !url) return;
272
272
  if (url === document.state.global.npmUrl) return;
273
273
  dispatch(setPackageNpmUrl({ url }));
274
- }, [document.state.global.npmUrl]);
274
+ }, [document.state.global.npmUrl, dispatch]);
275
275
  const onAddKeyword = useCallback((keyword) => {
276
276
  dispatch(addPackageKeyword(keyword));
277
- }, []);
277
+ }, [dispatch]);
278
278
  const onRemoveKeyword = useCallback((id) => {
279
279
  dispatch(removePackageKeyword({ id }));
280
- }, []);
280
+ }, [dispatch]);
281
281
  return /* @__PURE__ */ jsxs("div", {
282
282
  className: "bg-gray-50 p-6",
283
283
  children: [displayToolbar && /* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(MetaForm, {
@@ -304,4 +304,4 @@ function Editor(props) {
304
304
  //#endregion
305
305
  export { Editor as default };
306
306
 
307
- //# sourceMappingURL=editor-DabfMxkF.js.map
307
+ //# sourceMappingURL=editor-CsLmxkXj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-DabfMxkF.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 { useDebounce } from \"../../hooks/index.js\";\nimport type { Keyword } from \"../../../document-models/vetra-package/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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n />\n <div className=\"flex min-h-[80px] flex-wrap gap-2 rounded-md border border-gray-300 p-3\">\n {keywords.map((keyword) => (\n <span\n key={keyword.id}\n className=\"inline-flex items-center rounded-sm border border-blue-300 bg-blue-100 px-2 py-0.5 text-xs text-blue-800\"\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-blue-600 hover:text-blue-800 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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\n >\n Version\n </label>\n <input\n id=\"package-version\"\n type=\"text\"\n placeholder=\"1.0.0-dev\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500\"\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-gray-700\"\n >\n License\n </label>\n <input\n id=\"package-license\"\n type=\"text\"\n placeholder=\"AGPL-3.0-only\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500\"\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-gray-700\"\n >\n Install with:\n </label>\n <input\n id=\"package-install\"\n type=\"text\"\n placeholder=\"@powerhousedao/todo-demo-package\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500\"\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],\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],\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],\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],\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],\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],\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],\n );\n\n const onAddKeyword = useCallback((keyword: { id: string; label: string }) => {\n dispatch(addPackageKeyword(keyword));\n }, []);\n\n const onRemoveKeyword = useCallback((id: string) => {\n dispatch(removePackageKeyword({ id }));\n }, []);\n\n return (\n <div className=\"bg-gray-50 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;CAC7C,MAAM,CAAC,aAAa,kBAAkB,SAAS,mBAAmB;CAClE,MAAM,CAAC,UAAU,eAAe,SAAS,gBAAgB;CACzD,MAAM,CAAC,WAAW,gBAAgB,SAAS,iBAAiB;CAC5D,MAAM,CAAC,cAAc,mBAAmB,SAAS,oBAAoB;CACrE,MAAM,CAAC,kBAAkB,uBAAuB,SAC9C,wBACD;CACD,MAAM,CAAC,YAAY,iBAAiB,SAAS,kBAAkB;CAG/D,MAAM,CAAC,UAAU,eAAe,SAAoB,gBAAgB;CACpE,MAAM,CAAC,cAAc,mBAAmB,SAAS,GAAG;AAGpD,aAAY,MAAM,cAAc,IAAI;AACpC,aAAY,aAAa,qBAAqB,IAAI;AAClD,aAAY,WAAW,mBAAmB,IAAI;AAC9C,aAAY,cAAc,sBAAsB,IAAI;AACpD,aAAY,kBAAkB,0BAA0B,IAAI;AAC5D,aAAY,YAAY,oBAAoB,IAAI;AAEhD,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GAEE,qBAAC,OAAD;IAAK,WAAU;cAAf,CAEE,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,SAAD;KACE,SAAQ;KACR,WAAU;eACX;KAEO,CAAA,EACR,oBAAC,SAAD;KACE,IAAG;KACH,MAAK;KACL,OAAO;KACP,WAAW,MAAM,QAAQ,EAAE,OAAO,MAAM;KACxC,WAAU;KACV,CAAA,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AAK;AAC3C,MAAI,QAAQ,SAAS,MAAM,OAAO,OAAQ;AAE1C,WAAS,iBAAiB,EAAE,KAAK,CAAC,CAAC;IAErC,CAAC,SAAS,MAAM,OAAO,OAAO,CAC/B;CAED,MAAM,eAAe,aAAa,YAA2C;AAC3E,WAAS,kBAAkB,QAAQ,CAAC;IACnC,EAAE,CAAC;CAEN,MAAM,kBAAkB,aAAa,OAAe;AAClD,WAAS,qBAAqB,EAAE,IAAI,CAAC,CAAC;IACrC,EAAE,CAAC;AAEN,QACE,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-CsLmxkXj.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 { useDebounce } from \"../../hooks/index.js\";\nimport type { Keyword } from \"../../../document-models/vetra-package/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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n />\n <div className=\"flex min-h-[80px] flex-wrap gap-2 rounded-md border border-gray-300 p-3\">\n {keywords.map((keyword) => (\n <span\n key={keyword.id}\n className=\"inline-flex items-center rounded-sm border border-blue-300 bg-blue-100 px-2 py-0.5 text-xs text-blue-800\"\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-blue-600 hover:text-blue-800 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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\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-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\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-gray-700\"\n >\n Version\n </label>\n <input\n id=\"package-version\"\n type=\"text\"\n placeholder=\"1.0.0-dev\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500\"\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-gray-700\"\n >\n License\n </label>\n <input\n id=\"package-license\"\n type=\"text\"\n placeholder=\"AGPL-3.0-only\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500\"\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-gray-700\"\n >\n Install with:\n </label>\n <input\n id=\"package-install\"\n type=\"text\"\n placeholder=\"@powerhousedao/todo-demo-package\"\n readOnly\n className=\"w-full cursor-not-allowed rounded-md border border-gray-300 bg-gray-50 px-3 py-2 text-gray-500\"\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-gray-50 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;CAC7C,MAAM,CAAC,aAAa,kBAAkB,SAAS,mBAAmB;CAClE,MAAM,CAAC,UAAU,eAAe,SAAS,gBAAgB;CACzD,MAAM,CAAC,WAAW,gBAAgB,SAAS,iBAAiB;CAC5D,MAAM,CAAC,cAAc,mBAAmB,SAAS,oBAAoB;CACrE,MAAM,CAAC,kBAAkB,uBAAuB,SAC9C,wBACD;CACD,MAAM,CAAC,YAAY,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c,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,4 +1,4 @@
1
- import { _ as removeDocumentType, b as setProcessorStatus, h as addProcessorApp, m as addDocumentType, v as removeProcessorApp, x as setProcessorType, y as setProcessorName } from "./utils-Byjf33qt.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-CSA5LPj9.js";
2
2
  import { StatusPill } from "./editors/components/index.js";
3
3
  import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Btogj1f0.js";
4
4
  import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-BQKyels4.js";
@@ -239,4 +239,4 @@ function Editor() {
239
239
  //#endregion
240
240
  export { Editor as default };
241
241
 
242
- //# sourceMappingURL=editor-WWMGVelM.js.map
242
+ //# sourceMappingURL=editor-D-IzvjvS.js.map