@fudanda/workflow 0.0.0-stage → 1.20261015.1-beta.1
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 +21 -0
- package/README.md +113 -2
- package/THIRD-PARTY-NOTICES.md +57 -0
- package/dist/ai-markdown-esl-I5ck.js +7 -0
- package/dist/chrome.d.ts +11 -0
- package/dist/chrome.js +358 -0
- package/dist/core.d.ts +11 -0
- package/dist/core.js +3 -0
- package/dist/coze/compat/base.d.ts +116 -0
- package/dist/coze/control-icon.d.ts +15 -0
- package/dist/coze/execution-panel.d.ts +8 -0
- package/dist/coze/schema-tree.d.ts +9 -0
- package/dist/coze/side-panel.d.ts +12 -0
- package/dist/coze/source/form-extensions/components/output-tree/components/custom-tree-node/constants.d.ts +13 -0
- package/dist/coze/source/form-extensions/components/output-tree/components/custom-tree-node/type.d.ts +34 -0
- package/dist/coze/start-form.d.ts +9 -0
- package/dist/coze/test-input.d.ts +9 -0
- package/dist/coze/test-run-button.d.ts +4 -0
- package/dist/coze/workflow-header.d.ts +5 -0
- package/dist/designer.d.ts +2 -0
- package/dist/flowgram-designer.d.ts +62 -0
- package/dist/graph-scope.d.ts +147 -0
- package/dist/header-shortcuts-BQZuNfpA.js +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8694 -0
- package/dist/input-fields.d.ts +4 -0
- package/dist/panel-focus.d.ts +3 -0
- package/dist/prompt-kit.d.ts +47 -0
- package/dist/result-preview.d.ts +5 -0
- package/dist/schema-tree-CTM6hEdm.js +309 -0
- package/dist/start-form-D_J3UIoE.js +9330 -0
- package/dist/styles.css +2 -0
- package/dist/templates.d.ts +1 -0
- package/dist/test-input-validation-CkORPCfm.js +55 -0
- package/dist/test-input-validation.d.ts +11 -0
- package/dist/theme.d.ts +17 -0
- package/package.json +103 -4
- package/vendor/coze/LICENSE-APACHE +177 -0
- package/vendor/coze/UPSTREAM.json +2247 -0
- package/vendor/coze/original/base-test-button.tsx +22 -0
- package/vendor/coze/original/comment-container.tsx +68 -0
- package/vendor/coze/original/condition-container.tsx +60 -0
- package/vendor/coze/original/condition-tag.tsx +58 -0
- package/vendor/coze/original/coze-global.less +234 -0
- package/vendor/coze/original/create-loop-function-json.ts +134 -0
- package/vendor/coze/original/create-loop-function.ts +56 -0
- package/vendor/coze/original/end-registry.ts +41 -0
- package/vendor/coze/original/execute-result-panel.less +97 -0
- package/vendor/coze/original/execute-result-panel.tsx +171 -0
- package/vendor/coze/original/form-item.less +39 -0
- package/vendor/coze/original/form-item.tsx +200 -0
- package/vendor/coze/original/http-api-field.tsx +42 -0
- package/vendor/coze/original/http-form-render.tsx +102 -0
- package/vendor/coze/original/icon-add.svg +3 -0
- package/vendor/coze/original/icon-arrow-left.svg +3 -0
- package/vendor/coze/original/icon-auto-layout.svg +18 -0
- package/vendor/coze/original/icon-batch.jpg +0 -0
- package/vendor/coze/original/icon-break.jpg +0 -0
- package/vendor/coze/original/icon-code.svg +13 -0
- package/vendor/coze/original/icon-condition.jpg +0 -0
- package/vendor/coze/original/icon-condition.svg +12 -0
- package/vendor/coze/original/icon-continue.jpg +0 -0
- package/vendor/coze/original/icon-database-query.jpg +0 -0
- package/vendor/coze/original/icon-database-update.jpg +0 -0
- package/vendor/coze/original/icon-database.svg +18 -0
- package/vendor/coze/original/icon-delete.svg +5 -0
- package/vendor/coze/original/icon-end.jpg +0 -0
- package/vendor/coze/original/icon-fullscreen.svg +9 -0
- package/vendor/coze/original/icon-http.jpg +0 -0
- package/vendor/coze/original/icon-intent.jpg +0 -0
- package/vendor/coze/original/icon-json-parser.jpg +0 -0
- package/vendor/coze/original/icon-json-stringify.jpg +0 -0
- package/vendor/coze/original/icon-llm.jpg +0 -0
- package/vendor/coze/original/icon-loop.jpg +0 -0
- package/vendor/coze/original/icon-more.svg +11 -0
- package/vendor/coze/original/icon-play-round-outlined.svg +8 -0
- package/vendor/coze/original/icon-plugin-tool.svg +6 -0
- package/vendor/coze/original/icon-standard-copy.svg +8 -0
- package/vendor/coze/original/icon-start.jpg +0 -0
- package/vendor/coze/original/icon-text.jpg +0 -0
- package/vendor/coze/original/icon-unknown.svg +7 -0
- package/vendor/coze/original/icon-var.svg +6 -0
- package/vendor/coze/original/icon-variable-assign.jpg +0 -0
- package/vendor/coze/original/icon-variable-merge.jpg +0 -0
- package/vendor/coze/original/icon-workflow-end.svg +5 -0
- package/vendor/coze/original/icon-workflow-start.svg +5 -0
- package/vendor/coze/original/icon-workflow.jpg +0 -0
- package/vendor/coze/original/icon-workflow.svg +21 -0
- package/vendor/coze/original/icon-workflows.svg +5 -0
- package/vendor/coze/original/if-form-meta.tsx +88 -0
- package/vendor/coze/original/logic-display.tsx +33 -0
- package/vendor/coze/original/mouse-icon.tsx +35 -0
- package/vendor/coze/original/mouse-pad-selector.tsx +180 -0
- package/vendor/coze/original/node-card.tsx +77 -0
- package/vendor/coze/original/node-category-panel.less +4 -0
- package/vendor/coze/original/node-category-panel.tsx +53 -0
- package/vendor/coze/original/node-config-form.tsx +67 -0
- package/vendor/coze/original/node-header.less +165 -0
- package/vendor/coze/original/node-header.tsx +552 -0
- package/vendor/coze/original/node-panel.less +183 -0
- package/vendor/coze/original/node-render.less +20 -0
- package/vendor/coze/original/node-side-sheet.less +57 -0
- package/vendor/coze/original/node-side-sheet.tsx +214 -0
- package/vendor/coze/original/node-wrapper.tsx +71 -0
- package/vendor/coze/original/pad-icon.tsx +45 -0
- package/vendor/coze/original/resizable-side-panel-constants.ts +18 -0
- package/vendor/coze/original/resizable-side-panel.tsx +42 -0
- package/vendor/coze/original/start-registry.ts +53 -0
- package/vendor/coze/original/sub-canvas-background.less +4 -0
- package/vendor/coze/original/sub-canvas-background.tsx +48 -0
- package/vendor/coze/original/sub-canvas-container.less +16 -0
- package/vendor/coze/original/sub-canvas-container.tsx +97 -0
- package/vendor/coze/original/sub-canvas-header.less +75 -0
- package/vendor/coze/original/sub-canvas-header.tsx +95 -0
- package/vendor/coze/original/test-form-sheet-header.tsx +82 -0
- package/vendor/coze/original/test-form-sheet.less +178 -0
- package/vendor/coze/original/toolbar-add-node.tsx +68 -0
- package/vendor/coze/original/toolbar-auto-layout.tsx +61 -0
- package/vendor/coze/original/toolbar-comment.tsx +121 -0
- package/vendor/coze/original/toolbar-container.tsx +42 -0
- package/vendor/coze/original/toolbar-interactive.tsx +98 -0
- package/vendor/coze/original/toolbar-minimap-switch.tsx +41 -0
- package/vendor/coze/original/toolbar-tools.less +46 -0
- package/vendor/coze/original/toolbar-tools.tsx +89 -0
- package/vendor/coze/original/toolbar-zoom.tsx +134 -0
- package/vendor/coze/original/tree-variable-selector.less +292 -0
- package/vendor/coze/original/tree-variable-selector.tsx +298 -0
- package/vendor/coze/original/workflow-document-custom-options.ts +151 -0
- package/vendor/coze/original/workflow-header.less +65 -0
- package/vendor/coze/original/workflow-header.tsx +85 -0
- package/vendor/coze/source/agent-models/model-option/index.module.less +19 -0
- package/vendor/coze/source/agent-models/model-option/index.tsx +321 -0
- package/vendor/coze/source/agent-models/model-option-avatar/index.tsx +175 -0
- package/vendor/coze/source/agent-models/model-option-group/index.tsx +87 -0
- package/vendor/coze/source/agent-models/model-option-thumb/index.tsx +41 -0
- package/vendor/coze/source/agent-models/model-select-ui/index.tsx +238 -0
- package/vendor/coze/source/agent-models/popover-model-list-view/index.tsx +146 -0
- package/vendor/coze/source/components/code-editor/text-editor.tsx +71 -0
- package/vendor/coze/source/components/comment/components/editor/block.tsx +117 -0
- package/vendor/coze/source/components/comment/components/editor/leaf.tsx +64 -0
- package/vendor/coze/source/components/comment/components/toolbar.tsx +366 -0
- package/vendor/coze/source/components/comment/constant.ts +94 -0
- package/vendor/coze/source/components/editor-container/expand-editor/index.module.less +107 -0
- package/vendor/coze/source/components/editor-container/expand-editor/index.tsx +117 -0
- package/vendor/coze/source/components/model-select/components/model-setting.tsx +300 -0
- package/vendor/coze/source/components/model-select/components/settings.tsx +144 -0
- package/vendor/coze/source/components/model-select/index.module.less +34 -0
- package/vendor/coze/source/components/model-select/utils/index.tsx +100 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/constants.tsx +79 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field-empty.module.less +12 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field-empty.tsx +37 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field.module.less +19 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/field.tsx +52 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/http-api-field/index.tsx +42 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/overflow-tag-list.module.less +47 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/overflow-tag-list.tsx +162 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/variable-tag-list.module.less +48 -0
- package/vendor/coze/source/components/node-render/node-render-new/fields/variable-tag-list.tsx +126 -0
- package/vendor/coze/source/components/node-wrapper/execute-result-panel/index.module.less +97 -0
- package/vendor/coze/source/components/node-wrapper/execute-result-panel/index.tsx +171 -0
- package/vendor/coze/source/components/sub-canvas/components/background/index.module.less +4 -0
- package/vendor/coze/source/components/sub-canvas/components/header/index.module.less +75 -0
- package/vendor/coze/source/components/test-run/test-run-button/single-node.tsx +158 -0
- package/vendor/coze/source/execution-panel/panel.module.less +48 -0
- package/vendor/coze/source/execution-panel/panel.tsx +99 -0
- package/vendor/coze/source/execution-panel/use-resize.ts +79 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/constants.ts +28 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/context.ts +21 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/create-store.ts +48 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/index.ts +19 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/context/provider.tsx +50 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/data-viewer.module.less +26 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/data-viewer.tsx +79 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/index.ts +18 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-data-viewer-store.ts +29 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-expand.ts +35 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/hooks/use-value.tsx +66 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/index.tsx +21 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/json-field/index.tsx +186 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/json-field/json-field.module.less +79 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/types.ts +50 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/utils/big-number.ts +35 -0
- package/vendor/coze/source/external/features/log/components/data-viewer/utils/generate-field.ts +104 -0
- package/vendor/coze/source/external/features/log/components/log-parser/log-wrap.module.less +27 -0
- package/vendor/coze/source/external/features/log/components/log-parser/log-wrap.tsx +109 -0
- package/vendor/coze/source/external/features/log/components/node-status-bar/node-status-bar.module.less +52 -0
- package/vendor/coze/source/external/features/log/components/node-status-bar/node-status-bar.tsx +113 -0
- package/vendor/coze/source/form/components/field-empty.tsx +45 -0
- package/vendor/coze/source/form/components/section.tsx +91 -0
- package/vendor/coze/source/form-extensions/components/add-item-button/index.tsx +64 -0
- package/vendor/coze/source/form-extensions/components/form-card/index.module.less +131 -0
- package/vendor/coze/source/form-extensions/components/form-card/index.tsx +309 -0
- package/vendor/coze/source/form-extensions/components/form-item/index.module.less +39 -0
- package/vendor/coze/source/form-extensions/components/form-item/index.tsx +200 -0
- package/vendor/coze/source/form-extensions/components/form-item-feedback/index.module.less +7 -0
- package/vendor/coze/source/form-extensions/components/form-item-feedback/index.tsx +39 -0
- package/vendor/coze/source/form-extensions/components/level-line/index.module.less +346 -0
- package/vendor/coze/source/form-extensions/components/level-line/index.ts +17 -0
- package/vendor/coze/source/form-extensions/components/level-line/level-line.tsx +460 -0
- package/vendor/coze/source/form-extensions/components/level-line/types.ts +38 -0
- package/vendor/coze/source/form-extensions/components/level-line/utils.ts +60 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/constants.ts +61 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-boolean.tsx +80 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-integer.tsx +68 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-number.tsx +62 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-select.tsx +59 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/input-string.tsx +55 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/literal-value-input.tsx +35 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/styles.module.less +46 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/type.ts +61 -0
- package/vendor/coze/source/form-extensions/components/literal-value-input/utils.tsx +117 -0
- package/vendor/coze/source/form-extensions/components/node-header/components/close-button.tsx +44 -0
- package/vendor/coze/source/form-extensions/components/node-header/description-display.tsx +52 -0
- package/vendor/coze/source/form-extensions/components/node-header/description.tsx +131 -0
- package/vendor/coze/source/form-extensions/components/node-header/index.module.less +165 -0
- package/vendor/coze/source/form-extensions/components/node-header/index.tsx +552 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-btn/index.tsx +43 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/default-value-input.tsx +276 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/index.module.less +124 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/index.tsx +131 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/expand-content/types.ts +32 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-name/index.module.less +38 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-name/index.tsx +101 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-operator/index.module.less +51 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-operator/index.tsx +107 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-required/index.module.less +17 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-required/index.tsx +53 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/constants.tsx +77 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/index.module.less +97 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/components/param-type/index.tsx +155 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/constants.ts +38 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/index.module.less +138 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/index.tsx +360 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/custom-tree-node/type.ts +88 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/header/index.module.less +36 -0
- package/vendor/coze/source/form-extensions/components/output-tree/components/header/index.tsx +104 -0
- package/vendor/coze/source/form-extensions/components/output-tree/constants.ts +22 -0
- package/vendor/coze/source/form-extensions/components/output-tree/context.ts +28 -0
- package/vendor/coze/source/form-extensions/components/output-tree/hooks/use-columns-style.ts +39 -0
- package/vendor/coze/source/form-extensions/components/output-tree/index.module.less +83 -0
- package/vendor/coze/source/form-extensions/components/output-tree/index.tsx +692 -0
- package/vendor/coze/source/form-extensions/components/output-tree/utils.ts +185 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/index.tsx +97 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/option-item.tsx +30 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/process-type/types.ts +23 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/retry-times/index.tsx +45 -0
- package/vendor/coze/source/form-extensions/components/setting-on-error/components/timeout/index.tsx +102 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select-option.tsx +167 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select-tree-panel.tsx +165 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select.module.less +96 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/composite-select.tsx +265 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/context.tsx +42 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/expand-icon.tsx +30 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/index.module.less +292 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/node-variable-tree.module.less +49 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/node-variable-tree.tsx +149 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/utils.tsx +500 -0
- package/vendor/coze/source/form-extensions/components/tree-variable-selector/value-display.tsx +130 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/const.ts +68 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/context.ts +27 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/index.module.less +144 -0
- package/vendor/coze/source/form-extensions/components/value-expression-input/value-expression-input.tsx +418 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/constants.tsx +77 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/index.module.less +31 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/index.tsx +17 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/utils.tsx +298 -0
- package/vendor/coze/source/form-extensions/components/variable-type-selector/variable-type-selector.tsx +235 -0
- package/vendor/coze/source/form-extensions/components/variable-type-tag/index.tsx +54 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-branch.module.less +9 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-branch.tsx +249 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-header.tsx +50 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-item-logic.module.less +13 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-item-logic.tsx +73 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/delete/index.module.less +10 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/delete/index.tsx +42 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/index.module.less +9 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/index.tsx +254 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/operator/index.module.less +7 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/operator/index.tsx +144 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/condition-params-item/value-expression-with-state/index.tsx +69 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/context.ts +36 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/condition-branch-preview.tsx +44 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/condition-branch.tsx +152 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/container.tsx +19 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/custom-drag-layer.tsx +117 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/draggable/types.ts +18 -0
- package/vendor/coze/source/form-extensions/setters/condition/multi-condition/types.ts +58 -0
- package/vendor/coze/source/node-registries/end/components/terminate-plan-field.tsx +29 -0
- package/vendor/coze/source/node-registries/end/constants.ts +34 -0
- package/vendor/coze/source/node-registries/end/form.tsx +66 -0
- package/vendor/coze/source/node-registries/end/types.ts +45 -0
- package/vendor/coze/source/node-registries/http/components/base-editor/raw-text-editor.tsx +80 -0
- package/vendor/coze/source/node-registries/http/constants.ts +80 -0
- package/vendor/coze/source/node-registries/http/fields/json-import-editor/index.module.less +191 -0
- package/vendor/coze/source/node-registries/http/fields/json-import-editor/json-import-components/json-expand-editor.tsx +141 -0
- package/vendor/coze/source/node-registries/http/fields/json-import-editor/json-import-components/json-import.tsx +99 -0
- package/vendor/coze/source/node-registries/http/form-render.tsx +102 -0
- package/vendor/coze/source/node-registries/http/setters/api/curl-expand-editor.tsx +161 -0
- package/vendor/coze/source/node-registries/http/setters/api/curl-import.tsx +96 -0
- package/vendor/coze/source/node-registries/http/setters/api/index.module.less +199 -0
- package/vendor/coze/source/node-registries/http/setters/api/index.tsx +149 -0
- package/vendor/coze/source/node-registries/http/setters/api/utils.ts +41 -0
- package/vendor/coze/source/node-registries/http/setters/body/index.tsx +201 -0
- package/vendor/coze/source/node-registries/http/setters/constants.ts +83 -0
- package/vendor/coze/source/node-registries/if/components/else/index.tsx +41 -0
- package/vendor/coze/source/node-registries/intent/components/intents/index.module.less +15 -0
- package/vendor/coze/source/node-registries/intent/components/intents/option-item/index.tsx +189 -0
- package/vendor/coze/source/node-registries/json-stringify/constants.ts +32 -0
- package/vendor/coze/source/node-registries/json-stringify/form.tsx +46 -0
- package/vendor/coze/source/node-registries/loop/constants.ts +43 -0
- package/vendor/coze/source/node-registries/loop/loop-fields/loop-settings-section/index.tsx +48 -0
- package/vendor/coze/source/node-registries/loop/loop-fields/loop-type/index.tsx +81 -0
- package/vendor/coze/source/node-registries/loop/loop-fields/loop-type/options.ts +34 -0
- package/vendor/coze/source/node-registries/start/form.tsx +209 -0
- package/vendor/coze/source/node-registries/text-process/components/method-selector/index.tsx +46 -0
- package/vendor/coze/source/node-registries/text-process/constants.ts +132 -0
- package/vendor/coze/source/nodes-v2/components/form-item-feedback/index.module.less +7 -0
- package/vendor/coze/source/nodes-v2/components/form-item-feedback/index.tsx +47 -0
- package/vendor/coze/source/nodes-v2/components/system-prompt/index.module.less +66 -0
- package/vendor/coze/source/nodes-v2/components/system-prompt/prompt-kit-bar.tsx +129 -0
- package/vendor/coze/source/nodes-v2/components/system-prompt/system-prompt-editor.tsx +110 -0
- package/vendor/coze/source/nodes-v2/llm/user-prompt/index.tsx +64 -0
- package/vendor/coze/source/prompt-kit/input-config-popover/index.tsx +80 -0
- package/vendor/coze/source/prompt-kit/input-slot-widget/index.css +34 -0
- package/vendor/coze/source/prompt-kit/input-slot-widget/index.ts +169 -0
- package/vendor/coze/source/prompt-kit/library-item.tsx +141 -0
- package/vendor/coze/source/prompt-kit/prompt-info-input.tsx +90 -0
- package/vendor/coze/source/ui-components/add-operation/index.module.less +19 -0
- package/vendor/coze/source/ui-components/add-operation/index.tsx +67 -0
- package/vendor/coze/source/ui-components/auto-size-tooltip/index.module.less +39 -0
- package/vendor/coze/source/ui-components/auto-size-tooltip/index.tsx +74 -0
- package/vendor/coze/source/ui-components/workflow-sl-input/index.module.less +36 -0
- package/vendor/coze/source/ui-components/workflow-sl-input/index.tsx +194 -0
- package/vendor/coze/source/utils/create-slots/index.tsx +126 -0
- package/vendor/coze/source/utils/create-slots/use-force-update.ts +23 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback } from 'react';
|
|
18
|
+
|
|
19
|
+
import { reporter } from '@coze-arch/logger';
|
|
20
|
+
import { I18n } from '@coze-arch/i18n';
|
|
21
|
+
import { IconCozAutoLayout } from '@coze-arch/coze-design/icons';
|
|
22
|
+
import { IconButton, Tooltip } from '@coze-arch/coze-design';
|
|
23
|
+
import { useEntity, usePlayground } from '@flowgram-adapter/free-layout-editor';
|
|
24
|
+
|
|
25
|
+
import { useAutoLayout } from '../hooks';
|
|
26
|
+
import { WorkflowGlobalStateEntity } from '../../../entities';
|
|
27
|
+
|
|
28
|
+
export const AutoLayout = () => {
|
|
29
|
+
const runAutoLayout = useAutoLayout();
|
|
30
|
+
const playground = usePlayground();
|
|
31
|
+
const workflowState = useEntity<WorkflowGlobalStateEntity>(
|
|
32
|
+
WorkflowGlobalStateEntity,
|
|
33
|
+
);
|
|
34
|
+
const { workflowId } = workflowState;
|
|
35
|
+
const autoLayout = useCallback(async () => {
|
|
36
|
+
await runAutoLayout();
|
|
37
|
+
reporter.event({
|
|
38
|
+
eventName: 'workflow_control_auto_layout',
|
|
39
|
+
namespace: 'workflow',
|
|
40
|
+
scope: 'control', // Secondary namespace to refine specific scenarios
|
|
41
|
+
meta: {
|
|
42
|
+
workflowId,
|
|
43
|
+
}, // For other custom information, try to avoid reporting irrelevant or redundant information
|
|
44
|
+
});
|
|
45
|
+
}, [runAutoLayout, workflowId]);
|
|
46
|
+
|
|
47
|
+
if (playground.config.readonly) {
|
|
48
|
+
return <></>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Tooltip content={I18n.t('workflow_detail_layout_optimization_tooltip')}>
|
|
53
|
+
<IconButton
|
|
54
|
+
onClick={autoLayout}
|
|
55
|
+
icon={<IconCozAutoLayout className="coz-fg-primary" />}
|
|
56
|
+
color="secondary"
|
|
57
|
+
data-testid="workflow.detail.toolbar.auto-layout"
|
|
58
|
+
/>
|
|
59
|
+
</Tooltip>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useState } from 'react';
|
|
18
|
+
|
|
19
|
+
import { StandardNodeType } from '@coze-workflow/base';
|
|
20
|
+
import { I18n } from '@coze-arch/i18n';
|
|
21
|
+
import { IconCozComment } from '@coze-arch/coze-design/icons';
|
|
22
|
+
import { Tooltip, IconButton } from '@coze-arch/coze-design';
|
|
23
|
+
import { FlowNodeTransformData } from '@flowgram-adapter/free-layout-editor';
|
|
24
|
+
import {
|
|
25
|
+
WorkflowDocument,
|
|
26
|
+
type WorkflowNodeEntity,
|
|
27
|
+
type WorkflowNodeMeta,
|
|
28
|
+
WorkflowSelectService,
|
|
29
|
+
usePlayground,
|
|
30
|
+
useService,
|
|
31
|
+
} from '@flowgram-adapter/free-layout-editor';
|
|
32
|
+
|
|
33
|
+
import { WorkflowCustomDragService } from '@/services';
|
|
34
|
+
|
|
35
|
+
export const Comment = () => {
|
|
36
|
+
const playground = usePlayground();
|
|
37
|
+
const document = useService(WorkflowDocument);
|
|
38
|
+
const selectService = useService(WorkflowSelectService);
|
|
39
|
+
const dragService = useService(WorkflowCustomDragService);
|
|
40
|
+
|
|
41
|
+
const [tooltipVisible, setTooltipVisible] = useState(false);
|
|
42
|
+
|
|
43
|
+
const calcNodePosition = useCallback(
|
|
44
|
+
(
|
|
45
|
+
mouseEvent: React.MouseEvent<HTMLButtonElement>,
|
|
46
|
+
containerNode?: WorkflowNodeEntity,
|
|
47
|
+
) => {
|
|
48
|
+
const mousePosition = playground.config.getPosFromMouseEvent(mouseEvent);
|
|
49
|
+
if (!containerNode) {
|
|
50
|
+
return {
|
|
51
|
+
x: mousePosition.x,
|
|
52
|
+
y: mousePosition.y - 75,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const containerTransform = containerNode.getData(FlowNodeTransformData);
|
|
56
|
+
const childrenLength = containerNode.collapsedChildren.length;
|
|
57
|
+
return {
|
|
58
|
+
x:
|
|
59
|
+
containerTransform.padding.left -
|
|
60
|
+
containerTransform.padding.left +
|
|
61
|
+
childrenLength * 30,
|
|
62
|
+
y: containerTransform.padding.top + childrenLength * 30,
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
[playground],
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const createComment = useCallback(
|
|
69
|
+
async (mouseEvent: React.MouseEvent<HTMLButtonElement>) => {
|
|
70
|
+
setTooltipVisible(false);
|
|
71
|
+
let containerNode: WorkflowNodeEntity | undefined;
|
|
72
|
+
if (
|
|
73
|
+
selectService.activatedNode?.getNodeMeta<WorkflowNodeMeta>().isContainer
|
|
74
|
+
) {
|
|
75
|
+
containerNode = selectService.activatedNode;
|
|
76
|
+
}
|
|
77
|
+
const canvasPosition = calcNodePosition(mouseEvent, containerNode);
|
|
78
|
+
// Create Node
|
|
79
|
+
const node = await document.createWorkflowNodeByType(
|
|
80
|
+
StandardNodeType.Comment,
|
|
81
|
+
canvasPosition,
|
|
82
|
+
{},
|
|
83
|
+
containerNode?.id,
|
|
84
|
+
);
|
|
85
|
+
// Wait for node to render
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
if (containerNode) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// selected node
|
|
91
|
+
selectService.selectNode(node);
|
|
92
|
+
// Start dragging
|
|
93
|
+
dragService.startDragSelectedNodes(mouseEvent);
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- waiting for node render
|
|
95
|
+
}, 50);
|
|
96
|
+
},
|
|
97
|
+
[selectService, calcNodePosition, document, dragService],
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
if (playground.config.readonly) {
|
|
101
|
+
return <></>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<Tooltip
|
|
106
|
+
trigger="custom"
|
|
107
|
+
visible={tooltipVisible}
|
|
108
|
+
onVisibleChange={setTooltipVisible}
|
|
109
|
+
content={I18n.t('workflow_toolbar_comment_tooltips')}
|
|
110
|
+
>
|
|
111
|
+
<IconButton
|
|
112
|
+
icon={<IconCozComment className="coz-fg-primary" />}
|
|
113
|
+
color="secondary"
|
|
114
|
+
data-testid="workflow.detail.controls.comment"
|
|
115
|
+
onClick={createComment}
|
|
116
|
+
onMouseEnter={() => setTooltipVisible(true)}
|
|
117
|
+
onMouseLeave={() => setTooltipVisible(false)}
|
|
118
|
+
/>
|
|
119
|
+
</Tooltip>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useToolbarHandlers } from '../hooks';
|
|
18
|
+
import { Tools } from './tools';
|
|
19
|
+
import { Minimap } from './minimap';
|
|
20
|
+
|
|
21
|
+
import css from './tools.module.less';
|
|
22
|
+
|
|
23
|
+
export const ToolbarContainer = ({
|
|
24
|
+
disableTraceAndTestRun,
|
|
25
|
+
}: {
|
|
26
|
+
disableTraceAndTestRun?: boolean;
|
|
27
|
+
}) => {
|
|
28
|
+
const handlers = useToolbarHandlers();
|
|
29
|
+
|
|
30
|
+
if (disableTraceAndTestRun) {
|
|
31
|
+
return <></>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className={css.tools}>
|
|
36
|
+
<div>
|
|
37
|
+
<Minimap handlers={handlers} />
|
|
38
|
+
<Tools handlers={handlers} />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useEffect, useState } from 'react';
|
|
18
|
+
|
|
19
|
+
import { I18n } from '@coze-arch/i18n';
|
|
20
|
+
import { Tooltip } from '@coze-arch/coze-design';
|
|
21
|
+
import { usePlaygroundTools } from '@flowgram-adapter/free-layout-editor';
|
|
22
|
+
import { type InteractiveType as IdeInteractiveType } from '@flowgram-adapter/free-layout-editor';
|
|
23
|
+
import {
|
|
24
|
+
GuidingPopover,
|
|
25
|
+
InteractiveType,
|
|
26
|
+
MousePadSelector,
|
|
27
|
+
getPreferInteractiveType,
|
|
28
|
+
setPreferInteractiveType,
|
|
29
|
+
} from '@coze-common/mouse-pad-selector';
|
|
30
|
+
|
|
31
|
+
export const Interactive = () => {
|
|
32
|
+
const tools = usePlaygroundTools();
|
|
33
|
+
|
|
34
|
+
const [interactiveType, setInteractiveType] = useState<InteractiveType>(
|
|
35
|
+
() => getPreferInteractiveType() as InteractiveType,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const [showInteractivePanel, setShowInteractivePanel] = useState(false);
|
|
39
|
+
|
|
40
|
+
const mousePadTooltip = I18n.t(
|
|
41
|
+
interactiveType === InteractiveType.Mouse
|
|
42
|
+
? 'workflow_mouse_friendly'
|
|
43
|
+
: 'workflow_pad_friendly',
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
tools.setMouseScrollDelta(zoom => zoom / 20);
|
|
48
|
+
|
|
49
|
+
// Read interactive mode from cache, application takes effect
|
|
50
|
+
const preferInteractiveType = getPreferInteractiveType();
|
|
51
|
+
tools.setInteractiveType(preferInteractiveType as IdeInteractiveType);
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- init
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<GuidingPopover>
|
|
57
|
+
<Tooltip
|
|
58
|
+
content={mousePadTooltip}
|
|
59
|
+
style={{ display: showInteractivePanel ? 'none' : 'block' }}
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
className="workflow-toolbar-interactive"
|
|
63
|
+
data-testid="workflow.detail.toolbar.interactive"
|
|
64
|
+
>
|
|
65
|
+
<MousePadSelector
|
|
66
|
+
value={interactiveType}
|
|
67
|
+
onChange={value => {
|
|
68
|
+
setInteractiveType(value);
|
|
69
|
+
setPreferInteractiveType(value);
|
|
70
|
+
tools.setInteractiveType(value as unknown as IdeInteractiveType);
|
|
71
|
+
}}
|
|
72
|
+
onPopupVisibleChange={setShowInteractivePanel}
|
|
73
|
+
containerStyle={{
|
|
74
|
+
border: 'none',
|
|
75
|
+
height: '24px',
|
|
76
|
+
width: '38px',
|
|
77
|
+
justifyContent: 'center',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
gap: '2px',
|
|
80
|
+
padding: '4px',
|
|
81
|
+
paddingTop: '1px',
|
|
82
|
+
borderRadius: 'var(--small, 6px)',
|
|
83
|
+
}}
|
|
84
|
+
iconStyle={{
|
|
85
|
+
margin: '0',
|
|
86
|
+
width: '16px',
|
|
87
|
+
height: '16px',
|
|
88
|
+
}}
|
|
89
|
+
arrowStyle={{
|
|
90
|
+
width: '12px',
|
|
91
|
+
height: '12px',
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</Tooltip>
|
|
96
|
+
</GuidingPopover>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { I18n } from '@coze-arch/i18n';
|
|
18
|
+
import { IconCozRectangleMap } from '@coze-arch/coze-design/icons';
|
|
19
|
+
import { Tooltip, IconButton } from '@coze-arch/coze-design';
|
|
20
|
+
|
|
21
|
+
import type { ITool } from '../type';
|
|
22
|
+
|
|
23
|
+
export const MinimapSwitch = (props: ITool) => {
|
|
24
|
+
const { handlers } = props;
|
|
25
|
+
const { minimapVisible, setMinimapVisible } = handlers;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Tooltip content={I18n.t('workflow_toolbar_minimap_tooltips')}>
|
|
29
|
+
<IconButton
|
|
30
|
+
icon={
|
|
31
|
+
<IconCozRectangleMap
|
|
32
|
+
className={minimapVisible ? undefined : 'coz-fg-primary'}
|
|
33
|
+
/>
|
|
34
|
+
}
|
|
35
|
+
color={minimapVisible ? 'highlight' : 'secondary'}
|
|
36
|
+
data-testid="workflow.detail.toolbar.minimap-switch"
|
|
37
|
+
onClick={() => setMinimapVisible(!minimapVisible)}
|
|
38
|
+
/>
|
|
39
|
+
</Tooltip>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* stylelint-disable declaration-no-important */
|
|
2
|
+
.tools {
|
|
3
|
+
pointer-events: none;
|
|
4
|
+
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: 16px;
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-width: 360px;
|
|
13
|
+
padding: 0 8px;
|
|
14
|
+
|
|
15
|
+
:global .minimap-panel {
|
|
16
|
+
border: 1px solid var(--coz-stroke-plus) !important;
|
|
17
|
+
box-shadow: var(--coz-shadow-small) !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.tools-wrap {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-wrap: wrap-reverse;
|
|
24
|
+
gap: 8px;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tools-section {
|
|
29
|
+
pointer-events: auto;
|
|
30
|
+
|
|
31
|
+
display: flex;
|
|
32
|
+
column-gap: 2px;
|
|
33
|
+
align-items: center;
|
|
34
|
+
|
|
35
|
+
height: 40px;
|
|
36
|
+
padding: 0 4px;
|
|
37
|
+
|
|
38
|
+
background-color: var(--coz-bg-max);
|
|
39
|
+
border: 1px solid var(--coz-stroke-plus);
|
|
40
|
+
border-radius: 10px;
|
|
41
|
+
box-shadow: var(--coz-shadow-small);
|
|
42
|
+
|
|
43
|
+
&.test-run {
|
|
44
|
+
column-gap: 4px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useRef, type RefObject } from 'react';
|
|
18
|
+
|
|
19
|
+
import cls from 'classnames';
|
|
20
|
+
import { usePlayground } from '@flowgram-adapter/free-layout-editor';
|
|
21
|
+
import { Divider } from '@coze-arch/coze-design';
|
|
22
|
+
|
|
23
|
+
import { useTemplateService } from '@/hooks/use-template-service';
|
|
24
|
+
|
|
25
|
+
import type { ITool } from '../type';
|
|
26
|
+
import { StartTestRunButton } from '../../test-run/test-run-button/start-test-run-button';
|
|
27
|
+
import { OpenTraceButton } from '../../test-run/test-run-button/open-trace-button';
|
|
28
|
+
import { RoleButton } from '../../flow-role';
|
|
29
|
+
import { useGlobalState } from '../../../hooks';
|
|
30
|
+
import { Zoom } from './zoom';
|
|
31
|
+
import { MinimapSwitch } from './minimap-switch';
|
|
32
|
+
import { Interactive } from './interactive';
|
|
33
|
+
import { Comment } from './comment';
|
|
34
|
+
import { AutoLayout } from './auto-layout';
|
|
35
|
+
import { AddNode } from './add-node';
|
|
36
|
+
|
|
37
|
+
import css from './tools.module.less';
|
|
38
|
+
|
|
39
|
+
export const Tools = (props: ITool) => {
|
|
40
|
+
const templateState = useTemplateService();
|
|
41
|
+
|
|
42
|
+
const playground = usePlayground();
|
|
43
|
+
const { isChatflow } = useGlobalState();
|
|
44
|
+
const enableAddNode = !playground.config.readonly;
|
|
45
|
+
const toolbarRef = useRef<HTMLDivElement>();
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
className={cls(
|
|
49
|
+
css['tools-wrap'],
|
|
50
|
+
templateState.templateVisible ? 'bottom-[2px]' : 'bottom-[16px]',
|
|
51
|
+
)}
|
|
52
|
+
ref={toolbarRef as RefObject<HTMLDivElement>}
|
|
53
|
+
>
|
|
54
|
+
<div className={css['tools-section']}>
|
|
55
|
+
<Interactive />
|
|
56
|
+
<Zoom />
|
|
57
|
+
<Comment />
|
|
58
|
+
<AutoLayout />
|
|
59
|
+
<MinimapSwitch {...props} />
|
|
60
|
+
{enableAddNode ? (
|
|
61
|
+
<>
|
|
62
|
+
<Divider layout="vertical" style={{ height: '16px' }} margin={3} />
|
|
63
|
+
<AddNode {...props} toolbarRef={toolbarRef} />
|
|
64
|
+
</>
|
|
65
|
+
) : null}
|
|
66
|
+
</div>
|
|
67
|
+
<div className={cls(css['tools-section'], css['test-run'])}>
|
|
68
|
+
{isChatflow ? <RoleButton /> : null}
|
|
69
|
+
{/* The operation and maintenance platform does not need debugging and practice running, just need to view the information to troubleshoot problems */}
|
|
70
|
+
{IS_BOT_OP ? (
|
|
71
|
+
<OpenTraceButton />
|
|
72
|
+
) : (
|
|
73
|
+
<>
|
|
74
|
+
{isChatflow ? (
|
|
75
|
+
<Divider
|
|
76
|
+
layout="vertical"
|
|
77
|
+
style={{ height: '16px' }}
|
|
78
|
+
margin={3}
|
|
79
|
+
/>
|
|
80
|
+
) : null}
|
|
81
|
+
{/* will support soon */}
|
|
82
|
+
{!IS_OPEN_SOURCE && <OpenTraceButton />}
|
|
83
|
+
<StartTestRunButton />
|
|
84
|
+
</>
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 coze-dev Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
18
|
+
import { useMemo, useState, type CSSProperties } from 'react';
|
|
19
|
+
|
|
20
|
+
import { I18n } from '@coze-arch/i18n';
|
|
21
|
+
import { IconCozArrowDown } from '@coze-arch/coze-design/icons';
|
|
22
|
+
import { Dropdown, Divider } from '@coze-arch/coze-design';
|
|
23
|
+
import { usePlaygroundTools } from '@flowgram-adapter/free-layout-editor';
|
|
24
|
+
import { usePlayground } from '@flowgram-adapter/free-layout-editor';
|
|
25
|
+
|
|
26
|
+
export const Zoom = () => {
|
|
27
|
+
const tools = usePlaygroundTools();
|
|
28
|
+
const playground = usePlayground();
|
|
29
|
+
const [selected, setSelected] = useState(false);
|
|
30
|
+
const zoom = useMemo(() => {
|
|
31
|
+
const zoomValue = tools.zoom * 100;
|
|
32
|
+
return zoomValue.toFixed(0);
|
|
33
|
+
}, [tools.zoom]);
|
|
34
|
+
// In order to override the style of the cozed design, you cannot use tailwind css.
|
|
35
|
+
const zoomOptionStyle: CSSProperties = {
|
|
36
|
+
padding: '8px',
|
|
37
|
+
lineHeight: '16px',
|
|
38
|
+
};
|
|
39
|
+
return (
|
|
40
|
+
<Dropdown
|
|
41
|
+
clickToHide
|
|
42
|
+
position="top"
|
|
43
|
+
trigger="custom"
|
|
44
|
+
visible={selected}
|
|
45
|
+
onClickOutSide={() => setSelected(false)}
|
|
46
|
+
onVisibleChange={setSelected}
|
|
47
|
+
render={
|
|
48
|
+
<Dropdown.Menu>
|
|
49
|
+
<Dropdown.Item
|
|
50
|
+
data-testid="workflow.detail.toolbar.zoom.out"
|
|
51
|
+
style={zoomOptionStyle}
|
|
52
|
+
onClick={() => tools.zoomout()}
|
|
53
|
+
>
|
|
54
|
+
{I18n.t('workflow_toolbar_zoom_out')}
|
|
55
|
+
</Dropdown.Item>
|
|
56
|
+
<Dropdown.Item
|
|
57
|
+
data-testid="workflow.detail.toolbar.zoom.in"
|
|
58
|
+
style={zoomOptionStyle}
|
|
59
|
+
onClick={() => tools.zoomin()}
|
|
60
|
+
>
|
|
61
|
+
{I18n.t('workflow_toolbar_zoom_in')}
|
|
62
|
+
</Dropdown.Item>
|
|
63
|
+
<Dropdown.Item
|
|
64
|
+
data-testid="workflow.detail.toolbar.zoom.fit"
|
|
65
|
+
style={zoomOptionStyle}
|
|
66
|
+
onClick={() => tools.fitView()}
|
|
67
|
+
>
|
|
68
|
+
{I18n.t('workflow_toolbar_zoom_fit')}
|
|
69
|
+
</Dropdown.Item>
|
|
70
|
+
<Divider className="m-[4px] w-[108px]" />
|
|
71
|
+
<Dropdown.Item
|
|
72
|
+
data-testid="workflow.detail.toolbar.zoom.50"
|
|
73
|
+
style={zoomOptionStyle}
|
|
74
|
+
onClick={() => {
|
|
75
|
+
playground.config.updateZoom(0.5);
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
{I18n.t('workflow_toolbar_zoom_to')} 50%
|
|
79
|
+
</Dropdown.Item>
|
|
80
|
+
<Dropdown.Item
|
|
81
|
+
data-testid="workflow.detail.toolbar.zoom.100"
|
|
82
|
+
style={zoomOptionStyle}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
playground.config.updateZoom(1);
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
{I18n.t('workflow_toolbar_zoom_to')} 100%
|
|
88
|
+
</Dropdown.Item>
|
|
89
|
+
<Dropdown.Item
|
|
90
|
+
data-testid="workflow.detail.toolbar.zoom.150"
|
|
91
|
+
style={zoomOptionStyle}
|
|
92
|
+
onClick={() => {
|
|
93
|
+
playground.config.updateZoom(1.5);
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
{I18n.t('workflow_toolbar_zoom_to')} 150%
|
|
97
|
+
</Dropdown.Item>
|
|
98
|
+
<Dropdown.Item
|
|
99
|
+
data-testid="workflow.detail.toolbar.zoom.200"
|
|
100
|
+
style={zoomOptionStyle}
|
|
101
|
+
onClick={() => {
|
|
102
|
+
playground.config.updateZoom(2);
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
{I18n.t('workflow_toolbar_zoom_to')} 200%
|
|
106
|
+
</Dropdown.Item>
|
|
107
|
+
</Dropdown.Menu>
|
|
108
|
+
}
|
|
109
|
+
>
|
|
110
|
+
<div
|
|
111
|
+
className="workflow-toolbar-zoom flex justify-start items-center w-[70px] h-[24px] p-[2px] rounded-small border border-solid border-[var(--coz-stroke-plus)] cursor-pointer select-none"
|
|
112
|
+
data-testid="workflow.detail.toolbar.zoom"
|
|
113
|
+
onClick={() => setSelected(!selected)}
|
|
114
|
+
style={{
|
|
115
|
+
borderColor: selected
|
|
116
|
+
? 'var(--coz-stroke-hglt)'
|
|
117
|
+
: 'var(--coz-stroke-plus)',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<p className="text-[12px] flex items-center mx-[4px] w-[40px] h-[20px]">
|
|
121
|
+
{zoom}%
|
|
122
|
+
</p>
|
|
123
|
+
<div
|
|
124
|
+
className="flex items-center justify-center pr-[2px] color-[var(--coz-fg-secondary)]"
|
|
125
|
+
style={{
|
|
126
|
+
color: 'var(--coz-fg-secondary)',
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<IconCozArrowDown />
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</Dropdown>
|
|
133
|
+
);
|
|
134
|
+
};
|