@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,71 @@
|
|
|
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 { createRenderer, option } from '@coze-editor/editor/react';
|
|
18
|
+
import universal from '@coze-editor/editor/preset-universal';
|
|
19
|
+
import { mixLanguages } from '@coze-editor/editor';
|
|
20
|
+
import { keymap, EditorView } from '@codemirror/view';
|
|
21
|
+
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
|
22
|
+
|
|
23
|
+
const RawEditorTheme = EditorView.theme({
|
|
24
|
+
'&.cm-editor': {
|
|
25
|
+
outline: 'none',
|
|
26
|
+
},
|
|
27
|
+
'&.cm-content': {
|
|
28
|
+
wordBreak: 'break-all',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const minHeightOption = (value?: string | number) =>
|
|
33
|
+
EditorView.theme({
|
|
34
|
+
'.cm-content, .cm-gutter, .cm-right-gutter': {
|
|
35
|
+
minHeight:
|
|
36
|
+
typeof value === 'number'
|
|
37
|
+
? `${value}px`
|
|
38
|
+
: typeof value === 'string'
|
|
39
|
+
? value
|
|
40
|
+
: 'unset',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const lineHeightOption = (value?: string | number) =>
|
|
45
|
+
EditorView.theme({
|
|
46
|
+
'.cm-content, .cm-gutter, .cm-right-gutter': {
|
|
47
|
+
lineHeight:
|
|
48
|
+
typeof value === 'number'
|
|
49
|
+
? `${value}px`
|
|
50
|
+
: typeof value === 'string'
|
|
51
|
+
? value
|
|
52
|
+
: 'unset',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const extensions = [
|
|
57
|
+
mixLanguages({}),
|
|
58
|
+
RawEditorTheme,
|
|
59
|
+
// ... Other extensions
|
|
60
|
+
history(),
|
|
61
|
+
keymap.of([...defaultKeymap, ...historyKeymap]),
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const TextEditor = createRenderer(
|
|
65
|
+
[
|
|
66
|
+
...universal,
|
|
67
|
+
option('minHeight', minHeightOption),
|
|
68
|
+
option('lineHeight', lineHeightOption),
|
|
69
|
+
],
|
|
70
|
+
extensions,
|
|
71
|
+
);
|
|
@@ -0,0 +1,117 @@
|
|
|
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 { CommentEditorBlockFormat } from '../../constant';
|
|
18
|
+
|
|
19
|
+
export const Block = ({ attributes, children, element }) => {
|
|
20
|
+
const style = {
|
|
21
|
+
textAlign: element.align,
|
|
22
|
+
color: 'var(--coz-fg-primary, rgba(6, 7, 9, 0.80))',
|
|
23
|
+
};
|
|
24
|
+
// Select the corresponding HTML tag based on the element type
|
|
25
|
+
switch (element.type) {
|
|
26
|
+
case CommentEditorBlockFormat.Paragraph:
|
|
27
|
+
// Render paragraph
|
|
28
|
+
return (
|
|
29
|
+
<p className="text-[12px] m-0 p-0" style={style} {...attributes}>
|
|
30
|
+
{children}
|
|
31
|
+
</p>
|
|
32
|
+
);
|
|
33
|
+
case CommentEditorBlockFormat.Blockquote:
|
|
34
|
+
// Render reference block
|
|
35
|
+
return (
|
|
36
|
+
<blockquote
|
|
37
|
+
className="border-l-[3px] border-t-0 border-b-0 border-r-0 border-solid border-[#ced0d4] m-0 p-0 pl-[8px] ml-[8px] text-[12px]"
|
|
38
|
+
style={{
|
|
39
|
+
...style,
|
|
40
|
+
color: 'var(--coz-fg-secondary, rgba(32, 41, 69, 0.62))',
|
|
41
|
+
}}
|
|
42
|
+
{...attributes}
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</blockquote>
|
|
46
|
+
);
|
|
47
|
+
case CommentEditorBlockFormat.HeadingOne:
|
|
48
|
+
// Render first-level title
|
|
49
|
+
return (
|
|
50
|
+
<h1
|
|
51
|
+
className="text-[18px] mx-0 my-[6px] p-0 font-[600]"
|
|
52
|
+
style={style}
|
|
53
|
+
{...attributes}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</h1>
|
|
57
|
+
);
|
|
58
|
+
case CommentEditorBlockFormat.HeadingTwo:
|
|
59
|
+
// Render secondary title
|
|
60
|
+
return (
|
|
61
|
+
<h2
|
|
62
|
+
className="text-[16px] mx-0 my-[6px] p-0 font-[600]"
|
|
63
|
+
style={style}
|
|
64
|
+
{...attributes}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</h2>
|
|
68
|
+
);
|
|
69
|
+
case CommentEditorBlockFormat.HeadingThree:
|
|
70
|
+
// Render three-level title
|
|
71
|
+
return (
|
|
72
|
+
<h3
|
|
73
|
+
className="text-[14px] mx-0 my-[6px] p-0 font-[600]"
|
|
74
|
+
style={style}
|
|
75
|
+
{...attributes}
|
|
76
|
+
>
|
|
77
|
+
{children}
|
|
78
|
+
</h3>
|
|
79
|
+
);
|
|
80
|
+
case CommentEditorBlockFormat.BulletedList:
|
|
81
|
+
// Render unordered list
|
|
82
|
+
return (
|
|
83
|
+
<ul
|
|
84
|
+
className="text-[12px] m-0 p-0 pl-[16px] font-[400]"
|
|
85
|
+
style={style}
|
|
86
|
+
{...attributes}
|
|
87
|
+
>
|
|
88
|
+
{children}
|
|
89
|
+
</ul>
|
|
90
|
+
);
|
|
91
|
+
case CommentEditorBlockFormat.NumberedList:
|
|
92
|
+
// Render ordered list
|
|
93
|
+
return (
|
|
94
|
+
<ol
|
|
95
|
+
className="text-[12px] m-0 p-0 pl-[16px]"
|
|
96
|
+
style={style}
|
|
97
|
+
{...attributes}
|
|
98
|
+
>
|
|
99
|
+
{children}
|
|
100
|
+
</ol>
|
|
101
|
+
);
|
|
102
|
+
case CommentEditorBlockFormat.ListItem:
|
|
103
|
+
// Render list items
|
|
104
|
+
return (
|
|
105
|
+
<li className="text-[12px] m-0 p-0" style={style} {...attributes}>
|
|
106
|
+
{children}
|
|
107
|
+
</li>
|
|
108
|
+
);
|
|
109
|
+
default:
|
|
110
|
+
// Default render as paragraph
|
|
111
|
+
return (
|
|
112
|
+
<p className="text-[12px] m-0 p-0" style={style} {...attributes}>
|
|
113
|
+
{children}
|
|
114
|
+
</p>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { CommentEditorLeafFormat, CommentDefaultLink } from '../../constant';
|
|
18
|
+
|
|
19
|
+
export const Leaf = ({ attributes, children, leaf }) => {
|
|
20
|
+
if (leaf[CommentEditorLeafFormat.Bold]) {
|
|
21
|
+
children = <strong>{children}</strong>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (leaf[CommentEditorLeafFormat.Strikethrough]) {
|
|
25
|
+
children = <del>{children}</del>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (leaf[CommentEditorLeafFormat.Italic]) {
|
|
29
|
+
children = <em>{children}</em>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (leaf[CommentEditorLeafFormat.Underline]) {
|
|
33
|
+
children = <u>{children}</u>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (leaf[CommentEditorLeafFormat.Link]) {
|
|
37
|
+
children = (
|
|
38
|
+
<a
|
|
39
|
+
className="text-[var(--semi-color-link)] cursor-pointer"
|
|
40
|
+
href={leaf[CommentEditorLeafFormat.Link]}
|
|
41
|
+
onClick={e => {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
e.stopPropagation();
|
|
44
|
+
const link: string = leaf[CommentEditorLeafFormat.Link];
|
|
45
|
+
if (link === CommentDefaultLink) {
|
|
46
|
+
// If the link is the default link, open it directly.
|
|
47
|
+
return window.open(link, '_blank');
|
|
48
|
+
} else if (/^([a-zA-Z][a-zA-Z\d+\-.]*):\/\//.test(link)) {
|
|
49
|
+
// If a legal agreement is already included, open it directly
|
|
50
|
+
return window.open(link, '_blank');
|
|
51
|
+
} else {
|
|
52
|
+
// If there is no legal agreement, add the https protocol header.
|
|
53
|
+
// cp-disable-next-line
|
|
54
|
+
return window.open(`https://${link}`, '_blank');
|
|
55
|
+
}
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
</a>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return <span {...attributes}>{children}</span>;
|
|
64
|
+
};
|
|
@@ -0,0 +1,366 @@
|
|
|
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 max-lines-per-function -- no need to split */
|
|
18
|
+
import { type RefObject, type FC } from 'react';
|
|
19
|
+
|
|
20
|
+
import classNames from 'classnames';
|
|
21
|
+
import { I18n } from '@coze-arch/i18n';
|
|
22
|
+
import { Tooltip } from '@coze-arch/bot-semi';
|
|
23
|
+
import {
|
|
24
|
+
IconCozArrowDown,
|
|
25
|
+
IconCozBold,
|
|
26
|
+
IconCozQuotation,
|
|
27
|
+
IconCozH1,
|
|
28
|
+
IconCozH2,
|
|
29
|
+
IconCozH3,
|
|
30
|
+
IconCozItalic,
|
|
31
|
+
IconCozLink,
|
|
32
|
+
IconCozListDisorder,
|
|
33
|
+
IconCozListOrder,
|
|
34
|
+
IconCozStrikethrough,
|
|
35
|
+
IconCozTextStyle,
|
|
36
|
+
IconCozUnderscore,
|
|
37
|
+
} from '@coze-arch/coze-design/icons';
|
|
38
|
+
import { Dropdown, Input } from '@coze-arch/coze-design';
|
|
39
|
+
|
|
40
|
+
import { type CommentEditorModel } from '../model';
|
|
41
|
+
import {
|
|
42
|
+
CommentEditorBlockFormat,
|
|
43
|
+
CommentEditorLeafFormat,
|
|
44
|
+
CommentDefaultLink,
|
|
45
|
+
} from '../constant';
|
|
46
|
+
|
|
47
|
+
interface ICommentToolbar {
|
|
48
|
+
model: CommentEditorModel;
|
|
49
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
50
|
+
visible: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const CommentToolbar: FC<ICommentToolbar> = props => {
|
|
54
|
+
const { model, containerRef } = props;
|
|
55
|
+
|
|
56
|
+
const linkValue = model.getLeafValue(CommentEditorLeafFormat.Link) as string;
|
|
57
|
+
const linkDisplay = linkValue === CommentDefaultLink ? '' : linkValue;
|
|
58
|
+
|
|
59
|
+
const tooltipDelay = 1000;
|
|
60
|
+
const toolItemClass =
|
|
61
|
+
'flex items-center gap-[2px] w-auto h-[24px] p-[4px] rounded-[6px] hover:bg-[var(--coz-mg-primary)] cursor-pointer select-none';
|
|
62
|
+
const toolItemMarkedClass =
|
|
63
|
+
'text-[var(--coz-fg-hglt)] bg-[var(--coz-mg-hglt)] hover:bg-[var(--coz-mg-hglt-hovered)]';
|
|
64
|
+
const separatorClass = 'w-[1px] h-[16px] bg-[var(--coz-stroke-primary)]';
|
|
65
|
+
const textItemClass =
|
|
66
|
+
'w-full h-[32px] p-[8px] text-[14px] flex gap-[8px] items-center rounded-[5px] cursor-pointer select-none hover:bg-[var(--coz-mg-primary)]';
|
|
67
|
+
const textItemMarkedClass =
|
|
68
|
+
'text-[var(--coz-fg-hglt)] bg-[var(--coz-mg-hglt)] hover:bg-[var(--coz-mg-hglt-hovered)]';
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
className={classNames(
|
|
73
|
+
'workflow-comment-toolbar absolute left-[-140px]',
|
|
74
|
+
model.isLeafMarked(CommentEditorLeafFormat.Link)
|
|
75
|
+
? 'top-[-48px]'
|
|
76
|
+
: 'top-[-14px]',
|
|
77
|
+
)}
|
|
78
|
+
>
|
|
79
|
+
<div
|
|
80
|
+
className="flex items-center gap-[3px] h-[32px] p-[4px] w-auto bg-[var(--coz-bg-max)] rounded-[8px] border-[1px] border-solid border-[var(--coz-stroke-primary)]"
|
|
81
|
+
style={{
|
|
82
|
+
boxShadow:
|
|
83
|
+
'0px 4px 12px 0px rgba(0, 0, 0, 0.08), 0px 8px 24px 0px rgba(0, 0, 0, 0.04)',
|
|
84
|
+
}}
|
|
85
|
+
onMouseDown={e => {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
}}
|
|
89
|
+
onClick={e => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{/** Text style */}
|
|
95
|
+
<Dropdown
|
|
96
|
+
position="bottom"
|
|
97
|
+
trigger="hover"
|
|
98
|
+
clickToHide
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- must exist
|
|
100
|
+
getPopupContainer={() => containerRef.current!}
|
|
101
|
+
render={
|
|
102
|
+
<div
|
|
103
|
+
className="flex flex-col gap-[2px] justify-start items-center w-[120px] p-[4px] rounded-[8px] border-[0.5px] border-solid border-[var(--coz-stroke-primary)] bg-[var(--coz-bg-max)]"
|
|
104
|
+
style={{
|
|
105
|
+
boxShadow:
|
|
106
|
+
'0px 8px 24px 0px rgba(0, 0, 0, 0.16), 0px 16px 48px 0px rgba(0, 0, 0, 0.08)',
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
{/** text */}
|
|
110
|
+
<div
|
|
111
|
+
className={classNames(textItemClass, {
|
|
112
|
+
[textItemMarkedClass]: model.isBlockMarked(
|
|
113
|
+
CommentEditorBlockFormat.Paragraph,
|
|
114
|
+
),
|
|
115
|
+
})}
|
|
116
|
+
onClick={e => {
|
|
117
|
+
model.markBlock(CommentEditorBlockFormat.Paragraph);
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<IconCozTextStyle className="text-xxl" />
|
|
121
|
+
<p>{I18n.t('workflow_note_main_text')}</p>
|
|
122
|
+
</div>
|
|
123
|
+
{/** first-level title */}
|
|
124
|
+
<div
|
|
125
|
+
className={classNames(textItemClass, {
|
|
126
|
+
[textItemMarkedClass]: model.isBlockMarked(
|
|
127
|
+
CommentEditorBlockFormat.HeadingOne,
|
|
128
|
+
),
|
|
129
|
+
})}
|
|
130
|
+
onClick={e => {
|
|
131
|
+
model.markBlock(CommentEditorBlockFormat.HeadingOne);
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
<IconCozH1 className="text-xxl" />
|
|
135
|
+
<p>{I18n.t('workflow_note_heading')} 1</p>
|
|
136
|
+
</div>
|
|
137
|
+
{/** secondary title */}
|
|
138
|
+
<div
|
|
139
|
+
className={classNames(textItemClass, {
|
|
140
|
+
[textItemMarkedClass]: model.isBlockMarked(
|
|
141
|
+
CommentEditorBlockFormat.HeadingTwo,
|
|
142
|
+
),
|
|
143
|
+
})}
|
|
144
|
+
onClick={e => {
|
|
145
|
+
model.markBlock(CommentEditorBlockFormat.HeadingTwo);
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<IconCozH2 className="text-xxl" />
|
|
149
|
+
<p>{I18n.t('workflow_note_heading')} 2</p>
|
|
150
|
+
</div>
|
|
151
|
+
{/** third-level title */}
|
|
152
|
+
<div
|
|
153
|
+
className={classNames(textItemClass, {
|
|
154
|
+
[textItemMarkedClass]: model.isBlockMarked(
|
|
155
|
+
CommentEditorBlockFormat.HeadingThree,
|
|
156
|
+
),
|
|
157
|
+
})}
|
|
158
|
+
onClick={e => {
|
|
159
|
+
model.markBlock(CommentEditorBlockFormat.HeadingThree);
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
<IconCozH3 className="text-xxl" />
|
|
163
|
+
<p>{I18n.t('workflow_note_heading')} 3</p>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
}
|
|
167
|
+
>
|
|
168
|
+
<span className={toolItemClass}>
|
|
169
|
+
<IconCozTextStyle />
|
|
170
|
+
<IconCozArrowDown />
|
|
171
|
+
</span>
|
|
172
|
+
</Dropdown>
|
|
173
|
+
|
|
174
|
+
<div className={separatorClass} />
|
|
175
|
+
|
|
176
|
+
{/** bold */}
|
|
177
|
+
<Tooltip
|
|
178
|
+
content={I18n.t('workflow_note_bold')}
|
|
179
|
+
mouseEnterDelay={tooltipDelay}
|
|
180
|
+
>
|
|
181
|
+
<span
|
|
182
|
+
className={classNames(toolItemClass, {
|
|
183
|
+
[toolItemMarkedClass]: model.isLeafMarked(
|
|
184
|
+
CommentEditorLeafFormat.Bold,
|
|
185
|
+
),
|
|
186
|
+
})}
|
|
187
|
+
onClick={e => {
|
|
188
|
+
model.markLeaf(CommentEditorLeafFormat.Bold);
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<IconCozBold />
|
|
192
|
+
</span>
|
|
193
|
+
</Tooltip>
|
|
194
|
+
|
|
195
|
+
{/** Italic */}
|
|
196
|
+
<Tooltip
|
|
197
|
+
content={I18n.t('workflow_note_italic')}
|
|
198
|
+
mouseEnterDelay={tooltipDelay}
|
|
199
|
+
>
|
|
200
|
+
<span
|
|
201
|
+
className={classNames(toolItemClass, {
|
|
202
|
+
[toolItemMarkedClass]: model.isLeafMarked(
|
|
203
|
+
CommentEditorLeafFormat.Italic,
|
|
204
|
+
),
|
|
205
|
+
})}
|
|
206
|
+
onClick={e => {
|
|
207
|
+
model.markLeaf(CommentEditorLeafFormat.Italic);
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
210
|
+
<IconCozItalic />
|
|
211
|
+
</span>
|
|
212
|
+
</Tooltip>
|
|
213
|
+
|
|
214
|
+
{/** underline */}
|
|
215
|
+
<Tooltip
|
|
216
|
+
content={I18n.t('workflow_note_underline')}
|
|
217
|
+
mouseEnterDelay={tooltipDelay}
|
|
218
|
+
>
|
|
219
|
+
<span
|
|
220
|
+
className={classNames(toolItemClass, {
|
|
221
|
+
[toolItemMarkedClass]: model.isLeafMarked(
|
|
222
|
+
CommentEditorLeafFormat.Underline,
|
|
223
|
+
),
|
|
224
|
+
})}
|
|
225
|
+
onClick={e => {
|
|
226
|
+
model.markLeaf(CommentEditorLeafFormat.Underline);
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
<IconCozUnderscore />
|
|
230
|
+
</span>
|
|
231
|
+
</Tooltip>
|
|
232
|
+
|
|
233
|
+
{/** Strikethrough */}
|
|
234
|
+
<Tooltip
|
|
235
|
+
content={I18n.t('workflow_note_strikethrough')}
|
|
236
|
+
mouseEnterDelay={tooltipDelay}
|
|
237
|
+
>
|
|
238
|
+
<span
|
|
239
|
+
className={classNames(toolItemClass, {
|
|
240
|
+
[toolItemMarkedClass]: model.isLeafMarked(
|
|
241
|
+
CommentEditorLeafFormat.Strikethrough,
|
|
242
|
+
),
|
|
243
|
+
})}
|
|
244
|
+
onClick={e => {
|
|
245
|
+
model.markLeaf(CommentEditorLeafFormat.Strikethrough);
|
|
246
|
+
}}
|
|
247
|
+
>
|
|
248
|
+
<IconCozStrikethrough />
|
|
249
|
+
</span>
|
|
250
|
+
</Tooltip>
|
|
251
|
+
|
|
252
|
+
<div className={separatorClass} />
|
|
253
|
+
|
|
254
|
+
{/** unordered list */}
|
|
255
|
+
<Tooltip
|
|
256
|
+
content={I18n.t('workflow_note_bulleted_list')}
|
|
257
|
+
mouseEnterDelay={tooltipDelay}
|
|
258
|
+
>
|
|
259
|
+
<span
|
|
260
|
+
className={classNames(toolItemClass, {
|
|
261
|
+
[toolItemMarkedClass]: model.isBlockMarked(
|
|
262
|
+
CommentEditorBlockFormat.BulletedList,
|
|
263
|
+
),
|
|
264
|
+
})}
|
|
265
|
+
onClick={e => {
|
|
266
|
+
model.markBlock(CommentEditorBlockFormat.BulletedList);
|
|
267
|
+
}}
|
|
268
|
+
>
|
|
269
|
+
<IconCozListDisorder />
|
|
270
|
+
</span>
|
|
271
|
+
</Tooltip>
|
|
272
|
+
|
|
273
|
+
{/** ordered list */}
|
|
274
|
+
<Tooltip
|
|
275
|
+
content={I18n.t('workflow_note_numbered_list')}
|
|
276
|
+
mouseEnterDelay={tooltipDelay}
|
|
277
|
+
>
|
|
278
|
+
<span
|
|
279
|
+
className={classNames(toolItemClass, {
|
|
280
|
+
[toolItemMarkedClass]: model.isBlockMarked(
|
|
281
|
+
CommentEditorBlockFormat.NumberedList,
|
|
282
|
+
),
|
|
283
|
+
})}
|
|
284
|
+
onClick={e => {
|
|
285
|
+
model.markBlock(CommentEditorBlockFormat.NumberedList);
|
|
286
|
+
}}
|
|
287
|
+
>
|
|
288
|
+
<IconCozListOrder />
|
|
289
|
+
</span>
|
|
290
|
+
</Tooltip>
|
|
291
|
+
|
|
292
|
+
{/** quote */}
|
|
293
|
+
<Tooltip
|
|
294
|
+
content={I18n.t('workflow_note_quote')}
|
|
295
|
+
mouseEnterDelay={tooltipDelay}
|
|
296
|
+
>
|
|
297
|
+
<span
|
|
298
|
+
className={classNames(toolItemClass, {
|
|
299
|
+
[toolItemMarkedClass]: model.isBlockMarked(
|
|
300
|
+
CommentEditorBlockFormat.Blockquote,
|
|
301
|
+
),
|
|
302
|
+
})}
|
|
303
|
+
onClick={e => {
|
|
304
|
+
model.markBlock(CommentEditorBlockFormat.Blockquote);
|
|
305
|
+
}}
|
|
306
|
+
>
|
|
307
|
+
<IconCozQuotation />
|
|
308
|
+
</span>
|
|
309
|
+
</Tooltip>
|
|
310
|
+
|
|
311
|
+
<div className={separatorClass} />
|
|
312
|
+
|
|
313
|
+
{/** link */}
|
|
314
|
+
<Tooltip
|
|
315
|
+
content={I18n.t('workflow_note_hyperlink')}
|
|
316
|
+
mouseEnterDelay={tooltipDelay}
|
|
317
|
+
>
|
|
318
|
+
<span
|
|
319
|
+
className={classNames(toolItemClass, {
|
|
320
|
+
[toolItemMarkedClass]: model.isLeafMarked(
|
|
321
|
+
CommentEditorLeafFormat.Link,
|
|
322
|
+
),
|
|
323
|
+
})}
|
|
324
|
+
onClick={e => {
|
|
325
|
+
e.preventDefault();
|
|
326
|
+
e.stopPropagation();
|
|
327
|
+
model.markLeaf(CommentEditorLeafFormat.Link, CommentDefaultLink);
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<IconCozLink />
|
|
331
|
+
</span>
|
|
332
|
+
</Tooltip>
|
|
333
|
+
</div>
|
|
334
|
+
<div
|
|
335
|
+
className="w-full overflow-hidden absolute top-[34px]"
|
|
336
|
+
style={{
|
|
337
|
+
display: model.isLeafMarked(CommentEditorLeafFormat.Link)
|
|
338
|
+
? 'flex'
|
|
339
|
+
: 'none',
|
|
340
|
+
}}
|
|
341
|
+
onMouseDown={e => {
|
|
342
|
+
e.stopPropagation();
|
|
343
|
+
}}
|
|
344
|
+
>
|
|
345
|
+
<Input
|
|
346
|
+
// cp-disable-next-line
|
|
347
|
+
placeholder="https://"
|
|
348
|
+
style={{
|
|
349
|
+
// Overlay style is needed here, tailwind class priority is not high enough
|
|
350
|
+
backgroundColor: '#fff',
|
|
351
|
+
display: 'flex',
|
|
352
|
+
alignItems: 'center',
|
|
353
|
+
justifyContent: 'center',
|
|
354
|
+
}}
|
|
355
|
+
value={linkDisplay}
|
|
356
|
+
onChange={value => {
|
|
357
|
+
model.setLeafValue(
|
|
358
|
+
CommentEditorLeafFormat.Link,
|
|
359
|
+
value || CommentDefaultLink,
|
|
360
|
+
);
|
|
361
|
+
}}
|
|
362
|
+
></Input>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
);
|
|
366
|
+
};
|