@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,74 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { toBase64 } from "js-base64";
|
|
22
|
+
const getFileName = (extension) => `mermaid-diagram-${(/* @__PURE__ */ new Date()).getTime()}.${extension}`;
|
|
23
|
+
const simulateDownload = (download, href) => {
|
|
24
|
+
const a = document.createElement("a");
|
|
25
|
+
a.download = download;
|
|
26
|
+
a.href = href;
|
|
27
|
+
a.click();
|
|
28
|
+
a.remove();
|
|
29
|
+
};
|
|
30
|
+
const downloadImage = (context, image) => () => {
|
|
31
|
+
const { canvas } = context;
|
|
32
|
+
context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
33
|
+
simulateDownload(
|
|
34
|
+
getFileName("png"),
|
|
35
|
+
canvas.toDataURL("image/png").replace("image/png", "image/octet-stream")
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const getBase64SVG = (svg, width, height) => {
|
|
39
|
+
if (svg) {
|
|
40
|
+
svg = svg.cloneNode(true);
|
|
41
|
+
}
|
|
42
|
+
height && (svg == null ? void 0 : svg.setAttribute("height", `${height}px`));
|
|
43
|
+
width && (svg == null ? void 0 : svg.setAttribute("width", `${width}px`));
|
|
44
|
+
const svgString = svg.outerHTML.replaceAll("<br>", "<br/>").replaceAll(/<img([^>]*)>/g, (m, g) => `<img ${g} />`);
|
|
45
|
+
return toBase64(`<?xml version="1.0" encoding="UTF-8"?>
|
|
46
|
+
<?xml-stylesheet href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" type="text/css"?>
|
|
47
|
+
${svgString}`);
|
|
48
|
+
};
|
|
49
|
+
const exportImage = (svgSelector) => __async(void 0, null, function* () {
|
|
50
|
+
yield new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
51
|
+
const canvas = document.createElement("canvas");
|
|
52
|
+
const svg = document.querySelector(svgSelector);
|
|
53
|
+
if (!svg) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const box = svg.getBoundingClientRect();
|
|
57
|
+
const multiplier = 2;
|
|
58
|
+
canvas.width = box.width * multiplier;
|
|
59
|
+
canvas.height = box.height * multiplier;
|
|
60
|
+
const context = canvas.getContext("2d");
|
|
61
|
+
if (!context) {
|
|
62
|
+
throw new Error("context not found");
|
|
63
|
+
}
|
|
64
|
+
context.fillStyle = "white";
|
|
65
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
66
|
+
const image = new Image();
|
|
67
|
+
image.addEventListener("load", () => {
|
|
68
|
+
downloadImage(context, image)();
|
|
69
|
+
});
|
|
70
|
+
image.src = `data:image/svg+xml;base64,${getBase64SVG(svg, canvas.width, canvas.height)}`;
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
exportImage
|
|
74
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { useEffect, useRef, useState } from "react";
|
|
22
|
+
import classNames from "classnames";
|
|
23
|
+
import { Form } from "@coze-arch/coze-design";
|
|
24
|
+
import { convertModelToModelConfig } from "../utils/model-config";
|
|
25
|
+
import { ModelSelect } from "../model-select";
|
|
26
|
+
import { ModelConfigForm } from "./model-config-form";
|
|
27
|
+
import styles from "./index.module";
|
|
28
|
+
function BasicModelConfigEditor({
|
|
29
|
+
className,
|
|
30
|
+
style,
|
|
31
|
+
value,
|
|
32
|
+
onChange,
|
|
33
|
+
disabled,
|
|
34
|
+
modelSelectProps
|
|
35
|
+
}) {
|
|
36
|
+
const formApi = useRef();
|
|
37
|
+
const [selectModel, setSelectModel] = useState(
|
|
38
|
+
modelSelectProps == null ? void 0 : modelSelectProps.value
|
|
39
|
+
);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if ((selectModel == null ? void 0 : selectModel.id) !== (value == null ? void 0 : value.id)) {
|
|
43
|
+
const modelConfig = convertModelToModelConfig(selectModel);
|
|
44
|
+
(_b = (_a = formApi.current) == null ? void 0 : _a.setValues) == null ? void 0 : _b.call(_a, modelConfig, { isOverride: true });
|
|
45
|
+
}
|
|
46
|
+
}, [selectModel, value]);
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
Form,
|
|
49
|
+
{
|
|
50
|
+
className: classNames(styles["model-config-form"], className),
|
|
51
|
+
style,
|
|
52
|
+
labelWidth: 120,
|
|
53
|
+
initValues: value,
|
|
54
|
+
onValueChange: onChange,
|
|
55
|
+
getFormApi: (api) => formApi.current = api,
|
|
56
|
+
disabled,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
ModelSelect,
|
|
60
|
+
__spreadProps(__spreadValues({}, modelSelectProps), {
|
|
61
|
+
value: selectModel,
|
|
62
|
+
disabled,
|
|
63
|
+
onChange: setSelectModel
|
|
64
|
+
})
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsx(ModelConfigForm, { model: selectModel })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
BasicModelConfigEditor
|
|
73
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
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
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { isUndefined } from "lodash-es";
|
|
22
|
+
import { MdBoxLazy } from "@flow-web/md-box/lazy";
|
|
23
|
+
import { InputSlider } from "@cozeloop/components";
|
|
24
|
+
import { IconCozQuestionMarkCircle } from "@coze-arch/coze-design/icons";
|
|
25
|
+
import {
|
|
26
|
+
Form,
|
|
27
|
+
Tooltip,
|
|
28
|
+
Typography,
|
|
29
|
+
withField
|
|
30
|
+
} from "@coze-arch/coze-design";
|
|
31
|
+
import { DEFAULT_MAX_TOKENS, modelConfigLabelMap } from "../consts";
|
|
32
|
+
const convertInt64ToNumber = (v) => {
|
|
33
|
+
if (v !== void 0) {
|
|
34
|
+
return Number(v);
|
|
35
|
+
} else {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const getInputSliderConfig = (key, modelParams) => {
|
|
40
|
+
const param = modelParams.find((item) => item.name === key);
|
|
41
|
+
const max = key === "max_tokens" ? DEFAULT_MAX_TOKENS : 0;
|
|
42
|
+
return {
|
|
43
|
+
min: Number((param == null ? void 0 : param.min) || 0),
|
|
44
|
+
max: Math.max(Number((param == null ? void 0 : param.max) || 1), max),
|
|
45
|
+
defaultValue: Number((param == null ? void 0 : param.defaultVal) || max),
|
|
46
|
+
label: {
|
|
47
|
+
text: /* @__PURE__ */ jsx(Typography.Text, { children: (param == null ? void 0 : param.name) ? modelConfigLabelMap[param.name] || "" : "" }),
|
|
48
|
+
extra: /* @__PURE__ */ jsx(
|
|
49
|
+
Tooltip,
|
|
50
|
+
{
|
|
51
|
+
content: /* @__PURE__ */ jsx(MdBoxLazy, { className: "!text-white", markDown: (param == null ? void 0 : param.desc) || "" }),
|
|
52
|
+
theme: "dark",
|
|
53
|
+
children: /* @__PURE__ */ jsx(IconCozQuestionMarkCircle, {})
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const FormInputSlider = withField(InputSlider);
|
|
60
|
+
function ModelConfigForm({ model }) {
|
|
61
|
+
if (!model) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const modelAbility = model == null ? void 0 : model.ability;
|
|
65
|
+
const modelParams = (modelAbility == null ? void 0 : modelAbility.modelParams) || [];
|
|
66
|
+
const defaultRuntimeParam = model == null ? void 0 : model.defaultRuntimeParam;
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
FormInputSlider,
|
|
70
|
+
__spreadProps(__spreadValues({
|
|
71
|
+
field: "max_tokens",
|
|
72
|
+
labelPosition: "left"
|
|
73
|
+
}, getInputSliderConfig("max_tokens", modelParams)), {
|
|
74
|
+
label: {
|
|
75
|
+
text: /* @__PURE__ */ jsx(Typography.Text, { children: "最大回复长度" }),
|
|
76
|
+
extra: /* @__PURE__ */ jsx(
|
|
77
|
+
Tooltip,
|
|
78
|
+
{
|
|
79
|
+
content: /* @__PURE__ */ jsx(
|
|
80
|
+
MdBoxLazy,
|
|
81
|
+
{
|
|
82
|
+
className: "!text-white",
|
|
83
|
+
markDown: "- **max_tokens**: 控制模型输出的 Tokens 长度上限。通常 100 Tokens 约等于 150 个中文汉字。"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
theme: "dark",
|
|
87
|
+
children: /* @__PURE__ */ jsx(IconCozQuestionMarkCircle, {})
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
),
|
|
93
|
+
isUndefined(defaultRuntimeParam == null ? void 0 : defaultRuntimeParam.temperature) ? null : /* @__PURE__ */ jsx(
|
|
94
|
+
FormInputSlider,
|
|
95
|
+
__spreadProps(__spreadValues({
|
|
96
|
+
field: "temperature",
|
|
97
|
+
labelPosition: "left"
|
|
98
|
+
}, getInputSliderConfig("temperature", modelParams)), {
|
|
99
|
+
step: 0.01
|
|
100
|
+
})
|
|
101
|
+
),
|
|
102
|
+
isUndefined(defaultRuntimeParam == null ? void 0 : defaultRuntimeParam.topP) ? null : /* @__PURE__ */ jsx(
|
|
103
|
+
FormInputSlider,
|
|
104
|
+
__spreadProps(__spreadValues({
|
|
105
|
+
field: "top_p",
|
|
106
|
+
labelPosition: "left",
|
|
107
|
+
label: {
|
|
108
|
+
text: /* @__PURE__ */ jsx(Typography.Text, { children: "Top P" })
|
|
109
|
+
}
|
|
110
|
+
}, getInputSliderConfig("top_p", modelParams)), {
|
|
111
|
+
step: 0.01
|
|
112
|
+
})
|
|
113
|
+
),
|
|
114
|
+
(modelAbility == null ? void 0 : modelAbility.jsonModeEnabled) ? /* @__PURE__ */ jsx(
|
|
115
|
+
Form.Switch,
|
|
116
|
+
{
|
|
117
|
+
labelPosition: "left",
|
|
118
|
+
label: {
|
|
119
|
+
text: /* @__PURE__ */ jsx(Typography.Text, { children: "JSON Mode" })
|
|
120
|
+
},
|
|
121
|
+
field: "json_mode"
|
|
122
|
+
}
|
|
123
|
+
) : null
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
ModelConfigForm,
|
|
128
|
+
convertInt64ToNumber,
|
|
129
|
+
getInputSliderConfig
|
|
130
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
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 { useEffect, useRef, useState } from "react";
|
|
34
|
+
import {
|
|
35
|
+
Form,
|
|
36
|
+
Popover,
|
|
37
|
+
Space,
|
|
38
|
+
Typography
|
|
39
|
+
} from "@coze-arch/coze-design";
|
|
40
|
+
import { convertModelToModelConfig } from "../utils/model-config";
|
|
41
|
+
import { ModelSelect } from "../model-select";
|
|
42
|
+
import { ModelConfigForm } from "./model-config-form";
|
|
43
|
+
import styles from "./index.module";
|
|
44
|
+
function PopoverModelConfigEdiotr({
|
|
45
|
+
value,
|
|
46
|
+
disabled,
|
|
47
|
+
modelSelectProps,
|
|
48
|
+
popoverProps,
|
|
49
|
+
onChange,
|
|
50
|
+
renderDisplayContent
|
|
51
|
+
}) {
|
|
52
|
+
const formApi = useRef();
|
|
53
|
+
const _a = popoverProps || {}, { wrapClassName, wrapStyle } = _a, restPopoverProps = __objRest(_a, ["wrapClassName", "wrapStyle"]);
|
|
54
|
+
const [selectModel, setSelectModel] = useState();
|
|
55
|
+
const [isPopoverVisible, setPopoverVisible] = useState(false);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
var _a2, _b;
|
|
58
|
+
if ((selectModel == null ? void 0 : selectModel.id) !== (value == null ? void 0 : value.id)) {
|
|
59
|
+
const modelConfig = convertModelToModelConfig(selectModel);
|
|
60
|
+
(_b = (_a2 = formApi.current) == null ? void 0 : _a2.setValues) == null ? void 0 : _b.call(_a2, modelConfig, { isOverride: true });
|
|
61
|
+
}
|
|
62
|
+
}, [selectModel, value]);
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
Popover,
|
|
65
|
+
__spreadProps(__spreadValues({
|
|
66
|
+
content: /* @__PURE__ */ jsx("div", { className: "pt-1 px-4 pb-4", style: { width: 496 }, children: /* @__PURE__ */ jsxs(
|
|
67
|
+
Form,
|
|
68
|
+
{
|
|
69
|
+
className: styles["model-config-form"],
|
|
70
|
+
labelWidth: 120,
|
|
71
|
+
initValues: value,
|
|
72
|
+
onValueChange: onChange,
|
|
73
|
+
getFormApi: (api) => formApi.current = api,
|
|
74
|
+
disabled,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsxs(Space, { className: "py-0", children: [
|
|
77
|
+
/* @__PURE__ */ jsx(Typography.Title, { heading: 6, style: { minWidth: 120 }, children: "模型选择" }),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
ModelSelect,
|
|
80
|
+
__spreadProps(__spreadValues({}, modelSelectProps), {
|
|
81
|
+
value: selectModel,
|
|
82
|
+
disabled,
|
|
83
|
+
onChange: setSelectModel
|
|
84
|
+
})
|
|
85
|
+
)
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
Typography.Title,
|
|
89
|
+
{
|
|
90
|
+
heading: 6,
|
|
91
|
+
style: { marginTop: 12, marginBottom: 12 },
|
|
92
|
+
children: "参数配置"
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsx(ModelConfigForm, { model: selectModel })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
) }),
|
|
99
|
+
keepDOM: true,
|
|
100
|
+
trigger: "custom",
|
|
101
|
+
visible: isPopoverVisible,
|
|
102
|
+
onClickOutSide: () => setPopoverVisible(false)
|
|
103
|
+
}, restPopoverProps), {
|
|
104
|
+
children: /* @__PURE__ */ jsx(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: wrapClassName,
|
|
108
|
+
style: wrapStyle,
|
|
109
|
+
onClick: () => setPopoverVisible(true),
|
|
110
|
+
children: renderDisplayContent == null ? void 0 : renderDisplayContent(selectModel, isPopoverVisible)
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
})
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
PopoverModelConfigEdiotr
|
|
118
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { groupBy } from "lodash-es";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { IconCozUpdate } from "@coze-arch/coze-design/icons";
|
|
6
|
+
import { Avatar, Select, Typography } from "@coze-arch/coze-design";
|
|
7
|
+
import { renderModelOfflineTag } from "../utils/model-config";
|
|
8
|
+
import { ModelOption } from "./model-option";
|
|
9
|
+
import styles from "./index.module";
|
|
10
|
+
function ModelSelectItem({ item }) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center w-full gap-1", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-hidden flex-shrink-0 mr-[8px]", children: /* @__PURE__ */ jsx(Avatar, { src: item == null ? void 0 : item.modelIcon, shape: "square", size: "extra-extra-small" }) }),
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
14
|
+
Typography.Text,
|
|
15
|
+
{
|
|
16
|
+
style: {
|
|
17
|
+
maxWidth: "400px",
|
|
18
|
+
fontSize: "13px"
|
|
19
|
+
},
|
|
20
|
+
ellipsis: { showTooltip: { opts: { theme: "dark" } } },
|
|
21
|
+
children: item == null ? void 0 : item.displayName
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
renderModelOfflineTag(item)
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function ModelSelect({
|
|
28
|
+
className,
|
|
29
|
+
style,
|
|
30
|
+
value,
|
|
31
|
+
disabled,
|
|
32
|
+
defaultSelectFirstModel,
|
|
33
|
+
loading,
|
|
34
|
+
modelListData,
|
|
35
|
+
onChange,
|
|
36
|
+
loadMore,
|
|
37
|
+
optionCustomRender,
|
|
38
|
+
valueKey = "identification"
|
|
39
|
+
}) {
|
|
40
|
+
const handleModelChange = (v) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const model = (_a = modelListData == null ? void 0 : modelListData.list) == null ? void 0 : _a.find((item) => (item == null ? void 0 : item[valueKey]) === v);
|
|
43
|
+
onChange == null ? void 0 : onChange(model);
|
|
44
|
+
};
|
|
45
|
+
const ref = useRef();
|
|
46
|
+
const { modelGroups } = useMemo(() => {
|
|
47
|
+
const modelSeriesGroups = groupBy(
|
|
48
|
+
modelListData == null ? void 0 : modelListData.list,
|
|
49
|
+
(model) => {
|
|
50
|
+
var _a;
|
|
51
|
+
return (_a = model.commercialModelSeries) == null ? void 0 : _a.seriesName;
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
const groupedModels = Object.values(modelSeriesGroups).filter(
|
|
55
|
+
(group) => !!(group == null ? void 0 : group.length)
|
|
56
|
+
);
|
|
57
|
+
return {
|
|
58
|
+
modelGroups: groupedModels
|
|
59
|
+
};
|
|
60
|
+
}, [modelListData == null ? void 0 : modelListData.list]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
if (!value && defaultSelectFirstModel && ((_a = modelListData == null ? void 0 : modelListData.list) == null ? void 0 : _a.length)) {
|
|
64
|
+
onChange == null ? void 0 : onChange((_b = modelListData == null ? void 0 : modelListData.list) == null ? void 0 : _b[0]);
|
|
65
|
+
}
|
|
66
|
+
}, [modelListData == null ? void 0 : modelListData.list, defaultSelectFirstModel, value]);
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
Select,
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
className: classNames("w-full", styles["model-select"], className),
|
|
72
|
+
style,
|
|
73
|
+
showArrow: false,
|
|
74
|
+
suffix: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-shrink-0 text-[13px]", children: [
|
|
75
|
+
/* @__PURE__ */ jsx(IconCozUpdate, {}),
|
|
76
|
+
"选择模型"
|
|
77
|
+
] }),
|
|
78
|
+
loading,
|
|
79
|
+
disabled,
|
|
80
|
+
value: value == null ? void 0 : value[valueKey],
|
|
81
|
+
onChange: (v) => handleModelChange == null ? void 0 : handleModelChange(v),
|
|
82
|
+
onListScroll: (e) => {
|
|
83
|
+
const target = e.currentTarget;
|
|
84
|
+
const isAtBottom = target.scrollHeight - target.scrollTop === target.clientHeight;
|
|
85
|
+
if (!(modelListData == null ? void 0 : modelListData.hasMore) || !isAtBottom) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
loadMore == null ? void 0 : loadMore();
|
|
89
|
+
},
|
|
90
|
+
placeholder: "请选择模型",
|
|
91
|
+
renderSelectedItem: (item) => /* @__PURE__ */ jsx(ModelSelectItem, { item: item["data-item"] || value }),
|
|
92
|
+
dropdownClassName: styles["model-select-dropdown"],
|
|
93
|
+
showTick: false,
|
|
94
|
+
filter: (input, option) => {
|
|
95
|
+
var _a;
|
|
96
|
+
if (input && (option == null ? void 0 : option["data-item"])) {
|
|
97
|
+
const item = option["data-item"];
|
|
98
|
+
return (_a = item == null ? void 0 : item.displayName) == null ? void 0 : _a.includes(input);
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
},
|
|
102
|
+
children: modelGroups.map((group) => {
|
|
103
|
+
var _a, _b, _c, _d, _e, _f;
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
Select.OptGroup,
|
|
106
|
+
{
|
|
107
|
+
label: `${(_b = (_a = group[0]) == null ? void 0 : _a.commercialModelSeries) == null ? void 0 : _b.seriesName} | ${((_d = (_c = group[0]) == null ? void 0 : _c.commercialModelSeries) == null ? void 0 : _d.modelVendor) ? `由${(_f = (_e = group[0]) == null ? void 0 : _e.commercialModelSeries) == null ? void 0 : _f.modelVendor}提供` : ""}`,
|
|
108
|
+
children: group.map(
|
|
109
|
+
(item) => optionCustomRender ? optionCustomRender(item) : /* @__PURE__ */ jsx(
|
|
110
|
+
Select.Option,
|
|
111
|
+
{
|
|
112
|
+
value: item == null ? void 0 : item[valueKey],
|
|
113
|
+
"data-item": item,
|
|
114
|
+
disabled: item.disabled,
|
|
115
|
+
children: /* @__PURE__ */ jsx(
|
|
116
|
+
ModelOption,
|
|
117
|
+
{
|
|
118
|
+
model: item,
|
|
119
|
+
selected: (value == null ? void 0 : value[valueKey]) === (item == null ? void 0 : item[valueKey]),
|
|
120
|
+
disabled: item.disabled
|
|
121
|
+
},
|
|
122
|
+
item == null ? void 0 : item[valueKey]
|
|
123
|
+
)
|
|
124
|
+
},
|
|
125
|
+
item == null ? void 0 : item[valueKey]
|
|
126
|
+
)
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
ModelSelect
|
|
136
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* stylelint-disable declaration-no-important */
|
|
2
|
+
.model-select-dropdown_98ab9 .semi-select-option-list {
|
|
3
|
+
max-height: 390px !important;
|
|
4
|
+
}
|
|
5
|
+
.model-select-dropdown_98ab9 .semi-select-group {
|
|
6
|
+
padding-left: 16px !important;
|
|
7
|
+
}
|
|
8
|
+
.model-select-dropdown_98ab9 .coz-select-option-item {
|
|
9
|
+
background: transparent !important;
|
|
10
|
+
}
|
|
11
|
+
.model-select_98ab9 .semi-select-suffix {
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
padding-left: 4px;
|
|
14
|
+
}
|