@powerhousedao/workflow 6.2.3-dev.100
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/LICENSE +661 -0
- package/README.md +143 -0
- package/dist/browser/BlockSelector-CEdYUqjx.js +3371 -0
- package/dist/browser/BlockSelector-CEdYUqjx.js.map +1 -0
- package/dist/browser/PieceMarkdown-DSdZd-Jc.js +92 -0
- package/dist/browser/PieceMarkdown-DSdZd-Jc.js.map +1 -0
- package/dist/browser/connection-form-Biksq2jW.js +1524 -0
- package/dist/browser/connection-form-Biksq2jW.js.map +1 -0
- package/dist/browser/connection-ilYFCRUK.js +90 -0
- package/dist/browser/connection-ilYFCRUK.js.map +1 -0
- package/dist/browser/data-tree-Cq-s6bJp.js +76 -0
- package/dist/browser/data-tree-Cq-s6bJp.js.map +1 -0
- package/dist/browser/document-models/connection/index.js +3 -0
- package/dist/browser/document-models/index.js +4 -0
- package/dist/browser/document-models/workflow/index.js +3 -0
- package/dist/browser/document-models-C2SAP1SX.js +164 -0
- package/dist/browser/document-models-C2SAP1SX.js.map +1 -0
- package/dist/browser/editor-CIqKi7XK.js +3219 -0
- package/dist/browser/editor-CIqKi7XK.js.map +1 -0
- package/dist/browser/editor-DYjoPfta.js +4669 -0
- package/dist/browser/editor-DYjoPfta.js.map +1 -0
- package/dist/browser/editor-GeRXGdie.js +373 -0
- package/dist/browser/editor-GeRXGdie.js.map +1 -0
- package/dist/browser/editors/connection-editor/module.js +15 -0
- package/dist/browser/editors/connection-editor/module.js.map +1 -0
- package/dist/browser/editors/index.js +4 -0
- package/dist/browser/editors/runtime/index.js +2 -0
- package/dist/browser/editors/workflow-editor/module.js +15 -0
- package/dist/browser/editors/workflow-editor/module.js.map +1 -0
- package/dist/browser/editors/workflow-studio/module.js +15 -0
- package/dist/browser/editors/workflow-studio/module.js.map +1 -0
- package/dist/browser/index.js +463 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/module-DJz6oTX0.js +690 -0
- package/dist/browser/module-DJz6oTX0.js.map +1 -0
- package/dist/browser/module-mFCt9WHJ.js +1799 -0
- package/dist/browser/module-mFCt9WHJ.js.map +1 -0
- package/dist/browser/piece-auth-63iuNFTs.js +154 -0
- package/dist/browser/piece-auth-63iuNFTs.js.map +1 -0
- package/dist/browser/reactor/index.js +8 -0
- package/dist/browser/reactor/index.js.map +1 -0
- package/dist/browser/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/browser/runtime-queries-FmEzElOY.js +993 -0
- package/dist/browser/runtime-queries-FmEzElOY.js.map +1 -0
- package/dist/browser/style.css +667 -0
- package/dist/browser/trigger-text-DH6HIeoa.js +3210 -0
- package/dist/browser/trigger-text-DH6HIeoa.js.map +1 -0
- package/dist/browser/upgrade-manifests-C2Qa6myy.js +8 -0
- package/dist/browser/upgrade-manifests-C2Qa6myy.js.map +1 -0
- package/dist/browser/workflow-2gR2JXUS.js +109 -0
- package/dist/browser/workflow-2gR2JXUS.js.map +1 -0
- package/dist/node/document-models/connection/index.mjs +67 -0
- package/dist/node/document-models/connection/index.mjs.map +1 -0
- package/dist/node/document-models/index.mjs +4 -0
- package/dist/node/document-models/workflow/index.mjs +86 -0
- package/dist/node/document-models/workflow/index.mjs.map +1 -0
- package/dist/node/editors/index.mjs +6 -0
- package/dist/node/editors/index.mjs.map +1 -0
- package/dist/node/index.mjs +174 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/module-BXKUB58R.mjs +1804 -0
- package/dist/node/module-BXKUB58R.mjs.map +1 -0
- package/dist/node/module-CaBtkQmd.mjs +690 -0
- package/dist/node/module-CaBtkQmd.mjs.map +1 -0
- package/dist/node/pieces/ai/descriptor.json +857 -0
- package/dist/node/pieces/ai/index.mjs +624 -0
- package/dist/node/pieces/ai/package.json +9 -0
- package/dist/node/pieces/index.mjs +12 -0
- package/dist/node/pieces/index.mjs.map +1 -0
- package/dist/node/pieces/reactor/descriptor.json +648 -0
- package/dist/node/pieces/reactor/index.mjs +59 -0
- package/dist/node/pieces/reactor/package.json +9 -0
- package/dist/node/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/node/upgrade-manifests-BCCpSD1J.mjs +8 -0
- package/dist/node/upgrade-manifests-BCCpSD1J.mjs.map +1 -0
- package/dist/powerhouse.manifest.json +175 -0
- package/dist/style.css +670 -0
- package/dist/types/ai/runtime.d.ts +13 -0
- package/dist/types/ai/runtime.d.ts.map +1 -0
- package/dist/types/ai/tools.d.ts +65 -0
- package/dist/types/ai/tools.d.ts.map +1 -0
- package/dist/types/ai/tools.test.d.ts +2 -0
- package/dist/types/ai/tools.test.d.ts.map +1 -0
- package/dist/types/ai/workflow-tools.d.ts +9 -0
- package/dist/types/ai/workflow-tools.d.ts.map +1 -0
- package/dist/types/ai/workflow-tools.live.test.d.ts +2 -0
- package/dist/types/ai/workflow-tools.live.test.d.ts.map +1 -0
- package/dist/types/ai/workflow-tools.test.d.ts +2 -0
- package/dist/types/ai/workflow-tools.test.d.ts.map +1 -0
- package/dist/types/build.d.ts +2 -0
- package/dist/types/build.d.ts.map +1 -0
- package/dist/types/document-models/connection/index.d.ts +3 -0
- package/dist/types/document-models/connection/index.d.ts.map +1 -0
- package/dist/types/document-models/connection/upgrades/index.d.ts +3 -0
- package/dist/types/document-models/connection/upgrades/index.d.ts.map +1 -0
- package/dist/types/document-models/connection/upgrades/upgrade-manifest.d.ts +8 -0
- package/dist/types/document-models/connection/upgrades/upgrade-manifest.d.ts.map +1 -0
- package/dist/types/document-models/connection/upgrades/versions.d.ts +3 -0
- package/dist/types/document-models/connection/upgrades/versions.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/actions.d.ts +19 -0
- package/dist/types/document-models/connection/v1/actions.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/actions.d.ts +12 -0
- package/dist/types/document-models/connection/v1/gen/actions.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/config/actions.d.ts +28 -0
- package/dist/types/document-models/connection/v1/gen/config/actions.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/config/creators.d.ts +8 -0
- package/dist/types/document-models/connection/v1/gen/config/creators.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/config/error.d.ts +42 -0
- package/dist/types/document-models/connection/v1/gen/config/error.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/config/operations.d.ts +15 -0
- package/dist/types/document-models/connection/v1/gen/config/operations.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/connection/actions.d.ts +20 -0
- package/dist/types/document-models/connection/v1/gen/connection/actions.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/connection/creators.d.ts +6 -0
- package/dist/types/document-models/connection/v1/gen/connection/creators.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/connection/error.d.ts +14 -0
- package/dist/types/document-models/connection/v1/gen/connection/error.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/connection/operations.d.ts +13 -0
- package/dist/types/document-models/connection/v1/gen/connection/operations.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/controller.d.ts +8 -0
- package/dist/types/document-models/connection/v1/gen/controller.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/creators.d.ts +11 -0
- package/dist/types/document-models/connection/v1/gen/creators.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/document-model.d.ts +3 -0
- package/dist/types/document-models/connection/v1/gen/document-model.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/document-schema.d.ts +68 -0
- package/dist/types/document-models/connection/v1/gen/document-schema.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/document-type.d.ts +6 -0
- package/dist/types/document-models/connection/v1/gen/document-type.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/health/actions.d.ts +12 -0
- package/dist/types/document-models/connection/v1/gen/health/actions.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/health/creators.d.ts +4 -0
- package/dist/types/document-models/connection/v1/gen/health/creators.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/health/error.d.ts +2 -0
- package/dist/types/document-models/connection/v1/gen/health/error.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/health/operations.d.ts +11 -0
- package/dist/types/document-models/connection/v1/gen/health/operations.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/index.d.ts +19 -0
- package/dist/types/document-models/connection/v1/gen/index.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/ph-factories.d.ts +25 -0
- package/dist/types/document-models/connection/v1/gen/ph-factories.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/reducer.d.ts +4 -0
- package/dist/types/document-models/connection/v1/gen/reducer.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/schema/index.d.ts +7 -0
- package/dist/types/document-models/connection/v1/gen/schema/index.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/schema/types.d.ts +216 -0
- package/dist/types/document-models/connection/v1/gen/schema/types.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts +37 -0
- package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/types.d.ts +16 -0
- package/dist/types/document-models/connection/v1/gen/types.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/gen/utils.d.ts +10 -0
- package/dist/types/document-models/connection/v1/gen/utils.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/hooks.d.ts +18 -0
- package/dist/types/document-models/connection/v1/hooks.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/index.d.ts +11 -0
- package/dist/types/document-models/connection/v1/index.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/module.d.ts +26 -0
- package/dist/types/document-models/connection/v1/module.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/src/index.d.ts +6 -0
- package/dist/types/document-models/connection/v1/src/index.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/src/reactor-connection.d.ts +17 -0
- package/dist/types/document-models/connection/v1/src/reactor-connection.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/src/reducers/config.d.ts +3 -0
- package/dist/types/document-models/connection/v1/src/reducers/config.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/src/reducers/connection.d.ts +3 -0
- package/dist/types/document-models/connection/v1/src/reducers/connection.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/src/reducers/health.d.ts +3 -0
- package/dist/types/document-models/connection/v1/src/reducers/health.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/src/utils.d.ts +2 -0
- package/dist/types/document-models/connection/v1/src/utils.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/tests/config-values.test.d.ts +2 -0
- package/dist/types/document-models/connection/v1/tests/config-values.test.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/tests/connection-scenarios.test.d.ts +2 -0
- package/dist/types/document-models/connection/v1/tests/connection-scenarios.test.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/tests/document-model.test.d.ts +2 -0
- package/dist/types/document-models/connection/v1/tests/document-model.test.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/tests/reactor-connection.test.d.ts +2 -0
- package/dist/types/document-models/connection/v1/tests/reactor-connection.test.d.ts.map +1 -0
- package/dist/types/document-models/connection/v1/utils.d.ts +9 -0
- package/dist/types/document-models/connection/v1/utils.d.ts.map +1 -0
- package/dist/types/document-models/document-models.d.ts +63 -0
- package/dist/types/document-models/document-models.d.ts.map +1 -0
- package/dist/types/document-models/index.d.ts +4 -0
- package/dist/types/document-models/index.d.ts.map +1 -0
- package/dist/types/document-models/upgrade-manifests.d.ts +7 -0
- package/dist/types/document-models/upgrade-manifests.d.ts.map +1 -0
- package/dist/types/document-models/workflow/index.d.ts +3 -0
- package/dist/types/document-models/workflow/index.d.ts.map +1 -0
- package/dist/types/document-models/workflow/upgrades/index.d.ts +3 -0
- package/dist/types/document-models/workflow/upgrades/index.d.ts.map +1 -0
- package/dist/types/document-models/workflow/upgrades/upgrade-manifest.d.ts +8 -0
- package/dist/types/document-models/workflow/upgrades/upgrade-manifest.d.ts.map +1 -0
- package/dist/types/document-models/workflow/upgrades/versions.d.ts +3 -0
- package/dist/types/document-models/workflow/upgrades/versions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/actions.d.ts +32 -0
- package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/actions.d.ts +22 -0
- package/dist/types/document-models/workflow/v1/gen/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/controller.d.ts +8 -0
- package/dist/types/document-models/workflow/v1/gen/controller.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/creators.d.ts +21 -0
- package/dist/types/document-models/workflow/v1/gen/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/document-model.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/gen/document-model.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts +80 -0
- package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/document-type.d.ts +6 -0
- package/dist/types/document-models/workflow/v1/gen/document-type.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/edges/actions.d.ts +16 -0
- package/dist/types/document-models/workflow/v1/gen/edges/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/edges/creators.d.ts +5 -0
- package/dist/types/document-models/workflow/v1/gen/edges/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/edges/error.d.ts +36 -0
- package/dist/types/document-models/workflow/v1/gen/edges/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/edges/operations.d.ts +12 -0
- package/dist/types/document-models/workflow/v1/gen/edges/operations.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/index.d.ts +24 -0
- package/dist/types/document-models/workflow/v1/gen/index.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/ph-factories.d.ts +25 -0
- package/dist/types/document-models/workflow/v1/gen/ph-factories.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/policy/actions.d.ts +12 -0
- package/dist/types/document-models/workflow/v1/gen/policy/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/policy/creators.d.ts +4 -0
- package/dist/types/document-models/workflow/v1/gen/policy/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/policy/error.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/gen/policy/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/policy/operations.d.ts +11 -0
- package/dist/types/document-models/workflow/v1/gen/policy/operations.d.ts.map +1 -0
- 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 +4 -0
- package/dist/types/document-models/workflow/v1/gen/reducer.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts +16 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts +5 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts +14 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts +12 -0
- package/dist/types/document-models/workflow/v1/gen/runtime/operations.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/schema/index.d.ts +7 -0
- package/dist/types/document-models/workflow/v1/gen/schema/index.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +488 -0
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts +93 -0
- package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/steps/actions.d.ts +24 -0
- package/dist/types/document-models/workflow/v1/gen/steps/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/steps/creators.d.ts +7 -0
- package/dist/types/document-models/workflow/v1/gen/steps/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts +70 -0
- package/dist/types/document-models/workflow/v1/gen/steps/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/steps/operations.d.ts +14 -0
- package/dist/types/document-models/workflow/v1/gen/steps/operations.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/actions.d.ts +28 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/creators.d.ts +8 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts +57 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/operations.d.ts +15 -0
- package/dist/types/document-models/workflow/v1/gen/trigger/operations.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/types.d.ts +16 -0
- package/dist/types/document-models/workflow/v1/gen/types.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/utils.d.ts +10 -0
- package/dist/types/document-models/workflow/v1/gen/utils.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/variables/actions.d.ts +16 -0
- package/dist/types/document-models/workflow/v1/gen/variables/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/variables/creators.d.ts +5 -0
- package/dist/types/document-models/workflow/v1/gen/variables/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts +26 -0
- package/dist/types/document-models/workflow/v1/gen/variables/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/variables/operations.d.ts +12 -0
- package/dist/types/document-models/workflow/v1/gen/variables/operations.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/actions.d.ts +24 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/actions.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/creators.d.ts +7 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/creators.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts +14 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/error.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/operations.d.ts +14 -0
- package/dist/types/document-models/workflow/v1/gen/workflow/operations.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/hooks.d.ts +18 -0
- package/dist/types/document-models/workflow/v1/hooks.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/index.d.ts +11 -0
- package/dist/types/document-models/workflow/v1/index.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/module.d.ts +39 -0
- package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -0
- 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/index.d.ts +6 -0
- package/dist/types/document-models/workflow/v1/src/index.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/edges.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/edges.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/policy.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/policy.d.ts.map +1 -0
- 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 +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/runtime.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/steps.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/steps.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/variables.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/variables.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/reducers/workflow.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/src/reducers/workflow.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/src/utils.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/src/utils.d.ts.map +1 -0
- 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/document-model.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/document-model.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/managed-by.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/managed-by.test.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/tests/reactor-connection.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/reactor-connection.test.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/tests/trigger-fields.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/trigger-fields.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/document-models/workflow/v1/tests/workflow-scenarios.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/workflow-scenarios.test.d.ts.map +1 -0
- package/dist/types/document-models/workflow/v1/utils.d.ts +9 -0
- package/dist/types/document-models/workflow/v1/utils.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts +10 -0
- package/dist/types/editors/connection-editor/ConnectionToolbar.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/ReactorBindings.d.ts +6 -0
- package/dist/types/editors/connection-editor/ReactorBindings.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/ReactorConnectionSettings.d.ts +7 -0
- package/dist/types/editors/connection-editor/ReactorConnectionSettings.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/UsedBy.d.ts +6 -0
- package/dist/types/editors/connection-editor/UsedBy.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/connection-callbacks.d.ts +5 -0
- package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/connection-callbacks.test.d.ts +2 -0
- package/dist/types/editors/connection-editor/connection-callbacks.test.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/connection-form.d.ts +23 -0
- package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/connection-usage.d.ts +35 -0
- package/dist/types/editors/connection-editor/connection-usage.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/connection-usage.test.d.ts +2 -0
- package/dist/types/editors/connection-editor/connection-usage.test.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/editor.d.ts +4 -0
- package/dist/types/editors/connection-editor/editor.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/module.d.ts +9 -0
- package/dist/types/editors/connection-editor/module.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/piece-auth.d.ts +39 -0
- package/dist/types/editors/connection-editor/piece-auth.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/piece-auth.test.d.ts +2 -0
- package/dist/types/editors/connection-editor/piece-auth.test.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/status.d.ts +6 -0
- package/dist/types/editors/connection-editor/status.d.ts.map +1 -0
- package/dist/types/editors/editors.d.ts +7 -0
- package/dist/types/editors/editors.d.ts.map +1 -0
- package/dist/types/editors/index.d.ts +4 -0
- package/dist/types/editors/index.d.ts.map +1 -0
- package/dist/types/editors/runtime/index.d.ts +21 -0
- package/dist/types/editors/runtime/index.d.ts.map +1 -0
- package/dist/types/editors/runtime/runtime-export.test.d.ts +2 -0
- package/dist/types/editors/runtime/runtime-export.test.d.ts.map +1 -0
- package/dist/types/editors/shared/DocumentErrorBoundary.d.ts +35 -0
- package/dist/types/editors/shared/DocumentErrorBoundary.d.ts.map +1 -0
- package/dist/types/editors/shared/controls.d.ts +123 -0
- package/dist/types/editors/shared/controls.d.ts.map +1 -0
- package/dist/types/editors/shared/data-tree.d.ts +5 -0
- package/dist/types/editors/shared/data-tree.d.ts.map +1 -0
- package/dist/types/editors/shared/data-viewer.d.ts +7 -0
- package/dist/types/editors/shared/data-viewer.d.ts.map +1 -0
- package/dist/types/editors/shared/document-ref.d.ts +5 -0
- package/dist/types/editors/shared/document-ref.d.ts.map +1 -0
- package/dist/types/editors/shared/editor-chrome.d.ts +14 -0
- package/dist/types/editors/shared/editor-chrome.d.ts.map +1 -0
- package/dist/types/editors/shared/editor-chrome.test.d.ts +2 -0
- package/dist/types/editors/shared/editor-chrome.test.d.ts.map +1 -0
- package/dist/types/editors/shared/icons.d.ts +45 -0
- package/dist/types/editors/shared/icons.d.ts.map +1 -0
- package/dist/types/editors/shared/pending-echo.d.ts +9 -0
- package/dist/types/editors/shared/pending-echo.d.ts.map +1 -0
- package/dist/types/editors/shared/undo-plan.d.ts +27 -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/shared/url-param.d.ts +14 -0
- package/dist/types/editors/shared/url-param.d.ts.map +1 -0
- package/dist/types/editors/shared/url-param.test.d.ts +2 -0
- package/dist/types/editors/shared/url-param.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts +6 -0
- package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/editor.d.ts +6 -0
- package/dist/types/editors/workflow-editor/editor.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/module.d.ts +9 -0
- package/dist/types/editors/workflow-editor/module.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/reactor-hooks.d.ts +25 -0
- package/dist/types/editors/workflow-editor/reactor-hooks.d.ts.map +1 -0
- 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 +16 -0
- package/dist/types/editors/workflow-editor/runtime-api.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-client.d.ts +347 -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 +54 -0
- package/dist/types/editors/workflow-editor/runtime-context.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/runtime-contract.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/runtime-contract.test.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 +148 -0
- package/dist/types/editors/workflow-editor/runtime-queries.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts +40 -0
- package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts +15 -0
- package/dist/types/editors/workflow-editor/ui/CanvasContextMenu.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts +7 -0
- package/dist/types/editors/workflow-editor/ui/ConnectionField.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ConnectionName.d.ts +8 -0
- package/dist/types/editors/workflow-editor/ui/ConnectionName.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts +7 -0
- package/dist/types/editors/workflow-editor/ui/CreateConnectionModal.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts +51 -0
- package/dist/types/editors/workflow-editor/ui/ExpressionPicker.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/PanelResizer.d.ts +12 -0
- package/dist/types/editors/workflow-editor/ui/PanelResizer.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/PickerPopover.d.ts +12 -0
- package/dist/types/editors/workflow-editor/ui/PickerPopover.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/PieceMarkdown.d.ts +5 -0
- package/dist/types/editors/workflow-editor/ui/PieceMarkdown.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts +37 -0
- package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts +51 -0
- package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ReactorConnectionField.d.ts +9 -0
- package/dist/types/editors/workflow-editor/ui/ReactorConnectionField.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts +5 -0
- package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/SignInPrompt.d.ts +6 -0
- package/dist/types/editors/workflow-editor/ui/SignInPrompt.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/StepError.d.ts +4 -0
- package/dist/types/editors/workflow-editor/ui/StepError.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts +17 -0
- package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -0
- 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/SwitchboardGrants.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/SwitchboardGrants.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts +7 -0
- package/dist/types/editors/workflow-editor/ui/VariablesEditor.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/VirtualList.d.ts +14 -0
- package/dist/types/editors/workflow-editor/ui/VirtualList.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts +9 -0
- package/dist/types/editors/workflow-editor/ui/WorkflowCanvas.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts +9 -0
- package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts.map +1 -0
- 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 +9 -0
- package/dist/types/editors/workflow-editor/ui/ap-edge.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts +20 -0
- package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ap-layout.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/ap-layout.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts +41 -0
- package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/block-meta.d.ts +31 -0
- package/dist/types/editors/workflow-editor/ui/block-meta.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/block-meta.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/block-meta.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/block-picker-layout.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/block-picker-layout.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/block-selector-chips.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/block-selector-chips.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/blocks.d.ts +65 -0
- package/dist/types/editors/workflow-editor/ui/blocks.d.ts.map +1 -0
- 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 +35 -0
- package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/canvas-menu.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/canvas-menu.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/connection-create.d.ts +18 -0
- package/dist/types/editors/workflow-editor/ui/connection-create.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/connection-create.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/connection-create.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/design-time.d.ts +93 -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/document-options.d.ts +24 -0
- package/dist/types/editors/workflow-editor/ui/document-options.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/document-options.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/document-options.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.d.ts +8 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/document-shape.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts +39 -0
- package/dist/types/editors/workflow-editor/ui/expression-scope.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/expression-scope.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/expression-scope.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/expression-tokens.d.ts +18 -0
- package/dist/types/editors/workflow-editor/ui/expression-tokens.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/expression-tokens.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/expression-tokens.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/flow-control.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/flow-control.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/forms.d.ts +160 -0
- package/dist/types/editors/workflow-editor/ui/forms.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/item-summary.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/item-summary.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/manual-inputs.d.ts +7 -0
- package/dist/types/editors/workflow-editor/ui/manual-inputs.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/manual-inputs.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/manual-inputs.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/model.d.ts +187 -0
- package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/model.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/model.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/picker-placement.d.ts +19 -0
- package/dist/types/editors/workflow-editor/ui/picker-placement.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/picker-recent.d.ts +4 -0
- package/dist/types/editors/workflow-editor/ui/picker-recent.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/piece-placeholders.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/piece-placeholders.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/piece-source.d.ts +82 -0
- package/dist/types/editors/workflow-editor/ui/piece-source.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts +66 -0
- package/dist/types/editors/workflow-editor/ui/prop-controls.d.ts.map +1 -0
- 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/prop-layout.d.ts +13 -0
- package/dist/types/editors/workflow-editor/ui/prop-layout.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/prop-layout.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/prop-layout.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/query-keys.d.ts +66 -0
- package/dist/types/editors/workflow-editor/ui/query-keys.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-access.d.ts +43 -0
- package/dist/types/editors/workflow-editor/ui/reactor-access.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-access.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-access.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-connection-create.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.d.ts +25 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/reactor-view.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/retry-policy.d.ts +8 -0
- package/dist/types/editors/workflow-editor/ui/retry-policy.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/retry-policy.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/retry-policy.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts +30 -0
- package/dist/types/editors/workflow-editor/ui/schedule-draft.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/schedule-draft.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/schedule-draft.test.d.ts.map +1 -0
- 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-drag.d.ts +13 -0
- package/dist/types/editors/workflow-editor/ui/step-drag.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/step-drag.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/step-drag.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/step-test.d.ts +16 -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-strategy.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/trigger-strategy.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts +12 -0
- package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/trigger-text.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/trigger-text.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/use-selected-block.d.ts +4 -0
- package/dist/types/editors/workflow-editor/ui/use-selected-block.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/use-selected-block.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/use-selected-block.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/use-validity.d.ts +29 -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 +43 -0
- package/dist/types/editors/workflow-editor/ui/validation.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/validation.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/validation.test.d.ts.map +1 -0
- 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/undo-policy.d.ts +3 -0
- package/dist/types/editors/workflow-editor/undo-policy.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/undo-policy.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/undo-policy.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/use-workflow-runtime.d.ts +13 -0
- package/dist/types/editors/workflow-editor/use-workflow-runtime.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/use-workflow-runtime.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/use-workflow-runtime.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/RunDialog.d.ts +7 -0
- package/dist/types/editors/workflow-studio/components/RunDialog.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/RunsTable.d.ts +19 -0
- package/dist/types/editors/workflow-studio/components/RunsTable.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/RunsTable.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/RunsTable.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/RunsView.d.ts +15 -0
- package/dist/types/editors/workflow-studio/components/RunsView.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/ScrollFade.d.ts +7 -0
- package/dist/types/editors/workflow-studio/components/ScrollFade.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/Sidebar.d.ts +20 -0
- package/dist/types/editors/workflow-studio/components/Sidebar.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/Waitpoints.d.ts +57 -0
- package/dist/types/editors/workflow-studio/components/Waitpoints.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts +12 -0
- package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/WorkflowGraph.d.ts +41 -0
- package/dist/types/editors/workflow-studio/components/WorkflowGraph.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts +9 -0
- package/dist/types/editors/workflow-studio/components/WorkflowHeader.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts +15 -0
- package/dist/types/editors/workflow-studio/components/WorkflowMenu.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts +8 -0
- package/dist/types/editors/workflow-studio/components/WorkflowSteps.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts +5 -0
- package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/chain.d.ts +26 -0
- package/dist/types/editors/workflow-studio/components/chain.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/fit-geometry.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/fit-geometry.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/graph-layout.d.ts +30 -0
- package/dist/types/editors/workflow-studio/components/graph-layout.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/graph-layout.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/graph-layout.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/run-dialog.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/run-dialog.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/run-format.d.ts +60 -0
- package/dist/types/editors/workflow-studio/components/run-format.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/run-format.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/run-format.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/run-timeline.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/run-timeline.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/step-outline.d.ts +27 -0
- package/dist/types/editors/workflow-studio/components/step-outline.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/step-outline.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/step-outline.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/tips.d.ts +23 -0
- package/dist/types/editors/workflow-studio/components/tips.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/ui.d.ts +22 -0
- package/dist/types/editors/workflow-studio/components/ui.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/use-collapsed.d.ts +5 -0
- package/dist/types/editors/workflow-studio/components/use-collapsed.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/use-item-selection.d.ts +10 -0
- package/dist/types/editors/workflow-studio/components/use-item-selection.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/use-item-selection.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/use-item-selection.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/useRuns.d.ts +11 -0
- package/dist/types/editors/workflow-studio/components/useRuns.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/waitpoints-view.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/waitpoints-view.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/waitpoints.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/waitpoints.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/workflow-order.d.ts +19 -0
- package/dist/types/editors/workflow-studio/components/workflow-order.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/workflow-order.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/workflow-order.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/config.d.ts +3 -0
- package/dist/types/editors/workflow-studio/config.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/editor.d.ts +4 -0
- package/dist/types/editors/workflow-studio/editor.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/module.d.ts +8 -0
- package/dist/types/editors/workflow-studio/module.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/pieces/ai/ai-actions.test.d.ts +2 -0
- package/dist/types/pieces/ai/ai-actions.test.d.ts.map +1 -0
- package/dist/types/pieces/ai/ai-documents.test.d.ts +2 -0
- package/dist/types/pieces/ai/ai-documents.test.d.ts.map +1 -0
- package/dist/types/pieces/ai/ai.test.d.ts +2 -0
- package/dist/types/pieces/ai/ai.test.d.ts.map +1 -0
- package/dist/types/pieces/ai/index.d.ts +7 -0
- package/dist/types/pieces/ai/index.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/action-schema.d.ts +11 -0
- package/dist/types/pieces/ai/lib/action-schema.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/actions/ask-ai.d.ts +38 -0
- package/dist/types/pieces/ai/lib/actions/ask-ai.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/actions/decide-on-documents.d.ts +45 -0
- package/dist/types/pieces/ai/lib/actions/decide-on-documents.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/actions/decide.d.ts +39 -0
- package/dist/types/pieces/ai/lib/actions/decide.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/actions/extract.d.ts +41 -0
- package/dist/types/pieces/ai/lib/actions/extract.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/actions/propose-actions.d.ts +55 -0
- package/dist/types/pieces/ai/lib/actions/propose-actions.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/actions/summarize.d.ts +38 -0
- package/dist/types/pieces/ai/lib/actions/summarize.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/auth.d.ts +16 -0
- package/dist/types/pieces/ai/lib/auth.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/decision-model.d.ts +17 -0
- package/dist/types/pieces/ai/lib/decision-model.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/documents.d.ts +11 -0
- package/dist/types/pieces/ai/lib/documents.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/model-list.d.ts +8 -0
- package/dist/types/pieces/ai/lib/model-list.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/models.d.ts +19 -0
- package/dist/types/pieces/ai/lib/models.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/props.d.ts +16 -0
- package/dist/types/pieces/ai/lib/props.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/providers.d.ts +9 -0
- package/dist/types/pieces/ai/lib/providers.d.ts.map +1 -0
- package/dist/types/pieces/ai/lib/questions.d.ts +7 -0
- package/dist/types/pieces/ai/lib/questions.d.ts.map +1 -0
- package/dist/types/pieces/index.d.ts +4 -0
- package/dist/types/pieces/index.d.ts.map +1 -0
- package/dist/types/pieces/reactor/index.d.ts +3 -0
- package/dist/types/pieces/reactor/index.d.ts.map +1 -0
- 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 +27 -0
- package/dist/types/pieces/reactor/lib/actions/document-create.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts +25 -0
- package/dist/types/pieces/reactor/lib/actions/document-dispatch.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-find.d.ts +13 -0
- package/dist/types/pieces/reactor/lib/actions/document-find.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-get.d.ts +8 -0
- package/dist/types/pieces/reactor/lib/actions/document-get.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts +9 -0
- package/dist/types/pieces/reactor/lib/actions/document-schema.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/actions/document-types.d.ts +4 -0
- package/dist/types/pieces/reactor/lib/actions/document-types.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/actions/index-query.d.ts +14 -0
- package/dist/types/pieces/reactor/lib/actions/index-query.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/documents.d.ts +33 -0
- package/dist/types/pieces/reactor/lib/documents.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/documents.test.d.ts +2 -0
- package/dist/types/pieces/reactor/lib/documents.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/input-props.d.ts +5 -0
- package/dist/types/pieces/reactor/lib/input-props.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/input-props.test.d.ts +2 -0
- package/dist/types/pieces/reactor/lib/input-props.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/input-schema.d.ts +31 -0
- package/dist/types/pieces/reactor/lib/input-schema.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/input-schema.test.d.ts +2 -0
- package/dist/types/pieces/reactor/lib/input-schema.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/logo.d.ts +2 -0
- package/dist/types/pieces/reactor/lib/logo.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/parse.d.ts +40 -0
- package/dist/types/pieces/reactor/lib/parse.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/parse.test.d.ts +2 -0
- package/dist/types/pieces/reactor/lib/parse.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/reactor.d.ts +55 -0
- package/dist/types/pieces/reactor/lib/reactor.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/schema-text.d.ts +7 -0
- package/dist/types/pieces/reactor/lib/schema-text.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/schema-text.test.d.ts +2 -0
- package/dist/types/pieces/reactor/lib/schema-text.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/triggers/document-event.d.ts +45 -0
- package/dist/types/pieces/reactor/lib/triggers/document-event.d.ts.map +1 -0
- package/dist/types/pieces/reactor/lib/writes.d.ts +7 -0
- package/dist/types/pieces/reactor/lib/writes.d.ts.map +1 -0
- package/dist/types/pieces/reactor/reactor.test.d.ts +2 -0
- package/dist/types/pieces/reactor/reactor.test.d.ts.map +1 -0
- package/dist/types/pieces/reactor/test-signer.d.ts +3 -0
- package/dist/types/pieces/reactor/test-signer.d.ts.map +1 -0
- package/dist/types/playwright.config.d.ts +3 -0
- package/dist/types/playwright.config.d.ts.map +1 -0
- package/dist/types/reactor/index.d.ts +5 -0
- package/dist/types/reactor/index.d.ts.map +1 -0
- package/dist/types/scripts/ui-shots.d.ts +2 -0
- package/dist/types/scripts/ui-shots.d.ts.map +1 -0
- package/dist/types/scripts/ui-stack.d.ts +217 -0
- package/dist/types/scripts/ui-stack.d.ts.map +1 -0
- package/dist/types/test/graphql-server.d.ts +9 -0
- package/dist/types/test/graphql-server.d.ts.map +1 -0
- package/dist/types/test/runtime-schema.d.ts +17 -0
- package/dist/types/test/runtime-schema.d.ts.map +1 -0
- package/dist/types/test/switchboards.d.ts +20 -0
- package/dist/types/test/switchboards.d.ts.map +1 -0
- 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/connection-editor.spec.d.ts +2 -0
- package/dist/types/test/ui/connection-editor.spec.d.ts.map +1 -0
- package/dist/types/test/ui/data-viewer.spec.d.ts +2 -0
- package/dist/types/test/ui/data-viewer.spec.d.ts.map +1 -0
- package/dist/types/test/ui/fixtures.d.ts +14 -0
- package/dist/types/test/ui/fixtures.d.ts.map +1 -0
- package/dist/types/test/ui/flow-control.spec.d.ts +2 -0
- package/dist/types/test/ui/flow-control.spec.d.ts.map +1 -0
- package/dist/types/test/ui/global-setup.d.ts +2 -0
- package/dist/types/test/ui/global-setup.d.ts.map +1 -0
- package/dist/types/test/ui/harness/prop-controls.d.ts +6 -0
- package/dist/types/test/ui/harness/prop-controls.d.ts.map +1 -0
- package/dist/types/test/ui/harness/property-form-echo.d.ts +12 -0
- package/dist/types/test/ui/harness/property-form-echo.d.ts.map +1 -0
- package/dist/types/test/ui/harness/schedule-builder.d.ts +8 -0
- package/dist/types/test/ui/harness/schedule-builder.d.ts.map +1 -0
- package/dist/types/test/ui/manual-inputs.spec.d.ts +2 -0
- package/dist/types/test/ui/manual-inputs.spec.d.ts.map +1 -0
- 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/pieces.spec.d.ts +2 -0
- package/dist/types/test/ui/pieces.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/prop-controls.spec.d.ts +2 -0
- package/dist/types/test/ui/prop-controls.spec.d.ts.map +1 -0
- package/dist/types/test/ui/property-form-echo.spec.d.ts +2 -0
- package/dist/types/test/ui/property-form-echo.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/reactor-connection.spec.d.ts +2 -0
- package/dist/types/test/ui/reactor-connection.spec.d.ts.map +1 -0
- package/dist/types/test/ui/reactor-steps.spec.d.ts +2 -0
- package/dist/types/test/ui/reactor-steps.spec.d.ts.map +1 -0
- package/dist/types/test/ui/schedule-builder.spec.d.ts +2 -0
- package/dist/types/test/ui/schedule-builder.spec.d.ts.map +1 -0
- package/dist/types/test/ui/step-panel.spec.d.ts +2 -0
- package/dist/types/test/ui/step-panel.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/studio.spec.d.ts +2 -0
- package/dist/types/test/ui/studio.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/dist/types/test/waitpoint-record.d.ts +3 -0
- package/dist/types/test/waitpoint-record.d.ts.map +1 -0
- package/dist/types/vitest.config.d.ts +3 -0
- package/dist/types/vitest.config.d.ts.map +1 -0
- package/dist/workflow.css +68 -0
- package/package.json +146 -0
|
@@ -0,0 +1,3210 @@
|
|
|
1
|
+
import { B as SCHEDULE_TRIGGER, I as MANUAL_TRIGGER, K as WEBHOOK_TRIGGER, Q as triggerBlock, X as stepBlock } from "./runtime-queries-FmEzElOY.js";
|
|
2
|
+
import { $ as useOptionSearch, At as Button, Bt as Tooltip, Ft as Segmented, Gt as isIconName, Ht as textAreaClass, It as Select, Lt as Switch, Nt as Hint, Pt as IconButton, Rt as Tabs, Ut as textInputClass, Vt as invalidClass, Wt as Icon, Y as useDynamicCache, ct as parsePropList, et as useResolvedProp, f as blockMeta, ft as stripOptions, jt as FieldError, lt as resolverInputFor, mt as withSetting, ot as isEmptyValue, p as namedByCoreTab, st as isPropVisible, t as BlockLogo, ut as settingFor, zt as Toggle } from "./BlockSelector-CEdYUqjx.js";
|
|
3
|
+
import { useSetSelectedNode } from "@powerhousedao/reactor-browser";
|
|
4
|
+
import { blockKey } from "@powerhousedao/pieces-framework/block-type";
|
|
5
|
+
import { DOCUMENT_REF_KEY, NEXT_PORT, documentRefsIn, expandDocumentRefs, isDocumentRefMarker, parseScheduleConfig, stepPorts } from "@powerhousedao/pieces-framework/workflow";
|
|
6
|
+
import { Fragment, Suspense, createContext, lazy, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal } from "react-dom";
|
|
9
|
+
//#region editors/shared/pending-echo.ts
|
|
10
|
+
function keyOf(value) {
|
|
11
|
+
return JSON.stringify(value, (_, entry) => entry && typeof entry === "object" && !Array.isArray(entry) ? Object.fromEntries(Object.entries(entry).sort(([a], [b]) => a.localeCompare(b))) : entry);
|
|
12
|
+
}
|
|
13
|
+
function usePendingEcho(saved, onChange) {
|
|
14
|
+
const savedKey = keyOf(saved);
|
|
15
|
+
const [sent, setSent] = useState([]);
|
|
16
|
+
const [seen, setSeen] = useState(savedKey);
|
|
17
|
+
let pending = sent;
|
|
18
|
+
if (seen !== savedKey) {
|
|
19
|
+
const echo = sent.findIndex((value) => keyOf(value) === savedKey);
|
|
20
|
+
pending = echo === -1 ? [] : sent.slice(echo + 1);
|
|
21
|
+
setSeen(savedKey);
|
|
22
|
+
setSent(pending);
|
|
23
|
+
}
|
|
24
|
+
const value = pending.length > 0 ? pending[pending.length - 1] : saved;
|
|
25
|
+
return {
|
|
26
|
+
value,
|
|
27
|
+
commit: (next) => {
|
|
28
|
+
if (keyOf(next) === keyOf(value)) return;
|
|
29
|
+
setSent([...pending, next]);
|
|
30
|
+
onChange(next, value);
|
|
31
|
+
},
|
|
32
|
+
onBlur: (event) => {
|
|
33
|
+
const inside = event.currentTarget.contains(event.relatedTarget);
|
|
34
|
+
if (pending.length > 0 && !inside && keyOf(value) === savedKey) setSent([]);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region editors/workflow-editor/ui/canvas-menu.ts
|
|
40
|
+
function hasNextPort(model, id, portsOf) {
|
|
41
|
+
if (model.trigger?.id === id) return true;
|
|
42
|
+
const step = model.steps.find((entry) => entry.id === id);
|
|
43
|
+
return step ? stepPorts(stepBlock(step), step.config, portsOf)?.includes(NEXT_PORT) ?? false : false;
|
|
44
|
+
}
|
|
45
|
+
function contextMenuItems(target, model, portsOf) {
|
|
46
|
+
switch (target.kind) {
|
|
47
|
+
case "step": {
|
|
48
|
+
const skipped = model.steps.find((entry) => entry.id === target.id)?.skip === true;
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
id: "open",
|
|
52
|
+
label: "Open settings"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "addBelow",
|
|
56
|
+
label: "Add step below",
|
|
57
|
+
disabled: !hasNextPort(model, target.id, portsOf)
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "duplicate",
|
|
61
|
+
label: "Duplicate step"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "toggleSkip",
|
|
65
|
+
label: skipped ? "Stop skipping this step" : "Skip this step"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "removeStep",
|
|
69
|
+
label: "Remove step"
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
case "trigger": return [
|
|
74
|
+
{
|
|
75
|
+
id: "open",
|
|
76
|
+
label: "Open settings"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "addBelow",
|
|
80
|
+
label: "Add step below",
|
|
81
|
+
disabled: !model.trigger
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "changeTrigger",
|
|
85
|
+
label: "Change trigger"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "removeTrigger",
|
|
89
|
+
label: "Remove trigger"
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
case "edge": return [{
|
|
93
|
+
id: "insertStep",
|
|
94
|
+
label: "Insert step here"
|
|
95
|
+
}, {
|
|
96
|
+
id: "removeEdge",
|
|
97
|
+
label: "Remove edge"
|
|
98
|
+
}];
|
|
99
|
+
case "pane": return [
|
|
100
|
+
{
|
|
101
|
+
id: "addStep",
|
|
102
|
+
label: "Add step here"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "selectAll",
|
|
106
|
+
label: "Select all steps",
|
|
107
|
+
disabled: model.steps.length === 0
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "fitView",
|
|
111
|
+
label: "Fit view"
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const MENU_ITEM_HEIGHT = 28;
|
|
117
|
+
const VIEWPORT_MARGIN = 8;
|
|
118
|
+
function menuHeight(items) {
|
|
119
|
+
return items * MENU_ITEM_HEIGHT + 8;
|
|
120
|
+
}
|
|
121
|
+
function clampToViewport(at, extent, available) {
|
|
122
|
+
return Math.max(VIEWPORT_MARGIN, Math.min(at, available - extent - VIEWPORT_MARGIN));
|
|
123
|
+
}
|
|
124
|
+
function menuPosition(point, size, viewport) {
|
|
125
|
+
const place = (at, extent, available) => clampToViewport(at + extent > available - VIEWPORT_MARGIN ? at - extent : at, extent, available);
|
|
126
|
+
return {
|
|
127
|
+
x: place(point.x, size.width, viewport.width),
|
|
128
|
+
y: place(point.y, size.height, viewport.height)
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const ANCHOR_GAP = 8;
|
|
132
|
+
function anchorLeftPosition(anchor, size, viewport) {
|
|
133
|
+
const left = anchor.left - ANCHOR_GAP - size.width;
|
|
134
|
+
return {
|
|
135
|
+
x: clampToViewport(left >= VIEWPORT_MARGIN ? left : anchor.right + ANCHOR_GAP, size.width, viewport.width),
|
|
136
|
+
y: clampToViewport(anchor.top, size.height, viewport.height)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region editors/workflow-editor/ui/document-shape.ts
|
|
141
|
+
const MAX_DEPTH$1 = 6;
|
|
142
|
+
const normalize = (name) => name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
143
|
+
function typeName(node, kind) {
|
|
144
|
+
if (node.kind === kind.NON_NULL_TYPE) {
|
|
145
|
+
const inner = typeName(node.type, kind);
|
|
146
|
+
return {
|
|
147
|
+
name: inner.name,
|
|
148
|
+
display: `${inner.display}!`
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (node.kind === kind.LIST_TYPE) {
|
|
152
|
+
const inner = typeName(node.type, kind);
|
|
153
|
+
return {
|
|
154
|
+
name: inner.name,
|
|
155
|
+
display: `[${inner.display}]`
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
name: node.name.value,
|
|
160
|
+
display: node.name.value
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
async function stateFieldsFromSdl(model) {
|
|
164
|
+
if (!model.schema) return {};
|
|
165
|
+
const { Kind, parse } = await import("graphql");
|
|
166
|
+
let definitions;
|
|
167
|
+
try {
|
|
168
|
+
definitions = parse(model.schema).definitions;
|
|
169
|
+
} catch {
|
|
170
|
+
return {};
|
|
171
|
+
}
|
|
172
|
+
const types = /* @__PURE__ */ new Map();
|
|
173
|
+
for (const def of definitions) {
|
|
174
|
+
if (def.kind !== Kind.OBJECT_TYPE_DEFINITION && def.kind !== Kind.INPUT_OBJECT_TYPE_DEFINITION) continue;
|
|
175
|
+
types.set(normalize(def.name.value), (def.fields ?? []).map((field) => ({
|
|
176
|
+
name: field.name.value,
|
|
177
|
+
type: field.type
|
|
178
|
+
})));
|
|
179
|
+
}
|
|
180
|
+
const root = [`${normalize(model.name)}state`, `${normalize(model.name)}globalstate`].map((candidate) => types.get(candidate)).find((fields) => fields !== void 0);
|
|
181
|
+
const build = (fields, depth) => Object.fromEntries(fields.map((field) => {
|
|
182
|
+
const { name, display } = typeName(field.type, Kind);
|
|
183
|
+
const inner = types.get(normalize(name));
|
|
184
|
+
return [field.name, inner && inner.length > 0 && depth < MAX_DEPTH$1 ? build(inner, depth + 1) : display];
|
|
185
|
+
}));
|
|
186
|
+
return root ? build(root, 0) : {};
|
|
187
|
+
}
|
|
188
|
+
function documentShape(reference, globalState) {
|
|
189
|
+
return {
|
|
190
|
+
header: {
|
|
191
|
+
id: reference.documentId,
|
|
192
|
+
documentType: reference.documentType,
|
|
193
|
+
name: "String",
|
|
194
|
+
slug: "String",
|
|
195
|
+
branch: reference.branch,
|
|
196
|
+
revision: reference.revision,
|
|
197
|
+
createdAtUtcIso: "DateTime!",
|
|
198
|
+
lastModifiedAtUtcIso: "DateTime!"
|
|
199
|
+
},
|
|
200
|
+
state: { global: globalState }
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region editors/workflow-editor/ui/variable-types.ts
|
|
205
|
+
const VARIABLE_TYPE_LABEL = {
|
|
206
|
+
TEXT: "Text",
|
|
207
|
+
NUMBER: "Number",
|
|
208
|
+
BOOLEAN: "True or false",
|
|
209
|
+
JSON: "JSON",
|
|
210
|
+
SECRET: "Secret"
|
|
211
|
+
};
|
|
212
|
+
const VARIABLE_TYPES = Object.keys(VARIABLE_TYPE_LABEL);
|
|
213
|
+
const DECIMAL$1 = /^-?(?:\d+(?:\.\d*)?|\.\d+)$/;
|
|
214
|
+
function parseTypedValue(type, raw) {
|
|
215
|
+
const trimmed = raw.trim();
|
|
216
|
+
switch (type) {
|
|
217
|
+
case "TEXT": return {
|
|
218
|
+
ok: true,
|
|
219
|
+
value: raw === "" ? null : raw
|
|
220
|
+
};
|
|
221
|
+
case "NUMBER":
|
|
222
|
+
if (trimmed === "") return {
|
|
223
|
+
ok: true,
|
|
224
|
+
value: null
|
|
225
|
+
};
|
|
226
|
+
return DECIMAL$1.test(trimmed) ? {
|
|
227
|
+
ok: true,
|
|
228
|
+
value: Number(trimmed)
|
|
229
|
+
} : {
|
|
230
|
+
ok: false,
|
|
231
|
+
error: "Not a number"
|
|
232
|
+
};
|
|
233
|
+
case "BOOLEAN":
|
|
234
|
+
if (trimmed === "true") return {
|
|
235
|
+
ok: true,
|
|
236
|
+
value: true
|
|
237
|
+
};
|
|
238
|
+
if (trimmed === "false") return {
|
|
239
|
+
ok: true,
|
|
240
|
+
value: false
|
|
241
|
+
};
|
|
242
|
+
return {
|
|
243
|
+
ok: false,
|
|
244
|
+
error: "Not true or false"
|
|
245
|
+
};
|
|
246
|
+
case "JSON":
|
|
247
|
+
if (trimmed === "") return {
|
|
248
|
+
ok: true,
|
|
249
|
+
value: null
|
|
250
|
+
};
|
|
251
|
+
try {
|
|
252
|
+
return {
|
|
253
|
+
ok: true,
|
|
254
|
+
value: JSON.parse(trimmed)
|
|
255
|
+
};
|
|
256
|
+
} catch (error) {
|
|
257
|
+
return {
|
|
258
|
+
ok: false,
|
|
259
|
+
error: `Not valid JSON: ${error instanceof Error ? error.message : String(error)}`
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
case "SECRET": return {
|
|
263
|
+
ok: false,
|
|
264
|
+
error: "Secrets are set through the secret field"
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function valueMismatch(type, value) {
|
|
269
|
+
if (value === null || value === void 0) return null;
|
|
270
|
+
switch (type) {
|
|
271
|
+
case "TEXT": return typeof value === "string" ? null : "Not text";
|
|
272
|
+
case "NUMBER": return typeof value === "number" ? null : "Not a number";
|
|
273
|
+
case "BOOLEAN": return typeof value === "boolean" ? null : "Not true or false";
|
|
274
|
+
case "JSON": return null;
|
|
275
|
+
case "SECRET": return typeof value === "string" ? null : "Not a secret reference";
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function convertVariableValue(value, from, to) {
|
|
279
|
+
if (from === to) return value;
|
|
280
|
+
if (from === "SECRET" || to === "SECRET") return null;
|
|
281
|
+
if (to === "JSON" || value === null || value === void 0) return value ?? null;
|
|
282
|
+
if (to === "TEXT") return typeof value === "string" ? value : JSON.stringify(value);
|
|
283
|
+
if (typeof value === "string") {
|
|
284
|
+
const parsed = parseTypedValue(to, value);
|
|
285
|
+
if (parsed.ok) return parsed.value;
|
|
286
|
+
}
|
|
287
|
+
return value;
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region editors/workflow-editor/ui/expression-scope.ts
|
|
291
|
+
const EMPTY_SCOPE = {
|
|
292
|
+
value: {},
|
|
293
|
+
captions: {}
|
|
294
|
+
};
|
|
295
|
+
const MAX_DEPTH = 6;
|
|
296
|
+
const MAX_ARRAY_ITEMS = 25;
|
|
297
|
+
function capValue(value, depth = 0) {
|
|
298
|
+
if (value === null || typeof value !== "object") return value;
|
|
299
|
+
if (depth >= MAX_DEPTH) return Array.isArray(value) ? "[…]" : "{…}";
|
|
300
|
+
if (Array.isArray(value)) return value.slice(0, MAX_ARRAY_ITEMS).map((item) => capValue(item, depth + 1));
|
|
301
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, capValue(entry, depth + 1)]));
|
|
302
|
+
}
|
|
303
|
+
function upstreamStepIds(model, stepId) {
|
|
304
|
+
const incoming = /* @__PURE__ */ new Map();
|
|
305
|
+
for (const edge of model.edges) incoming.set(edge.to, [...incoming.get(edge.to) ?? [], edge.from]);
|
|
306
|
+
const upstream = /* @__PURE__ */ new Set();
|
|
307
|
+
const queue = [stepId];
|
|
308
|
+
while (queue.length > 0) for (const from of incoming.get(queue.pop()) ?? []) if (!upstream.has(from)) {
|
|
309
|
+
upstream.add(from);
|
|
310
|
+
queue.push(from);
|
|
311
|
+
}
|
|
312
|
+
return upstream;
|
|
313
|
+
}
|
|
314
|
+
function formatRunTime(startedAt, now = /* @__PURE__ */ new Date()) {
|
|
315
|
+
const date = new Date(startedAt);
|
|
316
|
+
if (Number.isNaN(date.getTime())) return startedAt;
|
|
317
|
+
const sameDay = date.toDateString() === now.toDateString();
|
|
318
|
+
const time = date.toLocaleTimeString([], {
|
|
319
|
+
hour: "2-digit",
|
|
320
|
+
minute: "2-digit"
|
|
321
|
+
});
|
|
322
|
+
return sameDay ? time : `${date.toLocaleDateString([], {
|
|
323
|
+
month: "short",
|
|
324
|
+
day: "numeric"
|
|
325
|
+
})} ${time}`;
|
|
326
|
+
}
|
|
327
|
+
const hasOutput = (step) => (step.status === "SUCCEEDED" || step.status === "REPLAYED") && step.output !== void 0 && step.output !== null;
|
|
328
|
+
async function withDocuments(value, documentOutput) {
|
|
329
|
+
const references = documentRefsIn(value);
|
|
330
|
+
if (references.length === 0) return value;
|
|
331
|
+
const key = (reference) => `${reference.branch}:${reference.documentId}`;
|
|
332
|
+
const shapeOf = async (reference) => {
|
|
333
|
+
try {
|
|
334
|
+
if (documentOutput) return await documentOutput(reference);
|
|
335
|
+
} catch {}
|
|
336
|
+
return documentShape(reference, {});
|
|
337
|
+
};
|
|
338
|
+
const shapes = new Map(await Promise.all(references.map(async (reference) => [key(reference), await shapeOf(reference)])));
|
|
339
|
+
return expandDocumentRefs(value, (reference) => shapes.get(key(reference)));
|
|
340
|
+
}
|
|
341
|
+
async function buildExpressionScope(options) {
|
|
342
|
+
const { model, latestRun } = options;
|
|
343
|
+
const documents = (value) => withDocuments(value, options.documentOutput);
|
|
344
|
+
const runCaption = latestRun ? `from run ${formatRunTime(latestRun.startedAt, options.now)}` : void 0;
|
|
345
|
+
const runSteps = new Map((latestRun?.steps ?? []).filter(hasOutput).map((step) => [step.stepKey, step]));
|
|
346
|
+
const value = {};
|
|
347
|
+
const captions = {};
|
|
348
|
+
const testCaption = (sample) => `from test ${formatRunTime(sample.testedAt, options.now)}`;
|
|
349
|
+
const tested = async (block) => block.lastTest && options.testOutput ? options.testOutput(block.id).catch(() => void 0) : void 0;
|
|
350
|
+
if (model.trigger) {
|
|
351
|
+
const sample = await tested(model.trigger);
|
|
352
|
+
if (sample) {
|
|
353
|
+
value.trigger = { payload: capValue(await documents(sample.value)) };
|
|
354
|
+
captions["trigger.payload"] = testCaption(sample);
|
|
355
|
+
} else if (runCaption && latestRun?.triggerPayload !== void 0 && latestRun.triggerPayload !== null) {
|
|
356
|
+
value.trigger = { payload: capValue(await documents(latestRun.triggerPayload)) };
|
|
357
|
+
captions["trigger.payload"] = runCaption;
|
|
358
|
+
} else {
|
|
359
|
+
value.trigger = { payload: await options.authoredOutput(triggerBlock(model.trigger), model.trigger.config) };
|
|
360
|
+
captions["trigger.payload"] = "declared type";
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
const upstream = upstreamStepIds(model, options.stepId);
|
|
364
|
+
const steps = {};
|
|
365
|
+
await Promise.all(model.steps.filter((step) => upstream.has(step.id)).map(async (step) => {
|
|
366
|
+
const sample = await tested(step);
|
|
367
|
+
if (sample) {
|
|
368
|
+
steps[step.key] = { output: capValue(await documents(sample.value)) };
|
|
369
|
+
captions[`steps.${step.key}.output`] = testCaption(sample);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const journaled = runSteps.get(step.key);
|
|
373
|
+
if (runCaption && journaled && journaled.pieceName === step.pieceName && journaled.blockName === step.actionName) {
|
|
374
|
+
steps[step.key] = { output: capValue(await documents(journaled.output)) };
|
|
375
|
+
captions[`steps.${step.key}.output`] = runCaption;
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
steps[step.key] = { output: await options.authoredOutput(stepBlock(step), step.config) };
|
|
379
|
+
captions[`steps.${step.key}.output`] = "declared type";
|
|
380
|
+
}));
|
|
381
|
+
if (Object.keys(steps).length > 0) value.steps = steps;
|
|
382
|
+
if (model.variables.length > 0) {
|
|
383
|
+
value.variables = Object.fromEntries(model.variables.map((variable) => [variable.key, variable.type === "SECRET" ? "secret" : variable.value ?? null]));
|
|
384
|
+
captions.variables = "workflow variables";
|
|
385
|
+
for (const variable of model.variables) if (variable.type) captions[`variables.${variable.key}`] = VARIABLE_TYPE_LABEL[variable.type].toLowerCase();
|
|
386
|
+
}
|
|
387
|
+
return {
|
|
388
|
+
value,
|
|
389
|
+
captions
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
const IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
393
|
+
function childPath(parent, key, parentIsArray) {
|
|
394
|
+
if (parentIsArray) return `${parent}[${key}]`;
|
|
395
|
+
if (!parent) return key;
|
|
396
|
+
return IDENTIFIER.test(key) ? `${parent}.${key}` : `${parent}[${JSON.stringify(key)}]`;
|
|
397
|
+
}
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region editors/workflow-editor/ui/expression-tokens.ts
|
|
400
|
+
const EMBEDDED_EXPRESSION = /(?<!\\)\{\{\s*([^{}]+?)\s*\}\}/g;
|
|
401
|
+
function splitExpressionTokens(value) {
|
|
402
|
+
const tokens = [];
|
|
403
|
+
let last = 0;
|
|
404
|
+
for (const match of value.matchAll(EMBEDDED_EXPRESSION)) {
|
|
405
|
+
const index = match.index;
|
|
406
|
+
if (index > last) tokens.push({
|
|
407
|
+
kind: "text",
|
|
408
|
+
text: value.slice(last, index)
|
|
409
|
+
});
|
|
410
|
+
tokens.push({
|
|
411
|
+
kind: "expression",
|
|
412
|
+
text: match[0],
|
|
413
|
+
expression: match[1]
|
|
414
|
+
});
|
|
415
|
+
last = index + match[0].length;
|
|
416
|
+
}
|
|
417
|
+
if (last < value.length) tokens.push({
|
|
418
|
+
kind: "text",
|
|
419
|
+
text: value.slice(last)
|
|
420
|
+
});
|
|
421
|
+
return tokens;
|
|
422
|
+
}
|
|
423
|
+
function hasExpressions(value) {
|
|
424
|
+
return typeof value === "string" && new RegExp(EMBEDDED_EXPRESSION).test(value);
|
|
425
|
+
}
|
|
426
|
+
function describeExpression(expression) {
|
|
427
|
+
const terms = expression.split("||");
|
|
428
|
+
const path = terms[0].trim();
|
|
429
|
+
const hasFallback = terms.length > 1;
|
|
430
|
+
const segments = path.split(".");
|
|
431
|
+
switch (segments[0]) {
|
|
432
|
+
case "steps": return {
|
|
433
|
+
root: "steps",
|
|
434
|
+
stepKey: segments[1] ?? "",
|
|
435
|
+
rest: segments.slice(2).join("."),
|
|
436
|
+
hasFallback
|
|
437
|
+
};
|
|
438
|
+
case "trigger": return {
|
|
439
|
+
root: "trigger",
|
|
440
|
+
rest: segments.slice(1).join("."),
|
|
441
|
+
hasFallback
|
|
442
|
+
};
|
|
443
|
+
case "variables": return {
|
|
444
|
+
root: "variables",
|
|
445
|
+
rest: segments.slice(1).join("."),
|
|
446
|
+
hasFallback
|
|
447
|
+
};
|
|
448
|
+
default: return {
|
|
449
|
+
root: "other",
|
|
450
|
+
rest: path,
|
|
451
|
+
hasFallback
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region editors/workflow-editor/ui/ExpressionPicker.tsx
|
|
457
|
+
const ScopeSourceContext = createContext(void 0);
|
|
458
|
+
const ExpressionScopeSourceProvider = ScopeSourceContext.Provider;
|
|
459
|
+
function useScopeSource() {
|
|
460
|
+
return useContext(ScopeSourceContext);
|
|
461
|
+
}
|
|
462
|
+
const TargetContext = createContext(null);
|
|
463
|
+
function ExpressionTargetProvider(props) {
|
|
464
|
+
const [target, setTarget] = useState(null);
|
|
465
|
+
const value = useMemo(() => ({
|
|
466
|
+
target,
|
|
467
|
+
setTarget,
|
|
468
|
+
stepBlocks: props.stepBlocks,
|
|
469
|
+
triggerBlock: props.triggerBlock
|
|
470
|
+
}), [
|
|
471
|
+
target,
|
|
472
|
+
props.stepBlocks,
|
|
473
|
+
props.triggerBlock
|
|
474
|
+
]);
|
|
475
|
+
return /* @__PURE__ */ jsx(TargetContext.Provider, {
|
|
476
|
+
value,
|
|
477
|
+
children: props.children
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function useExpressionTarget() {
|
|
481
|
+
return useContext(TargetContext);
|
|
482
|
+
}
|
|
483
|
+
function fieldAnchor(element) {
|
|
484
|
+
const rect = (element?.closest("label,div") ?? element)?.getBoundingClientRect();
|
|
485
|
+
if (!rect) return {
|
|
486
|
+
left: window.innerWidth,
|
|
487
|
+
right: window.innerWidth,
|
|
488
|
+
top: 0
|
|
489
|
+
};
|
|
490
|
+
return {
|
|
491
|
+
left: rect.left,
|
|
492
|
+
right: rect.right,
|
|
493
|
+
top: rect.top
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
function useExpressionField(options) {
|
|
497
|
+
const id = useId();
|
|
498
|
+
const context = useExpressionTarget();
|
|
499
|
+
const insertRef = useRef(options.insert);
|
|
500
|
+
useEffect(() => {
|
|
501
|
+
insertRef.current = options.insert;
|
|
502
|
+
});
|
|
503
|
+
const { stepId, label } = options;
|
|
504
|
+
return {
|
|
505
|
+
active: context?.target?.id === id,
|
|
506
|
+
focus: (event) => {
|
|
507
|
+
context?.setTarget({
|
|
508
|
+
id,
|
|
509
|
+
stepId,
|
|
510
|
+
label,
|
|
511
|
+
anchor: fieldAnchor(event?.currentTarget),
|
|
512
|
+
insert: (expression) => insertRef.current(expression)
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function preview(value) {
|
|
518
|
+
if (value === null) return "null";
|
|
519
|
+
if (value === void 0) return "";
|
|
520
|
+
if (Array.isArray(value)) return `[${value.length}]`;
|
|
521
|
+
if (typeof value === "object") return "{…}";
|
|
522
|
+
const text = typeof value === "string" ? value : JSON.stringify(value) ?? "";
|
|
523
|
+
return text.length > 28 ? `${text.slice(0, 28)}…` : text;
|
|
524
|
+
}
|
|
525
|
+
function isExpandable(value) {
|
|
526
|
+
return value !== null && typeof value === "object" && Object.keys(value).length > 0;
|
|
527
|
+
}
|
|
528
|
+
function entriesOf(value) {
|
|
529
|
+
if (Array.isArray(value)) return value.map((item, i) => [String(i), item]);
|
|
530
|
+
if (value !== null && typeof value === "object") return Object.entries(value);
|
|
531
|
+
return [];
|
|
532
|
+
}
|
|
533
|
+
function Caption(props) {
|
|
534
|
+
if (!props.text) return null;
|
|
535
|
+
return /* @__PURE__ */ jsx("span", {
|
|
536
|
+
className: "ml-auto shrink-0 pl-2 text-[10px] italic text-muted-foreground/80",
|
|
537
|
+
children: props.text
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
function ValueNode(props) {
|
|
541
|
+
const context = useExpressionTarget();
|
|
542
|
+
const [open, setOpen] = useState(props.depth < 2);
|
|
543
|
+
const expandable = isExpandable(props.value);
|
|
544
|
+
const stepKey = /^steps\.([^.]+)$/.exec(props.path)?.[1];
|
|
545
|
+
const nodeBlock = stepKey ? context?.stepBlocks[stepKey] : props.path === "trigger" ? context?.triggerBlock : void 0;
|
|
546
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
547
|
+
className: "flex items-center gap-1 rounded px-1 py-0.5 hover:bg-muted/50",
|
|
548
|
+
style: { paddingLeft: props.depth * 14 + 4 },
|
|
549
|
+
children: [
|
|
550
|
+
expandable ? /* @__PURE__ */ jsx("button", {
|
|
551
|
+
type: "button",
|
|
552
|
+
className: "w-3 shrink-0 text-[10px] text-muted-foreground/80",
|
|
553
|
+
onClick: () => setOpen((value) => !value),
|
|
554
|
+
children: open ? "▾" : "▸"
|
|
555
|
+
}) : /* @__PURE__ */ jsx("span", { className: "w-3 shrink-0" }),
|
|
556
|
+
/* @__PURE__ */ jsxs("button", {
|
|
557
|
+
type: "button",
|
|
558
|
+
className: "flex min-w-0 flex-1 items-baseline gap-2 text-left",
|
|
559
|
+
title: `{{${props.path}}}`,
|
|
560
|
+
onClick: () => props.onPick(props.path),
|
|
561
|
+
children: [nodeBlock ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BlockLogo, {
|
|
562
|
+
block: nodeBlock,
|
|
563
|
+
size: 16
|
|
564
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
565
|
+
className: "shrink-0 text-xs font-medium text-foreground",
|
|
566
|
+
children: blockMeta(nodeBlock).displayName
|
|
567
|
+
})] }) : /* @__PURE__ */ jsx("span", {
|
|
568
|
+
className: "shrink-0 font-mono text-xs text-foreground",
|
|
569
|
+
children: props.name
|
|
570
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
571
|
+
className: "truncate text-[11px] text-muted-foreground/80",
|
|
572
|
+
children: preview(props.value)
|
|
573
|
+
})]
|
|
574
|
+
}),
|
|
575
|
+
/* @__PURE__ */ jsx(Caption, { text: props.captions[props.path] })
|
|
576
|
+
]
|
|
577
|
+
}), expandable && open ? entriesOf(props.value).map(([key, child]) => /* @__PURE__ */ jsx(ValueNode, {
|
|
578
|
+
name: key,
|
|
579
|
+
path: childPath(props.path, key, Array.isArray(props.value)),
|
|
580
|
+
value: child,
|
|
581
|
+
depth: props.depth + 1,
|
|
582
|
+
captions: props.captions,
|
|
583
|
+
onPick: props.onPick
|
|
584
|
+
}, key)) : null] });
|
|
585
|
+
}
|
|
586
|
+
const SEARCH_DEPTH = 6;
|
|
587
|
+
const SEARCH_LIMIT = 200;
|
|
588
|
+
function flatten(value, path, depth, out) {
|
|
589
|
+
for (const [key, child] of entriesOf(value)) {
|
|
590
|
+
const nested = childPath(path, key, Array.isArray(value));
|
|
591
|
+
out.push({
|
|
592
|
+
path: nested,
|
|
593
|
+
value: child
|
|
594
|
+
});
|
|
595
|
+
if (depth < SEARCH_DEPTH && isExpandable(child)) flatten(child, nested, depth + 1, out);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function SearchResults(props) {
|
|
599
|
+
const matches = useMemo(() => {
|
|
600
|
+
const all = [];
|
|
601
|
+
flatten(props.scope.value, "", 0, all);
|
|
602
|
+
const lowered = props.query.toLowerCase();
|
|
603
|
+
return all.filter((entry) => entry.path.toLowerCase().includes(lowered)).slice(0, SEARCH_LIMIT);
|
|
604
|
+
}, [props.scope, props.query]);
|
|
605
|
+
if (matches.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
606
|
+
className: "px-2 py-1 text-xs text-muted-foreground/80",
|
|
607
|
+
children: "No matches"
|
|
608
|
+
});
|
|
609
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: matches.map((entry) => /* @__PURE__ */ jsxs("button", {
|
|
610
|
+
type: "button",
|
|
611
|
+
className: "flex w-full items-baseline gap-2 rounded px-2 py-0.5 text-left hover:bg-muted/50",
|
|
612
|
+
title: `{{${entry.path}}}`,
|
|
613
|
+
onClick: () => props.onPick(entry.path),
|
|
614
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
615
|
+
className: "min-w-0 truncate font-mono text-[11px] text-foreground",
|
|
616
|
+
children: entry.path
|
|
617
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
618
|
+
className: "truncate text-[10px] text-muted-foreground/80",
|
|
619
|
+
children: preview(entry.value)
|
|
620
|
+
})]
|
|
621
|
+
}, entry.path)) });
|
|
622
|
+
}
|
|
623
|
+
const POPUP_SIZE = {
|
|
624
|
+
width: 420,
|
|
625
|
+
height: 520
|
|
626
|
+
};
|
|
627
|
+
function ExpressionPickerPopup() {
|
|
628
|
+
const context = useExpressionTarget();
|
|
629
|
+
const target = context?.target ?? null;
|
|
630
|
+
const [query, setQuery] = useState("");
|
|
631
|
+
const [state, setState] = useState({ kind: "idle" });
|
|
632
|
+
const scopeSource = useScopeSource();
|
|
633
|
+
const containerRef = useRef(null);
|
|
634
|
+
const stepId = target?.stepId;
|
|
635
|
+
const hasTarget = target !== null;
|
|
636
|
+
useEffect(() => {
|
|
637
|
+
if (!hasTarget || !scopeSource) return;
|
|
638
|
+
let alive = true;
|
|
639
|
+
setState((current) => current.kind === "ready" && current.stepId === stepId ? current : { kind: "loading" });
|
|
640
|
+
scopeSource.load({ stepId }).then((scope) => {
|
|
641
|
+
if (alive) setState({
|
|
642
|
+
kind: "ready",
|
|
643
|
+
scope,
|
|
644
|
+
stepId
|
|
645
|
+
});
|
|
646
|
+
}, (error) => {
|
|
647
|
+
if (alive) setState({
|
|
648
|
+
kind: "error",
|
|
649
|
+
message: error instanceof Error ? error.message : String(error)
|
|
650
|
+
});
|
|
651
|
+
});
|
|
652
|
+
return () => {
|
|
653
|
+
alive = false;
|
|
654
|
+
};
|
|
655
|
+
}, [
|
|
656
|
+
hasTarget,
|
|
657
|
+
stepId,
|
|
658
|
+
scopeSource
|
|
659
|
+
]);
|
|
660
|
+
const targetId = target?.id;
|
|
661
|
+
useEffect(() => setQuery(""), [targetId]);
|
|
662
|
+
const close = context?.setTarget;
|
|
663
|
+
useEffect(() => {
|
|
664
|
+
if (!hasTarget || !close) return;
|
|
665
|
+
const dismiss = () => close(null);
|
|
666
|
+
const outside = (event) => !containerRef.current?.contains(event.target);
|
|
667
|
+
const onMouseDown = (event) => {
|
|
668
|
+
if (outside(event)) dismiss();
|
|
669
|
+
};
|
|
670
|
+
const onKeyDown = (event) => {
|
|
671
|
+
if (event.key === "Escape") dismiss();
|
|
672
|
+
};
|
|
673
|
+
const onScroll = (event) => {
|
|
674
|
+
if (outside(event)) dismiss();
|
|
675
|
+
};
|
|
676
|
+
window.addEventListener("mousedown", onMouseDown);
|
|
677
|
+
window.addEventListener("keydown", onKeyDown);
|
|
678
|
+
window.addEventListener("scroll", onScroll, true);
|
|
679
|
+
return () => {
|
|
680
|
+
window.removeEventListener("mousedown", onMouseDown);
|
|
681
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
682
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
683
|
+
};
|
|
684
|
+
}, [hasTarget, close]);
|
|
685
|
+
if (!context || !scopeSource || !target) return null;
|
|
686
|
+
const pick = (path) => {
|
|
687
|
+
target.insert(`{{${path}}}`);
|
|
688
|
+
context.setTarget(null);
|
|
689
|
+
};
|
|
690
|
+
const scope = state.kind === "ready" && state.stepId === stepId ? state.scope : EMPTY_SCOPE;
|
|
691
|
+
const empty = entriesOf(scope.value).length === 0;
|
|
692
|
+
const position = anchorLeftPosition(target.anchor, POPUP_SIZE, {
|
|
693
|
+
width: window.innerWidth,
|
|
694
|
+
height: window.innerHeight
|
|
695
|
+
});
|
|
696
|
+
return createPortal(/* @__PURE__ */ jsxs("div", {
|
|
697
|
+
ref: containerRef,
|
|
698
|
+
className: "workflow-expression-popup fixed flex flex-col rounded-md border border-solid border-foreground/10 bg-card shadow-lg",
|
|
699
|
+
onMouseDown: (event) => {
|
|
700
|
+
if (!(event.target instanceof HTMLInputElement)) event.preventDefault();
|
|
701
|
+
},
|
|
702
|
+
style: {
|
|
703
|
+
left: position.x,
|
|
704
|
+
top: position.y,
|
|
705
|
+
width: POPUP_SIZE.width,
|
|
706
|
+
maxHeight: POPUP_SIZE.height
|
|
707
|
+
},
|
|
708
|
+
children: [
|
|
709
|
+
/* @__PURE__ */ jsxs("div", {
|
|
710
|
+
className: "flex items-center gap-2 px-3 py-1.5",
|
|
711
|
+
children: [
|
|
712
|
+
/* @__PURE__ */ jsx("span", {
|
|
713
|
+
className: "font-mono text-[11px] text-muted-foreground",
|
|
714
|
+
children: "{}"
|
|
715
|
+
}),
|
|
716
|
+
/* @__PURE__ */ jsxs("span", {
|
|
717
|
+
className: "min-w-0 truncate text-xs text-muted-foreground",
|
|
718
|
+
children: [
|
|
719
|
+
"Insert into",
|
|
720
|
+
" ",
|
|
721
|
+
/* @__PURE__ */ jsx("span", {
|
|
722
|
+
className: "font-semibold text-foreground",
|
|
723
|
+
children: target.label
|
|
724
|
+
})
|
|
725
|
+
]
|
|
726
|
+
}),
|
|
727
|
+
/* @__PURE__ */ jsx("button", {
|
|
728
|
+
type: "button",
|
|
729
|
+
className: "ml-auto text-[11px] text-muted-foreground/80 hover:text-muted-foreground",
|
|
730
|
+
title: "Close",
|
|
731
|
+
onClick: () => context.setTarget(null),
|
|
732
|
+
children: "✕"
|
|
733
|
+
})
|
|
734
|
+
]
|
|
735
|
+
}),
|
|
736
|
+
/* @__PURE__ */ jsx("div", {
|
|
737
|
+
className: "px-3 pb-1.5",
|
|
738
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
739
|
+
className: "w-full rounded border border-foreground/10 px-2 py-1.5 text-sm",
|
|
740
|
+
placeholder: "Search paths…",
|
|
741
|
+
value: query,
|
|
742
|
+
onChange: (event) => setQuery(event.target.value)
|
|
743
|
+
})
|
|
744
|
+
}),
|
|
745
|
+
/* @__PURE__ */ jsx("div", {
|
|
746
|
+
className: "min-h-0 flex-1 overflow-y-auto px-1 pb-1",
|
|
747
|
+
children: state.kind === "error" ? /* @__PURE__ */ jsx("div", {
|
|
748
|
+
className: "px-2 py-1 text-xs text-wf-fail",
|
|
749
|
+
children: state.message
|
|
750
|
+
}) : state.kind === "loading" ? /* @__PURE__ */ jsx("div", {
|
|
751
|
+
className: "px-2 py-1 text-xs text-muted-foreground/80",
|
|
752
|
+
children: "Loading…"
|
|
753
|
+
}) : empty ? /* @__PURE__ */ jsx("div", {
|
|
754
|
+
className: "px-2 py-1 text-xs text-muted-foreground/80",
|
|
755
|
+
children: "No values available for this field yet."
|
|
756
|
+
}) : query.trim() ? /* @__PURE__ */ jsx(SearchResults, {
|
|
757
|
+
scope,
|
|
758
|
+
query: query.trim(),
|
|
759
|
+
onPick: pick
|
|
760
|
+
}) : entriesOf(scope.value).map(([key, value]) => /* @__PURE__ */ jsx(ValueNode, {
|
|
761
|
+
name: key,
|
|
762
|
+
path: key,
|
|
763
|
+
value,
|
|
764
|
+
depth: 0,
|
|
765
|
+
captions: scope.captions,
|
|
766
|
+
onPick: pick
|
|
767
|
+
}, key))
|
|
768
|
+
})
|
|
769
|
+
]
|
|
770
|
+
}), document.body);
|
|
771
|
+
}
|
|
772
|
+
function ExpressionPickerButton(props) {
|
|
773
|
+
if (!useScopeSource()) return null;
|
|
774
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
775
|
+
type: "button",
|
|
776
|
+
title: "Insert data from the trigger or an earlier step",
|
|
777
|
+
className: `inline-flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${props.active ? "bg-wf-run/10 text-wf-run" : "text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-focus-within/field:opacity-100 group-hover/field:opacity-100 [@media(hover:none)]:opacity-100"}`,
|
|
778
|
+
onClick: props.onFocusField,
|
|
779
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
780
|
+
name: "braces",
|
|
781
|
+
className: "h-3.5 w-3.5"
|
|
782
|
+
}), "Insert data"]
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
function Chip(props) {
|
|
786
|
+
const ref = describeExpression(props.expression);
|
|
787
|
+
const block = ref.stepKey ? props.stepBlocks[ref.stepKey] : void 0;
|
|
788
|
+
const head = ref.root === "steps" ? ref.stepKey : ref.root === "trigger" ? "trigger" : ref.root === "variables" ? "var" : "";
|
|
789
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
790
|
+
className: "inline-flex max-w-full items-center gap-1 rounded border border-solid border-wf-run/20 bg-wf-run/10 px-1 py-px font-mono text-[11px] text-wf-run",
|
|
791
|
+
title: `{{${props.expression}}}`,
|
|
792
|
+
children: [
|
|
793
|
+
block ? /* @__PURE__ */ jsx(BlockLogo, {
|
|
794
|
+
block,
|
|
795
|
+
size: 12
|
|
796
|
+
}) : null,
|
|
797
|
+
head ? /* @__PURE__ */ jsx("span", {
|
|
798
|
+
className: "font-semibold",
|
|
799
|
+
children: head
|
|
800
|
+
}) : null,
|
|
801
|
+
/* @__PURE__ */ jsx("span", {
|
|
802
|
+
className: "truncate",
|
|
803
|
+
children: ref.root === "other" ? ref.rest : ref.rest || "*"
|
|
804
|
+
}),
|
|
805
|
+
ref.hasFallback ? /* @__PURE__ */ jsx("span", {
|
|
806
|
+
className: "text-wf-run",
|
|
807
|
+
children: "||…"
|
|
808
|
+
}) : null
|
|
809
|
+
]
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
function ExpressionTokenLine(props) {
|
|
813
|
+
const context = useExpressionTarget();
|
|
814
|
+
const tokens = splitExpressionTokens(props.value);
|
|
815
|
+
if (!tokens.some((token) => token.kind === "expression")) return null;
|
|
816
|
+
return /* @__PURE__ */ jsx("div", {
|
|
817
|
+
className: "mt-1.5 flex flex-wrap items-center gap-1 text-xs text-muted-foreground",
|
|
818
|
+
children: tokens.map((token, index) => token.kind === "text" ? /* @__PURE__ */ jsx("span", {
|
|
819
|
+
className: "max-w-40 truncate whitespace-pre",
|
|
820
|
+
children: token.text
|
|
821
|
+
}, index) : /* @__PURE__ */ jsx(Chip, {
|
|
822
|
+
expression: token.expression,
|
|
823
|
+
stepBlocks: context?.stepBlocks ?? {}
|
|
824
|
+
}, index))
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region editors/workflow-editor/ui/secret-ref.ts
|
|
829
|
+
const SECRET_REF_PREFIX = "secret://v1:";
|
|
830
|
+
function useSecretRef(options) {
|
|
831
|
+
const { secrets } = options;
|
|
832
|
+
const ref = typeof options.value === "string" ? options.value : "";
|
|
833
|
+
const managed = ref.startsWith(SECRET_REF_PREFIX);
|
|
834
|
+
const [draft, setDraft] = useState("");
|
|
835
|
+
const [busy, setBusy] = useState(false);
|
|
836
|
+
const [error, setError] = useState(null);
|
|
837
|
+
const [stat, setStat] = useState(null);
|
|
838
|
+
useEffect(() => {
|
|
839
|
+
setStat(null);
|
|
840
|
+
if (!managed || !secrets) return;
|
|
841
|
+
let cancelled = false;
|
|
842
|
+
secrets.stat(ref).then((result) => {
|
|
843
|
+
if (!cancelled) setStat(result);
|
|
844
|
+
}, () => void 0);
|
|
845
|
+
return () => {
|
|
846
|
+
cancelled = true;
|
|
847
|
+
};
|
|
848
|
+
}, [
|
|
849
|
+
ref,
|
|
850
|
+
managed,
|
|
851
|
+
secrets
|
|
852
|
+
]);
|
|
853
|
+
const commit = () => {
|
|
854
|
+
if (draft === "" || busy || !secrets) return;
|
|
855
|
+
setBusy(true);
|
|
856
|
+
setError(null);
|
|
857
|
+
secrets.save({
|
|
858
|
+
ref: managed ? ref : void 0,
|
|
859
|
+
value: draft,
|
|
860
|
+
label: options.label
|
|
861
|
+
}).then((result) => {
|
|
862
|
+
setDraft("");
|
|
863
|
+
if (result.ref !== ref) options.onCommit(result.ref);
|
|
864
|
+
else setStat(result);
|
|
865
|
+
}).catch((requestError) => {
|
|
866
|
+
setError(requestError instanceof Error ? requestError.message : String(requestError));
|
|
867
|
+
}).finally(() => setBusy(false));
|
|
868
|
+
};
|
|
869
|
+
return {
|
|
870
|
+
ref,
|
|
871
|
+
managed,
|
|
872
|
+
draft,
|
|
873
|
+
setDraft,
|
|
874
|
+
busy,
|
|
875
|
+
error,
|
|
876
|
+
stat,
|
|
877
|
+
commit
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region editors/workflow-editor/ui/prop-defaults.ts
|
|
882
|
+
function asRecord(value) {
|
|
883
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
884
|
+
}
|
|
885
|
+
function withPropDefaults(props, config) {
|
|
886
|
+
const next = { ...asRecord(config) };
|
|
887
|
+
for (const prop of props) {
|
|
888
|
+
if (prop.type === "MARKDOWN" || prop.defaultValue === void 0) continue;
|
|
889
|
+
if (next[prop.name] === void 0) next[prop.name] = prop.defaultValue;
|
|
890
|
+
}
|
|
891
|
+
return next;
|
|
892
|
+
}
|
|
893
|
+
function lacksDefaults(props, config) {
|
|
894
|
+
const record = asRecord(config);
|
|
895
|
+
return props.some((prop) => prop.type !== "MARKDOWN" && prop.defaultValue !== void 0 && record[prop.name] === void 0);
|
|
896
|
+
}
|
|
897
|
+
//#endregion
|
|
898
|
+
//#region editors/workflow-editor/ui/prop-controls.tsx
|
|
899
|
+
const CALLOUT = {
|
|
900
|
+
INFO: { box: "rounded bg-muted px-2 py-1.5" },
|
|
901
|
+
WARNING: {
|
|
902
|
+
box: "rounded border border-solid border-wf-warn/40 bg-wf-warn/10 px-2 py-1.5",
|
|
903
|
+
icon: "alert"
|
|
904
|
+
},
|
|
905
|
+
TIP: {
|
|
906
|
+
box: "rounded border border-solid border-wf-ok/30 bg-wf-ok/10 px-2 py-1.5",
|
|
907
|
+
icon: "bolt"
|
|
908
|
+
},
|
|
909
|
+
BORDERLESS: { box: "" }
|
|
910
|
+
};
|
|
911
|
+
/** A MARKDOWN prop's text, styled by the piece's `variant` (INFO default). */
|
|
912
|
+
function MarkdownCallout(props) {
|
|
913
|
+
const callout = CALLOUT[props.variant ?? "INFO"] ?? CALLOUT.INFO;
|
|
914
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
915
|
+
className: `flex gap-2 ${callout.box}`,
|
|
916
|
+
"data-variant": props.variant ?? "INFO",
|
|
917
|
+
children: [callout.icon ? /* @__PURE__ */ jsx(Icon, {
|
|
918
|
+
name: callout.icon,
|
|
919
|
+
className: `mt-0.5 h-3.5 w-3.5 shrink-0 ${callout.icon === "alert" ? "text-wf-warn" : "text-wf-ok"}`
|
|
920
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
921
|
+
className: "min-w-0 flex-1",
|
|
922
|
+
children: props.children
|
|
923
|
+
})]
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
/** An option's icon, when the piece names one this editor draws. */
|
|
927
|
+
function optionIcon(name) {
|
|
928
|
+
return isIconName(name) ? /* @__PURE__ */ jsx(Icon, {
|
|
929
|
+
name,
|
|
930
|
+
className: "h-3.5 w-3.5 shrink-0 text-muted-foreground"
|
|
931
|
+
}) : void 0;
|
|
932
|
+
}
|
|
933
|
+
/** STATIC_DROPDOWN with `display: 'cards'`: one selectable card per option. */
|
|
934
|
+
function OptionCards(props) {
|
|
935
|
+
const current = props.keyOf(props.value);
|
|
936
|
+
return /* @__PURE__ */ jsx("div", {
|
|
937
|
+
id: props.id,
|
|
938
|
+
role: "radiogroup",
|
|
939
|
+
className: `grid grid-cols-2 gap-2 ${props.invalid ? "rounded-md ring-1 ring-wf-warn/60" : ""}`,
|
|
940
|
+
children: props.options.map((option) => {
|
|
941
|
+
const key = props.keyOf(option.value);
|
|
942
|
+
const selected = key === current;
|
|
943
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
944
|
+
type: "button",
|
|
945
|
+
role: "radio",
|
|
946
|
+
"aria-checked": selected,
|
|
947
|
+
className: `flex min-w-0 flex-col items-start gap-1 rounded-lg border border-solid p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${selected ? "border-foreground/40 bg-accent" : "border-foreground/10 hover:border-foreground/25"}`,
|
|
948
|
+
onClick: () => props.onChange(selected && props.clearable ? void 0 : option.value),
|
|
949
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
950
|
+
className: "flex items-center gap-1.5 text-[13px] font-medium text-foreground",
|
|
951
|
+
children: [optionIcon(option.icon), option.label]
|
|
952
|
+
}), option.description ? /* @__PURE__ */ jsx("span", {
|
|
953
|
+
className: "text-xs leading-snug text-muted-foreground",
|
|
954
|
+
children: option.description
|
|
955
|
+
}) : null]
|
|
956
|
+
}, key);
|
|
957
|
+
})
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
/** The declared bounds, for the hint and the check: "Between 0 and 5". */
|
|
961
|
+
function numberRangeText(min, max) {
|
|
962
|
+
if (min !== void 0 && max !== void 0) return `Between ${min} and ${max}`;
|
|
963
|
+
if (min !== void 0) return `At least ${min}`;
|
|
964
|
+
if (max !== void 0) return `At most ${max}`;
|
|
965
|
+
return null;
|
|
966
|
+
}
|
|
967
|
+
function numberRangeError(value, min, max) {
|
|
968
|
+
if (typeof value !== "number") return null;
|
|
969
|
+
if (min !== void 0 && value < min || max !== void 0 && value > max) return `${numberRangeText(min, max)}.`;
|
|
970
|
+
return null;
|
|
971
|
+
}
|
|
972
|
+
/** NUMBER with `display: 'stepper'`: − value +, still accepting expressions. */
|
|
973
|
+
function NumberStepper(props) {
|
|
974
|
+
const step = props.step ?? 1;
|
|
975
|
+
const numeric = typeof props.value === "number" ? props.value : void 0;
|
|
976
|
+
const clamp = (next) => Math.min(props.max ?? Infinity, Math.max(props.min ?? -Infinity, next));
|
|
977
|
+
const bump = (direction) => props.onCommit(clamp((numeric ?? props.min ?? 0) + direction * step));
|
|
978
|
+
const text = props.value === void 0 || props.value === null ? "" : String(props.value);
|
|
979
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
980
|
+
className: "flex items-center gap-1",
|
|
981
|
+
children: [
|
|
982
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
983
|
+
icon: "minus",
|
|
984
|
+
label: "Decrease",
|
|
985
|
+
disabled: numeric !== void 0 && props.min !== void 0 && numeric <= props.min,
|
|
986
|
+
onClick: () => bump(-1)
|
|
987
|
+
}),
|
|
988
|
+
/* @__PURE__ */ jsx("input", {
|
|
989
|
+
id: props.id,
|
|
990
|
+
className: `${textInputClass} w-24 text-center tabular-nums ${props.invalid ? invalidClass : ""}`,
|
|
991
|
+
defaultValue: text,
|
|
992
|
+
inputMode: "decimal",
|
|
993
|
+
spellCheck: false,
|
|
994
|
+
onFocus: props.onFocus,
|
|
995
|
+
onBlur: (event) => props.onCommitText(event.target.value)
|
|
996
|
+
}, text),
|
|
997
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
998
|
+
icon: "plus",
|
|
999
|
+
label: "Increase",
|
|
1000
|
+
disabled: numeric !== void 0 && props.max !== void 0 && numeric >= props.max,
|
|
1001
|
+
onClick: () => bump(1)
|
|
1002
|
+
})
|
|
1003
|
+
]
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
const DATE_PRESETS = Object.entries({
|
|
1007
|
+
any_time: "Any time",
|
|
1008
|
+
last_24_hours: "Last 24 hours",
|
|
1009
|
+
last_7_days: "Last 7 days",
|
|
1010
|
+
last_30_days: "Last 30 days",
|
|
1011
|
+
last_90_days: "Last 90 days",
|
|
1012
|
+
this_month: "This month",
|
|
1013
|
+
custom: "Custom"
|
|
1014
|
+
}).map(([value, label]) => ({
|
|
1015
|
+
value,
|
|
1016
|
+
label
|
|
1017
|
+
}));
|
|
1018
|
+
function toLocalInput(iso) {
|
|
1019
|
+
if (!iso) return "";
|
|
1020
|
+
const date = new Date(iso);
|
|
1021
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
1022
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
1023
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
1024
|
+
}
|
|
1025
|
+
function fromLocalInput(local) {
|
|
1026
|
+
if (!local) return void 0;
|
|
1027
|
+
const date = new Date(local);
|
|
1028
|
+
return Number.isNaN(date.getTime()) ? void 0 : date.toISOString();
|
|
1029
|
+
}
|
|
1030
|
+
function asDateRange(value) {
|
|
1031
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
1032
|
+
}
|
|
1033
|
+
function DateRangeField(props) {
|
|
1034
|
+
const range = asDateRange(props.value);
|
|
1035
|
+
const setPreset = (preset) => props.onCommit(preset === "" ? void 0 : preset === "custom" ? {
|
|
1036
|
+
preset,
|
|
1037
|
+
after: range.after,
|
|
1038
|
+
before: range.before
|
|
1039
|
+
} : { preset });
|
|
1040
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1041
|
+
className: "flex flex-col gap-2",
|
|
1042
|
+
children: [props.dropdown ? /* @__PURE__ */ jsx(Select, {
|
|
1043
|
+
id: props.id,
|
|
1044
|
+
options: DATE_PRESETS,
|
|
1045
|
+
value: range.preset ?? "",
|
|
1046
|
+
onChange: setPreset,
|
|
1047
|
+
invalid: props.invalid,
|
|
1048
|
+
clearable: props.clearable,
|
|
1049
|
+
placeholder: "Choose a range"
|
|
1050
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
1051
|
+
id: props.id,
|
|
1052
|
+
role: "radiogroup",
|
|
1053
|
+
className: "flex flex-wrap gap-1.5",
|
|
1054
|
+
children: DATE_PRESETS.map((preset) => {
|
|
1055
|
+
const selected = range.preset === preset.value;
|
|
1056
|
+
return /* @__PURE__ */ jsx("button", {
|
|
1057
|
+
type: "button",
|
|
1058
|
+
role: "radio",
|
|
1059
|
+
"aria-checked": selected,
|
|
1060
|
+
className: `h-7 rounded-full border border-solid px-2.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${selected ? "border-foreground bg-foreground text-background" : "border-foreground/15 text-muted-foreground hover:text-foreground"}`,
|
|
1061
|
+
onClick: () => setPreset(selected && props.clearable ? "" : preset.value),
|
|
1062
|
+
children: preset.label
|
|
1063
|
+
}, preset.value);
|
|
1064
|
+
})
|
|
1065
|
+
}), range.preset === "custom" ? /* @__PURE__ */ jsx("div", {
|
|
1066
|
+
className: "grid grid-cols-2 gap-2",
|
|
1067
|
+
children: ["after", "before"].map((edge) => /* @__PURE__ */ jsxs("label", {
|
|
1068
|
+
className: "flex flex-col gap-1 text-xs text-muted-foreground",
|
|
1069
|
+
children: [edge === "after" ? "From" : "To", /* @__PURE__ */ jsx("input", {
|
|
1070
|
+
type: "datetime-local",
|
|
1071
|
+
className: textInputClass,
|
|
1072
|
+
defaultValue: toLocalInput(range[edge]),
|
|
1073
|
+
onBlur: (event) => props.onCommit({
|
|
1074
|
+
...range,
|
|
1075
|
+
[edge]: fromLocalInput(event.target.value)
|
|
1076
|
+
})
|
|
1077
|
+
})]
|
|
1078
|
+
}, edge))
|
|
1079
|
+
}) : null]
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
const HEX = /^#[0-9a-f]{6}$/i;
|
|
1083
|
+
/** COLOR: a swatch picker beside a text field that also takes expressions. */
|
|
1084
|
+
function ColorField(props) {
|
|
1085
|
+
const text = typeof props.value === "string" ? props.value : "";
|
|
1086
|
+
const [draft, setDraft] = useState(null);
|
|
1087
|
+
const swatchRef = useRef(null);
|
|
1088
|
+
const onCommit = props.onCommit;
|
|
1089
|
+
useEffect(() => {
|
|
1090
|
+
const swatch = swatchRef.current;
|
|
1091
|
+
if (!swatch) return;
|
|
1092
|
+
const commit = () => {
|
|
1093
|
+
setDraft(null);
|
|
1094
|
+
onCommit(swatch.value);
|
|
1095
|
+
};
|
|
1096
|
+
swatch.addEventListener("change", commit);
|
|
1097
|
+
return () => swatch.removeEventListener("change", commit);
|
|
1098
|
+
}, [onCommit]);
|
|
1099
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1100
|
+
className: "flex items-center gap-2",
|
|
1101
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
1102
|
+
ref: swatchRef,
|
|
1103
|
+
type: "color",
|
|
1104
|
+
"aria-label": "Pick a colour",
|
|
1105
|
+
className: "h-9 w-10 shrink-0 cursor-pointer rounded-md border border-solid border-foreground/15 bg-card p-1",
|
|
1106
|
+
value: draft ?? (HEX.test(text) ? text : "#000000"),
|
|
1107
|
+
onChange: (event) => setDraft(event.target.value)
|
|
1108
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1109
|
+
id: props.id,
|
|
1110
|
+
className: `${textInputClass} font-mono text-xs ${props.invalid ? invalidClass : ""}`,
|
|
1111
|
+
defaultValue: text,
|
|
1112
|
+
placeholder: "#1d63d6 or {{steps.…}}",
|
|
1113
|
+
spellCheck: false,
|
|
1114
|
+
onFocus: props.onFocus,
|
|
1115
|
+
onBlur: (event) => {
|
|
1116
|
+
const raw = event.target.value.trim();
|
|
1117
|
+
props.onCommit(raw === "" ? void 0 : raw);
|
|
1118
|
+
}
|
|
1119
|
+
}, text)]
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
function richTextMode(format) {
|
|
1123
|
+
if (format === "html") return "html";
|
|
1124
|
+
if (format === "markdown" || format === "md") return "markdown";
|
|
1125
|
+
return "plain";
|
|
1126
|
+
}
|
|
1127
|
+
//#endregion
|
|
1128
|
+
//#region editors/workflow-editor/ui/prop-layout.tsx
|
|
1129
|
+
const PLACED = /* @__PURE__ */ new Set([
|
|
1130
|
+
"section",
|
|
1131
|
+
"tabs",
|
|
1132
|
+
"builder",
|
|
1133
|
+
"footer"
|
|
1134
|
+
]);
|
|
1135
|
+
function chipText(value) {
|
|
1136
|
+
if (typeof value === "string") return value;
|
|
1137
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
1138
|
+
if (Array.isArray(value)) return value.map(chipText).join(", ");
|
|
1139
|
+
return "set";
|
|
1140
|
+
}
|
|
1141
|
+
/** Consecutive `width: 'half'` fields share a row, two at a time. */
|
|
1142
|
+
function Rows(props) {
|
|
1143
|
+
const rows = [];
|
|
1144
|
+
let pending = null;
|
|
1145
|
+
const flush = () => {
|
|
1146
|
+
if (pending) rows.push(/* @__PURE__ */ jsx(Fragment, { children: pending.node }, pending.prop.name));
|
|
1147
|
+
pending = null;
|
|
1148
|
+
};
|
|
1149
|
+
for (const item of props.items) {
|
|
1150
|
+
if (item.prop.width !== "half") {
|
|
1151
|
+
flush();
|
|
1152
|
+
rows.push(/* @__PURE__ */ jsx(Fragment, { children: item.node }, item.prop.name));
|
|
1153
|
+
continue;
|
|
1154
|
+
}
|
|
1155
|
+
if (!pending) {
|
|
1156
|
+
pending = item;
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
const first = pending;
|
|
1160
|
+
pending = null;
|
|
1161
|
+
rows.push(/* @__PURE__ */ jsxs("div", {
|
|
1162
|
+
className: "grid grid-cols-1 gap-4 min-[420px]:grid-cols-2",
|
|
1163
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1164
|
+
className: "min-w-0",
|
|
1165
|
+
children: first.node
|
|
1166
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1167
|
+
className: "min-w-0",
|
|
1168
|
+
children: item.node
|
|
1169
|
+
})]
|
|
1170
|
+
}, `${first.prop.name}+${item.prop.name}`));
|
|
1171
|
+
}
|
|
1172
|
+
flush();
|
|
1173
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: rows });
|
|
1174
|
+
}
|
|
1175
|
+
function RevealCard(props) {
|
|
1176
|
+
const open = props.layout.values[props.checkbox.name] === true;
|
|
1177
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1178
|
+
className: "flex flex-col gap-4",
|
|
1179
|
+
children: [props.layout.renderField(props.checkbox), open && props.revealed.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
1180
|
+
className: "flex flex-col gap-4 border-l-2 border-solid border-foreground/10 pl-3",
|
|
1181
|
+
children: /* @__PURE__ */ jsx(Rows, { items: props.revealed.map((prop) => ({
|
|
1182
|
+
prop,
|
|
1183
|
+
node: props.layout.renderField(prop)
|
|
1184
|
+
})) })
|
|
1185
|
+
}) : null]
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
function FieldList(props) {
|
|
1189
|
+
const byName = new Map(props.members.map((prop) => [prop.name, prop]));
|
|
1190
|
+
const revealedBy = /* @__PURE__ */ new Map();
|
|
1191
|
+
for (const prop of props.members) for (const name of prop.reveals ?? []) if (byName.has(name)) revealedBy.set(name, prop);
|
|
1192
|
+
const items = props.members.filter((prop) => !revealedBy.has(prop.name)).map((prop) => {
|
|
1193
|
+
const revealed = (prop.reveals ?? []).map((name) => byName.get(name)).filter((entry) => entry !== void 0);
|
|
1194
|
+
return {
|
|
1195
|
+
prop,
|
|
1196
|
+
node: revealed.length > 0 ? /* @__PURE__ */ jsx(RevealCard, {
|
|
1197
|
+
checkbox: prop,
|
|
1198
|
+
revealed,
|
|
1199
|
+
layout: props.layout
|
|
1200
|
+
}) : props.layout.renderField(prop)
|
|
1201
|
+
};
|
|
1202
|
+
});
|
|
1203
|
+
return /* @__PURE__ */ jsx(Rows, { items });
|
|
1204
|
+
}
|
|
1205
|
+
function GroupHeading(props) {
|
|
1206
|
+
const { group } = props;
|
|
1207
|
+
if (!group.label && !group.description) return null;
|
|
1208
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1209
|
+
className: "flex flex-col gap-0.5",
|
|
1210
|
+
children: [group.label ? /* @__PURE__ */ jsxs("span", {
|
|
1211
|
+
className: "flex items-center gap-1.5 text-[13px] font-semibold text-foreground",
|
|
1212
|
+
children: [isIconName(group.icon) ? /* @__PURE__ */ jsx(Icon, {
|
|
1213
|
+
name: group.icon,
|
|
1214
|
+
className: "h-3.5 w-3.5 text-muted-foreground"
|
|
1215
|
+
}) : null, group.label]
|
|
1216
|
+
}) : null, group.description ? /* @__PURE__ */ jsx("span", {
|
|
1217
|
+
className: "text-xs text-muted-foreground",
|
|
1218
|
+
children: group.description
|
|
1219
|
+
}) : null]
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
function Section(props) {
|
|
1223
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
1224
|
+
"aria-label": props.group.label,
|
|
1225
|
+
className: "flex flex-col gap-4 rounded-lg border border-solid border-foreground/10 p-4",
|
|
1226
|
+
children: [/* @__PURE__ */ jsx(GroupHeading, { group: props.group }), /* @__PURE__ */ jsx(FieldList, {
|
|
1227
|
+
members: props.members,
|
|
1228
|
+
layout: props.layout
|
|
1229
|
+
})]
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
function TabbedGroup(props) {
|
|
1233
|
+
const [active, setActive] = useState(props.members[0]?.name ?? "");
|
|
1234
|
+
const current = props.members.find((prop) => prop.name === active) ?? props.members[0];
|
|
1235
|
+
if (!current) return null;
|
|
1236
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1237
|
+
className: "flex flex-col gap-3",
|
|
1238
|
+
children: [
|
|
1239
|
+
/* @__PURE__ */ jsx(GroupHeading, { group: props.group }),
|
|
1240
|
+
/* @__PURE__ */ jsx("div", {
|
|
1241
|
+
className: "border-b border-solid border-foreground/10",
|
|
1242
|
+
children: /* @__PURE__ */ jsx(Tabs, {
|
|
1243
|
+
value: current.name,
|
|
1244
|
+
onChange: setActive,
|
|
1245
|
+
tabs: props.members.map((prop) => ({
|
|
1246
|
+
value: prop.name,
|
|
1247
|
+
label: prop.displayName,
|
|
1248
|
+
badge: isEmptyValue(props.layout.values[prop.name]) ? void 0 : /* @__PURE__ */ jsx("span", {
|
|
1249
|
+
"aria-label": "has a value",
|
|
1250
|
+
className: "h-1.5 w-1.5 rounded-full bg-wf-run"
|
|
1251
|
+
})
|
|
1252
|
+
}))
|
|
1253
|
+
})
|
|
1254
|
+
}),
|
|
1255
|
+
props.layout.renderField(current)
|
|
1256
|
+
]
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
function BuilderGroups(props) {
|
|
1260
|
+
const members = props.groups.flatMap((group) => group.props.map((name) => props.byName.get(name)).filter((prop) => prop !== void 0));
|
|
1261
|
+
const [added, setAdded] = useState([]);
|
|
1262
|
+
const inUse = members.filter((prop) => prop.required || added.includes(prop.name) || !isEmptyValue(props.layout.values[prop.name]));
|
|
1263
|
+
const available = members.filter((prop) => !inUse.includes(prop));
|
|
1264
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1265
|
+
className: "flex flex-col gap-3",
|
|
1266
|
+
children: [
|
|
1267
|
+
props.groups.map((group) => /* @__PURE__ */ jsx(GroupHeading, { group }, group.key)),
|
|
1268
|
+
inUse.map((prop) => /* @__PURE__ */ jsxs("div", {
|
|
1269
|
+
className: "flex items-start gap-1",
|
|
1270
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1271
|
+
className: "min-w-0 flex-1",
|
|
1272
|
+
children: props.layout.renderField(prop)
|
|
1273
|
+
}), prop.required ? null : /* @__PURE__ */ jsx(IconButton, {
|
|
1274
|
+
icon: "close",
|
|
1275
|
+
label: `Remove ${prop.displayName}`,
|
|
1276
|
+
className: "mt-7",
|
|
1277
|
+
onClick: () => {
|
|
1278
|
+
setAdded((names) => names.filter((name) => name !== prop.name));
|
|
1279
|
+
props.layout.onCommit(prop.name, void 0);
|
|
1280
|
+
}
|
|
1281
|
+
})]
|
|
1282
|
+
}, prop.name)),
|
|
1283
|
+
available.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
1284
|
+
className: "max-w-60",
|
|
1285
|
+
children: /* @__PURE__ */ jsx(Select, {
|
|
1286
|
+
options: available.map((prop) => ({
|
|
1287
|
+
value: prop.name,
|
|
1288
|
+
label: prop.displayName,
|
|
1289
|
+
description: prop.description
|
|
1290
|
+
})),
|
|
1291
|
+
value: "",
|
|
1292
|
+
placeholder: "Add filter",
|
|
1293
|
+
onChange: (name) => {
|
|
1294
|
+
if (name) setAdded((names) => [...names, name]);
|
|
1295
|
+
}
|
|
1296
|
+
})
|
|
1297
|
+
}) : null
|
|
1298
|
+
]
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
function Summary(props) {
|
|
1302
|
+
const set = props.members.filter((prop) => !isEmptyValue(props.layout.values[prop.name]));
|
|
1303
|
+
if (set.length === 0) return null;
|
|
1304
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1305
|
+
className: "flex flex-wrap gap-1.5",
|
|
1306
|
+
"aria-label": "Filters in use",
|
|
1307
|
+
children: set.map((prop) => /* @__PURE__ */ jsxs("span", {
|
|
1308
|
+
className: "inline-flex h-6 max-w-full items-center gap-1 rounded-full bg-muted pl-2.5 pr-1 text-xs text-foreground",
|
|
1309
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
1310
|
+
className: "truncate",
|
|
1311
|
+
children: [
|
|
1312
|
+
prop.displayName,
|
|
1313
|
+
": ",
|
|
1314
|
+
chipText(props.layout.values[prop.name])
|
|
1315
|
+
]
|
|
1316
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1317
|
+
type: "button",
|
|
1318
|
+
"aria-label": `Clear ${prop.displayName}`,
|
|
1319
|
+
className: "flex h-4 w-4 items-center justify-center rounded-full text-muted-foreground hover:bg-foreground/10 hover:text-foreground",
|
|
1320
|
+
onClick: () => props.layout.onCommit(prop.name, void 0),
|
|
1321
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1322
|
+
name: "close",
|
|
1323
|
+
className: "h-3 w-3"
|
|
1324
|
+
})
|
|
1325
|
+
})]
|
|
1326
|
+
}, prop.name))
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
function essentialNames(props, groups) {
|
|
1330
|
+
const all = groups ?? [];
|
|
1331
|
+
if (all.some((group) => ["builder", "footer"].includes(group.display))) return new Set(props.map((prop) => prop.name));
|
|
1332
|
+
const names = new Set(all.filter((group) => group.display === "tabs" || group.display === "section").flatMap((group) => group.props));
|
|
1333
|
+
if (all.some((group) => group.display === "section")) for (const prop of props) for (const name of prop.reveals ?? []) names.add(name);
|
|
1334
|
+
return names;
|
|
1335
|
+
}
|
|
1336
|
+
function PropLayout(props) {
|
|
1337
|
+
const groups = (props.groups ?? []).filter((group) => PLACED.has(group.display) || group.display === "summary");
|
|
1338
|
+
const byName = new Map(props.props.map((prop) => [prop.name, prop]));
|
|
1339
|
+
const groupOf = /* @__PURE__ */ new Map();
|
|
1340
|
+
for (const group of groups) {
|
|
1341
|
+
if (!PLACED.has(group.display)) continue;
|
|
1342
|
+
for (const name of group.props) if (byName.has(name) && !groupOf.has(name)) groupOf.set(name, group);
|
|
1343
|
+
}
|
|
1344
|
+
for (const group of groups) {
|
|
1345
|
+
if (group.display !== "section") continue;
|
|
1346
|
+
for (const name of group.props) {
|
|
1347
|
+
if (groupOf.get(name) !== group) continue;
|
|
1348
|
+
for (const revealed of byName.get(name)?.reveals ?? []) if (byName.has(revealed) && !groupOf.has(revealed)) groupOf.set(revealed, group);
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
const membersOf = (group) => {
|
|
1352
|
+
const named = group.props.filter((name) => groupOf.get(name) === group);
|
|
1353
|
+
const joined = [...groupOf.keys()].filter((name) => groupOf.get(name) === group && !named.includes(name));
|
|
1354
|
+
return [...named, ...joined].map((name) => byName.get(name)).filter((prop) => prop !== void 0);
|
|
1355
|
+
};
|
|
1356
|
+
const builderGroups = groups.filter((group) => group.display === "builder");
|
|
1357
|
+
const summaries = groups.filter((group) => group.display === "summary");
|
|
1358
|
+
const sectionMembers = groups.filter((group) => group.display === "section").flatMap(membersOf);
|
|
1359
|
+
const blocks = [];
|
|
1360
|
+
let loose = [];
|
|
1361
|
+
const flushLoose = () => {
|
|
1362
|
+
if (loose.length === 0) return;
|
|
1363
|
+
blocks.push(/* @__PURE__ */ jsx(FieldList, {
|
|
1364
|
+
members: loose,
|
|
1365
|
+
layout: props
|
|
1366
|
+
}, `loose:${loose[0].name}`));
|
|
1367
|
+
loose = [];
|
|
1368
|
+
};
|
|
1369
|
+
const summarised = summaries.length > 0 && sectionMembers.length > 0;
|
|
1370
|
+
const placed = /* @__PURE__ */ new Set();
|
|
1371
|
+
for (const prop of props.props) {
|
|
1372
|
+
const group = groupOf.get(prop.name);
|
|
1373
|
+
if (!group) {
|
|
1374
|
+
loose.push(prop);
|
|
1375
|
+
continue;
|
|
1376
|
+
}
|
|
1377
|
+
const key = group.display === "builder" ? "builder" : group.key;
|
|
1378
|
+
if (placed.has(key)) continue;
|
|
1379
|
+
placed.add(key);
|
|
1380
|
+
flushLoose();
|
|
1381
|
+
if (group.display === "builder") blocks.push(/* @__PURE__ */ jsx(BuilderGroups, {
|
|
1382
|
+
groups: builderGroups,
|
|
1383
|
+
byName,
|
|
1384
|
+
layout: props
|
|
1385
|
+
}, "builder"));
|
|
1386
|
+
else if (group.display === "tabs") blocks.push(/* @__PURE__ */ jsx(TabbedGroup, {
|
|
1387
|
+
group,
|
|
1388
|
+
members: membersOf(group),
|
|
1389
|
+
layout: props
|
|
1390
|
+
}, group.key));
|
|
1391
|
+
else if (group.display === "footer") blocks.push(/* @__PURE__ */ jsxs("div", {
|
|
1392
|
+
className: "flex flex-col gap-4 border-t border-solid border-foreground/10 pt-4",
|
|
1393
|
+
children: [/* @__PURE__ */ jsx(GroupHeading, { group }), /* @__PURE__ */ jsx(FieldList, {
|
|
1394
|
+
members: membersOf(group),
|
|
1395
|
+
layout: props
|
|
1396
|
+
})]
|
|
1397
|
+
}, group.key));
|
|
1398
|
+
else {
|
|
1399
|
+
if (summarised && !placed.has("summary")) {
|
|
1400
|
+
placed.add("summary");
|
|
1401
|
+
blocks.push(/* @__PURE__ */ jsx(Summary, {
|
|
1402
|
+
members: sectionMembers,
|
|
1403
|
+
layout: props
|
|
1404
|
+
}, "summary"));
|
|
1405
|
+
}
|
|
1406
|
+
blocks.push(/* @__PURE__ */ jsx(Section, {
|
|
1407
|
+
group,
|
|
1408
|
+
members: membersOf(group),
|
|
1409
|
+
layout: props
|
|
1410
|
+
}, group.key));
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
flushLoose();
|
|
1414
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: blocks });
|
|
1415
|
+
}
|
|
1416
|
+
//#endregion
|
|
1417
|
+
//#region editors/workflow-editor/ui/PropertyForm.tsx
|
|
1418
|
+
function insertAtCursor(element, text) {
|
|
1419
|
+
const start = element.selectionStart ?? element.value.length;
|
|
1420
|
+
const end = element.selectionEnd ?? start;
|
|
1421
|
+
element.value = element.value.slice(0, start) + text + element.value.slice(end);
|
|
1422
|
+
return element.value;
|
|
1423
|
+
}
|
|
1424
|
+
const WHOLE_EXPRESSION = /^\{\{\s*[^{}]+?\s*\}\}$/;
|
|
1425
|
+
const DECIMAL = /^-?(?:\d+(?:\.\d*)?|\.\d+)$/;
|
|
1426
|
+
function parseDecimal(raw) {
|
|
1427
|
+
const trimmed = raw.trim();
|
|
1428
|
+
return DECIMAL.test(trimmed) ? Number(trimmed) : void 0;
|
|
1429
|
+
}
|
|
1430
|
+
function stringifyValue(value) {
|
|
1431
|
+
if (value === void 0 || value === null) return "";
|
|
1432
|
+
if (typeof value === "string") return value;
|
|
1433
|
+
try {
|
|
1434
|
+
return JSON.stringify(value, null, 2);
|
|
1435
|
+
} catch {
|
|
1436
|
+
return String(value);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
function parseDropdownResult(result) {
|
|
1440
|
+
const record = result;
|
|
1441
|
+
if (!record || !Array.isArray(record.options)) throw new Error("Unexpected options result");
|
|
1442
|
+
return {
|
|
1443
|
+
options: record.options.map((option) => ({
|
|
1444
|
+
label: stringifyValue(option.label ?? option.value),
|
|
1445
|
+
value: option.value,
|
|
1446
|
+
...typeof option.description === "string" && option.description ? { description: option.description } : {},
|
|
1447
|
+
...typeof option.icon === "string" ? { icon: option.icon } : {}
|
|
1448
|
+
})),
|
|
1449
|
+
placeholder: record.placeholder,
|
|
1450
|
+
disabled: record.disabled
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
const RELOAD_DEBOUNCE_MS = 400;
|
|
1454
|
+
const PieceMarkdown = lazy(() => import("./PieceMarkdown-DSdZd-Jc.js"));
|
|
1455
|
+
const NO_ENDPOINT = "[no endpoint yet — see Endpoint URL above]";
|
|
1456
|
+
function fillPiecePlaceholders(text, values) {
|
|
1457
|
+
return text.replace(/\{\{\s*webhookUrl\s*\}\}/g, values.webhookUrl ?? NO_ENDPOINT).replace(/\{\{\s*webhookTimeoutSeconds\s*\}\}/g, values.webhookTimeoutSeconds === void 0 ? "{{webhookTimeoutSeconds}}" : String(values.webhookTimeoutSeconds)).replace(/\{\{\s*pausedFlowTimeoutDays\s*\}\}/g, values.pausedFlowTimeoutDays === void 0 ? "the workflow's maximum suspension" : String(values.pausedFlowTimeoutDays));
|
|
1458
|
+
}
|
|
1459
|
+
const PiecePlaceholderContext = createContext({});
|
|
1460
|
+
function AvailableSoon(props) {
|
|
1461
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
1462
|
+
className: "inline-flex items-center gap-1 rounded-full bg-wf-warn/10 px-2 py-0.5 text-[11px] font-medium normal-case tracking-normal text-wf-warn",
|
|
1463
|
+
title: "Not supported by the runtime yet",
|
|
1464
|
+
children: ["Available soon", props.children ? /* @__PURE__ */ jsxs("span", { children: [": ", props.children] }) : null]
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
function FieldShell(props) {
|
|
1468
|
+
const { prop } = props;
|
|
1469
|
+
const LabelTag = props.htmlFor ? "label" : "span";
|
|
1470
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1471
|
+
className: "group/field",
|
|
1472
|
+
children: [
|
|
1473
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1474
|
+
className: "mb-1.5 flex min-h-6 items-center justify-between gap-2",
|
|
1475
|
+
children: [/* @__PURE__ */ jsxs(LabelTag, {
|
|
1476
|
+
htmlFor: props.htmlFor,
|
|
1477
|
+
className: "flex min-w-0 items-baseline gap-1.5 text-[13px] font-medium text-foreground",
|
|
1478
|
+
children: [
|
|
1479
|
+
optionIcon(prop.icon),
|
|
1480
|
+
/* @__PURE__ */ jsx("span", {
|
|
1481
|
+
className: "truncate",
|
|
1482
|
+
children: prop.displayName
|
|
1483
|
+
}),
|
|
1484
|
+
!prop.required ? /* @__PURE__ */ jsx("span", {
|
|
1485
|
+
className: "shrink-0 text-xs font-normal text-muted-foreground",
|
|
1486
|
+
children: "Optional"
|
|
1487
|
+
}) : null,
|
|
1488
|
+
props.invalid ? /* @__PURE__ */ jsx("span", {
|
|
1489
|
+
className: "shrink-0 text-xs font-normal text-wf-warn",
|
|
1490
|
+
children: "Needs a value"
|
|
1491
|
+
}) : null
|
|
1492
|
+
]
|
|
1493
|
+
}), props.picker ? /* @__PURE__ */ jsx("span", {
|
|
1494
|
+
className: "flex shrink-0 items-center gap-0.5",
|
|
1495
|
+
children: props.picker
|
|
1496
|
+
}) : null]
|
|
1497
|
+
}),
|
|
1498
|
+
props.children,
|
|
1499
|
+
/* @__PURE__ */ jsx(FieldError, { children: props.error }),
|
|
1500
|
+
/* @__PURE__ */ jsx(Hint, { text: prop.description })
|
|
1501
|
+
]
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
function OptionList(props) {
|
|
1505
|
+
const keyOf = (value) => stringifyValue(value);
|
|
1506
|
+
const byKey = new Map(props.options.map((option) => [keyOf(option.value), option]));
|
|
1507
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
1508
|
+
id: props.id,
|
|
1509
|
+
multiple: true,
|
|
1510
|
+
options: props.options.map((option) => ({
|
|
1511
|
+
value: keyOf(option.value),
|
|
1512
|
+
label: option.label
|
|
1513
|
+
})),
|
|
1514
|
+
value: props.selected.map(keyOf),
|
|
1515
|
+
onChange: (keys) => props.onChange(keys.map((key) => byKey.get(key)?.value ?? key)),
|
|
1516
|
+
invalid: props.invalid,
|
|
1517
|
+
loading: props.loading,
|
|
1518
|
+
onRefresh: props.onRefresh,
|
|
1519
|
+
placeholder: props.placeholder ?? "Choose any"
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
function OptionSelect(props) {
|
|
1523
|
+
const keyOf = (value) => stringifyValue(value);
|
|
1524
|
+
const byKey = new Map(props.options.map((option) => [keyOf(option.value), option]));
|
|
1525
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
1526
|
+
id: props.id,
|
|
1527
|
+
options: props.options.map((option) => ({
|
|
1528
|
+
value: keyOf(option.value),
|
|
1529
|
+
label: option.label,
|
|
1530
|
+
description: option.description,
|
|
1531
|
+
icon: optionIcon(option.icon)
|
|
1532
|
+
})),
|
|
1533
|
+
value: keyOf(props.value),
|
|
1534
|
+
onChange: (key) => props.onChange(key === "" ? void 0 : byKey.get(key)?.value ?? key),
|
|
1535
|
+
invalid: props.invalid,
|
|
1536
|
+
placeholder: props.placeholder,
|
|
1537
|
+
loading: props.loading,
|
|
1538
|
+
disabled: props.disabled,
|
|
1539
|
+
onRefresh: props.onRefresh,
|
|
1540
|
+
clearable: props.clearable,
|
|
1541
|
+
emptyText: props.emptyText,
|
|
1542
|
+
searchable: props.searchable,
|
|
1543
|
+
actions: props.actions,
|
|
1544
|
+
onQueryChange: props.onQueryChange
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
const SUMMARY_CHARS = 60;
|
|
1548
|
+
function itemSummary(fields, row) {
|
|
1549
|
+
const parts = [];
|
|
1550
|
+
for (const field of fields) {
|
|
1551
|
+
const value = row[field.name];
|
|
1552
|
+
if (value === true) {
|
|
1553
|
+
parts.push(field.displayName.toLowerCase());
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
if (value === void 0 || value === null || value === false) continue;
|
|
1557
|
+
const option = field.staticOptions?.find((o) => o.value === value);
|
|
1558
|
+
const text = option ? option.label : stringifyValue(value).trim();
|
|
1559
|
+
if (!text) continue;
|
|
1560
|
+
parts.push(text.length > SUMMARY_CHARS ? `${text.slice(0, SUMMARY_CHARS)}…` : text);
|
|
1561
|
+
}
|
|
1562
|
+
return parts.join(" · ");
|
|
1563
|
+
}
|
|
1564
|
+
function addItemLabel(displayName) {
|
|
1565
|
+
const name = displayName.trim().toLowerCase();
|
|
1566
|
+
if (!/^[a-z]+s$/.test(name) || name.endsWith("ss")) return "Add item";
|
|
1567
|
+
return `Add ${name.endsWith("ies") ? `${name.slice(0, -3)}y` : /(ss|x|z|ch|sh)es$/.test(name) ? name.slice(0, -2) : name.slice(0, -1)}`;
|
|
1568
|
+
}
|
|
1569
|
+
function ArrayRows(props) {
|
|
1570
|
+
const fields = props.prop.properties ?? [];
|
|
1571
|
+
const rows = Array.isArray(props.value) ? props.value.map((item) => item !== null && typeof item === "object" ? item : {}) : [];
|
|
1572
|
+
const [open, setOpen] = useState(() => /* @__PURE__ */ new Set());
|
|
1573
|
+
const toggle = (index) => setOpen((current) => {
|
|
1574
|
+
const next = new Set(current);
|
|
1575
|
+
if (!next.delete(index)) next.add(index);
|
|
1576
|
+
return next;
|
|
1577
|
+
});
|
|
1578
|
+
const update = (next) => props.onCommit(next.length > 0 ? next : void 0);
|
|
1579
|
+
const remove = (index) => {
|
|
1580
|
+
update(rows.filter((_, i) => i !== index));
|
|
1581
|
+
setOpen((current) => new Set([...current].filter((i) => i !== index).map((i) => i > index ? i - 1 : i)));
|
|
1582
|
+
};
|
|
1583
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1584
|
+
className: `flex flex-col gap-1.5 ${props.invalid ? "rounded-md ring-1 ring-wf-warn/50" : ""}`,
|
|
1585
|
+
children: [rows.map((row, index) => {
|
|
1586
|
+
const expanded = open.has(index);
|
|
1587
|
+
const summary = itemSummary(fields, row);
|
|
1588
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1589
|
+
className: "rounded-md border border-solid border-foreground/10 bg-muted/40",
|
|
1590
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1591
|
+
className: "flex items-center gap-1 py-1 pl-1 pr-1",
|
|
1592
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
1593
|
+
type: "button",
|
|
1594
|
+
"aria-expanded": expanded,
|
|
1595
|
+
onClick: () => toggle(index),
|
|
1596
|
+
className: "flex min-w-0 flex-1 items-center gap-1.5 rounded px-1 py-0.5 text-left text-[13px] hover:bg-foreground/5",
|
|
1597
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1598
|
+
name: expanded ? "chevronDown" : "chevron",
|
|
1599
|
+
className: "h-3.5 w-3.5 shrink-0 text-muted-foreground"
|
|
1600
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1601
|
+
className: `truncate ${summary ? "text-foreground" : "text-muted-foreground"}`,
|
|
1602
|
+
children: summary || `Item ${index + 1}`
|
|
1603
|
+
})]
|
|
1604
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1605
|
+
icon: "trash",
|
|
1606
|
+
label: `Remove item ${index + 1}`,
|
|
1607
|
+
onClick: () => remove(index)
|
|
1608
|
+
})]
|
|
1609
|
+
}), expanded ? /* @__PURE__ */ jsx("div", {
|
|
1610
|
+
className: "border-t border-solid border-foreground/10 px-3 pb-3 pt-2",
|
|
1611
|
+
children: /* @__PURE__ */ jsx(PropertyForm, {
|
|
1612
|
+
props: fields,
|
|
1613
|
+
value: row,
|
|
1614
|
+
onChange: (next) => update(rows.map((entry, i) => i === index ? next : entry)),
|
|
1615
|
+
scopeStepId: props.scopeStepId,
|
|
1616
|
+
nested: true
|
|
1617
|
+
})
|
|
1618
|
+
}) : null]
|
|
1619
|
+
}, index);
|
|
1620
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
1621
|
+
size: "sm",
|
|
1622
|
+
className: "self-start",
|
|
1623
|
+
onClick: () => {
|
|
1624
|
+
update([...rows, withPropDefaults(fields, {})]);
|
|
1625
|
+
setOpen((current) => new Set(current).add(rows.length));
|
|
1626
|
+
},
|
|
1627
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1628
|
+
name: "plus",
|
|
1629
|
+
className: "h-3.5 w-3.5"
|
|
1630
|
+
}), addItemLabel(props.prop.displayName)]
|
|
1631
|
+
})]
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
function rowsOf(value) {
|
|
1635
|
+
return Object.entries(value).map(([key, entry]) => ({
|
|
1636
|
+
key,
|
|
1637
|
+
value: stringifyValue(entry)
|
|
1638
|
+
}));
|
|
1639
|
+
}
|
|
1640
|
+
function recordOf(rows) {
|
|
1641
|
+
const record = {};
|
|
1642
|
+
for (const row of rows) if (row.key.trim() !== "") record[row.key.trim()] = row.value;
|
|
1643
|
+
return record;
|
|
1644
|
+
}
|
|
1645
|
+
function ObjectRows(props) {
|
|
1646
|
+
const [rows, setRows] = useState(() => rowsOf(props.value));
|
|
1647
|
+
const valueKey = keyOf(props.value);
|
|
1648
|
+
const [seen, setSeen] = useState(valueKey);
|
|
1649
|
+
if (seen !== valueKey) {
|
|
1650
|
+
setSeen(valueKey);
|
|
1651
|
+
if (keyOf(recordOf(rows)) !== valueKey) setRows(rowsOf(props.value));
|
|
1652
|
+
}
|
|
1653
|
+
const commit = (next) => {
|
|
1654
|
+
setRows(next);
|
|
1655
|
+
const record = recordOf(next);
|
|
1656
|
+
props.onCommit(Object.keys(record).length > 0 ? record : void 0);
|
|
1657
|
+
};
|
|
1658
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1659
|
+
className: `flex flex-col gap-1.5 ${props.invalid ? "rounded-md ring-1 ring-wf-warn/50" : ""}`,
|
|
1660
|
+
children: [rows.map((row, index) => /* @__PURE__ */ jsxs("div", {
|
|
1661
|
+
className: "flex items-center gap-1",
|
|
1662
|
+
children: [
|
|
1663
|
+
/* @__PURE__ */ jsx("input", {
|
|
1664
|
+
className: `${textInputClass} font-mono text-xs`,
|
|
1665
|
+
placeholder: "Key",
|
|
1666
|
+
value: row.key,
|
|
1667
|
+
onChange: (event) => setRows(rows.map((entry, i) => i === index ? {
|
|
1668
|
+
...entry,
|
|
1669
|
+
key: event.target.value
|
|
1670
|
+
} : entry)),
|
|
1671
|
+
onBlur: () => commit(rows)
|
|
1672
|
+
}),
|
|
1673
|
+
/* @__PURE__ */ jsx("input", {
|
|
1674
|
+
className: `${textInputClass} font-mono text-xs`,
|
|
1675
|
+
placeholder: "Value",
|
|
1676
|
+
value: row.value,
|
|
1677
|
+
onChange: (event) => setRows(rows.map((entry, i) => i === index ? {
|
|
1678
|
+
...entry,
|
|
1679
|
+
value: event.target.value
|
|
1680
|
+
} : entry)),
|
|
1681
|
+
onBlur: () => commit(rows)
|
|
1682
|
+
}),
|
|
1683
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
1684
|
+
icon: "close",
|
|
1685
|
+
label: "Remove entry",
|
|
1686
|
+
onClick: () => commit(rows.filter((_, i) => i !== index))
|
|
1687
|
+
})
|
|
1688
|
+
]
|
|
1689
|
+
}, index)), /* @__PURE__ */ jsxs(Button, {
|
|
1690
|
+
size: "sm",
|
|
1691
|
+
className: "self-start",
|
|
1692
|
+
onClick: () => setRows([...rows, {
|
|
1693
|
+
key: "",
|
|
1694
|
+
value: ""
|
|
1695
|
+
}]),
|
|
1696
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1697
|
+
name: "plus",
|
|
1698
|
+
className: "h-3.5 w-3.5"
|
|
1699
|
+
}), "Add entry"]
|
|
1700
|
+
})]
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
function isoToLocalInput(value) {
|
|
1704
|
+
if (typeof value !== "string" || value === "") return "";
|
|
1705
|
+
const date = new Date(value);
|
|
1706
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
1707
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
1708
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
1709
|
+
}
|
|
1710
|
+
function localInputToIso(value) {
|
|
1711
|
+
if (value === "") return void 0;
|
|
1712
|
+
const date = new Date(value);
|
|
1713
|
+
return Number.isNaN(date.getTime()) ? value : date.toISOString();
|
|
1714
|
+
}
|
|
1715
|
+
function isDropdownType(type) {
|
|
1716
|
+
return type === "DROPDOWN" || type === "MULTI_SELECT_DROPDOWN";
|
|
1717
|
+
}
|
|
1718
|
+
const SEARCH_DEBOUNCE_MS = 300;
|
|
1719
|
+
const FLIPS_TO_TEXT = /* @__PURE__ */ new Set([
|
|
1720
|
+
"DATE_TIME",
|
|
1721
|
+
"OBJECT",
|
|
1722
|
+
"DROPDOWN",
|
|
1723
|
+
"CHECKBOX",
|
|
1724
|
+
"NUMBER"
|
|
1725
|
+
]);
|
|
1726
|
+
const TEXT_MODE_TYPES = /* @__PURE__ */ new Set([
|
|
1727
|
+
"SHORT_TEXT",
|
|
1728
|
+
"LONG_TEXT",
|
|
1729
|
+
"NUMBER",
|
|
1730
|
+
"SECRET_TEXT",
|
|
1731
|
+
"FILE",
|
|
1732
|
+
"JSON",
|
|
1733
|
+
"DATE_TIME",
|
|
1734
|
+
"OBJECT",
|
|
1735
|
+
"DROPDOWN",
|
|
1736
|
+
"CHECKBOX"
|
|
1737
|
+
]);
|
|
1738
|
+
function SecretRefField(props) {
|
|
1739
|
+
const { secrets } = props;
|
|
1740
|
+
const fieldId = useId();
|
|
1741
|
+
const { ref, managed, draft, setDraft, busy, error, stat, commit } = useSecretRef({
|
|
1742
|
+
value: props.value,
|
|
1743
|
+
secrets,
|
|
1744
|
+
label: props.prop.displayName,
|
|
1745
|
+
onCommit: props.onCommit
|
|
1746
|
+
});
|
|
1747
|
+
if (!secrets) return /* @__PURE__ */ jsx(FieldShell, {
|
|
1748
|
+
htmlFor: fieldId,
|
|
1749
|
+
prop: props.prop,
|
|
1750
|
+
invalid: props.invalid,
|
|
1751
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
1752
|
+
className: "text-xs text-muted-foreground",
|
|
1753
|
+
children: "Managed secrets are unavailable in this session."
|
|
1754
|
+
})
|
|
1755
|
+
});
|
|
1756
|
+
return /* @__PURE__ */ jsxs(FieldShell, {
|
|
1757
|
+
htmlFor: fieldId,
|
|
1758
|
+
prop: props.prop,
|
|
1759
|
+
invalid: props.invalid,
|
|
1760
|
+
error,
|
|
1761
|
+
children: [managed ? /* @__PURE__ */ jsxs("p", {
|
|
1762
|
+
className: "mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
1763
|
+
children: [
|
|
1764
|
+
/* @__PURE__ */ jsx("span", {
|
|
1765
|
+
className: "font-medium text-foreground",
|
|
1766
|
+
children: stat?.label ?? ref
|
|
1767
|
+
}),
|
|
1768
|
+
stat ? /* @__PURE__ */ jsxs("span", { children: ["version ", stat.version] }) : null,
|
|
1769
|
+
stat?.status === "DELETED" ? /* @__PURE__ */ jsx("span", {
|
|
1770
|
+
className: "font-medium text-wf-fail",
|
|
1771
|
+
children: "deleted"
|
|
1772
|
+
}) : null
|
|
1773
|
+
]
|
|
1774
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
1775
|
+
className: "flex items-center gap-1",
|
|
1776
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
1777
|
+
id: fieldId,
|
|
1778
|
+
className: `${textInputClass} ${props.invalid ? invalidClass : ""}`,
|
|
1779
|
+
type: "password",
|
|
1780
|
+
value: draft,
|
|
1781
|
+
disabled: busy,
|
|
1782
|
+
placeholder: managed ? "Paste a new value to replace it" : "Paste the secret value",
|
|
1783
|
+
autoComplete: "off",
|
|
1784
|
+
spellCheck: false,
|
|
1785
|
+
onChange: (event) => setDraft(event.target.value),
|
|
1786
|
+
onKeyDown: (event) => {
|
|
1787
|
+
if (event.key === "Enter") commit();
|
|
1788
|
+
},
|
|
1789
|
+
onBlur: commit
|
|
1790
|
+
}), ref ? /* @__PURE__ */ jsx(IconButton, {
|
|
1791
|
+
icon: "close",
|
|
1792
|
+
label: "Remove secret",
|
|
1793
|
+
onClick: () => props.onCommit(void 0)
|
|
1794
|
+
}) : null]
|
|
1795
|
+
})]
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
function ModeButton(props) {
|
|
1799
|
+
return /* @__PURE__ */ jsx("button", {
|
|
1800
|
+
type: "button",
|
|
1801
|
+
className: "inline-flex h-6 shrink-0 items-center rounded-md px-1.5 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
1802
|
+
onClick: props.onClick,
|
|
1803
|
+
children: props.label
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
function PropField(props) {
|
|
1807
|
+
const { prop, value } = props;
|
|
1808
|
+
const placeholders = useContext(PiecePlaceholderContext);
|
|
1809
|
+
const fieldId = useId();
|
|
1810
|
+
const optionsUnavailable = Boolean(props.nested && prop.hasDynamicResolver && !props.loadOptions);
|
|
1811
|
+
const fieldRef = useRef(null);
|
|
1812
|
+
const invalid = prop.required && prop.type !== "MARKDOWN" && isEmptyValue(value);
|
|
1813
|
+
const [draft, setDraft] = useState(() => stringifyValue(value));
|
|
1814
|
+
const [prevValue, setPrevValue] = useState(value);
|
|
1815
|
+
if (value !== prevValue) {
|
|
1816
|
+
setPrevValue(value);
|
|
1817
|
+
setDraft(stringifyValue(value));
|
|
1818
|
+
}
|
|
1819
|
+
const [jsonError, setJsonError] = useState(null);
|
|
1820
|
+
const [textMode, setTextMode] = useState(props.mode === "EXPRESSION");
|
|
1821
|
+
const [prevMode, setPrevMode] = useState(props.mode);
|
|
1822
|
+
if (props.mode !== prevMode) {
|
|
1823
|
+
setPrevMode(props.mode);
|
|
1824
|
+
if (props.mode) setTextMode(props.mode === "EXPRESSION");
|
|
1825
|
+
}
|
|
1826
|
+
const onCommit = (next, mode) => props.onCommit(next, mode ?? (textMode ? "EXPRESSION" : "MANUAL"));
|
|
1827
|
+
const toMode = (expression) => {
|
|
1828
|
+
setTextMode(expression);
|
|
1829
|
+
props.onMode?.(expression ? "EXPRESSION" : "MANUAL");
|
|
1830
|
+
};
|
|
1831
|
+
const [numberError, setNumberError] = useState(null);
|
|
1832
|
+
const commitsOnInsert = prop.type !== "JSON";
|
|
1833
|
+
const field = useExpressionField({
|
|
1834
|
+
stepId: props.scopeStepId,
|
|
1835
|
+
label: prop.displayName,
|
|
1836
|
+
insert: (expression) => {
|
|
1837
|
+
if (FLIPS_TO_TEXT.has(prop.type) && !textMode) {
|
|
1838
|
+
setTextMode(true);
|
|
1839
|
+
setDraft(expression);
|
|
1840
|
+
setNumberError(null);
|
|
1841
|
+
onCommit(expression, "EXPRESSION");
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1844
|
+
if (!fieldRef.current) return;
|
|
1845
|
+
const next = insertAtCursor(fieldRef.current, expression);
|
|
1846
|
+
setDraft(next);
|
|
1847
|
+
if (commitsOnInsert) onCommit(next);
|
|
1848
|
+
}
|
|
1849
|
+
});
|
|
1850
|
+
const picker = TEXT_MODE_TYPES.has(prop.type) ? /* @__PURE__ */ jsx(ExpressionPickerButton, {
|
|
1851
|
+
active: field.active,
|
|
1852
|
+
onFocusField: field.focus
|
|
1853
|
+
}) : void 0;
|
|
1854
|
+
const dynamicLoad = props.loadOptions && prop.hasDynamicResolver && !props.optionsBlocked ? () => props.loadOptions(prop.name) : void 0;
|
|
1855
|
+
const isDropdown = prop.type === "DROPDOWN" || prop.type === "MULTI_SELECT_DROPDOWN";
|
|
1856
|
+
const dropdown = useResolvedProp({
|
|
1857
|
+
kind: "options",
|
|
1858
|
+
input: props.resolverInput,
|
|
1859
|
+
load: isDropdown ? dynamicLoad : void 0,
|
|
1860
|
+
parse: parseDropdownResult,
|
|
1861
|
+
debounceMs: RELOAD_DEBOUNCE_MS
|
|
1862
|
+
});
|
|
1863
|
+
const dynamic = useResolvedProp({
|
|
1864
|
+
kind: "dynamic",
|
|
1865
|
+
input: props.resolverInput,
|
|
1866
|
+
load: prop.type === "DYNAMIC" ? dynamicLoad : void 0,
|
|
1867
|
+
parse: parsePropList,
|
|
1868
|
+
debounceMs: RELOAD_DEBOUNCE_MS
|
|
1869
|
+
});
|
|
1870
|
+
const dynamicFields = dynamic.state.kind === "ready" ? dynamic.state.result : null;
|
|
1871
|
+
useEffect(() => {
|
|
1872
|
+
if (value !== void 0 || !dynamicFields) return;
|
|
1873
|
+
if (lacksDefaults(dynamicFields, {})) props.onCommit(withPropDefaults(dynamicFields, {}), "MANUAL");
|
|
1874
|
+
}, [dynamicFields]);
|
|
1875
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
1876
|
+
const [picked, setPicked] = useState(null);
|
|
1877
|
+
const loadOptions = props.loadOptions;
|
|
1878
|
+
const searchable = Boolean(prop.refreshOnSearch && loadOptions);
|
|
1879
|
+
const searchResult = useOptionSearch({
|
|
1880
|
+
input: props.resolverInput,
|
|
1881
|
+
query: searchQuery,
|
|
1882
|
+
load: searchable && loadOptions ? (searchValue) => loadOptions(prop.name, searchValue) : void 0,
|
|
1883
|
+
parse: parseDropdownResult,
|
|
1884
|
+
debounceMs: SEARCH_DEBOUNCE_MS
|
|
1885
|
+
});
|
|
1886
|
+
const onSearch = searchable ? setSearchQuery : void 0;
|
|
1887
|
+
const retryButton = (state, reload) => /* @__PURE__ */ jsx(IconButton, {
|
|
1888
|
+
icon: "retry",
|
|
1889
|
+
label: "Reload",
|
|
1890
|
+
disabled: state.kind === "loading",
|
|
1891
|
+
onClick: reload
|
|
1892
|
+
});
|
|
1893
|
+
const blocked = prop.hasDynamicResolver ? props.optionsBlocked : void 0;
|
|
1894
|
+
const loadError = (state) => blocked ?? (state.kind === "error" ? props.explainOptionsError?.(state.message) ?? state.message : null);
|
|
1895
|
+
const textInput = (extra) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
1896
|
+
className: "flex items-center gap-1",
|
|
1897
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
1898
|
+
id: fieldId,
|
|
1899
|
+
ref: fieldRef,
|
|
1900
|
+
type: extra.type ?? "text",
|
|
1901
|
+
className: `${textInputClass} ${extra.mono ? "font-mono text-xs" : ""} ${invalid ? invalidClass : ""}`,
|
|
1902
|
+
defaultValue: stringifyValue(value),
|
|
1903
|
+
placeholder: extra.placeholder ?? prop.placeholder,
|
|
1904
|
+
spellCheck: false,
|
|
1905
|
+
onFocus: field.focus,
|
|
1906
|
+
onChange: (event) => setDraft(event.target.value),
|
|
1907
|
+
onBlur: (event) => extra.commit(event.target.value)
|
|
1908
|
+
})
|
|
1909
|
+
}), extra.type === "password" ? null : /* @__PURE__ */ jsx(ExpressionTokenLine, { value: draft })] });
|
|
1910
|
+
switch (prop.type) {
|
|
1911
|
+
case "PH_SECRET_REF": return /* @__PURE__ */ jsx(SecretRefField, {
|
|
1912
|
+
prop,
|
|
1913
|
+
value,
|
|
1914
|
+
onCommit,
|
|
1915
|
+
invalid,
|
|
1916
|
+
secrets: props.secrets
|
|
1917
|
+
});
|
|
1918
|
+
case "MARKDOWN": {
|
|
1919
|
+
const markdown = fillPiecePlaceholders(stringifyValue(prop.description ?? prop.defaultValue ?? prop.displayName), {
|
|
1920
|
+
...placeholders,
|
|
1921
|
+
webhookUrl: props.webhookUrl
|
|
1922
|
+
});
|
|
1923
|
+
return /* @__PURE__ */ jsx(MarkdownCallout, {
|
|
1924
|
+
variant: prop.variant,
|
|
1925
|
+
children: /* @__PURE__ */ jsx(Suspense, {
|
|
1926
|
+
fallback: /* @__PURE__ */ jsx("p", {
|
|
1927
|
+
className: "whitespace-pre-wrap text-xs text-muted-foreground",
|
|
1928
|
+
children: markdown
|
|
1929
|
+
}),
|
|
1930
|
+
children: /* @__PURE__ */ jsx(PieceMarkdown, { text: markdown })
|
|
1931
|
+
})
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
case "CHECKBOX":
|
|
1935
|
+
if (textMode) return /* @__PURE__ */ jsx(FieldShell, {
|
|
1936
|
+
htmlFor: fieldId,
|
|
1937
|
+
prop,
|
|
1938
|
+
invalid,
|
|
1939
|
+
picker: /* @__PURE__ */ jsxs(Fragment$1, { children: [picker, /* @__PURE__ */ jsx(ModeButton, {
|
|
1940
|
+
label: "Use a switch",
|
|
1941
|
+
onClick: () => {
|
|
1942
|
+
setTextMode(false);
|
|
1943
|
+
onCommit(void 0, "MANUAL");
|
|
1944
|
+
}
|
|
1945
|
+
})] }),
|
|
1946
|
+
children: textInput({
|
|
1947
|
+
mono: true,
|
|
1948
|
+
placeholder: "{{steps.…}} yielding true or false",
|
|
1949
|
+
commit: (raw) => {
|
|
1950
|
+
const trimmed = raw.trim();
|
|
1951
|
+
if (trimmed === "") {
|
|
1952
|
+
setTextMode(false);
|
|
1953
|
+
return onCommit(void 0, "MANUAL");
|
|
1954
|
+
}
|
|
1955
|
+
onCommit(trimmed, "EXPRESSION");
|
|
1956
|
+
}
|
|
1957
|
+
})
|
|
1958
|
+
});
|
|
1959
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1960
|
+
className: "group/field flex items-start gap-1",
|
|
1961
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1962
|
+
className: "min-w-0 flex-1",
|
|
1963
|
+
children: /* @__PURE__ */ jsx(Switch, {
|
|
1964
|
+
checked: value === true,
|
|
1965
|
+
onChange: (checked) => onCommit(checked, "MANUAL"),
|
|
1966
|
+
label: prop.displayName,
|
|
1967
|
+
description: prop.description
|
|
1968
|
+
})
|
|
1969
|
+
}), picker]
|
|
1970
|
+
});
|
|
1971
|
+
case "NUMBER": {
|
|
1972
|
+
const rangeError = numberRangeError(value, prop.min, prop.max);
|
|
1973
|
+
const commitNumber = (raw) => {
|
|
1974
|
+
const trimmed = raw.trim();
|
|
1975
|
+
if (trimmed === "") {
|
|
1976
|
+
setNumberError(null);
|
|
1977
|
+
if (!textMode) return onCommit(void 0);
|
|
1978
|
+
setTextMode(false);
|
|
1979
|
+
return onCommit(void 0, "MANUAL");
|
|
1980
|
+
}
|
|
1981
|
+
if (textMode || hasExpressions(trimmed)) {
|
|
1982
|
+
setNumberError(null);
|
|
1983
|
+
setTextMode(true);
|
|
1984
|
+
return onCommit(trimmed, "EXPRESSION");
|
|
1985
|
+
}
|
|
1986
|
+
const parsed = parseDecimal(trimmed);
|
|
1987
|
+
if (parsed === void 0) {
|
|
1988
|
+
setNumberError("Not a number");
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
setNumberError(null);
|
|
1992
|
+
onCommit(parsed);
|
|
1993
|
+
};
|
|
1994
|
+
if (prop.display === "stepper" && !textMode) return /* @__PURE__ */ jsx(FieldShell, {
|
|
1995
|
+
htmlFor: fieldId,
|
|
1996
|
+
prop,
|
|
1997
|
+
invalid,
|
|
1998
|
+
picker,
|
|
1999
|
+
error: numberError ?? rangeError,
|
|
2000
|
+
children: /* @__PURE__ */ jsx(NumberStepper, {
|
|
2001
|
+
id: fieldId,
|
|
2002
|
+
value,
|
|
2003
|
+
min: prop.min,
|
|
2004
|
+
max: prop.max,
|
|
2005
|
+
step: prop.step,
|
|
2006
|
+
invalid: invalid || rangeError !== null || numberError !== null,
|
|
2007
|
+
onCommit: (next) => {
|
|
2008
|
+
setNumberError(null);
|
|
2009
|
+
onCommit(next);
|
|
2010
|
+
},
|
|
2011
|
+
onCommitText: commitNumber,
|
|
2012
|
+
onFocus: field.focus
|
|
2013
|
+
})
|
|
2014
|
+
});
|
|
2015
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
2016
|
+
htmlFor: fieldId,
|
|
2017
|
+
prop,
|
|
2018
|
+
invalid,
|
|
2019
|
+
picker,
|
|
2020
|
+
error: numberError ?? (textMode ? null : rangeError),
|
|
2021
|
+
children: textInput({
|
|
2022
|
+
mono: textMode,
|
|
2023
|
+
placeholder: textMode ? "{{expression}} yielding a number" : prop.placeholder ?? numberRangeText(prop.min, prop.max) ?? void 0,
|
|
2024
|
+
commit: commitNumber
|
|
2025
|
+
})
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
case "SECRET_TEXT": return /* @__PURE__ */ jsx(FieldShell, {
|
|
2029
|
+
htmlFor: fieldId,
|
|
2030
|
+
prop,
|
|
2031
|
+
invalid,
|
|
2032
|
+
picker,
|
|
2033
|
+
children: textInput({
|
|
2034
|
+
type: "password",
|
|
2035
|
+
commit: (raw) => onCommit(raw === "" ? void 0 : raw)
|
|
2036
|
+
})
|
|
2037
|
+
});
|
|
2038
|
+
case "FILE": return /* @__PURE__ */ jsx(FieldShell, {
|
|
2039
|
+
htmlFor: fieldId,
|
|
2040
|
+
prop,
|
|
2041
|
+
invalid,
|
|
2042
|
+
picker,
|
|
2043
|
+
children: textInput({
|
|
2044
|
+
mono: true,
|
|
2045
|
+
placeholder: prop.placeholder ?? "https://… or data:…;base64,…",
|
|
2046
|
+
commit: (raw) => onCommit(raw.trim() === "" ? void 0 : raw.trim())
|
|
2047
|
+
})
|
|
2048
|
+
});
|
|
2049
|
+
case "DATE_TIME":
|
|
2050
|
+
if (textMode) return /* @__PURE__ */ jsx(FieldShell, {
|
|
2051
|
+
htmlFor: fieldId,
|
|
2052
|
+
prop,
|
|
2053
|
+
invalid,
|
|
2054
|
+
picker,
|
|
2055
|
+
children: textInput({
|
|
2056
|
+
mono: true,
|
|
2057
|
+
placeholder: "ISO 8601 or {{expression}}",
|
|
2058
|
+
commit: (raw) => {
|
|
2059
|
+
const trimmed = raw.trim();
|
|
2060
|
+
if (trimmed === "") {
|
|
2061
|
+
setTextMode(false);
|
|
2062
|
+
return onCommit(void 0, "MANUAL");
|
|
2063
|
+
}
|
|
2064
|
+
onCommit(hasExpressions(trimmed) ? trimmed : localInputToIso(trimmed));
|
|
2065
|
+
}
|
|
2066
|
+
})
|
|
2067
|
+
});
|
|
2068
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
2069
|
+
htmlFor: fieldId,
|
|
2070
|
+
prop,
|
|
2071
|
+
invalid,
|
|
2072
|
+
picker,
|
|
2073
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
2074
|
+
id: fieldId,
|
|
2075
|
+
type: "datetime-local",
|
|
2076
|
+
className: `${textInputClass} ${invalid ? invalidClass : ""}`,
|
|
2077
|
+
defaultValue: isoToLocalInput(value),
|
|
2078
|
+
onFocus: field.focus,
|
|
2079
|
+
onBlur: (event) => onCommit(localInputToIso(event.target.value))
|
|
2080
|
+
})
|
|
2081
|
+
});
|
|
2082
|
+
case "STATIC_DROPDOWN": {
|
|
2083
|
+
const options = prop.staticOptions ?? [];
|
|
2084
|
+
if (prop.display === "cards") return /* @__PURE__ */ jsx(FieldShell, {
|
|
2085
|
+
htmlFor: fieldId,
|
|
2086
|
+
prop,
|
|
2087
|
+
invalid,
|
|
2088
|
+
children: /* @__PURE__ */ jsx(OptionCards, {
|
|
2089
|
+
id: fieldId,
|
|
2090
|
+
options,
|
|
2091
|
+
value,
|
|
2092
|
+
keyOf: stringifyValue,
|
|
2093
|
+
onChange: onCommit,
|
|
2094
|
+
invalid,
|
|
2095
|
+
clearable: !prop.required
|
|
2096
|
+
})
|
|
2097
|
+
});
|
|
2098
|
+
if (!prop.staticDisabled && prop.required !== true && prop.defaultValue !== void 0 && options.length >= 2 && options.length <= 3 && options.every((option) => option.label.length <= 22)) return /* @__PURE__ */ jsx(FieldShell, {
|
|
2099
|
+
htmlFor: fieldId,
|
|
2100
|
+
prop,
|
|
2101
|
+
invalid: false,
|
|
2102
|
+
children: /* @__PURE__ */ jsx(Segmented, {
|
|
2103
|
+
value: stringifyValue(value),
|
|
2104
|
+
options: options.map((option) => ({
|
|
2105
|
+
value: stringifyValue(option.value),
|
|
2106
|
+
label: option.label
|
|
2107
|
+
})),
|
|
2108
|
+
onChange: (key) => onCommit(options.find((option) => stringifyValue(option.value) === key)?.value ?? key)
|
|
2109
|
+
})
|
|
2110
|
+
});
|
|
2111
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
2112
|
+
htmlFor: fieldId,
|
|
2113
|
+
prop,
|
|
2114
|
+
invalid,
|
|
2115
|
+
children: /* @__PURE__ */ jsx(OptionSelect, {
|
|
2116
|
+
id: fieldId,
|
|
2117
|
+
options: prop.staticOptions ?? [],
|
|
2118
|
+
value,
|
|
2119
|
+
onChange: onCommit,
|
|
2120
|
+
invalid,
|
|
2121
|
+
placeholder: prop.staticPlaceholder ?? prop.placeholder,
|
|
2122
|
+
disabled: prop.staticDisabled && isEmptyValue(value),
|
|
2123
|
+
clearable: !prop.required
|
|
2124
|
+
})
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
case "STATIC_MULTI_SELECT_DROPDOWN": return /* @__PURE__ */ jsx(FieldShell, {
|
|
2128
|
+
htmlFor: fieldId,
|
|
2129
|
+
prop,
|
|
2130
|
+
invalid,
|
|
2131
|
+
children: /* @__PURE__ */ jsx(OptionList, {
|
|
2132
|
+
id: fieldId,
|
|
2133
|
+
options: prop.staticOptions ?? [],
|
|
2134
|
+
selected: Array.isArray(value) ? value : [],
|
|
2135
|
+
onChange: (next) => onCommit(next.length > 0 ? next : void 0),
|
|
2136
|
+
invalid
|
|
2137
|
+
})
|
|
2138
|
+
});
|
|
2139
|
+
case "DROPDOWN": {
|
|
2140
|
+
if (textMode) return /* @__PURE__ */ jsx(FieldShell, {
|
|
2141
|
+
htmlFor: fieldId,
|
|
2142
|
+
prop,
|
|
2143
|
+
invalid,
|
|
2144
|
+
picker: /* @__PURE__ */ jsxs(Fragment$1, { children: [picker, /* @__PURE__ */ jsx(ModeButton, {
|
|
2145
|
+
label: "Pick from list",
|
|
2146
|
+
onClick: () => {
|
|
2147
|
+
if (hasExpressions(value)) {
|
|
2148
|
+
setTextMode(false);
|
|
2149
|
+
onCommit(void 0, "MANUAL");
|
|
2150
|
+
} else toMode(false);
|
|
2151
|
+
}
|
|
2152
|
+
})] }),
|
|
2153
|
+
children: textInput({
|
|
2154
|
+
mono: true,
|
|
2155
|
+
placeholder: "{{steps.…}} or an id",
|
|
2156
|
+
commit: (raw) => onCommit(raw.trim() === "" ? void 0 : raw)
|
|
2157
|
+
})
|
|
2158
|
+
});
|
|
2159
|
+
const result = searchResult ?? (dropdown.state.kind === "ready" ? dropdown.state.result : null);
|
|
2160
|
+
const listed = result?.options ?? [];
|
|
2161
|
+
const options = picked !== null && stringifyValue(picked.value) === stringifyValue(value) && !listed.some((option) => stringifyValue(option.value) === stringifyValue(value)) ? [...listed, picked] : listed;
|
|
2162
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
2163
|
+
htmlFor: fieldId,
|
|
2164
|
+
prop,
|
|
2165
|
+
invalid,
|
|
2166
|
+
error: loadError(dropdown.state),
|
|
2167
|
+
picker: optionsUnavailable ? /* @__PURE__ */ jsx(AvailableSoon, {}) : picker,
|
|
2168
|
+
children: /* @__PURE__ */ jsx(OptionSelect, {
|
|
2169
|
+
id: fieldId,
|
|
2170
|
+
options,
|
|
2171
|
+
value,
|
|
2172
|
+
onChange: (next) => {
|
|
2173
|
+
setPicked(listed.find((option) => stringifyValue(option.value) === stringifyValue(next)) ?? null);
|
|
2174
|
+
onCommit(next);
|
|
2175
|
+
},
|
|
2176
|
+
invalid,
|
|
2177
|
+
loading: dropdown.state.kind === "loading",
|
|
2178
|
+
disabled: result?.disabled && !stringifyValue(value) || optionsUnavailable,
|
|
2179
|
+
onRefresh: dynamicLoad ? dropdown.reload : void 0,
|
|
2180
|
+
clearable: !prop.required,
|
|
2181
|
+
searchable: true,
|
|
2182
|
+
onQueryChange: onSearch,
|
|
2183
|
+
actions: [{
|
|
2184
|
+
label: "Use data from an earlier step",
|
|
2185
|
+
icon: "braces",
|
|
2186
|
+
onSelect: () => {
|
|
2187
|
+
toMode(true);
|
|
2188
|
+
field.focus();
|
|
2189
|
+
}
|
|
2190
|
+
}],
|
|
2191
|
+
emptyText: result?.placeholder ?? "Nothing to choose from yet. Some lists need a connection first.",
|
|
2192
|
+
placeholder: optionsUnavailable ? "Options for nested fields are available soon" : dropdown.syncing ? "Waiting for the Switchboard…" : result?.placeholder ?? prop.placeholder ?? "Choose…"
|
|
2193
|
+
})
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2196
|
+
case "MULTI_SELECT_DROPDOWN": {
|
|
2197
|
+
const result = dropdown.state.kind === "ready" ? dropdown.state.result : null;
|
|
2198
|
+
const selected = Array.isArray(value) ? value : [];
|
|
2199
|
+
const listed = new Set((result?.options ?? []).map((o) => stringifyValue(o.value)));
|
|
2200
|
+
const extra = selected.filter((entry) => !listed.has(stringifyValue(entry))).map((entry) => ({
|
|
2201
|
+
label: stringifyValue(entry),
|
|
2202
|
+
value: entry
|
|
2203
|
+
}));
|
|
2204
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
2205
|
+
htmlFor: fieldId,
|
|
2206
|
+
prop,
|
|
2207
|
+
invalid,
|
|
2208
|
+
error: loadError(dropdown.state),
|
|
2209
|
+
picker: optionsUnavailable ? /* @__PURE__ */ jsx(AvailableSoon, {}) : void 0,
|
|
2210
|
+
children: optionsUnavailable ? /* @__PURE__ */ jsx("p", {
|
|
2211
|
+
className: "text-xs text-muted-foreground",
|
|
2212
|
+
children: "Options for nested fields are available soon."
|
|
2213
|
+
}) : /* @__PURE__ */ jsx(OptionList, {
|
|
2214
|
+
id: fieldId,
|
|
2215
|
+
options: [...extra, ...result?.options ?? []],
|
|
2216
|
+
selected,
|
|
2217
|
+
onChange: (next) => onCommit(next.length > 0 ? next : void 0),
|
|
2218
|
+
invalid,
|
|
2219
|
+
loading: dropdown.state.kind === "loading",
|
|
2220
|
+
onRefresh: dynamicLoad ? dropdown.reload : void 0,
|
|
2221
|
+
placeholder: result?.placeholder ?? prop.placeholder
|
|
2222
|
+
})
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
case "DYNAMIC": {
|
|
2226
|
+
const fields = dynamic.state.kind === "ready" ? dynamic.state.result : null;
|
|
2227
|
+
const record = value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
2228
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
2229
|
+
htmlFor: fieldId,
|
|
2230
|
+
prop,
|
|
2231
|
+
invalid: invalid && fields !== null && fields.length > 0,
|
|
2232
|
+
error: loadError(dynamic.state),
|
|
2233
|
+
picker: optionsUnavailable ? /* @__PURE__ */ jsx(AvailableSoon, {}) : dynamicLoad ? retryButton(dynamic.state, dynamic.reload) : void 0,
|
|
2234
|
+
children: optionsUnavailable ? /* @__PURE__ */ jsx("p", {
|
|
2235
|
+
className: "text-xs text-muted-foreground",
|
|
2236
|
+
children: "Nested dynamic properties are available soon."
|
|
2237
|
+
}) : dynamic.state.kind === "loading" && !fields ? /* @__PURE__ */ jsx("p", {
|
|
2238
|
+
className: "text-xs text-muted-foreground",
|
|
2239
|
+
children: "Resolving properties…"
|
|
2240
|
+
}) : !dynamicLoad ? /* @__PURE__ */ jsx("p", {
|
|
2241
|
+
className: "text-xs text-muted-foreground",
|
|
2242
|
+
children: "Properties resolve once the runtime is reachable."
|
|
2243
|
+
}) : fields && fields.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
2244
|
+
className: "rounded-lg border border-solid border-foreground/10 bg-muted/40 p-3",
|
|
2245
|
+
children: /* @__PURE__ */ jsx(PropertyForm, {
|
|
2246
|
+
props: fields,
|
|
2247
|
+
value: record,
|
|
2248
|
+
onChange: (next) => onCommit(Object.keys(next).length > 0 ? next : void 0),
|
|
2249
|
+
scopeStepId: props.scopeStepId,
|
|
2250
|
+
nested: true
|
|
2251
|
+
})
|
|
2252
|
+
}) : fields ? /* @__PURE__ */ jsx("p", {
|
|
2253
|
+
className: "text-xs text-muted-foreground",
|
|
2254
|
+
children: props.waitingOn ? `Pick ${props.waitingOn} first; its fields show here.` : "No properties for the current selection."
|
|
2255
|
+
}) : null
|
|
2256
|
+
});
|
|
2257
|
+
}
|
|
2258
|
+
case "ARRAY": {
|
|
2259
|
+
if (prop.properties && prop.properties.length > 0) return /* @__PURE__ */ jsx(FieldShell, {
|
|
2260
|
+
htmlFor: fieldId,
|
|
2261
|
+
prop,
|
|
2262
|
+
invalid,
|
|
2263
|
+
children: /* @__PURE__ */ jsx(ArrayRows, {
|
|
2264
|
+
prop,
|
|
2265
|
+
value,
|
|
2266
|
+
onCommit,
|
|
2267
|
+
scopeStepId: props.scopeStepId,
|
|
2268
|
+
invalid
|
|
2269
|
+
})
|
|
2270
|
+
});
|
|
2271
|
+
if (textMode) return /* @__PURE__ */ jsx(FieldShell, {
|
|
2272
|
+
htmlFor: fieldId,
|
|
2273
|
+
prop,
|
|
2274
|
+
invalid,
|
|
2275
|
+
picker: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ExpressionPickerButton, {
|
|
2276
|
+
active: field.active,
|
|
2277
|
+
onFocusField: field.focus
|
|
2278
|
+
}), /* @__PURE__ */ jsx(ModeButton, {
|
|
2279
|
+
label: "Enter items",
|
|
2280
|
+
onClick: () => {
|
|
2281
|
+
setTextMode(false);
|
|
2282
|
+
const bound = stringifyValue(value).trim();
|
|
2283
|
+
onCommit(bound ? [bound] : void 0, "MANUAL");
|
|
2284
|
+
}
|
|
2285
|
+
})] }),
|
|
2286
|
+
children: textInput({
|
|
2287
|
+
mono: true,
|
|
2288
|
+
placeholder: "{{steps.…}} yielding a list",
|
|
2289
|
+
commit: (raw) => onCommit(raw.trim() === "" ? void 0 : raw.trim(), "EXPRESSION")
|
|
2290
|
+
})
|
|
2291
|
+
});
|
|
2292
|
+
const lines = Array.isArray(value) ? value.map((item) => stringifyValue(item)).join("\n") : stringifyValue(value);
|
|
2293
|
+
return /* @__PURE__ */ jsxs(FieldShell, {
|
|
2294
|
+
htmlFor: fieldId,
|
|
2295
|
+
prop,
|
|
2296
|
+
invalid,
|
|
2297
|
+
picker: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ExpressionPickerButton, {
|
|
2298
|
+
active: field.active,
|
|
2299
|
+
onFocusField: field.focus
|
|
2300
|
+
}), /* @__PURE__ */ jsx(ModeButton, {
|
|
2301
|
+
label: "Bind the whole list",
|
|
2302
|
+
onClick: () => {
|
|
2303
|
+
setTextMode(true);
|
|
2304
|
+
onCommit(void 0, "EXPRESSION");
|
|
2305
|
+
}
|
|
2306
|
+
})] }),
|
|
2307
|
+
children: [/* @__PURE__ */ jsx("textarea", {
|
|
2308
|
+
id: fieldId,
|
|
2309
|
+
ref: fieldRef,
|
|
2310
|
+
className: `${textAreaClass} font-mono text-xs ${invalid ? invalidClass : ""}`,
|
|
2311
|
+
defaultValue: lines,
|
|
2312
|
+
placeholder: prop.placeholder ?? "One item per line",
|
|
2313
|
+
spellCheck: false,
|
|
2314
|
+
onFocus: field.focus,
|
|
2315
|
+
onChange: (event) => setDraft(event.target.value),
|
|
2316
|
+
onBlur: (event) => {
|
|
2317
|
+
const items = event.target.value.split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
2318
|
+
if (items.length === 0) return onCommit(void 0);
|
|
2319
|
+
onCommit(items);
|
|
2320
|
+
}
|
|
2321
|
+
}), /* @__PURE__ */ jsx(ExpressionTokenLine, { value: draft })]
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2324
|
+
case "OBJECT":
|
|
2325
|
+
if (textMode) return /* @__PURE__ */ jsx(FieldShell, {
|
|
2326
|
+
htmlFor: fieldId,
|
|
2327
|
+
prop,
|
|
2328
|
+
invalid,
|
|
2329
|
+
picker,
|
|
2330
|
+
children: textInput({
|
|
2331
|
+
mono: true,
|
|
2332
|
+
placeholder: "{{expression}} yielding an object",
|
|
2333
|
+
commit: (raw) => {
|
|
2334
|
+
const trimmed = raw.trim();
|
|
2335
|
+
if (trimmed === "") {
|
|
2336
|
+
setTextMode(false);
|
|
2337
|
+
return onCommit(void 0, "MANUAL");
|
|
2338
|
+
}
|
|
2339
|
+
onCommit(trimmed);
|
|
2340
|
+
}
|
|
2341
|
+
})
|
|
2342
|
+
});
|
|
2343
|
+
return /* @__PURE__ */ jsx(FieldShell, {
|
|
2344
|
+
htmlFor: fieldId,
|
|
2345
|
+
prop,
|
|
2346
|
+
invalid,
|
|
2347
|
+
picker,
|
|
2348
|
+
children: /* @__PURE__ */ jsx(ObjectRows, {
|
|
2349
|
+
value: value !== null && typeof value === "object" && !Array.isArray(value) ? value : {},
|
|
2350
|
+
onCommit,
|
|
2351
|
+
invalid
|
|
2352
|
+
})
|
|
2353
|
+
});
|
|
2354
|
+
case "DATE_RANGE": return /* @__PURE__ */ jsx(FieldShell, {
|
|
2355
|
+
htmlFor: fieldId,
|
|
2356
|
+
prop,
|
|
2357
|
+
invalid,
|
|
2358
|
+
children: /* @__PURE__ */ jsx(DateRangeField, {
|
|
2359
|
+
id: fieldId,
|
|
2360
|
+
value,
|
|
2361
|
+
dropdown: prop.display === "dropdown",
|
|
2362
|
+
invalid,
|
|
2363
|
+
clearable: !prop.required,
|
|
2364
|
+
onCommit
|
|
2365
|
+
})
|
|
2366
|
+
});
|
|
2367
|
+
case "COLOR": return /* @__PURE__ */ jsx(FieldShell, {
|
|
2368
|
+
htmlFor: fieldId,
|
|
2369
|
+
prop,
|
|
2370
|
+
invalid,
|
|
2371
|
+
picker,
|
|
2372
|
+
children: /* @__PURE__ */ jsx(ColorField, {
|
|
2373
|
+
id: fieldId,
|
|
2374
|
+
value,
|
|
2375
|
+
invalid,
|
|
2376
|
+
onCommit,
|
|
2377
|
+
onFocus: field.focus
|
|
2378
|
+
})
|
|
2379
|
+
});
|
|
2380
|
+
case "RICH_TEXT":
|
|
2381
|
+
case "LONG_TEXT":
|
|
2382
|
+
case "CUSTOM":
|
|
2383
|
+
case "JSON": {
|
|
2384
|
+
const isJson = prop.type === "JSON" || prop.type === "CUSTOM";
|
|
2385
|
+
const mode = prop.type === "RICH_TEXT" ? richTextMode(prop.formatProperty ? props.config?.[prop.formatProperty] : "") : null;
|
|
2386
|
+
return /* @__PURE__ */ jsxs(FieldShell, {
|
|
2387
|
+
htmlFor: fieldId,
|
|
2388
|
+
prop,
|
|
2389
|
+
invalid,
|
|
2390
|
+
picker: mode ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
2391
|
+
className: "rounded bg-muted px-1.5 text-[11px] text-muted-foreground",
|
|
2392
|
+
children: mode === "html" ? "HTML" : mode === "markdown" ? "Markdown" : "Plain text"
|
|
2393
|
+
}), picker] }) : picker,
|
|
2394
|
+
error: jsonError,
|
|
2395
|
+
children: [/* @__PURE__ */ jsx("textarea", {
|
|
2396
|
+
id: fieldId,
|
|
2397
|
+
ref: fieldRef,
|
|
2398
|
+
className: `${textAreaClass} ${isJson || mode === "html" || prop.display === "code" ? "font-mono text-xs" : ""} ${mode ? "min-h-32" : ""} ${invalid ? invalidClass : ""}`,
|
|
2399
|
+
defaultValue: stringifyValue(value),
|
|
2400
|
+
placeholder: prop.placeholder,
|
|
2401
|
+
spellCheck: false,
|
|
2402
|
+
onFocus: field.focus,
|
|
2403
|
+
onChange: (event) => setDraft(event.target.value),
|
|
2404
|
+
onBlur: (event) => {
|
|
2405
|
+
const raw = event.target.value;
|
|
2406
|
+
if (!isJson) return onCommit(raw === "" ? void 0 : raw);
|
|
2407
|
+
const trimmed = raw.trim();
|
|
2408
|
+
if (trimmed === "") {
|
|
2409
|
+
setJsonError(null);
|
|
2410
|
+
return onCommit(void 0);
|
|
2411
|
+
}
|
|
2412
|
+
if (WHOLE_EXPRESSION.test(trimmed)) {
|
|
2413
|
+
setJsonError(null);
|
|
2414
|
+
return onCommit(trimmed);
|
|
2415
|
+
}
|
|
2416
|
+
try {
|
|
2417
|
+
onCommit(JSON.parse(trimmed));
|
|
2418
|
+
setJsonError(null);
|
|
2419
|
+
} catch {
|
|
2420
|
+
setJsonError("Not valid JSON, so it wasn't saved.");
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}), /* @__PURE__ */ jsx(ExpressionTokenLine, { value: draft })]
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2426
|
+
default: return /* @__PURE__ */ jsxs(FieldShell, {
|
|
2427
|
+
htmlFor: fieldId,
|
|
2428
|
+
prop,
|
|
2429
|
+
invalid,
|
|
2430
|
+
picker,
|
|
2431
|
+
children: [prop.emptyChoice && value === "" ? null : textInput({ commit: (raw) => onCommit(raw === "" ? void 0 : raw) }), prop.emptyChoice ? /* @__PURE__ */ jsxs("label", {
|
|
2432
|
+
className: "mt-1.5 flex items-center gap-2 text-xs text-muted-foreground",
|
|
2433
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
2434
|
+
type: "checkbox",
|
|
2435
|
+
className: "h-3.5 w-3.5 accent-current",
|
|
2436
|
+
checked: value === "",
|
|
2437
|
+
onChange: (event) => onCommit(event.target.checked ? "" : void 0, "MANUAL")
|
|
2438
|
+
}), prop.emptyChoice]
|
|
2439
|
+
}) : null]
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
const NO_BLOCK = {
|
|
2444
|
+
pieceName: "",
|
|
2445
|
+
pieceVersion: "",
|
|
2446
|
+
kind: "action",
|
|
2447
|
+
name: ""
|
|
2448
|
+
};
|
|
2449
|
+
function PropertyForm(props) {
|
|
2450
|
+
const echo = usePendingEcho({
|
|
2451
|
+
value: props.value,
|
|
2452
|
+
settings: props.settings ?? null
|
|
2453
|
+
}, (next, shown) => {
|
|
2454
|
+
if (next.settings !== shown.settings) props.onChange(next.value, next.settings ?? []);
|
|
2455
|
+
else props.onChange(next.value);
|
|
2456
|
+
});
|
|
2457
|
+
const { value: current, settings } = echo.value;
|
|
2458
|
+
const tracksSettings = props.writesSettings === true;
|
|
2459
|
+
const readDynamic = useDynamicCache();
|
|
2460
|
+
const withResolvedSchemas = (list, config) => {
|
|
2461
|
+
let next = list;
|
|
2462
|
+
for (const prop of props.props) {
|
|
2463
|
+
if (prop.type !== "DYNAMIC") continue;
|
|
2464
|
+
if (settingFor(next, prop.name)?.mode === "EXPRESSION") continue;
|
|
2465
|
+
const fields = readDynamic(resolverInputFor(props.block ?? NO_BLOCK, prop, config, props.connectionId, props.reactorConnectionId));
|
|
2466
|
+
if (!fields) continue;
|
|
2467
|
+
const schema = stripOptions(fields);
|
|
2468
|
+
const stored = settingFor(next, prop.name)?.schema ?? null;
|
|
2469
|
+
if (JSON.stringify(stored) === JSON.stringify(schema)) continue;
|
|
2470
|
+
next = withSetting(next, prop.name, { schema });
|
|
2471
|
+
}
|
|
2472
|
+
return next;
|
|
2473
|
+
};
|
|
2474
|
+
const commitField = (name, value, mode) => {
|
|
2475
|
+
const next = { ...current };
|
|
2476
|
+
if (value === void 0) delete next[name];
|
|
2477
|
+
else next[name] = value;
|
|
2478
|
+
let nextSettings = settings;
|
|
2479
|
+
const nextMode = mode ?? settingFor(settings, name)?.mode ?? "MANUAL";
|
|
2480
|
+
if (tracksSettings && settingFor(settings, name)?.mode !== nextMode) nextSettings = withSetting(nextSettings, name, { mode: nextMode });
|
|
2481
|
+
if (value !== current[name]) for (const dependent of props.props) {
|
|
2482
|
+
if (!dependent.refreshers?.includes(name)) continue;
|
|
2483
|
+
if (isDropdownType(dependent.type)) delete next[dependent.name];
|
|
2484
|
+
if (tracksSettings && dependent.type === "DYNAMIC" && settingFor(nextSettings, dependent.name)?.schema != null) nextSettings = withSetting(nextSettings, dependent.name, { schema: null });
|
|
2485
|
+
}
|
|
2486
|
+
if (tracksSettings) nextSettings = withResolvedSchemas(nextSettings, next);
|
|
2487
|
+
echo.commit({
|
|
2488
|
+
value: next,
|
|
2489
|
+
settings: nextSettings
|
|
2490
|
+
});
|
|
2491
|
+
};
|
|
2492
|
+
const setMode = (name, mode) => {
|
|
2493
|
+
if (!tracksSettings || settingFor(settings, name)?.mode === mode) return;
|
|
2494
|
+
echo.commit({
|
|
2495
|
+
value: current,
|
|
2496
|
+
settings: withResolvedSchemas(withSetting(settings, name, { mode }), current)
|
|
2497
|
+
});
|
|
2498
|
+
};
|
|
2499
|
+
const visible = props.props.filter((prop) => isPropVisible(prop, current));
|
|
2500
|
+
const kept = essentialNames(props.props, props.groups);
|
|
2501
|
+
const essential = visible.filter((prop) => !prop.advanced || kept.has(prop.name));
|
|
2502
|
+
const advanced = visible.filter((prop) => prop.advanced && !kept.has(prop.name));
|
|
2503
|
+
const [showAdvanced, setShowAdvanced] = useState(false);
|
|
2504
|
+
const advancedSet = advanced.filter((prop) => current[prop.name] !== void 0).length;
|
|
2505
|
+
const field = (prop) => /* @__PURE__ */ jsx(PropField, {
|
|
2506
|
+
prop,
|
|
2507
|
+
value: current[prop.name],
|
|
2508
|
+
onCommit: (value, mode) => commitField(prop.name, value, mode),
|
|
2509
|
+
mode: settingFor(settings, prop.name)?.mode,
|
|
2510
|
+
onMode: (mode) => setMode(prop.name, mode),
|
|
2511
|
+
loadOptions: props.loadOptions ? (propName, searchValue) => props.loadOptions(propName, current, searchValue) : void 0,
|
|
2512
|
+
config: current,
|
|
2513
|
+
secrets: props.secrets,
|
|
2514
|
+
scopeStepId: props.scopeStepId,
|
|
2515
|
+
optionsBlocked: props.optionsBlocked,
|
|
2516
|
+
explainOptionsError: props.explainOptionsError,
|
|
2517
|
+
resolverInput: resolverInputFor(props.block ?? NO_BLOCK, prop, current, props.connectionId, props.reactorConnectionId),
|
|
2518
|
+
waitingOn: props.props.find((sibling) => prop.refreshers?.includes(sibling.name) && isEmptyValue(current[sibling.name]))?.displayName,
|
|
2519
|
+
nested: props.nested,
|
|
2520
|
+
webhookUrl: props.webhookUrl
|
|
2521
|
+
}, prop.name);
|
|
2522
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2523
|
+
className: `flex flex-col ${props.nested ? "gap-3" : "gap-5"}`,
|
|
2524
|
+
onBlur: echo.onBlur,
|
|
2525
|
+
children: [/* @__PURE__ */ jsx(PropLayout, {
|
|
2526
|
+
props: essential,
|
|
2527
|
+
groups: props.groups,
|
|
2528
|
+
values: current,
|
|
2529
|
+
renderField: field,
|
|
2530
|
+
onCommit: commitField
|
|
2531
|
+
}), advanced.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
2532
|
+
className: "flex flex-col gap-5 border-t border-solid border-foreground/10 pt-4",
|
|
2533
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
2534
|
+
type: "button",
|
|
2535
|
+
className: "-mx-1 flex items-center gap-1.5 self-start rounded px-1 text-[13px] font-medium text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
2536
|
+
"aria-expanded": showAdvanced,
|
|
2537
|
+
onClick: () => setShowAdvanced((open) => !open),
|
|
2538
|
+
children: [
|
|
2539
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
2540
|
+
name: "chevron",
|
|
2541
|
+
className: `h-3.5 w-3.5 transition-transform ${showAdvanced ? "rotate-90" : ""}`
|
|
2542
|
+
}),
|
|
2543
|
+
"More options",
|
|
2544
|
+
/* @__PURE__ */ jsx("span", {
|
|
2545
|
+
className: "font-normal",
|
|
2546
|
+
children: advancedSet > 0 ? `${advanced.length} fields, ${advancedSet} set` : `${advanced.length} fields`
|
|
2547
|
+
})
|
|
2548
|
+
]
|
|
2549
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2550
|
+
hidden: !showAdvanced,
|
|
2551
|
+
className: "flex flex-col gap-5",
|
|
2552
|
+
children: /* @__PURE__ */ jsx(PropLayout, {
|
|
2553
|
+
props: advanced,
|
|
2554
|
+
groups: props.groups,
|
|
2555
|
+
values: current,
|
|
2556
|
+
renderField: field,
|
|
2557
|
+
onCommit: commitField
|
|
2558
|
+
})
|
|
2559
|
+
})]
|
|
2560
|
+
}) : null]
|
|
2561
|
+
});
|
|
2562
|
+
}
|
|
2563
|
+
//#endregion
|
|
2564
|
+
//#region editors/workflow-editor/ui/model.ts
|
|
2565
|
+
const VARIABLES_VIEW = "__variables";
|
|
2566
|
+
/** Query params of the editor's view: the open panel and its tab. */
|
|
2567
|
+
const STEP_PARAM = "step";
|
|
2568
|
+
function hasDraftChanges(model) {
|
|
2569
|
+
return !model.published || model.published.version !== model.version;
|
|
2570
|
+
}
|
|
2571
|
+
function uniqueStepKey(taken, label) {
|
|
2572
|
+
const base = label.toLowerCase().replaceAll(/[^a-z0-9]+/g, "_").replaceAll(/^_+|_+$/g, "") || "step";
|
|
2573
|
+
const keys = new Set(taken);
|
|
2574
|
+
let key = base;
|
|
2575
|
+
let suffix = 2;
|
|
2576
|
+
while (keys.has(key)) key = `${base}_${suffix++}`;
|
|
2577
|
+
return key;
|
|
2578
|
+
}
|
|
2579
|
+
//#endregion
|
|
2580
|
+
//#region editors/workflow-editor/ui/PublishControls.tsx
|
|
2581
|
+
function blockedReason(readiness) {
|
|
2582
|
+
if (!readiness.hasTrigger) return "Add a trigger first";
|
|
2583
|
+
if (readiness.firstIncomplete) return "You have incomplete steps";
|
|
2584
|
+
return "Checking the steps…";
|
|
2585
|
+
}
|
|
2586
|
+
function usePublish(callbacks) {
|
|
2587
|
+
const [publishing, setPublishing] = useState(false);
|
|
2588
|
+
const [error, setError] = useState(null);
|
|
2589
|
+
const publish = () => {
|
|
2590
|
+
if (publishing) return;
|
|
2591
|
+
setPublishing(true);
|
|
2592
|
+
setError(null);
|
|
2593
|
+
callbacks.publish().catch((cause) => setError(cause instanceof Error ? cause.message : String(cause))).finally(() => setPublishing(false));
|
|
2594
|
+
};
|
|
2595
|
+
return {
|
|
2596
|
+
publishing,
|
|
2597
|
+
error,
|
|
2598
|
+
publish
|
|
2599
|
+
};
|
|
2600
|
+
}
|
|
2601
|
+
function PublishButton(props) {
|
|
2602
|
+
const { model, readiness } = props;
|
|
2603
|
+
if (props.signIn?.required) return /* @__PURE__ */ jsx(Tooltip, {
|
|
2604
|
+
content: "This Switchboard enforces document permissions, so a publish must be signed",
|
|
2605
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
2606
|
+
size: props.size ?? "sm",
|
|
2607
|
+
variant: "primary",
|
|
2608
|
+
disabled: props.signIn.pending,
|
|
2609
|
+
onClick: props.signIn.login,
|
|
2610
|
+
children: "Sign in to publish"
|
|
2611
|
+
})
|
|
2612
|
+
});
|
|
2613
|
+
const incomplete = !readiness.ready;
|
|
2614
|
+
const changes = hasDraftChanges(model);
|
|
2615
|
+
const target = readiness.firstIncomplete;
|
|
2616
|
+
const select = () => {
|
|
2617
|
+
if (target) props.onSelect(target);
|
|
2618
|
+
};
|
|
2619
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
2620
|
+
enabled: incomplete,
|
|
2621
|
+
content: /* @__PURE__ */ jsx("button", {
|
|
2622
|
+
type: "button",
|
|
2623
|
+
className: "font-medium text-wf-warn hover:underline",
|
|
2624
|
+
onClick: select,
|
|
2625
|
+
children: blockedReason(readiness)
|
|
2626
|
+
}),
|
|
2627
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
2628
|
+
className: "inline-flex",
|
|
2629
|
+
onClick: incomplete ? select : void 0,
|
|
2630
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
2631
|
+
size: props.size ?? "sm",
|
|
2632
|
+
variant: "primary",
|
|
2633
|
+
disabled: incomplete || !changes || props.publishing,
|
|
2634
|
+
title: !changes && !incomplete ? "No unpublished changes" : void 0,
|
|
2635
|
+
onClick: props.onPublish,
|
|
2636
|
+
children: props.publishing ? "Publishing…" : "Publish"
|
|
2637
|
+
})
|
|
2638
|
+
})
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
function PublishState(props) {
|
|
2642
|
+
const draft = hasDraftChanges(props.model);
|
|
2643
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
2644
|
+
className: "flex shrink-0 items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground",
|
|
2645
|
+
title: props.model.published ? `Published ${new Date(props.model.published.publishedAt).toLocaleString()}` : "Never published",
|
|
2646
|
+
children: [
|
|
2647
|
+
/* @__PURE__ */ jsx("span", {
|
|
2648
|
+
"aria-hidden": true,
|
|
2649
|
+
className: `h-2 w-2 rounded-full ${draft ? "bg-wf-warn" : "bg-wf-ok"}`
|
|
2650
|
+
}),
|
|
2651
|
+
/* @__PURE__ */ jsx("span", { children: !props.model.published ? "Draft" : draft ? "Unpublished changes" : "Published" }),
|
|
2652
|
+
props.model.published && draft ? /* @__PURE__ */ jsxs("span", {
|
|
2653
|
+
className: "text-muted-foreground/80",
|
|
2654
|
+
children: [
|
|
2655
|
+
"· v",
|
|
2656
|
+
props.model.published.version,
|
|
2657
|
+
" live"
|
|
2658
|
+
]
|
|
2659
|
+
}) : null
|
|
2660
|
+
]
|
|
2661
|
+
});
|
|
2662
|
+
}
|
|
2663
|
+
function StatusToggle(props) {
|
|
2664
|
+
const allowed = props.published;
|
|
2665
|
+
const on = props.status === "ENABLED";
|
|
2666
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
2667
|
+
enabled: !allowed,
|
|
2668
|
+
content: "Publish the workflow first",
|
|
2669
|
+
align: "end",
|
|
2670
|
+
side: props.tooltipSide,
|
|
2671
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
2672
|
+
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
2673
|
+
children: [/* @__PURE__ */ jsx(Toggle, {
|
|
2674
|
+
checked: on,
|
|
2675
|
+
disabled: !allowed,
|
|
2676
|
+
label: on ? "Turn the workflow off" : "Turn the workflow on",
|
|
2677
|
+
onChange: (checked) => props.onChange(checked ? "ENABLED" : "DISABLED")
|
|
2678
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2679
|
+
className: "w-6",
|
|
2680
|
+
children: on ? "On" : "Off"
|
|
2681
|
+
})]
|
|
2682
|
+
})
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
function PublishedMissingNote(props) {
|
|
2686
|
+
if (props.missing.length === 0) return null;
|
|
2687
|
+
return /* @__PURE__ */ jsx("span", {
|
|
2688
|
+
role: "alert",
|
|
2689
|
+
"aria-label": "Published version incomplete",
|
|
2690
|
+
className: "shrink-0 whitespace-nowrap rounded-full bg-wf-warn/12 px-2 py-0.5 text-xs text-wf-warn",
|
|
2691
|
+
title: `The published version is missing a reactor connection on: ${props.missing.join(", ")}`,
|
|
2692
|
+
children: "Live version incomplete"
|
|
2693
|
+
});
|
|
2694
|
+
}
|
|
2695
|
+
function ReactorDenialNote(props) {
|
|
2696
|
+
if (!props.denial) return null;
|
|
2697
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
2698
|
+
role: "alert",
|
|
2699
|
+
"aria-label": "Reactor access denied",
|
|
2700
|
+
className: "max-w-80 truncate rounded-full bg-wf-warn/12 px-2 py-0.5 text-xs text-wf-warn",
|
|
2701
|
+
title: props.denial,
|
|
2702
|
+
children: ["No reactor access: ", props.denial]
|
|
2703
|
+
});
|
|
2704
|
+
}
|
|
2705
|
+
/** Instead of the draft banner on a managed workflow: who keeps it, and that edits here are not saved. */
|
|
2706
|
+
function ManagedBanner(props) {
|
|
2707
|
+
const manager = props.model.managedBy;
|
|
2708
|
+
if (!manager) return null;
|
|
2709
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2710
|
+
role: "status",
|
|
2711
|
+
className: "pointer-events-auto flex max-w-xl items-center gap-3 rounded-lg border border-solid border-foreground/10 bg-card px-3 py-1.5 text-[13px] shadow-sm",
|
|
2712
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2713
|
+
className: "h-2 w-2 shrink-0 rounded-full bg-muted-foreground",
|
|
2714
|
+
"aria-hidden": true
|
|
2715
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
2716
|
+
className: "text-foreground",
|
|
2717
|
+
children: [
|
|
2718
|
+
"Managed by ",
|
|
2719
|
+
/* @__PURE__ */ jsx("strong", { children: manager.label || manager.documentType }),
|
|
2720
|
+
". Change it there: edits here are not saved."
|
|
2721
|
+
]
|
|
2722
|
+
})]
|
|
2723
|
+
});
|
|
2724
|
+
}
|
|
2725
|
+
function DraftBanner(props) {
|
|
2726
|
+
if (!hasDraftChanges(props.model)) return null;
|
|
2727
|
+
const { readiness } = props;
|
|
2728
|
+
const target = readiness.firstIncomplete;
|
|
2729
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2730
|
+
role: "status",
|
|
2731
|
+
className: "pointer-events-auto flex items-center gap-3 rounded-lg border border-solid border-foreground/10 bg-card py-1.5 pl-3 pr-1.5 text-[13px] shadow-sm",
|
|
2732
|
+
children: [
|
|
2733
|
+
/* @__PURE__ */ jsx("span", {
|
|
2734
|
+
className: "h-2 w-2 shrink-0 rounded-full bg-wf-warn",
|
|
2735
|
+
"aria-hidden": true
|
|
2736
|
+
}),
|
|
2737
|
+
/* @__PURE__ */ jsx("span", {
|
|
2738
|
+
className: "text-foreground",
|
|
2739
|
+
children: "You have unpublished changes"
|
|
2740
|
+
}),
|
|
2741
|
+
props.error ? /* @__PURE__ */ jsx("span", {
|
|
2742
|
+
className: "text-xs text-wf-fail",
|
|
2743
|
+
children: props.error
|
|
2744
|
+
}) : null,
|
|
2745
|
+
!readiness.hasTrigger || target ? /* @__PURE__ */ jsxs("span", {
|
|
2746
|
+
className: "flex items-center gap-1.5 text-xs text-wf-warn",
|
|
2747
|
+
children: [/* @__PURE__ */ jsx("span", { children: target ? "Incomplete steps" : "No trigger yet" }), target ? /* @__PURE__ */ jsx("button", {
|
|
2748
|
+
type: "button",
|
|
2749
|
+
className: "font-medium underline underline-offset-2 hover:no-underline",
|
|
2750
|
+
onClick: () => props.onSelect(target),
|
|
2751
|
+
children: "Show"
|
|
2752
|
+
}) : null]
|
|
2753
|
+
}) : null,
|
|
2754
|
+
/* @__PURE__ */ jsxs("span", {
|
|
2755
|
+
className: "flex items-center gap-1",
|
|
2756
|
+
children: [props.model.published ? /* @__PURE__ */ jsx(Button, {
|
|
2757
|
+
size: "sm",
|
|
2758
|
+
variant: "ghost",
|
|
2759
|
+
onClick: props.onDiscard,
|
|
2760
|
+
children: "Discard changes"
|
|
2761
|
+
}) : null, /* @__PURE__ */ jsx(PublishButton, {
|
|
2762
|
+
model: props.model,
|
|
2763
|
+
readiness,
|
|
2764
|
+
publishing: props.publishing,
|
|
2765
|
+
onPublish: props.onPublish,
|
|
2766
|
+
onSelect: props.onSelect,
|
|
2767
|
+
signIn: props.signIn
|
|
2768
|
+
})]
|
|
2769
|
+
})
|
|
2770
|
+
]
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
//#endregion
|
|
2774
|
+
//#region editors/workflow-studio/components/step-outline.ts
|
|
2775
|
+
function stepOutline(args) {
|
|
2776
|
+
const inbound = /* @__PURE__ */ new Map();
|
|
2777
|
+
for (const edge of args.edges) {
|
|
2778
|
+
const list = inbound.get(edge.to) ?? [];
|
|
2779
|
+
list.push(edge);
|
|
2780
|
+
inbound.set(edge.to, list);
|
|
2781
|
+
}
|
|
2782
|
+
const decided = args.triggerId ? [args.triggerId] : [];
|
|
2783
|
+
const rows = [];
|
|
2784
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2785
|
+
const firstDecided = (edges) => edges.reduce((first, edge) => decided.indexOf(edge.from) < decided.indexOf(first.from) ? edge : first);
|
|
2786
|
+
let progressed = true;
|
|
2787
|
+
while (progressed) {
|
|
2788
|
+
progressed = false;
|
|
2789
|
+
for (const step of args.steps) {
|
|
2790
|
+
if (seen.has(step.id)) continue;
|
|
2791
|
+
const edges = inbound.get(step.id) ?? [];
|
|
2792
|
+
const entry = !args.triggerId && edges.length === 0;
|
|
2793
|
+
if (!entry) {
|
|
2794
|
+
if (edges.length === 0) continue;
|
|
2795
|
+
if (!edges.every((edge) => decided.includes(edge.from))) continue;
|
|
2796
|
+
}
|
|
2797
|
+
seen.add(step.id);
|
|
2798
|
+
decided.push(step.id);
|
|
2799
|
+
const port = entry ? null : firstDecided(edges).port;
|
|
2800
|
+
rows.push({
|
|
2801
|
+
step,
|
|
2802
|
+
port: port === "next" ? null : port
|
|
2803
|
+
});
|
|
2804
|
+
progressed = true;
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
return {
|
|
2808
|
+
rows,
|
|
2809
|
+
orphans: args.steps.filter((step) => !seen.has(step.id))
|
|
2810
|
+
};
|
|
2811
|
+
}
|
|
2812
|
+
//#endregion
|
|
2813
|
+
//#region editors/workflow-studio/components/graph-layout.ts
|
|
2814
|
+
const TRIGGER_NODE = "trigger";
|
|
2815
|
+
const SIDE_PORTS = /* @__PURE__ */ new Set([
|
|
2816
|
+
"false",
|
|
2817
|
+
"error",
|
|
2818
|
+
"each",
|
|
2819
|
+
"otherwise"
|
|
2820
|
+
]);
|
|
2821
|
+
const isSidePort = (port) => SIDE_PORTS.has(port) || /^branch_(?!1$)\d+$/.test(port);
|
|
2822
|
+
function graphLayout(args) {
|
|
2823
|
+
const { rows } = stepOutline(args);
|
|
2824
|
+
const nodeId = (id) => id === args.triggerId ? TRIGGER_NODE : id;
|
|
2825
|
+
const placed = /* @__PURE__ */ new Map([[TRIGGER_NODE, {
|
|
2826
|
+
col: 0,
|
|
2827
|
+
lane: 0
|
|
2828
|
+
}]]);
|
|
2829
|
+
const taken = /* @__PURE__ */ new Set();
|
|
2830
|
+
const inbound = /* @__PURE__ */ new Map();
|
|
2831
|
+
const outbound = /* @__PURE__ */ new Map();
|
|
2832
|
+
for (const edge of args.edges) {
|
|
2833
|
+
const list = inbound.get(edge.to) ?? [];
|
|
2834
|
+
list.push(edge);
|
|
2835
|
+
inbound.set(edge.to, list);
|
|
2836
|
+
outbound.set(edge.from, (outbound.get(edge.from) ?? 0) + 1);
|
|
2837
|
+
}
|
|
2838
|
+
const drops = (edge) => isSidePort(edge.port) && (outbound.get(edge.from) ?? 0) > 1;
|
|
2839
|
+
const nodes = [];
|
|
2840
|
+
for (const { step } of rows) {
|
|
2841
|
+
const from = (inbound.get(step.id) ?? []).filter((edge) => placed.has(nodeId(edge.from)));
|
|
2842
|
+
const col = Math.max(1, ...from.map((edge) => placed.get(nodeId(edge.from)).col + 1));
|
|
2843
|
+
const via = joinVia(from, (edge) => {
|
|
2844
|
+
const source = placed.get(nodeId(edge.from));
|
|
2845
|
+
return {
|
|
2846
|
+
lane: source.lane + (drops(edge) ? 1 : 0),
|
|
2847
|
+
col: source.col
|
|
2848
|
+
};
|
|
2849
|
+
});
|
|
2850
|
+
let lane = via ? placed.get(nodeId(via.from)).lane + (drops(via) ? 1 : 0) : 0;
|
|
2851
|
+
const port = from.length === 1 && from[0].port !== "next" ? from[0].port : null;
|
|
2852
|
+
while (taken.has(`${col}:${lane}`)) lane++;
|
|
2853
|
+
taken.add(`${col}:${lane}`);
|
|
2854
|
+
placed.set(step.id, {
|
|
2855
|
+
col,
|
|
2856
|
+
lane
|
|
2857
|
+
});
|
|
2858
|
+
nodes.push({
|
|
2859
|
+
step,
|
|
2860
|
+
col,
|
|
2861
|
+
lane,
|
|
2862
|
+
port,
|
|
2863
|
+
via
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
return {
|
|
2867
|
+
nodes,
|
|
2868
|
+
edges: args.edges.map((edge) => ({
|
|
2869
|
+
...edge,
|
|
2870
|
+
from: nodeId(edge.from)
|
|
2871
|
+
})).filter((edge) => placed.has(edge.from) && placed.has(edge.to)).map((edge) => {
|
|
2872
|
+
const a = placed.get(edge.from);
|
|
2873
|
+
const b = placed.get(edge.to);
|
|
2874
|
+
const clear = (lane) => !nodes.some((node) => node.lane === lane && node.col > a.col && node.col < b.col);
|
|
2875
|
+
const low = Math.max(a.lane, b.lane);
|
|
2876
|
+
const high = Math.min(a.lane, b.lane);
|
|
2877
|
+
const track = clear(low) ? {
|
|
2878
|
+
lane: low,
|
|
2879
|
+
under: false
|
|
2880
|
+
} : clear(high) ? {
|
|
2881
|
+
lane: high,
|
|
2882
|
+
under: false
|
|
2883
|
+
} : {
|
|
2884
|
+
lane: high,
|
|
2885
|
+
under: true
|
|
2886
|
+
};
|
|
2887
|
+
return {
|
|
2888
|
+
from: edge.from,
|
|
2889
|
+
to: edge.to,
|
|
2890
|
+
port: edge.port,
|
|
2891
|
+
track
|
|
2892
|
+
};
|
|
2893
|
+
}),
|
|
2894
|
+
cols: Math.max(0, ...nodes.map((node) => node.col)),
|
|
2895
|
+
lanes: Math.max(1, ...nodes.map((node) => node.lane + 1))
|
|
2896
|
+
};
|
|
2897
|
+
}
|
|
2898
|
+
function joinVia(from, spot) {
|
|
2899
|
+
let best = null;
|
|
2900
|
+
let bestSpot = {
|
|
2901
|
+
lane: Infinity,
|
|
2902
|
+
col: -Infinity
|
|
2903
|
+
};
|
|
2904
|
+
for (const edge of from) {
|
|
2905
|
+
const at = spot(edge);
|
|
2906
|
+
if (at.lane < bestSpot.lane || at.lane === bestSpot.lane && at.col >= bestSpot.col) {
|
|
2907
|
+
best = edge;
|
|
2908
|
+
bestSpot = at;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
return best;
|
|
2912
|
+
}
|
|
2913
|
+
//#endregion
|
|
2914
|
+
//#region editors/workflow-editor/ui/StepError.tsx
|
|
2915
|
+
function StepError(props) {
|
|
2916
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
2917
|
+
className: "overflow-auto whitespace-pre-wrap rounded-md bg-wf-fail/10 p-2.5 text-xs text-wf-fail",
|
|
2918
|
+
children: props.error
|
|
2919
|
+
});
|
|
2920
|
+
}
|
|
2921
|
+
//#endregion
|
|
2922
|
+
//#region editors/shared/document-ref.tsx
|
|
2923
|
+
const SHOWN = 3;
|
|
2924
|
+
function shortId(id) {
|
|
2925
|
+
return id.length > 16 ? `${id.slice(0, 6)}…${id.slice(-6)}` : id;
|
|
2926
|
+
}
|
|
2927
|
+
function revisionText(reference) {
|
|
2928
|
+
const scopes = Object.entries(reference.revision).map(([scope, count]) => `${scope} ${count}`).join(" · ");
|
|
2929
|
+
return reference.branch === "main" ? scopes : `${reference.branch}: ${scopes}`;
|
|
2930
|
+
}
|
|
2931
|
+
function DocumentRefRow(props) {
|
|
2932
|
+
const { reference } = props;
|
|
2933
|
+
const setSelectedNode = useSetSelectedNode();
|
|
2934
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
2935
|
+
"aria-label": `Document ${reference.documentId}`,
|
|
2936
|
+
className: "flex items-center gap-2",
|
|
2937
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2938
|
+
className: "min-w-0 flex-1 text-xs",
|
|
2939
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2940
|
+
className: "flex min-w-0 items-baseline gap-1.5",
|
|
2941
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2942
|
+
className: "truncate font-medium text-foreground",
|
|
2943
|
+
children: reference.documentType
|
|
2944
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2945
|
+
className: "shrink-0 font-mono text-[11px] text-muted-foreground",
|
|
2946
|
+
title: reference.documentId,
|
|
2947
|
+
children: shortId(reference.documentId)
|
|
2948
|
+
})]
|
|
2949
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
2950
|
+
className: "truncate text-[11px] text-muted-foreground",
|
|
2951
|
+
children: ["Revision ", revisionText(reference)]
|
|
2952
|
+
})]
|
|
2953
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
2954
|
+
size: "sm",
|
|
2955
|
+
onClick: () => setSelectedNode(reference.documentId),
|
|
2956
|
+
"aria-label": `Open document ${reference.documentId}`,
|
|
2957
|
+
children: "Open document"
|
|
2958
|
+
})]
|
|
2959
|
+
});
|
|
2960
|
+
}
|
|
2961
|
+
function DocumentRefs(props) {
|
|
2962
|
+
const { references } = props;
|
|
2963
|
+
const hidden = references.length - SHOWN;
|
|
2964
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2965
|
+
role: "group",
|
|
2966
|
+
"aria-label": "Document references",
|
|
2967
|
+
className: "flex flex-col gap-1.5",
|
|
2968
|
+
children: [
|
|
2969
|
+
/* @__PURE__ */ jsx("ul", {
|
|
2970
|
+
className: "m-0 flex list-none flex-col gap-1.5 p-0",
|
|
2971
|
+
children: references.slice(0, SHOWN).map((reference, index) => /* @__PURE__ */ jsx(DocumentRefRow, { reference }, `${reference.documentId}-${index}`))
|
|
2972
|
+
}),
|
|
2973
|
+
hidden > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
2974
|
+
className: "text-[11px] text-muted-foreground",
|
|
2975
|
+
children: [
|
|
2976
|
+
"and ",
|
|
2977
|
+
hidden,
|
|
2978
|
+
" more in the data below"
|
|
2979
|
+
]
|
|
2980
|
+
}) : null,
|
|
2981
|
+
/* @__PURE__ */ jsx("p", {
|
|
2982
|
+
className: "text-[11px] text-muted-foreground",
|
|
2983
|
+
children: "The run kept a reference, not the state. Opening shows the document as it is now: past revisions can't be read yet (#3179)."
|
|
2984
|
+
})
|
|
2985
|
+
]
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
//#endregion
|
|
2989
|
+
//#region editors/shared/data-viewer.tsx
|
|
2990
|
+
const DataTree = lazy(() => import("./data-tree-Cq-s6bJp.js"));
|
|
2991
|
+
function stringify(value) {
|
|
2992
|
+
try {
|
|
2993
|
+
return JSON.stringify(value, null, 2) ?? "";
|
|
2994
|
+
} catch {
|
|
2995
|
+
return String(value);
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
function isEmpty(value) {
|
|
2999
|
+
if (value === void 0 || value === null) return true;
|
|
3000
|
+
if (typeof value === "object") return Object.keys(value).length === 0;
|
|
3001
|
+
return false;
|
|
3002
|
+
}
|
|
3003
|
+
function RawJson(props) {
|
|
3004
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
3005
|
+
className: "max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-xs text-foreground",
|
|
3006
|
+
children: props.text
|
|
3007
|
+
});
|
|
3008
|
+
}
|
|
3009
|
+
function TreeSkeleton() {
|
|
3010
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3011
|
+
role: "status",
|
|
3012
|
+
"aria-label": "Loading data",
|
|
3013
|
+
className: "flex animate-pulse flex-col gap-2 py-1",
|
|
3014
|
+
children: [
|
|
3015
|
+
"w-2/5",
|
|
3016
|
+
"w-3/5",
|
|
3017
|
+
"w-1/2",
|
|
3018
|
+
"w-1/3"
|
|
3019
|
+
].map((width, index) => /* @__PURE__ */ jsx("span", {
|
|
3020
|
+
className: `h-2.5 rounded bg-muted ${width}`,
|
|
3021
|
+
style: { marginLeft: index === 0 ? 0 : 16 }
|
|
3022
|
+
}, width))
|
|
3023
|
+
});
|
|
3024
|
+
}
|
|
3025
|
+
function DataViewer(props) {
|
|
3026
|
+
const [raw, setRaw] = useState(false);
|
|
3027
|
+
const [copied, setCopied] = useState(false);
|
|
3028
|
+
const empty = isEmpty(props.value);
|
|
3029
|
+
const text = stringify(props.value);
|
|
3030
|
+
const tree = typeof props.value === "object" && props.value !== null;
|
|
3031
|
+
const references = tree ? documentRefsIn(props.value) : [];
|
|
3032
|
+
const treeValue = isDocumentRefMarker(props.value) ? Object.fromEntries(Object.entries(props.value).filter(([key]) => key !== DOCUMENT_REF_KEY)) : props.value;
|
|
3033
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
3034
|
+
"aria-label": props.label,
|
|
3035
|
+
className: "min-w-0 rounded-md border border-solid border-border bg-card",
|
|
3036
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
3037
|
+
className: "flex h-8 items-center gap-1 border-b border-solid border-border pl-3 pr-1",
|
|
3038
|
+
children: [
|
|
3039
|
+
/* @__PURE__ */ jsx("h4", {
|
|
3040
|
+
className: "mr-auto text-xs font-medium text-foreground",
|
|
3041
|
+
children: props.label
|
|
3042
|
+
}),
|
|
3043
|
+
!empty && tree ? /* @__PURE__ */ jsx("button", {
|
|
3044
|
+
type: "button",
|
|
3045
|
+
"aria-pressed": raw,
|
|
3046
|
+
className: "rounded px-1.5 py-0.5 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
3047
|
+
onClick: () => setRaw((value) => !value),
|
|
3048
|
+
children: raw ? "Tree" : "JSON"
|
|
3049
|
+
}) : null,
|
|
3050
|
+
!empty ? /* @__PURE__ */ jsx(IconButton, {
|
|
3051
|
+
icon: copied ? "check" : "copy",
|
|
3052
|
+
label: `Copy ${props.label.toLowerCase()} as JSON`,
|
|
3053
|
+
onClick: () => {
|
|
3054
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
3055
|
+
setCopied(true);
|
|
3056
|
+
setTimeout(() => setCopied(false), 1500);
|
|
3057
|
+
});
|
|
3058
|
+
}
|
|
3059
|
+
}) : null
|
|
3060
|
+
]
|
|
3061
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
3062
|
+
className: "px-3 py-2",
|
|
3063
|
+
children: empty ? /* @__PURE__ */ jsx("p", {
|
|
3064
|
+
className: "text-xs text-muted-foreground",
|
|
3065
|
+
children: props.emptyText ?? "Nothing"
|
|
3066
|
+
}) : !tree ? /* @__PURE__ */ jsx("p", {
|
|
3067
|
+
className: "break-words font-mono text-xs text-foreground",
|
|
3068
|
+
children: text
|
|
3069
|
+
}) : raw ? /* @__PURE__ */ jsx(RawJson, { text }) : /* @__PURE__ */ jsxs("div", {
|
|
3070
|
+
className: "flex flex-col gap-2",
|
|
3071
|
+
children: [references.length > 0 ? /* @__PURE__ */ jsx(DocumentRefs, { references }) : null, isEmpty(treeValue) ? null : /* @__PURE__ */ jsx("div", {
|
|
3072
|
+
className: "max-h-72 overflow-auto",
|
|
3073
|
+
children: /* @__PURE__ */ jsx(Suspense, {
|
|
3074
|
+
fallback: /* @__PURE__ */ jsx(TreeSkeleton, {}),
|
|
3075
|
+
children: /* @__PURE__ */ jsx(DataTree, {
|
|
3076
|
+
value: treeValue,
|
|
3077
|
+
root: props.root
|
|
3078
|
+
})
|
|
3079
|
+
})
|
|
3080
|
+
})]
|
|
3081
|
+
})
|
|
3082
|
+
})]
|
|
3083
|
+
});
|
|
3084
|
+
}
|
|
3085
|
+
//#endregion
|
|
3086
|
+
//#region editors/workflow-editor/ui/trigger-text.ts
|
|
3087
|
+
const WEEKDAYS = [
|
|
3088
|
+
"Sunday",
|
|
3089
|
+
"Monday",
|
|
3090
|
+
"Tuesday",
|
|
3091
|
+
"Wednesday",
|
|
3092
|
+
"Thursday",
|
|
3093
|
+
"Friday",
|
|
3094
|
+
"Saturday"
|
|
3095
|
+
];
|
|
3096
|
+
const UNIT_LABEL = {
|
|
3097
|
+
minutes: ["minute", "minutes"],
|
|
3098
|
+
hours: ["hour", "hours"],
|
|
3099
|
+
days: ["day", "days"]
|
|
3100
|
+
};
|
|
3101
|
+
function isInt(field) {
|
|
3102
|
+
return /^\d+$/.test(field);
|
|
3103
|
+
}
|
|
3104
|
+
function clock(hour, minute) {
|
|
3105
|
+
return `${hour.padStart(2, "0")}:${minute.padStart(2, "0")}`;
|
|
3106
|
+
}
|
|
3107
|
+
function dayList(field) {
|
|
3108
|
+
if (field === "1-5") return "on weekdays";
|
|
3109
|
+
if (field === "0,6" || field === "6,0") return "at weekends";
|
|
3110
|
+
const days = field.split(",");
|
|
3111
|
+
if (!days.every((day) => isInt(day) && Number(day) <= 7)) return void 0;
|
|
3112
|
+
const names = days.map((day) => WEEKDAYS[Number(day) % 7]);
|
|
3113
|
+
if (names.length === 1) return `every ${names[0]}`;
|
|
3114
|
+
return `on ${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
|
|
3115
|
+
}
|
|
3116
|
+
/** Describes a five-field cron expression, or returns undefined. */
|
|
3117
|
+
function describeCron(cron) {
|
|
3118
|
+
const fields = cron.trim().split(/\s+/);
|
|
3119
|
+
if (fields.length !== 5) return void 0;
|
|
3120
|
+
const [minute, hour, dayOfMonth, month, dayOfWeek] = fields;
|
|
3121
|
+
if (month !== "*") return void 0;
|
|
3122
|
+
const everyMinutes = /^\*\/(\d+)$/.exec(minute);
|
|
3123
|
+
if (everyMinutes && hour === "*" && dayOfMonth === "*" && dayOfWeek === "*") {
|
|
3124
|
+
const n = Number(everyMinutes[1]);
|
|
3125
|
+
return n === 1 ? "Every minute" : `Every ${n} minutes`;
|
|
3126
|
+
}
|
|
3127
|
+
if (minute === "*" && hour === "*" && dayOfMonth === "*" && dayOfWeek === "*") return "Every minute";
|
|
3128
|
+
if (isInt(minute) && hour === "*" && dayOfMonth === "*" && dayOfWeek === "*") return minute === "0" ? "Every hour, on the hour" : `Every hour at ${minute.padStart(2, "0")} past`;
|
|
3129
|
+
const everyHours = /^\*\/(\d+)$/.exec(hour);
|
|
3130
|
+
if (isInt(minute) && everyHours && dayOfMonth === "*" && dayOfWeek === "*") return `Every ${everyHours[1]} hours`;
|
|
3131
|
+
if (!isInt(minute) || !isInt(hour)) return void 0;
|
|
3132
|
+
const at = clock(hour, minute);
|
|
3133
|
+
if (dayOfMonth === "*" && dayOfWeek === "*") return `Every day at ${at}`;
|
|
3134
|
+
if (dayOfMonth === "*") {
|
|
3135
|
+
const days = dayList(dayOfWeek);
|
|
3136
|
+
return days ? `${days.charAt(0).toUpperCase()}${days.slice(1)} at ${at}` : void 0;
|
|
3137
|
+
}
|
|
3138
|
+
if (isInt(dayOfMonth) && dayOfWeek === "*") return `Every month on day ${dayOfMonth} at ${at}`;
|
|
3139
|
+
}
|
|
3140
|
+
function describeSchedule(config) {
|
|
3141
|
+
let schedule;
|
|
3142
|
+
try {
|
|
3143
|
+
schedule = parseScheduleConfig(config);
|
|
3144
|
+
} catch {
|
|
3145
|
+
return "On a schedule that does not parse";
|
|
3146
|
+
}
|
|
3147
|
+
if (schedule.mode === "interval") {
|
|
3148
|
+
const unit = UNIT_LABEL[schedule.unit];
|
|
3149
|
+
return schedule.every === 1 ? `Every ${unit[0]}` : `Every ${schedule.every} ${unit[1]}`;
|
|
3150
|
+
}
|
|
3151
|
+
const described = describeCron(schedule.cron);
|
|
3152
|
+
return described ? `${described} ${schedule.timezone}` : `On schedule ${schedule.cron}`;
|
|
3153
|
+
}
|
|
3154
|
+
function literal(config, key) {
|
|
3155
|
+
if (!config || typeof config !== "object") return void 0;
|
|
3156
|
+
const value = config[key];
|
|
3157
|
+
if (typeof value !== "string") return void 0;
|
|
3158
|
+
const text = value.trim();
|
|
3159
|
+
return text && !text.includes("{{") ? text : void 0;
|
|
3160
|
+
}
|
|
3161
|
+
function documentTypeLabel(documentType) {
|
|
3162
|
+
return (documentType.split("/").pop() ?? documentType).split(/[-_\s]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
3163
|
+
}
|
|
3164
|
+
function actionTypeLabel(actionType) {
|
|
3165
|
+
const text = actionType.toLowerCase().split(/[_\s]+/).filter(Boolean).join(" ");
|
|
3166
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
3167
|
+
}
|
|
3168
|
+
/** Describes a reactor document trigger by what it filters on. */
|
|
3169
|
+
function describeDocumentTrigger(triggerName, config) {
|
|
3170
|
+
const documentType = literal(config, "documentType");
|
|
3171
|
+
const label = documentType ? documentTypeLabel(documentType) : "";
|
|
3172
|
+
const subject = label ? `${/^[AEIOU]/.test(label) ? "an" : "a"} ${label}` : literal(config, "documentId") ? "its document" : "a document";
|
|
3173
|
+
switch (triggerName) {
|
|
3174
|
+
case "document-event": {
|
|
3175
|
+
const actionType = literal(config, "actionType");
|
|
3176
|
+
return actionType ? `When ${actionTypeLabel(actionType)} runs on ${subject}` : `When ${subject} changes`;
|
|
3177
|
+
}
|
|
3178
|
+
case "document-created": return `When ${subject} is created`;
|
|
3179
|
+
case "document-deleted": return `When ${subject} is deleted`;
|
|
3180
|
+
default: return;
|
|
3181
|
+
}
|
|
3182
|
+
}
|
|
3183
|
+
/** When a workflow starts, from its trigger. */
|
|
3184
|
+
function describeTrigger(trigger) {
|
|
3185
|
+
if (!trigger) return "Never starts: no trigger";
|
|
3186
|
+
const block = {
|
|
3187
|
+
pieceName: trigger.pieceName,
|
|
3188
|
+
kind: "trigger",
|
|
3189
|
+
name: trigger.triggerName
|
|
3190
|
+
};
|
|
3191
|
+
switch (blockKey(block)) {
|
|
3192
|
+
case blockKey(MANUAL_TRIGGER): return "Manual";
|
|
3193
|
+
case blockKey(WEBHOOK_TRIGGER): return "When its webhook is called";
|
|
3194
|
+
case blockKey(SCHEDULE_TRIGGER): return describeSchedule(trigger.config);
|
|
3195
|
+
default: {
|
|
3196
|
+
if (trigger.pieceName === "@powerhousedao/piece-reactor") {
|
|
3197
|
+
const described = describeDocumentTrigger(trigger.triggerName, trigger.config);
|
|
3198
|
+
if (described) return described;
|
|
3199
|
+
}
|
|
3200
|
+
const meta = blockMeta(block);
|
|
3201
|
+
if (namedByCoreTab(block)) return meta.displayName;
|
|
3202
|
+
const piece = meta.subtitle.replace(/ · Trigger$/, "");
|
|
3203
|
+
return `${meta.displayName} in ${piece}`;
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
3207
|
+
//#endregion
|
|
3208
|
+
export { ExpressionTargetProvider as A, documentShape as B, PropertyForm as C, ExpressionPickerButton as D, useSecretRef as E, VARIABLE_TYPES as F, usePendingEcho as G, contextMenuItems as H, VARIABLE_TYPE_LABEL as I, convertVariableValue as L, useExpressionField as M, EMPTY_SCOPE as N, ExpressionPickerPopup as O, buildExpressionScope as P, parseTypedValue as R, PiecePlaceholderContext as S, withPropDefaults as T, menuHeight as U, stateFieldsFromSdl as V, menuPosition as W, STEP_PARAM as _, StepError as a, uniqueStepKey as b, stepOutline as c, PublishButton as d, PublishState as f, usePublish as g, StatusToggle as h, DataViewer as i, ExpressionTokenLine as j, ExpressionScopeSourceProvider as k, DraftBanner as l, ReactorDenialNote as m, describeSchedule as n, TRIGGER_NODE as o, PublishedMissingNote as p, describeTrigger as r, graphLayout as s, describeCron as t, ManagedBanner as u, VARIABLES_VIEW as v, lacksDefaults as w, AvailableSoon as x, hasDraftChanges as y, valueMismatch as z };
|
|
3209
|
+
|
|
3210
|
+
//# sourceMappingURL=trigger-text-DH6HIeoa.js.map
|