@powerhousedao/vetra 4.1.0-dev.19 → 4.1.0-dev.21
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/document-models/app-module/gen/actions.d.ts +4 -0
- package/dist/document-models/app-module/gen/actions.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/actions.js +2 -0
- package/dist/document-models/app-module/gen/actions.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/actions.d.ts +12 -0
- package/dist/document-models/app-module/gen/base-operations/actions.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/actions.js +2 -0
- package/dist/document-models/app-module/gen/base-operations/actions.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/creators.d.ts +5 -0
- package/dist/document-models/app-module/gen/base-operations/creators.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/creators.js +5 -0
- package/dist/document-models/app-module/gen/base-operations/creators.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/error.d.ts +2 -0
- package/dist/document-models/app-module/gen/base-operations/error.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/error.js +2 -0
- package/dist/document-models/app-module/gen/base-operations/error.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/object.d.ts +8 -0
- package/dist/document-models/app-module/gen/base-operations/object.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/object.js +11 -0
- package/dist/document-models/app-module/gen/base-operations/object.js.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/operations.d.ts +8 -0
- package/dist/document-models/app-module/gen/base-operations/operations.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/base-operations/operations.js +2 -0
- package/dist/document-models/app-module/gen/base-operations/operations.js.map +1 -0
- package/dist/document-models/app-module/gen/creators.d.ts +2 -0
- package/dist/document-models/app-module/gen/creators.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/creators.js +2 -0
- package/dist/document-models/app-module/gen/creators.js.map +1 -0
- package/dist/document-models/app-module/gen/document-model.d.ts +3 -0
- package/dist/document-models/app-module/gen/document-model.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/document-model.js +60 -0
- package/dist/document-models/app-module/gen/document-model.js.map +1 -0
- package/dist/document-models/app-module/gen/index.d.ts +6 -0
- package/dist/document-models/app-module/gen/index.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/index.js +6 -0
- package/dist/document-models/app-module/gen/index.js.map +1 -0
- package/dist/document-models/app-module/gen/object.d.ts +16 -0
- package/dist/document-models/app-module/gen/object.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/object.js +26 -0
- package/dist/document-models/app-module/gen/object.js.map +1 -0
- package/dist/document-models/app-module/gen/reducer.d.ts +3 -0
- package/dist/document-models/app-module/gen/reducer.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/reducer.js +25 -0
- package/dist/document-models/app-module/gen/reducer.js.map +1 -0
- package/dist/document-models/app-module/gen/schema/index.d.ts +3 -0
- package/dist/document-models/app-module/gen/schema/index.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/schema/index.js +3 -0
- package/dist/document-models/app-module/gen/schema/index.js.map +1 -0
- package/dist/document-models/app-module/gen/schema/types.d.ts +148 -0
- package/dist/document-models/app-module/gen/schema/types.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/schema/types.js +2 -0
- package/dist/document-models/app-module/gen/schema/types.js.map +1 -0
- package/dist/document-models/app-module/gen/schema/zod.d.ts +14 -0
- package/dist/document-models/app-module/gen/schema/zod.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/schema/zod.js +24 -0
- package/dist/document-models/app-module/gen/schema/zod.js.map +1 -0
- package/dist/document-models/app-module/gen/types.d.ts +10 -0
- package/dist/document-models/app-module/gen/types.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/types.js +2 -0
- package/dist/document-models/app-module/gen/types.js.map +1 -0
- package/dist/document-models/app-module/gen/utils.d.ts +7 -0
- package/dist/document-models/app-module/gen/utils.d.ts.map +1 -0
- package/dist/document-models/app-module/gen/utils.js +40 -0
- package/dist/document-models/app-module/gen/utils.js.map +1 -0
- package/dist/document-models/app-module/index.d.ts +27 -0
- package/dist/document-models/app-module/index.d.ts.map +1 -0
- package/dist/document-models/app-module/index.js +22 -0
- package/dist/document-models/app-module/index.js.map +1 -0
- package/dist/document-models/app-module/src/reducers/base-operations.d.ts +3 -0
- package/dist/document-models/app-module/src/reducers/base-operations.d.ts.map +1 -0
- package/dist/document-models/app-module/src/reducers/base-operations.js +9 -0
- package/dist/document-models/app-module/src/reducers/base-operations.js.map +1 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.d.ts +6 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.d.ts.map +1 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.js +33 -0
- package/dist/document-models/app-module/src/tests/base-operations.test.js.map +1 -0
- package/dist/document-models/app-module/src/tests/document-model.test.d.ts +6 -0
- package/dist/document-models/app-module/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/app-module/src/tests/document-model.test.js +19 -0
- package/dist/document-models/app-module/src/tests/document-model.test.js.map +1 -0
- package/dist/document-models/app-module/src/utils.d.ts +2 -0
- package/dist/document-models/app-module/src/utils.d.ts.map +1 -0
- package/dist/document-models/app-module/src/utils.js +2 -0
- package/dist/document-models/app-module/src/utils.js.map +1 -0
- package/dist/document-models/document-editor/gen/base-operations/actions.d.ts +6 -6
- package/dist/document-models/document-editor/gen/base-operations/actions.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/base-operations/creators.d.ts +3 -3
- package/dist/document-models/document-editor/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/base-operations/creators.js +1 -1
- package/dist/document-models/document-editor/gen/base-operations/creators.js.map +1 -1
- package/dist/document-models/document-editor/gen/base-operations/object.d.ts +2 -2
- package/dist/document-models/document-editor/gen/base-operations/object.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/base-operations/object.js +4 -4
- package/dist/document-models/document-editor/gen/base-operations/object.js.map +1 -1
- package/dist/document-models/document-editor/gen/base-operations/operations.d.ts +2 -2
- package/dist/document-models/document-editor/gen/base-operations/operations.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/document-model.js +14 -14
- package/dist/document-models/document-editor/gen/document-model.js.map +1 -1
- package/dist/document-models/document-editor/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/reducer.js +7 -4
- package/dist/document-models/document-editor/gen/reducer.js.map +1 -1
- package/dist/document-models/document-editor/gen/schema/types.d.ts +10 -5
- package/dist/document-models/document-editor/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/schema/zod.d.ts +3 -2
- package/dist/document-models/document-editor/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/schema/zod.js +7 -6
- package/dist/document-models/document-editor/gen/schema/zod.js.map +1 -1
- package/dist/document-models/document-editor/gen/utils.js +2 -2
- package/dist/document-models/document-editor/gen/utils.js.map +1 -1
- package/dist/document-models/document-editor/index.d.ts +1 -1
- package/dist/document-models/document-editor/index.d.ts.map +1 -1
- package/dist/document-models/document-editor/src/reducers/base-operations.js +3 -3
- package/dist/document-models/document-editor/src/reducers/base-operations.js.map +1 -1
- package/dist/document-models/document-editor/src/tests/base-operations.test.js +10 -18
- package/dist/document-models/document-editor/src/tests/base-operations.test.js.map +1 -1
- package/dist/document-models/index.d.ts +1 -0
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +1 -0
- package/dist/document-models/index.js.map +1 -1
- package/dist/document-models/processor-module/gen/base-operations/actions.d.ts +6 -2
- package/dist/document-models/processor-module/gen/base-operations/actions.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/base-operations/creators.d.ts +3 -2
- package/dist/document-models/processor-module/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/base-operations/creators.js +1 -0
- package/dist/document-models/processor-module/gen/base-operations/creators.js.map +1 -1
- package/dist/document-models/processor-module/gen/base-operations/object.d.ts +2 -1
- package/dist/document-models/processor-module/gen/base-operations/object.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/base-operations/object.js +4 -1
- package/dist/document-models/processor-module/gen/base-operations/object.js.map +1 -1
- package/dist/document-models/processor-module/gen/base-operations/operations.d.ts +2 -1
- package/dist/document-models/processor-module/gen/base-operations/operations.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/document-model.js +13 -2
- package/dist/document-models/processor-module/gen/document-model.js.map +1 -1
- package/dist/document-models/processor-module/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/reducer.js +4 -0
- package/dist/document-models/processor-module/gen/reducer.js.map +1 -1
- package/dist/document-models/processor-module/gen/schema/types.d.ts +5 -0
- package/dist/document-models/processor-module/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/schema/zod.d.ts +3 -1
- package/dist/document-models/processor-module/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/schema/zod.js +7 -0
- package/dist/document-models/processor-module/gen/schema/zod.js.map +1 -1
- package/dist/document-models/processor-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/utils.js +1 -0
- package/dist/document-models/processor-module/gen/utils.js.map +1 -1
- package/dist/document-models/processor-module/index.d.ts +1 -0
- package/dist/document-models/processor-module/index.d.ts.map +1 -1
- package/dist/document-models/processor-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/processor-module/src/reducers/base-operations.js +3 -0
- package/dist/document-models/processor-module/src/reducers/base-operations.js.map +1 -1
- package/dist/document-models/processor-module/src/tests/base-operations.test.js +8 -8
- package/dist/document-models/processor-module/src/tests/base-operations.test.js.map +1 -1
- package/dist/document-models/subgraph-module/gen/base-operations/actions.d.ts +6 -2
- package/dist/document-models/subgraph-module/gen/base-operations/actions.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/base-operations/creators.d.ts +3 -2
- package/dist/document-models/subgraph-module/gen/base-operations/creators.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/base-operations/creators.js +2 -1
- package/dist/document-models/subgraph-module/gen/base-operations/creators.js.map +1 -1
- package/dist/document-models/subgraph-module/gen/base-operations/object.d.ts +2 -1
- package/dist/document-models/subgraph-module/gen/base-operations/object.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/base-operations/object.js +4 -1
- package/dist/document-models/subgraph-module/gen/base-operations/object.js.map +1 -1
- package/dist/document-models/subgraph-module/gen/base-operations/operations.d.ts +2 -1
- package/dist/document-models/subgraph-module/gen/base-operations/operations.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/document-model.js +13 -2
- package/dist/document-models/subgraph-module/gen/document-model.js.map +1 -1
- package/dist/document-models/subgraph-module/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/reducer.js +4 -0
- package/dist/document-models/subgraph-module/gen/reducer.js.map +1 -1
- package/dist/document-models/subgraph-module/gen/schema/types.d.ts +5 -0
- package/dist/document-models/subgraph-module/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/schema/zod.d.ts +3 -1
- package/dist/document-models/subgraph-module/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/schema/zod.js +7 -0
- package/dist/document-models/subgraph-module/gen/schema/zod.js.map +1 -1
- package/dist/document-models/subgraph-module/gen/utils.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/utils.js +1 -0
- package/dist/document-models/subgraph-module/gen/utils.js.map +1 -1
- package/dist/document-models/subgraph-module/index.d.ts +1 -0
- package/dist/document-models/subgraph-module/index.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/src/reducers/base-operations.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/src/reducers/base-operations.js +3 -0
- package/dist/document-models/subgraph-module/src/reducers/base-operations.js.map +1 -1
- package/dist/document-models/subgraph-module/src/tests/base-operations.test.js +2 -2
- package/dist/document-models/subgraph-module/src/tests/base-operations.test.js.map +1 -1
- package/dist/document-models/vetra-package/src/tests/base-operations.test.js +20 -20
- package/dist/document-models/vetra-package/src/tests/base-operations.test.js.map +1 -1
- package/dist/editors/app-editor/components/AppEditorForm.d.ts +8 -0
- package/dist/editors/app-editor/components/AppEditorForm.d.ts.map +1 -0
- package/dist/editors/app-editor/components/AppEditorForm.js +30 -0
- package/dist/editors/app-editor/components/AppEditorForm.js.map +1 -0
- package/dist/editors/app-editor/editor.d.ts +5 -0
- package/dist/editors/app-editor/editor.d.ts.map +1 -0
- package/dist/editors/app-editor/editor.js +17 -0
- package/dist/editors/app-editor/editor.js.map +1 -0
- package/dist/editors/app-editor/index.d.ts +5 -0
- package/dist/editors/app-editor/index.d.ts.map +1 -0
- package/dist/editors/app-editor/index.js +13 -0
- package/dist/editors/app-editor/index.js.map +1 -0
- package/dist/editors/components/StatusPill.d.ts +6 -0
- package/dist/editors/components/StatusPill.d.ts.map +1 -0
- package/dist/editors/components/StatusPill.js +7 -0
- package/dist/editors/components/StatusPill.js.map +1 -0
- package/dist/editors/components/index.d.ts +2 -0
- package/dist/editors/components/index.d.ts.map +1 -0
- package/dist/editors/components/index.js +2 -0
- package/dist/editors/components/index.js.map +1 -0
- package/dist/editors/document-editor/components/DocumentEditorForm.d.ts +3 -3
- package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
- package/dist/editors/document-editor/components/DocumentEditorForm.js +29 -8
- package/dist/editors/document-editor/components/DocumentEditorForm.js.map +1 -1
- package/dist/editors/document-editor/editor.d.ts.map +1 -1
- package/dist/editors/document-editor/editor.js +4 -11
- package/dist/editors/document-editor/editor.js.map +1 -1
- package/dist/editors/index.d.ts +1 -0
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +1 -0
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/processor-editor/components/ProcessorEditorForm.d.ts +6 -1
- package/dist/editors/processor-editor/components/ProcessorEditorForm.d.ts.map +1 -1
- package/dist/editors/processor-editor/components/ProcessorEditorForm.js +25 -14
- package/dist/editors/processor-editor/components/ProcessorEditorForm.js.map +1 -1
- package/dist/editors/processor-editor/editor.d.ts.map +1 -1
- package/dist/editors/processor-editor/editor.js +17 -6
- package/dist/editors/processor-editor/editor.js.map +1 -1
- package/dist/editors/subgraph-editor/components/SubgraphEditorForm.d.ts +3 -1
- package/dist/editors/subgraph-editor/components/SubgraphEditorForm.d.ts.map +1 -1
- package/dist/editors/subgraph-editor/components/SubgraphEditorForm.js +17 -5
- package/dist/editors/subgraph-editor/components/SubgraphEditorForm.js.map +1 -1
- package/dist/editors/subgraph-editor/editor.d.ts.map +1 -1
- package/dist/editors/subgraph-editor/editor.js +6 -5
- package/dist/editors/subgraph-editor/editor.js.map +1 -1
- package/dist/editors/vetra-drive-app/components/Accordion.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/components/Accordion.js +6 -1
- package/dist/editors/vetra-drive-app/components/Accordion.js.map +1 -1
- package/dist/editors/vetra-drive-app/components/ModuleItem.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/components/ModuleItem.js +3 -0
- package/dist/editors/vetra-drive-app/components/ModuleItem.js.map +1 -1
- package/dist/editors/vetra-drive-app/editor.d.ts.map +1 -1
- package/dist/editors/vetra-drive-app/editor.js +2 -1
- package/dist/editors/vetra-drive-app/editor.js.map +1 -1
- package/dist/editors/vetra-drive-app/icons/AppIcon.d.ts +9 -0
- package/dist/editors/vetra-drive-app/icons/AppIcon.d.ts.map +1 -0
- package/dist/editors/vetra-drive-app/icons/AppIcon.js +5 -0
- package/dist/editors/vetra-drive-app/icons/AppIcon.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/package.json +3 -2
- package/dist/powerhouse.manifest.json +9 -0
- package/dist/processors/codegen/document-handlers/app-handler.d.ts +10 -0
- package/dist/processors/codegen/document-handlers/app-handler.d.ts.map +1 -0
- package/dist/processors/codegen/document-handlers/app-handler.js +55 -0
- package/dist/processors/codegen/document-handlers/app-handler.js.map +1 -0
- package/dist/processors/codegen/document-handlers/document-editor-handler.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/document-editor-handler.js +32 -5
- package/dist/processors/codegen/document-handlers/document-editor-handler.js.map +1 -1
- package/dist/processors/codegen/document-handlers/document-model-handler.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/document-model-handler.js +16 -1
- package/dist/processors/codegen/document-handlers/document-model-handler.js.map +1 -1
- package/dist/processors/codegen/document-handlers/index.d.ts +1 -0
- package/dist/processors/codegen/document-handlers/index.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/index.js +1 -0
- package/dist/processors/codegen/document-handlers/index.js.map +1 -1
- package/dist/processors/codegen/document-handlers/processor-handler.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/processor-handler.js +14 -3
- package/dist/processors/codegen/document-handlers/processor-handler.js.map +1 -1
- package/dist/processors/codegen/document-handlers/subgraph-handler.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/subgraph-handler.js +28 -3
- package/dist/processors/codegen/document-handlers/subgraph-handler.js.map +1 -1
- package/dist/processors/codegen/factory.d.ts.map +1 -1
- package/dist/processors/codegen/factory.js +1 -0
- package/dist/processors/codegen/factory.js.map +1 -1
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +2 -1
- package/dist/processors/codegen/index.js.map +1 -1
- package/dist/style.css +17 -3
- package/dist/subgraphs/app-module/index.d.ts +10 -0
- package/dist/subgraphs/app-module/index.d.ts.map +1 -0
- package/dist/subgraphs/app-module/index.js +12 -0
- package/dist/subgraphs/app-module/index.js.map +1 -0
- package/dist/subgraphs/app-module/resolvers.d.ts +3 -0
- package/dist/subgraphs/app-module/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/app-module/resolvers.js +93 -0
- package/dist/subgraphs/app-module/resolvers.js.map +1 -0
- package/dist/subgraphs/app-module/schema.d.ts +3 -0
- package/dist/subgraphs/app-module/schema.d.ts.map +1 -0
- package/dist/subgraphs/app-module/schema.js +56 -0
- package/dist/subgraphs/app-module/schema.js.map +1 -0
- package/dist/subgraphs/document-editor/index.d.ts.map +1 -1
- package/dist/subgraphs/document-editor/index.js.map +1 -1
- package/dist/subgraphs/document-editor/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/document-editor/resolvers.js +73 -53
- package/dist/subgraphs/document-editor/resolvers.js.map +1 -1
- package/dist/subgraphs/document-editor/schema.d.ts.map +1 -1
- package/dist/subgraphs/document-editor/schema.js +18 -13
- package/dist/subgraphs/document-editor/schema.js.map +1 -1
- package/dist/subgraphs/index.d.ts +1 -0
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +1 -0
- package/dist/subgraphs/index.js.map +1 -1
- package/dist/subgraphs/processor-module/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/processor-module/resolvers.js +13 -1
- package/dist/subgraphs/processor-module/resolvers.js.map +1 -1
- package/dist/subgraphs/processor-module/schema.d.ts.map +1 -1
- package/dist/subgraphs/processor-module/schema.js +14 -0
- package/dist/subgraphs/processor-module/schema.js.map +1 -1
- package/dist/subgraphs/subgraph-module/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/subgraph-module/resolvers.js +12 -0
- package/dist/subgraphs/subgraph-module/resolvers.js.map +1 -1
- package/dist/subgraphs/subgraph-module/schema.d.ts.map +1 -1
- package/dist/subgraphs/subgraph-module/schema.js +14 -0
- package/dist/subgraphs/subgraph-module/schema.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -14
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useDebounce } from "../../hooks/index.js";
|
|
4
|
+
import { StatusPill } from "../../components/index.js";
|
|
5
|
+
export const AppEditorForm = ({ appName: initialAppName = "", status = "DRAFT", onNameChange, onConfirm }) => {
|
|
6
|
+
const [appName, setAppName] = useState(initialAppName);
|
|
7
|
+
const [isConfirmed, setIsConfirmed] = useState(false);
|
|
8
|
+
// Use the debounce hook for name changes
|
|
9
|
+
useDebounce(appName, onNameChange, 300);
|
|
10
|
+
// Update local state when initialAppName changes
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
setAppName(initialAppName);
|
|
13
|
+
}, [initialAppName]);
|
|
14
|
+
// Reset confirmation state if status changes back to DRAFT
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (status === "DRAFT") {
|
|
17
|
+
setIsConfirmed(false);
|
|
18
|
+
}
|
|
19
|
+
}, [status]);
|
|
20
|
+
// Check if form should be read-only
|
|
21
|
+
const isReadOnly = isConfirmed || status === "CONFIRMED";
|
|
22
|
+
const handleConfirm = () => {
|
|
23
|
+
if (appName.trim()) {
|
|
24
|
+
setIsConfirmed(true); // Immediate UI update
|
|
25
|
+
onConfirm?.();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return (_jsxs("div", { className: "space-y-6 p-6 bg-white", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "App Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "App Name" }), _jsx("input", { type: "text", value: appName, onChange: (e) => setAppName(e.target.value), disabled: isReadOnly, className: `w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${isReadOnly ? 'bg-gray-100 cursor-not-allowed' : ''}`, placeholder: "Enter app name" })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !appName.trim(), className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:cursor-not-allowed", children: "Confirm" }) }))] }));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=AppEditorForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppEditorForm.js","sourceRoot":"","sources":["../../../../editors/app-editor/components/AppEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AASvD,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,OAAO,EAAE,cAAc,GAAG,EAAE,EAC5B,MAAM,GAAG,OAAO,EAChB,YAAY,EACZ,SAAS,EACV,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,yCAAyC;IACzC,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;IAExC,iDAAiD;IACjD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,cAAc,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,2DAA2D;IAC3D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,cAAc,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,oCAAoC;IACpC,MAAM,UAAU,GAAG,WAAW,IAAI,MAAM,KAAK,WAAW,CAAC;IAEzD,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YACnB,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB;YAC5C,SAAS,EAAE,EAAE,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,wBAAwB,aACrC,eAAK,SAAS,EAAC,mCAAmC,aAChD,aAAI,SAAS,EAAC,mCAAmC,kCAAuB,EACxE,KAAC,UAAU,IACT,MAAM,EAAE,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EACtD,KAAK,EAAE,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,GACrD,IACE,EAGN,0BACE,gBAAO,SAAS,EAAC,8CAA8C,yBAEvD,EACR,gBACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC3C,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,mIACT,UAAU,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,EAClD,EAAE,EACF,WAAW,EAAC,gBAAgB,GAC5B,IACE,EAGL,CAAC,UAAU,IAAI,CACd,wBACE,iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EACzB,SAAS,EAAC,wLAAwL,wBAG3L,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorProps } from "document-model";
|
|
2
|
+
import { type AppModuleDocument } from "../../document-models/app-module/index.js";
|
|
3
|
+
export type IProps = EditorProps<AppModuleDocument>;
|
|
4
|
+
export default function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,2CAA2C,CAAC;AAInD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAsB3C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { actions, } from "../../document-models/app-module/index.js";
|
|
3
|
+
import { AppEditorForm } from "./components/AppEditorForm.js";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
export default function Editor(props) {
|
|
6
|
+
const { document, dispatch } = props;
|
|
7
|
+
const onNameChange = useCallback((name) => {
|
|
8
|
+
if (name === document.state.global.name)
|
|
9
|
+
return;
|
|
10
|
+
dispatch(actions.setAppName({ name }));
|
|
11
|
+
}, [document.state.global.name, dispatch]);
|
|
12
|
+
const onConfirm = useCallback(() => {
|
|
13
|
+
dispatch(actions.setAppStatus({ status: "CONFIRMED" }));
|
|
14
|
+
}, [dispatch]);
|
|
15
|
+
return (_jsx("div", { children: _jsx(AppEditorForm, { appName: document.state.global.name ?? "", status: document.state.global.status, onNameChange: onNameChange, onConfirm: onConfirm }) }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/app-editor/editor.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,OAAO,GACR,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,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 +1,13 @@
|
|
|
1
|
+
import Editor from "./editor.js";
|
|
2
|
+
export const module = {
|
|
3
|
+
Component: Editor,
|
|
4
|
+
documentTypes: ["powerhouse/app"],
|
|
5
|
+
config: {
|
|
6
|
+
id: "app-module-editor",
|
|
7
|
+
disableExternalControls: true,
|
|
8
|
+
documentToolbarEnabled: true,
|
|
9
|
+
showSwitchboardLink: true,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default module;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/app-editor/index.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,MAAM,GAAoC;IACrD,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,CAAC,gBAAgB,CAAC;IACjC,MAAM,EAAE;QACN,EAAE,EAAE,mBAAmB;QACvB,uBAAuB,EAAE,IAAI;QAC7B,sBAAsB,EAAE,IAAI;QAC5B,mBAAmB,EAAE,IAAI;KAC1B;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusPill.d.ts","sourceRoot":"","sources":["../../../editors/components/StatusPill.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAahD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const StatusPill = ({ status, label }) => {
|
|
3
|
+
return (_jsx("div", { className: `px-3 py-1 rounded-full text-xs font-medium ${status === 'confirmed'
|
|
4
|
+
? "bg-green-100 text-green-800"
|
|
5
|
+
: "bg-yellow-100 text-yellow-800"}`, children: label }));
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=StatusPill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusPill.js","sourceRoot":"","sources":["../../../editors/components/StatusPill.tsx"],"names":[],"mappings":";AAKA,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,MAAM,EACN,KAAK,EACN,EAAE,EAAE;IACH,OAAO,CACL,cAAK,SAAS,EAAE,8CACd,MAAM,KAAK,WAAW;YACpB,CAAC,CAAC,6BAA6B;YAC/B,CAAC,CAAC,+BACN,EAAE,YACC,KAAK,GACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../editors/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AddDocumentTypeInput, DocumentTypeItem, RemoveDocumentTypeInput } from "../../../document-models/document-editor/index.js";
|
|
2
2
|
export interface DocumentEditorFormProps {
|
|
3
3
|
editorName?: string;
|
|
4
|
-
editorId?: string;
|
|
5
4
|
documentTypes?: DocumentTypeItem[];
|
|
5
|
+
status?: string;
|
|
6
6
|
onEditorNameChange?: (name: string) => void;
|
|
7
|
-
onEditorIdChange?: (id: string) => void;
|
|
8
7
|
onAddDocumentType?: (input: AddDocumentTypeInput) => void;
|
|
9
8
|
onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;
|
|
9
|
+
onConfirm?: () => void;
|
|
10
10
|
}
|
|
11
11
|
export declare const DocumentEditorForm: React.FC<DocumentEditorFormProps>;
|
|
12
12
|
//# sourceMappingURL=DocumentEditorForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAIzI,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA4IhE,CAAC"}
|
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { StatusPill } from "../../components/index.js";
|
|
3
4
|
import { useDebounce } from "../../hooks/index.js";
|
|
4
|
-
export const DocumentEditorForm = ({ editorName: initialEditorName = "",
|
|
5
|
+
export const DocumentEditorForm = ({ editorName: initialEditorName = "", documentTypes: initialDocumentTypes = [], status = "DRAFT", onEditorNameChange, onAddDocumentType, onRemoveDocumentType, onConfirm }) => {
|
|
5
6
|
const [editorName, setEditorName] = useState(initialEditorName);
|
|
6
|
-
const [editorId, setEditorId] = useState(initialEditorId);
|
|
7
7
|
const [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);
|
|
8
8
|
const [documentTypeInput, setDocumentTypeInput] = useState("");
|
|
9
|
-
|
|
9
|
+
const [isConfirmed, setIsConfirmed] = useState(false);
|
|
10
|
+
// Use the debounce hook for name changes
|
|
10
11
|
useDebounce(editorName, onEditorNameChange, 300);
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
// Update local state when initial values change
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setEditorName(initialEditorName);
|
|
15
|
+
}, [initialEditorName]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setDocumentTypes(initialDocumentTypes);
|
|
18
|
+
}, [initialDocumentTypes]);
|
|
19
|
+
// Reset confirmation state if status changes back to DRAFT
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (status === "DRAFT") {
|
|
22
|
+
setIsConfirmed(false);
|
|
23
|
+
}
|
|
24
|
+
}, [status]);
|
|
25
|
+
// Check if form should be read-only
|
|
26
|
+
const isReadOnly = isConfirmed || status === "CONFIRMED";
|
|
27
|
+
const handleConfirm = () => {
|
|
28
|
+
if (editorName.trim() && documentTypes.length > 0) {
|
|
29
|
+
setIsConfirmed(true); // Immediate UI update
|
|
30
|
+
onConfirm?.();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return (_jsxs("div", { className: "space-y-6 p-6 bg-white", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Editor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Editor Name" }), _jsx("input", { type: "text", value: editorName, onChange: (e) => setEditorName(e.target.value), disabled: isReadOnly, className: `w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${isReadOnly ? 'bg-gray-100 cursor-not-allowed' : ''}` })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Supported Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && (_jsx("input", { type: "text", value: documentTypeInput, onChange: (e) => setDocumentTypeInput(e.target.value), onKeyDown: (e) => {
|
|
13
34
|
if (e.key === 'Enter' && documentTypeInput.trim()) {
|
|
14
35
|
e.preventDefault();
|
|
15
36
|
const newTypeInput = {
|
|
@@ -26,9 +47,9 @@ export const DocumentEditorForm = ({ editorName: initialEditorName = "", editorI
|
|
|
26
47
|
}
|
|
27
48
|
setDocumentTypeInput('');
|
|
28
49
|
}
|
|
29
|
-
}, placeholder: "Type a document type and press Enter", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" }), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), _jsx("button", { onClick: () => {
|
|
50
|
+
}, placeholder: "Type a document type and press Enter", className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" })), _jsx("div", { className: "space-y-1", children: documentTypes.map((type) => (_jsxs("div", { className: "flex items-center py-1", children: [_jsx("span", { className: "text-sm text-gray-700", children: type.documentType }), !isReadOnly && (_jsx("button", { onClick: () => {
|
|
30
51
|
setDocumentTypes(documentTypes.filter((dt) => dt.id !== type.id));
|
|
31
52
|
onRemoveDocumentType?.({ id: type.id });
|
|
32
|
-
}, className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" })] }, type.id))) })] })] })] }));
|
|
53
|
+
}, className: "ml-2 text-gray-400 hover:text-gray-600 focus:outline-none", children: "\u00D7" }))] }, type.id))) })] })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !editorName.trim() || documentTypes.length === 0, className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:cursor-not-allowed", children: "Confirm" }) }))] }));
|
|
33
54
|
};
|
|
34
55
|
//# sourceMappingURL=DocumentEditorForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentEditorForm.js","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentEditorForm.js","sourceRoot":"","sources":["../../../../editors/document-editor/components/DocumentEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAYnD,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,UAAU,EAAE,iBAAiB,GAAG,EAAE,EAClC,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,MAAM,GAAG,OAAO,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACV,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAChE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAqB,oBAAoB,CAAC,CAAC;IAC7F,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAA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AC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,KAAK,sBAAsB,EAI5B,MAAM,gDAAgD,CAAC;AAIxD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAiC3C"}
|
|
@@ -4,27 +4,20 @@ import { DocumentEditorForm } from "./components/DocumentEditorForm.js";
|
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
export default function Editor(props) {
|
|
6
6
|
const { document, dispatch } = props;
|
|
7
|
-
console.log(">>>>> document:", document.state.global);
|
|
8
7
|
const onEditorNameChange = useCallback((name) => {
|
|
9
|
-
if (!document.state.global.name && !name)
|
|
10
|
-
return;
|
|
11
8
|
if (name === document.state.global.name)
|
|
12
9
|
return;
|
|
13
10
|
dispatch(actions.setEditorName({ name }));
|
|
14
11
|
}, [document.state.global.name, dispatch]);
|
|
15
|
-
const onEditorIdChange = useCallback((id) => {
|
|
16
|
-
if (!document.state.global.id && !id)
|
|
17
|
-
return;
|
|
18
|
-
if (id === document.state.global.id)
|
|
19
|
-
return;
|
|
20
|
-
dispatch(actions.setEditorId({ id }));
|
|
21
|
-
}, [document.state.global.id, dispatch]);
|
|
22
12
|
const onAddDocumentType = useCallback((input) => {
|
|
23
13
|
dispatch(actions.addDocumentType(input));
|
|
24
14
|
}, [dispatch]);
|
|
25
15
|
const onRemoveDocumentType = useCallback((input) => {
|
|
26
16
|
dispatch(actions.removeDocumentType(input));
|
|
27
17
|
}, [dispatch]);
|
|
28
|
-
|
|
18
|
+
const onConfirm = useCallback(() => {
|
|
19
|
+
dispatch(actions.setEditorStatus({ status: "CONFIRMED" }));
|
|
20
|
+
}, [dispatch]);
|
|
21
|
+
return (_jsx("div", { children: _jsx(DocumentEditorForm, { editorName: document.state.global.name ?? "", documentTypes: document.state.global.documentTypes, status: document.state.global.status, onEditorNameChange: onEditorNameChange, onAddDocumentType: onAddDocumentType, onRemoveDocumentType: onRemoveDocumentType, onConfirm: onConfirm }) }));
|
|
29
22
|
}
|
|
30
23
|
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":";AACA,OAAO,EAIL,OAAO,GACR,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIpC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/document-editor/editor.tsx"],"names":[],"mappings":";AACA,OAAO,EAIL,OAAO,GACR,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIpC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,MAAM,kBAAkB,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QACtD,IAAI,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO;QAChD,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3C,MAAM,iBAAiB,GAAG,WAAW,CAAC,CAAC,KAA2B,EAAE,EAAE;QACpE,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,oBAAoB,GAAG,WAAW,CAAC,CAAC,KAA8B,EAAE,EAAE;QAC1E,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,wBACE,KAAC,kBAAkB,IACjB,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAC5C,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,EAClD,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,SAAS,GACpB,GACE,CACP,CAAC;AACJ,CAAC"}
|
package/dist/editors/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { module as VetraDriveApp } from "./vetra-drive-app/index.js";
|
|
|
3
3
|
export { module as VetraPackage } from "./vetra-package/index.js";
|
|
4
4
|
export { module as SubgraphEditor } from "./subgraph-editor/index.js";
|
|
5
5
|
export { module as ProcessorEditor } from "./processor-editor/index.js";
|
|
6
|
+
export { module as AppEditor } from "./app-editor/index.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/editors/index.js
CHANGED
|
@@ -3,4 +3,5 @@ export { module as VetraDriveApp } from "./vetra-drive-app/index.js";
|
|
|
3
3
|
export { module as VetraPackage } from "./vetra-package/index.js";
|
|
4
4
|
export { module as SubgraphEditor } from "./subgraph-editor/index.js";
|
|
5
5
|
export { module as ProcessorEditor } from "./processor-editor/index.js";
|
|
6
|
+
export { module as AppEditor } from "./app-editor/index.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -3,7 +3,12 @@ export interface ProcessorEditorFormProps {
|
|
|
3
3
|
processorName?: string;
|
|
4
4
|
processorType?: string;
|
|
5
5
|
documentTypes?: DocumentTypeItem[];
|
|
6
|
-
|
|
6
|
+
status?: string;
|
|
7
|
+
onNameChange?: (name: string) => void;
|
|
8
|
+
onTypeChange?: (type: string) => void;
|
|
9
|
+
onAddDocumentType?: (id: string, documentType: string) => void;
|
|
10
|
+
onRemoveDocumentType?: (id: string) => void;
|
|
11
|
+
onConfirm?: () => void;
|
|
7
12
|
}
|
|
8
13
|
export declare const ProcessorEditorForm: React.FC<ProcessorEditorFormProps>;
|
|
9
14
|
//# sourceMappingURL=ProcessorEditorForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessorEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"ProcessorEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,oDAAoD,CAAC;AAI5D,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,oBAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAwLlE,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
|
|
3
|
+
import { useDebounce } from "../../hooks/index.js";
|
|
4
|
+
import { StatusPill } from "../../components/index.js";
|
|
5
|
+
export const ProcessorEditorForm = ({ processorName: initialProcessorName = "", processorType: initialProcessorType = "", documentTypes: initialDocumentTypes = [], status = "DRAFT", onNameChange, onTypeChange, onAddDocumentType, onRemoveDocumentType, onConfirm, }) => {
|
|
4
6
|
const [processorName, setProcessorName] = useState(initialProcessorName);
|
|
5
7
|
const [processorType, setProcessorType] = useState(initialProcessorType);
|
|
6
8
|
const [documentTypes, setDocumentTypes] = useState(initialDocumentTypes);
|
|
7
9
|
const [documentTypeInput, setDocumentTypeInput] = useState("");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const [isConfirmed, setIsConfirmed] = useState(false);
|
|
11
|
+
// Use the debounce hook for name and type changes
|
|
12
|
+
useDebounce(processorName, onNameChange, 300);
|
|
13
|
+
useDebounce(processorType, onTypeChange, 300);
|
|
12
14
|
// Update local state when initial values change
|
|
13
15
|
useEffect(() => {
|
|
14
16
|
setProcessorName(initialProcessorName);
|
|
@@ -19,32 +21,41 @@ export const ProcessorEditorForm = ({ processorName: initialProcessorName = "",
|
|
|
19
21
|
useEffect(() => {
|
|
20
22
|
setDocumentTypes(initialDocumentTypes);
|
|
21
23
|
}, [initialDocumentTypes]);
|
|
24
|
+
// Reset confirmation state if status changes back to DRAFT
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (status === "DRAFT") {
|
|
27
|
+
setIsConfirmed(false);
|
|
28
|
+
}
|
|
29
|
+
}, [status]);
|
|
30
|
+
// Check if form should be read-only
|
|
31
|
+
const isReadOnly = isConfirmed || status === "CONFIRMED";
|
|
22
32
|
const handleConfirm = () => {
|
|
23
33
|
if (processorName.trim() && processorType && documentTypes.length > 0) {
|
|
24
|
-
|
|
34
|
+
setIsConfirmed(true); // Immediate UI update
|
|
35
|
+
onConfirm?.();
|
|
25
36
|
}
|
|
26
37
|
};
|
|
27
38
|
const handleAddDocumentType = () => {
|
|
28
39
|
if (documentTypeInput.trim()) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
if (!documentTypes.some((dt) => dt.documentType === newTypeInput.documentType)) {
|
|
40
|
+
const id = Date.now().toString();
|
|
41
|
+
const documentType = documentTypeInput.trim();
|
|
42
|
+
if (!documentTypes.some((dt) => dt.documentType === documentType)) {
|
|
34
43
|
const newType = {
|
|
35
|
-
id
|
|
36
|
-
documentType
|
|
44
|
+
id,
|
|
45
|
+
documentType,
|
|
37
46
|
};
|
|
38
47
|
setDocumentTypes([...documentTypes, newType]);
|
|
48
|
+
onAddDocumentType?.(id, documentType);
|
|
39
49
|
}
|
|
40
50
|
setDocumentTypeInput("");
|
|
41
51
|
}
|
|
42
52
|
};
|
|
43
53
|
const handleRemoveDocumentType = (id) => {
|
|
44
54
|
setDocumentTypes(documentTypes.filter((dt) => dt.id !== id));
|
|
55
|
+
onRemoveDocumentType?.(id);
|
|
45
56
|
};
|
|
46
57
|
const canConfirm = processorName.trim() && processorType && documentTypes.length > 0;
|
|
47
|
-
return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Processor Configuration" }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Processor Name" }), _jsx("input", { type: "text", value: processorName, onChange: (e) => setProcessorName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter processor name" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Type" }), _jsxs("select", { value: processorType, onChange: (e) => setProcessorType(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, children: [_jsx("option", { value: "", children: "Select type..." }), _jsx("option", { value: "analytics", children: "Analytics" }), _jsx("option", { value: "relational", children: "Relational Database" })] })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && (_jsx("input", { type: "text", value: documentTypeInput, onChange: (e) => setDocumentTypeInput(e.target.value), onKeyDown: (e) => {
|
|
58
|
+
return (_jsxs("div", { className: "space-y-6 bg-white p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Processor Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Processor Name" }), _jsx("input", { type: "text", value: processorName, onChange: (e) => setProcessorName(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, placeholder: "Enter processor name" })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Type" }), _jsxs("select", { value: processorType, onChange: (e) => setProcessorType(e.target.value), disabled: isReadOnly, className: `w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500 ${isReadOnly ? "cursor-not-allowed bg-gray-100" : ""}`, children: [_jsx("option", { value: "", children: "Select type..." }), _jsx("option", { value: "analytics", children: "Analytics" }), _jsx("option", { value: "relational", children: "Relational Database" })] })] }), _jsxs("div", { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Document Types" }), _jsxs("div", { className: "space-y-2", children: [!isReadOnly && (_jsx("input", { type: "text", value: documentTypeInput, onChange: (e) => setDocumentTypeInput(e.target.value), onKeyDown: (e) => {
|
|
48
59
|
if (e.key === "Enter") {
|
|
49
60
|
e.preventDefault();
|
|
50
61
|
handleAddDocumentType();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessorEditorForm.js","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProcessorEditorForm.js","sourceRoot":"","sources":["../../../../editors/processor-editor/components/ProcessorEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAcvD,MAAM,CAAC,MAAM,mBAAmB,GAAuC,CAAC,EACtE,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,aAAa,EAAE,oBAAoB,GAAG,EAAE,EACxC,MAAM,GAAG,OAAO,EAChB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACV,EAAE,EAAE;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACzE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACzE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GACrC,QAAQ,CAAqB,oBAAoB,CAAC,CAAC;IACrD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,kDAAkD;IAClD,WAAW,CAAC,aAAa,EAAE,YAAY,EAA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C,UAAU,IAAI,CACd,iBACE,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,EAChD,SAAS,EAAC,2DAA2D,uBAG9D,CACV,KAXO,IAAI,CAAC,EAAE,CAYX,CACP,CAAC,GACE,IACF,IACF,EAGL,CAAC,UAAU,IAAI,CACd,wBACE,iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,UAAU,EACrB,SAAS,EAAC,wLAAwL,wBAG3L,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,iDAAiD,CAAC;AAIzD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,iDAAiD,CAAC;AAIzD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAE1D,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAwC3C"}
|
|
@@ -4,14 +4,25 @@ import { ProcessorEditorForm } from "./components/ProcessorEditorForm.js";
|
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
export default function Editor(props) {
|
|
6
6
|
const { document, dispatch } = props;
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const onNameChange = useCallback((name) => {
|
|
8
|
+
if (name === document.state.global.name)
|
|
9
|
+
return;
|
|
9
10
|
dispatch(actions.setProcessorName({ name }));
|
|
11
|
+
}, [document.state.global.name, dispatch]);
|
|
12
|
+
const onTypeChange = useCallback((type) => {
|
|
13
|
+
if (type === document.state.global.type)
|
|
14
|
+
return;
|
|
10
15
|
dispatch(actions.setProcessorType({ type }));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
16
|
+
}, [document.state.global.type, dispatch]);
|
|
17
|
+
const onAddDocumentType = useCallback((id, documentType) => {
|
|
18
|
+
dispatch(actions.addDocumentType({ id, documentType }));
|
|
14
19
|
}, [dispatch]);
|
|
15
|
-
|
|
20
|
+
const onRemoveDocumentType = useCallback((id) => {
|
|
21
|
+
dispatch(actions.removeDocumentType({ id }));
|
|
22
|
+
}, [dispatch]);
|
|
23
|
+
const onConfirm = useCallback(() => {
|
|
24
|
+
dispatch(actions.setProcessorStatus({ status: "CONFIRMED" }));
|
|
25
|
+
}, [dispatch]);
|
|
26
|
+
return (_jsx("div", { children: _jsx(ProcessorEditorForm, { processorName: document.state.global.name ?? "", processorType: document.state.global.type ?? "", documentTypes: document.state.global.documentTypes ?? [], status: document.state.global.status, onNameChange: onNameChange, onTypeChange: onTypeChange, onAddDocumentType: onAddDocumentType, onRemoveDocumentType: onRemoveDocumentType, onConfirm: onConfirm }) }));
|
|
16
27
|
}
|
|
17
28
|
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/processor-editor/editor.tsx"],"names":[],"mappings":";AACA,OAAO,EAGL,OAAO,GACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIpC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,MAAM,E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C,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,oBAAoB,GAAG,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QACtD,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,wBACE,KAAC,mBAAmB,IAClB,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAC/C,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAC/C,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,EACxD,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EACpC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,SAAS,GACpB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface SubgraphEditorFormProps {
|
|
2
2
|
subgraphName?: string;
|
|
3
|
-
|
|
3
|
+
status?: string;
|
|
4
|
+
onNameChange?: (name: string) => void;
|
|
5
|
+
onConfirm?: () => void;
|
|
4
6
|
}
|
|
5
7
|
export declare const SubgraphEditorForm: React.FC<SubgraphEditorFormProps>;
|
|
6
8
|
//# sourceMappingURL=SubgraphEditorForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubgraphEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/subgraph-editor/components/SubgraphEditorForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubgraphEditorForm.d.ts","sourceRoot":"","sources":["../../../../editors/subgraph-editor/components/SubgraphEditorForm.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA2EhE,CAAC"}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
|
|
3
|
+
import { useDebounce } from "../../hooks/index.js";
|
|
4
|
+
import { StatusPill } from "../../components/index.js";
|
|
5
|
+
export const SubgraphEditorForm = ({ subgraphName: initialSubgraphName = "", status = "DRAFT", onNameChange, onConfirm }) => {
|
|
4
6
|
const [subgraphName, setSubgraphName] = useState(initialSubgraphName);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
const [isConfirmed, setIsConfirmed] = useState(false);
|
|
8
|
+
// Use the debounce hook for name changes
|
|
9
|
+
useDebounce(subgraphName, onNameChange, 300);
|
|
7
10
|
// Update local state when initialSubgraphName changes
|
|
8
11
|
useEffect(() => {
|
|
9
12
|
setSubgraphName(initialSubgraphName);
|
|
10
13
|
}, [initialSubgraphName]);
|
|
14
|
+
// Reset confirmation state if status changes back to DRAFT
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (status === "DRAFT") {
|
|
17
|
+
setIsConfirmed(false);
|
|
18
|
+
}
|
|
19
|
+
}, [status]);
|
|
20
|
+
// Check if form should be read-only
|
|
21
|
+
const isReadOnly = isConfirmed || status === "CONFIRMED";
|
|
11
22
|
const handleConfirm = () => {
|
|
12
23
|
if (subgraphName.trim()) {
|
|
13
|
-
|
|
24
|
+
setIsConfirmed(true); // Immediate UI update
|
|
25
|
+
onConfirm?.();
|
|
14
26
|
}
|
|
15
27
|
};
|
|
16
|
-
return (_jsxs("div", { className: "space-y-6 p-6 bg-white", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Subgraph Configuration" }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Subgraph Name" }), _jsx("input", { type: "text", value: subgraphName, onChange: (e) => setSubgraphName(e.target.value), disabled: isReadOnly, className: `w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${isReadOnly ? 'bg-gray-100 cursor-not-allowed' : ''}`, placeholder: "Enter subgraph name" })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !subgraphName.trim(), className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:cursor-not-allowed", children: "Confirm" }) }))] }));
|
|
28
|
+
return (_jsxs("div", { className: "space-y-6 p-6 bg-white", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-medium text-gray-900", children: "Subgraph Configuration" }), _jsx(StatusPill, { status: status === "CONFIRMED" ? 'confirmed' : 'draft', label: status === "CONFIRMED" ? 'Confirmed' : 'Draft' })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Subgraph Name" }), _jsx("input", { type: "text", value: subgraphName, onChange: (e) => setSubgraphName(e.target.value), disabled: isReadOnly, className: `w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${isReadOnly ? 'bg-gray-100 cursor-not-allowed' : ''}`, placeholder: "Enter subgraph name" })] }), !isReadOnly && (_jsx("div", { children: _jsx("button", { onClick: handleConfirm, disabled: !subgraphName.trim(), className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:cursor-not-allowed", children: "Confirm" }) }))] }));
|
|
17
29
|
};
|
|
18
30
|
//# sourceMappingURL=SubgraphEditorForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubgraphEditorForm.js","sourceRoot":"","sources":["../../../../editors/subgraph-editor/components/SubgraphEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SubgraphEditorForm.js","sourceRoot":"","sources":["../../../../editors/subgraph-editor/components/SubgraphEditorForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AASvD,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,YAAY,EAAE,mBAAmB,GAAG,EAAE,EACtC,MAAM,GAAG,OAAO,EAChB,YAAY,EACZ,SAAS,EACV,EAAE,EAAE;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACtE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,yCAAyC;IACzC,WAAW,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;IAE7C,sDAAsD;IACtD,SAAS,CAAC,GAAG,EAAE;QACb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iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,EAC9B,SAAS,EAAC,wLAAwL,wBAG3L,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/subgraph-editor/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,gDAAgD,CAAC;AAGxD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,2CAsB3C"}
|