@cozeloop/prompt-components 0.0.2 → 0.0.3
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/dist/es/basic-editor/custom-facet.js +9 -0
- package/dist/es/basic-editor/diff.js +138 -0
- package/dist/{go-syntax-067c4f5d.mjs → es/basic-editor/extensions/go-syntax.js} +9 -16
- package/dist/es/basic-editor/extensions/go-template.js +16 -0
- package/dist/{go-theme-062a6df6.mjs → es/basic-editor/extensions/go-theme.js} +4 -3
- package/dist/es/basic-editor/extensions/jinja.js +80 -0
- package/dist/es/basic-editor/extensions/keymap.js +442 -0
- package/dist/es/basic-editor/extensions/language-support.js +12 -0
- package/dist/es/basic-editor/extensions/markdown.js +58 -0
- package/dist/es/basic-editor/extensions/search/dom/icon.js +250 -0
- package/dist/es/basic-editor/extensions/search/dom/match-count.js +33 -0
- package/dist/es/basic-editor/extensions/search/index.js +18 -0
- package/dist/es/basic-editor/extensions/search/panel.js +418 -0
- package/dist/es/basic-editor/extensions/search/theme.js +184 -0
- package/dist/es/basic-editor/extensions/validation.js +84 -0
- package/dist/es/basic-editor/extensions/validation.module.js +5 -0
- package/dist/es/basic-editor/extensions/validation_module.css +7 -0
- package/dist/es/basic-editor/extensions/variable.js +178 -0
- package/dist/es/basic-editor/index.js +171 -0
- package/dist/es/code-editor/code-editor.js +83 -0
- package/dist/es/code-editor/index.js +12 -0
- package/dist/es/code-editor/json-editor.js +157 -0
- package/dist/es/code-editor/raw-text-editor.js +46 -0
- package/dist/es/code-editor/text-editor.js +41 -0
- package/dist/es/code-editor/themes/coze-dark.js +112 -0
- package/dist/es/code-editor/themes/coze-light.js +118 -0
- package/dist/es/consts/index.js +12 -0
- package/dist/es/dev-layout/index.js +35 -0
- package/dist/es/idls/fornax_ml_flow/index.js +2322 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/ai_annotate.js +41 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/aidpcallback.js +108 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/annotation_job.js +52 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/base.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/batch_infer.js +72 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/dataprocess.js +10 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/dataset.js +36 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2.js +139 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2job.js +40 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2lineage.js +25 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2similarity.js +12 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/filter.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/flow_devops_evaluation_callback_common.js +36 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/flow_devops_prompt_common.js +318 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/fornax_domain_model.js +326 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/ml_flow_domain_model.js +327 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/openapi.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotateservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotationjobservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_batchinferservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_crowdsourcingannotationjobservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_dataprocessservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservicev2.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_modelservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_annotationjobservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_batchinferservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_datasetservicev2.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_tagservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/tag.js +33 -0
- package/dist/es/idls/prompt_api/index.js +2009 -0
- package/dist/es/idls/prompt_api/namespaces/base.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_callback.js +35 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_commercial_openapi.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_common.js +318 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_debug.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_manage.js +23 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_mcp.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_optimize.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_paas.js +43 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_platform.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/mcp.js +9 -0
- package/dist/es/idls/prompt_api/namespaces/model.js +320 -0
- package/dist/es/idls/prompt_api/namespaces/permission.js +47 -0
- package/dist/es/idls/prompt_api/namespaces/release.js +25 -0
- package/dist/es/index.js +66 -0
- package/dist/es/mermaid-diagram/index.js +148 -0
- package/dist/es/mermaid-diagram/index.module.js +5 -0
- package/dist/es/mermaid-diagram/index_module.css +4 -0
- package/dist/es/mermaid-diagram/use-svg-pan-zoom.js +49 -0
- package/dist/es/mermaid-diagram/utils.js +74 -0
- package/dist/es/model-config-editor/basic-type.js +73 -0
- package/dist/es/model-config-editor/index.module.js +5 -0
- package/dist/es/model-config-editor/index_module.css +8 -0
- package/dist/es/model-config-editor/model-config-form.js +130 -0
- package/dist/es/model-config-editor/popover-type.js +118 -0
- package/dist/es/model-select/index.js +136 -0
- package/dist/es/model-select/index.module.js +5 -0
- package/dist/es/model-select/index_module.css +14 -0
- package/dist/es/model-select/model-option/index.js +161 -0
- package/dist/es/model-select/model-option/index.module.js +5 -0
- package/dist/es/model-select/model-option/index_module.css +23 -0
- package/dist/es/model-select/model-option-group/index.js +44 -0
- package/dist/es/prompt-editor/index.js +188 -0
- package/dist/es/prompt-editor/index.module.js +5 -0
- package/dist/es/prompt-editor/index_module.css +71 -0
- package/dist/es/prompt-editor/message-type-select.js +74 -0
- package/dist/es/schema-editor/index.js +43 -0
- package/dist/es/utils/base.js +53 -0
- package/dist/es/utils/model-config.js +32 -0
- package/dist/lib/basic-editor/custom-facet.js +33 -0
- package/dist/lib/basic-editor/diff.js +167 -0
- package/dist/lib/basic-editor/extensions/go-syntax.js +146 -0
- package/dist/lib/basic-editor/extensions/go-template.js +50 -0
- package/dist/lib/basic-editor/extensions/go-theme.js +1091 -0
- package/dist/lib/basic-editor/extensions/jinja.js +100 -0
- package/dist/lib/basic-editor/extensions/keymap.js +465 -0
- package/dist/lib/basic-editor/extensions/language-support.js +32 -0
- package/dist/lib/basic-editor/extensions/markdown.js +78 -0
- package/dist/lib/basic-editor/extensions/search/dom/icon.js +291 -0
- package/dist/lib/basic-editor/extensions/search/dom/match-count.js +67 -0
- package/dist/lib/basic-editor/extensions/search/index.js +38 -0
- package/dist/lib/basic-editor/extensions/search/panel.js +429 -0
- package/dist/lib/basic-editor/extensions/search/theme.js +208 -0
- package/dist/lib/basic-editor/extensions/validation.js +118 -0
- package/dist/lib/basic-editor/extensions/validation.module.js +25 -0
- package/dist/lib/basic-editor/extensions/validation_module.css +7 -0
- package/dist/lib/basic-editor/extensions/variable.js +190 -0
- package/dist/lib/basic-editor/index.js +193 -0
- package/dist/lib/code-editor/code-editor.js +117 -0
- package/dist/lib/code-editor/index.js +40 -0
- package/dist/lib/code-editor/json-editor.js +184 -0
- package/dist/lib/code-editor/raw-text-editor.js +70 -0
- package/dist/lib/code-editor/text-editor.js +75 -0
- package/dist/lib/code-editor/themes/coze-dark.js +136 -0
- package/dist/lib/code-editor/themes/coze-light.js +142 -0
- package/dist/lib/consts/index.js +38 -0
- package/dist/lib/dev-layout/index.js +69 -0
- package/dist/lib/idls/fornax_ml_flow/index.js +2414 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/ai_annotate.js +69 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/aidpcallback.js +140 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/annotation_job.js +82 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/base.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/batch_infer.js +105 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/dataprocess.js +34 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/dataset.js +63 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2.js +177 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2job.js +68 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2lineage.js +50 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2similarity.js +37 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/filter.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/flow_devops_evaluation_callback_common.js +62 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/flow_devops_prompt_common.js +378 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/fornax_domain_model.js +384 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/ml_flow_domain_model.js +385 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/openapi.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotateservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotationjobservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_batchinferservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_crowdsourcingannotationjobservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_dataprocessservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservicev2.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_modelservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_annotationjobservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_batchinferservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_datasetservicev2.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_tagservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/tag.js +60 -0
- package/dist/lib/idls/prompt_api/index.js +2071 -0
- package/dist/lib/idls/prompt_api/namespaces/base.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_callback.js +62 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_commercial_openapi.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_common.js +378 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_debug.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_manage.js +49 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_mcp.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_optimize.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_paas.js +72 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_platform.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/mcp.js +33 -0
- package/dist/lib/idls/prompt_api/namespaces/model.js +377 -0
- package/dist/lib/idls/prompt_api/namespaces/permission.js +72 -0
- package/dist/lib/idls/prompt_api/namespaces/release.js +50 -0
- package/dist/lib/index.js +110 -0
- package/dist/lib/mermaid-diagram/index.js +174 -0
- package/dist/lib/mermaid-diagram/index.module.js +25 -0
- package/dist/lib/mermaid-diagram/index_module.css +4 -0
- package/dist/lib/mermaid-diagram/use-svg-pan-zoom.js +83 -0
- package/dist/lib/mermaid-diagram/utils.js +98 -0
- package/dist/lib/model-config-editor/basic-type.js +105 -0
- package/dist/lib/model-config-editor/index.module.js +25 -0
- package/dist/lib/model-config-editor/index_module.css +8 -0
- package/dist/lib/model-config-editor/model-config-form.js +149 -0
- package/dist/lib/model-config-editor/popover-type.js +145 -0
- package/dist/lib/model-select/index.js +170 -0
- package/dist/lib/model-select/index.module.js +25 -0
- package/dist/lib/model-select/index_module.css +14 -0
- package/dist/lib/model-select/model-option/index.js +188 -0
- package/dist/lib/model-select/model-option/index.module.js +25 -0
- package/dist/lib/model-select/model-option/index_module.css +23 -0
- package/dist/lib/model-select/model-option-group/index.js +75 -0
- package/dist/lib/prompt-editor/index.js +218 -0
- package/dist/lib/prompt-editor/index.module.js +25 -0
- package/dist/lib/prompt-editor/index_module.css +71 -0
- package/dist/lib/prompt-editor/message-type-select.js +108 -0
- package/dist/lib/schema-editor/index.js +77 -0
- package/dist/lib/utils/base.js +82 -0
- package/dist/lib/utils/model-config.js +67 -0
- package/dist/{src → types}/basic-editor/custom-facet.d.ts +1 -2
- package/dist/types/basic-editor/diff.d.ts +15 -0
- package/dist/types/basic-editor/extensions/go-syntax.d.ts +71 -0
- package/dist/types/basic-editor/extensions/go-template.d.ts +1 -0
- package/dist/{src → types}/basic-editor/extensions/go-theme.d.ts +1 -1
- package/dist/types/basic-editor/extensions/jinja.d.ts +6 -0
- package/dist/{src → types}/basic-editor/extensions/keymap.d.ts +2 -3
- package/dist/types/basic-editor/extensions/language-support.d.ts +2 -0
- package/dist/types/basic-editor/extensions/markdown.d.ts +2 -0
- package/dist/types/basic-editor/extensions/search/dom/icon.d.ts +59 -0
- package/dist/types/basic-editor/extensions/search/dom/match-count.d.ts +14 -0
- package/dist/types/basic-editor/extensions/search/index.d.ts +1 -0
- package/dist/types/basic-editor/extensions/search/panel.d.ts +32 -0
- package/dist/types/basic-editor/extensions/search/theme.d.ts +1 -0
- package/dist/types/basic-editor/extensions/validation.d.ts +10 -0
- package/dist/types/basic-editor/extensions/variable.d.ts +14 -0
- package/dist/types/basic-editor/index.d.ts +28 -0
- package/dist/types/code-editor/code-editor.d.ts +23 -0
- package/dist/{src → types}/code-editor/index.d.ts +1 -1
- package/dist/types/code-editor/json-editor.d.ts +17 -0
- package/dist/types/code-editor/raw-text-editor.d.ts +11 -0
- package/dist/types/code-editor/text-editor.d.ts +23 -0
- package/dist/types/code-editor/themes/coze-dark.d.ts +1 -0
- package/dist/types/code-editor/themes/coze-light.d.ts +1 -0
- package/dist/{src → types}/consts/index.d.ts +1 -1
- package/dist/types/dev-layout/index.d.ts +13 -0
- package/dist/types/idls/fornax_ml_flow/index.d.ts +779 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/ai_annotate.d.ts +102 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/aidpcallback.d.ts +227 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/annotation_job.d.ts +402 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/base.d.ts +18 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/batch_infer.d.ts +331 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/dataprocess.d.ts +16 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/dataset.d.ts +88 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2.d.ts +462 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2job.d.ts +180 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2lineage.d.ts +69 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2similarity.d.ts +8 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/filter.d.ts +39 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/flow_devops_evaluation_callback_common.d.ts +88 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/flow_devops_prompt_common.d.ts +370 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/fornax_domain_model.d.ts +320 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/ml_flow_domain_model.d.ts +510 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/openapi.d.ts +6 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotateservice.d.ts +106 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotationjobservice.d.ts +256 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_batchinferservice.d.ts +73 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_crowdsourcingannotationjobservice.d.ts +94 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_dataprocessservice.d.ts +11 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservice.d.ts +24 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservicev2.d.ts +653 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_modelservice.d.ts +83 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_annotationjobservice.d.ts +81 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_batchinferservice.d.ts +24 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_datasetservicev2.d.ts +260 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_tagservice.d.ts +111 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/tag.d.ts +109 -0
- package/dist/types/idls/prompt_api/index.d.ts +667 -0
- package/dist/types/idls/prompt_api/namespaces/base.d.ts +18 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_callback.d.ts +102 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_commercial_openapi.d.ts +81 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_common.d.ts +1270 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_debug.d.ts +197 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_manage.d.ts +769 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_mcp.d.ts +301 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_optimize.d.ts +155 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_paas.d.ts +198 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_platform.d.ts +230 -0
- package/dist/types/idls/prompt_api/namespaces/mcp.d.ts +95 -0
- package/dist/types/idls/prompt_api/namespaces/model.d.ts +315 -0
- package/dist/types/idls/prompt_api/namespaces/permission.d.ts +52 -0
- package/dist/types/idls/prompt_api/namespaces/release.d.ts +62 -0
- package/dist/{src → types}/index.d.ts +7 -7
- package/dist/types/mermaid-diagram/index.d.ts +12 -0
- package/dist/types/mermaid-diagram/use-svg-pan-zoom.d.ts +17 -0
- package/dist/{src → types}/mermaid-diagram/utils.d.ts +1 -1
- package/dist/types/model-config-editor/basic-type.d.ts +19 -0
- package/dist/types/model-config-editor/model-config-form.d.ts +14 -0
- package/dist/types/model-config-editor/popover-type.d.ts +25 -0
- package/dist/types/model-select/index.d.ts +38 -0
- package/dist/types/model-select/model-option/index.d.ts +30 -0
- package/dist/types/model-select/model-option-group/index.d.ts +15 -0
- package/dist/types/prompt-editor/index.d.ts +30 -0
- package/dist/types/prompt-editor/message-type-select.d.ts +16 -0
- package/dist/types/schema-editor/index.d.ts +18 -0
- package/dist/{src → types}/utils/base.d.ts +4 -5
- package/dist/types/utils/model-config.d.ts +4 -0
- package/package.json +8 -16
- package/dist/edenx.config.d.ts +0 -2
- package/dist/go-syntax-4deb0289.js +0 -8
- package/dist/go-theme-fbd8a4fa.js +0 -1
- package/dist/index.cjs +0 -61
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2788
- package/dist/src/basic-editor/diff.d.ts +0 -16
- package/dist/src/basic-editor/extensions/go-syntax.d.ts +0 -71
- package/dist/src/basic-editor/extensions/go-template.d.ts +0 -1
- package/dist/src/basic-editor/extensions/jinja.d.ts +0 -4
- package/dist/src/basic-editor/extensions/language-support.d.ts +0 -2
- package/dist/src/basic-editor/extensions/markdown.d.ts +0 -2
- package/dist/src/basic-editor/extensions/search/dom/icon.d.ts +0 -59
- package/dist/src/basic-editor/extensions/search/dom/match-count.d.ts +0 -14
- package/dist/src/basic-editor/extensions/search/index.d.ts +0 -1
- package/dist/src/basic-editor/extensions/search/panel.d.ts +0 -33
- package/dist/src/basic-editor/extensions/search/theme.d.ts +0 -1
- package/dist/src/basic-editor/extensions/validation.d.ts +0 -8
- package/dist/src/basic-editor/extensions/variable.d.ts +0 -11
- package/dist/src/basic-editor/index.d.ts +0 -29
- package/dist/src/code-editor/json-editor.d.ts +0 -18
- package/dist/src/code-editor/raw-text-editor.d.ts +0 -11
- package/dist/src/dev-layout/index.d.ts +0 -7
- package/dist/src/mermaid-diagram/index.d.ts +0 -12
- package/dist/src/mermaid-diagram/use-svg-pan-zoom.d.ts +0 -12
- package/dist/src/model-config-editor/basic-type.d.ts +0 -13
- package/dist/src/model-config-editor/model-config-form.d.ts +0 -13
- package/dist/src/model-config-editor/popover-type.d.ts +0 -19
- package/dist/src/model-select/index.d.ts +0 -27
- package/dist/src/model-select/model-option/index.d.ts +0 -25
- package/dist/src/model-select/model-option-group/index.d.ts +0 -16
- package/dist/src/prompt-editor/index.d.ts +0 -31
- package/dist/src/prompt-editor/message-type-select.d.ts +0 -11
- package/dist/src/schema-editor/index.d.ts +0 -11
- package/dist/src/utils/model-config.d.ts +0 -5
- package/dist/style.css +0 -1
- package/dist/test-build.d.ts +0 -7
- package/dist/vite.config.d.ts +0 -2
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var __objRest = (source, exclude) => {
|
|
5
|
+
var target = {};
|
|
6
|
+
for (var prop in source)
|
|
7
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
|
+
target[prop] = source[prop];
|
|
9
|
+
if (source != null && __getOwnPropSymbols)
|
|
10
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
11
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
12
|
+
target[prop] = source[prop];
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { useRef } from "react";
|
|
18
|
+
import cls from "classnames";
|
|
19
|
+
import { useHover } from "ahooks";
|
|
20
|
+
import { IconCozDiamondFill } from "@coze-arch/coze-design/icons";
|
|
21
|
+
import {
|
|
22
|
+
Avatar,
|
|
23
|
+
Space,
|
|
24
|
+
Tag,
|
|
25
|
+
Tooltip,
|
|
26
|
+
Typography
|
|
27
|
+
} from "@coze-arch/coze-design";
|
|
28
|
+
import { renderModelOfflineTag } from "../../utils/model-config";
|
|
29
|
+
import styles from "./index.module";
|
|
30
|
+
function ModelOption(_a) {
|
|
31
|
+
var _b = _a, {
|
|
32
|
+
model,
|
|
33
|
+
selected,
|
|
34
|
+
disabled,
|
|
35
|
+
onClick
|
|
36
|
+
} = _b, props = __objRest(_b, [
|
|
37
|
+
"model",
|
|
38
|
+
"selected",
|
|
39
|
+
"disabled",
|
|
40
|
+
"onClick"
|
|
41
|
+
]);
|
|
42
|
+
var _a2, _b2;
|
|
43
|
+
const ref = useRef(null);
|
|
44
|
+
const isHovering = useHover(ref);
|
|
45
|
+
const modelTags = model.modelTags || [];
|
|
46
|
+
const renderOverflow = (items) => (items == null ? void 0 : items.length) ? /* @__PURE__ */ jsx(
|
|
47
|
+
Tooltip,
|
|
48
|
+
{
|
|
49
|
+
content: /* @__PURE__ */ jsx(Space, { wrap: true, spacing: 3, children: items == null ? void 0 : items.map((item) => /* @__PURE__ */ jsx(Tag, { children: item })) }),
|
|
50
|
+
children: /* @__PURE__ */ jsxs(
|
|
51
|
+
Tag,
|
|
52
|
+
{
|
|
53
|
+
style: { flex: "0 0 auto" },
|
|
54
|
+
size: "mini",
|
|
55
|
+
color: "primary",
|
|
56
|
+
className: "!bg-transparent !border border-solid",
|
|
57
|
+
children: [
|
|
58
|
+
"+",
|
|
59
|
+
items.length
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
) : null;
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
"article",
|
|
67
|
+
{
|
|
68
|
+
ref,
|
|
69
|
+
className: cls(
|
|
70
|
+
"pl-[16px] pr-[12px] w-full relative",
|
|
71
|
+
"flex gap-[16px] items-center rounded-[12px]",
|
|
72
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
73
|
+
styles["model-option"],
|
|
74
|
+
{ [styles["model-option_selected"]]: selected }
|
|
75
|
+
),
|
|
76
|
+
style: { minWidth: 480, maxWidth: 570 },
|
|
77
|
+
onClick: () => {
|
|
78
|
+
onClick == null ? void 0 : onClick();
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
Avatar,
|
|
83
|
+
{
|
|
84
|
+
className: "shrink-0 rounded-[6px] border border-solid coz-stroke-primary",
|
|
85
|
+
shape: "square",
|
|
86
|
+
src: model.modelIcon,
|
|
87
|
+
size: "default"
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ jsxs(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: cls(
|
|
94
|
+
"h-[70px] py-[14px] w-full",
|
|
95
|
+
"flex flex-col overflow-hidden",
|
|
96
|
+
"border-0 border-b border-solid coz-stroke-primary",
|
|
97
|
+
styles["model-info-border"]
|
|
98
|
+
),
|
|
99
|
+
style: isHovering ? {
|
|
100
|
+
mask: calcMaskStyle([
|
|
101
|
+
props.enableConfig,
|
|
102
|
+
props.enableJumpDetail
|
|
103
|
+
])
|
|
104
|
+
} : void 0,
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full flex items-center gap-[6px] overflow-hidden", children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Typography.Title, { fontSize: "14px", ellipsis: { showTooltip: true }, children: model.displayName }),
|
|
108
|
+
/* @__PURE__ */ jsxs("div", { className: "shrink-0 flex gap-[6px]", children: [
|
|
109
|
+
disabled ? /* @__PURE__ */ jsx("div", { className: "h-[16px] leading-[16px]", children: /* @__PURE__ */ jsx(IconCozDiamondFill, { className: "coz-fg-hglt text-[12px]" }) }) : null,
|
|
110
|
+
((_a2 = model.commercialModelStatusDetail) == null ? void 0 : _a2.isNewModel) ? /* @__PURE__ */ jsx(Tooltip, { content: "Pro 版用户专享", theme: "dark", children: /* @__PURE__ */ jsx(Tag, { size: "mini", color: "brand", children: "新模型" }) }) : null,
|
|
111
|
+
((_b2 = model.commercialModelStatusDetail) == null ? void 0 : _b2.isAdvancedModel) ? /* @__PURE__ */ jsx(Tooltip, { content: "专业版用户专享", theme: "dark", children: /* @__PURE__ */ jsx(Tag, { size: "mini", color: "blue", children: "高级" }) }) : null,
|
|
112
|
+
renderModelOfflineTag(model),
|
|
113
|
+
(modelTags == null ? void 0 : modelTags.length) ? /* @__PURE__ */ jsxs(Space, { spacing: 4, children: [
|
|
114
|
+
modelTags.slice(0, 3).map((item) => /* @__PURE__ */ jsx(
|
|
115
|
+
Tag,
|
|
116
|
+
{
|
|
117
|
+
size: "mini",
|
|
118
|
+
color: "primary",
|
|
119
|
+
className: "!bg-transparent !border border-solid coz-stroke-plus !rounded-[4px]",
|
|
120
|
+
children: item
|
|
121
|
+
},
|
|
122
|
+
item
|
|
123
|
+
)),
|
|
124
|
+
renderOverflow(modelTags.slice(3))
|
|
125
|
+
] }) : null
|
|
126
|
+
] })
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
Typography.Text,
|
|
130
|
+
{
|
|
131
|
+
className: "mt-[4px] text-[12px] leading-[16px] coz-fg-secondary",
|
|
132
|
+
ellipsis: { showTooltip: { opts: { theme: "dark" } } },
|
|
133
|
+
children: model.description
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
function calcMaskStyle(buttonVisible) {
|
|
144
|
+
const btnNum = buttonVisible.reduce(
|
|
145
|
+
(prevNum, showBtn) => prevNum + (showBtn ? 1 : 0),
|
|
146
|
+
0
|
|
147
|
+
);
|
|
148
|
+
if (btnNum === 0) {
|
|
149
|
+
return "none";
|
|
150
|
+
}
|
|
151
|
+
const BTN_WIDTH = 32;
|
|
152
|
+
const BTN_GAP = 3;
|
|
153
|
+
const PRESET_PADDING = 16;
|
|
154
|
+
const MASK_WIDTH = 24;
|
|
155
|
+
const gradientStart = btnNum * BTN_WIDTH + (btnNum - 1) * BTN_GAP + PRESET_PADDING;
|
|
156
|
+
const gradientEnd = gradientStart + MASK_WIDTH;
|
|
157
|
+
return `linear-gradient(to left, rgba(0,0,0,0), rgba(0,0,0,0) ${gradientStart}px, #fff ${gradientEnd}px)`;
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
ModelOption
|
|
161
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* stylelint-disable declaration-no-important */
|
|
2
|
+
.model-option_88e78:hover {
|
|
3
|
+
background-color: rgba(var(--coze-bg-5), var(--coze-bg-5-alpha));
|
|
4
|
+
}
|
|
5
|
+
.model-option_88e78:last-of-type .model-info-border_88e78,
|
|
6
|
+
.model-option_88e78.model-option_selected_88e78 .model-info-border_88e78,
|
|
7
|
+
.model-option_88e78:hover .model-info-border_88e78,
|
|
8
|
+
.model-option_88e78:has( + .model-option_88e78.model-option_selected_88e78) .model-info-border_88e78,
|
|
9
|
+
.model-option_88e78:has( + .model-option_88e78:hover) .model-info-border_88e78 {
|
|
10
|
+
border-color: transparent;
|
|
11
|
+
}
|
|
12
|
+
.model-option_88e78 .coz-tag.coz-tag-mini {
|
|
13
|
+
padding-right: 3px;
|
|
14
|
+
padding-left: 3px;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
}
|
|
17
|
+
.model-option_selected_88e78 {
|
|
18
|
+
background-color: rgba(var(--coze-brand-1), var(--coze-brand-1-alpha));
|
|
19
|
+
border: 0;
|
|
20
|
+
}
|
|
21
|
+
.model-option_selected_88e78:hover {
|
|
22
|
+
background-color: rgba(var(--coze-brand-2), var(--coze-brand-2-alpha)) !important;
|
|
23
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import cls from "classnames";
|
|
3
|
+
import {
|
|
4
|
+
IconCozQuestionMarkCircle,
|
|
5
|
+
IconCozStarFill
|
|
6
|
+
} from "@coze-arch/coze-design/icons";
|
|
7
|
+
import { Avatar, Divider, Tooltip } from "@coze-arch/coze-design";
|
|
8
|
+
function ModelOptionGroup(props) {
|
|
9
|
+
const questionMark = (props == null ? void 0 : props.tooltip) ? /* @__PURE__ */ jsx(Tooltip, { content: props == null ? void 0 : props.tooltip, theme: "dark", children: /* @__PURE__ */ jsx(IconCozQuestionMarkCircle, { className: "cursor-pointer coz-fg-secondary" }) }) : null;
|
|
10
|
+
return /* @__PURE__ */ jsx("div", { className: "pb-[2px]", children: props.type === "new" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[4px] coz-fg-hglt", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(IconCozStarFill, {}),
|
|
12
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] leading-[16px]", children: props.seriesName }),
|
|
13
|
+
questionMark
|
|
14
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[6px]", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
Avatar,
|
|
17
|
+
{
|
|
18
|
+
shape: "square",
|
|
19
|
+
className: "w-[14px] h-[14px] rounded-[3px] !cursor-default border border-solid coz-stroke-primary",
|
|
20
|
+
src: props.icon
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ jsxs(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: cls(
|
|
27
|
+
"flex items-center gap-[4px]",
|
|
28
|
+
"text-[12px] leading-[16px]"
|
|
29
|
+
),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx("span", { className: "coz-fg-secondary", children: props.seriesName }),
|
|
32
|
+
questionMark,
|
|
33
|
+
props.desc ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Divider, { layout: "vertical" }),
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "coz-fg-dim", children: props.desc })
|
|
36
|
+
] }) : null
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }) });
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
ModelOptionGroup
|
|
44
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { forwardRef, useState } from "react";
|
|
34
|
+
import cn from "classnames";
|
|
35
|
+
import { flow_devops_prompt_common } from "../idls/prompt_api";
|
|
36
|
+
import { IconCozHandle } from "@coze-arch/coze-design/icons";
|
|
37
|
+
import { IconButton, Input, Space } from "@coze-arch/coze-design";
|
|
38
|
+
import { VARIABLE_MAX_LEN } from "../consts";
|
|
39
|
+
import {
|
|
40
|
+
PromptBasicEditor
|
|
41
|
+
} from "../basic-editor";
|
|
42
|
+
import { MessageTypeSelect } from "./message-type-select";
|
|
43
|
+
import styles from "./index.module";
|
|
44
|
+
const PromptEditor = forwardRef(
|
|
45
|
+
(_a, ref) => {
|
|
46
|
+
var _b = _a, {
|
|
47
|
+
className,
|
|
48
|
+
message,
|
|
49
|
+
dragBtnHidden,
|
|
50
|
+
messageTypeDisabled,
|
|
51
|
+
variables,
|
|
52
|
+
disabled,
|
|
53
|
+
isDrag,
|
|
54
|
+
onMessageChange,
|
|
55
|
+
onMessageTypeChange,
|
|
56
|
+
placeholder,
|
|
57
|
+
messageTypeList,
|
|
58
|
+
leftActionBtns,
|
|
59
|
+
rightActionBtns,
|
|
60
|
+
children,
|
|
61
|
+
hideActionWrap,
|
|
62
|
+
isFullscreen
|
|
63
|
+
} = _b, rest = __objRest(_b, [
|
|
64
|
+
"className",
|
|
65
|
+
"message",
|
|
66
|
+
"dragBtnHidden",
|
|
67
|
+
"messageTypeDisabled",
|
|
68
|
+
"variables",
|
|
69
|
+
"disabled",
|
|
70
|
+
"isDrag",
|
|
71
|
+
"onMessageChange",
|
|
72
|
+
"onMessageTypeChange",
|
|
73
|
+
"placeholder",
|
|
74
|
+
"messageTypeList",
|
|
75
|
+
"leftActionBtns",
|
|
76
|
+
"rightActionBtns",
|
|
77
|
+
"children",
|
|
78
|
+
"hideActionWrap",
|
|
79
|
+
"isFullscreen"
|
|
80
|
+
]);
|
|
81
|
+
const [editorActive, setEditorActive] = useState(false);
|
|
82
|
+
const handleMessageContentChange = (v) => {
|
|
83
|
+
onMessageChange == null ? void 0 : onMessageChange(__spreadProps(__spreadValues({}, message), { content: v }));
|
|
84
|
+
};
|
|
85
|
+
const readonly = disabled || isDrag;
|
|
86
|
+
return /* @__PURE__ */ jsxs(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: cn(
|
|
90
|
+
styles["prompt-editor-container"],
|
|
91
|
+
{
|
|
92
|
+
[styles["prompt-editor-container-active"]]: editorActive,
|
|
93
|
+
[styles["prompt-editor-container-disabled"]]: disabled,
|
|
94
|
+
[styles["full-screen"]]: isFullscreen
|
|
95
|
+
},
|
|
96
|
+
className
|
|
97
|
+
),
|
|
98
|
+
children: [
|
|
99
|
+
hideActionWrap ? null : /* @__PURE__ */ jsxs("div", { className: styles.header, children: [
|
|
100
|
+
/* @__PURE__ */ jsxs(Space, { spacing: 2, children: [
|
|
101
|
+
dragBtnHidden ? null : /* @__PURE__ */ jsx(
|
|
102
|
+
IconButton,
|
|
103
|
+
{
|
|
104
|
+
color: "secondary",
|
|
105
|
+
size: "mini",
|
|
106
|
+
icon: /* @__PURE__ */ jsx(IconCozHandle, { fontSize: 14 }),
|
|
107
|
+
className: cn("drag !w-[14px]", styles["drag-btn"])
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
(message == null ? void 0 : message.message_type) ? /* @__PURE__ */ jsx(
|
|
111
|
+
MessageTypeSelect,
|
|
112
|
+
{
|
|
113
|
+
value: message.message_type,
|
|
114
|
+
onChange: onMessageTypeChange,
|
|
115
|
+
disabled: messageTypeDisabled || readonly,
|
|
116
|
+
messageTypeList
|
|
117
|
+
}
|
|
118
|
+
) : null,
|
|
119
|
+
leftActionBtns
|
|
120
|
+
] }),
|
|
121
|
+
rightActionBtns
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ jsx(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: cn("w-full overflow-y-auto styled-scrollbar", {
|
|
127
|
+
"py-1": (message == null ? void 0 : message.message_type) !== flow_devops_prompt_common.MessageType.Placeholder
|
|
128
|
+
}),
|
|
129
|
+
children: (message == null ? void 0 : message.message_type) === flow_devops_prompt_common.MessageType.Placeholder ? /* @__PURE__ */ jsx(
|
|
130
|
+
Input,
|
|
131
|
+
{
|
|
132
|
+
value: message.content,
|
|
133
|
+
onChange: handleMessageContentChange,
|
|
134
|
+
borderless: true,
|
|
135
|
+
disabled: readonly,
|
|
136
|
+
style: { border: 0, borderRadius: 0 },
|
|
137
|
+
onInput: (event) => {
|
|
138
|
+
const target = event.target;
|
|
139
|
+
if (target) {
|
|
140
|
+
let { value } = target;
|
|
141
|
+
if (value === "") {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (!/^[A-Za-z]/.test(value)) {
|
|
145
|
+
value = value.slice(1);
|
|
146
|
+
}
|
|
147
|
+
value = value.replace(/[^A-Za-z0-9_]/g, "");
|
|
148
|
+
target.value = value;
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
maxLength: VARIABLE_MAX_LEN,
|
|
152
|
+
max: 50,
|
|
153
|
+
className: "!pl-3 font-sm",
|
|
154
|
+
inputStyle: {
|
|
155
|
+
fontSize: 13,
|
|
156
|
+
color: "var(--Green-COZColorGreen7, #00A136)",
|
|
157
|
+
fontFamily: "JetBrainsMonoRegular"
|
|
158
|
+
},
|
|
159
|
+
onFocus: () => setEditorActive(true),
|
|
160
|
+
onBlur: () => setEditorActive(false),
|
|
161
|
+
placeholder: "支持输入英文字母和下划线,且首字母必须是字母"
|
|
162
|
+
},
|
|
163
|
+
message.key || message.id
|
|
164
|
+
) : /* @__PURE__ */ jsx(
|
|
165
|
+
PromptBasicEditor,
|
|
166
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
167
|
+
defaultValue: message == null ? void 0 : message.content,
|
|
168
|
+
onChange: handleMessageContentChange,
|
|
169
|
+
variables,
|
|
170
|
+
readOnly: readonly,
|
|
171
|
+
linePlaceholder: placeholder,
|
|
172
|
+
onFocus: () => setEditorActive(true),
|
|
173
|
+
onBlur: () => setEditorActive(false),
|
|
174
|
+
ref,
|
|
175
|
+
children
|
|
176
|
+
}),
|
|
177
|
+
(message == null ? void 0 : message.key) || (message == null ? void 0 : message.id)
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
export {
|
|
187
|
+
PromptEditor
|
|
188
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./index_module.css";
|
|
2
|
+
var index_module_default = { "prompt-editor-container": "prompt-editor-container_8d7ff", "header": "header_8d7ff", "drag-btn": "drag-btn_8d7ff", "prompt-editor-container-error": "prompt-editor-container-error_8d7ff", "prompt-editor-btn-group": "prompt-editor-btn-group_8d7ff", "prompt-editor-container-active": "prompt-editor-container-active_8d7ff", "prompt-editor-container-disabled": "prompt-editor-container-disabled_8d7ff", "role-display": "role-display_8d7ff", "full-screen": "full-screen_8d7ff" };
|
|
3
|
+
export {
|
|
4
|
+
index_module_default as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* stylelint-disable font-family-no-missing-generic-family-keyword */
|
|
2
|
+
/* stylelint-disable declaration-no-important */
|
|
3
|
+
.prompt-editor-container_8d7ff {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: flex-start;
|
|
8
|
+
align-self: stretch;
|
|
9
|
+
background: var(--Bg-COZ-bg-max, #FFF);
|
|
10
|
+
border: 1px solid var(--Stroke-COZ-stroke-plus, rgba(68, 83, 130, 0.25));
|
|
11
|
+
border-radius: var(--Radius-Default, 6px);
|
|
12
|
+
}
|
|
13
|
+
.prompt-editor-container_8d7ff .header_8d7ff {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 36px;
|
|
20
|
+
padding: 12px 8px;
|
|
21
|
+
border-bottom: 1px solid var(--Stroke-COZ-stroke-primary, rgba(82, 100, 154, 0.13));
|
|
22
|
+
}
|
|
23
|
+
.prompt-editor-container_8d7ff .header_8d7ff .drag-btn_8d7ff {
|
|
24
|
+
color: var(--coz-fg-dim);
|
|
25
|
+
}
|
|
26
|
+
.prompt-editor-container_8d7ff .header_8d7ff .drag-btn_8d7ff:hover {
|
|
27
|
+
color: var(--coz-fg-secondary);
|
|
28
|
+
}
|
|
29
|
+
.prompt-editor-container-error_8d7ff {
|
|
30
|
+
border: 1px solid var(--Red-COZ-red-500, #F54A45);
|
|
31
|
+
}
|
|
32
|
+
.prompt-editor-container_8d7ff .prompt-editor-btn-group_8d7ff {
|
|
33
|
+
display: none;
|
|
34
|
+
transition: all 0.2s ease-in-out;
|
|
35
|
+
}
|
|
36
|
+
.prompt-editor-container_8d7ff input::placeholder {
|
|
37
|
+
font-family: JetBrainsMonoBold !important;
|
|
38
|
+
font-size: 13px !important;
|
|
39
|
+
}
|
|
40
|
+
.prompt-editor-container_8d7ff .cm-scroller {
|
|
41
|
+
scrollbar-gutter: stable;
|
|
42
|
+
}
|
|
43
|
+
.prompt-editor-container_8d7ff .cm-scroller::-webkit-scrollbar-thumb {
|
|
44
|
+
visibility: hidden;
|
|
45
|
+
}
|
|
46
|
+
.prompt-editor-container-active_8d7ff {
|
|
47
|
+
border: 1px solid rgba(var(--coze-up-brand-9), 1);
|
|
48
|
+
}
|
|
49
|
+
.prompt-editor-container-active_8d7ff .cm-scroller::-webkit-scrollbar-thumb {
|
|
50
|
+
visibility: visible;
|
|
51
|
+
}
|
|
52
|
+
.prompt-editor-container-disabled_8d7ff {
|
|
53
|
+
background: var(--coz-bg-primary, #F7F7FC);
|
|
54
|
+
}
|
|
55
|
+
.prompt-editor-container_8d7ff:hover .prompt-editor-btn-group_8d7ff {
|
|
56
|
+
display: flex;
|
|
57
|
+
}
|
|
58
|
+
.prompt-editor-container_8d7ff:hover .cm-scroller::-webkit-scrollbar-thumb {
|
|
59
|
+
visibility: visible;
|
|
60
|
+
}
|
|
61
|
+
.role-display_8d7ff {
|
|
62
|
+
color: var(--Fg-COZ-fg-dim, rgba(55, 67, 106, 0.38)) !important;
|
|
63
|
+
}
|
|
64
|
+
.full-screen_8d7ff {
|
|
65
|
+
position: fixed !important;
|
|
66
|
+
z-index: 1000;
|
|
67
|
+
inset: 0 !important;
|
|
68
|
+
width: 100% !important;
|
|
69
|
+
height: 100% !important;
|
|
70
|
+
background-color: var(--semi-color-bg-0);
|
|
71
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import { IconCozNodeExpand } from "@coze-arch/coze-design/icons";
|
|
5
|
+
import { Button, Menu, Typography } from "@coze-arch/coze-design";
|
|
6
|
+
import styles from "./index.module";
|
|
7
|
+
function MessageTypeSelect({
|
|
8
|
+
value,
|
|
9
|
+
onChange,
|
|
10
|
+
disabled,
|
|
11
|
+
messageTypeList = []
|
|
12
|
+
}) {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
|
+
const [visible, setVisible] = useState(false);
|
|
15
|
+
if (disabled) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
Typography.Text,
|
|
18
|
+
{
|
|
19
|
+
size: "small",
|
|
20
|
+
type: "tertiary",
|
|
21
|
+
className: cn("px-2", styles["role-display"], "variable-text"),
|
|
22
|
+
children: (_b = ((_a = messageTypeList.find((it) => it.value === value)) == null ? void 0 : _a.label) || value) != null ? _b : "-"
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
Menu,
|
|
28
|
+
{
|
|
29
|
+
visible,
|
|
30
|
+
trigger: "custom",
|
|
31
|
+
position: "bottomLeft",
|
|
32
|
+
showTick: false,
|
|
33
|
+
render: /* @__PURE__ */ jsx(
|
|
34
|
+
Menu.SubMenu,
|
|
35
|
+
{
|
|
36
|
+
mode: "selection",
|
|
37
|
+
selectedKeys: [`${value}`],
|
|
38
|
+
onSelectionChange: (v) => {
|
|
39
|
+
onChange == null ? void 0 : onChange(Number(v));
|
|
40
|
+
setVisible(false);
|
|
41
|
+
},
|
|
42
|
+
children: messageTypeList == null ? void 0 : messageTypeList.map((it) => /* @__PURE__ */ jsx(
|
|
43
|
+
Menu.Item,
|
|
44
|
+
{
|
|
45
|
+
itemKey: `${it.value}`,
|
|
46
|
+
className: cn("!px-2", {
|
|
47
|
+
"coz-mg-primary": `${it}` === `${value}`
|
|
48
|
+
}),
|
|
49
|
+
children: /* @__PURE__ */ jsx(Typography.Text, { className: "variable-text", children: it.label })
|
|
50
|
+
},
|
|
51
|
+
it.value
|
|
52
|
+
))
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
onClickOutSide: () => setVisible(false),
|
|
56
|
+
children: /* @__PURE__ */ jsxs(
|
|
57
|
+
Button,
|
|
58
|
+
{
|
|
59
|
+
size: "mini",
|
|
60
|
+
color: "secondary",
|
|
61
|
+
onClick: () => setVisible(true),
|
|
62
|
+
className: cn(styles["role-display"], "variable-text"),
|
|
63
|
+
children: [
|
|
64
|
+
(_d = ((_c = messageTypeList.find((it) => it.value === value)) == null ? void 0 : _c.label) || value) != null ? _d : "-",
|
|
65
|
+
/* @__PURE__ */ jsx(IconCozNodeExpand, { className: "ml-0.5" })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
MessageTypeSelect
|
|
74
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { BaseJsonEditor, BaseRawTextEditor } from "../code-editor";
|
|
4
|
+
const SchemaEditor = ({
|
|
5
|
+
value,
|
|
6
|
+
onChange,
|
|
7
|
+
placeholder,
|
|
8
|
+
readOnly,
|
|
9
|
+
language,
|
|
10
|
+
className
|
|
11
|
+
}) => /* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: classNames(
|
|
15
|
+
"w-full h-[500px] border border-solid coz-stroke-primary rounded-[4px] overflow-hidden relative bg-white",
|
|
16
|
+
{ "opacity-70": readOnly },
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
children: language === "json" ? /* @__PURE__ */ jsx(
|
|
20
|
+
BaseJsonEditor,
|
|
21
|
+
{
|
|
22
|
+
className: "w-full h-full overflow-y-auto",
|
|
23
|
+
onChange,
|
|
24
|
+
value: value || "",
|
|
25
|
+
placeholder,
|
|
26
|
+
readonly: readOnly,
|
|
27
|
+
borderRadius: 4
|
|
28
|
+
}
|
|
29
|
+
) : /* @__PURE__ */ jsx(
|
|
30
|
+
BaseRawTextEditor,
|
|
31
|
+
{
|
|
32
|
+
className: "w-full h-full overflow-y-auto",
|
|
33
|
+
onChange,
|
|
34
|
+
value: value || "",
|
|
35
|
+
placeholder,
|
|
36
|
+
readonly: readOnly
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
export {
|
|
42
|
+
SchemaEditor
|
|
43
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { uniqueId } from "lodash-es";
|
|
2
|
+
const safeParseJson = (jsonString, fallback) => {
|
|
3
|
+
try {
|
|
4
|
+
if (jsonString) {
|
|
5
|
+
return JSON.parse(jsonString);
|
|
6
|
+
}
|
|
7
|
+
} catch (e) {
|
|
8
|
+
return fallback;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const HEIGHT_BUFFER = 20;
|
|
12
|
+
const handleScrollToBottom = (e, callback) => {
|
|
13
|
+
const { scrollTop, clientHeight, scrollHeight } = e.currentTarget;
|
|
14
|
+
if (scrollTop + clientHeight + HEIGHT_BUFFER >= scrollHeight) {
|
|
15
|
+
callback();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function sleep(timer = 600) {
|
|
19
|
+
return new Promise((resolve) => {
|
|
20
|
+
setTimeout(() => resolve(), timer);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const messageId = () => {
|
|
24
|
+
const date = /* @__PURE__ */ new Date();
|
|
25
|
+
return date.getTime() + uniqueId();
|
|
26
|
+
};
|
|
27
|
+
const thousand = 1e3;
|
|
28
|
+
const convertNumberToThousands = (num) => {
|
|
29
|
+
if (!num) {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
const number = Number(num);
|
|
33
|
+
if (number < thousand) {
|
|
34
|
+
return number;
|
|
35
|
+
} else {
|
|
36
|
+
return `${(number / thousand).toFixed(1)} K`;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
function recordToArray(record) {
|
|
40
|
+
return Object.entries(record).map(([key, value]) => ({
|
|
41
|
+
label: key,
|
|
42
|
+
value
|
|
43
|
+
// 将值转换为字符串,如果值为 undefined 则不设置
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
convertNumberToThousands,
|
|
48
|
+
handleScrollToBottom,
|
|
49
|
+
messageId,
|
|
50
|
+
recordToArray,
|
|
51
|
+
safeParseJson,
|
|
52
|
+
sleep
|
|
53
|
+
};
|