@powerhousedao/vetra 6.2.3-dev.10 → 6.2.3-dev.101

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 (171) hide show
  1. package/dist/codegen/index.d.ts +30 -19
  2. package/dist/codegen/index.d.ts.map +1 -1
  3. package/dist/codegen/index.js +39 -34
  4. package/dist/codegen/index.js.map +1 -1
  5. package/dist/codegen/spec.d.ts +3 -2
  6. package/dist/codegen/spec.js +1 -1
  7. package/dist/{connect-qpJ9OUaH.js → connect-EqImHuZ2.js} +1 -1
  8. package/dist/{connect-qpJ9OUaH.js.map → connect-EqImHuZ2.js.map} +1 -1
  9. package/dist/document-models/app-module/index.d.ts +4 -12
  10. package/dist/document-models/app-module/index.js +4 -4
  11. package/dist/document-models/app-module/index.js.map +1 -1
  12. package/dist/document-models/document-editor/index.d.ts +4 -12
  13. package/dist/document-models/document-editor/index.js +4 -4
  14. package/dist/document-models/document-editor/index.js.map +1 -1
  15. package/dist/document-models/index.d.ts +7 -6
  16. package/dist/document-models/index.js +5 -5
  17. package/dist/document-models/processor-module/index.d.ts +4 -12
  18. package/dist/document-models/processor-module/index.js +5 -5
  19. package/dist/document-models/processor-module/index.js.map +1 -1
  20. package/dist/document-models/subgraph-module/index.d.ts +4 -12
  21. package/dist/document-models/subgraph-module/index.js +4 -4
  22. package/dist/document-models/subgraph-module/index.js.map +1 -1
  23. package/dist/document-models/vetra-package/index.d.ts +4 -12
  24. package/dist/document-models/vetra-package/index.js +3 -3
  25. package/dist/{editor-_0gdltOt.js → editor-BDR7IYJG.js} +5 -7
  26. package/dist/editor-BDR7IYJG.js.map +1 -0
  27. package/dist/{editor-CLbvu3pG.js → editor-CbT_8Z6A.js} +6 -8
  28. package/dist/editor-CbT_8Z6A.js.map +1 -0
  29. package/dist/{editor-CCdg1mJL.js → editor-CnfajXGg.js} +5 -7
  30. package/dist/{editor-CCdg1mJL.js.map → editor-CnfajXGg.js.map} +1 -1
  31. package/dist/{editor-Fgw7attg.js → editor-Cnk0M044.js} +70 -51
  32. package/dist/editor-Cnk0M044.js.map +1 -0
  33. package/dist/{editor-LRAwrgdQ.js → editor-D5SIbFn_.js} +10 -9
  34. package/dist/editor-D5SIbFn_.js.map +1 -0
  35. package/dist/{editor-C13SvgUy.js → editor-SJk7cr6k.js} +5 -7
  36. package/dist/editor-SJk7cr6k.js.map +1 -0
  37. package/dist/editors/components/index.d.ts +3 -3
  38. package/dist/editors/components/index.d.ts.map +1 -1
  39. package/dist/editors/components/index.js.map +1 -1
  40. package/dist/editors/hooks/index.d.ts +3 -3
  41. package/dist/editors/hooks/index.d.ts.map +1 -1
  42. package/dist/editors/hooks/index.js +1 -1
  43. package/dist/editors/index.d.ts +18 -8
  44. package/dist/editors/index.d.ts.map +1 -1
  45. package/dist/editors/index.js +1 -1
  46. package/dist/{factory-5eiZohiv.js → factory-BUuO4fIN.js} +12 -4
  47. package/dist/factory-BUuO4fIN.js.map +1 -0
  48. package/dist/{factory-DMl8eB3P.js → factory-GIkoxPdL.js} +16 -12
  49. package/dist/factory-GIkoxPdL.js.map +1 -0
  50. package/dist/{hooks-BIgFcbaF.js → hooks-BbxvC-C3.js} +2 -2
  51. package/dist/{hooks-BIgFcbaF.js.map → hooks-BbxvC-C3.js.map} +1 -1
  52. package/dist/index-BwHVZmO6.d.ts +43 -0
  53. package/dist/index-BwHVZmO6.d.ts.map +1 -0
  54. package/dist/{index-Dm_gN1DR.d.ts → index-C56rbYzd.d.ts} +27 -59
  55. package/dist/index-C56rbYzd.d.ts.map +1 -0
  56. package/dist/index-CDV0nUS6.d.ts +36 -0
  57. package/dist/index-CDV0nUS6.d.ts.map +1 -0
  58. package/dist/{index-f_um1g-i.d.ts → index-ChQj71kz.d.ts} +27 -62
  59. package/dist/index-ChQj71kz.d.ts.map +1 -0
  60. package/dist/index-CiPX7twW.d.ts +34 -0
  61. package/dist/index-CiPX7twW.d.ts.map +1 -0
  62. package/dist/{index-SB-AtQdU.d.ts → index-CqDvbSe4.d.ts} +31 -64
  63. package/dist/index-CqDvbSe4.d.ts.map +1 -0
  64. package/dist/index-DGhkn3As.d.ts +40 -0
  65. package/dist/index-DGhkn3As.d.ts.map +1 -0
  66. package/dist/index-DoopUfIG.d.ts +32 -0
  67. package/dist/index-DoopUfIG.d.ts.map +1 -0
  68. package/dist/{index-B5ijieNt.d.ts → index-RAhSmsFD.d.ts} +22 -55
  69. package/dist/index-RAhSmsFD.d.ts.map +1 -0
  70. package/dist/index.d.ts +56 -93
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +84 -12
  73. package/dist/index.js.map +1 -1
  74. package/dist/{logger-WHD0fyLm.js → logger-BFxMdimR.js} +1 -1
  75. package/dist/{logger-WHD0fyLm.js.map → logger-BFxMdimR.js.map} +1 -1
  76. package/dist/{module-CRq_lUkG.js → module-23VayWKe.js} +9 -9
  77. package/dist/module-23VayWKe.js.map +1 -0
  78. package/dist/{module-Chqkdq4U.js → module-2JZcvfVs.js} +3 -3
  79. package/dist/{module-Chqkdq4U.js.map → module-2JZcvfVs.js.map} +1 -1
  80. package/dist/{module-DXT-FMxU.js → module-B6S4QGOx.js} +7 -7
  81. package/dist/module-B6S4QGOx.js.map +1 -0
  82. package/dist/{module-bKT_e3CH.js → module-BktWa0rB.js} +11 -9
  83. package/dist/module-BktWa0rB.js.map +1 -0
  84. package/dist/{module-ciAK1LUC.d.ts → module-C-jL7yqs.d.ts} +38 -70
  85. package/dist/module-C-jL7yqs.d.ts.map +1 -0
  86. package/dist/{module-CRfHlbnq.js → module-FXJRy_1W.js} +2 -2
  87. package/dist/{module-CRfHlbnq.js.map → module-FXJRy_1W.js.map} +1 -1
  88. package/dist/{module-Bx1OEHxF.js → module-hLzF5tCL.js} +3 -3
  89. package/dist/{module-Bx1OEHxF.js.map → module-hLzF5tCL.js.map} +1 -1
  90. package/dist/{ph-factories-CjbIAMgT.js → ph-factories-Bgnr3mK3.js} +2 -2
  91. package/dist/{ph-factories-CjbIAMgT.js.map → ph-factories-Bgnr3mK3.js.map} +1 -1
  92. package/dist/{ph-factories-Ce8oAqs9.js → ph-factories-CgoFCmG0.js} +2 -2
  93. package/dist/{ph-factories-Ce8oAqs9.js.map → ph-factories-CgoFCmG0.js.map} +1 -1
  94. package/dist/{ph-factories-dVj6mIlR.js → ph-factories-DhLtvC7j.js} +2 -2
  95. package/dist/{ph-factories-dVj6mIlR.js.map → ph-factories-DhLtvC7j.js.map} +1 -1
  96. package/dist/{ph-factories-CljTAAVS.js → ph-factories-fEke-Nr8.js} +2 -2
  97. package/dist/{ph-factories-CljTAAVS.js.map → ph-factories-fEke-Nr8.js.map} +1 -1
  98. package/dist/powerhouse.manifest.json +76 -0
  99. package/dist/{processor-trJFuoHh.js → processor-Cb2shrDB.js} +436 -328
  100. package/dist/processor-Cb2shrDB.js.map +1 -0
  101. package/dist/processors/codegen/index.d.ts +14 -6
  102. package/dist/processors/codegen/index.d.ts.map +1 -1
  103. package/dist/processors/codegen/index.js +2 -2
  104. package/dist/processors/index.d.ts +2 -3
  105. package/dist/processors/index.d.ts.map +1 -1
  106. package/dist/processors/index.js +1 -1
  107. package/dist/processors/index.js.map +1 -1
  108. package/dist/processors/vetra-read-model/index.d.ts +47 -49
  109. package/dist/processors/vetra-read-model/index.d.ts.map +1 -1
  110. package/dist/processors/vetra-read-model/index.js +1 -1
  111. package/dist/{spec-api-DobY5TUJ.js → spec-api-BGj7gcQn.js} +24 -18
  112. package/dist/{spec-api-DobY5TUJ.js.map → spec-api-BGj7gcQn.js.map} +1 -1
  113. package/dist/{specs-BeVdfCwg.d.ts → specs-DoTSfuxN.d.ts} +7 -4
  114. package/dist/specs-DoTSfuxN.d.ts.map +1 -0
  115. package/dist/subgraph-type-lint-Dr8Wu0VB.js +94 -0
  116. package/dist/subgraph-type-lint-Dr8Wu0VB.js.map +1 -0
  117. package/dist/switchboard-DUSh_ScZ.js +8 -0
  118. package/dist/{switchboard-Bf0uvxSu.js.map → switchboard-DUSh_ScZ.js.map} +1 -1
  119. package/dist/{upgrade-manifest-OlS1ALVv.js → upgrade-manifest-BOZ5nmyK.js} +1 -1
  120. package/dist/{upgrade-manifest-OlS1ALVv.js.map → upgrade-manifest-BOZ5nmyK.js.map} +1 -1
  121. package/dist/{upgrade-manifest-BGuy0v65.js → upgrade-manifest-D7xKGmZc.js} +1 -1
  122. package/dist/{upgrade-manifest-BGuy0v65.js.map → upgrade-manifest-D7xKGmZc.js.map} +1 -1
  123. package/dist/{upgrade-manifest-Ck3Mgwhc.js → upgrade-manifest-DLxSL23q.js} +1 -1
  124. package/dist/{upgrade-manifest-Ck3Mgwhc.js.map → upgrade-manifest-DLxSL23q.js.map} +1 -1
  125. package/dist/{upgrade-manifest-XdOLymuP.js → upgrade-manifest-Dv62Cod7.js} +1 -1
  126. package/dist/{upgrade-manifest-XdOLymuP.js.map → upgrade-manifest-Dv62Cod7.js.map} +1 -1
  127. package/dist/{upgrade-manifest-NaS4SWk9.js → upgrade-manifest-d3LquK-H.js} +1 -1
  128. package/dist/{upgrade-manifest-NaS4SWk9.js.map → upgrade-manifest-d3LquK-H.js.map} +1 -1
  129. package/dist/{utils-DXCsvCXL.js → utils-876N1Sph.js} +2 -2
  130. package/dist/{utils-DXCsvCXL.js.map → utils-876N1Sph.js.map} +1 -1
  131. package/dist/{utils-CkxGmQ2_.js → utils-Al_SGg2a.js} +2 -2
  132. package/dist/{utils-CkxGmQ2_.js.map → utils-Al_SGg2a.js.map} +1 -1
  133. package/dist/{utils-DmOIDVQo.js → utils-BJk4_43W.js} +24 -4
  134. package/dist/utils-BJk4_43W.js.map +1 -0
  135. package/dist/{utils-B4KdjDnp.js → utils-COP7hJ-K.js} +2 -2
  136. package/dist/{utils-B4KdjDnp.js.map → utils-COP7hJ-K.js.map} +1 -1
  137. package/dist/{vetra-package-Bl6TC4wx.js → vetra-package-DSyRtkdJ.js} +2 -2
  138. package/dist/{vetra-package-Bl6TC4wx.js.map → vetra-package-DSyRtkdJ.js.map} +1 -1
  139. package/package.json +17 -14
  140. package/style.css +2 -0
  141. package/dist/document-models/app-module/index.d.ts.map +0 -1
  142. package/dist/document-models/document-editor/index.d.ts.map +0 -1
  143. package/dist/document-models/processor-module/index.d.ts.map +0 -1
  144. package/dist/document-models/subgraph-module/index.d.ts.map +0 -1
  145. package/dist/document-models/vetra-package/index.d.ts.map +0 -1
  146. package/dist/editor-C13SvgUy.js.map +0 -1
  147. package/dist/editor-CLbvu3pG.js.map +0 -1
  148. package/dist/editor-Fgw7attg.js.map +0 -1
  149. package/dist/editor-LRAwrgdQ.js.map +0 -1
  150. package/dist/editor-_0gdltOt.js.map +0 -1
  151. package/dist/factory-5eiZohiv.js.map +0 -1
  152. package/dist/factory-DMl8eB3P.js.map +0 -1
  153. package/dist/index-B5ijieNt.d.ts.map +0 -1
  154. package/dist/index-Dm_gN1DR.d.ts.map +0 -1
  155. package/dist/index-SB-AtQdU.d.ts.map +0 -1
  156. package/dist/index-f_um1g-i.d.ts.map +0 -1
  157. package/dist/module-CRq_lUkG.js.map +0 -1
  158. package/dist/module-DXT-FMxU.js.map +0 -1
  159. package/dist/module-bKT_e3CH.js.map +0 -1
  160. package/dist/module-ciAK1LUC.d.ts.map +0 -1
  161. package/dist/powerhouse.manifest.d.ts +0 -34
  162. package/dist/powerhouse.manifest.d.ts.map +0 -1
  163. package/dist/powerhouse.manifest.js +0 -86
  164. package/dist/powerhouse.manifest.js.map +0 -1
  165. package/dist/processor-trJFuoHh.js.map +0 -1
  166. package/dist/specs-BeVdfCwg.d.ts.map +0 -1
  167. package/dist/switchboard-Bf0uvxSu.js +0 -8
  168. package/dist/useVetraDocument-BlLdlhrQ.js +0 -30
  169. package/dist/useVetraDocument-BlLdlhrQ.js.map +0 -1
  170. package/dist/utils-DmOIDVQo.js.map +0 -1
  171. /package/dist/{chunk-pbuEa-1d.js → rolldown-runtime-D7D4PA-g.js} +0 -0
