@cozeloop/components 0.0.3 → 0.0.4-beta-1770694681364
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/index.css +13 -29
- package/dist/es/{index.js → index.mjs} +562 -518
- package/dist/es/loopIcons.mjs +3 -0
- package/dist/es/rslib-runtime.mjs +40 -0
- package/dist/lib/base-search-select/base-search-select.d.ts +4 -1
- package/dist/lib/base-search-select/index.d.ts +1 -1
- package/dist/lib/base-search-select/types.d.ts +1 -1
- package/dist/lib/code-editor-with-loading/index.d.ts +10 -0
- package/dist/lib/codemirror-editor/code-editor.d.ts +23 -2
- package/dist/lib/codemirror-editor/index.d.ts +2 -0
- package/dist/lib/codemirror-editor/json-editor.d.ts +1 -1
- package/dist/lib/codemirror-editor/raw-code-editor.d.ts +20 -0
- package/dist/lib/codemirror-editor/text-editor.d.ts +23 -2
- package/dist/lib/collapse-card/index.d.ts +2 -1
- package/dist/lib/collapse-item/index.d.ts +7 -0
- package/dist/lib/copyable/index.d.ts +5 -0
- package/dist/lib/hooks/use-unsave-leave-warning.d.ts +4 -1
- package/dist/lib/index.d.ts +7 -6
- package/dist/lib/large-txt-render/index.d.ts +1 -0
- package/dist/lib/logic-editor/logic-editor.d.ts +2 -4
- package/dist/lib/logic-editor/logic-types.d.ts +6 -2
- package/dist/lib/loop-icons/index.d.ts +1 -0
- package/dist/lib/multi-part-editor/type.d.ts +1 -1
- package/dist/lib/primary-page/primary-header.d.ts +2 -1
- package/dist/lib/table/sort-icon.d.ts +3 -3
- package/dist/lib/table-col-actions/index.d.ts +2 -0
- package/package.json +36 -28
- package/.eslintcache +0 -1
- package/.rush/temp/shrinkwrap-deps.json +0 -770
- package/OWNERS +0 -5
- package/config/rush-project.json +0 -8
- package/dist/lib/base-search-select/base-search-form-select.js +0 -6
- package/dist/lib/base-search-select/base-search-form-select.js.map +0 -1
- package/dist/lib/base-search-select/base-search-select.js +0 -127
- package/dist/lib/base-search-select/base-search-select.js.map +0 -1
- package/dist/lib/base-search-select/index.js +0 -3
- package/dist/lib/base-search-select/index.js.map +0 -1
- package/dist/lib/base-search-select/types.js +0 -2
- package/dist/lib/base-search-select/types.js.map +0 -1
- package/dist/lib/base-search-select/utils.js +0 -48
- package/dist/lib/base-search-select/utils.js.map +0 -1
- package/dist/lib/basic-card/index.js +0 -4
- package/dist/lib/basic-card/index.js.map +0 -1
- package/dist/lib/card-pane/index.js +0 -9
- package/dist/lib/card-pane/index.js.map +0 -1
- package/dist/lib/chip-select/index.js +0 -6
- package/dist/lib/chip-select/index.js.map +0 -1
- package/dist/lib/code-editor/index.js +0 -7
- package/dist/lib/code-editor/index.js.map +0 -1
- package/dist/lib/code-usage/index.d.ts +0 -14
- package/dist/lib/code-usage/index.js +0 -31
- package/dist/lib/code-usage/index.js.map +0 -1
- package/dist/lib/codemirror-editor/code-editor.js +0 -108
- package/dist/lib/codemirror-editor/code-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/index.js +0 -5
- package/dist/lib/codemirror-editor/index.js.map +0 -1
- package/dist/lib/codemirror-editor/json-editor.js +0 -97
- package/dist/lib/codemirror-editor/json-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/raw-text-editor.js +0 -32
- package/dist/lib/codemirror-editor/raw-text-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/text-editor.js +0 -44
- package/dist/lib/codemirror-editor/text-editor.js.map +0 -1
- package/dist/lib/codemirror-editor/themes/coze-dark.js +0 -113
- package/dist/lib/codemirror-editor/themes/coze-dark.js.map +0 -1
- package/dist/lib/codemirror-editor/themes/coze-light.js +0 -119
- package/dist/lib/codemirror-editor/themes/coze-light.js.map +0 -1
- package/dist/lib/collapse-card/index.js +0 -31
- package/dist/lib/collapse-card/index.js.map +0 -1
- package/dist/lib/collapsible-card/index.js +0 -13
- package/dist/lib/collapsible-card/index.js.map +0 -1
- package/dist/lib/column-manage-storage/index.js +0 -48
- package/dist/lib/column-manage-storage/index.js.map +0 -1
- package/dist/lib/columns-select/index.js +0 -77
- package/dist/lib/columns-select/index.js.map +0 -1
- package/dist/lib/edit-icon-button/index.js +0 -13
- package/dist/lib/edit-icon-button/index.js.map +0 -1
- package/dist/lib/footer-actions/index.js +0 -9
- package/dist/lib/footer-actions/index.js.map +0 -1
- package/dist/lib/hooks/use-infinite-scroll.js +0 -133
- package/dist/lib/hooks/use-infinite-scroll.js.map +0 -1
- package/dist/lib/hooks/use-mouse-down-offset.js +0 -39
- package/dist/lib/hooks/use-mouse-down-offset.js.map +0 -1
- package/dist/lib/hooks/use-unsave-leave-warning.js +0 -33
- package/dist/lib/hooks/use-unsave-leave-warning.js.map +0 -1
- package/dist/lib/id-render/icon-button-container.js +0 -8
- package/dist/lib/id-render/icon-button-container.js.map +0 -1
- package/dist/lib/id-render/index.js +0 -21
- package/dist/lib/id-render/index.js.map +0 -1
- package/dist/lib/index-controller/record-navigation.js +0 -9
- package/dist/lib/index-controller/record-navigation.js.map +0 -1
- package/dist/lib/index-controller/use-item-index-controller.js +0 -123
- package/dist/lib/index-controller/use-item-index-controller.js.map +0 -1
- package/dist/lib/index.js +0 -76
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/infinite-scroll-table/index.js +0 -34
- package/dist/lib/infinite-scroll-table/index.js.map +0 -1
- package/dist/lib/info-tooltip/index.js +0 -9
- package/dist/lib/info-tooltip/index.js.map +0 -1
- package/dist/lib/input-components/radio-button.js +0 -21
- package/dist/lib/input-components/radio-button.js.map +0 -1
- package/dist/lib/input-slider/index.js +0 -81
- package/dist/lib/input-slider/index.js.map +0 -1
- package/dist/lib/input-with-count/index.js +0 -7
- package/dist/lib/input-with-count/index.js.map +0 -1
- package/dist/lib/jump-button/jump-icon-button.js +0 -7
- package/dist/lib/jump-button/jump-icon-button.js.map +0 -1
- package/dist/lib/large-txt-render/index.js +0 -26
- package/dist/lib/large-txt-render/index.js.map +0 -1
- package/dist/lib/layout/content.js +0 -5
- package/dist/lib/layout/content.js.map +0 -1
- package/dist/lib/layout/header.js +0 -6
- package/dist/lib/layout/header.js.map +0 -1
- package/dist/lib/layout/index.js +0 -9
- package/dist/lib/layout/index.js.map +0 -1
- package/dist/lib/layout/tabs.js +0 -10
- package/dist/lib/layout/tabs.js.map +0 -1
- package/dist/lib/lazy-load-component/index.js +0 -42
- package/dist/lib/lazy-load-component/index.js.map +0 -1
- package/dist/lib/logic-editor/index.js +0 -3
- package/dist/lib/logic-editor/index.js.map +0 -1
- package/dist/lib/logic-editor/logic-editor.js +0 -69
- package/dist/lib/logic-editor/logic-editor.js.map +0 -1
- package/dist/lib/logic-editor/logic-left-render.js +0 -60
- package/dist/lib/logic-editor/logic-left-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-operator-render.js +0 -29
- package/dist/lib/logic-editor/logic-operator-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-right-render.js +0 -25
- package/dist/lib/logic-editor/logic-right-render.js.map +0 -1
- package/dist/lib/logic-editor/logic-types.js +0 -136
- package/dist/lib/logic-editor/logic-types.js.map +0 -1
- package/dist/lib/logic-editor/utils.js +0 -18
- package/dist/lib/logic-editor/utils.js.map +0 -1
- package/dist/lib/logic-expr/consts.js +0 -5
- package/dist/lib/logic-expr/consts.js.map +0 -1
- package/dist/lib/logic-expr/expr-group-render.js +0 -61
- package/dist/lib/logic-expr/expr-group-render.js.map +0 -1
- package/dist/lib/logic-expr/expr-render.js +0 -85
- package/dist/lib/logic-expr/expr-render.js.map +0 -1
- package/dist/lib/logic-expr/index.js +0 -2
- package/dist/lib/logic-expr/index.js.map +0 -1
- package/dist/lib/logic-expr/logic-expr.js +0 -187
- package/dist/lib/logic-expr/logic-expr.js.map +0 -1
- package/dist/lib/logic-expr/logic-not.js +0 -21
- package/dist/lib/logic-expr/logic-not.js.map +0 -1
- package/dist/lib/logic-expr/logic-toggle.js +0 -33
- package/dist/lib/logic-expr/logic-toggle.js.map +0 -1
- package/dist/lib/logic-expr/types.js +0 -2
- package/dist/lib/logic-expr/types.js.map +0 -1
- package/dist/lib/loop-radio-group/index.js +0 -7
- package/dist/lib/loop-radio-group/index.js.map +0 -1
- package/dist/lib/multi-part-editor/components/image-item-renderer.js +0 -57
- package/dist/lib/multi-part-editor/components/image-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js +0 -25
- package/dist/lib/multi-part-editor/components/multipart-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/components/url-input-modal.js +0 -150
- package/dist/lib/multi-part-editor/components/url-input-modal.js.map +0 -1
- package/dist/lib/multi-part-editor/components/video-item-renderer.js +0 -57
- package/dist/lib/multi-part-editor/components/video-item-renderer.js.map +0 -1
- package/dist/lib/multi-part-editor/index.js +0 -300
- package/dist/lib/multi-part-editor/index.js.map +0 -1
- package/dist/lib/multi-part-editor/multi-part-render.js +0 -40
- package/dist/lib/multi-part-editor/multi-part-render.js.map +0 -1
- package/dist/lib/multi-part-editor/type.js +0 -25
- package/dist/lib/multi-part-editor/type.js.map +0 -1
- package/dist/lib/multi-part-editor/upload-button.js +0 -103
- package/dist/lib/multi-part-editor/upload-button.js.map +0 -1
- package/dist/lib/multi-part-editor/utils.js +0 -43
- package/dist/lib/multi-part-editor/utils.js.map +0 -1
- package/dist/lib/open-detail-button/index.js +0 -11
- package/dist/lib/open-detail-button/index.js.map +0 -1
- package/dist/lib/page-content/index.js +0 -23
- package/dist/lib/page-content/index.js.map +0 -1
- package/dist/lib/primary-page/index.js +0 -2
- package/dist/lib/primary-page/index.js.map +0 -1
- package/dist/lib/primary-page/primary-header.js +0 -4
- package/dist/lib/primary-page/primary-header.js.map +0 -1
- package/dist/lib/primary-title/index.js +0 -8
- package/dist/lib/primary-title/index.js.map +0 -1
- package/dist/lib/provider/index.d.ts +0 -18
- package/dist/lib/provider/index.js +0 -43
- package/dist/lib/provider/index.js.map +0 -1
- package/dist/lib/resizable-side-sheet/index.js +0 -32
- package/dist/lib/resizable-side-sheet/index.js.map +0 -1
- package/dist/lib/resize-sidesheet/index.js +0 -15
- package/dist/lib/resize-sidesheet/index.js.map +0 -1
- package/dist/lib/resize-sidesheet/use-drag.js +0 -30
- package/dist/lib/resize-sidesheet/use-drag.js.map +0 -1
- package/dist/lib/schema-editor/index.js +0 -5
- package/dist/lib/schema-editor/index.js.map +0 -1
- package/dist/lib/search-form/index.d.ts +0 -15
- package/dist/lib/search-form/index.js +0 -77
- package/dist/lib/search-form/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js +0 -19
- package/dist/lib/semi-schema-form/components/tmpls/array-field-item.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js +0 -39
- package/dist/lib/semi-schema-form/components/tmpls/array-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js +0 -32
- package/dist/lib/semi-schema-form/components/tmpls/base-input.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js +0 -13
- package/dist/lib/semi-schema-form/components/tmpls/description-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js +0 -14
- package/dist/lib/semi-schema-form/components/tmpls/error-list.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js +0 -16
- package/dist/lib/semi-schema-form/components/tmpls/field-error.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/field.js +0 -21
- package/dist/lib/semi-schema-form/components/tmpls/field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js +0 -29
- package/dist/lib/semi-schema-form/components/tmpls/icon-button.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/index.js +0 -31
- package/dist/lib/semi-schema-form/components/tmpls/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js +0 -81
- package/dist/lib/semi-schema-form/components/tmpls/object-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/submit.js +0 -13
- package/dist/lib/semi-schema-form/components/tmpls/submit.js.map +0 -1
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js +0 -12
- package/dist/lib/semi-schema-form/components/tmpls/title-field.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js +0 -26
- package/dist/lib/semi-schema-form/components/widgets/checkbox.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js +0 -27
- package/dist/lib/semi-schema-form/components/widgets/checkboxs.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/index.js +0 -15
- package/dist/lib/semi-schema-form/components/widgets/index.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/radio.js +0 -27
- package/dist/lib/semi-schema-form/components/widgets/radio.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/range.js +0 -26
- package/dist/lib/semi-schema-form/components/widgets/range.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/select.js +0 -44
- package/dist/lib/semi-schema-form/components/widgets/select.js.map +0 -1
- package/dist/lib/semi-schema-form/components/widgets/textarea.js +0 -18
- package/dist/lib/semi-schema-form/components/widgets/textarea.js.map +0 -1
- package/dist/lib/semi-schema-form/index.js +0 -9
- package/dist/lib/semi-schema-form/index.js.map +0 -1
- package/dist/lib/sentinel-form/enum.js +0 -15
- package/dist/lib/sentinel-form/enum.js.map +0 -1
- package/dist/lib/sentinel-form/index.js +0 -289
- package/dist/lib/sentinel-form/index.js.map +0 -1
- package/dist/lib/step-nav/index.js +0 -13
- package/dist/lib/step-nav/index.js.map +0 -1
- package/dist/lib/table/index.js +0 -6
- package/dist/lib/table/index.js.map +0 -1
- package/dist/lib/table/sort-icon.js +0 -30
- package/dist/lib/table/sort-icon.js.map +0 -1
- package/dist/lib/table/table-with-pagination.js +0 -74
- package/dist/lib/table/table-with-pagination.js.map +0 -1
- package/dist/lib/table/table-without-pagniation.js +0 -37
- package/dist/lib/table/table-without-pagniation.js.map +0 -1
- package/dist/lib/table-batch-operate/table-batch-operation.js +0 -14
- package/dist/lib/table-batch-operate/table-batch-operation.js.map +0 -1
- package/dist/lib/table-batch-operate/use-batch-operate.js +0 -71
- package/dist/lib/table-batch-operate/use-batch-operate.js.map +0 -1
- package/dist/lib/table-col-actions/index.js +0 -35
- package/dist/lib/table-col-actions/index.js.map +0 -1
- package/dist/lib/table-cols-config/index.js +0 -57
- package/dist/lib/table-cols-config/index.js.map +0 -1
- package/dist/lib/table-cols-config/type.js +0 -2
- package/dist/lib/table-cols-config/type.js.map +0 -1
- package/dist/lib/table-cols-config/use-hidden-col-keys.js +0 -32
- package/dist/lib/table-cols-config/use-hidden-col-keys.js.map +0 -1
- package/dist/lib/table-cols-config/util.js +0 -39
- package/dist/lib/table-cols-config/util.js.map +0 -1
- package/dist/lib/table-empty/index.js +0 -10
- package/dist/lib/table-empty/index.js.map +0 -1
- package/dist/lib/table-header/index.js +0 -11
- package/dist/lib/table-header/index.js.map +0 -1
- package/dist/lib/tabs/index.js +0 -9
- package/dist/lib/tabs/index.js.map +0 -1
- package/dist/lib/text-area-pro/index.js +0 -10
- package/dist/lib/text-area-pro/index.js.map +0 -1
- package/dist/lib/text-with-copy/index.js +0 -24
- package/dist/lib/text-with-copy/index.js.map +0 -1
- package/dist/lib/title-with-sub/index.js +0 -6
- package/dist/lib/title-with-sub/index.js.map +0 -1
- package/dist/lib/tooltip-when-disabled/index.js +0 -9
- package/dist/lib/tooltip-when-disabled/index.js.map +0 -1
- package/dist/lib/tooltip-with-disabled/index.js +0 -9
- package/dist/lib/tooltip-with-disabled/index.js.map +0 -1
- package/dist/lib/tsconfig.build.tsbuildinfo +0 -1
- package/dist/lib/upload/index.js +0 -25
- package/dist/lib/upload/index.js.map +0 -1
- package/dist/lib/user-profile/index.js +0 -21
- package/dist/lib/user-profile/index.js.map +0 -1
- package/dist/lib/utils/basic.js +0 -29
- package/dist/lib/utils/basic.js.map +0 -1
- package/dist/lib/version-list/version-descriptions.js +0 -14
- package/dist/lib/version-list/version-descriptions.js.map +0 -1
- package/dist/lib/version-list/version-item.js +0 -6
- package/dist/lib/version-list/version-item.js.map +0 -1
- package/dist/lib/version-list/version-list.js +0 -11
- package/dist/lib/version-list/version-list.js.map +0 -1
- package/dist/lib/version-list/version-switch-panel.js +0 -10
- package/dist/lib/version-list/version-switch-panel.js.map +0 -1
- package/eslint.config.js +0 -7
- package/rslib.config.js +0 -7
- package/script/publish.js +0 -146
- package/src/base-search-select/base-search-form-select.tsx +0 -10
- package/src/base-search-select/base-search-select.tsx +0 -200
- package/src/base-search-select/index.module.less +0 -16
- package/src/base-search-select/index.tsx +0 -3
- package/src/base-search-select/types.ts +0 -16
- package/src/base-search-select/utils.ts +0 -78
- package/src/basic-card/index.tsx +0 -23
- package/src/card-pane/index.module.less +0 -14
- package/src/card-pane/index.tsx +0 -25
- package/src/chip-select/index.module.less +0 -17
- package/src/chip-select/index.tsx +0 -7
- package/src/code-editor/index.tsx +0 -9
- package/src/code-usage/code-item.module.less +0 -32
- package/src/code-usage/index.tsx +0 -91
- package/src/codemirror-editor/code-editor.tsx +0 -139
- package/src/codemirror-editor/index.ts +0 -4
- package/src/codemirror-editor/json-editor.tsx +0 -183
- package/src/codemirror-editor/raw-text-editor.tsx +0 -68
- package/src/codemirror-editor/text-editor.tsx +0 -58
- package/src/codemirror-editor/themes/coze-dark.ts +0 -116
- package/src/codemirror-editor/themes/coze-light.ts +0 -122
- package/src/collapse-card/index.module.less +0 -27
- package/src/collapse-card/index.tsx +0 -93
- package/src/collapsible-card/index.module.less +0 -63
- package/src/collapsible-card/index.tsx +0 -57
- package/src/column-manage-storage/index.tsx +0 -64
- package/src/columns-select/index.tsx +0 -244
- package/src/edit-icon-button/index.tsx +0 -36
- package/src/footer-actions/index.tsx +0 -33
- package/src/hooks/use-infinite-scroll.ts +0 -183
- package/src/hooks/use-mouse-down-offset.ts +0 -50
- package/src/hooks/use-unsave-leave-warning.ts +0 -49
- package/src/id-render/icon-button-container.tsx +0 -37
- package/src/id-render/index.tsx +0 -64
- package/src/index-controller/record-navigation.tsx +0 -57
- package/src/index-controller/use-item-index-controller.ts +0 -197
- package/src/index.ts +0 -208
- package/src/infinite-scroll-table/index.tsx +0 -99
- package/src/info-tooltip/index.tsx +0 -41
- package/src/input-components/radio-button.tsx +0 -63
- package/src/input-slider/index.module.less +0 -30
- package/src/input-slider/index.tsx +0 -161
- package/src/input-with-count/index.tsx +0 -31
- package/src/jump-button/jump-icon-button.tsx +0 -12
- package/src/large-txt-render/index.tsx +0 -46
- package/src/layout/content.tsx +0 -28
- package/src/layout/header.tsx +0 -15
- package/src/layout/index.module.less +0 -28
- package/src/layout/index.tsx +0 -9
- package/src/layout/tabs.tsx +0 -11
- package/src/lazy-load-component/index.tsx +0 -55
- package/src/logic-editor/index.ts +0 -3
- package/src/logic-editor/logic-editor.module.less +0 -13
- package/src/logic-editor/logic-editor.tsx +0 -200
- package/src/logic-editor/logic-left-render.tsx +0 -100
- package/src/logic-editor/logic-operator-render.tsx +0 -54
- package/src/logic-editor/logic-right-render.tsx +0 -51
- package/src/logic-editor/logic-types.tsx +0 -238
- package/src/logic-editor/utils.ts +0 -22
- package/src/logic-expr/assets/select.svg +0 -1
- package/src/logic-expr/consts.ts +0 -6
- package/src/logic-expr/expr-group-render.tsx +0 -238
- package/src/logic-expr/expr-render.tsx +0 -226
- package/src/logic-expr/index.module.less +0 -252
- package/src/logic-expr/index.ts +0 -13
- package/src/logic-expr/logic-expr.tsx +0 -261
- package/src/logic-expr/logic-not.tsx +0 -46
- package/src/logic-expr/logic-toggle.tsx +0 -96
- package/src/logic-expr/types.ts +0 -95
- package/src/loop-radio-group/index.tsx +0 -16
- package/src/multi-part-editor/components/image-item-renderer.tsx +0 -134
- package/src/multi-part-editor/components/index.module.less +0 -21
- package/src/multi-part-editor/components/multipart-item-renderer.tsx +0 -74
- package/src/multi-part-editor/components/url-input-modal.tsx +0 -317
- package/src/multi-part-editor/components/video-item-renderer.tsx +0 -145
- package/src/multi-part-editor/index.module.less +0 -8
- package/src/multi-part-editor/index.tsx +0 -571
- package/src/multi-part-editor/multi-part-render.tsx +0 -87
- package/src/multi-part-editor/type.tsx +0 -103
- package/src/multi-part-editor/upload-button.tsx +0 -256
- package/src/multi-part-editor/utils.ts +0 -64
- package/src/open-detail-button/index.tsx +0 -30
- package/src/page-content/index.tsx +0 -99
- package/src/primary-page/index.tsx +0 -1
- package/src/primary-page/primary-header.tsx +0 -64
- package/src/primary-title/index.module.less +0 -14
- package/src/primary-title/index.tsx +0 -18
- package/src/provider/index.tsx +0 -89
- package/src/resizable-side-sheet/index.tsx +0 -69
- package/src/resize-sidesheet/index.module.less +0 -14
- package/src/resize-sidesheet/index.tsx +0 -68
- package/src/resize-sidesheet/use-drag.ts +0 -43
- package/src/schema-editor/index.tsx +0 -52
- package/src/search-form/index.tsx +0 -134
- package/src/semi-schema-form/components/tmpls/array-field-item.tsx +0 -97
- package/src/semi-schema-form/components/tmpls/array-field.tsx +0 -127
- package/src/semi-schema-form/components/tmpls/base-input.tsx +0 -126
- package/src/semi-schema-form/components/tmpls/description-field.tsx +0 -23
- package/src/semi-schema-form/components/tmpls/error-list.tsx +0 -44
- package/src/semi-schema-form/components/tmpls/field-error.tsx +0 -33
- package/src/semi-schema-form/components/tmpls/field.tsx +0 -54
- package/src/semi-schema-form/components/tmpls/icon-button.tsx +0 -112
- package/src/semi-schema-form/components/tmpls/index.ts +0 -39
- package/src/semi-schema-form/components/tmpls/object-field.tsx +0 -173
- package/src/semi-schema-form/components/tmpls/submit.tsx +0 -31
- package/src/semi-schema-form/components/tmpls/title-field.tsx +0 -30
- package/src/semi-schema-form/components/widgets/checkbox.tsx +0 -67
- package/src/semi-schema-form/components/widgets/checkboxs.tsx +0 -100
- package/src/semi-schema-form/components/widgets/index.ts +0 -17
- package/src/semi-schema-form/components/widgets/radio.tsx +0 -105
- package/src/semi-schema-form/components/widgets/range.tsx +0 -73
- package/src/semi-schema-form/components/widgets/select.tsx +0 -108
- package/src/semi-schema-form/components/widgets/textarea.tsx +0 -63
- package/src/semi-schema-form/index.tsx +0 -14
- package/src/sentinel-form/enum.ts +0 -16
- package/src/sentinel-form/index.tsx +0 -382
- package/src/step-nav/index.module.less +0 -45
- package/src/step-nav/index.tsx +0 -53
- package/src/table/index.module.less +0 -144
- package/src/table/index.tsx +0 -18
- package/src/table/sort-icon.tsx +0 -73
- package/src/table/table-with-pagination.tsx +0 -150
- package/src/table/table-without-pagniation.tsx +0 -66
- package/src/table-batch-operate/table-batch-operation.tsx +0 -47
- package/src/table-batch-operate/use-batch-operate.ts +0 -111
- package/src/table-col-actions/index.module.less +0 -8
- package/src/table-col-actions/index.tsx +0 -149
- package/src/table-cols-config/index.module.less +0 -34
- package/src/table-cols-config/index.tsx +0 -171
- package/src/table-cols-config/type.ts +0 -12
- package/src/table-cols-config/use-hidden-col-keys.ts +0 -53
- package/src/table-cols-config/util.ts +0 -56
- package/src/table-empty/index.tsx +0 -23
- package/src/table-header/index.module.less +0 -7
- package/src/table-header/index.tsx +0 -70
- package/src/tabs/index.module.less +0 -48
- package/src/tabs/index.tsx +0 -9
- package/src/text-area-pro/index.module.less +0 -5
- package/src/text-area-pro/index.tsx +0 -49
- package/src/text-with-copy/index.tsx +0 -95
- package/src/title-with-sub/index.tsx +0 -27
- package/src/tooltip-when-disabled/index.tsx +0 -23
- package/src/tooltip-with-disabled/index.tsx +0 -17
- package/src/types.d.ts +0 -24
- package/src/upload/index.ts +0 -39
- package/src/user-profile/index.tsx +0 -49
- package/src/utils/basic.ts +0 -29
- package/src/version-list/index.module.less +0 -16
- package/src/version-list/version-descriptions.tsx +0 -80
- package/src/version-list/version-item.tsx +0 -30
- package/src/version-list/version-list.tsx +0 -59
- package/src/version-list/version-switch-panel.tsx +0 -31
- package/tailwind.config.ts +0 -6
- package/tsconfig.build.json +0 -44
- package/tsconfig.json +0 -17
- package/tsconfig.misc.json +0 -28
- package/vitest.config.mts +0 -7
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
import "./static/svg/select.svg";
|
|
3
|
+
import { __webpack_require__ } from "./rslib-runtime.mjs";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { arrayMove, sortableContainer as external_react_sortable_hoc_sortableContainer, sortableElement, sortableHandle } from "react-sortable-hoc";
|
|
5
|
-
import react, { Fragment as external_react_Fragment,
|
|
6
|
+
import react, { Fragment as external_react_Fragment, forwardRef, isValidElement, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { I18n as i18n_I18n } from "@cozeloop/i18n";
|
|
6
8
|
import { IconCozArrowDown, IconCozArrowLeft, IconCozArrowRight, IconCozCheckMarkCircleFill, IconCozCheckMarkFill, IconCozContent, IconCozCopy, IconCozCross, IconCozCrossCircleFill, IconCozCrossFill, IconCozEye, IconCozFilter, IconCozHandle, IconCozImage, IconCozImageArrowUp, IconCozImageBroken, IconCozInfoCircle, IconCozLongArrowTopRight, IconCozLongArrowUp, IconCozMore, IconCozPencil, IconCozPlayCircle, IconCozPlus, IconCozPlusCircle, IconCozQuestionMarkCircle, IconCozRefresh, IconCozSetting, IconCozTableSetting, IconCozTrashCan, IconCozVideo, IconCozWarningCircle } from "@coze-arch/coze-design/icons";
|
|
7
9
|
import { Banner, Button, ButtonGroup, Cascader, Checkbox, Col, Collapse, CozAvatar, CozInputNumber, CozPagination, DatePicker, Descriptions, Divider, Dropdown, Empty, EmptyState, Form, IconButton, Image, ImagePreview, Input, List, Loading, Menu, Modal, Popover, Radio, RadioGroup, Row, Select, SideSheet, Skeleton, Slider, Space, Spin, Switch, Table, Tabs, Tag, TextArea, Toast, Tooltip, Typography, Upload, withField } from "@coze-arch/coze-design";
|
|
8
|
-
import { IconCozIllus404, IconCozIllus404Dark, IconCozIllusEmpty, IconCozIllusEmptyDark, IconCozIllusError, IconCozIllusErrorDark, IconCozIllusLock, IconCozIllusLockDark, IconCozIllusNone, IconCozIllusNoneDark } from "@coze-arch/coze-design/illustrations";
|
|
9
10
|
import classnames from "classnames";
|
|
11
|
+
import { IconCozIllus404, IconCozIllus404Dark, IconCozIllusEmpty, IconCozIllusEmptyDark, IconCozIllusError, IconCozIllusErrorDark, IconCozIllusLock, IconCozIllusLockDark, IconCozIllusNone, IconCozIllusNoneDark } from "@coze-arch/coze-design/illustrations";
|
|
10
12
|
import { useDebounceFn, useInfiniteScroll, useLatest, useMemoizedFn, useRequest, useSize } from "ahooks";
|
|
11
|
-
import { cloneDeep, debounce, get, isEmpty as external_lodash_es_isEmpty, isInteger, isNull, isNumber, isObject, isString, isUndefined,
|
|
13
|
+
import { cloneDeep, debounce, get, isEmpty as external_lodash_es_isEmpty, isInteger, isNull, isNumber, isObject, isString, isUndefined, set } from "lodash-es";
|
|
12
14
|
import copy_to_clipboard from "copy-to-clipboard";
|
|
13
15
|
import { formatTimestampToString, safeJsonParse, sleep as toolkit_sleep } from "@cozeloop/toolkit";
|
|
14
|
-
import { useBlocker, useSearchParams } from "react-router-dom";
|
|
15
16
|
import _monaco_editor_react, { DiffEditor, loader } from "@monaco-editor/react";
|
|
16
17
|
import sortablejs from "sortablejs";
|
|
17
18
|
import { nanoid } from "nanoid";
|
|
@@ -19,40 +20,21 @@ import { ContentType } from "@cozeloop/api-schema/evaluation";
|
|
|
19
20
|
import { ItemErrorType, StorageProvider } from "@cozeloop/api-schema/data";
|
|
20
21
|
import { ContentType as prompt_ContentType } from "@cozeloop/api-schema/prompt";
|
|
21
22
|
import { withTheme } from "@rjsf/core";
|
|
22
|
-
import
|
|
23
|
+
import { defaultKeymap, history as commands_history, historyKeymap } from "@codemirror/commands";
|
|
23
24
|
import { TranslatableString, ariaDescribedByIds, canExpand, enumOptionsIndexForValue, enumOptionsValueForIndex, errorId, examplesId, getInputProps, getSubmitButtonOptions, getTemplate, getUiOptions, optionId, rangeSpec } from "@rjsf/utils";
|
|
24
25
|
import { useMouseDownOffset as hooks_useMouseDownOffset } from "@cozeloop/hooks";
|
|
25
26
|
import dayjs from "dayjs";
|
|
27
|
+
import { useReportEvent } from "@cozeloop/config-provider";
|
|
26
28
|
import { EditorProvider, createRenderer, option as react_option } from "@coze-editor/editor/react";
|
|
27
29
|
import preset_code, { createTheme, languages, tags, themes, transformerCreator } from "@coze-editor/editor/preset-code";
|
|
30
|
+
import { typescript } from "@coze-editor/editor/language-typescript";
|
|
28
31
|
import { shell } from "@coze-editor/editor/language-shell";
|
|
32
|
+
import { python } from "@coze-editor/editor/language-python";
|
|
29
33
|
import { json } from "@coze-editor/editor/language-json";
|
|
30
34
|
import { mixLanguages } from "@coze-editor/editor";
|
|
31
35
|
import { EditorView, keymap } from "@codemirror/view";
|
|
36
|
+
import { goLanguage } from "@codemirror/lang-go";
|
|
32
37
|
import preset_universal from "@coze-editor/editor/preset-universal";
|
|
33
|
-
import { defaultKeymap, history as commands_history, historyKeymap } from "@codemirror/commands";
|
|
34
|
-
var __webpack_require__ = {};
|
|
35
|
-
(()=>{
|
|
36
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
37
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: definition[key]
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
})();
|
|
43
|
-
(()=>{
|
|
44
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
45
|
-
})();
|
|
46
|
-
(()=>{
|
|
47
|
-
__webpack_require__.r = (exports)=>{
|
|
48
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
49
|
-
value: 'Module'
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(exports, '__esModule', {
|
|
52
|
-
value: true
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
})();
|
|
56
38
|
var external_react_sortable_hoc_namespaceObject = {};
|
|
57
39
|
__webpack_require__.r(external_react_sortable_hoc_namespaceObject);
|
|
58
40
|
__webpack_require__.d(external_react_sortable_hoc_namespaceObject, {
|
|
@@ -69,10 +51,10 @@ const SortableContainer = columns_select_sortableContainer(({ children })=>/*#__
|
|
|
69
51
|
}));
|
|
70
52
|
const DragHandle = columns_select_sortableHandle(()=>/*#__PURE__*/ jsx(IconCozHandle, {
|
|
71
53
|
className: "cursor-grab",
|
|
72
|
-
"aria-label":
|
|
54
|
+
"aria-label": i18n_I18n.t('drag_to_sort'),
|
|
73
55
|
role: "button"
|
|
74
56
|
}));
|
|
75
|
-
const ColumnSelector = ({ columns, defaultColumns = columns, onChange, buttonText, resetButtonText
|
|
57
|
+
const ColumnSelector = ({ columns, defaultColumns = columns, onChange, buttonText, resetButtonText, className, sortable = true, itemRender, footerRender })=>{
|
|
76
58
|
const [list, setList] = useState(()=>[
|
|
77
59
|
...columns
|
|
78
60
|
]);
|
|
@@ -115,7 +97,7 @@ const ColumnSelector = ({ columns, defaultColumns = columns, onChange, buttonTex
|
|
|
115
97
|
/*#__PURE__*/ jsx(Checkbox, {
|
|
116
98
|
disabled: disabledKeys.includes(value.key ?? '') || value.disabled,
|
|
117
99
|
checked: selectedKeys.includes(value.key ?? ''),
|
|
118
|
-
"aria-label":
|
|
100
|
+
"aria-label": `${i18n_I18n.t('select')}${value.value}`
|
|
119
101
|
}),
|
|
120
102
|
/*#__PURE__*/ jsx(Typography.Text, {
|
|
121
103
|
ellipsis: {
|
|
@@ -188,7 +170,7 @@ const ColumnSelector = ({ columns, defaultColumns = columns, onChange, buttonTex
|
|
|
188
170
|
onClick: handleReset,
|
|
189
171
|
children: /*#__PURE__*/ jsx("span", {
|
|
190
172
|
className: "text-brand font-medium text-[13px]",
|
|
191
|
-
children: resetButtonText
|
|
173
|
+
children: resetButtonText || i18n_I18n.t('reset_to_default')
|
|
192
174
|
})
|
|
193
175
|
})
|
|
194
176
|
]
|
|
@@ -199,7 +181,7 @@ const ColumnSelector = ({ columns, defaultColumns = columns, onChange, buttonTex
|
|
|
199
181
|
onClick: handleReset,
|
|
200
182
|
children: /*#__PURE__*/ jsx("span", {
|
|
201
183
|
className: "text-brand font-medium text-[13px]",
|
|
202
|
-
children: resetButtonText
|
|
184
|
+
children: resetButtonText || i18n_I18n.t('reset_to_default')
|
|
203
185
|
})
|
|
204
186
|
})
|
|
205
187
|
]
|
|
@@ -207,7 +189,7 @@ const ColumnSelector = ({ columns, defaultColumns = columns, onChange, buttonTex
|
|
|
207
189
|
trigger: "click",
|
|
208
190
|
children: /*#__PURE__*/ jsx("div", {
|
|
209
191
|
children: /*#__PURE__*/ jsx(Tooltip, {
|
|
210
|
-
content:
|
|
192
|
+
content: i18n_I18n.t('column_management'),
|
|
211
193
|
theme: "dark",
|
|
212
194
|
position: "top",
|
|
213
195
|
children: /*#__PURE__*/ jsx(Button, {
|
|
@@ -242,6 +224,21 @@ function TooltipWithDisabled({ children, disabled, ...rest }) {
|
|
|
242
224
|
children: children
|
|
243
225
|
});
|
|
244
226
|
}
|
|
227
|
+
function Copyable({ className, text }) {
|
|
228
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
229
|
+
className: classnames(className, 'inline-flex items-center gap-1'),
|
|
230
|
+
children: [
|
|
231
|
+
text,
|
|
232
|
+
/*#__PURE__*/ jsx(IconCozCopy, {
|
|
233
|
+
className: "cursor-pointer",
|
|
234
|
+
onClick: async ()=>{
|
|
235
|
+
await navigator.clipboard.writeText(text);
|
|
236
|
+
Toast.success(i18n_I18n.t('copy_success'));
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
}
|
|
245
242
|
const index_module = {
|
|
246
243
|
"loop-table": "loop-table-ZtuuXn",
|
|
247
244
|
loopTable: "loop-table-ZtuuXn"
|
|
@@ -250,7 +247,7 @@ const LoopTable = ({ className, ...props })=>/*#__PURE__*/ jsx(Table, {
|
|
|
250
247
|
empty: /*#__PURE__*/ jsx(EmptyState, {
|
|
251
248
|
size: "full_screen",
|
|
252
249
|
icon: /*#__PURE__*/ jsx(IconCozIllusEmpty, {}),
|
|
253
|
-
title:
|
|
250
|
+
title: i18n_I18n.t('no_data')
|
|
254
251
|
}),
|
|
255
252
|
...props,
|
|
256
253
|
id: index_module["loop-table"]
|
|
@@ -295,24 +292,24 @@ const IconSortArrow = ({ sortOrder, ...rest })=>{
|
|
|
295
292
|
]
|
|
296
293
|
});
|
|
297
294
|
};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
295
|
+
const createLoopTableSortIcon = ()=>({ sortOrder })=>{
|
|
296
|
+
let tooltip = i18n_I18n.t('click_ascending');
|
|
297
|
+
if ('ascend' === sortOrder) tooltip = i18n_I18n.t('click_descending');
|
|
298
|
+
else if ('descend' === sortOrder) tooltip = i18n_I18n.t('restore_default_sort');
|
|
299
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
300
|
+
theme: "dark",
|
|
301
|
+
content: tooltip,
|
|
302
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
303
|
+
className: "flex items-center",
|
|
304
|
+
children: /*#__PURE__*/ jsx(IconButtonContainer, {
|
|
305
|
+
icon: /*#__PURE__*/ jsx(IconSortArrow, {
|
|
306
|
+
sortOrder: sortOrder,
|
|
307
|
+
className: "text-[var(--coz-fg-secondary)]"
|
|
308
|
+
})
|
|
311
309
|
})
|
|
312
310
|
})
|
|
313
|
-
})
|
|
314
|
-
}
|
|
315
|
-
}
|
|
311
|
+
});
|
|
312
|
+
};
|
|
316
313
|
function getStoragePageSize(pageSizeStorageKey) {
|
|
317
314
|
if (!pageSizeStorageKey) return;
|
|
318
315
|
const pageSize = localStorage.getItem(pageSizeStorageKey);
|
|
@@ -377,7 +374,7 @@ function TableWithPagination(props) {
|
|
|
377
374
|
columns: columns?.filter((column)=>true !== column.hidden && false !== column.checked)?.map((column)=>({
|
|
378
375
|
...column,
|
|
379
376
|
...column.sorter && !column.sortIcon ? {
|
|
380
|
-
sortIcon:
|
|
377
|
+
sortIcon: createLoopTableSortIcon()
|
|
381
378
|
} : {}
|
|
382
379
|
})),
|
|
383
380
|
dataSource: service?.data?.list ?? []
|
|
@@ -426,7 +423,7 @@ function PageNotFound({ className, ...props }) {
|
|
|
426
423
|
darkModeImage: /*#__PURE__*/ jsx(IconCozIllus404Dark, {
|
|
427
424
|
className: "text-[160px]"
|
|
428
425
|
}),
|
|
429
|
-
description:
|
|
426
|
+
description: i18n_I18n.t('page_not_found'),
|
|
430
427
|
...props
|
|
431
428
|
})
|
|
432
429
|
});
|
|
@@ -441,7 +438,7 @@ function PageError({ className, ...props }) {
|
|
|
441
438
|
darkModeImage: /*#__PURE__*/ jsx(IconCozIllusErrorDark, {
|
|
442
439
|
className: "text-[160px]"
|
|
443
440
|
}),
|
|
444
|
-
description:
|
|
441
|
+
description: i18n_I18n.t('page_load_failed'),
|
|
445
442
|
...props
|
|
446
443
|
})
|
|
447
444
|
});
|
|
@@ -456,7 +453,7 @@ function PageNoAuth({ className, ...props }) {
|
|
|
456
453
|
darkModeImage: /*#__PURE__*/ jsx(IconCozIllusLockDark, {
|
|
457
454
|
className: "text-[160px]"
|
|
458
455
|
}),
|
|
459
|
-
description:
|
|
456
|
+
description: i18n_I18n.t('no_permission'),
|
|
460
457
|
...props
|
|
461
458
|
})
|
|
462
459
|
});
|
|
@@ -493,25 +490,29 @@ function TableColActions({ actions, maxCount = 2, disabled, spaceProps = {}, wra
|
|
|
493
490
|
spacing: 12,
|
|
494
491
|
...spaceProps,
|
|
495
492
|
children: [
|
|
496
|
-
firstActions.map((action, index)
|
|
497
|
-
|
|
498
|
-
|
|
493
|
+
firstActions.map((action, index)=>{
|
|
494
|
+
const { disabledTooltip, disabled: actionDisabled, onClick: actionOnclick, type: actionType, label: actionLabel, icon: actionIcon, ...restProps } = action;
|
|
495
|
+
return /*#__PURE__*/ jsx(TooltipWhenDisabled, {
|
|
496
|
+
content: disabledTooltip || actionLabel,
|
|
497
|
+
disabled: Boolean(actionDisabled),
|
|
499
498
|
needWrap: false,
|
|
500
499
|
children: /*#__PURE__*/ jsx(Typography.Text, {
|
|
501
500
|
size: "small",
|
|
502
501
|
className: classnames(`!text-[13px] ${textClassName}`, {
|
|
503
|
-
'opacity-45':
|
|
502
|
+
'opacity-45': actionDisabled || disabled
|
|
504
503
|
}),
|
|
505
|
-
type:
|
|
506
|
-
disabled:
|
|
504
|
+
type: actionType,
|
|
505
|
+
disabled: actionDisabled || disabled,
|
|
507
506
|
onClick: ()=>{
|
|
508
|
-
if (!(
|
|
507
|
+
if (!(actionDisabled || disabled)) actionOnclick?.();
|
|
509
508
|
},
|
|
510
|
-
link: !
|
|
511
|
-
|
|
509
|
+
link: !actionType,
|
|
510
|
+
...restProps,
|
|
511
|
+
children: actionIcon ? null : actionLabel
|
|
512
512
|
})
|
|
513
|
-
}, index)
|
|
514
|
-
|
|
513
|
+
}, index);
|
|
514
|
+
}),
|
|
515
|
+
moreActions.length > 0 ? /*#__PURE__*/ jsx(Menu, {
|
|
515
516
|
position: "bottomLeft",
|
|
516
517
|
visible: visible,
|
|
517
518
|
trigger: "custom",
|
|
@@ -520,35 +521,36 @@ function TableColActions({ actions, maxCount = 2, disabled, spaceProps = {}, wra
|
|
|
520
521
|
render: /*#__PURE__*/ jsx(Menu.SubMenu, {
|
|
521
522
|
mode: "menu",
|
|
522
523
|
children: moreActions.map((action, index)=>{
|
|
523
|
-
const
|
|
524
|
-
const
|
|
524
|
+
const { disabledTooltip, disabled: actionDisabled, onClick: actionOnclick, type: actionType, label: actionLabel, icon: actionIcon, ...restProps } = action;
|
|
525
|
+
const isDisabled = actionDisabled || disabled;
|
|
525
526
|
const dropdownItem = /*#__PURE__*/ jsx(Menu.Item, {
|
|
526
527
|
disabled: isDisabled,
|
|
527
528
|
onClick: ()=>{
|
|
528
529
|
if (!isDisabled) {
|
|
529
530
|
setVisible(false);
|
|
530
|
-
|
|
531
|
+
actionOnclick?.();
|
|
531
532
|
}
|
|
532
533
|
},
|
|
533
534
|
className: classnames('min-w-[90px] !p-0 !pl-2', {
|
|
534
535
|
'opacity-50': isDisabled
|
|
535
536
|
}),
|
|
536
|
-
icon:
|
|
537
|
+
icon: actionIcon,
|
|
537
538
|
style: {
|
|
538
539
|
minWidth: '90px'
|
|
539
540
|
},
|
|
541
|
+
...restProps,
|
|
540
542
|
children: /*#__PURE__*/ jsx(Typography.Text, {
|
|
541
|
-
type:
|
|
543
|
+
type: actionType,
|
|
542
544
|
size: "small",
|
|
543
545
|
className: "!text-[13px] min-w-[80px]",
|
|
544
|
-
link: !
|
|
545
|
-
children:
|
|
546
|
+
link: !actionType,
|
|
547
|
+
children: actionLabel
|
|
546
548
|
})
|
|
547
549
|
});
|
|
548
550
|
return /*#__PURE__*/ jsx("div", {
|
|
549
551
|
children: /*#__PURE__*/ jsx(TooltipWhenDisabled, {
|
|
550
|
-
content:
|
|
551
|
-
disabled: Boolean(isDisabled &&
|
|
552
|
+
content: disabledTooltip,
|
|
553
|
+
disabled: Boolean(isDisabled && disabledTooltip),
|
|
552
554
|
theme: "dark",
|
|
553
555
|
needWrap: false,
|
|
554
556
|
children: dropdownItem
|
|
@@ -563,7 +565,7 @@ function TableColActions({ actions, maxCount = 2, disabled, spaceProps = {}, wra
|
|
|
563
565
|
className: "text-[#5A4DED]"
|
|
564
566
|
})
|
|
565
567
|
})
|
|
566
|
-
})
|
|
568
|
+
}) : null
|
|
567
569
|
]
|
|
568
570
|
})
|
|
569
571
|
});
|
|
@@ -580,7 +582,7 @@ const LoopTabs = (props)=>{
|
|
|
580
582
|
};
|
|
581
583
|
const PER_PRE_MAX_LENGTH = 25000;
|
|
582
584
|
const LargeTxtRender = (props)=>{
|
|
583
|
-
const { text } = props;
|
|
585
|
+
const { text, className } = props;
|
|
584
586
|
const ref = useRef(null);
|
|
585
587
|
const getMoreTextChunk = (startIndex)=>{
|
|
586
588
|
const endIndex = startIndex + PER_PRE_MAX_LENGTH;
|
|
@@ -602,7 +604,7 @@ const LargeTxtRender = (props)=>{
|
|
|
602
604
|
});
|
|
603
605
|
return /*#__PURE__*/ jsx("pre", {
|
|
604
606
|
ref: ref,
|
|
605
|
-
className:
|
|
607
|
+
className: classnames('m-0 break-words whitespace-pre-wrap max-h-full overflow-y-auto text-[13px] leading-4 text-[var(--coz-fg-primary)] font-normal', className),
|
|
606
608
|
children: data?.list.join('') || ''
|
|
607
609
|
});
|
|
608
610
|
};
|
|
@@ -687,14 +689,14 @@ const handleCopy = async (value, hideToast)=>{
|
|
|
687
689
|
try {
|
|
688
690
|
copy_to_clipboard(value);
|
|
689
691
|
hideToast || Toast.success({
|
|
690
|
-
content:
|
|
692
|
+
content: i18n_I18n.t('copy_success'),
|
|
691
693
|
showClose: false,
|
|
692
694
|
zIndex: 99999
|
|
693
695
|
});
|
|
694
696
|
return Promise.resolve(true);
|
|
695
697
|
} catch (e) {
|
|
696
698
|
Toast.warning({
|
|
697
|
-
content:
|
|
699
|
+
content: i18n_I18n.t('copy_failed'),
|
|
698
700
|
showClose: false,
|
|
699
701
|
zIndex: 99999
|
|
700
702
|
});
|
|
@@ -769,7 +771,7 @@ const version_list_index_module = {
|
|
|
769
771
|
description: "description-gjffk4"
|
|
770
772
|
};
|
|
771
773
|
function VersionDescriptions({ version, className }) {
|
|
772
|
-
const { version: versionName, draftSubmitText =
|
|
774
|
+
const { version: versionName, draftSubmitText = i18n_I18n.t('save_time'), submitTime, submitter, description, isDraft = false } = version || {};
|
|
773
775
|
return /*#__PURE__*/ jsxs(Descriptions, {
|
|
774
776
|
align: "left",
|
|
775
777
|
className: classnames(version_list_index_module.description, className),
|
|
@@ -777,17 +779,17 @@ function VersionDescriptions({ version, className }) {
|
|
|
777
779
|
/*#__PURE__*/ jsx(Tag, {
|
|
778
780
|
color: isDraft ? 'primary' : 'green',
|
|
779
781
|
className: "mb-2",
|
|
780
|
-
children: isDraft ?
|
|
782
|
+
children: isDraft ? i18n_I18n.t('current_draft') : i18n_I18n.t('submit')
|
|
781
783
|
}),
|
|
782
784
|
isDraft ? null : /*#__PURE__*/ jsx(Descriptions.Item, {
|
|
783
|
-
itemKey:
|
|
785
|
+
itemKey: i18n_I18n.t('version'),
|
|
784
786
|
children: /*#__PURE__*/ jsx("span", {
|
|
785
787
|
className: "font-medium",
|
|
786
788
|
children: versionName ?? '-'
|
|
787
789
|
})
|
|
788
790
|
}),
|
|
789
791
|
submitTime ? /*#__PURE__*/ jsx(Descriptions.Item, {
|
|
790
|
-
itemKey: isDraft ? draftSubmitText :
|
|
792
|
+
itemKey: isDraft ? draftSubmitText : i18n_I18n.t('submit_time'),
|
|
791
793
|
className: "!text-[13px]",
|
|
792
794
|
children: /*#__PURE__*/ jsx("span", {
|
|
793
795
|
className: "font-medium !text-[13px]",
|
|
@@ -795,7 +797,7 @@ function VersionDescriptions({ version, className }) {
|
|
|
795
797
|
})
|
|
796
798
|
}) : null,
|
|
797
799
|
isDraft && !submitter ? null : /*#__PURE__*/ jsx(Descriptions.Item, {
|
|
798
|
-
itemKey:
|
|
800
|
+
itemKey: i18n_I18n.t('submit_user'),
|
|
799
801
|
className: "!text-[13px]",
|
|
800
802
|
children: /*#__PURE__*/ jsx(UserProfile, {
|
|
801
803
|
name: submitter?.name,
|
|
@@ -803,7 +805,7 @@ function VersionDescriptions({ version, className }) {
|
|
|
803
805
|
})
|
|
804
806
|
}),
|
|
805
807
|
isDraft ? null : /*#__PURE__*/ jsx(Descriptions.Item, {
|
|
806
|
-
itemKey: "
|
|
808
|
+
itemKey: i18n_I18n.t("version_description"),
|
|
807
809
|
className: "!text-[13px]",
|
|
808
810
|
children: /*#__PURE__*/ jsx(Typography.Text, {
|
|
809
811
|
ellipsis: {
|
|
@@ -844,7 +846,7 @@ function VersionList({ versions = [], loadMoreLoading = false, enableLoadMore =
|
|
|
844
846
|
loading: loadMoreLoading,
|
|
845
847
|
color: "primary",
|
|
846
848
|
onClick: ()=>onLoadMore?.(),
|
|
847
|
-
children:
|
|
849
|
+
children: i18n_I18n.t('show_more')
|
|
848
850
|
})
|
|
849
851
|
});
|
|
850
852
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
@@ -873,7 +875,7 @@ function VersionSwitchPanel({ visible = true, onClose, ...versionListProps }) {
|
|
|
873
875
|
children: [
|
|
874
876
|
/*#__PURE__*/ jsx("div", {
|
|
875
877
|
className: "text-sm font-medium",
|
|
876
|
-
children:
|
|
878
|
+
children: i18n_I18n.t('version_record')
|
|
877
879
|
}),
|
|
878
880
|
/*#__PURE__*/ jsx(IconCozCross, {
|
|
879
881
|
className: "ml-auto cursor-pointer text-gray-400 hover:text-gray-900",
|
|
@@ -921,7 +923,7 @@ function TextWithCopy({ displayText, copyTooltipText, content, className, maxWid
|
|
|
921
923
|
children: displayText || content || ''
|
|
922
924
|
}),
|
|
923
925
|
content ? /*#__PURE__*/ jsx(Tooltip, {
|
|
924
|
-
content: copyTooltipText ||
|
|
926
|
+
content: copyTooltipText || i18n_I18n.t('copy_content'),
|
|
925
927
|
theme: "dark",
|
|
926
928
|
children: /*#__PURE__*/ jsx(IconButton, {
|
|
927
929
|
size: "mini",
|
|
@@ -990,7 +992,7 @@ function IDRender({ id, showSuffixLength = 5, enableCopy = true, useTag = false,
|
|
|
990
992
|
})
|
|
991
993
|
}),
|
|
992
994
|
enableCopy ? /*#__PURE__*/ jsx(Tooltip, {
|
|
993
|
-
content:
|
|
995
|
+
content: i18n_I18n.t('copy_id'),
|
|
994
996
|
theme: "dark",
|
|
995
997
|
children: /*#__PURE__*/ jsx("div", {
|
|
996
998
|
children: /*#__PURE__*/ jsx(IconButtonContainer, {
|
|
@@ -1000,10 +1002,10 @@ function IDRender({ id, showSuffixLength = 5, enableCopy = true, useTag = false,
|
|
|
1000
1002
|
e.stopPropagation();
|
|
1001
1003
|
try {
|
|
1002
1004
|
await navigator.clipboard.writeText(idString);
|
|
1003
|
-
Toast.success(
|
|
1005
|
+
Toast.success(i18n_I18n.t('copy_success'));
|
|
1004
1006
|
} catch (error) {
|
|
1005
1007
|
console.error(error);
|
|
1006
|
-
Toast.error(
|
|
1008
|
+
Toast.error(i18n_I18n.t('copy_failed'));
|
|
1007
1009
|
}
|
|
1008
1010
|
}
|
|
1009
1011
|
})
|
|
@@ -1051,10 +1053,11 @@ const dealColumnsWithStorage = (storageKey, columns)=>{
|
|
|
1051
1053
|
checked: sort[column.key]?.checked ?? true
|
|
1052
1054
|
}));
|
|
1053
1055
|
};
|
|
1054
|
-
const PrimaryPage = ({ pageTitle, filterSlot, children, contentClassName, className, headerClassName, titleClassName, titleSlot })=>/*#__PURE__*/ jsxs("div", {
|
|
1056
|
+
const PrimaryPage = ({ pageTitle, renderCustomHeader, filterSlot, children, contentClassName, className, headerClassName, titleClassName, titleSlot, ...restProps })=>/*#__PURE__*/ jsxs("div", {
|
|
1055
1057
|
className: classnames('pt-2 pb-3 h-full max-h-full flex flex-col', className),
|
|
1058
|
+
...restProps,
|
|
1056
1059
|
children: [
|
|
1057
|
-
pageTitle || titleSlot ? /*#__PURE__*/ jsxs("div", {
|
|
1060
|
+
renderCustomHeader ? renderCustomHeader : pageTitle || titleSlot ? /*#__PURE__*/ jsxs("div", {
|
|
1058
1061
|
className: classnames('flex items-center justify-between py-4 px-6', headerClassName),
|
|
1059
1062
|
children: [
|
|
1060
1063
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -1197,42 +1200,8 @@ const ResizeSidesheet = (props)=>{
|
|
|
1197
1200
|
]
|
|
1198
1201
|
});
|
|
1199
1202
|
};
|
|
1200
|
-
const CozeLoopContext = /*#__PURE__*/ createContext({});
|
|
1201
|
-
function CozeLoopProvider({ children, i18n, sendEvent }) {
|
|
1202
|
-
return /*#__PURE__*/ jsx(CozeLoopContext.Provider, {
|
|
1203
|
-
value: {
|
|
1204
|
-
i18n,
|
|
1205
|
-
sendEvent
|
|
1206
|
-
},
|
|
1207
|
-
children: children
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
function useI18n() {
|
|
1211
|
-
const context = useContext(CozeLoopContext);
|
|
1212
|
-
if (!context.i18n) return {
|
|
1213
|
-
t: (key)=>{
|
|
1214
|
-
console.warn(`CozeLoopProvider: No i18n function provided, returning key: ${key}`);
|
|
1215
|
-
return key;
|
|
1216
|
-
},
|
|
1217
|
-
language: 'zh-CN'
|
|
1218
|
-
};
|
|
1219
|
-
if ('object' == typeof context.i18n && 't' in context.i18n) return context.i18n;
|
|
1220
|
-
return {
|
|
1221
|
-
t: context.i18n
|
|
1222
|
-
};
|
|
1223
|
-
}
|
|
1224
|
-
function useReportEvent() {
|
|
1225
|
-
const context = useContext(CozeLoopContext);
|
|
1226
|
-
return context.sendEvent ?? ((name, params)=>{
|
|
1227
|
-
console.info(name, params);
|
|
1228
|
-
});
|
|
1229
|
-
}
|
|
1230
|
-
function useCozeLoopContext() {
|
|
1231
|
-
return useContext(CozeLoopContext);
|
|
1232
|
-
}
|
|
1233
1203
|
const useUnsaveLeaveWarning = ({ block, message })=>{
|
|
1234
|
-
const
|
|
1235
|
-
const warnMessage = message || i18n.t('unsave_leave_confirm_warning') || 'Close confirm';
|
|
1204
|
+
const warnMessage = message || i18n_I18n.t('unsave_leave_confirm_warning') || 'Close confirm';
|
|
1236
1205
|
useEffect(()=>{
|
|
1237
1206
|
const handleBeforeUnload = (event)=>{
|
|
1238
1207
|
if (block) {
|
|
@@ -1248,10 +1217,6 @@ const useUnsaveLeaveWarning = ({ block, message })=>{
|
|
|
1248
1217
|
block,
|
|
1249
1218
|
warnMessage
|
|
1250
1219
|
]);
|
|
1251
|
-
useBlocker(()=>{
|
|
1252
|
-
if (block) return !window.confirm(warnMessage);
|
|
1253
|
-
return true;
|
|
1254
|
-
});
|
|
1255
1220
|
};
|
|
1256
1221
|
const InfiniteScrollTable = /*#__PURE__*/ forwardRef(({ service, options, className, ...restTableProps }, ref)=>{
|
|
1257
1222
|
const containerRef = useRef(null);
|
|
@@ -1285,7 +1250,7 @@ const InfiniteScrollTable = /*#__PURE__*/ forwardRef(({ service, options, classN
|
|
|
1285
1250
|
empty: restTableProps.empty ?? /*#__PURE__*/ jsx(EmptyState, {
|
|
1286
1251
|
size: "full_screen",
|
|
1287
1252
|
icon: /*#__PURE__*/ jsx(IconCozIllusEmpty, {}),
|
|
1288
|
-
title:
|
|
1253
|
+
title: i18n_I18n.t('no_data')
|
|
1289
1254
|
}),
|
|
1290
1255
|
enableLoad: true,
|
|
1291
1256
|
loadMode: "cursor",
|
|
@@ -1386,7 +1351,7 @@ function TableColsConfig({ className, localStorageKey, defaultHiddenColKeys, col
|
|
|
1386
1351
|
const configColumns = generateConfigColumns(handledColumns, hiddenColKeys);
|
|
1387
1352
|
if (configColumns) toolkit_sleep(100).then(()=>{
|
|
1388
1353
|
onChangeConfig?.(configColumns);
|
|
1389
|
-
});
|
|
1354
|
+
}).catch(console.error);
|
|
1390
1355
|
}
|
|
1391
1356
|
}, [
|
|
1392
1357
|
handledColumns,
|
|
@@ -1450,7 +1415,7 @@ function TableColsConfig({ className, localStorageKey, defaultHiddenColKeys, col
|
|
|
1450
1415
|
icon: /*#__PURE__*/ jsx(IconCozSetting, {}),
|
|
1451
1416
|
color: "primary",
|
|
1452
1417
|
onClick: ()=>setVisible(true),
|
|
1453
|
-
children:
|
|
1418
|
+
children: i18n_I18n.t('column_configuration')
|
|
1454
1419
|
}),
|
|
1455
1420
|
/*#__PURE__*/ jsxs(SideSheet, {
|
|
1456
1421
|
placement: "right",
|
|
@@ -1466,7 +1431,7 @@ function TableColsConfig({ className, localStorageKey, defaultHiddenColKeys, col
|
|
|
1466
1431
|
children: [
|
|
1467
1432
|
/*#__PURE__*/ jsx("div", {
|
|
1468
1433
|
className: classnames(table_cols_config_index_module.cell, table_cols_config_index_module["cell-left"], table_cols_config_index_module["cell-thead"]),
|
|
1469
|
-
children:
|
|
1434
|
+
children: i18n_I18n.t('column_name')
|
|
1470
1435
|
}),
|
|
1471
1436
|
/*#__PURE__*/ jsx("div", {
|
|
1472
1437
|
className: classnames(table_cols_config_index_module.cell, table_cols_config_index_module["cell-right"], table_cols_config_index_module["cell-thead"]),
|
|
@@ -1513,7 +1478,7 @@ function TableHeader({ columnSelectorConfigProps, tableColsConfigProps, filterFo
|
|
|
1513
1478
|
...spaceProps || {},
|
|
1514
1479
|
children: [
|
|
1515
1480
|
refreshButtonPros ? /*#__PURE__*/ jsx(Tooltip, {
|
|
1516
|
-
content:
|
|
1481
|
+
content: i18n_I18n.t('refresh'),
|
|
1517
1482
|
theme: "dark",
|
|
1518
1483
|
children: /*#__PURE__*/ jsx(Button, {
|
|
1519
1484
|
color: "primary",
|
|
@@ -1535,7 +1500,7 @@ function TableWithoutPagination(props) {
|
|
|
1535
1500
|
const { header, heightFull = false, className } = props;
|
|
1536
1501
|
const { columns } = props.tableProps ?? {};
|
|
1537
1502
|
const tableContainerRef = useRef(null);
|
|
1538
|
-
const size = useSize(tableContainerRef
|
|
1503
|
+
const size = useSize(tableContainerRef);
|
|
1539
1504
|
const tableHeaderSize = useSize(tableContainerRef.current?.querySelector('.semi-table-header'));
|
|
1540
1505
|
const tableHeaderHeight = tableHeaderSize?.height ?? 56;
|
|
1541
1506
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -1559,7 +1524,7 @@ function TableWithoutPagination(props) {
|
|
|
1559
1524
|
columns: columns?.filter((column)=>true !== column.hidden && false !== column.checked)?.map((column)=>({
|
|
1560
1525
|
...column,
|
|
1561
1526
|
...column.sorter && !column.sortIcon ? {
|
|
1562
|
-
sortIcon:
|
|
1527
|
+
sortIcon: createLoopTableSortIcon()
|
|
1563
1528
|
} : {}
|
|
1564
1529
|
}))
|
|
1565
1530
|
}
|
|
@@ -1573,7 +1538,7 @@ function TableBatchOperate({ actions, batchOperateStore }) {
|
|
|
1573
1538
|
if (!enableBatchOperate) return /*#__PURE__*/ jsx(Button, {
|
|
1574
1539
|
color: "primary",
|
|
1575
1540
|
onClick: ()=>setEnableBatchOperate?.(true),
|
|
1576
|
-
children:
|
|
1541
|
+
children: i18n_I18n.t('bulk_select')
|
|
1577
1542
|
});
|
|
1578
1543
|
return /*#__PURE__*/ jsxs("div", {
|
|
1579
1544
|
className: "flex items-center gap-2",
|
|
@@ -1581,16 +1546,16 @@ function TableBatchOperate({ actions, batchOperateStore }) {
|
|
|
1581
1546
|
/*#__PURE__*/ jsxs("div", {
|
|
1582
1547
|
className: "text-xs",
|
|
1583
1548
|
children: [
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1549
|
+
i18n_I18n.t('cozeloop_open_evaluate_selected_data_count', {
|
|
1550
|
+
placeholder1: selectedItems.length
|
|
1551
|
+
}),
|
|
1587
1552
|
/*#__PURE__*/ jsx("span", {
|
|
1588
1553
|
className: "ml-1 text-[rgb(var(--coze-up-brand-9))] cursor-pointer",
|
|
1589
1554
|
onClick: ()=>{
|
|
1590
1555
|
setSelectedItems([]);
|
|
1591
1556
|
setEnableBatchOperate?.(false);
|
|
1592
1557
|
},
|
|
1593
|
-
children:
|
|
1558
|
+
children: i18n_I18n.t('unselect')
|
|
1594
1559
|
})
|
|
1595
1560
|
]
|
|
1596
1561
|
}),
|
|
@@ -1776,7 +1741,7 @@ function IndexControllerView({ indexControllerStore, className }) {
|
|
|
1776
1741
|
spacing: 4,
|
|
1777
1742
|
children: [
|
|
1778
1743
|
/*#__PURE__*/ jsx(Tooltip, {
|
|
1779
|
-
content:
|
|
1744
|
+
content: i18n_I18n.t('prev_item'),
|
|
1780
1745
|
theme: "dark",
|
|
1781
1746
|
children: /*#__PURE__*/ jsx("div", {
|
|
1782
1747
|
className: "flex items-center",
|
|
@@ -1801,7 +1766,7 @@ function IndexControllerView({ indexControllerStore, className }) {
|
|
|
1801
1766
|
]
|
|
1802
1767
|
}),
|
|
1803
1768
|
/*#__PURE__*/ jsx(Tooltip, {
|
|
1804
|
-
content:
|
|
1769
|
+
content: i18n_I18n.t('next_one'),
|
|
1805
1770
|
theme: "dark",
|
|
1806
1771
|
children: /*#__PURE__*/ jsx("div", {
|
|
1807
1772
|
className: "flex items-center",
|
|
@@ -1853,7 +1818,7 @@ const base_search_select_index_module = {
|
|
|
1853
1818
|
"select-dropdown-style": "select-dropdown-style-o3gnrf",
|
|
1854
1819
|
selectDropdownStyle: "select-dropdown-style-o3gnrf"
|
|
1855
1820
|
};
|
|
1856
|
-
const BaseSearchSelect = (props)=>{
|
|
1821
|
+
const BaseSearchSelect = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
1857
1822
|
const { optionList: _optionList, loadOptionByIds, value, defaultValue, onSearch, renderSelectedItem, onChangeWithObject, onDropdownVisibleChange, showRefreshBtn, onClickRefresh, disabledCacheOptions } = props;
|
|
1858
1823
|
const [searchWord, setSearchWord] = useState('');
|
|
1859
1824
|
const [refreshFlag, setRefreshFlag] = useState([]);
|
|
@@ -1937,7 +1902,7 @@ const BaseSearchSelect = (props)=>{
|
|
|
1937
1902
|
return /*#__PURE__*/ jsx(Select, {
|
|
1938
1903
|
suffix: showRefreshBtn && dropdownVisible ? /*#__PURE__*/ jsx(Tooltip, {
|
|
1939
1904
|
theme: "dark",
|
|
1940
|
-
content:
|
|
1905
|
+
content: i18n_I18n.t('refresh'),
|
|
1941
1906
|
children: /*#__PURE__*/ jsxs("div", {
|
|
1942
1907
|
className: "flex flex-row items-center",
|
|
1943
1908
|
children: [
|
|
@@ -1965,9 +1930,10 @@ const BaseSearchSelect = (props)=>{
|
|
|
1965
1930
|
onSearch: (vs, e)=>{
|
|
1966
1931
|
setSearchWord(vs);
|
|
1967
1932
|
if (onSearch) onSearch?.(vs, e);
|
|
1968
|
-
}
|
|
1933
|
+
},
|
|
1934
|
+
ref: ref
|
|
1969
1935
|
});
|
|
1970
|
-
};
|
|
1936
|
+
});
|
|
1971
1937
|
const base_search_select = BaseSearchSelect;
|
|
1972
1938
|
const BaseSearchFormSelect = withField((props)=>/*#__PURE__*/ jsx(base_search_select, {
|
|
1973
1939
|
...props
|
|
@@ -1976,7 +1942,7 @@ const base_search_form_select = BaseSearchFormSelect;
|
|
|
1976
1942
|
function OpenDetailButton({ url, className }) {
|
|
1977
1943
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
1978
1944
|
theme: "dark",
|
|
1979
|
-
content:
|
|
1945
|
+
content: i18n_I18n.t('view_detail'),
|
|
1980
1946
|
children: /*#__PURE__*/ jsx(Button, {
|
|
1981
1947
|
onClick: (e)=>{
|
|
1982
1948
|
e.stopPropagation();
|
|
@@ -2115,7 +2081,6 @@ const logic_expr_index_module = {
|
|
|
2115
2081
|
};
|
|
2116
2082
|
function LogicNot(props) {
|
|
2117
2083
|
const { not, readonly, onChange, className, style } = props;
|
|
2118
|
-
const I18n = useI18n();
|
|
2119
2084
|
const onClick = ()=>{
|
|
2120
2085
|
if (readonly) return;
|
|
2121
2086
|
onChange?.(!not);
|
|
@@ -2129,7 +2094,7 @@ function LogicNot(props) {
|
|
|
2129
2094
|
e.stopPropagation();
|
|
2130
2095
|
onClick();
|
|
2131
2096
|
},
|
|
2132
|
-
children:
|
|
2097
|
+
children: i18n_I18n.t('logic_expr_not')
|
|
2133
2098
|
});
|
|
2134
2099
|
}
|
|
2135
2100
|
const LOGIC_OPTIONS = [
|
|
@@ -2157,7 +2122,6 @@ const SvgSelect = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
|
2157
2122
|
});
|
|
2158
2123
|
function LogicToggle(props) {
|
|
2159
2124
|
const { operator = 'and', hideLine, enableNot, not = false, readonly, allowLogicOperators, onChange } = props;
|
|
2160
|
-
const I18n = useI18n();
|
|
2161
2125
|
const filteredLogicOptions = allowLogicOperators ? LOGIC_OPTIONS.filter((op)=>allowLogicOperators.includes(op.value)) : LOGIC_OPTIONS;
|
|
2162
2126
|
const label = filteredLogicOptions.find((op)=>op.value === operator)?.label || '-';
|
|
2163
2127
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -2168,7 +2132,7 @@ function LogicToggle(props) {
|
|
|
2168
2132
|
}),
|
|
2169
2133
|
children: readonly ? /*#__PURE__*/ jsx("div", {
|
|
2170
2134
|
className: logic_expr_index_module["logic-toggle-tag"],
|
|
2171
|
-
children:
|
|
2135
|
+
children: i18n_I18n.t(label)
|
|
2172
2136
|
}) : /*#__PURE__*/ jsx(Select, {
|
|
2173
2137
|
size: "small",
|
|
2174
2138
|
showClear: false,
|
|
@@ -2184,7 +2148,7 @@ function LogicToggle(props) {
|
|
|
2184
2148
|
onChange(operator, val);
|
|
2185
2149
|
}
|
|
2186
2150
|
}) : null,
|
|
2187
|
-
|
|
2151
|
+
i18n_I18n.t(label),
|
|
2188
2152
|
/*#__PURE__*/ jsx(SvgSelect, {
|
|
2189
2153
|
className: logic_expr_index_module["logic-toggle-tag-icon"]
|
|
2190
2154
|
})
|
|
@@ -2192,7 +2156,7 @@ function LogicToggle(props) {
|
|
|
2192
2156
|
}),
|
|
2193
2157
|
optionList: filteredLogicOptions.map((item)=>({
|
|
2194
2158
|
...item,
|
|
2195
|
-
label:
|
|
2159
|
+
label: i18n_I18n.t(item.label ?? '')
|
|
2196
2160
|
})),
|
|
2197
2161
|
value: operator,
|
|
2198
2162
|
onChange: (val)=>{
|
|
@@ -2261,7 +2225,6 @@ function defaultRightRender({ expr, readonly, size, onChange, onExprChange }) {
|
|
|
2261
2225
|
}
|
|
2262
2226
|
const ExprRender = ({ value, readonly, enableNot, className, style, path, leftRender, operatorRender, rightRender, elementSize = 'default', onChange, onDelete, renderTool, errorMsgRender })=>{
|
|
2263
2227
|
const isEdit = !readonly;
|
|
2264
|
-
const I18n = useI18n();
|
|
2265
2228
|
const [deleteButtonHover, setDeleteButtonHover] = useState(false);
|
|
2266
2229
|
const patchExpr = (expr)=>{
|
|
2267
2230
|
const newExpr = {
|
|
@@ -2343,7 +2306,7 @@ const ExprRender = ({ value, readonly, enableNot, className, style, path, leftRe
|
|
|
2343
2306
|
renderRight(),
|
|
2344
2307
|
isEdit ? /*#__PURE__*/ jsx(Tooltip, {
|
|
2345
2308
|
theme: "dark",
|
|
2346
|
-
content:
|
|
2309
|
+
content: i18n_I18n.t('logic_expr_delete_filter'),
|
|
2347
2310
|
children: /*#__PURE__*/ jsx(IconButton, {
|
|
2348
2311
|
className: classnames('expr-render-del-btn', logic_expr_index_module["expr-render-del-btn"]),
|
|
2349
2312
|
size: "small",
|
|
@@ -2385,7 +2348,6 @@ function genPath(path, index) {
|
|
|
2385
2348
|
return path ? `${path}-${index}` : `${index}`;
|
|
2386
2349
|
}
|
|
2387
2350
|
function ExprGroupRender({ value, readonly, singleTag, enableNot, className, exprGroupRenderContentItemsClassName, style, path, leftRender, operatorRender, rightRender, allowLogicOperators, maxNestingDepth, elementSize = 'default', logicToggleReadonly, onExprChange, onExprGroupChange, onAddItem, onAddGroup, onDeleteExpr, onDeleteExprGroup, errorMsgRender }) {
|
|
2388
|
-
const I18n = useI18n();
|
|
2389
2351
|
const isEdit = !readonly;
|
|
2390
2352
|
const patchExpr = (expr)=>{
|
|
2391
2353
|
if (!value) return;
|
|
@@ -2418,7 +2380,7 @@ function ExprGroupRender({ value, readonly, singleTag, enableNot, className, exp
|
|
|
2418
2380
|
type: "primary",
|
|
2419
2381
|
children: /*#__PURE__*/ jsx("span", {
|
|
2420
2382
|
className: "text-brand-9 text-[14px] leading-[20px]",
|
|
2421
|
-
children:
|
|
2383
|
+
children: i18n_I18n.t('logic_expr_add_filter')
|
|
2422
2384
|
})
|
|
2423
2385
|
}),
|
|
2424
2386
|
showAddGroupButton ? /*#__PURE__*/ jsxs(Fragment, {
|
|
@@ -2429,7 +2391,7 @@ function ExprGroupRender({ value, readonly, singleTag, enableNot, className, exp
|
|
|
2429
2391
|
/*#__PURE__*/ jsx(ToolButton, {
|
|
2430
2392
|
icon: /*#__PURE__*/ jsx(IconCozPlusCircle, {}),
|
|
2431
2393
|
onClick: ()=>onAddGroup?.(path),
|
|
2432
|
-
children:
|
|
2394
|
+
children: i18n_I18n.t('logic_expr_add_filter_group')
|
|
2433
2395
|
})
|
|
2434
2396
|
]
|
|
2435
2397
|
}) : null
|
|
@@ -2705,85 +2667,85 @@ function findFieldByPath(fields, fieldPaths) {
|
|
|
2705
2667
|
});
|
|
2706
2668
|
return field;
|
|
2707
2669
|
}
|
|
2708
|
-
const stringOperations = [
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
];
|
|
2726
|
-
const numberOperations = [
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
];
|
|
2752
|
-
const dateOperations = [
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
];
|
|
2770
|
-
const selectOperations = [
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
];
|
|
2670
|
+
const stringOperations = ()=>[
|
|
2671
|
+
{
|
|
2672
|
+
label: i18n_I18n.t('contain'),
|
|
2673
|
+
value: 'like'
|
|
2674
|
+
},
|
|
2675
|
+
{
|
|
2676
|
+
label: i18n_I18n.t('not_contain'),
|
|
2677
|
+
value: 'not-like'
|
|
2678
|
+
},
|
|
2679
|
+
{
|
|
2680
|
+
label: i18n_I18n.t('equal_to'),
|
|
2681
|
+
value: 'equals'
|
|
2682
|
+
},
|
|
2683
|
+
{
|
|
2684
|
+
label: i18n_I18n.t('not_equal_to'),
|
|
2685
|
+
value: 'not-equals'
|
|
2686
|
+
}
|
|
2687
|
+
];
|
|
2688
|
+
const numberOperations = ()=>[
|
|
2689
|
+
{
|
|
2690
|
+
label: i18n_I18n.t('equal_to'),
|
|
2691
|
+
value: 'equals'
|
|
2692
|
+
},
|
|
2693
|
+
{
|
|
2694
|
+
label: i18n_I18n.t('not_equal_to'),
|
|
2695
|
+
value: 'not-equals'
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
label: i18n_I18n.t('greater_than'),
|
|
2699
|
+
value: 'greater-than'
|
|
2700
|
+
},
|
|
2701
|
+
{
|
|
2702
|
+
label: i18n_I18n.t('task_filter_gte'),
|
|
2703
|
+
value: 'greater-than-equals'
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
label: i18n_I18n.t('less_than'),
|
|
2707
|
+
value: 'less-than'
|
|
2708
|
+
},
|
|
2709
|
+
{
|
|
2710
|
+
label: i18n_I18n.t('task_filter_lte'),
|
|
2711
|
+
value: 'less-than-equals'
|
|
2712
|
+
}
|
|
2713
|
+
];
|
|
2714
|
+
const dateOperations = ()=>[
|
|
2715
|
+
{
|
|
2716
|
+
label: i18n_I18n.t('equal_to'),
|
|
2717
|
+
value: 'equals'
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
label: i18n_I18n.t('not_equal_to'),
|
|
2721
|
+
value: 'not-equals'
|
|
2722
|
+
},
|
|
2723
|
+
{
|
|
2724
|
+
label: i18n_I18n.t('later_than'),
|
|
2725
|
+
value: 'greater-than'
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
label: i18n_I18n.t('earlier_than'),
|
|
2729
|
+
value: 'less-than'
|
|
2730
|
+
}
|
|
2731
|
+
];
|
|
2732
|
+
const selectOperations = ()=>[
|
|
2733
|
+
{
|
|
2734
|
+
label: i18n_I18n.t('contain'),
|
|
2735
|
+
value: 'contains'
|
|
2736
|
+
},
|
|
2737
|
+
{
|
|
2738
|
+
label: i18n_I18n.t('not_contain'),
|
|
2739
|
+
value: 'not-contains'
|
|
2740
|
+
}
|
|
2741
|
+
];
|
|
2780
2742
|
function StringSetter({ textAreaMode = true, ...props }) {
|
|
2781
2743
|
if (false === textAreaMode) return /*#__PURE__*/ jsx(Input, {
|
|
2782
|
-
placeholder:
|
|
2744
|
+
placeholder: i18n_I18n.t('please_enter'),
|
|
2783
2745
|
...props
|
|
2784
2746
|
});
|
|
2785
2747
|
return /*#__PURE__*/ jsx(TextArea, {
|
|
2786
|
-
placeholder:
|
|
2748
|
+
placeholder: i18n_I18n.t('please_enter'),
|
|
2787
2749
|
rows: 1,
|
|
2788
2750
|
...props
|
|
2789
2751
|
});
|
|
@@ -2791,7 +2753,7 @@ function StringSetter({ textAreaMode = true, ...props }) {
|
|
|
2791
2753
|
function NumberSetter(props) {
|
|
2792
2754
|
const { value, onChange, ...rest } = props;
|
|
2793
2755
|
return /*#__PURE__*/ jsx(CozInputNumber, {
|
|
2794
|
-
placeholder:
|
|
2756
|
+
placeholder: i18n_I18n.t('please_enter'),
|
|
2795
2757
|
...rest,
|
|
2796
2758
|
className: `w-full ${props.className ?? ''}`,
|
|
2797
2759
|
value: value ?? '',
|
|
@@ -2809,7 +2771,7 @@ function DateSetter(props) {
|
|
|
2809
2771
|
function SelectSetter(props) {
|
|
2810
2772
|
const { value, onChange, optionList = [], className = '', ...rest } = props;
|
|
2811
2773
|
return /*#__PURE__*/ jsx(Select, {
|
|
2812
|
-
placeholder:
|
|
2774
|
+
placeholder: i18n_I18n.t('please_select'),
|
|
2813
2775
|
...rest,
|
|
2814
2776
|
className: `w-full ${className}`,
|
|
2815
2777
|
optionList: optionList,
|
|
@@ -2817,33 +2779,40 @@ function SelectSetter(props) {
|
|
|
2817
2779
|
onChange: (val)=>onChange(val)
|
|
2818
2780
|
});
|
|
2819
2781
|
}
|
|
2820
|
-
|
|
2821
|
-
{
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2782
|
+
function useDataTypeList() {
|
|
2783
|
+
const [state] = useState(()=>{
|
|
2784
|
+
const dataTypeList = [
|
|
2785
|
+
{
|
|
2786
|
+
type: 'string',
|
|
2787
|
+
operations: stringOperations(),
|
|
2788
|
+
setter: StringSetter
|
|
2789
|
+
},
|
|
2790
|
+
{
|
|
2791
|
+
type: 'number',
|
|
2792
|
+
operations: numberOperations(),
|
|
2793
|
+
setter: NumberSetter
|
|
2794
|
+
},
|
|
2795
|
+
{
|
|
2796
|
+
type: 'date',
|
|
2797
|
+
operations: dateOperations(),
|
|
2798
|
+
setter: DateSetter
|
|
2799
|
+
},
|
|
2800
|
+
{
|
|
2801
|
+
type: 'options',
|
|
2802
|
+
operations: selectOperations(),
|
|
2803
|
+
setter: SelectSetter
|
|
2804
|
+
}
|
|
2805
|
+
];
|
|
2806
|
+
return dataTypeList;
|
|
2807
|
+
});
|
|
2808
|
+
return state;
|
|
2809
|
+
}
|
|
2842
2810
|
function RightRender(props) {
|
|
2843
2811
|
const { expr, onExprChange, fields, disabled = false } = props;
|
|
2844
2812
|
const field = findFieldByPath(fields, expr.left);
|
|
2845
2813
|
if (!field) return null;
|
|
2846
2814
|
if ('is-empty' === expr.operator || 'is-not-empty' === expr.operator) return null;
|
|
2815
|
+
const dataTypeList = useDataTypeList();
|
|
2847
2816
|
const Setter = field?.setter || dataTypeList.find((dataType)=>dataType.type === field.type)?.setter;
|
|
2848
2817
|
if (!Setter) return null;
|
|
2849
2818
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -2866,6 +2835,7 @@ function RightRender(props) {
|
|
|
2866
2835
|
function OperatorRender(props) {
|
|
2867
2836
|
const { expr, onExprChange, fields, disabled = false } = props;
|
|
2868
2837
|
const field = findFieldByPath(fields, expr.left);
|
|
2838
|
+
const dataTypeList = useDataTypeList();
|
|
2869
2839
|
const dataType = dataTypeList.find((item)=>item.type === field?.type);
|
|
2870
2840
|
if (!field) return null;
|
|
2871
2841
|
const { disabledOperations = [], customOperations } = field;
|
|
@@ -2875,7 +2845,7 @@ function OperatorRender(props) {
|
|
|
2875
2845
|
return /*#__PURE__*/ jsx("div", {
|
|
2876
2846
|
className: "w-24",
|
|
2877
2847
|
children: /*#__PURE__*/ jsx(Select, {
|
|
2878
|
-
placeholder:
|
|
2848
|
+
placeholder: i18n_I18n.t('operator'),
|
|
2879
2849
|
value: expr.operator,
|
|
2880
2850
|
style: {
|
|
2881
2851
|
width: '100%'
|
|
@@ -2900,10 +2870,11 @@ function fieldsToOptions(fields) {
|
|
|
2900
2870
|
}
|
|
2901
2871
|
function LeftRender(props) {
|
|
2902
2872
|
const { expr, onExprChange, fields, disabled, enableCascadeMode } = props;
|
|
2873
|
+
const dataTypeList = useDataTypeList();
|
|
2903
2874
|
if (enableCascadeMode) return /*#__PURE__*/ jsx("div", {
|
|
2904
2875
|
className: "w-56",
|
|
2905
2876
|
children: /*#__PURE__*/ jsx(Cascader, {
|
|
2906
|
-
placeholder:
|
|
2877
|
+
placeholder: i18n_I18n.t('please_select'),
|
|
2907
2878
|
value: expr.left,
|
|
2908
2879
|
className: "w-full",
|
|
2909
2880
|
disabled: disabled,
|
|
@@ -2930,7 +2901,7 @@ function LeftRender(props) {
|
|
|
2930
2901
|
return /*#__PURE__*/ jsx("div", {
|
|
2931
2902
|
className: "w-40",
|
|
2932
2903
|
children: /*#__PURE__*/ jsx(Select, {
|
|
2933
|
-
placeholder:
|
|
2904
|
+
placeholder: i18n_I18n.t('please_select'),
|
|
2934
2905
|
value: expr.left,
|
|
2935
2906
|
className: "w-full",
|
|
2936
2907
|
disabled: disabled,
|
|
@@ -3017,7 +2988,7 @@ function LogicEditor({ fields = [], disabled = false, value, popoverProps = {},
|
|
|
3017
2988
|
children: [
|
|
3018
2989
|
/*#__PURE__*/ jsx("div", {
|
|
3019
2990
|
className: "font-medium",
|
|
3020
|
-
children:
|
|
2991
|
+
children: i18n_I18n.t('filter')
|
|
3021
2992
|
}),
|
|
3022
2993
|
tooltip ? /*#__PURE__*/ jsx(Tooltip, {
|
|
3023
2994
|
theme: "dark",
|
|
@@ -3032,7 +3003,7 @@ function LogicEditor({ fields = [], disabled = false, value, popoverProps = {},
|
|
|
3032
3003
|
setLogicFilter(void 0);
|
|
3033
3004
|
onChange?.(void 0);
|
|
3034
3005
|
},
|
|
3035
|
-
children:
|
|
3006
|
+
children: i18n_I18n.t('clear_filter')
|
|
3036
3007
|
})
|
|
3037
3008
|
]
|
|
3038
3009
|
}),
|
|
@@ -3057,7 +3028,7 @@ function LogicEditor({ fields = [], disabled = false, value, popoverProps = {},
|
|
|
3057
3028
|
setVisible(false);
|
|
3058
3029
|
onClose?.();
|
|
3059
3030
|
},
|
|
3060
|
-
children:
|
|
3031
|
+
children: i18n_I18n.t('apply')
|
|
3061
3032
|
})
|
|
3062
3033
|
})
|
|
3063
3034
|
]
|
|
@@ -3084,7 +3055,7 @@ function LogicEditor({ fields = [], disabled = false, value, popoverProps = {},
|
|
|
3084
3055
|
icon: /*#__PURE__*/ jsx(IconCozFilter, {}),
|
|
3085
3056
|
color: "primary",
|
|
3086
3057
|
children: [
|
|
3087
|
-
|
|
3058
|
+
i18n_I18n.t('filter'),
|
|
3088
3059
|
count ? /*#__PURE__*/ jsx("div", {
|
|
3089
3060
|
className: "flex items-center justify-center w-5 h-5 rounded-[50%] text-brand-9 bg-brand-4 ml-1 text-[13px]",
|
|
3090
3061
|
children: count
|
|
@@ -3095,7 +3066,7 @@ function LogicEditor({ fields = [], disabled = false, value, popoverProps = {},
|
|
|
3095
3066
|
}
|
|
3096
3067
|
loader.config({
|
|
3097
3068
|
paths: {
|
|
3098
|
-
vs:
|
|
3069
|
+
vs: "https://unpkg.com/monaco-editor@0.43.0/min/vs"
|
|
3099
3070
|
}
|
|
3100
3071
|
});
|
|
3101
3072
|
const BasicCard = ({ title, children, className })=>/*#__PURE__*/ jsxs("div", {
|
|
@@ -3155,23 +3126,23 @@ var type_ImageStatus = /*#__PURE__*/ function(ImageStatus) {
|
|
|
3155
3126
|
ImageStatus["Error"] = "error";
|
|
3156
3127
|
return ImageStatus;
|
|
3157
3128
|
}({});
|
|
3158
|
-
const
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
};
|
|
3129
|
+
const getErrorTypeMap = ()=>({
|
|
3130
|
+
[ItemErrorType.MismatchSchema]: i18n_I18n.t('schema_mismatch'),
|
|
3131
|
+
[ItemErrorType.EmptyData]: i18n_I18n.t('empty_data'),
|
|
3132
|
+
[ItemErrorType.ExceedMaxItemSize]: i18n_I18n.t('single_data_size_exceeded'),
|
|
3133
|
+
[ItemErrorType.ExceedDatasetCapacity]: i18n_I18n.t('dataset_capacity_exceeded'),
|
|
3134
|
+
[ItemErrorType.MalformedFile]: i18n_I18n.t('file_format_error'),
|
|
3135
|
+
[ItemErrorType.InternalError]: i18n_I18n.t('system_error'),
|
|
3136
|
+
[ItemErrorType.IllegalContent]: i18n_I18n.t('contains_illegal_content'),
|
|
3137
|
+
[ItemErrorType.MissingRequiredField]: i18n_I18n.t('missing_required_field'),
|
|
3138
|
+
[ItemErrorType.ExceedMaxNestedDepth]: i18n_I18n.t('data_nesting_exceeds_limit'),
|
|
3139
|
+
[ItemErrorType.TransformItemFailed]: i18n_I18n.t('data_conversion_failed'),
|
|
3140
|
+
[ItemErrorType.ExceedMaxImageCount]: i18n_I18n.t('exceed_max_image_count'),
|
|
3141
|
+
[ItemErrorType.ExceedMaxImageSize]: i18n_I18n.t('exceed_max_image_size'),
|
|
3142
|
+
[ItemErrorType.GetImageFailed]: i18n_I18n.t('get_image_failed'),
|
|
3143
|
+
[ItemErrorType.IllegalExtension]: i18n_I18n.t('illegal_extension'),
|
|
3144
|
+
[ItemErrorType.UploadImageFailed]: i18n_I18n.t('cozeloop_open_evaluate_image_upload_failed')
|
|
3145
|
+
});
|
|
3175
3146
|
const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImageUrl, uploadType = 'image', intranetUrlValidator })=>{
|
|
3176
3147
|
const [error, setError] = useState('');
|
|
3177
3148
|
const [isUploading, setIsUploading] = useState(false);
|
|
@@ -3187,7 +3158,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3187
3158
|
}
|
|
3188
3159
|
};
|
|
3189
3160
|
const handleUpload = async (formValues)=>{
|
|
3190
|
-
if (formValues?.urls?.length === 0) return void setError(
|
|
3161
|
+
if (formValues?.urls?.length === 0) return void setError(i18n_I18n.t('please_add_at_least_one_image_link'));
|
|
3191
3162
|
setIsUploading(true);
|
|
3192
3163
|
setError('');
|
|
3193
3164
|
try {
|
|
@@ -3195,7 +3166,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3195
3166
|
setUploadResults(results || []);
|
|
3196
3167
|
setIsUploaded(true);
|
|
3197
3168
|
} catch (err) {
|
|
3198
|
-
setError(
|
|
3169
|
+
setError(i18n_I18n.t('upload_failed_please_try_again'));
|
|
3199
3170
|
} finally{
|
|
3200
3171
|
setIsUploading(false);
|
|
3201
3172
|
}
|
|
@@ -3248,24 +3219,28 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3248
3219
|
/*#__PURE__*/ jsx(Form.Input, {
|
|
3249
3220
|
field: `urls[${idx}]`,
|
|
3250
3221
|
label: {
|
|
3251
|
-
text: `${'image' === uploadType ?
|
|
3222
|
+
text: `${'image' === uploadType ? i18n_I18n.t('image') : i18n_I18n.t('video')}${idx + 1}`,
|
|
3252
3223
|
required: true
|
|
3253
3224
|
},
|
|
3254
3225
|
fieldClassName: "flex-1",
|
|
3255
|
-
placeholder:
|
|
3226
|
+
placeholder: `${i18n_I18n.t('please_input_placeholder1_link_public', {
|
|
3227
|
+
placeholder1: 'image' === uploadType ? i18n_I18n.t('image') : i18n_I18n.t('video')
|
|
3228
|
+
})}`,
|
|
3256
3229
|
rules: [
|
|
3257
3230
|
{
|
|
3258
3231
|
validator: (_, value, cb)=>{
|
|
3259
3232
|
if (!value) {
|
|
3260
|
-
cb(
|
|
3233
|
+
cb(`${i18n_I18n.t('please_input_placeholder1_link', {
|
|
3234
|
+
placeholder1: 'image' === uploadType ? i18n_I18n.t('image') : i18n_I18n.t('video')
|
|
3235
|
+
})}`);
|
|
3261
3236
|
return false;
|
|
3262
3237
|
}
|
|
3263
3238
|
if (intranetUrlValidator && intranetUrlValidator(value)) {
|
|
3264
|
-
cb(
|
|
3239
|
+
cb(i18n_I18n.t('please_use_public_domain'));
|
|
3265
3240
|
return false;
|
|
3266
3241
|
}
|
|
3267
3242
|
if (!validateUrl(value)) {
|
|
3268
|
-
cb(
|
|
3243
|
+
cb(i18n_I18n.t('please_enter_a_valid_url'));
|
|
3269
3244
|
return false;
|
|
3270
3245
|
}
|
|
3271
3246
|
return true;
|
|
@@ -3298,7 +3273,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3298
3273
|
]),
|
|
3299
3274
|
className: "mt-2",
|
|
3300
3275
|
children: [
|
|
3301
|
-
|
|
3276
|
+
i18n_I18n.t('space_member_role_type_add_btn'),
|
|
3302
3277
|
/*#__PURE__*/ jsx(Typography.Text, {
|
|
3303
3278
|
className: "ml-1",
|
|
3304
3279
|
type: "secondary",
|
|
@@ -3316,7 +3291,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3316
3291
|
});
|
|
3317
3292
|
const columns = [
|
|
3318
3293
|
{
|
|
3319
|
-
title:
|
|
3294
|
+
title: i18n_I18n.t('image_address'),
|
|
3320
3295
|
dataIndex: 'originImage.url',
|
|
3321
3296
|
width: 220,
|
|
3322
3297
|
ellipsis: {
|
|
@@ -3324,7 +3299,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3324
3299
|
}
|
|
3325
3300
|
},
|
|
3326
3301
|
{
|
|
3327
|
-
title:
|
|
3302
|
+
title: i18n_I18n.t('image_preview'),
|
|
3328
3303
|
dataIndex: 'originImage.url',
|
|
3329
3304
|
width: 120,
|
|
3330
3305
|
render: (url)=>/*#__PURE__*/ jsx(Image, {
|
|
@@ -3337,7 +3312,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3337
3312
|
})
|
|
3338
3313
|
},
|
|
3339
3314
|
{
|
|
3340
|
-
title:
|
|
3315
|
+
title: i18n_I18n.t('status'),
|
|
3341
3316
|
key: 'status',
|
|
3342
3317
|
align: 'left',
|
|
3343
3318
|
width: 200,
|
|
@@ -3347,12 +3322,12 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3347
3322
|
/*#__PURE__*/ jsx(Tag, {
|
|
3348
3323
|
prefixIcon: record?.errorType ? /*#__PURE__*/ jsx(IconCozCrossCircleFill, {}) : /*#__PURE__*/ jsx(IconCozCheckMarkCircleFill, {}),
|
|
3349
3324
|
color: record?.errorType ? 'red' : 'green',
|
|
3350
|
-
children: record?.errorType ?
|
|
3325
|
+
children: record?.errorType ? i18n_I18n.t('failure') : i18n_I18n.t('success')
|
|
3351
3326
|
}),
|
|
3352
3327
|
/*#__PURE__*/ jsx(Typography.Text, {
|
|
3353
3328
|
type: "secondary",
|
|
3354
3329
|
className: "ml-1",
|
|
3355
|
-
children: record.errorType ?
|
|
3330
|
+
children: record.errorType ? getErrorTypeMap()[record.errorType] : ''
|
|
3356
3331
|
})
|
|
3357
3332
|
]
|
|
3358
3333
|
})
|
|
@@ -3371,13 +3346,15 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3371
3346
|
})
|
|
3372
3347
|
});
|
|
3373
3348
|
const getConfirmButtonText = ()=>{
|
|
3374
|
-
if (!uploadImageUrl) return
|
|
3375
|
-
if (isUploading) return
|
|
3376
|
-
if (isUploaded) return
|
|
3377
|
-
return
|
|
3349
|
+
if (!uploadImageUrl) return i18n_I18n.t('global_btn_confirm');
|
|
3350
|
+
if (isUploading) return i18n_I18n.t('cozeloop_open_evaluate_uploading');
|
|
3351
|
+
if (isUploaded) return `${i18n_I18n.t('import')}${'image' === uploadType ? i18n_I18n.t('image') : i18n_I18n.t('video')}`;
|
|
3352
|
+
return i18n_I18n.t('upload');
|
|
3378
3353
|
};
|
|
3379
3354
|
return /*#__PURE__*/ jsxs(Modal, {
|
|
3380
|
-
title:
|
|
3355
|
+
title: `${i18n_I18n.t('add_placeholder1_link', {
|
|
3356
|
+
placeholder1: 'image' === uploadType ? i18n_I18n.t('image') : i18n_I18n.t('video')
|
|
3357
|
+
})}`,
|
|
3381
3358
|
visible: visible,
|
|
3382
3359
|
onCancel: handleCancel,
|
|
3383
3360
|
width: 640,
|
|
@@ -3387,7 +3364,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3387
3364
|
/*#__PURE__*/ jsx(Button, {
|
|
3388
3365
|
onClick: handleCancel,
|
|
3389
3366
|
color: "primary",
|
|
3390
|
-
children:
|
|
3367
|
+
children: i18n_I18n.t('cancel')
|
|
3391
3368
|
}),
|
|
3392
3369
|
/*#__PURE__*/ jsx(Button, {
|
|
3393
3370
|
type: "primary",
|
|
@@ -3406,7 +3383,7 @@ const UrlInputModal = ({ visible, onConfirm, onCancel, maxCount = 6, uploadImage
|
|
|
3406
3383
|
}),
|
|
3407
3384
|
/*#__PURE__*/ jsx("span", {
|
|
3408
3385
|
className: "ml-2",
|
|
3409
|
-
children:
|
|
3386
|
+
children: i18n_I18n.t('cozeloop_open_evaluate_uploading_image')
|
|
3410
3387
|
})
|
|
3411
3388
|
]
|
|
3412
3389
|
}) : null,
|
|
@@ -3508,10 +3485,10 @@ const VideoItemRenderer = ({ className, style, spaceID, item, onRemove, onChange
|
|
|
3508
3485
|
}),
|
|
3509
3486
|
status === type_ImageStatus.Error ? /*#__PURE__*/ jsx("div", {
|
|
3510
3487
|
className: "text-sm text-red-500",
|
|
3511
|
-
children:
|
|
3488
|
+
children: i18n_I18n.t('upload_fail')
|
|
3512
3489
|
}) : null,
|
|
3513
3490
|
/*#__PURE__*/ jsx(Modal, {
|
|
3514
|
-
title:
|
|
3491
|
+
title: i18n_I18n.t('video_preview'),
|
|
3515
3492
|
footer: null,
|
|
3516
3493
|
visible: visible,
|
|
3517
3494
|
onCancel: ()=>setVisible(false),
|
|
@@ -3629,7 +3606,7 @@ const ImageItemRenderer = ({ className, style, spaceID, item, onRemove, onChange
|
|
|
3629
3606
|
}),
|
|
3630
3607
|
status === type_ImageStatus.Error && /*#__PURE__*/ jsx("div", {
|
|
3631
3608
|
className: "text-sm text-red-500",
|
|
3632
|
-
children:
|
|
3609
|
+
children: i18n_I18n.t('upload_fail')
|
|
3633
3610
|
})
|
|
3634
3611
|
]
|
|
3635
3612
|
});
|
|
@@ -3654,7 +3631,7 @@ const MultipartItemRenderer = ({ item, readonly, onChange, onRemove })=>{
|
|
|
3654
3631
|
maxRows: 3
|
|
3655
3632
|
},
|
|
3656
3633
|
disabled: readonly,
|
|
3657
|
-
placeholder:
|
|
3634
|
+
placeholder: i18n_I18n.t('please_input_text')
|
|
3658
3635
|
}),
|
|
3659
3636
|
readonly ? null : /*#__PURE__*/ jsx(Button, {
|
|
3660
3637
|
icon: /*#__PURE__*/ jsx(IconCozTrashCan, {}),
|
|
@@ -3857,12 +3834,16 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
3857
3834
|
};
|
|
3858
3835
|
const getDisabledTooltip = useCallback(({ type, exceed, disabled })=>{
|
|
3859
3836
|
if (type === ContentType.Image) {
|
|
3860
|
-
if (exceed) return
|
|
3861
|
-
|
|
3837
|
+
if (exceed) return `${i18n_I18n.t('multi_modal_image_limit_reached', {
|
|
3838
|
+
canUseFileLimit
|
|
3839
|
+
})}`;
|
|
3840
|
+
if (disabled) return i18n_I18n.t('model_not_support_multi_modal_image');
|
|
3862
3841
|
} else {
|
|
3863
|
-
if ('Video' !== type) return
|
|
3864
|
-
if (exceed) return
|
|
3865
|
-
|
|
3842
|
+
if ('Video' !== type) return i18n_I18n.t('model_not_support_multi_modal');
|
|
3843
|
+
if (exceed) return `${i18n_I18n.t('multi_modal_video_limit_reached', {
|
|
3844
|
+
canUseFileLimit
|
|
3845
|
+
})}`;
|
|
3846
|
+
if (disabled) return i18n_I18n.t('model_not_support_multi_modal_video');
|
|
3866
3847
|
}
|
|
3867
3848
|
}, []);
|
|
3868
3849
|
const renderImageSubMenu = useCallback((children)=>/*#__PURE__*/ jsx(TooltipWhenDisabled, {
|
|
@@ -3899,14 +3880,14 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
3899
3880
|
/*#__PURE__*/ jsx(Menu.Item, {
|
|
3900
3881
|
onClick: handleAddText,
|
|
3901
3882
|
disabled: imageCount >= maxPartCount,
|
|
3902
|
-
children:
|
|
3883
|
+
children: i18n_I18n.t('text')
|
|
3903
3884
|
}),
|
|
3904
3885
|
imageHidden ? null : /*#__PURE__*/ jsx(Menu.Item, {
|
|
3905
3886
|
onClick: handleAddImageFile,
|
|
3906
3887
|
disabled: exceedFileCount || !imageEnabled,
|
|
3907
3888
|
children: renderImageSubMenu(/*#__PURE__*/ jsx("span", {
|
|
3908
3889
|
className: "w-full",
|
|
3909
|
-
children:
|
|
3890
|
+
children: i18n_I18n.t('image_source_file')
|
|
3910
3891
|
}))
|
|
3911
3892
|
}),
|
|
3912
3893
|
imageHidden ? null : /*#__PURE__*/ jsx(Menu.Item, {
|
|
@@ -3914,7 +3895,7 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
3914
3895
|
disabled: exceedFileCount || !imageEnabled,
|
|
3915
3896
|
children: renderImageSubMenu(/*#__PURE__*/ jsx("span", {
|
|
3916
3897
|
className: "w-full",
|
|
3917
|
-
children:
|
|
3898
|
+
children: i18n_I18n.t('image_external_link')
|
|
3918
3899
|
}))
|
|
3919
3900
|
}),
|
|
3920
3901
|
videoHidden ? null : /*#__PURE__*/ jsx(Menu.Item, {
|
|
@@ -3922,7 +3903,7 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
3922
3903
|
disabled: exceedFileCount || !videoEnabled,
|
|
3923
3904
|
children: renderVideoSubMenu(/*#__PURE__*/ jsx("span", {
|
|
3924
3905
|
className: "w-full",
|
|
3925
|
-
children:
|
|
3906
|
+
children: i18n_I18n.t('video_source_file')
|
|
3926
3907
|
}))
|
|
3927
3908
|
}),
|
|
3928
3909
|
videoHidden ? null : /*#__PURE__*/ jsx(Menu.Item, {
|
|
@@ -3930,7 +3911,7 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
3930
3911
|
disabled: exceedFileCount || !videoEnabled,
|
|
3931
3912
|
children: renderVideoSubMenu(/*#__PURE__*/ jsx("span", {
|
|
3932
3913
|
className: "w-full",
|
|
3933
|
-
children:
|
|
3914
|
+
children: i18n_I18n.t('video_external_link')
|
|
3934
3915
|
}))
|
|
3935
3916
|
})
|
|
3936
3917
|
]
|
|
@@ -4011,7 +3992,7 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
4011
3992
|
color: "primary",
|
|
4012
3993
|
disabled: true,
|
|
4013
3994
|
children: [
|
|
4014
|
-
|
|
3995
|
+
i18n_I18n.t('add_data'),
|
|
4015
3996
|
/*#__PURE__*/ jsx(Typography.Text, {
|
|
4016
3997
|
className: "ml-1 !text-inherit",
|
|
4017
3998
|
type: "secondary",
|
|
@@ -4030,7 +4011,7 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
4030
4011
|
color: "primary",
|
|
4031
4012
|
disabled: items.length >= maxPartCount,
|
|
4032
4013
|
children: [
|
|
4033
|
-
|
|
4014
|
+
i18n_I18n.t('add_data'),
|
|
4034
4015
|
/*#__PURE__*/ jsx(Typography.Text, {
|
|
4035
4016
|
className: "ml-1",
|
|
4036
4017
|
type: "secondary",
|
|
@@ -4044,7 +4025,7 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
4044
4025
|
action: "",
|
|
4045
4026
|
maxSize: maxFileSize,
|
|
4046
4027
|
onSizeError: ()=>{
|
|
4047
|
-
Toast.error(
|
|
4028
|
+
Toast.error(i18n_I18n.t('cozeloop_open_evaluate_image_size_limit_20mb'));
|
|
4048
4029
|
},
|
|
4049
4030
|
accept: supportedFormats,
|
|
4050
4031
|
customRequest: handleUploadFile,
|
|
@@ -4055,7 +4036,7 @@ const MultipartEditor = ({ spaceID, uploadFile, value, onChange, className, mult
|
|
|
4055
4036
|
multiple: true,
|
|
4056
4037
|
limit: canUseFileLimit > canUsePartLimit ? canUsePartLimit : canUseFileLimit,
|
|
4057
4038
|
onExceed: ()=>{
|
|
4058
|
-
Toast.error(
|
|
4039
|
+
Toast.error(i18n_I18n.t('image_or_node_quantity_limit'));
|
|
4059
4040
|
}
|
|
4060
4041
|
}),
|
|
4061
4042
|
showUrlModal ? /*#__PURE__*/ jsx(UrlInputModal, {
|
|
@@ -4135,7 +4116,7 @@ const UploadButton = /*#__PURE__*/ forwardRef(({ spaceID, disabled, maxImageSize
|
|
|
4135
4116
|
onFilePartsChange?.(newPart);
|
|
4136
4117
|
} catch (error) {
|
|
4137
4118
|
console.info('error', error);
|
|
4138
|
-
Toast.error(
|
|
4119
|
+
Toast.error(i18n_I18n.t('image_upload_error'));
|
|
4139
4120
|
onFilePartsChange?.({
|
|
4140
4121
|
...part,
|
|
4141
4122
|
status: 'uploadFail'
|
|
@@ -4151,8 +4132,12 @@ const UploadButton = /*#__PURE__*/ forwardRef(({ spaceID, disabled, maxImageSize
|
|
|
4151
4132
|
showUploadList: false,
|
|
4152
4133
|
maxSize: maxImageSize ? 1024 * maxImageSize * 1024 : 0,
|
|
4153
4134
|
limit: fileLimit,
|
|
4154
|
-
onSizeError: ()=>Toast.error(
|
|
4155
|
-
|
|
4135
|
+
onSizeError: ()=>Toast.error(`${i18n_I18n.t('image_size_exceed_max', {
|
|
4136
|
+
maxImageSize
|
|
4137
|
+
})}`),
|
|
4138
|
+
onExceed: ()=>Toast.warning(`${i18n_I18n.t('max_upload_images_limit', {
|
|
4139
|
+
maxFileCount
|
|
4140
|
+
})}`),
|
|
4156
4141
|
multiple: true,
|
|
4157
4142
|
fileList: fileParts.map((it)=>({
|
|
4158
4143
|
uid: it.uid || '',
|
|
@@ -4176,8 +4161,12 @@ const UploadButton = /*#__PURE__*/ forwardRef(({ spaceID, disabled, maxImageSize
|
|
|
4176
4161
|
showUploadList: false,
|
|
4177
4162
|
maxSize: maxVideoSize ? 1024 * maxVideoSize : 0,
|
|
4178
4163
|
limit: fileLimit,
|
|
4179
|
-
onSizeError: ()=>Toast.error(
|
|
4180
|
-
|
|
4164
|
+
onSizeError: ()=>Toast.error(`${i18n_I18n.t('video_size_exceed_max', {
|
|
4165
|
+
maxVideoSize
|
|
4166
|
+
})}`),
|
|
4167
|
+
onExceed: ()=>Toast.warning(`${i18n_I18n.t('max_upload_videos_limit', {
|
|
4168
|
+
maxFileCount
|
|
4169
|
+
})}`),
|
|
4181
4170
|
multiple: true,
|
|
4182
4171
|
fileList: fileParts.map((it)=>({
|
|
4183
4172
|
uid: it.uid || '',
|
|
@@ -4203,14 +4192,14 @@ const UploadButton = /*#__PURE__*/ forwardRef(({ spaceID, disabled, maxImageSize
|
|
|
4203
4192
|
color: "primary",
|
|
4204
4193
|
disabled: disabled,
|
|
4205
4194
|
"data-btm": "d41383",
|
|
4206
|
-
"data-btm-title":
|
|
4195
|
+
"data-btm-title": i18n_I18n.t('image_upload')
|
|
4207
4196
|
}));
|
|
4208
4197
|
if (!imageEnabled && videoEnabled) return renderVideoUpload(/*#__PURE__*/ jsx(IconButton, {
|
|
4209
4198
|
icon: /*#__PURE__*/ jsx(IconCozVideo, {}),
|
|
4210
4199
|
color: "primary",
|
|
4211
4200
|
disabled: disabled,
|
|
4212
4201
|
"data-btm": "d27622",
|
|
4213
|
-
"data-btm-title":
|
|
4202
|
+
"data-btm-title": i18n_I18n.t('video_upload')
|
|
4214
4203
|
}));
|
|
4215
4204
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
4216
4205
|
children: [
|
|
@@ -4223,16 +4212,16 @@ const UploadButton = /*#__PURE__*/ forwardRef(({ spaceID, disabled, maxImageSize
|
|
|
4223
4212
|
uploadImgRef.current?.openFileDialog();
|
|
4224
4213
|
},
|
|
4225
4214
|
"data-btm": "d41383",
|
|
4226
|
-
"data-btm-title":
|
|
4227
|
-
children:
|
|
4215
|
+
"data-btm-title": i18n_I18n.t('image_upload'),
|
|
4216
|
+
children: i18n_I18n.t('image_upload')
|
|
4228
4217
|
}),
|
|
4229
4218
|
/*#__PURE__*/ jsx(Menu.Item, {
|
|
4230
4219
|
onClick: ()=>{
|
|
4231
4220
|
uploadVideoRef.current?.openFileDialog();
|
|
4232
4221
|
},
|
|
4233
4222
|
"data-btm": "d27622",
|
|
4234
|
-
"data-btm-title":
|
|
4235
|
-
children:
|
|
4223
|
+
"data-btm-title": i18n_I18n.t('video_upload'),
|
|
4224
|
+
children: i18n_I18n.t('video_upload')
|
|
4236
4225
|
})
|
|
4237
4226
|
]
|
|
4238
4227
|
}),
|
|
@@ -4431,76 +4420,6 @@ function LoopRadioGroup({ className, ...props }) {
|
|
|
4431
4420
|
...props
|
|
4432
4421
|
});
|
|
4433
4422
|
}
|
|
4434
|
-
const code_item_module = {
|
|
4435
|
-
"usage-detail": "usage-detail-avIFhw",
|
|
4436
|
-
usageDetail: "usage-detail-avIFhw"
|
|
4437
|
-
};
|
|
4438
|
-
var code_usage_SupportedLang = /*#__PURE__*/ function(SupportedLang) {
|
|
4439
|
-
SupportedLang["Golang"] = "go";
|
|
4440
|
-
SupportedLang["Js"] = "javascript";
|
|
4441
|
-
SupportedLang["Python"] = "python";
|
|
4442
|
-
return SupportedLang;
|
|
4443
|
-
}({});
|
|
4444
|
-
const UsageContent = ({ content, copyable, lang = "javascript", height = 300 })=>/*#__PURE__*/ jsxs("div", {
|
|
4445
|
-
className: "bg-[var(--semi-color-fill-0)] p-[16px] rounded-[8px] text-[14px] flex",
|
|
4446
|
-
children: [
|
|
4447
|
-
/*#__PURE__*/ jsx("div", {
|
|
4448
|
-
className: "flex-1 whitespace-pre-wrap break-all",
|
|
4449
|
-
children: /*#__PURE__*/ jsx(_monaco_editor_react, {
|
|
4450
|
-
width: '100%',
|
|
4451
|
-
height: height,
|
|
4452
|
-
language: lang,
|
|
4453
|
-
value: content,
|
|
4454
|
-
theme: 'code-block-grey',
|
|
4455
|
-
options: {
|
|
4456
|
-
minimap: {
|
|
4457
|
-
enabled: false
|
|
4458
|
-
},
|
|
4459
|
-
wordWrap: 'on',
|
|
4460
|
-
scrollBeyondLastLine: false,
|
|
4461
|
-
unicodeHighlight: {
|
|
4462
|
-
ambiguousCharacters: false
|
|
4463
|
-
},
|
|
4464
|
-
lineNumbers: 'on',
|
|
4465
|
-
formatOnPaste: true,
|
|
4466
|
-
readOnly: true
|
|
4467
|
-
},
|
|
4468
|
-
beforeMount: (monaco)=>{
|
|
4469
|
-
monaco.editor.defineTheme('code-block-grey', {
|
|
4470
|
-
base: 'vs',
|
|
4471
|
-
inherit: true,
|
|
4472
|
-
rules: [],
|
|
4473
|
-
colors: {
|
|
4474
|
-
'editor.background': '#F4F4F4'
|
|
4475
|
-
}
|
|
4476
|
-
});
|
|
4477
|
-
}
|
|
4478
|
-
})
|
|
4479
|
-
}),
|
|
4480
|
-
/*#__PURE__*/ jsx("div", {
|
|
4481
|
-
className: "ml-[8px]",
|
|
4482
|
-
children: copyable ? /*#__PURE__*/ jsx(IconCozCopy, {
|
|
4483
|
-
className: "ml-[4px] text-[var(--coz-fg-dim)] cursor-pointer hover:coz-fg-primary",
|
|
4484
|
-
onClick: ()=>handleCopy(content || '')
|
|
4485
|
-
}) : null
|
|
4486
|
-
})
|
|
4487
|
-
]
|
|
4488
|
-
});
|
|
4489
|
-
const UsageItem = ({ title, content, lang, contentHeight })=>/*#__PURE__*/ jsxs("div", {
|
|
4490
|
-
className: code_item_module["usage-detail"],
|
|
4491
|
-
children: [
|
|
4492
|
-
/*#__PURE__*/ jsx("div", {
|
|
4493
|
-
className: "text-[#16px] font-[500] mb-4",
|
|
4494
|
-
children: title
|
|
4495
|
-
}),
|
|
4496
|
-
content ? /*#__PURE__*/ jsx(UsageContent, {
|
|
4497
|
-
content: content,
|
|
4498
|
-
copyable: true,
|
|
4499
|
-
lang: lang,
|
|
4500
|
-
height: contentHeight
|
|
4501
|
-
}) : null
|
|
4502
|
-
]
|
|
4503
|
-
});
|
|
4504
4423
|
const layout_index_module = {
|
|
4505
4424
|
tabs: "tabs-GNhC2M"
|
|
4506
4425
|
};
|
|
@@ -4535,78 +4454,6 @@ const Layout = {
|
|
|
4535
4454
|
Content: Content,
|
|
4536
4455
|
Tabs: tabs_Tabs
|
|
4537
4456
|
};
|
|
4538
|
-
const stringifyObjectValue = (value)=>Object.keys(value).reduce((acc, key)=>{
|
|
4539
|
-
const val = value[key];
|
|
4540
|
-
if ('object' == typeof val) acc[key] = JSON.stringify(val);
|
|
4541
|
-
else acc[key] = val;
|
|
4542
|
-
return acc;
|
|
4543
|
-
}, {});
|
|
4544
|
-
const parseObjectValue = (data)=>Object.keys(data).reduce((acc, key)=>{
|
|
4545
|
-
const value = data[key];
|
|
4546
|
-
if (value.startsWith('{') || value.startsWith('[')) acc[key] = safeJsonParse(value) || value;
|
|
4547
|
-
else acc[key] = value;
|
|
4548
|
-
return acc;
|
|
4549
|
-
}, {});
|
|
4550
|
-
const SearchForm = /*#__PURE__*/ forwardRef(({ className, children, onSearch, SemiForm, initValue = {} }, ref)=>{
|
|
4551
|
-
const formRef = useRef(null);
|
|
4552
|
-
const [initValueAndParams] = useState(()=>{
|
|
4553
|
-
const params = new URLSearchParams(window.location.search);
|
|
4554
|
-
const initParams = {};
|
|
4555
|
-
params.forEach((value, key)=>{
|
|
4556
|
-
initParams[key] = value;
|
|
4557
|
-
});
|
|
4558
|
-
const urlValues = parseObjectValue(initParams);
|
|
4559
|
-
const defaultValue = {
|
|
4560
|
-
...initValue,
|
|
4561
|
-
...urlValues
|
|
4562
|
-
};
|
|
4563
|
-
const defaultSearchParams = new URLSearchParams(stringifyObjectValue(defaultValue));
|
|
4564
|
-
const filterValue = omit(defaultValue, [
|
|
4565
|
-
'page',
|
|
4566
|
-
'pageSize'
|
|
4567
|
-
]);
|
|
4568
|
-
if (0 !== Object.keys(filterValue).length) onSearch?.(filterValue);
|
|
4569
|
-
return {
|
|
4570
|
-
defaultValue: filterValue,
|
|
4571
|
-
defaultSearchParams
|
|
4572
|
-
};
|
|
4573
|
-
});
|
|
4574
|
-
const [searchParams, setSearchParams] = useSearchParams();
|
|
4575
|
-
const formValueChange = useCallback((allValues)=>{
|
|
4576
|
-
const searchResult = onSearch?.(allValues);
|
|
4577
|
-
searchResult?.then(()=>{
|
|
4578
|
-
setSearchParams((prev)=>{
|
|
4579
|
-
const v = stringifyObjectValue(allValues || {});
|
|
4580
|
-
prev.forEach((_value, key)=>{
|
|
4581
|
-
if (![
|
|
4582
|
-
'page',
|
|
4583
|
-
'pageSize',
|
|
4584
|
-
'tab'
|
|
4585
|
-
].includes(key)) prev.delete(key);
|
|
4586
|
-
});
|
|
4587
|
-
Object.keys(v).forEach((key)=>{
|
|
4588
|
-
prev.set(key, v[key]);
|
|
4589
|
-
});
|
|
4590
|
-
return prev;
|
|
4591
|
-
}, {
|
|
4592
|
-
replace: true
|
|
4593
|
-
});
|
|
4594
|
-
});
|
|
4595
|
-
}, [
|
|
4596
|
-
searchParams
|
|
4597
|
-
]);
|
|
4598
|
-
useImperativeHandle(ref, ()=>({
|
|
4599
|
-
getValues: ()=>formRef.current?.formApi?.getValues?.()
|
|
4600
|
-
}));
|
|
4601
|
-
return children ? /*#__PURE__*/ jsx(SemiForm, {
|
|
4602
|
-
ref: formRef,
|
|
4603
|
-
initValues: initValueAndParams.defaultValue,
|
|
4604
|
-
onValueChange: formValueChange,
|
|
4605
|
-
layout: "horizontal",
|
|
4606
|
-
className: className,
|
|
4607
|
-
children: children
|
|
4608
|
-
}) : null;
|
|
4609
|
-
});
|
|
4610
4457
|
function TitleWithSub({ title, subTitle, className }) {
|
|
4611
4458
|
return /*#__PURE__*/ jsxs(Space, {
|
|
4612
4459
|
align: "center",
|
|
@@ -4627,30 +4474,28 @@ function TitleWithSub({ title, subTitle, className }) {
|
|
|
4627
4474
|
});
|
|
4628
4475
|
}
|
|
4629
4476
|
function FooterActions({ confirmBtnProps: { text: confirmBtnText, ...confirmBtnProps } = {}, cancelBtnProps: { text: cancelBtnText, ...cancelBtnProps } = {} }) {
|
|
4630
|
-
const I18n = useI18n();
|
|
4631
4477
|
return /*#__PURE__*/ jsxs("div", {
|
|
4632
4478
|
className: "flex justify-end",
|
|
4633
4479
|
children: [
|
|
4634
4480
|
/*#__PURE__*/ jsx(Button, {
|
|
4635
4481
|
color: "primary",
|
|
4636
4482
|
...cancelBtnProps,
|
|
4637
|
-
children: cancelBtnText ??
|
|
4483
|
+
children: cancelBtnText ?? i18n_I18n.t('cancel')
|
|
4638
4484
|
}),
|
|
4639
4485
|
/*#__PURE__*/ jsx(Button, {
|
|
4640
4486
|
className: "ml-2",
|
|
4641
4487
|
...confirmBtnProps,
|
|
4642
|
-
children: confirmBtnText ??
|
|
4488
|
+
children: confirmBtnText ?? i18n_I18n.t('global_btn_confirm')
|
|
4643
4489
|
})
|
|
4644
4490
|
]
|
|
4645
4491
|
});
|
|
4646
4492
|
}
|
|
4647
4493
|
function TableEmpty({ className, ...props }) {
|
|
4648
|
-
const I18n = useI18n();
|
|
4649
4494
|
return /*#__PURE__*/ jsx(EmptyState, {
|
|
4650
4495
|
className: classnames('my-10', className),
|
|
4651
4496
|
icon: /*#__PURE__*/ jsx(IconCozIllusNone, {}),
|
|
4652
4497
|
darkModeIcon: /*#__PURE__*/ jsx(IconCozIllusNoneDark, {}),
|
|
4653
|
-
description:
|
|
4498
|
+
description: i18n_I18n.t('no_data'),
|
|
4654
4499
|
...props
|
|
4655
4500
|
});
|
|
4656
4501
|
}
|
|
@@ -5268,15 +5113,14 @@ const ResizableSideSheet = (props)=>{
|
|
|
5268
5113
|
]
|
|
5269
5114
|
});
|
|
5270
5115
|
};
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
}({});
|
|
5116
|
+
function safeStringify(obj) {
|
|
5117
|
+
return JSON.stringify(obj, (_, value)=>{
|
|
5118
|
+
if (/*#__PURE__*/ isValidElement(value)) return '[ReactElement]';
|
|
5119
|
+
if ('function' == typeof value) return '[Function]';
|
|
5120
|
+
if (value instanceof HTMLElement) return '[HTMLElement]';
|
|
5121
|
+
return value;
|
|
5122
|
+
});
|
|
5123
|
+
}
|
|
5280
5124
|
const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormApi, ...props }, ref)=>{
|
|
5281
5125
|
const sendEvent = useReportEvent();
|
|
5282
5126
|
const sessionID = useMemo(()=>nanoid(), []);
|
|
@@ -5294,7 +5138,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5294
5138
|
validateErrorCount.current = validateErrorCount.current + 1;
|
|
5295
5139
|
const validateErrorTime = Date.now();
|
|
5296
5140
|
const errorKeys = Object.keys(error) || [];
|
|
5297
|
-
sendEvent(
|
|
5141
|
+
sendEvent("loop_form_field_validate_error", {
|
|
5298
5142
|
form_id: formID,
|
|
5299
5143
|
session_id: sessionID,
|
|
5300
5144
|
form_item_error_count: errorKeys.length,
|
|
@@ -5308,7 +5152,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5308
5152
|
if (isInterfaceError) {
|
|
5309
5153
|
firstValidateSuccess.current = false;
|
|
5310
5154
|
interfaceErrorCount.current = interfaceErrorCount.current + 1;
|
|
5311
|
-
sendEvent?.(
|
|
5155
|
+
sendEvent?.("loop_form_submit_interface_error", {
|
|
5312
5156
|
form_id: formID,
|
|
5313
5157
|
session_id: sessionID,
|
|
5314
5158
|
form_interface_error_detail: JSON.stringify(error || {}),
|
|
@@ -5322,7 +5166,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5322
5166
|
const formItemShow = Object.keys(values);
|
|
5323
5167
|
const formItemFilled = formItemShow.filter((key)=>values[key]);
|
|
5324
5168
|
const successTime = Date.now();
|
|
5325
|
-
sendEvent?.(
|
|
5169
|
+
sendEvent?.("loop_form_submit_success", {
|
|
5326
5170
|
form_id: formID,
|
|
5327
5171
|
session_id: sessionID,
|
|
5328
5172
|
form_complete_consume_time: Date.now() - startTimeRef.current,
|
|
@@ -5331,7 +5175,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5331
5175
|
form_item_filled: JSON.stringify(formItemFilled),
|
|
5332
5176
|
form_item_show: JSON.stringify(formItemShow),
|
|
5333
5177
|
form_item_used_percent: formItemFilled.length / formItemShow.length,
|
|
5334
|
-
form_values:
|
|
5178
|
+
form_values: safeStringify(values),
|
|
5335
5179
|
time: successTime,
|
|
5336
5180
|
time_str: dayjs(successTime).format('YYYY-MM-DD HH:mm:ss')
|
|
5337
5181
|
});
|
|
@@ -5368,6 +5212,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5368
5212
|
const formIdRef = useRef(formID);
|
|
5369
5213
|
const sessionIdRef = useRef(sessionID);
|
|
5370
5214
|
const flushedRef = useRef(false);
|
|
5215
|
+
const latestValuesRef = useRef('');
|
|
5371
5216
|
useEffect(()=>{
|
|
5372
5217
|
formIdRef.current = formID;
|
|
5373
5218
|
}, [
|
|
@@ -5429,7 +5274,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5429
5274
|
};
|
|
5430
5275
|
const onFormClose = ()=>{
|
|
5431
5276
|
const closeTime = Date.now();
|
|
5432
|
-
sendEvent?.(
|
|
5277
|
+
sendEvent?.("loop_form_close", {
|
|
5433
5278
|
form_id: formIdRef.current,
|
|
5434
5279
|
session_id: sessionIdRef.current,
|
|
5435
5280
|
form_no_operation: noOperation.current,
|
|
@@ -5437,14 +5282,17 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5437
5282
|
form_operation_submit_success: submitSuccess.current,
|
|
5438
5283
|
form_request_error_times: interfaceErrorCount.current,
|
|
5439
5284
|
form_item_error_times: validateErrorCount.current,
|
|
5285
|
+
form_values: latestValuesRef.current,
|
|
5440
5286
|
time: closeTime,
|
|
5441
5287
|
time_str: dayjs(closeTime).format('YYYY-MM-DD HH:mm:ss')
|
|
5442
5288
|
});
|
|
5443
5289
|
};
|
|
5444
|
-
const onFormCloseDobounce = useDebounceFn(onFormClose, {
|
|
5445
|
-
wait: 200
|
|
5446
|
-
});
|
|
5447
5290
|
const onValuesChange = (values, changedValues)=>{
|
|
5291
|
+
try {
|
|
5292
|
+
latestValuesRef.current = safeStringify(values);
|
|
5293
|
+
} catch (err) {
|
|
5294
|
+
console.error(err);
|
|
5295
|
+
}
|
|
5448
5296
|
handleValueChange(changedValues);
|
|
5449
5297
|
onValueChange?.(values, changedValues);
|
|
5450
5298
|
};
|
|
@@ -5469,7 +5317,7 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5469
5317
|
useEffect(()=>{
|
|
5470
5318
|
if (sessionID && formID) {
|
|
5471
5319
|
const initTime = Date.now();
|
|
5472
|
-
sendEvent?.(
|
|
5320
|
+
sendEvent?.("init_loop_form", {
|
|
5473
5321
|
form_id: formID,
|
|
5474
5322
|
session_id: sessionID,
|
|
5475
5323
|
time: initTime,
|
|
@@ -5479,12 +5327,17 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5479
5327
|
return ()=>{
|
|
5480
5328
|
if (formID && sessionID && !flushedRef.current) {
|
|
5481
5329
|
flushedRef.current = true;
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5330
|
+
try {
|
|
5331
|
+
sendEvent?.("loop_form_field_change_timeline", {
|
|
5332
|
+
form_id: formID,
|
|
5333
|
+
session_id: sessionID,
|
|
5334
|
+
time_line: JSON.stringify(operationTimelineRef.current)
|
|
5335
|
+
});
|
|
5336
|
+
} catch (err) {
|
|
5337
|
+
console.error(err);
|
|
5338
|
+
} finally{
|
|
5339
|
+
onFormClose();
|
|
5340
|
+
}
|
|
5488
5341
|
}
|
|
5489
5342
|
};
|
|
5490
5343
|
}, [
|
|
@@ -5498,12 +5351,17 @@ const SentinelFormInner = ({ formID, children, onValueChange, onSubmit, getFormA
|
|
|
5498
5351
|
const sid = sessionIdRef.current;
|
|
5499
5352
|
if (!fid || !sid) return;
|
|
5500
5353
|
flushedRef.current = true;
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5354
|
+
try {
|
|
5355
|
+
sendEvent?.("loop_form_field_change_timeline", {
|
|
5356
|
+
form_id: fid,
|
|
5357
|
+
session_id: sid,
|
|
5358
|
+
time_line: JSON.stringify(operationTimelineRef.current)
|
|
5359
|
+
});
|
|
5360
|
+
} catch (err) {
|
|
5361
|
+
console.error(err);
|
|
5362
|
+
} finally{
|
|
5363
|
+
onFormClose();
|
|
5364
|
+
}
|
|
5507
5365
|
};
|
|
5508
5366
|
window.addEventListener('pagehide', flushOnClose);
|
|
5509
5367
|
window.addEventListener('beforeunload', flushOnClose);
|
|
@@ -5797,6 +5655,11 @@ languages.register('json', {
|
|
|
5797
5655
|
languageService: json.languageService
|
|
5798
5656
|
});
|
|
5799
5657
|
languages.register('shell', shell);
|
|
5658
|
+
languages.register('python', python);
|
|
5659
|
+
languages.register("typescript", typescript);
|
|
5660
|
+
languages.register('go', {
|
|
5661
|
+
language: goLanguage
|
|
5662
|
+
});
|
|
5800
5663
|
themes.register('coze-light', cozeLight);
|
|
5801
5664
|
themes.register('coze-dark', cozeDark);
|
|
5802
5665
|
const minHeightOption = (value)=>EditorView.theme({
|
|
@@ -5836,7 +5699,7 @@ function createStyleOptions() {
|
|
|
5836
5699
|
return [
|
|
5837
5700
|
react_option('minHeight', minHeightOption),
|
|
5838
5701
|
react_option('maxHeight', maxHeightOption),
|
|
5839
|
-
react_option('
|
|
5702
|
+
react_option('editorHeight', heightOption),
|
|
5840
5703
|
react_option('borderRadius', borderRadiusOption),
|
|
5841
5704
|
react_option('padding', paddingOption),
|
|
5842
5705
|
react_option('lineHeight', lineHeightOption)
|
|
@@ -5930,15 +5793,20 @@ const transformer = transformerCreator((text)=>{
|
|
|
5930
5793
|
return text;
|
|
5931
5794
|
});
|
|
5932
5795
|
const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
5933
|
-
const { value, onChange, placeholder, className, isDarkTheme, readonly, minHeight = '100px', maxHeight,
|
|
5796
|
+
const { value, onChange, placeholder, className, isDarkTheme, readonly, minHeight = '100px', maxHeight, editorHeight, padding, borderRadius, onFocus, onBlur } = props;
|
|
5934
5797
|
const apiRef = useRef(null);
|
|
5935
5798
|
const handleChange = useCallback((e)=>{
|
|
5936
5799
|
if ('function' == typeof onChange) onChange(e.value);
|
|
5937
5800
|
}, [
|
|
5938
5801
|
onChange
|
|
5939
5802
|
]);
|
|
5940
|
-
|
|
5803
|
+
const updateAst = useDebounceFn(()=>{
|
|
5941
5804
|
apiRef.current?.updateASTDecorations();
|
|
5805
|
+
}, {
|
|
5806
|
+
wait: 200
|
|
5807
|
+
});
|
|
5808
|
+
useEffect(()=>{
|
|
5809
|
+
updateAst.run();
|
|
5942
5810
|
}, [
|
|
5943
5811
|
isDarkTheme
|
|
5944
5812
|
]);
|
|
@@ -5971,10 +5839,10 @@ const CodeMirrorJsonEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
|
5971
5839
|
theme: isDarkTheme ? 'coze-dark' : 'coze-light',
|
|
5972
5840
|
languageId: 'json',
|
|
5973
5841
|
editable: !readonly,
|
|
5974
|
-
transformer,
|
|
5842
|
+
transformer: transformer,
|
|
5975
5843
|
minHeight,
|
|
5976
5844
|
maxHeight,
|
|
5977
|
-
|
|
5845
|
+
editorHeight,
|
|
5978
5846
|
borderRadius,
|
|
5979
5847
|
padding,
|
|
5980
5848
|
fontSize: 13,
|
|
@@ -6023,6 +5891,106 @@ const CodeMirrorRawTextEditor = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
6023
5891
|
})
|
|
6024
5892
|
});
|
|
6025
5893
|
});
|
|
5894
|
+
const raw_code_editor_extensions = [
|
|
5895
|
+
EditorView.theme({
|
|
5896
|
+
'.cm-activeLineGutter': {
|
|
5897
|
+
backgroundColor: 'transparent !important'
|
|
5898
|
+
},
|
|
5899
|
+
'.cm-activeLine': {
|
|
5900
|
+
backgroundColor: 'transparent !important'
|
|
5901
|
+
}
|
|
5902
|
+
})
|
|
5903
|
+
];
|
|
5904
|
+
function raw_code_editor_findAllMatches(inputString, regex) {
|
|
5905
|
+
const globalRegex = new RegExp(regex, regex.flags.includes('g') ? regex.flags : `${regex.flags}g`);
|
|
5906
|
+
let match;
|
|
5907
|
+
const matches = [];
|
|
5908
|
+
while(true){
|
|
5909
|
+
match = globalRegex.exec(inputString);
|
|
5910
|
+
if (!match) break;
|
|
5911
|
+
if (match.index === globalRegex.lastIndex) globalRegex.lastIndex++;
|
|
5912
|
+
matches.push({
|
|
5913
|
+
match: match[0],
|
|
5914
|
+
range: [
|
|
5915
|
+
match.index,
|
|
5916
|
+
match.index + match[0].length
|
|
5917
|
+
]
|
|
5918
|
+
});
|
|
5919
|
+
}
|
|
5920
|
+
return matches;
|
|
5921
|
+
}
|
|
5922
|
+
const raw_code_editor_transformer = transformerCreator((text)=>{
|
|
5923
|
+
const originalSource = text.toString();
|
|
5924
|
+
const matches = raw_code_editor_findAllMatches(originalSource, /\{\{([^\}]*)\}\}/g);
|
|
5925
|
+
if (matches.length > 0) matches.forEach(({ range })=>{
|
|
5926
|
+
text.replaceRange(range[0], range[1], 'null');
|
|
5927
|
+
});
|
|
5928
|
+
return text;
|
|
5929
|
+
});
|
|
5930
|
+
const CodeMirrorRawCodeEditor = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
5931
|
+
const { value, onChange, placeholder, className, isDarkTheme, readonly, minHeight = '100px', maxHeight, editorHeight, padding, borderRadius, onFocus, onBlur, language = 'shell' } = props;
|
|
5932
|
+
const apiRef = useRef(null);
|
|
5933
|
+
const handleChange = useCallback((e)=>{
|
|
5934
|
+
if ('function' == typeof onChange) onChange(e.value);
|
|
5935
|
+
}, [
|
|
5936
|
+
onChange
|
|
5937
|
+
]);
|
|
5938
|
+
const updateAst = useDebounceFn(()=>{
|
|
5939
|
+
apiRef.current?.updateASTDecorations();
|
|
5940
|
+
}, {
|
|
5941
|
+
wait: 200
|
|
5942
|
+
});
|
|
5943
|
+
useEffect(()=>{
|
|
5944
|
+
updateAst.run();
|
|
5945
|
+
}, [
|
|
5946
|
+
isDarkTheme
|
|
5947
|
+
]);
|
|
5948
|
+
useEffect(()=>{
|
|
5949
|
+
const editor = apiRef.current;
|
|
5950
|
+
if (!editor) return;
|
|
5951
|
+
if ('string' == typeof value && value !== editor.getValue()) editor.setValue(value);
|
|
5952
|
+
}, [
|
|
5953
|
+
value
|
|
5954
|
+
]);
|
|
5955
|
+
const formatJson = async ()=>{
|
|
5956
|
+
const view = apiRef.current?.$view;
|
|
5957
|
+
if (!view) return;
|
|
5958
|
+
view.dispatch(await json.languageService.format(view.state, {
|
|
5959
|
+
tabSize: 2
|
|
5960
|
+
}));
|
|
5961
|
+
};
|
|
5962
|
+
useImperativeHandle(ref, ()=>({
|
|
5963
|
+
formatJson
|
|
5964
|
+
}));
|
|
5965
|
+
return /*#__PURE__*/ jsx(EditorProvider, {
|
|
5966
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
5967
|
+
className: className,
|
|
5968
|
+
children: /*#__PURE__*/ jsx(CodeMirrorCodeEditor, {
|
|
5969
|
+
defaultValue: value ?? '',
|
|
5970
|
+
onChange: handleChange,
|
|
5971
|
+
options: {
|
|
5972
|
+
placeholder,
|
|
5973
|
+
lineWrapping: true,
|
|
5974
|
+
theme: isDarkTheme ? 'coze-dark' : 'coze-light',
|
|
5975
|
+
languageId: language,
|
|
5976
|
+
editable: !readonly,
|
|
5977
|
+
transformer: raw_code_editor_transformer,
|
|
5978
|
+
minHeight,
|
|
5979
|
+
maxHeight,
|
|
5980
|
+
editorHeight,
|
|
5981
|
+
borderRadius,
|
|
5982
|
+
padding,
|
|
5983
|
+
fontSize: 13,
|
|
5984
|
+
lineHeight: 20
|
|
5985
|
+
},
|
|
5986
|
+
didMount: (api)=>apiRef.current = api,
|
|
5987
|
+
extensions: raw_code_editor_extensions,
|
|
5988
|
+
onFocus: onFocus,
|
|
5989
|
+
onBlur: onBlur
|
|
5990
|
+
})
|
|
5991
|
+
})
|
|
5992
|
+
});
|
|
5993
|
+
});
|
|
6026
5994
|
const SchemaEditor = ({ value, onChange, placeholder, readOnly, language, className })=>/*#__PURE__*/ jsx("div", {
|
|
6027
5995
|
className: classnames('w-full h-[500px] border border-solid coz-stroke-primary rounded-[4px] overflow-hidden relative bg-white', {
|
|
6028
5996
|
'opacity-70': readOnly
|
|
@@ -6042,4 +6010,80 @@ const SchemaEditor = ({ value, onChange, placeholder, readOnly, language, classN
|
|
|
6042
6010
|
readonly: readOnly
|
|
6043
6011
|
})
|
|
6044
6012
|
});
|
|
6045
|
-
|
|
6013
|
+
const code_editor_with_loading_index_module = {
|
|
6014
|
+
"code-container": "code-container-A_QOb1",
|
|
6015
|
+
codeContainer: "code-container-A_QOb1"
|
|
6016
|
+
};
|
|
6017
|
+
const codeOptionsConfig = {
|
|
6018
|
+
lineNumbersMinChars: 3,
|
|
6019
|
+
automaticLayout: true,
|
|
6020
|
+
scrollBeyondLastLine: false,
|
|
6021
|
+
renderLineHighlight: 'none',
|
|
6022
|
+
tabSize: 2,
|
|
6023
|
+
insertSpaces: true,
|
|
6024
|
+
minimap: {
|
|
6025
|
+
enabled: false
|
|
6026
|
+
}
|
|
6027
|
+
};
|
|
6028
|
+
const CodeEditorWithLoading = ({ value, onChange, disabled, className })=>{
|
|
6029
|
+
const [loading, setLoading] = useState(true);
|
|
6030
|
+
const LoadingNode = loading && /*#__PURE__*/ jsx("div", {
|
|
6031
|
+
className: "absolute bg-[white] z-20 top-0 bottom-0 left-0 right-0 flex items-center justify-center",
|
|
6032
|
+
children: /*#__PURE__*/ jsx(Loading, {
|
|
6033
|
+
loading: true
|
|
6034
|
+
})
|
|
6035
|
+
});
|
|
6036
|
+
const onEditorMount = ()=>{
|
|
6037
|
+
setLoading(false);
|
|
6038
|
+
};
|
|
6039
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
6040
|
+
className: classnames(code_editor_with_loading_index_module["code-container"], className),
|
|
6041
|
+
children: [
|
|
6042
|
+
LoadingNode,
|
|
6043
|
+
/*#__PURE__*/ jsx(_monaco_editor_react, {
|
|
6044
|
+
language: 'json',
|
|
6045
|
+
value: value,
|
|
6046
|
+
options: {
|
|
6047
|
+
readOnly: disabled,
|
|
6048
|
+
...codeOptionsConfig
|
|
6049
|
+
},
|
|
6050
|
+
onMount: onEditorMount,
|
|
6051
|
+
theme: "vs-dark",
|
|
6052
|
+
onChange: (newValue)=>{
|
|
6053
|
+
onChange?.(newValue || '');
|
|
6054
|
+
}
|
|
6055
|
+
})
|
|
6056
|
+
]
|
|
6057
|
+
});
|
|
6058
|
+
};
|
|
6059
|
+
const CollapseItem = ({ children, open: defaultOpen, title, className })=>{
|
|
6060
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
6061
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
6062
|
+
className: className,
|
|
6063
|
+
children: [
|
|
6064
|
+
/*#__PURE__*/ jsxs("div", {
|
|
6065
|
+
className: "h-5 flex flex-row items-center cursor-pointer text-sm coz-fg-primary font-semibold",
|
|
6066
|
+
onClick: ()=>setOpen((pre)=>!pre),
|
|
6067
|
+
children: [
|
|
6068
|
+
title,
|
|
6069
|
+
/*#__PURE__*/ jsx(IconCozArrowRight, {
|
|
6070
|
+
className: classnames('h-4 w-4 ml-2 coz-fg-plus transition-transform', open ? 'rotate-90' : '')
|
|
6071
|
+
})
|
|
6072
|
+
]
|
|
6073
|
+
}),
|
|
6074
|
+
/*#__PURE__*/ jsx("div", {
|
|
6075
|
+
className: open ? '' : 'hidden',
|
|
6076
|
+
children: children
|
|
6077
|
+
})
|
|
6078
|
+
]
|
|
6079
|
+
});
|
|
6080
|
+
};
|
|
6081
|
+
function src_useReportEvent() {
|
|
6082
|
+
return (name, params)=>{
|
|
6083
|
+
console.info(name, params);
|
|
6084
|
+
};
|
|
6085
|
+
}
|
|
6086
|
+
var src_DEFAULT_FILE_COUNT = 20;
|
|
6087
|
+
var src_DEFAULT_PART_COUNT = 50;
|
|
6088
|
+
export { default as schemaValidators } from "@rjsf/validator-ajv8";
|
|
6089
|
+
export { BasicCard, CardPane, ChipSelect, CodeEditorWithLoading, CodeMirrorCodeEditor, CodeMirrorJsonEditor, CodeMirrorRawCodeEditor, CodeMirrorRawTextEditor, CodeMirrorTextEditor, CollapseCard, CollapseItem, ColumnSelector, Copyable, DEFAULT_FILE_SIZE, DEFAULT_PAGE_SIZE, DEFAULT_SUPPORTED_FORMATS, DEFAULT_VIDEO_SUPPORTED_FORMATS, DiffEditor, EditIconButton, EditorProvider, FooterActions, FullPage, IDRender, IconButtonContainer, ImageItemRenderer, IndexControllerView, InfiniteScrollTable, InfoTooltip, InputSlider, InputWithCount, JumpIconButton, LargeTxtRender, Layout, LazyLoadComponent, LogicEditor, LogicExpr, LoopRadioGroup, LoopTable, LoopTabs, MultiPartRender, MultipartEditor, OpenDetailButton, PAGE_SIZE_OPTIONS, PageError, PageLoading, PageNoAuth, PageNoContent, PageNotFound, PrimaryPage, PrimaryTitle, RadioButton, ResizableSideSheet, ResizeSidesheet, SchemaEditor, SemiSchemaForm, SentinelForm, StepNav, TableBatchOperate, TableColActions, TableColsConfig, TableEmpty, TableHeader, TableWithPagination, TableWithoutPagination, TextAreaPro, TextWithCopy, TitleWithSub, TooltipWhenDisabled, TooltipWithDisabled, UploadButton, UserProfile, VersionItem, VersionList, VersionSwitchPanel, VideoItemRenderer, _monaco_editor_react as CodeEditor, base_search_form_select as BaseSearchFormSelect, base_search_select as BaseSearchSelect, dealColumnsWithStorage, formateDecimalPlacesString, getColumnManageStorage, getStoragePageSize, handleCopy, setColumnsManageStorage, sleep, src_DEFAULT_FILE_COUNT as DEFAULT_FILE_COUNT, src_DEFAULT_PART_COUNT as DEFAULT_PART_COUNT, src_useReportEvent as useReportEvent, type_ImageStatus as MultipartRenderStatus, upload_uploadFile as uploadFile, useBatchOperate, useItemIndexController, useUnsaveLeaveWarning };
|