@fudanda/workflow 0.0.0-stage → 2.20261024.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 +114 -3
- 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 +63 -0
- package/dist/graph-scope.d.ts +78 -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/observation-types.d.ts +6 -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-L6xw9phk.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,34 @@
|
|
|
1
|
+
|
|
2
|
+
.cm-content {
|
|
3
|
+
.slot-content {
|
|
4
|
+
color: #4E40E5;
|
|
5
|
+
word-break: break-all;
|
|
6
|
+
background-color: rgba(186, 192, 255, 20%);
|
|
7
|
+
|
|
8
|
+
/* padding: 2px 0; */
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.slot-side-left {
|
|
12
|
+
/* padding: 2px 0 2px 5px; */
|
|
13
|
+
padding-left: 5px;
|
|
14
|
+
background-color: rgba(186, 192, 255, 20%);
|
|
15
|
+
border-radius: 4px 0 0 4px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.slot-side-right {
|
|
19
|
+
margin-right: 4px;
|
|
20
|
+
|
|
21
|
+
/* padding: 2px 5px 2px 0; */
|
|
22
|
+
padding-right: 5px;
|
|
23
|
+
background-color: rgba(186, 192, 255, 20%);
|
|
24
|
+
border-radius: 0 5px 5px 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.slot-placeholder {
|
|
28
|
+
color: rgba(148, 152, 247, 70%);
|
|
29
|
+
word-break: break-all;
|
|
30
|
+
background-color: rgba(186, 192, 255, 20%);
|
|
31
|
+
|
|
32
|
+
/* padding: 2px 0; */
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
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 { ConfigModeWidgetPopover } from './config-mode-popover';
|
|
18
|
+
|
|
19
|
+
import './index.css';
|
|
20
|
+
import { useEffect, useLayoutEffect } from 'react';
|
|
21
|
+
|
|
22
|
+
import { useEditor, useInjector } from '@coze-editor/editor/react';
|
|
23
|
+
import { type EditorAPI } from '@coze-editor/editor/preset-prompt';
|
|
24
|
+
import {
|
|
25
|
+
astDecorator,
|
|
26
|
+
SpanWidget,
|
|
27
|
+
autoSelectRanges,
|
|
28
|
+
selectionEnlarger,
|
|
29
|
+
deletionEnlarger,
|
|
30
|
+
} from '@coze-editor/editor';
|
|
31
|
+
import { type ViewUpdate } from '@codemirror/view';
|
|
32
|
+
|
|
33
|
+
import {
|
|
34
|
+
type MarkRangeInfo,
|
|
35
|
+
TemplateParser,
|
|
36
|
+
} from '../../shared/utils/template-parser';
|
|
37
|
+
import { useReadonly } from '../../shared/hooks/use-editor-readonly';
|
|
38
|
+
interface InputSlotWidgetProps {
|
|
39
|
+
mode?: 'input' | 'configurable';
|
|
40
|
+
onSelectionInInputSlot?: (selection: MarkRangeInfo | undefined) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const templateParser = new TemplateParser({ mark: 'InputSlot' });
|
|
44
|
+
|
|
45
|
+
export const InputSlotWidget = (props: InputSlotWidgetProps) => {
|
|
46
|
+
const { mode, onSelectionInInputSlot } = props;
|
|
47
|
+
const injector = useInjector();
|
|
48
|
+
const editor = useEditor<EditorAPI>();
|
|
49
|
+
const readonly = useReadonly();
|
|
50
|
+
|
|
51
|
+
useLayoutEffect(() => {
|
|
52
|
+
const { markInfoField } = templateParser;
|
|
53
|
+
|
|
54
|
+
return injector.inject([
|
|
55
|
+
astDecorator.whole.of((cursor, state) => {
|
|
56
|
+
if (templateParser.isOpenNode(cursor.node, state)) {
|
|
57
|
+
const open = cursor.node;
|
|
58
|
+
const close = templateParser.findCloseNode(open, state);
|
|
59
|
+
|
|
60
|
+
if (close) {
|
|
61
|
+
const openTemplate = state.sliceDoc(open.from, open.to);
|
|
62
|
+
const data = templateParser.getData(openTemplate);
|
|
63
|
+
const from = open.to;
|
|
64
|
+
const to = close.from;
|
|
65
|
+
|
|
66
|
+
if (from === to) {
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
type: 'replace',
|
|
70
|
+
widget: new SpanWidget({
|
|
71
|
+
className: 'slot-side-left',
|
|
72
|
+
}),
|
|
73
|
+
atomicRange: true,
|
|
74
|
+
from: open.from,
|
|
75
|
+
to: open.to,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'widget',
|
|
79
|
+
widget: new SpanWidget({
|
|
80
|
+
text: data?.placeholder || '',
|
|
81
|
+
className: 'slot-placeholder',
|
|
82
|
+
}),
|
|
83
|
+
from,
|
|
84
|
+
atomicRange: true,
|
|
85
|
+
side: 1,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'replace',
|
|
89
|
+
widget: new SpanWidget({
|
|
90
|
+
className: 'slot-side-right',
|
|
91
|
+
}),
|
|
92
|
+
atomicRange: true,
|
|
93
|
+
from: close.from,
|
|
94
|
+
to: close.to,
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
return [
|
|
99
|
+
{
|
|
100
|
+
type: 'replace',
|
|
101
|
+
widget: new SpanWidget({
|
|
102
|
+
className: 'slot-side-left',
|
|
103
|
+
}),
|
|
104
|
+
atomicRange: true,
|
|
105
|
+
from: open.from,
|
|
106
|
+
to: open.to,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: 'className',
|
|
110
|
+
className: 'slot-content',
|
|
111
|
+
from,
|
|
112
|
+
to,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: 'replace',
|
|
116
|
+
widget: new SpanWidget({ className: 'slot-side-right' }),
|
|
117
|
+
atomicRange: true,
|
|
118
|
+
from: close.from,
|
|
119
|
+
to: close.to,
|
|
120
|
+
},
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}),
|
|
125
|
+
|
|
126
|
+
markInfoField,
|
|
127
|
+
|
|
128
|
+
autoSelectRanges.of(state => state.field(markInfoField).contents),
|
|
129
|
+
|
|
130
|
+
selectionEnlarger.of(state => state.field(markInfoField).specs),
|
|
131
|
+
|
|
132
|
+
deletionEnlarger.of(state => state.field(markInfoField).specs),
|
|
133
|
+
]);
|
|
134
|
+
}, [injector]);
|
|
135
|
+
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (!editor) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const handleViewUpdate = (update: ViewUpdate) => {
|
|
141
|
+
if (!update.state.selection.main.empty) {
|
|
142
|
+
const markRangeInfo = templateParser.getSelectionInMarkNodeRange(
|
|
143
|
+
update.state.selection.main,
|
|
144
|
+
update.state,
|
|
145
|
+
);
|
|
146
|
+
if (markRangeInfo) {
|
|
147
|
+
onSelectionInInputSlot?.(markRangeInfo);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
onSelectionInInputSlot?.(undefined);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
editor.$on('viewUpdate', handleViewUpdate);
|
|
154
|
+
return () => {
|
|
155
|
+
editor.$off('viewUpdate', handleViewUpdate);
|
|
156
|
+
};
|
|
157
|
+
}, [editor]);
|
|
158
|
+
|
|
159
|
+
if (mode === 'configurable' && !readonly) {
|
|
160
|
+
return (
|
|
161
|
+
<ConfigModeWidgetPopover
|
|
162
|
+
direction="bottomLeft"
|
|
163
|
+
templateParser={templateParser}
|
|
164
|
+
/>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
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 { useState } from 'react';
|
|
18
|
+
|
|
19
|
+
import cls from 'classnames';
|
|
20
|
+
import { ActionKey } from '@coze-arch/idl/resource';
|
|
21
|
+
import { type ResourceAction } from '@coze-arch/idl/plugin_develop';
|
|
22
|
+
import { I18n } from '@coze-arch/i18n';
|
|
23
|
+
import { IconCozMore } from '@coze-arch/coze-design/icons';
|
|
24
|
+
import { Tooltip, Typography } from '@coze-arch/coze-design';
|
|
25
|
+
const { Text } = Typography;
|
|
26
|
+
|
|
27
|
+
export interface LibraryItemProps {
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description: string;
|
|
31
|
+
isSelected?: boolean;
|
|
32
|
+
onActive?: (id: string) => void;
|
|
33
|
+
actions?: ResourceAction[];
|
|
34
|
+
onDeleteAction?: (id: string) => void;
|
|
35
|
+
onEditAction?: (id: string) => void;
|
|
36
|
+
}
|
|
37
|
+
const actionsMap: {
|
|
38
|
+
[key in ActionKey.Delete | ActionKey.Edit]: string;
|
|
39
|
+
} = {
|
|
40
|
+
[ActionKey.Delete]: I18n.t('Delete'),
|
|
41
|
+
[ActionKey.Edit]: I18n.t('Edit'),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const LibraryItem = ({
|
|
45
|
+
id,
|
|
46
|
+
title,
|
|
47
|
+
description,
|
|
48
|
+
actions,
|
|
49
|
+
isSelected,
|
|
50
|
+
onActive,
|
|
51
|
+
onDeleteAction,
|
|
52
|
+
onEditAction,
|
|
53
|
+
}: LibraryItemProps) => {
|
|
54
|
+
const [isHover, setIsHover] = useState(false);
|
|
55
|
+
const handleActions = (action: ActionKey) => {
|
|
56
|
+
if (action === ActionKey.Delete) {
|
|
57
|
+
onDeleteAction?.(id);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (action === ActionKey.Edit) {
|
|
61
|
+
onEditAction?.(id);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
<div
|
|
67
|
+
className={cls(
|
|
68
|
+
'w-full flex flex-row justify-between items-center overflow-hidden px-3 h-[64px]',
|
|
69
|
+
'relative',
|
|
70
|
+
'after:content-[""] after:absolute after:left-0 after:right-0',
|
|
71
|
+
'after:bottom-0 after:h-[1px] after:coz-mg-primary',
|
|
72
|
+
'hover:coz-mg-secondary-hovered hover:rounded hover:after:hidden',
|
|
73
|
+
'cursor-pointer',
|
|
74
|
+
{
|
|
75
|
+
'rounded coz-mg-primary after:hidden': isSelected,
|
|
76
|
+
},
|
|
77
|
+
)}
|
|
78
|
+
onClick={() => {
|
|
79
|
+
onActive?.(id);
|
|
80
|
+
}}
|
|
81
|
+
onMouseEnter={() => {
|
|
82
|
+
setIsHover(true);
|
|
83
|
+
}}
|
|
84
|
+
onMouseLeave={() => {
|
|
85
|
+
setIsHover(false);
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
<div className="flex flex-1 min-w-[0px] w-0 flex-col gap-[2px]">
|
|
89
|
+
<Text className="text-lg flex-1 font-medium" ellipsis>
|
|
90
|
+
{title}
|
|
91
|
+
</Text>
|
|
92
|
+
<Text
|
|
93
|
+
className="text-base"
|
|
94
|
+
ellipsis={{
|
|
95
|
+
rows: 1,
|
|
96
|
+
showTooltip: {
|
|
97
|
+
opts: {
|
|
98
|
+
position: 'right',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
{description}
|
|
104
|
+
</Text>
|
|
105
|
+
</div>
|
|
106
|
+
<Tooltip
|
|
107
|
+
position="bottom"
|
|
108
|
+
className="!p-1"
|
|
109
|
+
content={
|
|
110
|
+
<div className="flex flex-col gap-[2px] w-[120px]">
|
|
111
|
+
{actions
|
|
112
|
+
?.filter(action => action.enable)
|
|
113
|
+
?.filter(action => action.key in actionsMap)
|
|
114
|
+
.map(action => (
|
|
115
|
+
<div
|
|
116
|
+
key={action.key}
|
|
117
|
+
onClick={() => handleActions(action.key as ActionKey)}
|
|
118
|
+
className="w-full text-sm h-[32px] p-2 flex items-center cursor-pointer hover:coz-mg-primary-hovered hover:rounded-mini"
|
|
119
|
+
>
|
|
120
|
+
{actionsMap[action.key as keyof typeof actionsMap]}
|
|
121
|
+
</div>
|
|
122
|
+
))}
|
|
123
|
+
</div>
|
|
124
|
+
}
|
|
125
|
+
>
|
|
126
|
+
<div
|
|
127
|
+
className={cls(
|
|
128
|
+
'w-6 h-6 rounded-little coz-mg-secondary-hovered flex items-center justify-center',
|
|
129
|
+
{
|
|
130
|
+
hidden: !actions?.length || !isHover,
|
|
131
|
+
},
|
|
132
|
+
)}
|
|
133
|
+
onClick={e => e.stopPropagation()}
|
|
134
|
+
>
|
|
135
|
+
<IconCozMore />
|
|
136
|
+
</div>
|
|
137
|
+
</Tooltip>
|
|
138
|
+
</div>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
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, type ComponentProps } from 'react';
|
|
18
|
+
|
|
19
|
+
import { withField, FormInput, FormTextArea } from '@coze-arch/coze-design';
|
|
20
|
+
|
|
21
|
+
interface PromptInfoInputProps {
|
|
22
|
+
readonly?: boolean;
|
|
23
|
+
initCount?: number;
|
|
24
|
+
value?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
rows?: number;
|
|
27
|
+
field: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
maxLength?: number;
|
|
31
|
+
maxCount?: number;
|
|
32
|
+
rules?: ComponentProps<typeof FormInput>['rules'];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const PromptInfoInput = (props: PromptInfoInputProps) => {
|
|
36
|
+
const { initCount, disabled, rows } = props;
|
|
37
|
+
const [count, setCount] = useState(initCount || 0);
|
|
38
|
+
|
|
39
|
+
const handleChange = (v: string) => {
|
|
40
|
+
setCount(v.length);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setCount(initCount || 0);
|
|
45
|
+
}, [initCount]);
|
|
46
|
+
|
|
47
|
+
const countSuffix = (
|
|
48
|
+
<div className="overflow-hidden coz-fg-secondary text-sm pr-[9px]">{`${count}/${props.maxCount}`}</div>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
if (disabled) {
|
|
52
|
+
return <ReadonlyInput {...props} />;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (rows && rows > 1) {
|
|
56
|
+
return (
|
|
57
|
+
<FormTextArea
|
|
58
|
+
{...props}
|
|
59
|
+
autosize
|
|
60
|
+
autoComplete="off"
|
|
61
|
+
onChange={(value: string) => handleChange(value)}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<FormInput
|
|
68
|
+
{...props}
|
|
69
|
+
autoComplete="off"
|
|
70
|
+
suffix={countSuffix}
|
|
71
|
+
onChange={value => handleChange(value)}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const ReadonlyInputCom = (props: PromptInfoInputProps) => {
|
|
77
|
+
const { value } = props;
|
|
78
|
+
return (
|
|
79
|
+
<div className="w-full">
|
|
80
|
+
<div className="coz-fg-secondary text-base break-all whitespace-pre-line">
|
|
81
|
+
{value}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const ReadonlyInput = withField(ReadonlyInputCom, {
|
|
88
|
+
valueKey: 'value',
|
|
89
|
+
onKeyChangeFnName: 'onChange',
|
|
90
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
.icon {
|
|
3
|
+
color: #4d53e8;
|
|
4
|
+
|
|
5
|
+
&>svg {
|
|
6
|
+
color: #4d53e8;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.disabled {
|
|
12
|
+
.icon {
|
|
13
|
+
color: var(--light-usage-disabled-color-disabled-text, rgb(28 31 35 / 35%));
|
|
14
|
+
|
|
15
|
+
&>svg {
|
|
16
|
+
color: var(--light-usage-disabled-color-disabled-text, rgb(28 31 35 / 35%));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 React from 'react';
|
|
18
|
+
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
import { IconCozAddNode } from '@coze-arch/coze-design/icons';
|
|
21
|
+
import { IconButton, type ButtonProps } from '@coze-arch/coze-design';
|
|
22
|
+
import { IconAdd } from '@coze-arch/bot-icons';
|
|
23
|
+
|
|
24
|
+
import styles from './index.module.less';
|
|
25
|
+
|
|
26
|
+
type AddOperationProps = React.PropsWithChildren<{
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
29
|
+
className?: string;
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
subitem?: boolean;
|
|
33
|
+
size?: ButtonProps['size'];
|
|
34
|
+
color?: ButtonProps['color'];
|
|
35
|
+
}>;
|
|
36
|
+
|
|
37
|
+
export default function AddOperation({
|
|
38
|
+
readonly,
|
|
39
|
+
onClick,
|
|
40
|
+
className,
|
|
41
|
+
style,
|
|
42
|
+
disabled,
|
|
43
|
+
subitem = false,
|
|
44
|
+
size,
|
|
45
|
+
color,
|
|
46
|
+
...restProps
|
|
47
|
+
}: AddOperationProps) {
|
|
48
|
+
if (readonly) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return (
|
|
52
|
+
<IconButton
|
|
53
|
+
data-testid={restProps['data-testid']}
|
|
54
|
+
onClick={onClick}
|
|
55
|
+
className={classNames(
|
|
56
|
+
styles.container,
|
|
57
|
+
disabled ? styles.disabled : null,
|
|
58
|
+
className,
|
|
59
|
+
)}
|
|
60
|
+
style={style}
|
|
61
|
+
icon={subitem ? <IconCozAddNode /> : <IconAdd className={styles.icon} />}
|
|
62
|
+
disabled={disabled}
|
|
63
|
+
size={size}
|
|
64
|
+
color={color}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* stylelint-disable declaration-no-important */
|
|
2
|
+
.popup_container {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
|
|
7
|
+
.nano {
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
|
|
14
|
+
align-self: stretch;
|
|
15
|
+
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
:global {
|
|
20
|
+
.semi-portal-inner {
|
|
21
|
+
left: 50% !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tooltip {
|
|
28
|
+
&.top-level {
|
|
29
|
+
max-width: 400px;
|
|
30
|
+
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
font-style: normal;
|
|
34
|
+
line-height: 22px;
|
|
35
|
+
word-break: break-word;
|
|
36
|
+
|
|
37
|
+
border-radius: 6px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 React, { type PropsWithChildren, useRef } from 'react';
|
|
18
|
+
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
import { Tooltip, type TooltipProps } from '@coze-arch/coze-design';
|
|
21
|
+
|
|
22
|
+
import styles from './index.module.less';
|
|
23
|
+
|
|
24
|
+
type AutoSizeTooltipProps = PropsWithChildren<
|
|
25
|
+
{
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
containerClassName?: string;
|
|
29
|
+
containerStyle?: React.CSSProperties;
|
|
30
|
+
tooltipClassName?: string;
|
|
31
|
+
tooltipStyle?: React.CSSProperties;
|
|
32
|
+
} & Omit<TooltipProps, 'className' | 'style'>
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
export default function AutoSizeTooltip({
|
|
36
|
+
children,
|
|
37
|
+
className,
|
|
38
|
+
style,
|
|
39
|
+
tooltipClassName,
|
|
40
|
+
tooltipStyle,
|
|
41
|
+
containerClassName,
|
|
42
|
+
containerStyle,
|
|
43
|
+
...rest
|
|
44
|
+
}: AutoSizeTooltipProps) {
|
|
45
|
+
const nanoRef = useRef<HTMLDivElement | null>(null);
|
|
46
|
+
const renderContent = () => (
|
|
47
|
+
<>
|
|
48
|
+
<div
|
|
49
|
+
ref={nanoRef}
|
|
50
|
+
className={classNames(styles.nano, containerClassName)}
|
|
51
|
+
style={containerStyle}
|
|
52
|
+
/>
|
|
53
|
+
<Tooltip
|
|
54
|
+
{...rest}
|
|
55
|
+
className={classNames(
|
|
56
|
+
styles.tooltip,
|
|
57
|
+
styles['top-level'],
|
|
58
|
+
tooltipClassName,
|
|
59
|
+
)}
|
|
60
|
+
style={{ left: 0, ...tooltipStyle }}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</Tooltip>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
className={classNames(styles.popup_container, className)}
|
|
69
|
+
style={style}
|
|
70
|
+
>
|
|
71
|
+
{renderContent()}
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.input-wrapper {
|
|
2
|
+
width: 100%;
|
|
3
|
+
span {
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
.error-content {
|
|
8
|
+
height: 20px;
|
|
9
|
+
}
|
|
10
|
+
.error-float {
|
|
11
|
+
width: 100%;
|
|
12
|
+
position: absolute;
|
|
13
|
+
}
|
|
14
|
+
.error-text {
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
padding-top: 2px;
|
|
17
|
+
padding-left: 12px;
|
|
18
|
+
color: @error-red;
|
|
19
|
+
position: absolute;
|
|
20
|
+
}
|
|
21
|
+
.input {
|
|
22
|
+
input {
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.limit-count {
|
|
28
|
+
padding-left: 8px;
|
|
29
|
+
padding-right: 12px;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
color: var(--light-usage-text-color-text-3, rgba(28, 31, 35, 0.35));
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
font-style: normal;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
line-height: 16px;
|
|
36
|
+
}
|