@@ -1,7 +1,6 @@
1
- import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-DXCsvCXL.js";
2
- import { useSelectedDocumentEditorDocument } from "./document-models/document-editor/index.js";
1
+ import { _ as setEditorName, g as removeDocumentType, m as addDocumentType, v as setEditorStatus } from "./utils-876N1Sph.js";
3
2
  import { StatusPill } from "./editors/components/index.js";
4
- import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-BIgFcbaF.js";
3
+ import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-BbxvC-C3.js";
5
4
  import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
6
5
  import { Suspense, useCallback, useEffect, useState } from "react";
7
6
  import { twMerge } from "tailwind-merge";
@@ -139,9 +138,8 @@ const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes:
139
138
  const editorConfig = { isExternalControlsEnabled: false };
140
139
  //#endregion
141
140
  //#region editors/document-editor/editor.tsx
142
- function Editor() {
141
+ function Editor({ document, dispatch }) {
143
142
  useSetPHDocumentEditorConfig(editorConfig);
144
- const [document, dispatch] = useSelectedDocumentEditorDocument();
145
143
  const onEditorNameChange = useCallback((name) => {
146
144
  if (!document.state.global.name && !name) return;
147
145
  if (name === document.state.global.name) return;
@@ -158,7 +156,7 @@ function Editor() {
158
156
  }, [dispatch]);
159
157
  return /* @__PURE__ */ jsxs("div", {
160
158
  className: "bg-background p-6",
161
- children: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx(DocumentEditorForm, {
159
+ children: [/* @__PURE__ */ jsx(DocumentToolbar, { document }), /* @__PURE__ */ jsx(DocumentEditorForm, {
162
160
  status: document.state.global.status,
163
161
  editorName: document.state.global.name ?? "",
164
162
  documentTypes: document.state.global.documentTypes,
@@ -172,4 +170,4 @@ function Editor() {
172
170
  //#endregion
173
171
  export { Editor as default };
174
172
 
175
- //# sourceMappingURL=editor-C13SvgUy.js.map
173
+ //# sourceMappingURL=editor-SJk7cr6k.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-SJk7cr6k.js","names":[],"sources":["../editors/document-editor/components/DocumentEditorForm.tsx","../editors/document-editor/config.ts","../editors/document-editor/editor.tsx"],"sourcesContent":["import { Suspense, useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-border px-3 py-2 text-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none\"\n {...props}\n >\n <option value=\"\">Select a document type</option>\n {props.children}\n </select>\n );\n}\n\nfunction DocumentTypeSelect({\n documentTypes,\n setDocumentTypes,\n onAddDocumentType,\n onRemoveDocumentType,\n}: {\n setDocumentTypes: (documentTypes: DocumentTypeItem[]) => void;\n} & Pick<\n DocumentEditorFormProps,\n \"documentTypes\" | \"onAddDocumentType\" | \"onRemoveDocumentType\"\n>) {\n // Get available document types from the hook (vetra drive only for document editor)\n const availableDocumentTypes = useAvailableDocumentTypes(true);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\n return (\n <DocumentTypeSelectUI\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (selectedValue) {\n // Remove existing document type if any\n\n const existingType = documentTypes?.at(0);\n if (existingType) {\n onRemoveDocumentType?.({ id: existingType.id });\n }\n\n // Add the new document type\n const newTypeInput: AddDocumentTypeInput = {\n id: Date.now().toString(), // Generate a unique ID\n documentType: selectedValue,\n };\n const newType: DocumentTypeItem = {\n id: newTypeInput.id,\n documentType: newTypeInput.documentType,\n };\n setDocumentTypes([newType]); // Replace with single item array\n onAddDocumentType?.(newTypeInput);\n }\n setSelectedDocumentType(\"\");\n }}\n >\n {availableDocumentTypes.map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </DocumentTypeSelectUI>\n );\n}\n\nexport const DocumentEditorForm: React.FC<DocumentEditorFormProps> = ({\n editorName: initialEditorName = \"\",\n documentTypes: initialDocumentTypes = [],\n status = \"DRAFT\",\n onEditorNameChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onConfirm,\n}) => {\n const [editorName, setEditorName] = useState(initialEditorName);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(editorName, onEditorNameChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-foreground\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Editor Name\n </label>\n <input\n id=\"editor-name\"\n type=\"text\"\n value={editorName}\n onChange={(e) => setEditorName(e.target.value)}\n disabled={isReadOnly}\n className={twMerge(\n \"w-full rounded-md border border-border px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-transparent focus:ring-2 focus:ring-ring focus:outline-none disabled:disabled-effect\",\n isReadOnly ? \"cursor-not-allowed bg-muted\" : \"\",\n )}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-foreground\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-muted-foreground hover:hover-effect focus:outline-none\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-primary px-4 py-2 text-primary-foreground hover:hover-effect focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none disabled:disabled-effect\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport type { EditorProps } from \"@powerhousedao/shared/document-model\";\nimport type {\n DocumentEditorAction,\n DocumentEditorDocument,\n} from \"../../document-models/document-editor/index.js\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\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 document,\n dispatch,\n}: EditorProps<DocumentEditorDocument, DocumentEditorAction>) {\n useSetPHDocumentEditorConfig(editorConfig);\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-background p-6\">\n <DocumentToolbar document={document} />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,SAAS,qBACP,OACA;CACA,OACE,qBAAC,UAAD;EACE,IAA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/components/StatusPill.d.ts
2
- interface StatusPillProps {
2
+ export interface StatusPillProps {
3
3
  status: "draft" | "confirmed";
4
4
  label: string;
5
5
  }
6
- declare const StatusPill: React.FC<StatusPillProps>;
6
+ export declare const StatusPill: React.FC<StatusPillProps>;
7
7
  //#endregion
8
- export { StatusPill, StatusPillProps };
8
+ export {};
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"mappings":";UAEiB,eAAA;EACf,MAAA;EACA,KAAA;AAAA;AAAA,cAGW,UAAA,EAAY,KAAA,CAAM,EAAA,CAAG,eAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"mappings":";iBAEiB;EACf;EACA;;qBAGW,YAAY,MAAM,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"sourcesContent":["import { twMerge } from \"tailwind-merge\";\n\nexport interface StatusPillProps {\n status: \"draft\" | \"confirmed\";\n label: string;\n}\n\nexport const StatusPill: React.FC<StatusPillProps> = ({ status, label }) => {\n return (\n <div\n className={twMerge(\n \"rounded-full px-3 py-1 text-xs font-medium\",\n status === \"confirmed\"\n ? \"bg-success/10 text-success\"\n : \"bg-warning/10 text-warning\",\n )}\n >\n {label}\n </div>\n );\n};\n"],"mappings":";;;AAOA,MAAa,cAAyC,EAAE,QAAQ,YAAY;AAC1E,QACE,oBAAC,OAAD;EACE,WAAW,QACT,8CACA,WAAW,cACP,+BACA,6BACL;YAEA;EACG,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"sourcesContent":["import { twMerge } from \"tailwind-merge\";\n\nexport interface StatusPillProps {\n status: \"draft\" | \"confirmed\";\n label: string;\n}\n\nexport const StatusPill: React.FC<StatusPillProps> = ({ status, label }) => {\n return (\n <div\n className={twMerge(\n \"rounded-full px-3 py-1 text-xs font-medium\",\n status === \"confirmed\"\n ? \"bg-success/10 text-success\"\n : \"bg-warning/10 text-warning\",\n )}\n >\n {label}\n </div>\n );\n};\n"],"mappings":";;;AAOA,MAAa,cAAyC,EAAE,QAAQ,YAAY;CAC1E,OACE,oBAAC,OAAD;EACE,WAAW,QACT,8CACA,WAAW,cACP,+BACA,4BACN;EAEC,UAAA;CACE,CAAA;AAET"}
@@ -1,5 +1,5 @@
1
1
  //#region editors/hooks/useAvailableDocumentTypes.d.ts
2
- declare function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments?: boolean): string[];
2
+ export declare function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments?: boolean): string[];
3
3
  //#endregion
4
4
  //#region editors/hooks/useDebounce.d.ts
5
5
  /**
@@ -10,7 +10,7 @@ declare function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments?:
10
10
  * @param callback - Function to call with the debounced value (optional)
11
11
  * @param delay - Delay in milliseconds
12
12
  */
13
- declare function useDebounce<T>(value: T, callback: ((value: T) => void) | undefined, delay: number): void;
13
+ export declare function useDebounce<T>(value: T, callback: ((value: T) => void) | undefined, delay: number): void;
14
14
  //#endregion
15
- export { useAvailableDocumentTypes, useDebounce };
15
+ export {};
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/hooks/useAvailableDocumentTypes.ts","../../../editors/hooks/useDebounce.ts"],"mappings":";iBAegB,yBAAA,CACd,mCAAA;;;;AADF;;;;;;;iBCLgB,WAAA,GAAA,CACd,KAAA,EAAO,CAAA,EACP,QAAA,IAAY,KAAA,EAAO,CAAA,wBACnB,KAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/hooks/useAvailableDocumentTypes.ts","../../../editors/hooks/useDebounce.ts"],"mappings":";wBAegB,0BACd;;;;;;;;;;;wBCNc,YAAY,GAC1B,OAAO,GACP,YAAY,OAAO,yBACnB"}
@@ -1,2 +1,2 @@
1
- import { n as useAvailableDocumentTypes, t as useDebounce } from "../../hooks-BIgFcbaF.js";
1
+ import { n as useAvailableDocumentTypes, t as useDebounce } from "../../hooks-BbxvC-C3.js";
2
2
  export { useAvailableDocumentTypes, useDebounce };
@@ -1,28 +1,38 @@
1
+ import { $ as AppModuleDocument, W as AppModuleAction } from "../index-ChQj71kz.js";
2
+ import "../index-CDV0nUS6.js";
3
+ import { G as DocumentEditorDocument, z as DocumentEditorAction } from "../index-C56rbYzd.js";
4
+ import "../index-CiPX7twW.js";
5
+ import { G as ProcessorModuleAction, et as ProcessorModuleDocument } from "../index-CqDvbSe4.js";
6
+ import "../index-BwHVZmO6.js";
7
+ import { P as SubgraphModuleAction, R as SubgraphModuleDocument } from "../index-RAhSmsFD.js";
8
+ import "../index-DoopUfIG.js";
9
+ import { Z as VetraPackageDocument, xt as VetraPackageAction } from "../module-C-jL7yqs.js";
10
+ import "../index-DGhkn3As.js";
1
11
  import { EditorModule } from "document-model";
2
12
  import { EditorModule as EditorModule$1 } from "@powerhousedao/shared/document-model";
3
-
13
+ import { DocumentDriveAction, DocumentDriveDocument } from "@powerhousedao/shared/document-drive";
4
14
  //#region editors/app-editor/module.d.ts
5
15
  /** Document editor module for the "powerhouse/app" document type */
6
- declare const AppEditor: EditorModule;
16
+ export declare const AppEditor: EditorModule<AppModuleDocument, AppModuleAction>;
7
17
  //#endregion
8
18
  //#region editors/document-editor/module.d.ts
9
19
  /** Document editor module for the "powerhouse/document-editor" document type */
10
- declare const DocumentEditorEditor: EditorModule;
20
+ export declare const DocumentEditorEditor: EditorModule<DocumentEditorDocument, DocumentEditorAction>;
11
21
  //#endregion
12
22
  //#region editors/processor-editor/module.d.ts
13
23
  /** Document editor module for the "powerhouse/processor" document type */
14
- declare const ProcessorModuleEditor: EditorModule;
24
+ export declare const ProcessorModuleEditor: EditorModule<ProcessorModuleDocument, ProcessorModuleAction>;
15
25
  //#endregion
16
26
  //#region editors/subgraph-editor/module.d.ts
17
27
  /** Document editor module for the "powerhouse/subgraph" document type */
18
- declare const SubgraphModuleEditor: EditorModule;
28
+ export declare const SubgraphModuleEditor: EditorModule<SubgraphModuleDocument, SubgraphModuleAction>;
19
29
  //#endregion
20
30
  //#region editors/vetra-drive-app/module.d.ts
21
- declare const VetraDriveApp: EditorModule$1;
31
+ export declare const VetraDriveApp: EditorModule$1<DocumentDriveDocument, DocumentDriveAction>;
22
32
  //#endregion
23
33
  //#region editors/vetra-package/module.d.ts
24
34
  /** Document editor module for the "powerhouse/package" document type */
25
- declare const VetraPackageEditor: EditorModule;
35
+ export declare const VetraPackageEditor: EditorModule<VetraPackageDocument, VetraPackageAction>;
26
36
  //#endregion
27
- export { AppEditor, DocumentEditorEditor, ProcessorModuleEditor, SubgraphModuleEditor, VetraDriveApp, VetraPackageEditor };
37
+ export {};
28
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../editors/app-editor/module.ts","../../editors/document-editor/module.ts","../../editors/processor-editor/module.ts","../../editors/subgraph-editor/module.ts","../../editors/vetra-drive-app/module.ts","../../editors/vetra-package/module.ts"],"mappings":";;;;;cAQa,SAAA,EAAW,YAAA;;;;cCAX,oBAAA,EAAsB,YAAA;;;;cCAtB,qBAAA,EAAuB,YAAA;;;;cCAvB,oBAAA,EAAsB,YAAA;;;cCLtB,aAAA,EAAe,cAAA;;;;cCKf,kBAAA,EAAoB,YAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../editors/app-editor/module.ts","../../editors/document-editor/module.ts","../../editors/processor-editor/module.ts","../../editors/subgraph-editor/module.ts","../../editors/vetra-drive-app/module.ts","../../editors/vetra-package/module.ts"],"mappings":";;;;;;;;;;;;;;;qBAYa,WAAW,aAAa,mBAAmB;;;;qBCA3C,sBAAsB,aACjC,wBACA;;;;qBCFW,uBAAuB,aAClC,yBACA;;;;qBCFW,sBAAsB,aACjC,wBACA;;;qBCPW,eAAe,eAC1B,uBACA;;;;qBCGW,oBAAoB,aAC/B,sBACA"}
@@ -1,2 +1,2 @@
1
- import { a as DocumentEditorEditor, i as ProcessorModuleEditor, n as VetraDriveApp, o as AppEditor, r as SubgraphModuleEditor, t as VetraPackageEditor } from "../module-DXT-FMxU.js";
1
+ import { a as DocumentEditorEditor, i as ProcessorModuleEditor, n as VetraDriveApp, o as AppEditor, r as SubgraphModuleEditor, t as VetraPackageEditor } from "../module-B6S4QGOx.js";
2
2
  export { AppEditor, DocumentEditorEditor, ProcessorModuleEditor, SubgraphModuleEditor, VetraDriveApp, VetraPackageEditor };
@@ -1,4 +1,5 @@
1
- import { t as logger } from "./logger-WHD0fyLm.js";
1
+ import { t as logger } from "./logger-BFxMdimR.js";
2
+ import { deletedDocumentId } from "@powerhousedao/shared/processors";
2
3
  //#region processors/vetra-read-model/migrations.ts
3
4
  async function up(db) {
4
5
  await db.schema.createTable("vetra_package").addColumn("document_id", "varchar(255)", (col) => col.primaryKey()).addColumn("name", "varchar(255)").addColumn("description", "text").addColumn("category", "varchar(255)").addColumn("author_name", "varchar(255)").addColumn("author_website", "varchar(512)").addColumn("keywords", "text").addColumn("github_url", "varchar(512)").addColumn("npm_url", "varchar(512)").addColumn("drive_id", "varchar(255)").addColumn("last_operation_index", "integer", (col) => col.notNull()).addColumn("last_operation_hash", "varchar(255)", (col) => col.notNull()).addColumn("last_operation_timestamp", "timestamptz", (col) => col.notNull()).addColumn("created_at", "timestamptz", (col) => col.notNull().defaultTo("now()")).addColumn("updated_at", "timestamptz", (col) => col.notNull().defaultTo("now()")).ifNotExists().execute();
@@ -16,8 +17,15 @@ var VetraReadModelProcessor = class {
16
17
  async onOperations(operations) {
17
18
  logger.info(">>> VetraReadModelProcessor.onOperations()");
18
19
  if (operations.length === 0) return;
19
- for (const { operation, context } of operations) {
20
+ for (const op of operations) {
21
+ const { operation, context } = op;
20
22
  if (context.documentType !== "powerhouse/package") continue;
23
+ const deleted = deletedDocumentId(op);
24
+ if (deleted !== void 0) {
25
+ await this.relationalDb.deleteFrom("vetra_package").where("document_id", "=", deleted).execute();
26
+ continue;
27
+ }
28
+ if (context.scope !== "global") continue;
21
29
  const state = context.resultingState ? JSON.parse(context.resultingState) : void 0;
22
30
  const getString = (val) => typeof val === "string" ? val : null;
23
31
  const now = /* @__PURE__ */ new Date();
@@ -68,7 +76,7 @@ const vetraReadModelFactoryBuilder = (module) => {
68
76
  branch: ["main"],
69
77
  documentId: ["*"],
70
78
  documentType: ["powerhouse/package"],
71
- scope: ["global"]
79
+ scope: ["global", "document"]
72
80
  }
73
81
  }];
74
82
  };
@@ -76,4 +84,4 @@ const vetraReadModelFactoryBuilder = (module) => {
76
84
  //#endregion
77
85
  export { VetraReadModelProcessor as n, vetraReadModelFactoryBuilder as t };
78
86
 
79
- //# sourceMappingURL=factory-5eiZohiv.js.map
87
+ //# sourceMappingURL=factory-BUuO4fIN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-BUuO4fIN.js","names":[],"sources":["../processors/vetra-read-model/migrations.ts","../processors/vetra-read-model/processor.ts","../processors/vetra-read-model/factory.ts"],"sourcesContent":["import type { IRelationalDb } from \"@powerhousedao/shared/processors\";\n\nexport async function up(db: IRelationalDb<any>): Promise<void> {\n // Create vetra_package table to store VetraPackage document state\n await db.schema\n .createTable(\"vetra_package\")\n .addColumn(\"document_id\", \"varchar(255)\", (col) => col.primaryKey()) // VetraPackage state fields\n .addColumn(\"name\", \"varchar(255)\")\n .addColumn(\"description\", \"text\")\n .addColumn(\"category\", \"varchar(255)\")\n .addColumn(\"author_name\", \"varchar(255)\")\n .addColumn(\"author_website\", \"varchar(512)\")\n .addColumn(\"keywords\", \"text\") // JSON array of {id, label}\n .addColumn(\"github_url\", \"varchar(512)\")\n .addColumn(\"npm_url\", \"varchar(512)\")\n .addColumn(\"drive_id\", \"varchar(255)\")\n // Document metadata\n .addColumn(\"last_operation_index\", \"integer\", (col) => col.notNull())\n .addColumn(\"last_operation_hash\", \"varchar(255)\", (col) => col.notNull())\n .addColumn(\"last_operation_timestamp\", \"timestamptz\", (col) =>\n col.notNull(),\n )\n .addColumn(\"created_at\", \"timestamptz\", (col) =>\n col.notNull().defaultTo(\"now()\"),\n )\n .addColumn(\"updated_at\", \"timestamptz\", (col) =>\n col.notNull().defaultTo(\"now()\"),\n )\n .ifNotExists()\n .execute();\n\n // Create indexes for common queries\n await db.schema\n .createIndex(\"idx_vetra_package_document_id\")\n .on(\"vetra_package\")\n .column(\"document_id\")\n .ifNotExists()\n .execute();\n\n await db.schema\n .createIndex(\"idx_vetra_package_name\")\n .on(\"vetra_package\")\n .column(\"name\")\n .ifNotExists()\n .execute();\n\n await db.schema\n .createIndex(\"idx_vetra_package_category\")\n .on(\"vetra_package\")\n .column(\"category\")\n .ifNotExists()\n .execute();\n}\n\nexport async function down(db: IRelationalDb<any>): Promise<void> {\n // Drop indexes first\n await db.schema.dropIndex(\"idx_vetra_package_category\").ifExists().execute();\n await db.schema.dropIndex(\"idx_vetra_package_name\").ifExists().execute();\n await db.schema\n .dropIndex(\"idx_vetra_package_document_id\")\n .ifExists()\n .execute();\n\n // Drop table\n await db.schema.dropTable(\"vetra_package\").ifExists().execute();\n}\n","import type {\n IProcessor,\n OperationWithContext,\n} from \"@powerhousedao/reactor-browser\";\nimport { deletedDocumentId } from \"@powerhousedao/shared/processors\";\nimport type { Kysely } from \"kysely\";\nimport type { VetraPackageState } from \"../../document-models/vetra-package/v1/gen/schema/types.js\";\nimport { logger } from \"../codegen/logger.js\";\nimport { type DB } from \"./schema.js\";\n\ninterface VetraPackageGlobalState extends VetraPackageState {}\n\nexport class VetraReadModelProcessor implements IProcessor {\n private relationalDb: Kysely<DB>;\n\n constructor(relationalDb: Kysely<DB>) {\n this.relationalDb = relationalDb;\n }\n\n async onOperations(operations: OperationWithContext[]): Promise<void> {\n logger.info(\">>> VetraReadModelProcessor.onOperations()\");\n if (operations.length === 0) return;\n\n for (const op of operations) {\n const { operation, context } = op;\n if (context.documentType !== \"powerhouse/package\") continue;\n\n const deleted = deletedDocumentId(op);\n if (deleted !== undefined) {\n await this.relationalDb\n .deleteFrom(\"vetra_package\")\n .where(\"document_id\", \"=\", deleted)\n .execute();\n continue;\n }\n if (context.scope !== \"global\") continue;\n\n const state = context.resultingState\n ? (JSON.parse(context.resultingState) as VetraPackageGlobalState)\n : undefined;\n\n const getString = (val: unknown): string | null =>\n typeof val === \"string\" ? val : null;\n\n const now = new Date();\n const operationTimestamp = new Date(\n parseInt(operation.timestampUtcMs, 10),\n );\n\n await this.relationalDb\n .insertInto(\"vetra_package\")\n .values({\n document_id: context.documentId,\n name: getString(state?.name),\n description: getString(state?.description),\n category: getString(state?.category),\n author_name: getString(state?.author?.name),\n author_website: getString(state?.author?.website),\n keywords: state?.keywords ? JSON.stringify(state.keywords) : null,\n github_url: getString(state?.githubUrl),\n npm_url: getString(state?.npmUrl),\n last_operation_index: operation.index,\n last_operation_hash: operation.hash,\n last_operation_timestamp: operationTimestamp,\n drive_id: \"\", // Not available in new format\n created_at: now,\n updated_at: now,\n })\n .onConflict((oc) =>\n oc.column(\"document_id\").doUpdateSet({\n name: getString(state?.name),\n description: getString(state?.description),\n category: getString(state?.category),\n author_name: getString(state?.author?.name),\n author_website: getString(state?.author?.website),\n keywords: state?.keywords ? JSON.stringify(state.keywords) : null,\n github_url: getString(state?.githubUrl),\n npm_url: getString(state?.npmUrl),\n last_operation_index: operation.index,\n last_operation_hash: operation.hash,\n last_operation_timestamp: operationTimestamp,\n updated_at: now,\n }),\n )\n .execute();\n }\n }\n\n async onDisconnect() {}\n}\n","import type {\n IProcessorHostModule,\n ProcessorFactoryBuilder,\n ProcessorRecord,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocumentHeader } from \"@powerhousedao/shared/document-model\";\nimport { up } from \"./migrations.js\";\nimport { VetraReadModelProcessor } from \"./processor.js\";\nimport type { DB } from \"./schema.js\";\n\nexport const vetraReadModelFactoryBuilder: ProcessorFactoryBuilder = (\n module: IProcessorHostModule,\n) => {\n return async (_driveHeader: PHDocumentHeader): Promise<ProcessorRecord[]> => {\n // Create namespace (same as legacy - all vetra packages share one namespace)\n const db = await module.relationalDb.createNamespace<DB>(\"vetra-packages\");\n\n // Run migrations (idempotent - uses ifNotExists)\n await up(db);\n\n // Create the processor with the relational database\n const processor = new VetraReadModelProcessor(db);\n return [\n {\n processor,\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n documentType: [\"powerhouse/package\"],\n // \"document\" carries DELETE_DOCUMENT and PURGE_DOCUMENT.\n scope: [\"global\", \"document\"],\n },\n },\n ];\n };\n};\n"],"mappings":";;;AAEA,eAAsB,GAAG,IAAuC;CAE9D,MAAM,GAAG,OACN,YAAY,eAAe,CAAC,CAC5B,UAAU,eAAe,iBAAiB,QAAQ,IAAI,WAAW,CAAC,CAAC,CACnE,UAAU,QAAQ,cAAc,CAAC,CACjC,UAAU,eAAe,MAAM,CAAC,CAChC,UAAU,YAAY,cAAc,CAAC,CACrC,UAAU,eAAe,cAAc,CAAC,CACxC,UAAU,kBAAkB,cAAc,CAAC,CAC3C,UAAU,YAAY,MAAM,CAAC,CAC7B,UAAU,cAAc,cAAc,CAAC,CACvC,UAAU,WAAW,cAAc,CAAC,CACpC,UAAU,YAAY,cAAc,CAAC,CAErC,UAAU,wBAAwB,YAAY,QAAQ,IAAI,QAAQ,CAAC,CAAC,CACpE,UAAU,uBAAuB,iBAAiB,QAAQ,IAAI,QAAQ,CAAC,CAAC,CACxE,UAAU,4BAA4B,gBAAgB,QACrD,IAAI,QAAQ,CACd,CAAC,CACA,UAAU,cAAc,gBAAgB,QACvC,IAAI,QAAQ,CAAC,CAAC,UAAU,OAAO,CACjC,CAAC,CACA,UAAU,cAAc,gBAAgB,QACvC,IAAI,QAAQ,CAAC,CAAC,UAAU,OAAO,CACjC,CAAC,CACA,YAAY,CAAC,CACb,QAAQ;CAGX,MAAM,GAAG,OACN,YAAY,+BAA+B,CAAC,CAC5C,GAAG,eAAe,CAAC,CACnB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,WAAW,KAAK,UAAU,MAAM,QAAQ,IAAI;IAC7D,YAAY,UAAU,OAAO,SAAS;IACtC,SAAS,UAAU,OAAO,MAAM;IAChC,sBAAsB,UAAU;IAChC,qBAAqB,UAAU;IAC/B,0BAA0B;IAC1B,UAAU;IACV,YAAY;IACZ,YAAY;GACd,CAAC,CAAC,CACD,YAAY,OACX,GAAG,OAAO,aAAa,CAAC,CAAC,YAAY;IACnC,MAAM,UAAU,OAAO,IAAI;IAC3B,aAAa,UAAU,OAAO,WAAW;IACzC,UAAU,UAAU,OAAO,QAAQ;IACnC,aAAa,UAAU,OAAO,QAAQ,IAAI;IAC1C,gBAAgB,UAAU,OAAO,QAAQ,OAAO;IAChD,UAAU,OAAO,WAAW,KAAK,UAAU,MAAM,QAAQ,IAAI;IAC7D,YAAY,UAAU,OAAO,SAAS;IACtC,SAAS,UAAU,OAAO,MAAM;IAChC,sBAAsB,UAAU;IAChC,qBAAqB,UAAU;IAC/B,0BAA0B;IAC1B,YAAY;GACd,CAAC,CACH,CAAC,CACA,QAAQ;EACb;CACF;CAEA,MAAM,eAAe,CAAC;AACxB;;;AC/EA,MAAa,gCACX,WACG;CACH,OAAO,OAAO,iBAA+D;EAE3E,MAAM,KAAK,MAAM,OAAO,aAAa,gBAAoB,gBAAgB;EAGzE,MAAM,GAAG,EAAE;EAIX,OAAO,CACL;GACE,WAAA,IAHkB,wBAAwB,EAGlC;GACR,QAAQ;IACN,QAAQ,CAAC,MAAM;IACf,YAAY,CAAC,GAAG;IAChB,cAAc,CAAC,oBAAoB;IAEnC,OAAO,CAAC,UAAU,UAAU;GAC9B;EACF,CACF;CACF;AACF"}
@@ -1,4 +1,5 @@
1
- import { t as logger } from "./logger-WHD0fyLm.js";
1
+ import { t as logger } from "./logger-BFxMdimR.js";
2
+ import { getCodegenStatusRegistry } from "@powerhousedao/shared/processors";
2
3
  import { VETRA_PROCESSOR_CONFIG_KEY } from "@powerhousedao/config";
3
4
  //#region processors/codegen/factory.ts
4
5
  /**
@@ -26,23 +27,26 @@ const codegenFactoryBuilder = (module) => {
26
27
  const [{ buildTsMorphProject }, { getConfig }, { CodegenProcessor }] = await Promise.all([
27
28
  import("@powerhousedao/codegen/utils"),
28
29
  import("@powerhousedao/config/node"),
29
- import("./processor-trJFuoHh.js").then((n) => n.n)
30
+ import("./processor-Cb2shrDB.js").then((n) => n.n)
30
31
  ]);
31
32
  const config = getConfig();
32
33
  const cwd = process.cwd();
34
+ const processor = new CodegenProcessor(buildTsMorphProject(cwd), config, cwd, driveHeader.id, module.client, vetraConfig?.interactive);
35
+ const documentTypes = [
36
+ "powerhouse/document-model",
37
+ "powerhouse/package",
38
+ "powerhouse/document-editor",
39
+ "powerhouse/subgraph",
40
+ "powerhouse/processor",
41
+ "powerhouse/app"
42
+ ];
43
+ getCodegenStatusRegistry().watch(documentTypes);
33
44
  return [{
34
- processor: new CodegenProcessor(buildTsMorphProject(cwd), config, cwd, vetraConfig?.interactive),
45
+ processor,
35
46
  filter: {
36
47
  branch: ["main"],
37
48
  documentId: ["*"],
38
- documentType: [
39
- "powerhouse/document-model",
40
- "powerhouse/package",
41
- "powerhouse/document-editor",
42
- "powerhouse/subgraph",
43
- "powerhouse/processor",
44
- "powerhouse/app"
45
- ],
49
+ documentType: documentTypes,
46
50
  scope: ["global"]
47
51
  }
48
52
  }];
@@ -51,4 +55,4 @@ const codegenFactoryBuilder = (module) => {
51
55
  //#endregion
52
56
  export { codegenFactoryBuilder as t };
53
57
 
54
- //# sourceMappingURL=factory-DMl8eB3P.js.map
58
+ //# sourceMappingURL=factory-GIkoxPdL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-GIkoxPdL.js","names":[],"sources":["../processors/codegen/factory.ts"],"sourcesContent":["import type { VetraProcessorConfigType } from \"@powerhousedao/config\";\nimport { VETRA_PROCESSOR_CONFIG_KEY } from \"@powerhousedao/config\";\nimport type {\n IProcessorHostModule,\n ProcessorFactoryBuilder,\n ProcessorRecord,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocumentHeader } from \"@powerhousedao/shared/document-model\";\nimport { getCodegenStatusRegistry } from \"@powerhousedao/shared/processors\";\nimport { logger } from \"./logger.js\";\n\n/**\n * Determines if a drive header matches the Vetra drive criteria.\n * @param driveHeader - The drive header to check\n * @param explicitDriveId - Optional explicit drive ID from config (if set, uses exact match)\n * @returns true if the drive is a Vetra drive, false otherwise\n */\nfunction isDriveVetra(\n driveHeader: PHDocumentHeader,\n driveIdFromConfig?: string,\n): boolean {\n // If explicit drive ID is configured, use exact match\n if (driveIdFromConfig) {\n return (\n driveHeader.slug === driveIdFromConfig ||\n driveHeader.id === driveIdFromConfig\n );\n }\n\n // Otherwise, check if slug/id matches Vetra pattern\n // Matches \"vetra\" exactly or IDs starting with \"vetra-\" (case-insensitive)\n const matchesPattern = (identifier: string): boolean => {\n const lower = identifier.toLowerCase();\n return lower === \"vetra\" || lower.startsWith(\"vetra-\");\n };\n\n return matchesPattern(driveHeader.slug) || matchesPattern(driveHeader.id);\n}\n\nexport const codegenFactoryBuilder: ProcessorFactoryBuilder = (\n module: IProcessorHostModule,\n) => {\n return async (driveHeader: PHDocumentHeader): Promise<ProcessorRecord[]> => {\n const processorsConfig = module.config ?? new Map<string, unknown>();\n const vetraConfig = processorsConfig.get(VETRA_PROCESSOR_CONFIG_KEY) as\n | VetraProcessorConfigType\n | undefined;\n\n // Exit early if it's not a vetra drive\n if (!isDriveVetra(driveHeader, vetraConfig?.driveId)) {\n logger.debug(\n `Drive ${driveHeader.slug} is not a Vetra drive, skipping codegen processor`,\n );\n return [];\n }\n\n logger.info(\n `Drive ${driveHeader.slug} is a Vetra drive, using codegen processor`,\n );\n\n // Lazy-load codegen only once a Vetra drive is confirmed.\n const [{ buildTsMorphProject }, { getConfig }, { CodegenProcessor }] =\n await Promise.all([\n import(\"@powerhousedao/codegen/utils\"),\n import(\"@powerhousedao/config/node\"),\n import(\"./processor.js\"),\n ]);\n\n const config = getConfig();\n const cwd = process.cwd();\n\n /* Use one instance of ts-morph project, which handles race conditions */\n const project = buildTsMorphProject(cwd);\n const processor = new CodegenProcessor(\n project,\n config,\n cwd,\n driveHeader.id,\n module.client,\n vetraConfig?.interactive,\n );\n const documentTypes = [\n \"powerhouse/document-model\",\n \"powerhouse/package\",\n \"powerhouse/document-editor\",\n \"powerhouse/subgraph\",\n \"powerhouse/processor\",\n \"powerhouse/app\",\n ];\n getCodegenStatusRegistry().watch(documentTypes);\n return [\n {\n processor,\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n documentType: documentTypes,\n scope: [\"global\"],\n },\n },\n ];\n };\n};\n"],"mappings":";;;;;;;;;;AAiBA,SAAS,aACP,aACA,mBACS;CAET,IAAI,mBACF,OACE,YAAY,SAAS,qBACrB,YAAY,OAAO;CAMvB,MAAM,kBAAkB,eAAgC;EACtD,MAAM,QAAQ,WAAW,YAAY;EACrC,OAAO,UAAU,WAAW,MAAM,WAAW,QAAQ;CACvD;CAEA,OAAO,eAAe,YAAY,IAAI,KAAK,eAAe,YAAY,EAAE;AAC1E;AAEA,MAAa,yBACX,WACG;CACH,OAAO,OAAO,gBAA8D;EAE1E,MAAM,eADmB,OAAO,0BAAU,IAAI,IAAqB,EAAA,CAC9B,IAAI,0BAA0B;EAKnE,IAAI,CAAC,aAAa,aAAa,aAAa,OAAO,GAAG;GACpD,OAAO,MACL,SAAS,YAAY,KAAK,kDAC5B;GACA,OAAO,CAAC;EACV;EAEA,OAAO,KACL,SAAS,YAAY,KAAK,2CAC5B;EAGA,MAAM,CAAC,EAAE,uBAAuB,EAAE,aAAa,EAAE,sBAC/C,MAAM,QAAQ,IAAI;GAChB,OAAO;GACP,OAAO;GACP,OAAO,0BAAiB,CAAA,MAAA,MAAA,EAAA,CAAA;EAC1B,CAAC;EAEH,MAAM,SAAS,UAAU;EACzB,MAAM,MAAM,QAAQ,IAAI;EAIxB,MAAM,YAAY,IAAI,iBADN,oBAAoB,GAE5B,GACN,QACA,KACA,YAAY,IACZ,OAAO,QACP,aAAa,WACf;EACA,MAAM,gBAAgB;GACpB;GACA;GACA;GACA;GACA;GACA;EACF;EACA,yBAAyB,CAAC,CAAC,MAAM,aAAa;EAC9C,OAAO,CACL;GACE;GACA,QAAQ;IACN,QAAQ,CAAC,MAAM;IACf,YAAY,CAAC,GAAG;IAChB,cAAc;IACd,OAAO,CAAC,QAAQ;GAClB;EACF,CACF;CACF;AACF"}
@@ -8,7 +8,7 @@ function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments = false)
8
8
  const supportedDocumentTypes = useSupportedDocumentTypesInReactor() ?? [];
9
9
  const documentTypesFromDocumentModelDocuments = (useDocumentsInSelectedDrive() ?? []).filter(isDocumentModelDocument).map((doc) => doc.state.global.id);
10
10
  if (onlyDocumentTypesFromDriveDocuments) return [...new Set(documentTypesFromDocumentModelDocuments)];
11
- return [...new Set([...supportedDocumentTypes, ...documentTypesFromDocumentModelDocuments])];
11
+ return [.../* @__PURE__ */ new Set([...supportedDocumentTypes, ...documentTypesFromDocumentModelDocuments])];
12
12
  }
13
13
  //#endregion
14
14
  //#region editors/hooks/useDebounce.ts
@@ -36,4 +36,4 @@ function useDebounce(value, callback, delay) {
36
36
  //#endregion
37
37
  export { useAvailableDocumentTypes as n, useDebounce as t };
38
38
 
39
- //# sourceMappingURL=hooks-BIgFcbaF.js.map
39
+ //# sourceMappingURL=hooks-BbxvC-C3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-BIgFcbaF.js","names":[],"sources":["../editors/hooks/useAvailableDocumentTypes.ts","../editors/hooks/useDebounce.ts"],"sourcesContent":["import {\n useDocumentsInSelectedDrive,\n useSupportedDocumentTypesInReactor,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n DocumentModelDocument,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\n\nfunction isDocumentModelDocument(\n document: PHDocument,\n): document is DocumentModelDocument {\n return document.header.documentType === \"powerhouse/document-model\";\n}\n\nexport function useAvailableDocumentTypes(\n onlyDocumentTypesFromDriveDocuments = false,\n): string[] {\n const supportedDocumentTypes = useSupportedDocumentTypesInReactor() ?? [];\n const documents = useDocumentsInSelectedDrive() ?? [];\n const documentModelDocumentsInSelectedDrive = documents.filter(\n isDocumentModelDocument,\n );\n const documentTypesFromDocumentModelDocuments =\n documentModelDocumentsInSelectedDrive.map((doc) => doc.state.global.id);\n\n if (onlyDocumentTypesFromDriveDocuments)\n return [...new Set(documentTypesFromDocumentModelDocuments)];\n\n return [\n ...new Set([\n ...supportedDocumentTypes,\n ...documentTypesFromDocumentModelDocuments,\n ]),\n ];\n}\n","import { useEffect } from \"react\";\n\n/**\n * Reusable debounce hook that calls a callback function after a specified delay\n * when the value changes. Useful for API calls, search inputs, etc.\n *\n * @param value - The value to debounce\n * @param callback - Function to call with the debounced value (optional)\n * @param delay - Delay in milliseconds\n */\nexport function useDebounce<T>(\n value: T,\n callback: ((value: T) => void) | undefined,\n delay: number,\n) {\n useEffect(() => {\n if (!callback) return;\n\n const timer = setTimeout(() => {\n callback(value);\n }, delay);\n\n return () => clearTimeout(timer);\n }, [value, callback, delay]);\n}\n"],"mappings":";;;AASA,SAAS,wBACP,UACmC;AACnC,QAAO,SAAS,OAAO,iBAAiB;;AAG1C,SAAgB,0BACd,sCAAsC,OAC5B;CACV,MAAM,yBAAyB,oCAAoC,IAAI,EAAE;CAKzE,MAAM,2CAJY,6BAA6B,IAAI,EAAE,EACG,OACtD,wBACD,CAEuC,KAAK,QAAQ,IAAI,MAAM,OAAO,GAAG;AAEzE,KAAI,oCACF,QAAO,CAAC,GAAG,IAAI,IAAI,wCAAwC,CAAC;AAE9D,QAAO,CACL,GAAG,IAAI,IAAI,CACT,GAAG,wBACH,GAAG,wCACJ,CAAC,CACH;;;;;;;;;;;;ACxBH,SAAgB,YACd,OACA,UACA,OACA;AACA,iBAAgB;AACd,MAAI,CAAC,SAAU;EAEf,MAAM,QAAQ,iBAAiB;AAC7B,YAAS,MAAM;KACd,MAAM;AAET,eAAa,aAAa,MAAM;IAC/B;EAAC;EAAO;EAAU;EAAM,CAAC"}
1
+ {"version":3,"file":"hooks-BbxvC-C3.js","names":[],"sources":["../editors/hooks/useAvailableDocumentTypes.ts","../editors/hooks/useDebounce.ts"],"sourcesContent":["import {\n useDocumentsInSelectedDrive,\n useSupportedDocumentTypesInReactor,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n DocumentModelDocument,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\n\nfunction isDocumentModelDocument(\n document: PHDocument,\n): document is DocumentModelDocument {\n return document.header.documentType === \"powerhouse/document-model\";\n}\n\nexport function useAvailableDocumentTypes(\n onlyDocumentTypesFromDriveDocuments = false,\n): string[] {\n const supportedDocumentTypes = useSupportedDocumentTypesInReactor() ?? [];\n const documents = useDocumentsInSelectedDrive() ?? [];\n const documentModelDocumentsInSelectedDrive = documents.filter(\n isDocumentModelDocument,\n );\n const documentTypesFromDocumentModelDocuments =\n documentModelDocumentsInSelectedDrive.map((doc) => doc.state.global.id);\n\n if (onlyDocumentTypesFromDriveDocuments)\n return [...new Set(documentTypesFromDocumentModelDocuments)];\n\n return [\n ...new Set([\n ...supportedDocumentTypes,\n ...documentTypesFromDocumentModelDocuments,\n ]),\n ];\n}\n","import { useEffect } from \"react\";\n\n/**\n * Reusable debounce hook that calls a callback function after a specified delay\n * when the value changes. Useful for API calls, search inputs, etc.\n *\n * @param value - The value to debounce\n * @param callback - Function to call with the debounced value (optional)\n * @param delay - Delay in milliseconds\n */\nexport function useDebounce<T>(\n value: T,\n callback: ((value: T) => void) | undefined,\n delay: number,\n) {\n useEffect(() => {\n if (!callback) return;\n\n const timer = setTimeout(() => {\n callback(value);\n }, delay);\n\n return () => clearTimeout(timer);\n }, [value, callback, delay]);\n}\n"],"mappings":";;;AASA,SAAS,wBACP,UACmC;CACnC,OAAO,SAAS,OAAO,iBAAiB;AAC1C;AAEA,SAAgB,0BACd,sCAAsC,OAC5B;CACV,MAAM,yBAAyB,mCAAmC,KAAK,CAAC;CAKxE,MAAM,2CAJY,4BAA4B,KAAK,CAAC,EAAA,CACI,OACtD,uBAGoC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,OAAO,EAAE;CAExE,IAAI,qCACF,OAAO,CAAC,GAAG,IAAI,IAAI,uCAAuC,CAAC;CAE7D,OAAO,CACL,mBAAG,IAAI,IAAI,CACT,GAAG,wBACH,GAAG,uCACL,CAAC,CACH;AACF;;;;;;;;;;;ACzBA,SAAgB,YACd,OACA,UACA,OACA;CACA,gBAAgB;EACd,IAAI,CAAC,UAAU;EAEf,MAAM,QAAQ,iBAAiB;GAC7B,SAAS,KAAK;EAChB,GAAG,KAAK;EAER,aAAa,aAAa,KAAK;CACjC,GAAG;EAAC;EAAO;EAAU;CAAK,CAAC;AAC7B"}
@@ -0,0 +1,43 @@
1
+ import { $ as SetProcessorTypeAction, K as AddDocumentTypeAction, Q as SetProcessorStatusAction, X as RemoveProcessorAppAction, Y as RemoveDocumentTypeAction, Z as SetProcessorNameAction, _t as SetProcessorNameInput, ht as RemoveProcessorAppInput, it as AddProcessorAppInput, mt as RemoveDocumentTypeInput, q as AddProcessorAppAction, rt as AddDocumentTypeInput, vt as SetProcessorStatusInput, yt as SetProcessorTypeInput } from "./index-CqDvbSe4.js";
2
+ import { UpgradeManifest } from "document-model";
3
+ //#region document-models/processor-module/v1/gen/document-type.d.ts
4
+ /**
5
+ * WARNING: DO NOT EDIT
6
+ * This file is auto-generated and updated by codegen
7
+ */
8
+ declare const processorModuleDocumentType = "powerhouse/processor";
9
+ //#endregion
10
+ //#region document-models/processor-module/v1/actions.d.ts
11
+ /** Actions for the ProcessorModule document model */
12
+ declare const actions: {
13
+ setName: typeof import("document-model").setName;
14
+ setPreferredEditor: typeof import("document-model").setPreferredEditor;
15
+ setSlug: typeof import("document-model").setSlug;
16
+ undo: typeof import("document-model").undo;
17
+ redo: typeof import("document-model").redo;
18
+ noop: typeof import("document-model").noop;
19
+ setProcessorName: (input: SetProcessorNameInput) => SetProcessorNameAction;
20
+ setProcessorType: (input: SetProcessorTypeInput) => SetProcessorTypeAction;
21
+ addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
22
+ removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
23
+ addProcessorApp: (input: AddProcessorAppInput) => AddProcessorAppAction;
24
+ removeProcessorApp: (input: RemoveProcessorAppInput) => RemoveProcessorAppAction;
25
+ setProcessorStatus: (input: SetProcessorStatusInput) => SetProcessorStatusAction;
26
+ };
27
+ //#endregion
28
+ //#region document-models/processor-module/v1/src/utils.d.ts
29
+ /** The processor kinds Vetra's codegen can generate. */
30
+ declare const PROCESSOR_TYPES: readonly ["analytics", "relational"];
31
+ type ProcessorType = (typeof PROCESSOR_TYPES)[number];
32
+ declare function isProcessorType(type: string): type is ProcessorType;
33
+ //#endregion
34
+ //#region document-models/processor-module/upgrades/versions.d.ts
35
+ declare const supportedVersions: readonly [1];
36
+ declare const latestVersion: 1;
37
+ //#endregion
38
+ //#region document-models/processor-module/upgrades/upgrade-manifest.d.ts
39
+ declare const processorModuleUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
40
+ //#endregion
41
+ export { ProcessorType as a, processorModuleDocumentType as c, PROCESSOR_TYPES as i, latestVersion as n, isProcessorType as o, supportedVersions as r, actions as s, processorModuleUpgradeManifest as t };
42
+ export {};
43
+ //# sourceMappingURL=index-BwHVZmO6.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BwHVZmO6.d.ts","names":[],"sources":["../document-models/processor-module/v1/gen/document-type.ts","../document-models/processor-module/v1/actions.ts","../document-models/processor-module/v1/src/utils.ts","../document-models/processor-module/upgrades/versions.ts","../document-models/processor-module/upgrades/upgrade-manifest.ts"],"mappings":";;;;;;;cAIa;;;;cCKA;;;;;;;4BAAA;;;;;;;;;;;cCRA;KACD,wBAAwB;iBAEpB,gBAAgB,eAAe,QAAQ;;;cCJ1C;cAEA;;;cCKA,gCAAgC,uBACpC"}
@@ -1,21 +1,19 @@
1
- import * as document_model0 from "document-model";
2
1
  import { Action, DocumentModelGlobalState, DocumentModelUtils, PHAuthState, PHBaseState, PHDocument, PHDocumentController, PHDocumentState, Reducer, SignalDispatch } from "document-model";
3
2
  import * as z$1 from "zod";
4
3
  import { z } from "zod";
5
4
  import { DocumentDispatch } from "@powerhousedao/reactor-browser";
6
-
7
5
  //#region document-models/document-editor/v1/gen/schema/types.d.ts
8
6
  type Maybe<T> = T | null | undefined;
9
7
  type InputMaybe<T> = T | null | undefined;
10
8
  type Exact<T extends {
11
9
  [key: string]: unknown;
12
- }> = { [K in keyof T]: T[K] };
13
- type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
14
- type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
10
+ }> = { [K in keyof T]: T[K]; };
11
+ type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]>; };
12
+ type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]>; };
15
13
  type MakeEmpty<T extends {
16
14
  [key: string]: unknown;
17
- }, K extends keyof T> = { [_ in K]?: never };
18
- type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
15
+ }, K extends keyof T> = { [_ in K]?: never; };
16
+ type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; };
19
17
  /** All built-in and custom scalars, mapped to their actual values */
20
18
  type Scalars = {
21
19
  ID: {
@@ -153,13 +151,18 @@ type AddDocumentTypeInput = {
153
151
  * the first matching editor when opening a document.
154
152
  */
155
153
  type DocumentEditorState = {
156
- /** Document types this editor can edit. Each entry has a stable id so it can be removed individually. */documentTypes: Array<DocumentTypeItem>; /** Display name of the editor. Also determines the generated folder name under `editors/`. */
157
- name: Scalars["String"]["output"]; /** Lifecycle status. While DRAFT the editor definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation. */
154
+ /** Document types this editor can edit. Each entry has a stable id so it can be removed individually. */
155
+ documentTypes: Array<DocumentTypeItem>;
156
+ /** Display name of the editor. Also determines the generated folder name under `editors/`. */
157
+ name: Scalars["String"]["output"];
158
+ /** Lifecycle status. While DRAFT the editor definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation. */
158
159
  status: StatusType;
159
160
  };
160
161
  /** A document type id (e.g. 'powerhouse/document-drive') attached to the editor with a stable entry id. */
161
162
  type DocumentTypeItem = {
162
- /** Document type id this editor handles (e.g. 'my-org/invoice'). */documentType: Scalars["String"]["output"]; /** Stable identifier for the entry; used to remove it. */
163
+ /** Document type id this editor handles (e.g. 'my-org/invoice'). */
164
+ documentType: Scalars["String"]["output"];
165
+ /** Stable identifier for the entry; used to remove it. */
163
166
  id: Scalars["OID"]["output"];
164
167
  };
165
168
  type RemoveDocumentTypeInput = {
@@ -217,7 +220,7 @@ interface DocumentEditorBaseOperationsOperations {
217
220
  }
218
221
  //#endregion
219
222
  //#region document-models/document-editor/v1/gen/controller.d.ts
220
- declare const DocumentEditorController: new (initialDocument?: document_model0.PHDocument<DocumentEditorPHState> | undefined) => PHDocumentController<DocumentEditorPHState> & document_model0.ActionMap<DocumentEditorBaseOperationsAction, PHDocumentController<DocumentEditorPHState>>;
223
+ declare const DocumentEditorController: new (initialDocument?: import("document-model").PHDocument<DocumentEditorPHState> | undefined) => PHDocumentController<DocumentEditorPHState> & import("document-model").ActionMap<DocumentEditorBaseOperationsAction, PHDocumentController<DocumentEditorPHState>>;
221
224
  declare namespace creators_d_exports {
222
225
  export { addDocumentType, removeDocumentType, setEditorName, setEditorStatus };
223
226
  }
@@ -278,13 +281,6 @@ declare function isDocumentEditorDocument(document: unknown): document is Docume
278
281
  /** Simple helper function to assert that a document is a DocumentEditor document */
279
282
  declare function assertIsDocumentEditorDocument(document: unknown): asserts document is DocumentEditorDocument;
280
283
  //#endregion
281
- //#region document-models/document-editor/v1/gen/document-type.d.ts
282
- /**
283
- * WARNING: DO NOT EDIT
284
- * This file is auto-generated and updated by codegen
285
- */
286
- declare const documentEditorDocumentType = "powerhouse/document-editor";
287
- //#endregion
288
284
  //#region document-models/document-editor/v1/gen/ph-factories.d.ts
289
285
  declare function defaultGlobalState(): DocumentEditorState;
290
286
  declare function defaultLocalState(): DocumentEditorLocalState;
@@ -302,28 +298,6 @@ declare function createDocumentEditorDocument(state?: Partial<{
302
298
  local?: Partial<DocumentEditorLocalState>;
303
299
  }>): DocumentEditorDocument;
304
300
  //#endregion
305
- //#region document-models/document-editor/v1/actions.d.ts
306
- /** Actions for the DocumentEditor document model */
307
- declare const actions: {
308
- setEditorName: (input: SetEditorNameInput) => SetEditorNameAction;
309
- addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
310
- removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
311
- setEditorStatus: (input: SetEditorStatusInput) => SetEditorStatusAction;
312
- setName: (name: string | {
313
- name: string;
314
- }) => document_model0.SetNameAction;
315
- setPreferredEditor: (input: string | null | {
316
- preferredEditor: string | null;
317
- }) => document_model0.SetPreferredEditorAction;
318
- undo: (count?: number, scope?: string) => document_model0.UndoAction;
319
- redo: (count?: number, scope?: string) => document_model0.RedoAction;
320
- prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
321
- loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
322
- name: string;
323
- }, operations: number) => document_model0.LoadStateAction;
324
- noop: (scope?: string) => document_model0.NOOPAction;
325
- };
326
- //#endregion
327
301
  //#region document-models/document-editor/v1/hooks.d.ts
328
302
  /** Hook to get a DocumentEditor document by its id */
329
303
  declare function useDocumentEditorDocumentById(documentId: string | null | undefined): [DocumentEditorDocument, DocumentDispatch<DocumentEditorAction>] | [undefined, undefined];
@@ -338,28 +312,21 @@ declare function useDocumentEditorDocumentsInSelectedFolder(): DocumentEditorDoc
338
312
  /** Document model module for the DocumentEditor document type */
339
313
  declare const DocumentEditor: {
340
314
  readonly version: 1;
341
- readonly reducer: document_model0.Reducer<DocumentEditorPHState>;
315
+ readonly reducer: import("document-model").Reducer<DocumentEditorPHState>;
342
316
  readonly actions: {
317
+ setName: typeof import("document-model").setName;
318
+ setPreferredEditor: typeof import("document-model").setPreferredEditor;
319
+ setSlug: typeof import("document-model").setSlug;
320
+ undo: typeof import("document-model").undo;
321
+ redo: typeof import("document-model").redo;
322
+ noop: typeof import("document-model").noop;
343
323
  setEditorName: (input: SetEditorNameInput) => SetEditorNameAction;
344
324
  addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
345
325
  removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
346
326
  setEditorStatus: (input: SetEditorStatusInput) => SetEditorStatusAction;
347
- setName: (name: string | {
348
- name: string;
349
- }) => document_model0.SetNameAction;
350
- setPreferredEditor: (input: string | null | {
351
- preferredEditor: string | null;
352
- }) => document_model0.SetPreferredEditorAction;
353
- undo: (count?: number, scope?: string) => document_model0.UndoAction;
354
- redo: (count?: number, scope?: string) => document_model0.RedoAction;
355
- prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
356
- loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
357
- name: string;
358
- }, operations: number) => document_model0.LoadStateAction;
359
- noop: (scope?: string) => document_model0.NOOPAction;
360
327
  };
361
- readonly utils: document_model0.DocumentModelUtils<DocumentEditorPHState>;
362
- readonly documentModel: document_model0.DocumentModelPHState;
328
+ readonly utils: import("document-model").DocumentModelUtils<DocumentEditorPHState>;
329
+ readonly documentModel: import("document-model").DocumentModelPHState;
363
330
  };
364
331
  //#endregion
365
332
  //#region document-models/document-editor/v1/utils.d.ts
@@ -370,7 +337,7 @@ declare const utils: DocumentModelUtils<DocumentEditorPHState>;
370
337
  declare const reducer: Reducer<DocumentEditorPHState>;
371
338
  //#endregion
372
339
  //#region document-models/document-editor/v1/gen/schema/zod.d.ts
373
- type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]> }>;
340
+ type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]>; }>;
374
341
  type definedNonNullAny = {};
