@powerhousedao/workflow 6.2.3-dev.30 → 6.2.3-dev.31
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/README.md +8 -8
- package/dist/browser/BlockSelector-BHJQOhie.js +3051 -0
- package/dist/browser/BlockSelector-BHJQOhie.js.map +1 -0
- package/dist/browser/{connection-form-D-NETdDQ.js → connection-form-CaduwBiu.js} +349 -50
- package/dist/browser/connection-form-CaduwBiu.js.map +1 -0
- package/dist/browser/{data-tree-DA4sc7B7.js → data-tree-8219PVfh.js} +2 -2
- package/dist/browser/{data-tree-DA4sc7B7.js.map → data-tree-8219PVfh.js.map} +1 -1
- package/dist/browser/document-models/index.js +2 -2
- package/dist/browser/document-models/workflow/index.js +3 -3
- package/dist/browser/{document-models-BohsduV4.js → document-models-C1ZgIZyV.js} +7 -2
- package/dist/browser/{document-models-BohsduV4.js.map → document-models-C1ZgIZyV.js.map} +1 -1
- package/dist/browser/{editor-B6N0PCuZ.js → editor-BHV1MZS8.js} +2437 -6283
- package/dist/browser/editor-BHV1MZS8.js.map +1 -0
- package/dist/{node/editor-StBssjcQ.mjs → browser/editor-C0C1eB0R.js} +385 -119
- package/dist/browser/editor-C0C1eB0R.js.map +1 -0
- package/dist/browser/{editor-BkdwuOC-.js → editor-CFcXlZY2.js} +14 -24
- package/dist/browser/editor-CFcXlZY2.js.map +1 -0
- package/dist/browser/editors/connection-editor/module.js +1 -1
- package/dist/browser/editors/workflow-editor/module.js +1 -1
- package/dist/browser/editors/workflow-studio/module.js +1 -1
- package/dist/browser/index.js +97 -43
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{module-Bkms70LV.js → module-DU2vb3FH.js} +574 -94
- package/dist/browser/module-DU2vb3FH.js.map +1 -0
- package/dist/browser/{piece-auth-Z4mZEOtL.js → piece-auth-BS5CtQOG.js} +45 -12
- package/dist/browser/piece-auth-BS5CtQOG.js.map +1 -0
- package/dist/browser/reactor/index.js +2 -2
- package/dist/browser/runtime-queries-Ds2kk-Ow.js +2535 -0
- package/dist/browser/runtime-queries-Ds2kk-Ow.js.map +1 -0
- package/dist/browser/trigger-text-BkcklsMX.js +5569 -0
- package/dist/browser/trigger-text-BkcklsMX.js.map +1 -0
- package/dist/browser/{upgrade-manifests-BLrv3cf2.js → upgrade-manifests-BpakVE9l.js} +2 -2
- package/dist/browser/{upgrade-manifests-BLrv3cf2.js.map → upgrade-manifests-BpakVE9l.js.map} +1 -1
- package/dist/browser/{workflow-CGtVlhr8.js → workflow-BxShRhVy.js} +3 -2
- package/dist/browser/workflow-BxShRhVy.js.map +1 -0
- package/dist/node/BlockSelector-lOcIiaqt.mjs +3055 -0
- package/dist/node/BlockSelector-lOcIiaqt.mjs.map +1 -0
- package/dist/node/{connection-form-C9vbfSnA.mjs → connection-form-DWt29kft.mjs} +349 -50
- package/dist/node/connection-form-DWt29kft.mjs.map +1 -0
- package/dist/node/{data-tree-CbqpF3lC.mjs → data-tree-Cdx85Y19.mjs} +2 -2
- package/dist/node/{data-tree-CbqpF3lC.mjs.map → data-tree-Cdx85Y19.mjs.map} +1 -1
- package/dist/node/document-models/index.mjs +2 -2
- package/dist/node/document-models/workflow/index.mjs +3 -3
- package/dist/{browser/editor-CZ5NvCyv.js → node/editor-CR823u-y.mjs} +385 -119
- package/dist/node/editor-CR823u-y.mjs.map +1 -0
- package/dist/node/{editor-DP36YDk5.mjs → editor-CwX-G2Jv.mjs} +2437 -7479
- package/dist/node/editor-CwX-G2Jv.mjs.map +1 -0
- package/dist/node/{editor-By9BHI8e.mjs → editor-D_t8OtZn.mjs} +14 -24
- package/dist/node/editor-D_t8OtZn.mjs.map +1 -0
- package/dist/node/editors/connection-editor/module.mjs +1 -1
- package/dist/node/editors/workflow-editor/module.mjs +1 -1
- package/dist/node/editors/workflow-studio/module.mjs +1 -1
- package/dist/node/index.mjs +102 -43
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{module-DuxxhgKs.mjs → module-Dhe5E-VA.mjs} +574 -94
- package/dist/node/module-Dhe5E-VA.mjs.map +1 -0
- package/dist/node/{piece-auth-Z4mZEOtL.mjs → piece-auth-BS5CtQOG.mjs} +45 -12
- package/dist/node/piece-auth-BS5CtQOG.mjs.map +1 -0
- package/dist/node/pieces/index.mjs +0 -1
- package/dist/node/pieces/index.mjs.map +1 -1
- package/dist/node/pieces/reactor/descriptor.json +85 -3
- package/dist/node/pieces/reactor/index.mjs +14843 -163
- package/dist/node/pieces/reactor/index.mjs.map +1 -1
- package/dist/node/pieces/reactor/package.json +1 -1
- package/dist/node/runtime-queries-D5EGaCrH.mjs +2544 -0
- package/dist/node/runtime-queries-D5EGaCrH.mjs.map +1 -0
- package/dist/node/trigger-text-DJIAQBWg.mjs +6765 -0
- package/dist/node/trigger-text-DJIAQBWg.mjs.map +1 -0
- package/dist/node/{upgrade-manifests-C1sl_M-H.mjs → upgrade-manifests-CmNd742Y.mjs} +2 -2
- package/dist/node/{upgrade-manifests-C1sl_M-H.mjs.map → upgrade-manifests-CmNd742Y.mjs.map} +1 -1
- package/dist/node/{workflow-C-uuQPnf.mjs → workflow-CGzYGZnr.mjs} +3 -2
- package/dist/node/workflow-CGzYGZnr.mjs.map +1 -0
- package/dist/powerhouse.manifest.json +6 -1
- package/dist/style.css +151 -19
- package/dist/types/ai/tools.d.ts +3 -1
- package/dist/types/ai/tools.d.ts.map +1 -1
- package/dist/types/ai/workflow-tools.d.ts.map +1 -1
- package/dist/types/document-models/document-models.d.ts +3 -0
- package/dist/types/document-models/document-models.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/actions.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/actions.d.ts +3 -1
- package/dist/types/document-models/workflow/v1/gen/actions.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/creators.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/gen/creators.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/document-model.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/index.d.ts +1 -0
- package/dist/types/document-models/workflow/v1/gen/index.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/ph-factories.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/publishing/actions.d.ts +16 -0
- package/dist/types/document-models/workflow/v1/gen/publishing/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/publishing/creators.d.ts +5 -0
- package/dist/types/document-models/workflow/v1/gen/publishing/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/publishing/error.d.ts +14 -0
- package/dist/types/document-models/workflow/v1/gen/publishing/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/publishing/operations.d.ts +12 -0
- package/dist/types/document-models/workflow/v1/gen/publishing/operations.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/reducer.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts +6 -2
- package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts +3 -2
- package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts +13 -1
- package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts +2 -1
- package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +102 -12
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts +21 -1
- package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts +26 -1
- package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts +13 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/utils.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts +13 -1
- package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts +13 -1
- package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/module.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/helpers.d.ts +15 -0
- package/dist/types/document-models/workflow/v1/src/helpers.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/edges.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/publishing.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/publishing.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/runtime.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/steps.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/variables.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/workflow.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/tests/block-validation-and-enable.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/block-validation-and-enable.test.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/tests/config-and-variables.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/config-and-variables.test.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/tests/draft-and-publish.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/draft-and-publish.test.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/tests/updated-at.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/updated-at.test.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/UsedBy.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/connection-form.d.ts +2 -1
- package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/connection-usage.d.ts +3 -2
- package/dist/types/editors/connection-editor/connection-usage.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/editor.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/piece-auth.d.ts +7 -1
- package/dist/types/editors/connection-editor/piece-auth.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/status.d.ts +2 -1
- package/dist/types/editors/connection-editor/status.d.ts.map +1 -1
- package/dist/types/editors/shared/controls.d.ts +17 -1
- package/dist/types/editors/shared/controls.d.ts.map +1 -1
- package/dist/types/editors/shared/editor-chrome.d.ts +2 -0
- package/dist/types/editors/shared/editor-chrome.d.ts.map +1 -1
- package/dist/types/editors/shared/icons.d.ts +2 -0
- package/dist/types/editors/shared/icons.d.ts.map +1 -1
- package/dist/types/editors/shared/undo-plan.d.ts +20 -0
- package/dist/types/editors/shared/undo-plan.d.ts.map +1 -0
- package/dist/types/editors/shared/undo-plan.test.d.ts +2 -0
- package/dist/types/editors/shared/undo-plan.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/editor.d.ts +0 -1
- package/dist/types/editors/workflow-editor/editor.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/run-kinds.d.ts +5 -0
- package/dist/types/editors/workflow-editor/run-kinds.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-api.d.ts +12 -139
- package/dist/types/editors/workflow-editor/runtime-api.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/runtime-client.d.ts +260 -0
- package/dist/types/editors/workflow-editor/runtime-client.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-client.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/runtime-client.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-context.d.ts +45 -0
- package/dist/types/editors/workflow-editor/runtime-context.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-persist.d.ts +23 -0
- package/dist/types/editors/workflow-editor/runtime-persist.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-persist.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/runtime-persist.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-queries.d.ts +128 -0
- package/dist/types/editors/workflow-editor/runtime-queries.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts +3 -3
- package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts +4 -3
- package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts +2 -3
- package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts +6 -5
- package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts +7 -1
- package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts +34 -0
- package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts +2 -3
- package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/StepTest.d.ts +11 -0
- package/dist/types/editors/workflow-editor/ui/StepTest.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts +0 -1
- package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts +1 -3
- package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts +1 -3
- package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/add-follow-up.d.ts +31 -0
- package/dist/types/editors/workflow-editor/ui/add-follow-up.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/add-follow-up.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/add-follow-up.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ap-edge.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts +2 -1
- package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts +7 -9
- package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/block-meta.d.ts +10 -5
- package/dist/types/editors/workflow-editor/ui/block-meta.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/blocks.d.ts +43 -2
- package/dist/types/editors/workflow-editor/ui/blocks.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/blocks.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/blocks.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts +4 -2
- package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/connection-create.d.ts +3 -3
- package/dist/types/editors/workflow-editor/ui/connection-create.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/design-time.d.ts +92 -0
- package/dist/types/editors/workflow-editor/ui/design-time.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/design-time.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/design-time.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts +10 -2
- package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/forms.d.ts +35 -6
- package/dist/types/editors/workflow-editor/ui/forms.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/model.d.ts +58 -13
- package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/piece-source.d.ts +11 -6
- package/dist/types/editors/workflow-editor/ui/piece-source.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts +5 -0
- package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/prop-controls.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/prop-controls.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/prop-defaults.d.ts +4 -0
- package/dist/types/editors/workflow-editor/ui/prop-defaults.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/prop-defaults.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/prop-defaults.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/query-keys.d.ts +54 -0
- package/dist/types/editors/workflow-editor/ui/query-keys.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts +3 -8
- package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/secret-ref.d.ts +18 -0
- package/dist/types/editors/workflow-editor/ui/secret-ref.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/step-test.d.ts +14 -0
- package/dist/types/editors/workflow-editor/ui/step-test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/step-test.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/step-test.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/test-state.d.ts +7 -0
- package/dist/types/editors/workflow-editor/ui/test-state.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts +2 -1
- package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/use-validity.d.ts +28 -0
- package/dist/types/editors/workflow-editor/ui/use-validity.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/validation.d.ts +33 -1
- package/dist/types/editors/workflow-editor/ui/validation.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/variable-types.d.ts +14 -0
- package/dist/types/editors/workflow-editor/ui/variable-types.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/variable-types.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/variable-types.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/version-badge.d.ts +33 -0
- package/dist/types/editors/workflow-editor/ui/version-badge.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/version-badge.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/version-badge.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/use-runtime-url.d.ts +0 -1
- package/dist/types/editors/workflow-editor/use-runtime-url.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/RunsTable.d.ts +1 -1
- package/dist/types/editors/workflow-studio/components/RunsTable.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/RunsView.d.ts +4 -1
- package/dist/types/editors/workflow-studio/components/RunsView.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/Sidebar.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts +2 -1
- package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts +13 -0
- package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts +0 -1
- package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/chain.d.ts +5 -3
- package/dist/types/editors/workflow-studio/components/chain.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/run-format.d.ts +11 -2
- package/dist/types/editors/workflow-studio/components/run-format.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/step-outline.d.ts +3 -1
- package/dist/types/editors/workflow-studio/components/step-outline.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/ui.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/ui.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/useRuns.d.ts +4 -1
- package/dist/types/editors/workflow-studio/components/useRuns.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/editor.d.ts.map +1 -1
- package/dist/types/pieces/index.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/action-list-prop.test.d.ts +2 -0
- package/dist/types/pieces/reactor/lib/actions/action-list-prop.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-create.d.ts +14 -1
- package/dist/types/pieces/reactor/lib/actions/document-create.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts +14 -1
- package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-get.d.ts +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-get.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/input-props.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/input-schema.d.ts +11 -2
- package/dist/types/pieces/reactor/lib/input-schema.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/parse.d.ts +22 -4
- package/dist/types/pieces/reactor/lib/parse.d.ts.map +1 -1
- package/dist/types/pieces/reactor/lib/reactor.d.ts +15 -1
- package/dist/types/pieces/reactor/lib/reactor.d.ts.map +1 -1
- package/dist/types/scripts/ui-stack.d.ts +53 -11
- package/dist/types/scripts/ui-stack.d.ts.map +1 -1
- package/dist/types/test/ui/block-picker.spec.d.ts +2 -0
- package/dist/types/test/ui/block-picker.spec.d.ts.map +1 -0
- package/dist/types/test/ui/branch.spec.d.ts +2 -0
- package/dist/types/test/ui/branch.spec.d.ts.map +1 -0
- package/dist/types/test/ui/canvas-logos.spec.d.ts +2 -0
- package/dist/types/test/ui/canvas-logos.spec.d.ts.map +1 -0
- package/dist/types/test/ui/fixtures.d.ts +1 -0
- package/dist/types/test/ui/fixtures.d.ts.map +1 -1
- package/dist/types/test/ui/global-setup.d.ts.map +1 -1
- package/dist/types/test/ui/harness/prop-controls.d.ts.map +1 -1
- package/dist/types/test/ui/piece-version.spec.d.ts +2 -0
- package/dist/types/test/ui/piece-version.spec.d.ts.map +1 -0
- package/dist/types/test/ui/ports.spec.d.ts +2 -0
- package/dist/types/test/ui/ports.spec.d.ts.map +1 -0
- package/dist/types/test/ui/publish.spec.d.ts +2 -0
- package/dist/types/test/ui/publish.spec.d.ts.map +1 -0
- package/dist/types/test/ui/step-test.spec.d.ts +2 -0
- package/dist/types/test/ui/step-test.spec.d.ts.map +1 -0
- package/dist/types/test/ui/variables.spec.d.ts +2 -0
- package/dist/types/test/ui/variables.spec.d.ts.map +1 -0
- package/dist/types/test/ui/webhook.spec.d.ts +2 -0
- package/dist/types/test/ui/webhook.spec.d.ts.map +1 -0
- package/dist/types/test/ui/workflow-menu.spec.d.ts +2 -0
- package/dist/types/test/ui/workflow-menu.spec.d.ts.map +1 -0
- package/package.json +11 -10
- package/dist/browser/BlockSelector-D24DIiSX.js +0 -1388
- package/dist/browser/BlockSelector-D24DIiSX.js.map +0 -1
- package/dist/browser/connection-form-D-NETdDQ.js.map +0 -1
- package/dist/browser/editor-B6N0PCuZ.js.map +0 -1
- package/dist/browser/editor-BkdwuOC-.js.map +0 -1
- package/dist/browser/editor-CZ5NvCyv.js.map +0 -1
- package/dist/browser/module-Bkms70LV.js.map +0 -1
- package/dist/browser/piece-auth-Z4mZEOtL.js.map +0 -1
- package/dist/browser/runtime-api-DDMQc4PB.js +0 -558
- package/dist/browser/runtime-api-DDMQc4PB.js.map +0 -1
- package/dist/browser/trigger-text-CUv5Z2Uk.js +0 -551
- package/dist/browser/trigger-text-CUv5Z2Uk.js.map +0 -1
- package/dist/browser/workflow-CGtVlhr8.js.map +0 -1
- package/dist/node/BlockSelector-CTmmpYxu.mjs +0 -1388
- package/dist/node/BlockSelector-CTmmpYxu.mjs.map +0 -1
- package/dist/node/connection-form-C9vbfSnA.mjs.map +0 -1
- package/dist/node/editor-By9BHI8e.mjs.map +0 -1
- package/dist/node/editor-DP36YDk5.mjs.map +0 -1
- package/dist/node/editor-StBssjcQ.mjs.map +0 -1
- package/dist/node/module-DuxxhgKs.mjs.map +0 -1
- package/dist/node/piece-auth-Z4mZEOtL.mjs.map +0 -1
- package/dist/node/runtime-api-DDMQc4PB.mjs +0 -558
- package/dist/node/runtime-api-DDMQc4PB.mjs.map +0 -1
- package/dist/node/trigger-text-Bzq6VfOQ.mjs +0 -551
- package/dist/node/trigger-text-Bzq6VfOQ.mjs.map +0 -1
- package/dist/node/workflow-C-uuQPnf.mjs.map +0 -1
- package/dist/types/editors/workflow-editor/runtime-api.test.d.ts +0 -2
- package/dist/types/editors/workflow-editor/runtime-api.test.d.ts.map +0 -1
- package/dist/types/editors/workflow-editor/runtime-piece-source.d.ts +0 -2
- package/dist/types/editors/workflow-editor/runtime-piece-source.d.ts.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { y as actions } from "./module-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { c as DataViewer,
|
|
6
|
-
import {
|
|
7
|
-
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
1
|
+
import { K as CORE_PIECE, et as sameBlock, l as runsOfPages, q as MANUAL_TRIGGER, rt as triggerBlock, tt as stepBlock } from "./runtime-queries-D5EGaCrH.mjs";
|
|
2
|
+
import { y as actions } from "./module-Dhe5E-VA.mjs";
|
|
3
|
+
import { $ as formatDuration, B as blockMeta, Et as Select, G as CONNECTION_TONE, It as DocumentErrorBoundary, J as STEP_TONE, K as RUN_STATUSES, Lt as DocumentLoadError, Nt as textInputClass, Pt as Icon, Q as formatAbsolute, Rt as errorMessage, W as usePieceLogos, X as TONE_TEXT, Y as TONE_DOT, Z as durationMs, at as runTimeline, bt as Button, ct as toneOf, et as formatMs, ht as useRunQuery, it as runStatusLabel, lt as workflowHealth, mt as useRunPagesQuery, nt as formatWhen, ot as runTone, q as RUN_TONE, rt as runStats, st as statusLabel, t as BlockLogo, tt as formatTrigger, ut as WorkflowRuntimeProvider, vt as useRuntimeActions } from "./BlockSelector-lOcIiaqt.mjs";
|
|
4
|
+
import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-CGzYGZnr.mjs";
|
|
5
|
+
import { a as Modal, c as PublishState, i as DataViewer, l as StatusToggle, r as describeTrigger } from "./trigger-text-DJIAQBWg.mjs";
|
|
6
|
+
import { Fragment, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
8
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { addDocument, deleteNode, setSelectedNode, showDeleteNodeModal, useDispatch, useDocumentSafe, useFileNodesInSelectedDrive, usePHToast, useSelectedDrive, useSelectedDriveId, useSelectedNode, useSetPHAppConfig } from "@powerhousedao/reactor-browser";
|
|
9
9
|
//#region editors/workflow-studio/components/chain.tsx
|
|
10
10
|
const RING$1 = {
|
|
11
11
|
ok: "ring-wf-ok",
|
|
@@ -41,7 +41,7 @@ function MiniChain(props) {
|
|
|
41
41
|
className: `flex shrink-0 items-center justify-center rounded-full bg-card ring-[1.5px] dark:bg-white ${md ? "h-8 w-8" : "h-6 w-6"} ${RING$1[tones[index]]} ${link.status === "SKIPPED" ? "opacity-50" : ""}`,
|
|
42
42
|
children: /* @__PURE__ */ jsx(BlockLogo, {
|
|
43
43
|
bare: true,
|
|
44
|
-
|
|
44
|
+
block: link.block,
|
|
45
45
|
size: md ? 16 : 14
|
|
46
46
|
})
|
|
47
47
|
})]
|
|
@@ -56,16 +56,36 @@ function MiniChain(props) {
|
|
|
56
56
|
}) : null]
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
+
function triggerOfKind(kind) {
|
|
60
|
+
if (kind.startsWith("piece:")) {
|
|
61
|
+
const rest = kind.slice(6);
|
|
62
|
+
const colon = rest.indexOf(":");
|
|
63
|
+
if (colon > 0) return {
|
|
64
|
+
pieceName: rest.slice(0, colon),
|
|
65
|
+
kind: "trigger",
|
|
66
|
+
name: rest.slice(colon + 1)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
pieceName: CORE_PIECE,
|
|
71
|
+
kind: "trigger",
|
|
72
|
+
name: kind
|
|
73
|
+
};
|
|
74
|
+
}
|
|
59
75
|
/** A run's own chain: the trigger, then every step it recorded. */
|
|
60
|
-
function runLinks(run,
|
|
76
|
+
function runLinks(run, trigger) {
|
|
61
77
|
return [{
|
|
62
78
|
id: "trigger",
|
|
63
|
-
|
|
79
|
+
block: trigger ?? triggerOfKind(run.triggerKind),
|
|
64
80
|
label: "Trigger",
|
|
65
81
|
status: "SUCCEEDED"
|
|
66
82
|
}, ...run.steps.map((step) => ({
|
|
67
83
|
id: step.stepId + step.stepKey,
|
|
68
|
-
|
|
84
|
+
block: {
|
|
85
|
+
pieceName: step.pieceName,
|
|
86
|
+
kind: "action",
|
|
87
|
+
name: step.blockName
|
|
88
|
+
},
|
|
69
89
|
label: step.stepKey,
|
|
70
90
|
status: step.status
|
|
71
91
|
}))];
|
|
@@ -98,7 +118,7 @@ function RunStrip(props) {
|
|
|
98
118
|
//#endregion
|
|
99
119
|
//#region editors/workflow-studio/components/ui.tsx
|
|
100
120
|
function StatusDot(props) {
|
|
101
|
-
const hollow = props.tone === "idle";
|
|
121
|
+
const hollow = props.hollow ?? props.tone === "idle";
|
|
102
122
|
return /* @__PURE__ */ jsx("span", {
|
|
103
123
|
"aria-hidden": true,
|
|
104
124
|
className: `inline-block h-2 w-2 shrink-0 rounded-full ${hollow ? "border border-solid border-muted-foreground/60" : TONE_DOT[props.tone]} ${props.className ?? ""}`
|
|
@@ -107,7 +127,7 @@ function StatusDot(props) {
|
|
|
107
127
|
function StatusText(props) {
|
|
108
128
|
return /* @__PURE__ */ jsxs("span", {
|
|
109
129
|
className: `inline-flex items-center gap-1.5 font-medium ${TONE_TEXT[props.tone]} ${props.className ?? ""}`,
|
|
110
|
-
children: [/* @__PURE__ */ jsx(StatusDot, { tone: props.tone }), statusLabel(props.status)]
|
|
130
|
+
children: [/* @__PURE__ */ jsx(StatusDot, { tone: props.tone }), props.label ?? statusLabel(props.status)]
|
|
111
131
|
});
|
|
112
132
|
}
|
|
113
133
|
/** A label/value pair for a header's facts line. */
|
|
@@ -126,6 +146,7 @@ function Fact(props) {
|
|
|
126
146
|
}
|
|
127
147
|
//#endregion
|
|
128
148
|
//#region editors/workflow-studio/components/RunsTable.tsx
|
|
149
|
+
const DETAIL_POLL_MS = 5e3;
|
|
129
150
|
const CONTROL = "h-8 rounded-md border border-solid border-border bg-card px-2.5 text-[13px] text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
130
151
|
function stringify(value) {
|
|
131
152
|
if (value === void 0) return "";
|
|
@@ -156,7 +177,11 @@ function TimelineBar(props) {
|
|
|
156
177
|
}
|
|
157
178
|
function StepRow(props) {
|
|
158
179
|
const { step } = props;
|
|
159
|
-
const meta = blockMeta(
|
|
180
|
+
const meta = blockMeta({
|
|
181
|
+
pieceName: step.pieceName,
|
|
182
|
+
kind: "action",
|
|
183
|
+
name: step.blockName
|
|
184
|
+
});
|
|
160
185
|
const [open, setOpen] = useState(false);
|
|
161
186
|
return /* @__PURE__ */ jsxs("div", {
|
|
162
187
|
role: "listitem",
|
|
@@ -210,6 +235,15 @@ function StepRow(props) {
|
|
|
210
235
|
}) : null, step.status === "SKIPPED" ? /* @__PURE__ */ jsx("p", {
|
|
211
236
|
className: "text-xs text-muted-foreground",
|
|
212
237
|
children: "The run never reached this step."
|
|
238
|
+
}) : props.dataError ? /* @__PURE__ */ jsxs("p", {
|
|
239
|
+
className: "text-xs text-wf-warn",
|
|
240
|
+
children: ["Couldn't load what this step received and produced.", /* @__PURE__ */ jsx("span", {
|
|
241
|
+
className: "mt-0.5 block opacity-80",
|
|
242
|
+
children: props.dataError
|
|
243
|
+
})]
|
|
244
|
+
}) : props.dataPending ? /* @__PURE__ */ jsx("p", {
|
|
245
|
+
className: "text-xs text-muted-foreground",
|
|
246
|
+
children: "Loading step data…"
|
|
213
247
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
214
248
|
className: "grid items-start gap-2 md:grid-cols-2",
|
|
215
249
|
children: [/* @__PURE__ */ jsx(DataViewer, {
|
|
@@ -234,10 +268,14 @@ const TRIGGER_LABEL = {
|
|
|
234
268
|
rerun: "Rerun"
|
|
235
269
|
};
|
|
236
270
|
function triggerLabel(kind) {
|
|
237
|
-
if (kind.startsWith("piece:"))
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
271
|
+
if (kind.startsWith("piece:")) {
|
|
272
|
+
const trigger = triggerOfKind(kind);
|
|
273
|
+
return describeTrigger({
|
|
274
|
+
pieceName: trigger.pieceName,
|
|
275
|
+
triggerName: trigger.name,
|
|
276
|
+
config: null
|
|
277
|
+
});
|
|
278
|
+
}
|
|
241
279
|
return TRIGGER_LABEL[kind] ?? formatTrigger(kind);
|
|
242
280
|
}
|
|
243
281
|
function describeRunError(error, names) {
|
|
@@ -309,7 +347,12 @@ function TriggerRow(props) {
|
|
|
309
347
|
});
|
|
310
348
|
}
|
|
311
349
|
function RunDetail(props) {
|
|
312
|
-
const {
|
|
350
|
+
const { names } = props;
|
|
351
|
+
const { rerunRun } = useRuntimeActions();
|
|
352
|
+
const full = useRunQuery(props.run.id, { pollMs: DETAIL_POLL_MS });
|
|
353
|
+
const run = full.data ?? props.run;
|
|
354
|
+
const dataPending = full.data === void 0 && full.status === "pending";
|
|
355
|
+
const dataError = full.status === "error" ? full.error instanceof Error ? full.error.message : String(full.error) : null;
|
|
313
356
|
const timeline = runTimeline(run);
|
|
314
357
|
const [rerunning, setRerunning] = useState(false);
|
|
315
358
|
const [rerunError, setRerunError] = useState(null);
|
|
@@ -320,6 +363,11 @@ function RunDetail(props) {
|
|
|
320
363
|
className: "rounded-md bg-wf-fail/10 px-3 py-2 text-[13px] text-wf-fail",
|
|
321
364
|
children: describeRunError(run.error, names)
|
|
322
365
|
}) : null,
|
|
366
|
+
run.warningNotes.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
367
|
+
"aria-label": "Run warnings",
|
|
368
|
+
className: "space-y-1 rounded-md bg-wf-warn/10 px-3 py-2 text-[13px] text-wf-warn",
|
|
369
|
+
children: run.warningNotes.map((note) => /* @__PURE__ */ jsx("li", { children: note }, note))
|
|
370
|
+
}) : null,
|
|
323
371
|
/* @__PURE__ */ jsxs("div", {
|
|
324
372
|
className: "flex flex-wrap items-center gap-x-5 gap-y-1 text-xs text-muted-foreground",
|
|
325
373
|
children: [
|
|
@@ -363,7 +411,9 @@ function RunDetail(props) {
|
|
|
363
411
|
run.steps.map((step) => /* @__PURE__ */ jsx(StepRow, {
|
|
364
412
|
step,
|
|
365
413
|
name: names.get(step.stepKey),
|
|
366
|
-
span: timeline.get(step.stepId)
|
|
414
|
+
span: timeline.get(step.stepId),
|
|
415
|
+
dataPending,
|
|
416
|
+
dataError
|
|
367
417
|
}, step.stepId + step.stepKey)),
|
|
368
418
|
run.steps.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
369
419
|
className: "border-t border-solid border-border px-3 py-2 pl-10 text-xs text-muted-foreground",
|
|
@@ -399,7 +449,10 @@ function RunsTable(props) {
|
|
|
399
449
|
const [descending, setDescending] = useState(true);
|
|
400
450
|
const [expanded, setExpanded] = useState(null);
|
|
401
451
|
const documents = useWorkflowDocumentsInSelectedDrive() ?? [];
|
|
402
|
-
const
|
|
452
|
+
const triggerBlocks = new Map(documents.map((document) => {
|
|
453
|
+
const trigger = document.state.global.trigger;
|
|
454
|
+
return [document.header.id, trigger ? triggerBlock(trigger) : void 0];
|
|
455
|
+
}));
|
|
403
456
|
const stepNames = new Map(documents.map((document) => [document.header.id, new Map(document.state.global.steps.map((step) => [step.key, step.name || step.key]))]));
|
|
404
457
|
usePieceLogos();
|
|
405
458
|
const workflowOptions = useMemo(() => [...new Map(props.runs.map((run) => [run.workflowId, run.workflowName]))].map(([id, name]) => ({
|
|
@@ -583,8 +636,9 @@ function RunsTable(props) {
|
|
|
583
636
|
/* @__PURE__ */ jsx("td", {
|
|
584
637
|
className: "px-3 py-2.5",
|
|
585
638
|
children: /* @__PURE__ */ jsx(StatusText, {
|
|
586
|
-
tone:
|
|
587
|
-
status: run.status
|
|
639
|
+
tone: runTone(run),
|
|
640
|
+
status: run.status,
|
|
641
|
+
label: runStatusLabel(run)
|
|
588
642
|
})
|
|
589
643
|
}),
|
|
590
644
|
props.showWorkflow ? /* @__PURE__ */ jsx("td", {
|
|
@@ -609,7 +663,7 @@ function RunsTable(props) {
|
|
|
609
663
|
}),
|
|
610
664
|
/* @__PURE__ */ jsx("td", {
|
|
611
665
|
className: "px-3 py-2",
|
|
612
|
-
children: /* @__PURE__ */ jsx(MiniChain, { links: runLinks(run,
|
|
666
|
+
children: /* @__PURE__ */ jsx(MiniChain, { links: runLinks(run, triggerBlocks.get(run.workflowId)) })
|
|
613
667
|
}),
|
|
614
668
|
/* @__PURE__ */ jsx("td", {
|
|
615
669
|
className: "px-3 py-2.5",
|
|
@@ -699,11 +753,193 @@ function RunsView(props) {
|
|
|
699
753
|
className: "mt-1 text-xs text-muted-foreground",
|
|
700
754
|
children: props.onFire ? "Use Run now to record the first one." : "Runs appear here once the trigger fires."
|
|
701
755
|
})]
|
|
702
|
-
}) : /* @__PURE__ */ jsx(RunsTable, {
|
|
756
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(RunsTable, {
|
|
703
757
|
runs,
|
|
704
758
|
showWorkflow: props.showWorkflow,
|
|
705
759
|
onChanged: props.reload
|
|
706
|
-
})
|
|
760
|
+
}), props.hasMore && props.onLoadMore ? /* @__PURE__ */ jsx("div", {
|
|
761
|
+
className: "mt-3 flex justify-center",
|
|
762
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
763
|
+
disabled: props.loadingMore,
|
|
764
|
+
onClick: () => props.onLoadMore(),
|
|
765
|
+
children: props.loadingMore ? "Loading…" : "Load older runs"
|
|
766
|
+
})
|
|
767
|
+
}) : null] })
|
|
768
|
+
]
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
//#endregion
|
|
772
|
+
//#region editors/workflow-studio/components/WorkflowMenu.tsx
|
|
773
|
+
function DeleteWorkflowDialog(props) {
|
|
774
|
+
const [typed, setTyped] = useState("");
|
|
775
|
+
const [error, setError] = useState(null);
|
|
776
|
+
const [deleting, setDeleting] = useState(false);
|
|
777
|
+
const inputId = useId();
|
|
778
|
+
const cancelRef = useRef(null);
|
|
779
|
+
const matches = typed === props.name;
|
|
780
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
781
|
+
open: true,
|
|
782
|
+
title: "Delete workflow",
|
|
783
|
+
onOpenChange: (open) => {
|
|
784
|
+
if (!open) props.onCancel();
|
|
785
|
+
},
|
|
786
|
+
contentProps: {
|
|
787
|
+
className: "w-[28rem] max-w-[92vw] rounded-xl border border-solid border-foreground/10",
|
|
788
|
+
role: "alertdialog",
|
|
789
|
+
"aria-label": "Delete workflow",
|
|
790
|
+
onOpenAutoFocus: (event) => {
|
|
791
|
+
event.preventDefault();
|
|
792
|
+
cancelRef.current?.focus();
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
796
|
+
className: "flex flex-col gap-4 p-6",
|
|
797
|
+
onSubmit: (event) => {
|
|
798
|
+
event.preventDefault();
|
|
799
|
+
if (!matches || deleting) return;
|
|
800
|
+
setDeleting(true);
|
|
801
|
+
props.onConfirm().catch((cause) => {
|
|
802
|
+
setDeleting(false);
|
|
803
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
804
|
+
});
|
|
805
|
+
},
|
|
806
|
+
children: [
|
|
807
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
808
|
+
className: "text-[15px] font-semibold text-foreground",
|
|
809
|
+
children: "Delete workflow"
|
|
810
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
811
|
+
className: "mt-1 text-[13px] text-muted-foreground",
|
|
812
|
+
children: "This removes the workflow from the drive and can't be undone. To archive it instead, use Archive."
|
|
813
|
+
})] }),
|
|
814
|
+
/* @__PURE__ */ jsxs("label", {
|
|
815
|
+
htmlFor: inputId,
|
|
816
|
+
className: "flex flex-col gap-1.5",
|
|
817
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
818
|
+
className: "text-[13px] text-foreground",
|
|
819
|
+
children: [
|
|
820
|
+
"Type ",
|
|
821
|
+
/* @__PURE__ */ jsx("strong", {
|
|
822
|
+
className: "font-semibold",
|
|
823
|
+
children: props.name
|
|
824
|
+
}),
|
|
825
|
+
" to confirm"
|
|
826
|
+
]
|
|
827
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
828
|
+
id: inputId,
|
|
829
|
+
className: textInputClass,
|
|
830
|
+
value: typed,
|
|
831
|
+
spellCheck: false,
|
|
832
|
+
autoComplete: "off",
|
|
833
|
+
onChange: (event) => setTyped(event.target.value)
|
|
834
|
+
})]
|
|
835
|
+
}),
|
|
836
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
837
|
+
className: "text-xs text-wf-fail",
|
|
838
|
+
children: error
|
|
839
|
+
}) : null,
|
|
840
|
+
/* @__PURE__ */ jsxs("div", {
|
|
841
|
+
className: "flex justify-end gap-2",
|
|
842
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
843
|
+
ref: cancelRef,
|
|
844
|
+
onClick: props.onCancel,
|
|
845
|
+
children: "Cancel"
|
|
846
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
847
|
+
type: "submit",
|
|
848
|
+
variant: "destructive",
|
|
849
|
+
disabled: !matches || deleting,
|
|
850
|
+
children: deleting ? "Deleting…" : "Delete workflow"
|
|
851
|
+
})]
|
|
852
|
+
})
|
|
853
|
+
]
|
|
854
|
+
})
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
function MenuItem(props) {
|
|
858
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
859
|
+
type: "button",
|
|
860
|
+
role: "menuitem",
|
|
861
|
+
className: `flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] hover:bg-accent focus-visible:bg-accent focus-visible:outline-none ${props.danger ? "text-wf-fail" : "text-foreground"}`,
|
|
862
|
+
onClick: props.onSelect,
|
|
863
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
864
|
+
name: props.icon,
|
|
865
|
+
className: "h-3.5 w-3.5"
|
|
866
|
+
}), props.label]
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
function WorkflowMenu(props) {
|
|
870
|
+
const [open, setOpen] = useState(false);
|
|
871
|
+
const [confirming, setConfirming] = useState(false);
|
|
872
|
+
const [, dispatch] = useDispatch(props.document);
|
|
873
|
+
const driveId = useSelectedDriveId();
|
|
874
|
+
const ref = useRef(null);
|
|
875
|
+
const state = props.document.state.global;
|
|
876
|
+
const name = state.name || props.nodeName || "Untitled workflow";
|
|
877
|
+
const archived = state.status === "ARCHIVED";
|
|
878
|
+
useEffect(() => {
|
|
879
|
+
if (!open) return;
|
|
880
|
+
const close = (event) => {
|
|
881
|
+
if (!ref.current?.contains(event.target)) setOpen(false);
|
|
882
|
+
};
|
|
883
|
+
const escape = (event) => {
|
|
884
|
+
if (event.key === "Escape") setOpen(false);
|
|
885
|
+
};
|
|
886
|
+
window.addEventListener("mousedown", close);
|
|
887
|
+
window.addEventListener("keydown", escape);
|
|
888
|
+
return () => {
|
|
889
|
+
window.removeEventListener("mousedown", close);
|
|
890
|
+
window.removeEventListener("keydown", escape);
|
|
891
|
+
};
|
|
892
|
+
}, [open]);
|
|
893
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
894
|
+
ref,
|
|
895
|
+
className: "relative",
|
|
896
|
+
children: [
|
|
897
|
+
/* @__PURE__ */ jsx("button", {
|
|
898
|
+
type: "button",
|
|
899
|
+
"aria-label": `More actions for ${name}`,
|
|
900
|
+
"aria-haspopup": "menu",
|
|
901
|
+
"aria-expanded": open,
|
|
902
|
+
className: `flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${props.subtle && !open ? "opacity-0 group-hover:opacity-100" : ""}`,
|
|
903
|
+
onClick: (event) => {
|
|
904
|
+
event.stopPropagation();
|
|
905
|
+
setOpen((value) => !value);
|
|
906
|
+
},
|
|
907
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
908
|
+
name: "more",
|
|
909
|
+
className: "h-4 w-4"
|
|
910
|
+
})
|
|
911
|
+
}),
|
|
912
|
+
open ? /* @__PURE__ */ jsxs("div", {
|
|
913
|
+
role: "menu",
|
|
914
|
+
className: "absolute right-0 top-full z-50 mt-1 w-44 rounded-md border border-solid border-foreground/10 bg-card p-1 shadow-lg",
|
|
915
|
+
children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
916
|
+
label: archived ? "Restore" : "Archive",
|
|
917
|
+
icon: archived ? "retry" : "archive",
|
|
918
|
+
onSelect: () => {
|
|
919
|
+
setOpen(false);
|
|
920
|
+
const status = archived ? state.published ? "DISABLED" : "DRAFT" : "ARCHIVED";
|
|
921
|
+
dispatch(actions.setWorkflowStatus({ status }));
|
|
922
|
+
}
|
|
923
|
+
}), /* @__PURE__ */ jsx(MenuItem, {
|
|
924
|
+
label: "Delete…",
|
|
925
|
+
icon: "trash",
|
|
926
|
+
danger: true,
|
|
927
|
+
onSelect: () => {
|
|
928
|
+
setOpen(false);
|
|
929
|
+
setConfirming(true);
|
|
930
|
+
}
|
|
931
|
+
})]
|
|
932
|
+
}) : null,
|
|
933
|
+
confirming ? /* @__PURE__ */ jsx(DeleteWorkflowDialog, {
|
|
934
|
+
name,
|
|
935
|
+
onCancel: () => setConfirming(false),
|
|
936
|
+
onConfirm: async () => {
|
|
937
|
+
if (!driveId) throw new Error("No drive is selected");
|
|
938
|
+
await deleteNode(driveId, props.document.header.id);
|
|
939
|
+
setConfirming(false);
|
|
940
|
+
props.onDeleted?.();
|
|
941
|
+
}
|
|
942
|
+
}) : null
|
|
707
943
|
]
|
|
708
944
|
});
|
|
709
945
|
}
|
|
@@ -714,7 +950,11 @@ function documentName(document, fallback) {
|
|
|
714
950
|
return (document?.state?.global)?.name || fallback || "(unnamed)";
|
|
715
951
|
}
|
|
716
952
|
function documentStatus(document) {
|
|
717
|
-
|
|
953
|
+
const state = document?.state?.global;
|
|
954
|
+
return {
|
|
955
|
+
status: state?.status,
|
|
956
|
+
published: Boolean(state?.published)
|
|
957
|
+
};
|
|
718
958
|
}
|
|
719
959
|
function Row(props) {
|
|
720
960
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -769,10 +1009,12 @@ function NodeRow(props) {
|
|
|
769
1009
|
children: node.name || "(unnamed)"
|
|
770
1010
|
})]
|
|
771
1011
|
});
|
|
772
|
-
const status = documentStatus(document);
|
|
773
|
-
const
|
|
1012
|
+
const { status, published } = documentStatus(document);
|
|
1013
|
+
const isWorkflow = node.documentType === WORKFLOW_TYPE$2;
|
|
1014
|
+
const { tone, label, hollow } = isWorkflow ? workflowHealth(status, props.lastRunStatus, published) : {
|
|
774
1015
|
tone: toneOf(CONNECTION_TONE, status),
|
|
775
|
-
label: status
|
|
1016
|
+
label: status,
|
|
1017
|
+
hollow: void 0
|
|
776
1018
|
};
|
|
777
1019
|
return /* @__PURE__ */ jsxs(Row, {
|
|
778
1020
|
active: props.active,
|
|
@@ -789,7 +1031,11 @@ function NodeRow(props) {
|
|
|
789
1031
|
name: "pencil",
|
|
790
1032
|
className: "h-3.5 w-3.5"
|
|
791
1033
|
})
|
|
792
|
-
}) : null, /* @__PURE__ */ jsx(
|
|
1034
|
+
}) : null, isWorkflow && document ? /* @__PURE__ */ jsx(WorkflowMenu, {
|
|
1035
|
+
subtle: true,
|
|
1036
|
+
document,
|
|
1037
|
+
nodeName: node.name
|
|
1038
|
+
}) : /* @__PURE__ */ jsx(DeleteButton, {
|
|
793
1039
|
node,
|
|
794
1040
|
label: documentName(document, node.name)
|
|
795
1041
|
})]
|
|
@@ -797,7 +1043,10 @@ function NodeRow(props) {
|
|
|
797
1043
|
children: [/* @__PURE__ */ jsx("span", {
|
|
798
1044
|
title: label,
|
|
799
1045
|
className: "flex",
|
|
800
|
-
children: /* @__PURE__ */ jsx(StatusDot, {
|
|
1046
|
+
children: /* @__PURE__ */ jsx(StatusDot, {
|
|
1047
|
+
tone,
|
|
1048
|
+
hollow
|
|
1049
|
+
})
|
|
801
1050
|
}), /* @__PURE__ */ jsx("span", {
|
|
802
1051
|
className: "min-w-0 truncate",
|
|
803
1052
|
children: documentName(document, node.name)
|
|
@@ -904,73 +1153,58 @@ function useHashSelection() {
|
|
|
904
1153
|
const POLL_MS = 5e3;
|
|
905
1154
|
function useRuns(scope, active = true) {
|
|
906
1155
|
const { workflowId, driveId, limit } = scope;
|
|
907
|
-
const
|
|
908
|
-
const [error, setError] = useState(null);
|
|
909
|
-
const load = useRef(() => void 0);
|
|
910
|
-
useEffect(() => {
|
|
911
|
-
if (!active) return;
|
|
912
|
-
let cancelled = false;
|
|
913
|
-
const run = () => {
|
|
914
|
-
fetchRuns({
|
|
915
|
-
workflowId,
|
|
916
|
-
driveId,
|
|
917
|
-
limit
|
|
918
|
-
}).then((result) => {
|
|
919
|
-
if (cancelled) return;
|
|
920
|
-
setRuns(result);
|
|
921
|
-
setError(null);
|
|
922
|
-
}, (loadError) => {
|
|
923
|
-
if (cancelled) return;
|
|
924
|
-
setError(loadError instanceof Error ? loadError.message : String(loadError));
|
|
925
|
-
});
|
|
926
|
-
};
|
|
927
|
-
load.current = run;
|
|
928
|
-
setRuns(null);
|
|
929
|
-
run();
|
|
930
|
-
const timer = setInterval(run, POLL_MS);
|
|
931
|
-
return () => {
|
|
932
|
-
cancelled = true;
|
|
933
|
-
clearInterval(timer);
|
|
934
|
-
};
|
|
935
|
-
}, [
|
|
1156
|
+
const query = useRunPagesQuery({
|
|
936
1157
|
workflowId,
|
|
937
1158
|
driveId,
|
|
938
|
-
limit
|
|
939
|
-
|
|
940
|
-
|
|
1159
|
+
limit
|
|
1160
|
+
}, {
|
|
1161
|
+
active,
|
|
1162
|
+
pollMs: POLL_MS
|
|
1163
|
+
});
|
|
1164
|
+
const { refetch, fetchNextPage } = query;
|
|
941
1165
|
return {
|
|
942
|
-
runs,
|
|
943
|
-
error,
|
|
944
|
-
reload:
|
|
1166
|
+
runs: query.data ? runsOfPages(query.data.pages) : null,
|
|
1167
|
+
error: query.status === "error" ? query.error instanceof Error ? query.error.message : String(query.error) : null,
|
|
1168
|
+
reload: () => void refetch(),
|
|
1169
|
+
hasMore: query.hasNextPage,
|
|
1170
|
+
loadingMore: query.isFetchingNextPage,
|
|
1171
|
+
loadMore: () => void fetchNextPage()
|
|
945
1172
|
};
|
|
946
1173
|
}
|
|
947
1174
|
//#endregion
|
|
948
1175
|
//#region editors/workflow-studio/components/step-outline.ts
|
|
949
1176
|
function stepOutline(args) {
|
|
950
|
-
const
|
|
951
|
-
const outgoing = /* @__PURE__ */ new Map();
|
|
1177
|
+
const inbound = /* @__PURE__ */ new Map();
|
|
952
1178
|
for (const edge of args.edges) {
|
|
953
|
-
|
|
954
|
-
const list = outgoing.get(edge.from) ?? [];
|
|
1179
|
+
const list = inbound.get(edge.to) ?? [];
|
|
955
1180
|
list.push(edge);
|
|
956
|
-
|
|
1181
|
+
inbound.set(edge.to, list);
|
|
957
1182
|
}
|
|
958
|
-
|
|
1183
|
+
const decided = args.triggerId ? [args.triggerId] : [];
|
|
959
1184
|
const rows = [];
|
|
960
1185
|
const seen = /* @__PURE__ */ new Set();
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
1186
|
+
const firstDecided = (edges) => edges.reduce((first, edge) => decided.indexOf(edge.from) < decided.indexOf(first.from) ? edge : first);
|
|
1187
|
+
let progressed = true;
|
|
1188
|
+
while (progressed) {
|
|
1189
|
+
progressed = false;
|
|
1190
|
+
for (const step of args.steps) {
|
|
1191
|
+
if (seen.has(step.id)) continue;
|
|
1192
|
+
const edges = inbound.get(step.id) ?? [];
|
|
1193
|
+
const entry = !args.triggerId && edges.length === 0;
|
|
1194
|
+
if (!entry) {
|
|
1195
|
+
if (edges.length === 0) continue;
|
|
1196
|
+
if (!edges.every((edge) => decided.includes(edge.from))) continue;
|
|
1197
|
+
}
|
|
1198
|
+
seen.add(step.id);
|
|
1199
|
+
decided.push(step.id);
|
|
1200
|
+
const port = entry ? null : firstDecided(edges).port;
|
|
966
1201
|
rows.push({
|
|
967
1202
|
step,
|
|
968
1203
|
port: port === "next" ? null : port
|
|
969
1204
|
});
|
|
1205
|
+
progressed = true;
|
|
970
1206
|
}
|
|
971
|
-
|
|
972
|
-
};
|
|
973
|
-
if (args.triggerId) walk(args.triggerId, null);
|
|
1207
|
+
}
|
|
974
1208
|
return {
|
|
975
1209
|
rows,
|
|
976
1210
|
orphans: args.steps.filter((step) => !seen.has(step.id))
|
|
@@ -978,6 +1212,16 @@ function stepOutline(args) {
|
|
|
978
1212
|
}
|
|
979
1213
|
//#endregion
|
|
980
1214
|
//#region editors/workflow-studio/components/WorkflowBoard.tsx
|
|
1215
|
+
function RowToggle(props) {
|
|
1216
|
+
const [, dispatch] = useDispatch(props.document);
|
|
1217
|
+
const state = props.document.state.global;
|
|
1218
|
+
return /* @__PURE__ */ jsx(StatusToggle, {
|
|
1219
|
+
tooltipSide: "left",
|
|
1220
|
+
published: Boolean(state.published),
|
|
1221
|
+
status: state.status,
|
|
1222
|
+
onChange: (status) => dispatch(actions.setWorkflowStatus({ status }))
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
981
1225
|
function summary(rows) {
|
|
982
1226
|
const count = `${rows.length} ${rows.length === 1 ? "workflow" : "workflows"}`;
|
|
983
1227
|
const failing = rows.filter((row) => row.runs[0]?.status === "FAILED").length;
|
|
@@ -1001,16 +1245,17 @@ function WorkflowBoard(props) {
|
|
|
1001
1245
|
});
|
|
1002
1246
|
const links = [...state.trigger ? [{
|
|
1003
1247
|
id: state.trigger.id,
|
|
1004
|
-
|
|
1248
|
+
block: triggerBlock(state.trigger),
|
|
1005
1249
|
label: "Trigger",
|
|
1006
1250
|
status: latest ? "SUCCEEDED" : void 0
|
|
1007
1251
|
}] : [], ...outline.rows.map((row) => ({
|
|
1008
1252
|
id: row.step.id,
|
|
1009
|
-
|
|
1253
|
+
block: stepBlock(row.step),
|
|
1010
1254
|
label: row.step.name || row.step.key,
|
|
1011
1255
|
status: statusByKey.get(row.step.key)
|
|
1012
1256
|
}))];
|
|
1013
1257
|
return {
|
|
1258
|
+
document,
|
|
1014
1259
|
id: document.header.id,
|
|
1015
1260
|
name: state.name || document.header.name || "Untitled workflow",
|
|
1016
1261
|
status: state.status,
|
|
@@ -1058,12 +1303,12 @@ function WorkflowBoard(props) {
|
|
|
1058
1303
|
children: rows.map((row) => {
|
|
1059
1304
|
const latest = row.runs.at(0);
|
|
1060
1305
|
const latestTone = toneOf(RUN_TONE, latest?.status);
|
|
1061
|
-
const health = workflowHealth(row.status, latest?.status);
|
|
1062
|
-
return /* @__PURE__ */
|
|
1063
|
-
className: "border-b border-solid border-foreground/10 last:border-b-0",
|
|
1064
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
1306
|
+
const health = workflowHealth(row.status, latest?.status, Boolean(row.document.state.global.published));
|
|
1307
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
1308
|
+
className: "flex items-center border-b border-solid border-foreground/10 last:border-b-0",
|
|
1309
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
1065
1310
|
type: "button",
|
|
1066
|
-
className: "grid w-
|
|
1311
|
+
className: "grid min-w-0 flex-1 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-6 gap-y-3 px-5 py-4 text-left transition-colors hover:bg-accent/50 focus-visible:bg-accent/50 focus-visible:outline-none md:grid-cols-[minmax(0,1.2fr)_minmax(0,1fr)_minmax(0,0.8fr)_auto]",
|
|
1067
1312
|
onClick: () => props.onOpen(row.id),
|
|
1068
1313
|
children: [
|
|
1069
1314
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -1074,7 +1319,10 @@ function WorkflowBoard(props) {
|
|
|
1074
1319
|
/* @__PURE__ */ jsx("span", {
|
|
1075
1320
|
title: health.label,
|
|
1076
1321
|
className: "flex",
|
|
1077
|
-
children: /* @__PURE__ */ jsx(StatusDot, {
|
|
1322
|
+
children: /* @__PURE__ */ jsx(StatusDot, {
|
|
1323
|
+
tone: health.tone,
|
|
1324
|
+
hollow: health.hollow
|
|
1325
|
+
})
|
|
1078
1326
|
}),
|
|
1079
1327
|
/* @__PURE__ */ jsx("span", {
|
|
1080
1328
|
className: "truncate text-[15px] font-semibold text-foreground",
|
|
@@ -1110,7 +1358,10 @@ function WorkflowBoard(props) {
|
|
|
1110
1358
|
}),
|
|
1111
1359
|
/* @__PURE__ */ jsx(RunStrip, { runs: row.runs })
|
|
1112
1360
|
]
|
|
1113
|
-
})
|
|
1361
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
1362
|
+
className: "flex shrink-0 items-center gap-1 pr-3",
|
|
1363
|
+
children: [/* @__PURE__ */ jsx(RowToggle, { document: row.document }), /* @__PURE__ */ jsx(WorkflowMenu, { document: row.document })]
|
|
1364
|
+
})]
|
|
1114
1365
|
}, row.id);
|
|
1115
1366
|
})
|
|
1116
1367
|
})]
|
|
@@ -1158,7 +1409,7 @@ function TrackStop(props) {
|
|
|
1158
1409
|
onClick: props.onClick,
|
|
1159
1410
|
children: /* @__PURE__ */ jsx(BlockLogo, {
|
|
1160
1411
|
bare: true,
|
|
1161
|
-
|
|
1412
|
+
block: stop.block,
|
|
1162
1413
|
size: 20
|
|
1163
1414
|
})
|
|
1164
1415
|
}),
|
|
@@ -1198,12 +1449,13 @@ function WorkflowSteps(props) {
|
|
|
1198
1449
|
});
|
|
1199
1450
|
const statusByKey = new Map((props.latestRun?.steps ?? []).map((step) => [step.stepKey, step.status]));
|
|
1200
1451
|
const stopFor = (step, port) => {
|
|
1201
|
-
const
|
|
1452
|
+
const block = stepBlock(step);
|
|
1453
|
+
const meta = blockMeta(block);
|
|
1202
1454
|
return {
|
|
1203
1455
|
id: step.id,
|
|
1204
1456
|
title: step.name || step.key,
|
|
1205
1457
|
subtitle: meta.displayName,
|
|
1206
|
-
|
|
1458
|
+
block,
|
|
1207
1459
|
status: statusByKey.get(step.key),
|
|
1208
1460
|
port
|
|
1209
1461
|
};
|
|
@@ -1226,12 +1478,13 @@ function WorkflowSteps(props) {
|
|
|
1226
1478
|
]
|
|
1227
1479
|
})
|
|
1228
1480
|
});
|
|
1229
|
-
const
|
|
1230
|
-
const
|
|
1481
|
+
const trigger = state.trigger ? triggerBlock(state.trigger) : null;
|
|
1482
|
+
const triggerMeta = trigger ? blockMeta(trigger) : null;
|
|
1483
|
+
const stops = [...state.trigger && trigger && triggerMeta ? [{
|
|
1231
1484
|
id: state.trigger.id,
|
|
1232
1485
|
title: triggerMeta.displayName,
|
|
1233
1486
|
subtitle: "Trigger",
|
|
1234
|
-
|
|
1487
|
+
block: trigger,
|
|
1235
1488
|
status: props.latestRun ? "SUCCEEDED" : void 0
|
|
1236
1489
|
}] : [], ...outline.rows.map((row) => stopFor(row.step, row.port))];
|
|
1237
1490
|
return /* @__PURE__ */ jsxs("section", {
|
|
@@ -1291,11 +1544,10 @@ function WorkflowHeader(props) {
|
|
|
1291
1544
|
}
|
|
1292
1545
|
});
|
|
1293
1546
|
if (document?.header.documentType !== WORKFLOW_TYPE$1) return null;
|
|
1294
|
-
const
|
|
1295
|
-
const
|
|
1547
|
+
const workflow = document;
|
|
1548
|
+
const state = workflow.state.global;
|
|
1296
1549
|
const stats = runStats(props.runs ?? []);
|
|
1297
1550
|
const lastTone = toneOf(RUN_TONE, stats.lastRun?.status);
|
|
1298
|
-
const statusTone = toneOf(WORKFLOW_TONE, state.status);
|
|
1299
1551
|
return /* @__PURE__ */ jsxs("header", {
|
|
1300
1552
|
className: "mb-8",
|
|
1301
1553
|
children: [
|
|
@@ -1305,13 +1557,17 @@ function WorkflowHeader(props) {
|
|
|
1305
1557
|
className: "min-w-0 grow",
|
|
1306
1558
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1307
1559
|
className: "flex items-center gap-2.5",
|
|
1308
|
-
children: [
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1560
|
+
children: [
|
|
1561
|
+
/* @__PURE__ */ jsx("h2", {
|
|
1562
|
+
className: "min-w-0 truncate text-xl font-semibold tracking-tight text-foreground",
|
|
1563
|
+
children: state.name || props.node.name || "Untitled workflow"
|
|
1564
|
+
}),
|
|
1565
|
+
/* @__PURE__ */ jsx(PublishState, { model: state }),
|
|
1566
|
+
state.status === "ARCHIVED" ? /* @__PURE__ */ jsx("span", {
|
|
1567
|
+
className: "rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",
|
|
1568
|
+
children: "Archived"
|
|
1569
|
+
}) : null
|
|
1570
|
+
]
|
|
1315
1571
|
}), state.description ? /* @__PURE__ */ jsx("p", {
|
|
1316
1572
|
className: "mt-1 max-w-prose text-[13px] text-muted-foreground",
|
|
1317
1573
|
children: state.description
|
|
@@ -1319,19 +1575,20 @@ function WorkflowHeader(props) {
|
|
|
1319
1575
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1320
1576
|
className: "flex items-center gap-2",
|
|
1321
1577
|
children: [
|
|
1322
|
-
/* @__PURE__ */ jsx(
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
}),
|
|
1327
|
-
/* @__PURE__ */ jsx(Button, {
|
|
1328
|
-
onClick: () => dispatch(actions.setWorkflowStatus({ status: enabled ? "DISABLED" : "ENABLED" })),
|
|
1329
|
-
children: enabled ? "Disable" : "Enable"
|
|
1578
|
+
/* @__PURE__ */ jsx(StatusToggle, {
|
|
1579
|
+
published: Boolean(state.published),
|
|
1580
|
+
status: state.status,
|
|
1581
|
+
onChange: (status) => dispatch(actions.setWorkflowStatus({ status }))
|
|
1330
1582
|
}),
|
|
1331
1583
|
/* @__PURE__ */ jsx(Button, {
|
|
1332
1584
|
variant: "primary",
|
|
1333
1585
|
onClick: props.onEdit,
|
|
1334
1586
|
children: "Edit workflow"
|
|
1587
|
+
}),
|
|
1588
|
+
/* @__PURE__ */ jsx(WorkflowMenu, {
|
|
1589
|
+
document: workflow,
|
|
1590
|
+
nodeName: props.node.name,
|
|
1591
|
+
onDeleted: props.onDeleted
|
|
1335
1592
|
})
|
|
1336
1593
|
]
|
|
1337
1594
|
})]
|
|
@@ -1390,6 +1647,10 @@ function WorkflowHeader(props) {
|
|
|
1390
1647
|
const WORKFLOW_TYPE = "powerhouse/workflow";
|
|
1391
1648
|
const CONNECTION_TYPE = "powerhouse/connection";
|
|
1392
1649
|
function WorkflowStudio(props) {
|
|
1650
|
+
return /* @__PURE__ */ jsx(WorkflowRuntimeProvider, { children: /* @__PURE__ */ jsx(Studio, { children: props.children }) });
|
|
1651
|
+
}
|
|
1652
|
+
function Studio(props) {
|
|
1653
|
+
const { fireWorkflow } = useRuntimeActions();
|
|
1393
1654
|
const [drive] = useSelectedDrive();
|
|
1394
1655
|
const fileNodes = useFileNodesInSelectedDrive() ?? [];
|
|
1395
1656
|
const selectedNode = useSelectedNode();
|
|
@@ -1438,11 +1699,13 @@ function WorkflowStudio(props) {
|
|
|
1438
1699
|
const focusedWorkflow = liveTarget;
|
|
1439
1700
|
const driveFeed = useRuns({ driveId });
|
|
1440
1701
|
const workflowFeed = useRuns({ workflowId: focusedWorkflow?.id }, Boolean(focusedWorkflow));
|
|
1441
|
-
const
|
|
1702
|
+
const feed = focusedWorkflow ? workflowFeed : driveFeed;
|
|
1703
|
+
const { runs, error: runsError, reload: reloadRuns } = feed;
|
|
1442
1704
|
const lastRuns = /* @__PURE__ */ new Map();
|
|
1443
1705
|
for (const run of driveFeed.runs ?? []) if (!lastRuns.has(run.workflowId)) lastRuns.set(run.workflowId, run.status);
|
|
1444
1706
|
const { data: targetDocument } = useDocumentSafe(liveTarget?.id ?? null);
|
|
1445
|
-
const
|
|
1707
|
+
const targetTrigger = targetDocument?.header.documentType === WORKFLOW_TYPE ? targetDocument.state.global.trigger : null;
|
|
1708
|
+
const manualTrigger = Boolean(targetTrigger && sameBlock(triggerBlock(targetTrigger), MANUAL_TRIGGER));
|
|
1446
1709
|
return /* @__PURE__ */ jsxs("div", {
|
|
1447
1710
|
className: "flex h-full min-h-0",
|
|
1448
1711
|
children: [/* @__PURE__ */ jsx(Sidebar, {
|
|
@@ -1482,7 +1745,8 @@ function WorkflowStudio(props) {
|
|
|
1482
1745
|
children: [liveTarget ? /* @__PURE__ */ jsx(WorkflowHeader, {
|
|
1483
1746
|
node: liveTarget,
|
|
1484
1747
|
runs,
|
|
1485
|
-
onEdit: () => setSelectedNode(liveTarget.id)
|
|
1748
|
+
onEdit: () => setSelectedNode(liveTarget.id),
|
|
1749
|
+
onDeleted: () => select(void 0)
|
|
1486
1750
|
}, liveTarget.id) : /* @__PURE__ */ jsx(WorkflowBoard, {
|
|
1487
1751
|
runs,
|
|
1488
1752
|
creating,
|
|
@@ -1494,6 +1758,9 @@ function WorkflowStudio(props) {
|
|
|
1494
1758
|
error: runsError,
|
|
1495
1759
|
reload: reloadRuns,
|
|
1496
1760
|
showWorkflow: liveTarget === null,
|
|
1761
|
+
hasMore: feed.hasMore,
|
|
1762
|
+
loadingMore: feed.loadingMore,
|
|
1763
|
+
onLoadMore: feed.loadMore,
|
|
1497
1764
|
onFire: liveTarget && manualTrigger ? () => fireWorkflow(liveTarget.id).then((result) => result.error) : void 0
|
|
1498
1765
|
})]
|
|
1499
1766
|
})
|
|
@@ -1515,7 +1782,6 @@ const editorConfig = {
|
|
|
1515
1782
|
/** Editor component for the app */
|
|
1516
1783
|
function Editor(props) {
|
|
1517
1784
|
useSetPHAppConfig(editorConfig);
|
|
1518
|
-
useSyncWorkflowRuntimeUrl();
|
|
1519
1785
|
return /* @__PURE__ */ jsx("div", {
|
|
1520
1786
|
className: "h-full min-h-0 bg-background",
|
|
1521
1787
|
children: /* @__PURE__ */ jsx(WorkflowStudio, { children: props.children })
|
|
@@ -1524,4 +1790,4 @@ function Editor(props) {
|
|
|
1524
1790
|
//#endregion
|
|
1525
1791
|
export { Editor as default };
|
|
1526
1792
|
|
|
1527
|
-
//# sourceMappingURL=editor-
|
|
1793
|
+
//# sourceMappingURL=editor-CR823u-y.mjs.map
|