@powerhousedao/vetra 6.0.2-staging.9 → 6.1.0-dev.0
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.
- package/dist/app-module-D_cAVvt0.js +48 -0
- package/dist/app-module-D_cAVvt0.js.map +1 -0
- package/dist/codegen/index.d.ts +117 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +793 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/{connect-CTIucT0o.js → connect-BRlVKs1s.js} +1 -1
- package/dist/{connect-CTIucT0o.js.map → connect-BRlVKs1s.js.map} +1 -1
- package/dist/document-editor-1NFr9t3a.js +48 -0
- package/dist/document-editor-1NFr9t3a.js.map +1 -0
- package/dist/document-models/app-module/index.d.ts +1 -1
- package/dist/document-models/app-module/index.js +4 -2
- package/dist/document-models/document-editor/index.d.ts +1 -1
- package/dist/document-models/document-editor/index.js +4 -2
- package/dist/document-models/index.d.ts +5 -5
- package/dist/document-models/index.js +5 -5
- package/dist/document-models/processor-module/index.d.ts +1 -1
- package/dist/document-models/processor-module/index.js +4 -2
- package/dist/document-models/subgraph-module/index.d.ts +1 -1
- package/dist/document-models/subgraph-module/index.js +4 -2
- package/dist/document-models/vetra-package/index.d.ts +1 -1
- package/dist/document-models/vetra-package/index.js +2 -2
- package/dist/{editor-CbtrPBTP.js → editor-BwbJ65NZ.js} +4 -4
- package/dist/{editor-CbtrPBTP.js.map → editor-BwbJ65NZ.js.map} +1 -1
- package/dist/{editor-BSQfwcdz.js → editor-CJAn9WTA.js} +4 -4
- package/dist/{editor-BSQfwcdz.js.map → editor-CJAn9WTA.js.map} +1 -1
- package/dist/{editor-D70FYIwV.js → editor-CLERZjRS.js} +1 -1
- package/dist/{editor-D70FYIwV.js.map → editor-CLERZjRS.js.map} +1 -1
- package/dist/{editor-Dtg8STyT.js → editor-DWufJcmG.js} +4 -4
- package/dist/{editor-Dtg8STyT.js.map → editor-DWufJcmG.js.map} +1 -1
- package/dist/{editor-SfVorwsP.js → editor-DabfMxkF.js} +4 -4
- package/dist/{editor-SfVorwsP.js.map → editor-DabfMxkF.js.map} +1 -1
- package/dist/{editor-Bku8e2dr.js → editor-WWMGVelM.js} +4 -4
- package/dist/{editor-Bku8e2dr.js.map → editor-WWMGVelM.js.map} +1 -1
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/{factory-D8ZDOMP3.js → factory-Bd_0OaF8.js} +2 -2
- package/dist/{factory-D8ZDOMP3.js.map → factory-Bd_0OaF8.js.map} +1 -1
- package/dist/{factory-CweZppg6.js → factory-CEzh-u5J.js} +7 -7
- package/dist/factory-CEzh-u5J.js.map +1 -0
- package/dist/{hooks-Xexr33XS.js → hooks-Btogj1f0.js} +1 -1
- package/dist/{hooks-Xexr33XS.js.map → hooks-Btogj1f0.js.map} +1 -1
- package/dist/{module-BYEvqA47.d.ts → index-BPoF8P3O.d.ts} +57 -57
- package/dist/index-BPoF8P3O.d.ts.map +1 -0
- package/dist/{module-CpP8D2Hl.d.ts → index-BoGed4Fa.d.ts} +88 -88
- package/dist/index-BoGed4Fa.d.ts.map +1 -0
- package/dist/{index-BfK0fsx4.d.ts → index-C4s0aLv3.d.ts} +49 -49
- package/dist/index-C4s0aLv3.d.ts.map +1 -0
- package/dist/{index-BdmD5tsW.d.ts → index-ClaOdn_F.d.ts} +46 -46
- package/dist/index-ClaOdn_F.d.ts.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/{logger-BLNtquAC.js → logger-CYkStoEb.js} +1 -1
- package/dist/{logger-BLNtquAC.js.map → logger-CYkStoEb.js.map} +1 -1
- package/dist/module-DPyV2vUY.js +138 -0
- package/dist/module-DPyV2vUY.js.map +1 -0
- package/dist/{module-CCqD26Hf.d.ts → module-Drla4Vmn.d.ts} +1 -1
- package/dist/{module-CCqD26Hf.d.ts.map → module-Drla4Vmn.d.ts.map} +1 -1
- package/dist/{module-CZLiUtDI.js → module-dDKBr6QY.js} +1 -1
- package/dist/{module-CZLiUtDI.js.map → module-dDKBr6QY.js.map} +1 -1
- package/dist/{module-CXIFrq-R.js → module-jWN6gsmi.js} +7 -7
- package/dist/{module-CXIFrq-R.js.map → module-jWN6gsmi.js.map} +1 -1
- package/dist/module-pK0hpO6c.js +131 -0
- package/dist/module-pK0hpO6c.js.map +1 -0
- package/dist/module-ryHOwQp-.js +105 -0
- package/dist/module-ryHOwQp-.js.map +1 -0
- package/dist/module-x2Liyk0-.js +80 -0
- package/dist/module-x2Liyk0-.js.map +1 -0
- package/dist/ph-factories-B0_E6LY6.js +53 -0
- package/dist/ph-factories-B0_E6LY6.js.map +1 -0
- package/dist/ph-factories-B6PSPkPQ.js +52 -0
- package/dist/ph-factories-B6PSPkPQ.js.map +1 -0
- package/dist/ph-factories-Bn_HTUfT.js +50 -0
- package/dist/ph-factories-Bn_HTUfT.js.map +1 -0
- package/dist/ph-factories-CJXfT_Z1.js +51 -0
- package/dist/ph-factories-CJXfT_Z1.js.map +1 -0
- package/dist/processor-module-B7IAItXQ.js +48 -0
- package/dist/processor-module-B7IAItXQ.js.map +1 -0
- package/dist/processors/codegen/index.d.ts +3 -21305
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/vetra-read-model/index.js +1 -1
- package/dist/subgraph-module-CfzSZTNC.js +48 -0
- package/dist/subgraph-module-CfzSZTNC.js.map +1 -0
- package/dist/switchboard-CIUZkhea.js +8 -0
- package/dist/{switchboard-JOTFVXuj.js.map → switchboard-CIUZkhea.js.map} +1 -1
- package/dist/{useVetraDocument-DoAwvHVi.js → useVetraDocument-BQKyels4.js} +1 -1
- package/dist/{useVetraDocument-DoAwvHVi.js.map → useVetraDocument-BQKyels4.js.map} +1 -1
- package/dist/{module-CTPfENDU.js → utils-BRx88WW3.js} +5 -130
- package/dist/utils-BRx88WW3.js.map +1 -0
- package/dist/{module-BWlCj_0C.js → utils-Byjf33qt.js} +5 -137
- package/dist/utils-Byjf33qt.js.map +1 -0
- package/dist/{module-BoGgbKmO.js → utils-CWO5kDus.js} +5 -79
- package/dist/utils-CWO5kDus.js.map +1 -0
- package/dist/{module-D0SK3Nds.js → utils-CnZc-0E4.js} +5 -104
- package/dist/utils-CnZc-0E4.js.map +1 -0
- package/dist/{vetra-package-YNLxEA-U.js → vetra-package-BgTjv343.js} +2 -2
- package/dist/{vetra-package-YNLxEA-U.js.map → vetra-package-BgTjv343.js.map} +1 -1
- package/package.json +12 -8
- package/dist/app-module-Bbj7PI-S.js +0 -94
- package/dist/app-module-Bbj7PI-S.js.map +0 -1
- package/dist/document-editor-DS-bZMKx.js +0 -93
- package/dist/document-editor-DS-bZMKx.js.map +0 -1
- package/dist/factory-CweZppg6.js.map +0 -1
- package/dist/index-BdmD5tsW.d.ts.map +0 -1
- package/dist/index-BfK0fsx4.d.ts.map +0 -1
- package/dist/module-BWlCj_0C.js.map +0 -1
- package/dist/module-BYEvqA47.d.ts.map +0 -1
- package/dist/module-BoGgbKmO.js.map +0 -1
- package/dist/module-CTPfENDU.js.map +0 -1
- package/dist/module-CpP8D2Hl.d.ts.map +0 -1
- package/dist/module-D0SK3Nds.js.map +0 -1
- package/dist/processor-module-D0lRrrpW.js +0 -95
- package/dist/processor-module-D0lRrrpW.js.map +0 -1
- package/dist/subgraph-module-B3ipwOza.js +0 -92
- package/dist/subgraph-module-B3ipwOza.js.map +0 -1
- package/dist/switchboard-JOTFVXuj.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["generateId","documentEditorReducer","documentEditorUtils","documentEditorActions","documentEditorSpec","processorModuleReducer","processorModuleUtils","processorModuleActions","processorModuleSpec","subgraphModuleReducer","subgraphModuleUtils","subgraphModuleActions","subgraphModuleSpec","appModuleReducer","appModuleUtils","appModuleActions","appModuleSpec"],"sources":["../../codegen/extract.ts","../../codegen/generate-from-document.ts","../../document-models/app-module/app-module.json","../../document-models/document-editor/document-editor.json","../../document-models/processor-module/processor-module.json","../../document-models/subgraph-module/subgraph-module.json","../../codegen/specs.ts","../../codegen/spec-api.ts"],"sourcesContent":["/**\n * Inverse of the `generate*` functions in `@powerhousedao/codegen`.\n *\n * `generate*` reads source-of-truth documents and writes code into the project.\n * `extract*` reads the project's existing code/files and produces the\n * `powerhouse/*` documents that would have produced that code. Intended as a\n * one-shot migration step toward the documents-as-source-of-truth model: run\n * extraction, save the documents into `specs/`, and from then on regenerate\n * from the specs.\n */\nimport {\n generateId,\n type DocumentModelDocument,\n type DocumentModelGlobalState,\n type DocumentModelPHState,\n} from \"@powerhousedao/shared/document-model\";\nimport {\n getAppMetadata,\n getEditorMetadata,\n getOrCreateDirectory,\n getProcessorMetadata,\n getSubgraphMetadata,\n loadDocumentModelInDir,\n} from \"@powerhousedao/codegen/utils\";\nimport { documentModelDocumentModelModule } from \"document-model\";\nimport { readdirSync } from \"node:fs\";\nimport type { Project } from \"ts-morph\";\n\nconst isDefined = <T>(v: T | undefined | null): v is T => v != null;\n\n/* Import from gen/ directly to bypass the top-level barrel's `hooks.ts`,\n * which pulls in browser-only `@powerhousedao/reactor-browser`. */\nimport {\n createAppModuleDocument,\n type AppModuleDocument,\n type AppModuleGlobalState,\n} from \"../document-models/app-module/v1/gen/index.js\";\nimport {\n createDocumentEditorDocument,\n type DocumentEditorDocument,\n type DocumentEditorGlobalState,\n} from \"../document-models/document-editor/v1/gen/index.js\";\nimport {\n createProcessorModuleDocument,\n type ProcessorModuleDocument,\n type ProcessorModuleGlobalState,\n} from \"../document-models/processor-module/v1/gen/index.js\";\nimport {\n createSubgraphModuleDocument,\n type SubgraphModuleDocument,\n type SubgraphModuleGlobalState,\n} from \"../document-models/subgraph-module/v1/gen/index.js\";\n\n/* Builds a `powerhouse/document-editor` document for each editor in the\n * project's `editors/` directory. Drive editors (powerhouse/document-drive)\n * are excluded — those are handled by `extractAppDocuments`, matching how\n * `generateAllEditors` / `generateAllApps` are split.\n */\nexport function extractEditorDocuments(\n project: Project,\n): DocumentEditorDocument[] {\n const { directory: editorsDir } = getOrCreateDirectory(project, \"editors\");\n return editorsDir\n .getDirectories()\n .map((dir) => getEditorMetadata(project, dir.getBaseName()))\n .filter(isDefined)\n .filter(\n ({ documentTypes }) =>\n !documentTypes.includes(\"powerhouse/document-drive\"),\n )\n .map(({ name, documentTypes }) => {\n const global: DocumentEditorGlobalState = {\n name,\n documentTypes: documentTypes.map((documentType) => ({\n id: generateId(),\n documentType,\n })),\n status: \"CONFIRMED\",\n };\n const doc = createDocumentEditorDocument({ global });\n doc.header.name = name;\n return doc;\n });\n}\n\n/* Builds a `powerhouse/app` document for each drive editor (an editor whose\n * documentTypes include `powerhouse/document-drive`) — same selection\n * predicate used by `generateAllApps`.\n */\nexport function extractAppDocuments(project: Project): AppModuleDocument[] {\n const { directory: editorsDir } = getOrCreateDirectory(project, \"editors\");\n return editorsDir\n .getDirectories()\n .map((dir) => getAppMetadata(project, dir.getBaseName()))\n .filter(isDefined)\n .map(({ name, allowedDocumentTypes, isDragAndDropEnabled }) => {\n const global: AppModuleGlobalState = {\n name,\n status: \"CONFIRMED\",\n allowedDocumentTypes:\n allowedDocumentTypes.length > 0 ? allowedDocumentTypes : null,\n isDragAndDropEnabled: isDragAndDropEnabled ?? true,\n };\n const doc = createAppModuleDocument({ global });\n doc.header.name = name;\n return doc;\n });\n}\n\nexport function extractProcessorDocuments(\n project: Project,\n): ProcessorModuleDocument[] {\n const { directory: processorsDir } = getOrCreateDirectory(\n project,\n \"processors\",\n );\n return processorsDir\n .getDirectories()\n .map((dir) => getProcessorMetadata(project, dir.getBaseName()))\n .map(({ processorName, processorApps, processorType, documentTypes }) => {\n const global: ProcessorModuleGlobalState = {\n name: processorName,\n // Inverse of the mapping in processor-generator.ts: the document\n // model stores `relational`; codegen consumes `relationalDb`.\n type: processorType === \"relationalDb\" ? \"relational\" : processorType,\n documentTypes: documentTypes.map((documentType) => ({\n id: generateId(),\n documentType,\n })),\n status: \"CONFIRMED\",\n processorApps: [...processorApps],\n };\n const doc = createProcessorModuleDocument({ global });\n doc.header.name = processorName;\n return doc;\n });\n}\n\nexport function extractSubgraphDocuments(\n project: Project,\n): SubgraphModuleDocument[] {\n const { directory: subgraphsDir } = getOrCreateDirectory(\n project,\n \"subgraphs\",\n );\n return subgraphsDir\n .getDirectories()\n .map((dir) => getSubgraphMetadata(project, dir.getBaseName()).subgraphName)\n .filter(isDefined)\n .map((name) => {\n const global: SubgraphModuleGlobalState = { name, status: \"CONFIRMED\" };\n const doc = createSubgraphModuleDocument({ global });\n doc.header.name = name;\n return doc;\n });\n}\n\nexport function extractDocumentModelDocuments(\n project: Project,\n): DocumentModelDocument[] {\n const { directory: documentModelsDir } = getOrCreateDirectory(\n project,\n \"document-models\",\n );\n return readdirSync(documentModelsDir.getPath(), { withFileTypes: true })\n .map(loadDocumentModelInDir)\n .filter(isDefined)\n .map(buildDocumentModelDocument);\n}\n\nfunction buildDocumentModelDocument(\n globalState: DocumentModelGlobalState,\n): DocumentModelDocument {\n const state = documentModelDocumentModelModule.utils.createState({\n global: globalState,\n } as Partial<DocumentModelPHState>);\n const doc = documentModelDocumentModelModule.utils.createDocument(state);\n doc.header.name = globalState.name;\n return doc;\n}\n\nexport type ExtractedDocuments = {\n documentModels: DocumentModelDocument[];\n editors: DocumentEditorDocument[];\n apps: AppModuleDocument[];\n processors: ProcessorModuleDocument[];\n subgraphs: SubgraphModuleDocument[];\n};\n\n/* Mirrors `generateAll` — runs every extractor against the project and\n * returns the full set of documents keyed by module type.\n */\nexport function extractAllDocuments(project: Project): ExtractedDocuments {\n return {\n documentModels: extractDocumentModelDocuments(project),\n editors: extractEditorDocuments(project),\n apps: extractAppDocuments(project),\n processors: extractProcessorDocuments(project),\n subgraphs: extractSubgraphDocuments(project),\n };\n}\n","/**\n * Document-driven codegen wrappers. Each function takes a `PHDocument` of the\n * matching vetra type and dispatches to the generic generate* in\n * `@powerhousedao/codegen`. The state→args translation is lifted verbatim from\n * `packages/vetra/processors/codegen/document-handlers/generators/*-generator.ts`\n * so the agent-driven path and the reactor-driven path produce identical\n * output.\n *\n * Callers are responsible for `await project.save()` after one or more\n * `generate*FromDocument` calls — leaving it out here lets a CLI batch\n * multiple specs into a single save.\n */\nimport {\n generateApp,\n generateDocumentModel,\n generateEditor,\n generateProcessor,\n generateSubgraph,\n} from \"@powerhousedao/codegen\";\nimport {\n PROCESSOR_APPS,\n type ProcessorApp,\n type ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { kebabCase } from \"change-case\";\nimport type { Project } from \"ts-morph\";\n\n/* Import from gen/ directly to bypass the top-level barrel's `hooks.ts`,\n * which pulls in browser-only `@powerhousedao/reactor-browser`. */\nimport type { AppModuleDocument } from \"../document-models/app-module/v1/gen/index.js\";\nimport type {\n DocumentEditorDocument,\n DocumentTypeItem as EditorDocumentTypeItem,\n} from \"../document-models/document-editor/v1/gen/index.js\";\nimport type {\n DocumentTypeItem as ProcessorDocumentTypeItem,\n ProcessorModuleDocument,\n} from \"../document-models/processor-module/v1/gen/index.js\";\nimport type { SubgraphModuleDocument } from \"../document-models/subgraph-module/v1/gen/index.js\";\nimport type { DocumentModelDocument } from \"@powerhousedao/shared/document-model\";\n\nexport async function generateDocumentModelFromDocument(\n doc: DocumentModelDocument,\n project: Project,\n): Promise<void> {\n await generateDocumentModel(doc.state.global, project);\n}\n\nexport async function generateEditorFromDocument(\n doc: DocumentEditorDocument,\n project: Project,\n): Promise<void> {\n const state = doc.state.global;\n const documentTypes = state.documentTypes.map(\n (dt: EditorDocumentTypeItem) => dt.documentType,\n );\n await generateEditor(\n {\n editorName: state.name,\n documentTypes,\n editorId: kebabCase(state.name),\n },\n project,\n );\n}\n\nexport async function generateProcessorFromDocument(\n doc: ProcessorModuleDocument,\n project: Project,\n): Promise<void> {\n const state = doc.state.global;\n // Mirror processor-generator.ts:99-103: document model stores `relational`,\n // codegen expects `relationalDb`.\n let processorType: \"analytics\" | \"relationalDb\";\n if (state.type === \"analytics\") {\n processorType = \"analytics\";\n } else if (state.type === \"relational\") {\n processorType = \"relationalDb\";\n } else {\n throw new Error(`Unsupported processor type: \"${state.type}\"`);\n }\n\n const documentTypes = state.documentTypes.map(\n (dt: ProcessorDocumentTypeItem) => dt.documentType,\n );\n const processorApps = state.processorApps;\n if (!isProcessorApps(processorApps)) {\n throw new Error(`Unsupported processor apps: ${processorApps.join(\", \")}`);\n }\n await generateProcessor(\n {\n processorName: state.name,\n processorType,\n documentTypes,\n processorApps,\n },\n project,\n );\n}\n\nexport async function generateSubgraphFromDocument(\n doc: SubgraphModuleDocument,\n project: Project,\n): Promise<void> {\n await generateSubgraph(doc.state.global.name, project);\n}\n\nexport async function generateAppFromDocument(\n doc: AppModuleDocument,\n project: Project,\n): Promise<void> {\n const state = doc.state.global;\n await generateApp(\n {\n appName: state.name,\n appId: kebabCase(state.name),\n allowedDocumentTypes: state.allowedDocumentTypes ?? [],\n isDragAndDropEnabled: state.isDragAndDropEnabled,\n },\n project,\n );\n}\n\nfunction isProcessorApps(input: readonly string[]): input is ProcessorApps {\n if (input.length === 0) return false;\n if (new Set(input).size !== input.length) return false;\n if (!input.every((i) => PROCESSOR_APPS.includes(i as ProcessorApp))) {\n return false;\n }\n return true;\n}\n","","","","","import type {\n Action,\n DocumentModelGlobalState,\n PHDocument,\n Reducer,\n} from \"@powerhousedao/shared/document-model\";\nimport { kebabCase } from \"change-case\";\nimport { documentModelDocumentModelModule } from \"document-model\";\nimport { baseSaveToFile } from \"document-model/node\";\nimport { mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\n/* Import from gen/ + actions.ts directly (not the top-level barrel) so we\n * don't pull in `hooks.ts`, which depends on `@powerhousedao/reactor-browser`\n * (a browser-only module that breaks Node-side spec tooling). */\nimport appModuleSpec from \"../document-models/app-module/app-module.json\" with { type: \"json\" };\nimport { actions as appModuleActions } from \"../document-models/app-module/v1/actions.js\";\nimport {\n appModuleDocumentType,\n createAppModuleDocument,\n reducer as appModuleReducer,\n utils as appModuleUtils,\n} from \"../document-models/app-module/v1/gen/index.js\";\nimport documentEditorSpec from \"../document-models/document-editor/document-editor.json\" with { type: \"json\" };\nimport { actions as documentEditorActions } from \"../document-models/document-editor/v1/actions.js\";\nimport {\n createDocumentEditorDocument,\n documentEditorDocumentType,\n reducer as documentEditorReducer,\n utils as documentEditorUtils,\n} from \"../document-models/document-editor/v1/gen/index.js\";\nimport processorModuleSpec from \"../document-models/processor-module/processor-module.json\" with { type: \"json\" };\nimport { actions as processorModuleActions } from \"../document-models/processor-module/v1/actions.js\";\nimport {\n createProcessorModuleDocument,\n processorModuleDocumentType,\n reducer as processorModuleReducer,\n utils as processorModuleUtils,\n} from \"../document-models/processor-module/v1/gen/index.js\";\nimport subgraphModuleSpec from \"../document-models/subgraph-module/subgraph-module.json\" with { type: \"json\" };\nimport { actions as subgraphModuleActions } from \"../document-models/subgraph-module/v1/actions.js\";\nimport {\n createSubgraphModuleDocument,\n subgraphModuleDocumentType,\n reducer as subgraphModuleReducer,\n utils as subgraphModuleUtils,\n} from \"../document-models/subgraph-module/v1/gen/index.js\";\n\nexport const SPECS_DIRNAME = \"specs\";\n\nconst documentModelDocumentType = \"powerhouse/document-model\";\n\ntype ActionsModule = Record<string, (input?: any) => Action>;\n\ntype SpecEntry = {\n documentType: string;\n subdir: string;\n reducer: Reducer<any>;\n utils: { fileExtension: string };\n actions: ActionsModule;\n createDocument: (state?: any) => PHDocument;\n jsonSpec: DocumentModelGlobalState;\n};\n\nconst SPECS: Record<string, SpecEntry> = {\n [documentModelDocumentType]: {\n documentType: documentModelDocumentType,\n subdir: \"document-models\",\n reducer: documentModelDocumentModelModule.reducer,\n utils: documentModelDocumentModelModule.utils,\n actions: documentModelDocumentModelModule.actions as ActionsModule,\n createDocument: documentModelDocumentModelModule.utils.createDocument,\n jsonSpec: documentModelDocumentModelModule.documentModel\n .global as DocumentModelGlobalState,\n },\n [documentEditorDocumentType]: {\n documentType: documentEditorDocumentType,\n subdir: \"editors\",\n reducer: documentEditorReducer as Reducer<any>,\n utils: documentEditorUtils,\n actions: documentEditorActions as unknown as ActionsModule,\n createDocument: createDocumentEditorDocument as (state?: any) => PHDocument,\n jsonSpec: documentEditorSpec as unknown as DocumentModelGlobalState,\n },\n [processorModuleDocumentType]: {\n documentType: processorModuleDocumentType,\n subdir: \"processors\",\n reducer: processorModuleReducer as Reducer<any>,\n utils: processorModuleUtils,\n actions: processorModuleActions as unknown as ActionsModule,\n createDocument: createProcessorModuleDocument as (\n state?: any,\n ) => PHDocument,\n jsonSpec: processorModuleSpec as unknown as DocumentModelGlobalState,\n },\n [subgraphModuleDocumentType]: {\n documentType: subgraphModuleDocumentType,\n subdir: \"subgraphs\",\n reducer: subgraphModuleReducer as Reducer<any>,\n utils: subgraphModuleUtils,\n actions: subgraphModuleActions as unknown as ActionsModule,\n createDocument: createSubgraphModuleDocument as (state?: any) => PHDocument,\n jsonSpec: subgraphModuleSpec as unknown as DocumentModelGlobalState,\n },\n [appModuleDocumentType]: {\n documentType: appModuleDocumentType,\n subdir: \"apps\",\n reducer: appModuleReducer as Reducer<any>,\n utils: appModuleUtils,\n actions: appModuleActions as unknown as ActionsModule,\n createDocument: createAppModuleDocument as (state?: any) => PHDocument,\n jsonSpec: appModuleSpec as unknown as DocumentModelGlobalState,\n },\n};\n\nexport function getSpecEntry(documentType: string): SpecEntry {\n const entry = SPECS[documentType];\n if (!entry) {\n throw new Error(`No spec handler registered for \"${documentType}\"`);\n }\n return entry;\n}\n\nexport function listSpecDocumentTypes(): string[] {\n return Object.keys(SPECS);\n}\n\n/** Returns the directory that holds specs for a given document type. */\nexport function specDir(projectDir: string, documentType: string): string {\n return join(projectDir, SPECS_DIRNAME, getSpecEntry(documentType).subdir);\n}\n\n/**\n * Deterministic path for a doc-type + display name.\n * Format: `<projectDir>/<specsDir>/<subdir>/<kebab-name>.<ext>.phd`.\n */\nexport function specPath(\n projectDir: string,\n documentType: string,\n name: string,\n): string {\n const entry = getSpecEntry(documentType);\n const baseName = kebabCase(name);\n const ext = stripLeadingDot(entry.utils.fileExtension);\n return join(specDir(projectDir, documentType), `${baseName}.${ext}.phd`);\n}\n\n/* baseSaveToFile expects the extension WITHOUT a leading dot (\"phdm\"), while the\n * document-model utils export it WITH one (\".phdm\"). Normalize so we can pass\n * either through. */\nexport function stripLeadingDot(ext: string): string {\n return ext.startsWith(\".\") ? ext.slice(1) : ext;\n}\n\n/** Saves a document into `<projectDir>/specs/<subdir>/<kebab-name>.<ext>.phd`. */\nexport async function saveSpec(\n doc: PHDocument,\n projectDir: string,\n): Promise<string> {\n const entry = getSpecEntry(doc.header.documentType);\n const dir = specDir(projectDir, doc.header.documentType);\n await mkdir(dir, { recursive: true });\n const name = kebabCase(doc.header.name || \"untitled\");\n return baseSaveToFile(\n doc,\n dir,\n stripLeadingDot(entry.utils.fileExtension),\n name,\n );\n}\n","/**\n * File-backed mirror of reactor-mcp's tool surface. Same function names and\n * input shapes — same agent code works whether it's targeting a live reactor\n * or a `specs/` folder on disk. The \"drive id\" is the project directory;\n * \"document id\" is the file path of the spec.\n *\n * See `packages/reactor-mcp/src/tools/reactor.ts` for the canonical schema.\n */\nimport type {\n Action,\n DocumentModelGlobalState,\n OperationSpecification,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport { camelCase } from \"change-case\";\nimport { baseLoadFromFile } from \"document-model/node\";\nimport { readdir, rm, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport {\n getSpecEntry,\n listSpecDocumentTypes,\n saveSpec,\n specDir,\n SPECS_DIRNAME,\n} from \"./specs.js\";\n\nexport type DocumentModelInfo = {\n name: string;\n type: string;\n description: string;\n extension: string;\n authorName: string;\n authorWebsite: string;\n};\n\n/** Mirrors reactor-mcp `getDocumentModels`. */\nexport function getDocumentModels(): DocumentModelInfo[] {\n return listSpecDocumentTypes().map((documentType) => {\n const { jsonSpec } = getSpecEntry(documentType);\n return {\n name: jsonSpec.name,\n type: jsonSpec.id,\n description: jsonSpec.description ?? \"\",\n extension: jsonSpec.extension ?? \"\",\n authorName: jsonSpec.author?.name ?? \"\",\n authorWebsite: jsonSpec.author?.website ?? \"\",\n };\n });\n}\n\n/** Mirrors reactor-mcp `getDocumentModelSchema`. Returns the full\n * `DocumentModelGlobalState` (schema + operations + errors), same payload\n * shape reactor-mcp serves. */\nexport function getDocumentModelSchema(\n documentType: string,\n): DocumentModelGlobalState {\n return getSpecEntry(documentType).jsonSpec;\n}\n\n/** Mirrors reactor-mcp `getDocument`. Path = file location on disk. */\nexport async function getDocument(path: string): Promise<PHDocument> {\n // We don't know the documentType ahead of time, so try each registered\n // reducer until one loads cleanly. baseLoadFromFile validates against the\n // reducer; the wrong reducer rejects. Try the path's parent directory first\n // as a fast hint (matches our `specs/<subdir>/` convention).\n const subdir = pathSubdir(path);\n const hint = subdir\n ? listSpecDocumentTypes().find((t) => getSpecEntry(t).subdir === subdir)\n : undefined;\n const order = hint\n ? [hint, ...listSpecDocumentTypes().filter((t) => t !== hint)]\n : listSpecDocumentTypes();\n\n let lastError: unknown;\n for (const documentType of order) {\n const { reducer } = getSpecEntry(documentType);\n try {\n return await baseLoadFromFile(path, reducer);\n } catch (err) {\n lastError = err;\n }\n }\n throw new Error(\n `Failed to load spec at \"${path}\": no registered reducer accepted it. Last error: ${String(lastError)}`,\n );\n}\n\n/** Mirrors reactor-mcp `getDocuments`. `parentId` is the project directory\n * containing `specs/`. */\nexport async function getDocuments(\n projectDir: string,\n opts: { documentType?: string } = {},\n): Promise<PHDocument[]> {\n const documentTypes = opts.documentType\n ? [opts.documentType]\n : listSpecDocumentTypes();\n\n const results: PHDocument[] = [];\n for (const documentType of documentTypes) {\n const dir = specDir(projectDir, documentType);\n const exists = await stat(dir).then(\n (s) => s.isDirectory(),\n () => false,\n );\n if (!exists) continue;\n const entries = await readdir(dir);\n for (const entry of entries) {\n if (!entry.endsWith(\".phd\")) continue;\n results.push(await getDocument(join(dir, entry)));\n }\n }\n return results;\n}\n\n/** Mirrors reactor-mcp `createDocument`. Returns an in-memory document; the\n * caller persists with `saveSpec`. */\nexport function createDocument(\n documentType: string,\n opts: {\n name?: string;\n initialState?: { global?: unknown; local?: unknown };\n } = {},\n): PHDocument {\n const entry = getSpecEntry(documentType);\n const doc = entry.createDocument(opts.initialState);\n if (opts.name) doc.header.name = opts.name;\n return doc;\n}\n\nexport type ActionInput = {\n type: string;\n input?: unknown;\n scope?: string;\n};\n\n/** Mirrors reactor-mcp `addActions`. Validates every action up front against\n * the document model's latest specification, then applies them in order via\n * the reducer. If any action is invalid, throws an aggregated error and\n * leaves `doc` untouched. */\nexport function addActions(\n doc: PHDocument,\n actions: ActionInput[],\n): PHDocument {\n const entry = getSpecEntry(doc.header.documentType);\n const built = validateAndBuildActions(entry, actions);\n let current = doc;\n for (let i = 0; i < built.length; i++) {\n const action = built[i];\n current = entry.reducer(current, action);\n /* The base reducer wraps custom reducers in try/catch and records any\n * throw as `operation.error` instead of propagating. For an atomic\n * batch apply that's the wrong shape — surface the error so callers\n * (and `saveSpec`) bail out before persisting a half-applied doc. */\n const scope = action.scope ?? \"global\";\n const ops = current.operations[scope];\n const last = ops?.[ops.length - 1];\n if (last?.error) {\n const failures: ActionValidationError[] = [\n {\n index: i,\n type: actions[i].type ?? \"<missing>\",\n errors: [`Reducer error: ${last.error}`],\n },\n ];\n throw formatValidationError(failures);\n }\n }\n return current;\n}\n\nexport type ActionValidationError = {\n /** Position in the input array. */\n index: number;\n /** The action's `type` field (or `<missing>` when not a string). */\n type: string;\n /** Human-readable reasons the action was rejected. */\n errors: string[];\n};\n\n/** Validate a list of actions without applying them. Returns one entry per\n * invalid action with all of its problems aggregated. Used by `addActions`\n * and exposed for callers that want a dry-run check. */\nexport function validateActions(\n documentType: string,\n actions: ActionInput[],\n): ActionValidationError[] {\n const entry = getSpecEntry(documentType);\n const failures: ActionValidationError[] = [];\n for (let i = 0; i < actions.length; i++) {\n const errors = collectActionErrors(entry, actions[i]);\n if (errors.length > 0) {\n failures.push({ index: i, type: actions[i].type ?? \"<missing>\", errors });\n }\n }\n return failures;\n}\n\n/** Run validateActions across the batch and, on success, materialize the\n * built Action objects. On any failure throws with every action's errors\n * aggregated — the caller never sees a partial apply. */\nfunction validateAndBuildActions(\n entry: ReturnType<typeof getSpecEntry>,\n actions: ActionInput[],\n): Action[] {\n const built: Action[] = [];\n const failures: ActionValidationError[] = [];\n for (let i = 0; i < actions.length; i++) {\n const item = actions[i];\n const errors = collectActionErrors(entry, item);\n if (errors.length > 0) {\n failures.push({ index: i, type: item.type ?? \"<missing>\", errors });\n continue;\n }\n built.push(buildAction(entry.actions, item));\n }\n if (failures.length > 0) throw formatValidationError(failures);\n return built;\n}\n\n/* Mirrors reactor-mcp's `validateDocumentModelAction`: confirms the operation\n * is declared in the latest spec, looks up the action creator, runs the\n * creator's own input validation, and checks scope. */\nfunction collectActionErrors(\n entry: ReturnType<typeof getSpecEntry>,\n item: ActionInput,\n): string[] {\n const errors: string[] = [];\n if (typeof item.type !== \"string\" || item.type.length === 0) {\n errors.push(\"Missing `type` field\");\n return errors;\n }\n const specs = entry.jsonSpec.specifications;\n if (!specs || specs.length === 0) {\n errors.push(\"Document model has no specifications\");\n return errors;\n }\n const latest = specs[specs.length - 1];\n let operation: OperationSpecification | undefined;\n for (const module of latest.modules ?? []) {\n const found = (module.operations ?? []).find((op) => op.name === item.type);\n if (found) {\n operation = found;\n break;\n }\n }\n if (!operation) {\n errors.push(\n `Operation \"${item.type}\" is not defined in any module of the document model`,\n );\n }\n const creatorName = camelCase(item.type);\n const creator = entry.actions[creatorName];\n if (!creator) {\n errors.push(`No action creator found.`);\n } else {\n try {\n creator(item.input);\n } catch (err) {\n errors.push(\n `Input validation error: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n }\n if (operation?.scope && item.scope && item.scope !== operation.scope) {\n errors.push(\n `Scope \"${item.scope}\" does not match operation scope \"${operation.scope}\"`,\n );\n }\n return errors;\n}\n\nfunction formatValidationError(failures: ActionValidationError[]): Error {\n const lines = failures.map(\n (f) => ` [${f.index}] ${f.type}: ${f.errors.join(\"; \")}`,\n );\n const header =\n failures.length === 1\n ? \"1 action failed validation:\"\n : `${failures.length} actions failed validation:`;\n const err = new Error([header, ...lines].join(\"\\n\")) as Error & {\n failures: ActionValidationError[];\n };\n err.failures = failures;\n return err;\n}\n\nfunction buildAction(\n actionsModule: Record<string, (input?: any) => Action>,\n item: ActionInput,\n): Action {\n const creatorName = camelCase(item.type);\n const creator = actionsModule[creatorName];\n if (!creator) {\n throw new Error(\n `No action creator found for \"${item.type}\" (looked up as \"${creatorName}\")`,\n );\n }\n const action = creator(item.input);\n // Caller may override the scope (creator picks a default).\n if (item.scope) action.scope = item.scope;\n return action;\n}\n\n/** Mirrors reactor-mcp `deleteDocument`. Removes the spec file from disk. */\nexport async function deleteDocument(\n path: string,\n): Promise<{ success: boolean }> {\n try {\n await rm(path);\n return { success: true };\n } catch {\n return { success: false };\n }\n}\n\n/* Convenience: persist after applying actions. Matches the typical agent\n * loop `getDocument → addActions → saveSpec` from the plan. */\nexport async function addActionsAndSave(\n path: string,\n projectDir: string,\n actions: ActionInput[],\n): Promise<{ doc: PHDocument; savedPath: string }> {\n const doc = await getDocument(path);\n const next = addActions(doc, actions);\n const savedPath = await saveSpec(next, projectDir);\n return { doc: next, savedPath };\n}\n\nfunction pathSubdir(filePath: string): string | undefined {\n const parts = filePath.split(/[/\\\\]/);\n const i = parts.lastIndexOf(SPECS_DIRNAME);\n if (i < 0 || i + 1 >= parts.length) return undefined;\n return parts[i + 1];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,aAAgB,MAAoC,KAAK;AA8B/D,SAAgB,uBACd,SAC0B;CAC1B,MAAM,EAAE,WAAW,eAAe,qBAAqB,SAAS,UAAU;AAC1E,QAAO,WACJ,gBAAgB,CAChB,KAAK,QAAQ,kBAAkB,SAAS,IAAI,aAAa,CAAC,CAAC,CAC3D,OAAO,UAAU,CACjB,QACE,EAAE,o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
1
|
-
{"version":3,"file":"connect-
|
|
1
|
+
{"version":3,"file":"connect-BRlVKs1s.js","names":[],"sources":["../processors/connect.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { ProcessorFactoryBuilder } from \"@powerhousedao/reactor-browser\";\n\nexport const processorFactoryBuilders: ProcessorFactoryBuilder[] = [];\n"],"mappings":";AAMA,MAAa,2BAAsD,EAAE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { l as isDocumentEditorDocument, s as assertIsDocumentEditorDocument } from "./utils-CnZc-0E4.js";
|
|
2
|
+
import { t as DocumentEditor } from "./module-ryHOwQp-.js";
|
|
3
|
+
import { PHDocumentController } from "document-model";
|
|
4
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument } from "@powerhousedao/reactor-browser";
|
|
5
|
+
//#region document-models/document-editor/v1/gen/controller.ts
|
|
6
|
+
/**
|
|
7
|
+
* WARNING: DO NOT EDIT
|
|
8
|
+
* This file is auto-generated and updated by codegen
|
|
9
|
+
*/
|
|
10
|
+
const DocumentEditorController = PHDocumentController.forDocumentModel(DocumentEditor);
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region document-models/document-editor/v1/hooks.ts
|
|
13
|
+
/** Hook to get a DocumentEditor document by its id */
|
|
14
|
+
function useDocumentEditorDocumentById(documentId) {
|
|
15
|
+
const [document, dispatch] = useDocumentById(documentId);
|
|
16
|
+
if (!isDocumentEditorDocument(document)) return [void 0, void 0];
|
|
17
|
+
return [document, dispatch];
|
|
18
|
+
}
|
|
19
|
+
/** Hook to get the selected DocumentEditor document */
|
|
20
|
+
function useSelectedDocumentEditorDocument() {
|
|
21
|
+
const [document, dispatch] = useSelectedDocument();
|
|
22
|
+
assertIsDocumentEditorDocument(document);
|
|
23
|
+
return [document, dispatch];
|
|
24
|
+
}
|
|
25
|
+
/** Hook to get all DocumentEditor documents in the selected drive */
|
|
26
|
+
function useDocumentEditorDocumentsInSelectedDrive() {
|
|
27
|
+
return useDocumentsInSelectedDrive()?.filter(isDocumentEditorDocument);
|
|
28
|
+
}
|
|
29
|
+
/** Hook to get all DocumentEditor documents in the selected folder */
|
|
30
|
+
function useDocumentEditorDocumentsInSelectedFolder() {
|
|
31
|
+
return useDocumentsInSelectedFolder()?.filter(isDocumentEditorDocument);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region document-models/document-editor/upgrades/versions.ts
|
|
35
|
+
const supportedVersions = [1];
|
|
36
|
+
const latestVersion = supportedVersions[0];
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region document-models/document-editor/upgrades/upgrade-manifest.ts
|
|
39
|
+
const documentEditorUpgradeManifest = {
|
|
40
|
+
documentType: "powerhouse/document-editor",
|
|
41
|
+
latestVersion,
|
|
42
|
+
supportedVersions,
|
|
43
|
+
upgrades: {}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
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
|
+
|
|
48
|
+
//# sourceMappingURL=document-editor-1NFr9t3a.js.map
|
|
@@ -0,0 +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,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as SetAppStatusAction, A as assertIsAppModuleDocument, B as removeDocumentType, C as defaultGlobalState, D as AppModuleDocumentHeaderSchema, E as appModuleDocumentType, F as AppModuleDndOperationsOperations, G as AppModuleBaseOperationsOperations, H as setAppStatus, I as creators_d_exports$1, J as SetDragAndDropEnabledAction, K as AppModuleAction, L as setDragAndDropEnabled, M as isAppModuleDocument, N as isAppModuleState, O as AppModuleDocumentSchema, P as documentModel, Q as SetAppNameAction, R as addDocumentType, S as createState, T as defaultPHState, U as setDocumentTypes, V as setAppName, W as AppModuleController, X as AppModuleBaseOperationsAction, Y as AddDocumentTypeAction, Z as RemoveDocumentTypeAction, _ as useAppModuleDocumentsInSelectedDrive, _t as SetDocumentTypesInput, a as RemoveDocumentTypeInputSchema, at as AppModuleState, b as actions, c as SetDocumentTypesInputSchema, ct as InputMaybe, d as definedNonNullAnySchema, dt as MakeOptional, et as SetDocumentTypesAction, f as isDefinedNonNullAny, ft as Maybe, g as useAppModuleDocumentById, gt as SetAppStatusInput, h as AppModule, ht as SetAppNameInput, i as AppModuleStateSchema, it as AddDocumentTypeInput, j as assertIsAppModuleState, k as AppModulePHStateSchema, l as SetDragAndDropEnabledInputSchema, lt as MakeEmpty, m as utils, mt as Scalars, n as initialLocalState, nt as AppModuleLocalState, o as SetAppNameInputSchema, ot as Exact, p as reducer, pt as RemoveDocumentTypeInput, q as AppModuleDndOperationsAction, r as AddDocumentTypeInputSchema, rt as AppModulePHState, s as SetAppStatusInputSchema, st as Incremental, t as initialGlobalState, tt as AppModuleDocument, u as StatusTypeSchema, ut as MakeMaybe, v as useAppModuleDocumentsInSelectedFolder, vt as SetDragAndDropEnabledInput, w as defaultLocalState, x as createAppModuleDocument, y as useSelectedAppModuleDocument, yt as StatusType, z as creators_d_exports } from "../../index-C4s0aLv3.js";
|
|
2
2
|
import { UpgradeManifest } from "document-model";
|
|
3
3
|
|
|
4
4
|
//#region document-models/app-module/upgrades/versions.d.ts
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
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";
|
|
3
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,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as Exact, A as assertIsDocumentEditorState, B as DocumentEditorBaseOperationsOperations, C as defaultLocalState, D as DocumentEditorDocumentSchema, E as DocumentEditorDocumentHeaderSchema, F as creators_d_exports, G as SetEditorNameAction, H as AddDocumentTypeAction, I as removeDocumentType, J as DocumentEditorLocalState, K as SetEditorStatusAction, L as setEditorName, M as isDocumentEditorState, N as documentModel, O as DocumentEditorPHStateSchema, P as addDocumentType, Q as DocumentTypeItem, R as setEditorStatus, S as defaultGlobalState, T as documentEditorDocumentType, U as DocumentEditorBaseOperationsAction, V as DocumentEditorAction, W as RemoveDocumentTypeAction, X as AddDocumentTypeInput, Y as DocumentEditorPHState, Z as DocumentEditorState, _ as useDocumentEditorDocumentsInSelectedFolder, a as DocumentTypeItemSchema, at as Maybe, b as createDocumentEditorDocument, c as SetEditorStatusInputSchema, ct as SetEditorNameInput, d as isDefinedNonNullAny, et as Incremental, f as reducer, g as useDocumentEditorDocumentsInSelectedDrive, h as useDocumentEditorDocumentById, i as DocumentEditorStateSchema, it as MakeOptional, j as isDocumentEditorDocument, k as assertIsDocumentEditorDocument, l as StatusTypeSchema, lt as SetEditorStatusInput, m as DocumentEditor, n as initialLocalState, nt as MakeEmpty, o as RemoveDocumentTypeInputSchema, ot as RemoveDocumentTypeInput, p as utils, q as DocumentEditorDocument, r as AddDocumentTypeInputSchema, rt as MakeMaybe, s as SetEditorNameInputSchema, st as Scalars, t as initialGlobalState, tt as InputMaybe, u as definedNonNullAnySchema, ut as StatusType, v as useSelectedDocumentEditorDocument, w as defaultPHState, x as createState, y as actions, z as DocumentEditorController } from "../../index-ClaOdn_F.js";
|
|
2
2
|
import { UpgradeManifest } from "document-model";
|
|
3
3
|
|
|
4
4
|
//#region document-models/document-editor/upgrades/versions.d.ts
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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";
|
|
3
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as VetraPackage } from "../module-
|
|
1
|
+
import { h as AppModule } from "../index-C4s0aLv3.js";
|
|
2
|
+
import { m as DocumentEditor } from "../index-ClaOdn_F.js";
|
|
3
|
+
import { _ as ProcessorModule } from "../index-BoGed4Fa.js";
|
|
4
|
+
import { d as SubgraphModule } from "../index-BPoF8P3O.js";
|
|
5
|
+
import { t as VetraPackage } from "../module-Drla4Vmn.js";
|
|
6
6
|
export { AppModule as AppModuleV1, DocumentEditor as DocumentEditorV1, ProcessorModule as ProcessorModuleV1, SubgraphModule as SubgraphModuleV1, VetraPackage as VetraPackageV1 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as AppModule } from "../module-
|
|
2
|
-
import { t as DocumentEditor } from "../module-
|
|
3
|
-
import { t as ProcessorModule } from "../module-
|
|
4
|
-
import { t as SubgraphModule } from "../module-
|
|
5
|
-
import { t as VetraPackage } from "../module-
|
|
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";
|
|
6
6
|
export { AppModule as AppModuleV1, DocumentEditor as DocumentEditorV1, ProcessorModule as ProcessorModuleV1, SubgraphModule as SubgraphModuleV1, VetraPackage as VetraPackageV1 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as SetProcessorNameAction, A as ProcessorModuleDocumentSchema, B as removeDocumentType, C as createProcessorModuleDocument, D as defaultPHState, E as defaultLocalState, F as isProcessorModuleState, G as ProcessorModuleController, H as setProcessorName, I as documentModel, J as AddDocumentTypeAction, K as ProcessorModuleBaseOperationsOperations, L as addDocumentType, M as assertIsProcessorModuleDocument, N as assertIsProcessorModuleState, O as processorModuleDocumentType, P as isProcessorModuleDocument, Q as RemoveProcessorAppAction, R as addProcessorApp, S as actions, St as StatusType, T as defaultGlobalState, U as setProcessorStatus, V as removeProcessorApp, W as setProcessorType, X as ProcessorModuleBaseOperationsAction, Y as AddProcessorAppAction, Z as RemoveDocumentTypeAction, _ as ProcessorModule, _t as RemoveProcessorAppInput, a as DocumentTypeItemSchema, at as AddDocumentTypeInput, b as useProcessorModuleDocumentsInSelectedFolder, bt as SetProcessorStatusInput, c as RemoveProcessorAppInputSchema, ct as Exact, d as SetProcessorTypeInputSchema, dt as MakeEmpty, et as SetProcessorStatusAction, f as StatusTypeSchema, ft as MakeMaybe, g as utils, gt as RemoveDocumentTypeInput, h as reducer, ht as ProcessorModuleState, i as AddProcessorAppInputSchema, it as ProcessorModulePHState, j as ProcessorModulePHStateSchema, k as ProcessorModuleDocumentHeaderSchema, l as SetProcessorNameInputSchema, lt as Incremental, m as isDefinedNonNullAny, mt as Maybe, n as initialLocalState, nt as ProcessorModuleDocument, o as ProcessorModuleStateSchema, ot as AddProcessorAppInput, p as definedNonNullAnySchema, pt as MakeOptional, q as ProcessorModuleAction, r as AddDocumentTypeInputSchema, rt as ProcessorModuleLocalState, s as RemoveDocumentTypeInputSchema, st as DocumentTypeItem, t as initialGlobalState, tt as SetProcessorTypeAction, u as SetProcessorStatusInputSchema, ut as InputMaybe, v as useProcessorModuleDocumentById, vt as Scalars, w as createState, x as useSelectedProcessorModuleDocument, xt as SetProcessorTypeInput, y as useProcessorModuleDocumentsInSelectedDrive, yt as SetProcessorNameInput, z as creators_d_exports } from "../../index-BoGed4Fa.js";
|
|
2
2
|
import { UpgradeManifest } from "document-model";
|
|
3
3
|
|
|
4
4
|
//#region document-models/processor-module/upgrades/versions.d.ts
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
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";
|
|
3
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,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as StatusType, A as documentModel, B as SubgraphModuleDocument, C as SubgraphModuleDocumentHeaderSchema, D as assertIsSubgraphModuleState, E as assertIsSubgraphModuleDocument, F as SubgraphModuleBaseOperationsOperations, G as InputMaybe, H as SubgraphModulePHState, I as SubgraphModuleAction, J as MakeOptional, K as MakeEmpty, L as SetSubgraphNameAction, M as setSubgraphName, N as setSubgraphStatus, O as isSubgraphModuleDocument, P as SubgraphModuleController, Q as SetSubgraphStatusInput, R as SetSubgraphStatusAction, S as subgraphModuleDocumentType, T as SubgraphModulePHStateSchema, U as Exact, V as SubgraphModuleLocalState, W as Incremental, X as Scalars, Y as Maybe, Z as SetSubgraphNameInput, _ as createState, a as StatusTypeSchema, b as defaultLocalState, c as isDefinedNonNullAny, d as SubgraphModule, et as SubgraphModuleState, f as useSelectedSubgraphModuleDocument, g as actions, h as useSubgraphModuleDocumentsInSelectedFolder, i as SetSubgraphStatusInputSchema, j as creators_d_exports, k as isSubgraphModuleState, l as reducer, m as useSubgraphModuleDocumentsInSelectedDrive, n as initialLocalState, o as SubgraphModuleStateSchema, p as useSubgraphModuleDocumentById, q as MakeMaybe, r as SetSubgraphNameInputSchema, s as definedNonNullAnySchema, t as initialGlobalState, u as utils, v as createSubgraphModuleDocument, w as SubgraphModuleDocumentSchema, x as defaultPHState, y as defaultGlobalState, z as SubgraphModuleBaseOperationsAction } from "../../index-BPoF8P3O.js";
|
|
2
2
|
import { UpgradeManifest } from "document-model";
|
|
3
3
|
|
|
4
4
|
//#region document-models/subgraph-module/upgrades/versions.d.ts
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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";
|
|
3
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,4 +1,4 @@
|
|
|
1
|
-
import { $ as VetraPackageDocument, A as vetraPackageDocumentType, At as SetPackageDescriptionAction, B as creators_d_exports, C as isDefinedNonNullAny, Ct as VetraPackageAction, D as defaultGlobalState, Dt as SetPackageAuthorNameAction, E as createVetraPackageDocument, Et as SetPackageAuthorAction, F as assertIsVetraPackageState, G as setPackageCategory, H as setPackageAuthor, I as isVetraPackageDocument, J as setPackageName, K as setPackageDescription, L as isVetraPackageState, M as VetraPackageDocumentSchema, Mt as SetPackageNameAction, N as VetraPackagePHStateSchema, Nt as SetPackageNpmUrlAction, O as defaultLocalState, Ot as SetPackageAuthorWebsiteAction, P as assertIsVetraPackageDocument, Pt as VetraPackageBaseOperationsAction, Q as actions, R as documentModel, S as definedNonNullAnySchema, St as VetraPackageState, T as createState, Tt as RemovePackageKeywordAction, U as setPackageAuthorName, V as removePackageKeyword, W as setPackageAuthorWebsite, X as VetraPackageController, Y as setPackageNpmUrl, Z as VetraPackageBaseOperationsOperations, _ as SetPackageDescriptionInputSchema, _t as SetPackageCategoryInput, a as useVetraPackageDocumentsInSelectedDrive, at as Incremental, b as SetPackageNpmUrlInputSchema, bt as SetPackageNameInput, c as initialLocalState, ct as MakeEmpty, d as KeywordSchema, dt as Maybe, et as VetraPackageLocalState, f as RemovePackageKeywordInputSchema, ft as RemovePackageKeywordInput, g as SetPackageCategoryInputSchema, gt as SetPackageAuthorWebsiteInput, h as SetPackageAuthorWebsiteInputSchema, ht as SetPackageAuthorNameInput, i as useVetraPackageDocumentById, it as Exact, j as VetraPackageDocumentHeaderSchema, jt as SetPackageGithubUrlAction, k as defaultPHState, kt as SetPackageCategoryAction, l as AddPackageKeywordInputSchema, lt as MakeMaybe, m as SetPackageAuthorNameInputSchema, mt as SetPackageAuthorInput, n as utils, nt as AddPackageKeywordInput, o as useVetraPackageDocumentsInSelectedFolder, ot as InputMaybe, p as SetPackageAuthorInputSchema, pt as Scalars, q as setPackageGithubUrl, r as useSelectedVetraPackageDocument, rt as Author, s as initialGlobalState, st as Keyword, t as VetraPackage, tt as VetraPackagePHState, u as AuthorSchema, ut as MakeOptional, v as SetPackageGithubUrlInputSchema, vt as SetPackageDescriptionInput, w as reducer, wt as AddPackageKeywordAction, x as VetraPackageStateSchema, xt as SetPackageNpmUrlInput, y as SetPackageNameInputSchema, yt as SetPackageGithubUrlInput, z as addPackageKeyword } from "../../module-
|
|
1
|
+
import { $ as VetraPackageDocument, A as vetraPackageDocumentType, At as SetPackageDescriptionAction, B as creators_d_exports, C as isDefinedNonNullAny, Ct as VetraPackageAction, D as defaultGlobalState, Dt as SetPackageAuthorNameAction, E as createVetraPackageDocument, Et as SetPackageAuthorAction, F as assertIsVetraPackageState, G as setPackageCategory, H as setPackageAuthor, I as isVetraPackageDocument, J as setPackageName, K as setPackageDescription, L as isVetraPackageState, M as VetraPackageDocumentSchema, Mt as SetPackageNameAction, N as VetraPackagePHStateSchema, Nt as SetPackageNpmUrlAction, O as defaultLocalState, Ot as SetPackageAuthorWebsiteAction, P as assertIsVetraPackageDocument, Pt as VetraPackageBaseOperationsAction, Q as actions, R as documentModel, S as definedNonNullAnySchema, St as VetraPackageState, T as createState, Tt as RemovePackageKeywordAction, U as setPackageAuthorName, V as removePackageKeyword, W as setPackageAuthorWebsite, X as VetraPackageController, Y as setPackageNpmUrl, Z as VetraPackageBaseOperationsOperations, _ as SetPackageDescriptionInputSchema, _t as SetPackageCategoryInput, a as useVetraPackageDocumentsInSelectedDrive, at as Incremental, b as SetPackageNpmUrlInputSchema, bt as SetPackageNameInput, c as initialLocalState, ct as MakeEmpty, d as KeywordSchema, dt as Maybe, et as VetraPackageLocalState, f as RemovePackageKeywordInputSchema, ft as RemovePackageKeywordInput, g as SetPackageCategoryInputSchema, gt as SetPackageAuthorWebsiteInput, h as SetPackageAuthorWebsiteInputSchema, ht as SetPackageAuthorNameInput, i as useVetraPackageDocumentById, it as Exact, j as VetraPackageDocumentHeaderSchema, jt as SetPackageGithubUrlAction, k as defaultPHState, kt as SetPackageCategoryAction, l as AddPackageKeywordInputSchema, lt as MakeMaybe, m as SetPackageAuthorNameInputSchema, mt as SetPackageAuthorInput, n as utils, nt as AddPackageKeywordInput, o as useVetraPackageDocumentsInSelectedFolder, ot as InputMaybe, p as SetPackageAuthorInputSchema, pt as Scalars, q as setPackageGithubUrl, r as useSelectedVetraPackageDocument, rt as Author, s as initialGlobalState, st as Keyword, t as VetraPackage, tt as VetraPackagePHState, u as AuthorSchema, ut as MakeOptional, v as SetPackageGithubUrlInputSchema, vt as SetPackageDescriptionInput, w as reducer, wt as AddPackageKeywordAction, x as VetraPackageStateSchema, xt as SetPackageNpmUrlInput, y as SetPackageNameInputSchema, yt as SetPackageGithubUrlInput, z as addPackageKeyword } from "../../module-Drla4Vmn.js";
|
|
2
2
|
import { UpgradeManifest } from "document-model";
|
|
3
3
|
|
|
4
4
|
//#region document-models/vetra-package/upgrades/versions.d.ts
|
|
@@ -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-
|
|
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-
|
|
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";
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as useSelectedAppModuleDocument } from "./app-module-
|
|
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";
|
|
3
3
|
import { StatusPill } from "./editors/components/index.js";
|
|
4
|
-
import { t as useDebounce } from "./hooks-
|
|
4
|
+
import { t as useDebounce } from "./hooks-Btogj1f0.js";
|
|
5
5
|
import { useDocumentTypesInSelectedDrive, useSetPHDocumentEditorConfig, useSupportedDocumentTypesInReactor } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { useCallback, useEffect, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -196,4 +196,4 @@ function Editor() {
|
|
|
196
196
|
//#endregion
|
|
197
197
|
export { Editor as default };
|
|
198
198
|
|
|
199
|
-
//# sourceMappingURL=editor-
|
|
199
|
+
//# sourceMappingURL=editor-BwbJ65NZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-CbtrPBTP.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],\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,aAAa;CAC1D,MAAM,CAAC,aAAa,kBAAkB,SAAS,WAAW,YAAY;CACtE,MAAM,+BAA+B,iCAAiC;CACtE,MAAM,kCAAkC,oCAAoC;CAC5E,MAAM,CAAC,uBAAuB,4BAA4B,SACxD,wBAAwB,EAAE,CAC3B;AAaD,aAAY,SATS,aAClB,SAAiB;AAChB,MAAI,SAAS,aAAc;AAC3B,UAAQ,IAAI,gBAAgB,KAAK;AACjC,WAAS,WAAW,EAAE,MAAM,CAAC,CAAC;IAEhC,CAAC,aAAa,CACf,EAEkC,IAAI;CAEvC,MAAM,kBAAkB;AACtB,WAAS,aAAa,EAAE,QAAQ,aAAa,CAAC,CAAC;;CAGjD,MAAM,uBAAuB,YAAqB;AAChD,MAAI,YAAY,qBAAsB;AACtC,WAAS,sBAAsB,EAAE,SAAS,CAAC,CAAC;;AAI9C,iBAAgB;AACd,MAAI,WAAW,QAEb,gBAAe,MAAM;I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AU;eACZ,sBAAsB,SAAS,IAC9B,sBAAsB,KAAK,SACzB,qBAAC,OAAD;MAAgB,WAAU;gBAA1B,CACE,oBAAC,QAAD;OAAM,WAAU;iBAAyB;OAAY,CAAA,EACpD,CAAC,cACA,oBAAC,UAAD;OACE,eAAe,yBAAyB,KAAK;OAC7C,WAAU;iBACX;OAEQ,CAAA,CAEP;QAVI,KAUJ,CACN,GAEF,oBAAC,QAAD;MAAM,WAAU;gBAAwB;MAAwB,CAAA;KAE9D,CAAA,CACF;MACF,EAAA,CAAA;GAGN,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,MAAD;IAAI,WAAU;cAA2C;IAEpD,CAAA,EAGL,oBAAC,OAAD;IAAK,WAAU;cACb,qBAAC,SAAD;KAAO,SAAQ;KAAwB,WAAU;eAAjD,CACE,oBAAC,SAAD;MACE,IAAG;MACH,MAAK;MACL,SAAS;MACT,WAAW,MAAM,oBAAoB,EAAE,OAAO,QAAQ;MACtD,UAAU;MACV,WAAW,4EACT,aAAa,uBAAuB;MAEtC,CAAA,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
|
+
{"version":3,"file":"editor-BwbJ65NZ.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],\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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EpD,CAAA,EAGL,oBAAC,OAAD;IAAK,WAAU;cACb,qBAAC,SAAD;KAAO,SAAQ;KAAwB,WAAU;eAAjD,CACE,oBAAC,SAAD;MACE,IAAG;MACH,MAAK;MACL,SAAS;MACT,WAAW,MAAM,oBAAoB,EAAE,OAAO,QAAQ;MACtD,UAAU;MACV,WAAW,4EACT,aAAa,uBAAuB;MAEtC,CAAA,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,7 +1,7 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { s as useSelectedDocumentEditorDocument } from "./document-editor-
|
|
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";
|
|
3
3
|
import { StatusPill } from "./editors/components/index.js";
|
|
4
|
-
import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-
|
|
4
|
+
import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Btogj1f0.js";
|
|
5
5
|
import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { Suspense, useCallback, useEffect, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -171,4 +171,4 @@ function Editor() {
|
|
|
171
171
|
//#endregion
|
|
172
172
|
export { Editor as default };
|
|
173
173
|
|
|
174
|
-
//# sourceMappingURL=editor-
|
|
174
|
+
//# sourceMappingURL=editor-CJAn9WTA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-BSQfwcdz.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={onConfir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;OAEQ,CAAA,CAEP;QAfI,KAAK,GAeT,CACN;KACE,CAAA,CACF;MACF,EAAA,CAAA;GAGL,CAAC,cACA,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,WAAW,MAAM,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-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+B,CAAA,EAC/C,MAAM,SACA;;;AAIb,SAAS,mBAAmB,EAC1B,eACA,kBACA,mBACA,wBAMC;CAED,MAAM,yBAAyB,0BAA0B,KAAK;CAC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