375
342
  declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
376
343
  declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
@@ -389,5 +356,6 @@ declare function SetEditorStatusInputSchema(): z$1.ZodObject<Properties<SetEdito
389
356
  declare const initialGlobalState: DocumentEditorState;
390
357
  declare const initialLocalState: DocumentEditorLocalState;
391
358
  //#endregion
392
- export { Exact as $, assertIsDocumentEditorState as A, DocumentEditorBaseOperationsOperations as B, defaultLocalState as C, DocumentEditorDocumentSchema as D, DocumentEditorDocumentHeaderSchema as E, creators_d_exports as F, SetEditorNameAction as G, AddDocumentTypeAction as H, removeDocumentType as I, DocumentEditorLocalState as J, SetEditorStatusAction as K, setEditorName as L, isDocumentEditorState as M, documentModel as N, DocumentEditorPHStateSchema as O, addDocumentType as P, DocumentTypeItem as Q, setEditorStatus as R, defaultGlobalState as S, documentEditorDocumentType as T, DocumentEditorBaseOperationsAction as U, DocumentEditorAction as V, RemoveDocumentTypeAction as W, AddDocumentTypeInput as X, DocumentEditorPHState as Y, DocumentEditorState as Z, useDocumentEditorDocumentsInSelectedFolder as _, DocumentTypeItemSchema as a, Maybe as at, createDocumentEditorDocument as b, SetEditorStatusInputSchema as c, SetEditorNameInput as ct, isDefinedNonNullAny as d, Incremental as et, reducer as f, useDocumentEditorDocumentsInSelectedDrive as g, useDocumentEditorDocumentById as h, DocumentEditorStateSchema as i, MakeOptional as it, isDocumentEditorDocument as j, assertIsDocumentEditorDocument as k, StatusTypeSchema as l, SetEditorStatusInput as lt, DocumentEditor as m, initialLocalState as n, MakeEmpty as nt, RemoveDocumentTypeInputSchema as o, RemoveDocumentTypeInput as ot, utils as p, DocumentEditorDocument as q, AddDocumentTypeInputSchema as r, MakeMaybe as rt, SetEditorNameInputSchema as s, Scalars as st, initialGlobalState as t, InputMaybe as tt, definedNonNullAnySchema as u, StatusType as ut, useSelectedDocumentEditorDocument as v, defaultPHState as w, createState$1 as x, actions as y, DocumentEditorController as z };
393
- //# sourceMappingURL=index-Dm_gN1DR.d.ts.map
359
+ export { InputMaybe as $, isDocumentEditorState as A, AddDocumentTypeAction as B, defaultPHState as C, assertIsDocumentEditorDocument as D, DocumentEditorPHStateSchema as E, setEditorName as F, DocumentEditorDocument as G, RemoveDocumentTypeAction as H, setEditorStatus as I, AddDocumentTypeInput as J, DocumentEditorLocalState as K, DocumentEditorController as L, addDocumentType as M, creators_d_exports as N, assertIsDocumentEditorState as O, removeDocumentType as P, Incremental as Q, DocumentEditorBaseOperationsOperations as R, defaultLocalState as S, DocumentEditorDocumentSchema as T, SetEditorNameAction as U, DocumentEditorBaseOperationsAction as V, SetEditorStatusAction as W, DocumentTypeItem as X, DocumentEditorState as Y, Exact as Z, useDocumentEditorDocumentsInSelectedFolder as _, DocumentTypeItemSchema as a, Scalars as at, createState$1 as b, SetEditorStatusInputSchema as c, StatusType as ct, isDefinedNonNullAny as d, MakeEmpty as et, reducer as f, useDocumentEditorDocumentsInSelectedDrive as g, useDocumentEditorDocumentById as h, DocumentEditorStateSchema as i, RemoveDocumentTypeInput as it, documentModel as j, isDocumentEditorDocument as k, StatusTypeSchema as l, DocumentEditor as m, initialLocalState as n, MakeOptional as nt, RemoveDocumentTypeInputSchema as o, SetEditorNameInput as ot, utils as p, DocumentEditorPHState as q, AddDocumentTypeInputSchema as r, Maybe as rt, SetEditorNameInputSchema as s, SetEditorStatusInput as st, initialGlobalState as t, MakeMaybe as tt, definedNonNullAnySchema as u, useSelectedDocumentEditorDocument as v, DocumentEditorDocumentHeaderSchema as w, defaultGlobalState as x, createDocumentEditorDocument as y, DocumentEditorAction as z };
360
+ export {};
361
+ //# sourceMappingURL=index-C56rbYzd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C56rbYzd.d.ts","names":[],"sources":["../document-models/document-editor/v1/gen/schema/types.ts","../document-models/document-editor/v1/gen/types.ts","../document-models/document-editor/v1/gen/base-operations/actions.ts","../document-models/document-editor/v1/gen/actions.ts","../document-models/document-editor/v1/gen/base-operations/operations.ts","../document-models/document-editor/v1/gen/controller.ts","../document-models/document-editor/v1/gen/base-operations/creators.ts","../document-models/document-editor/v1/gen/document-model.ts","../document-models/document-editor/v1/gen/document-schema.ts","../document-models/document-editor/v1/gen/ph-factories.ts","../document-models/document-editor/v1/hooks.ts","../document-models/document-editor/v1/module.ts","../document-models/document-editor/v1/utils.ts","../document-models/document-editor/v1/gen/reducer.ts","../document-models/document-editor/v1/gen/schema/zod.ts","../document-models/document-editor/v1/gen/utils.ts"],"mappings":";;;;;KAAY,MAAM,KAAK;KACX,WAAW,KAAK;KAChB,MAAM;GAAa;QAC5B,WAAW,IAAI,EAAE;KAER,aAAa,GAAG,gBAAgB,KAAK,KAAK,GAAG,QACtD,UAAU,KAAK,MAAM,EAAE;KAEd,UAAU,GAAG,gBAAgB,KAAK,KAAK,GAAG,QACnD,UAAU,IAAI,MAAM,EAAE;KAEb,UACV;GAAa;GACb,gBAAgB,QACX,KAAK;KACA,YAAY,KACpB,OAEG,WAAW,KAAK,4CAA4C,EAAE;;KAGzD;EACV;IAAM;IAAe;;EACrB;IAAU;IAAe;;EACzB;IAAW;IAAgB;;EAC3B;IAAO;IAAe;;EACtB;IAAS;IAAe;;EACxB;IAAW;IAAgC;;EAC3C;IACE;MAAS;MAAe;;IACxB;MAAU;MAAe;;;EAE3B;IACE;MAAS;MAAc;;IACvB;MAAU;MAAc;;;EAE1B;IACE;MAAS;MAAc;;IACvB;MAAU;MAAc;;;EAE1B;IACE;MAAS;MAAc;;IACvB;MAAU;MAAc;;;EAE1B;IAAgB;IAAe;;EAC/B;IAAqB;IAAe;;EACpC;IAAiB;IAAe;;EAChC;IACE;IACA;;EAEF;IAAY;IAAe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AAA;;iBAGc,sBACd,iBACC,SAAS;;iBAKI,4BACd,yBACS,SAAS;;iBAKJ,yBACd,oBACC,YAAY;;iBAKC,+BACd,4BACS,YAAY;;;iBCvCP,sBAAsB;iBAQtB,qBAAqB;iBAIrB,kBAAkB;iBA0BlB,cACd,YAAY,QAAQ,cACpB,cAAc,QAAQ,sBACtB,aAAa,QAAQ,4BACpB;;;;;;iBAaa,6BACd,QAAQ;EACN,OAAO,QAAQ;EACf,WAAW,QAAQ;EACnB,SAAS,QAAQ;EACjB,QAAQ,QAAQ;KAEjB;;;;iBCxDa,8BACd,yCAEG,wBAAwB,iBAAiB;;iBAQ9B,sCACd,wBACA,iBAAiB;;iBASH,6CAAyC;;iBAMzC,8CAA0C;;;;cCpC7C;WACF;;;;;;;;;;;;;;;;;;;;cCJE,OAAO,mBAAmB;;;cCmE1B,SAAS,QAAQ;;;KChEzB,WAAW,KAAK,YAClB,WAAW,IAAI,IAAE,QAAQ,EAAE;KAGzB;cAEQ,sBAAmB,WAAa,KAAK;cAGrC,yBAAuB,IAAA,SAAA,IAAA,QAAA,wBAAA,IAAA,KAAA,kBAAA;cAIvB,kBAAgB,IAAA;;;;iBAEb,8BAA8B,IAAE,UAC9C,WAAW;iBAQG,6BAA6B,IAAE,UAC7C,WAAW;iBAUG,0BAA0B,IAAE,UAC1C,WAAW;iBASG,iCAAiC,IAAE,UACjD,WAAW;iBAOG,4BAA4B,IAAE,UAC5C,WAAW;iBAOG,8BAA8B,IAAE,UAC9C,WAAW;;;cClDA,oBAAoB;cAKpB,mBAAmB"}
@@ -0,0 +1,36 @@
1
+ import { K as SetDragAndDropEnabledAction, Q as SetDocumentTypesAction, X as SetAppNameAction, Y as RemoveDocumentTypeAction, Z as SetAppStatusAction, dt as RemoveDocumentTypeInput, gt as SetDragAndDropEnabledInput, ht as SetDocumentTypesInput, mt as SetAppStatusInput, nt as AddDocumentTypeInput, pt as SetAppNameInput, q as AddDocumentTypeAction } from "./index-ChQj71kz.js";
2
+ import { UpgradeManifest } from "document-model";
3
+ //#region document-models/app-module/v1/gen/document-type.d.ts
4
+ /**
5
+ * WARNING: DO NOT EDIT
6
+ * This file is auto-generated and updated by codegen
7
+ */
8
+ declare const appModuleDocumentType = "powerhouse/app";
9
+ //#endregion
10
+ //#region document-models/app-module/v1/actions.d.ts
11
+ /** Actions for the AppModule document model */
12
+ declare const actions: {
13
+ setName: typeof import("document-model").setName;
14
+ setPreferredEditor: typeof import("document-model").setPreferredEditor;
15
+ setSlug: typeof import("document-model").setSlug;
16
+ undo: typeof import("document-model").undo;
17
+ redo: typeof import("document-model").redo;
18
+ noop: typeof import("document-model").noop;
19
+ setAppName: (input: SetAppNameInput) => SetAppNameAction;
20
+ setAppStatus: (input: SetAppStatusInput) => SetAppStatusAction;
21
+ addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
22
+ removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
23
+ setDocumentTypes: (input: SetDocumentTypesInput) => SetDocumentTypesAction;
24
+ setDragAndDropEnabled: (input: SetDragAndDropEnabledInput) => SetDragAndDropEnabledAction;
25
+ };
26
+ //#endregion
27
+ //#region document-models/app-module/upgrades/versions.d.ts
28
+ declare const supportedVersions: readonly [1];
29
+ declare const latestVersion: 1;
30
+ //#endregion
31
+ //#region document-models/app-module/upgrades/upgrade-manifest.d.ts
32
+ declare const appModuleUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
33
+ //#endregion
34
+ export { appModuleDocumentType as a, actions as i, latestVersion as n, supportedVersions as r, appModuleUpgradeManifest as t };
35
+ export {};
36
+ //# sourceMappingURL=index-CDV0nUS6.d.ts.map