@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,103 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { type ContentPart } from '@cozeloop/api-schema/prompt';
|
|
3
|
-
import {
|
|
4
|
-
type Content,
|
|
5
|
-
type Image,
|
|
6
|
-
type ContentType,
|
|
7
|
-
} from '@cozeloop/api-schema/evaluation';
|
|
8
|
-
import { ItemErrorType, type MultiModalSpec } from '@cozeloop/api-schema/data';
|
|
9
|
-
|
|
10
|
-
export enum ImageStatus {
|
|
11
|
-
Loading = 'loading',
|
|
12
|
-
Success = 'success',
|
|
13
|
-
Error = 'error',
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type FileItemStatus =
|
|
17
|
-
| 'success'
|
|
18
|
-
| 'uploadFail'
|
|
19
|
-
| 'validateFail'
|
|
20
|
-
| 'validating'
|
|
21
|
-
| 'uploading'
|
|
22
|
-
| 'wait';
|
|
23
|
-
|
|
24
|
-
export interface ContentPartLoop extends ContentPart {
|
|
25
|
-
uid?: string;
|
|
26
|
-
status?: FileItemStatus;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const ErrorTypeMap = {
|
|
30
|
-
[ItemErrorType.MismatchSchema]: 'schema 不匹配',
|
|
31
|
-
[ItemErrorType.EmptyData]: '空数据',
|
|
32
|
-
[ItemErrorType.ExceedMaxItemSize]: '单条数据大小超限',
|
|
33
|
-
[ItemErrorType.ExceedDatasetCapacity]: '数据集容量超限',
|
|
34
|
-
[ItemErrorType.MalformedFile]: '文件格式错误',
|
|
35
|
-
[ItemErrorType.InternalError]: '系统错误',
|
|
36
|
-
[ItemErrorType.IllegalContent]: '包含非法内容',
|
|
37
|
-
[ItemErrorType.MissingRequiredField]: '缺少必填字段',
|
|
38
|
-
[ItemErrorType.ExceedMaxNestedDepth]: '数据嵌套层数超限',
|
|
39
|
-
[ItemErrorType.TransformItemFailed]: '数据转换失败',
|
|
40
|
-
[ItemErrorType.ExceedMaxImageCount]: '图片数量超限',
|
|
41
|
-
[ItemErrorType.ExceedMaxImageSize]: '图片大小超限',
|
|
42
|
-
[ItemErrorType.GetImageFailed]: '图片获取失败',
|
|
43
|
-
[ItemErrorType.IllegalExtension]: '文件扩展名不合法',
|
|
44
|
-
[ItemErrorType.UploadImageFailed]: '上传图片失败',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export type MultipartItemContentType = ContentType | 'Video';
|
|
48
|
-
export interface MultipartItem extends Omit<Content, 'content_type'> {
|
|
49
|
-
uid?: string;
|
|
50
|
-
sourceImage?: {
|
|
51
|
-
status: ImageStatus;
|
|
52
|
-
file?: File;
|
|
53
|
-
};
|
|
54
|
-
sourceVideo?: {
|
|
55
|
-
status: ImageStatus;
|
|
56
|
-
file?: File;
|
|
57
|
-
};
|
|
58
|
-
video?: Image;
|
|
59
|
-
content_type: MultipartItemContentType;
|
|
60
|
-
config?: {
|
|
61
|
-
image_resolution?: string;
|
|
62
|
-
video_fps?: number;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ImageField {
|
|
67
|
-
name?: string;
|
|
68
|
-
url?: string;
|
|
69
|
-
uri?: string;
|
|
70
|
-
thumb_url?: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface UploadAttachmentDetail {
|
|
74
|
-
contentType?: ContentType;
|
|
75
|
-
originImage?: ImageField;
|
|
76
|
-
image?: ImageField;
|
|
77
|
-
errorType?: ItemErrorType;
|
|
78
|
-
errMsg?: string;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export type MultipartEditorConfig = MultiModalSpec & {
|
|
82
|
-
imageEnabled?: boolean;
|
|
83
|
-
imageSupportedFormats?: string[];
|
|
84
|
-
videoEnabled?: boolean;
|
|
85
|
-
videoSupportedFormats?: string[];
|
|
86
|
-
maxVideoSize?: number;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export interface MultipartEditorProps {
|
|
90
|
-
spaceID?: Int64;
|
|
91
|
-
className?: string;
|
|
92
|
-
value?: MultipartItem[];
|
|
93
|
-
multipartConfig?: MultipartEditorConfig;
|
|
94
|
-
readonly?: boolean;
|
|
95
|
-
onChange?: (contents: MultipartItem[]) => void;
|
|
96
|
-
uploadFile?: (params: any) => Promise<string>;
|
|
97
|
-
uploadImageUrl?: (
|
|
98
|
-
urls: string[],
|
|
99
|
-
) => Promise<UploadAttachmentDetail[] | undefined>;
|
|
100
|
-
imageHidden?: boolean;
|
|
101
|
-
videoHidden?: boolean;
|
|
102
|
-
intranetUrlValidator?: (url: string) => boolean;
|
|
103
|
-
}
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @coze-arch/max-line-per-function */
|
|
2
|
-
import { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
|
3
|
-
|
|
4
|
-
import { ContentType } from '@cozeloop/api-schema/prompt';
|
|
5
|
-
import {
|
|
6
|
-
IconCozImage,
|
|
7
|
-
IconCozImageArrowUp,
|
|
8
|
-
IconCozVideo,
|
|
9
|
-
} from '@coze-arch/coze-design/icons';
|
|
10
|
-
import {
|
|
11
|
-
IconButton,
|
|
12
|
-
Menu,
|
|
13
|
-
Toast,
|
|
14
|
-
Upload,
|
|
15
|
-
type UploadProps,
|
|
16
|
-
} from '@coze-arch/coze-design';
|
|
17
|
-
|
|
18
|
-
import { type ContentPartLoop } from './type';
|
|
19
|
-
|
|
20
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
|
-
interface UploadBtnProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
22
|
-
spaceID: string;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
maxImageSize?: number;
|
|
25
|
-
maxVideoSize?: number;
|
|
26
|
-
maxFileCount?: number;
|
|
27
|
-
imageEnabled?: boolean;
|
|
28
|
-
videoEnabled?: boolean;
|
|
29
|
-
imageSupportedFormats?: string[];
|
|
30
|
-
videoSupportedFormats?: string[];
|
|
31
|
-
fileLimit?: number;
|
|
32
|
-
fileParts?: ContentPartLoop[];
|
|
33
|
-
uploadFile?: (params: any) => Promise<string>;
|
|
34
|
-
onFilePartsChange?: (part: ContentPartLoop) => void;
|
|
35
|
-
}
|
|
36
|
-
export interface UploadButtonRef {
|
|
37
|
-
getUploadImage: () => Upload | null;
|
|
38
|
-
getUploadVideo: () => Upload | null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const UploadButton = forwardRef<UploadButtonRef, UploadBtnProps>(
|
|
42
|
-
(
|
|
43
|
-
{
|
|
44
|
-
spaceID,
|
|
45
|
-
disabled,
|
|
46
|
-
maxImageSize,
|
|
47
|
-
maxVideoSize,
|
|
48
|
-
maxFileCount,
|
|
49
|
-
uploadFile,
|
|
50
|
-
imageEnabled,
|
|
51
|
-
videoEnabled,
|
|
52
|
-
imageSupportedFormats,
|
|
53
|
-
videoSupportedFormats,
|
|
54
|
-
fileLimit,
|
|
55
|
-
fileParts = [],
|
|
56
|
-
onFilePartsChange,
|
|
57
|
-
}: UploadBtnProps,
|
|
58
|
-
ref,
|
|
59
|
-
) => {
|
|
60
|
-
const uploadImgRef = useRef<Upload>(null);
|
|
61
|
-
const uploadVideoRef = useRef<Upload>(null);
|
|
62
|
-
|
|
63
|
-
const createUploadHandler =
|
|
64
|
-
(fileType: 'image' | 'video'): UploadProps['customRequest'] =>
|
|
65
|
-
({ fileInstance, file, onProgress, onSuccess, onError }) => {
|
|
66
|
-
const currentFileType = fileType;
|
|
67
|
-
const { uid } = file;
|
|
68
|
-
|
|
69
|
-
const reader = new FileReader();
|
|
70
|
-
reader.readAsDataURL(fileInstance as Blob);
|
|
71
|
-
reader.onload = async () => {
|
|
72
|
-
const base64Url = reader.result as string;
|
|
73
|
-
const partInfo =
|
|
74
|
-
currentFileType === 'image'
|
|
75
|
-
? { image_url: { url: file.url, thumb_url: base64Url } }
|
|
76
|
-
: { video_url: { url: file.url, thumb_url: base64Url } };
|
|
77
|
-
const part: ContentPartLoop = {
|
|
78
|
-
type:
|
|
79
|
-
currentFileType === 'image'
|
|
80
|
-
? ContentType.ImageURL
|
|
81
|
-
: ContentType.VideoURL,
|
|
82
|
-
...partInfo,
|
|
83
|
-
status: 'uploading',
|
|
84
|
-
uid,
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
onFilePartsChange?.(part);
|
|
89
|
-
const res = await uploadFile?.({
|
|
90
|
-
spaceID,
|
|
91
|
-
file: fileInstance,
|
|
92
|
-
fileType: 'image', // 不管是视频还是图片,都走imageX上传,所以fileType必须都是image
|
|
93
|
-
onProgress,
|
|
94
|
-
onSuccess,
|
|
95
|
-
onError,
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const fileInfo =
|
|
99
|
-
currentFileType === 'image'
|
|
100
|
-
? {
|
|
101
|
-
image_url: {
|
|
102
|
-
url: file.url,
|
|
103
|
-
uri: res,
|
|
104
|
-
thumb_url: base64Url,
|
|
105
|
-
},
|
|
106
|
-
}
|
|
107
|
-
: {
|
|
108
|
-
video_url: {
|
|
109
|
-
url: file.url,
|
|
110
|
-
uri: res,
|
|
111
|
-
thumb_url: base64Url,
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const newPart: ContentPartLoop = {
|
|
116
|
-
...part,
|
|
117
|
-
...fileInfo,
|
|
118
|
-
status: 'success',
|
|
119
|
-
};
|
|
120
|
-
onFilePartsChange?.(newPart);
|
|
121
|
-
} catch (error) {
|
|
122
|
-
console.info('error', error);
|
|
123
|
-
Toast.error('图片上传失败,请稍后重试');
|
|
124
|
-
onFilePartsChange?.({
|
|
125
|
-
...part,
|
|
126
|
-
status: 'uploadFail',
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const renderImageUpload = useCallback(
|
|
133
|
-
(children: React.ReactNode) => (
|
|
134
|
-
<Upload
|
|
135
|
-
ref={uploadImgRef}
|
|
136
|
-
action=""
|
|
137
|
-
customRequest={createUploadHandler('image')}
|
|
138
|
-
accept={imageSupportedFormats?.join(',') || 'image/*'}
|
|
139
|
-
showUploadList={false}
|
|
140
|
-
maxSize={maxImageSize ? maxImageSize * 1024 * 1024 : 0}
|
|
141
|
-
limit={fileLimit}
|
|
142
|
-
onSizeError={() => Toast.error(`图片大小不能超过${maxImageSize}MB`)}
|
|
143
|
-
onExceed={() => Toast.warning(`最多上传${maxFileCount}张图片`)}
|
|
144
|
-
multiple
|
|
145
|
-
fileList={fileParts.map(it => ({
|
|
146
|
-
uid: it.uid || '',
|
|
147
|
-
url: it.image_url?.url,
|
|
148
|
-
status: it.status || 'success',
|
|
149
|
-
name: it.uid || '',
|
|
150
|
-
size: '0',
|
|
151
|
-
}))}
|
|
152
|
-
>
|
|
153
|
-
{children}
|
|
154
|
-
</Upload>
|
|
155
|
-
),
|
|
156
|
-
[fileParts, maxImageSize, fileLimit, imageSupportedFormats],
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
const renderVideoUpload = useCallback(
|
|
160
|
-
(children: React.ReactNode) => (
|
|
161
|
-
<Upload
|
|
162
|
-
ref={uploadVideoRef}
|
|
163
|
-
action=""
|
|
164
|
-
customRequest={createUploadHandler('video')}
|
|
165
|
-
accept={videoSupportedFormats?.join(',') || 'video/*'}
|
|
166
|
-
showUploadList={false}
|
|
167
|
-
maxSize={maxVideoSize ? maxVideoSize * 1024 : 0}
|
|
168
|
-
limit={fileLimit}
|
|
169
|
-
onSizeError={() => Toast.error(`视频大小不能超过${maxVideoSize}MB`)}
|
|
170
|
-
onExceed={() => Toast.warning(`最多上传${maxFileCount}个视频`)}
|
|
171
|
-
multiple
|
|
172
|
-
fileList={fileParts.map(it => ({
|
|
173
|
-
uid: it.uid || '',
|
|
174
|
-
url: it.video_url?.url,
|
|
175
|
-
status: it.status || 'success',
|
|
176
|
-
name: it.uid || '',
|
|
177
|
-
size: '0',
|
|
178
|
-
}))}
|
|
179
|
-
>
|
|
180
|
-
{children}
|
|
181
|
-
</Upload>
|
|
182
|
-
),
|
|
183
|
-
[fileParts, maxVideoSize, fileLimit, videoSupportedFormats],
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
useImperativeHandle(ref, () => ({
|
|
187
|
-
getUploadImage: () => uploadImgRef.current,
|
|
188
|
-
getUploadVideo: () => uploadVideoRef.current,
|
|
189
|
-
}));
|
|
190
|
-
|
|
191
|
-
if (!imageEnabled && !videoEnabled) {
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (imageEnabled && !videoEnabled) {
|
|
196
|
-
return renderImageUpload(
|
|
197
|
-
<IconButton
|
|
198
|
-
icon={<IconCozImage />}
|
|
199
|
-
color="primary"
|
|
200
|
-
disabled={disabled}
|
|
201
|
-
data-btm="d41383"
|
|
202
|
-
data-btm-title="图片上传"
|
|
203
|
-
/>,
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (!imageEnabled && videoEnabled) {
|
|
208
|
-
return renderVideoUpload(
|
|
209
|
-
<IconButton
|
|
210
|
-
icon={<IconCozVideo />}
|
|
211
|
-
color="primary"
|
|
212
|
-
disabled={disabled}
|
|
213
|
-
data-btm="d27622"
|
|
214
|
-
data-btm-title="视频上传"
|
|
215
|
-
/>,
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return (
|
|
220
|
-
<>
|
|
221
|
-
<Menu
|
|
222
|
-
render={
|
|
223
|
-
<Menu.SubMenu mode="menu">
|
|
224
|
-
<Menu.Item
|
|
225
|
-
onClick={() => {
|
|
226
|
-
uploadImgRef.current?.openFileDialog();
|
|
227
|
-
}}
|
|
228
|
-
data-btm="d41383"
|
|
229
|
-
data-btm-title="图片上传"
|
|
230
|
-
>
|
|
231
|
-
图片上传
|
|
232
|
-
</Menu.Item>
|
|
233
|
-
<Menu.Item
|
|
234
|
-
onClick={() => {
|
|
235
|
-
uploadVideoRef.current?.openFileDialog();
|
|
236
|
-
}}
|
|
237
|
-
data-btm="d27622"
|
|
238
|
-
data-btm-title="视频上传"
|
|
239
|
-
>
|
|
240
|
-
视频上传
|
|
241
|
-
</Menu.Item>
|
|
242
|
-
</Menu.SubMenu>
|
|
243
|
-
}
|
|
244
|
-
>
|
|
245
|
-
<IconButton
|
|
246
|
-
icon={<IconCozImageArrowUp />}
|
|
247
|
-
color="primary"
|
|
248
|
-
disabled={disabled}
|
|
249
|
-
/>
|
|
250
|
-
</Menu>
|
|
251
|
-
{renderImageUpload(null)}
|
|
252
|
-
{renderVideoUpload(null)}
|
|
253
|
-
</>
|
|
254
|
-
);
|
|
255
|
-
},
|
|
256
|
-
);
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { type MultipartEditorConfig } from './type';
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_FILE_SIZE = 20 * 1024 * 1024;
|
|
4
|
-
export const DEFAULT_FILE_COUNT = 20;
|
|
5
|
-
export const DEFAULT_PART_COUNT = 50;
|
|
6
|
-
export const DEFAULT_SUPPORTED_FORMATS = [
|
|
7
|
-
'.jpg',
|
|
8
|
-
'.jpeg',
|
|
9
|
-
'.png',
|
|
10
|
-
'.gif',
|
|
11
|
-
'.bmp',
|
|
12
|
-
'.webp',
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
export const DEFAULT_VIDEO_SUPPORTED_FORMATS = [
|
|
16
|
-
'.mp4',
|
|
17
|
-
'.avi',
|
|
18
|
-
'.mov',
|
|
19
|
-
'.wmv',
|
|
20
|
-
'.flv',
|
|
21
|
-
'.mkv',
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
export const getMultipartConfig = (multipartConfig?: MultipartEditorConfig) => {
|
|
25
|
-
const {
|
|
26
|
-
max_file_count,
|
|
27
|
-
max_part_count,
|
|
28
|
-
max_file_size,
|
|
29
|
-
imageEnabled,
|
|
30
|
-
videoEnabled,
|
|
31
|
-
imageSupportedFormats,
|
|
32
|
-
videoSupportedFormats,
|
|
33
|
-
maxVideoSize,
|
|
34
|
-
} = multipartConfig || {};
|
|
35
|
-
const maxFileCount = max_file_count
|
|
36
|
-
? Number(max_file_count)
|
|
37
|
-
: DEFAULT_FILE_COUNT;
|
|
38
|
-
const maxPartCount = max_part_count
|
|
39
|
-
? Number(max_part_count)
|
|
40
|
-
: DEFAULT_PART_COUNT;
|
|
41
|
-
const trueMaxFileCount =
|
|
42
|
-
maxFileCount > maxPartCount ? maxPartCount : maxFileCount;
|
|
43
|
-
const maxFileSize = max_file_size ? Number(max_file_size) : DEFAULT_FILE_SIZE;
|
|
44
|
-
const currentImageSupportedFormats = (
|
|
45
|
-
imageSupportedFormats?.map(format =>
|
|
46
|
-
format.startsWith('.') ? format : `.${format}`,
|
|
47
|
-
) || DEFAULT_SUPPORTED_FORMATS
|
|
48
|
-
).join(',');
|
|
49
|
-
const currentVideoSupportedFormats = (
|
|
50
|
-
videoSupportedFormats?.map(format =>
|
|
51
|
-
format.startsWith('.') ? format : `.${format}`,
|
|
52
|
-
) || DEFAULT_VIDEO_SUPPORTED_FORMATS
|
|
53
|
-
).join(',');
|
|
54
|
-
return {
|
|
55
|
-
maxFileCount: trueMaxFileCount,
|
|
56
|
-
maxPartCount,
|
|
57
|
-
maxFileSize,
|
|
58
|
-
imageEnabled,
|
|
59
|
-
videoEnabled,
|
|
60
|
-
imageSupportedFormats: currentImageSupportedFormats,
|
|
61
|
-
videoSupportedFormats: currentVideoSupportedFormats,
|
|
62
|
-
maxVideoSize,
|
|
63
|
-
};
|
|
64
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { IconCozLongArrowTopRight } from '@coze-arch/coze-design/icons';
|
|
3
|
-
import { Tooltip, Button } from '@coze-arch/coze-design';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
url: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function OpenDetailButton({ url, className }: Props) {
|
|
11
|
-
return (
|
|
12
|
-
<Tooltip theme="dark" content="查看详情">
|
|
13
|
-
<Button
|
|
14
|
-
onClick={e => {
|
|
15
|
-
e.stopPropagation();
|
|
16
|
-
window.open(url);
|
|
17
|
-
}}
|
|
18
|
-
className={classNames(
|
|
19
|
-
'flex-shrink-0 !h-6 !w-6 !min-w-[24px] !p-[5px]',
|
|
20
|
-
className,
|
|
21
|
-
)}
|
|
22
|
-
size="small"
|
|
23
|
-
color="secondary"
|
|
24
|
-
icon={
|
|
25
|
-
<IconCozLongArrowTopRight className="h-[14px] w-[14px] coz-fg-secondary" />
|
|
26
|
-
}
|
|
27
|
-
></Button>
|
|
28
|
-
</Tooltip>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
5
|
-
IconCozIllus404Dark,
|
|
6
|
-
IconCozIllus404,
|
|
7
|
-
IconCozIllusErrorDark,
|
|
8
|
-
IconCozIllusError,
|
|
9
|
-
IconCozIllusLock,
|
|
10
|
-
IconCozIllusLockDark,
|
|
11
|
-
IconCozIllusEmpty,
|
|
12
|
-
IconCozIllusEmptyDark,
|
|
13
|
-
} from '@coze-arch/coze-design/illustrations';
|
|
14
|
-
import { Empty, Spin, type EmptyStateProps } from '@coze-arch/coze-design';
|
|
15
|
-
|
|
16
|
-
interface PageLoadingProps {
|
|
17
|
-
tip?: ReactNode;
|
|
18
|
-
className?: string;
|
|
19
|
-
style?: CSSProperties;
|
|
20
|
-
}
|
|
21
|
-
interface FullPageProps {
|
|
22
|
-
className?: string;
|
|
23
|
-
style?: CSSProperties;
|
|
24
|
-
children?: ReactNode;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
type PageContentProps = Omit<EmptyStateProps, 'image' | 'darkModeImage'>;
|
|
28
|
-
|
|
29
|
-
export function FullPage({ children, className, style }: FullPageProps) {
|
|
30
|
-
return (
|
|
31
|
-
<div
|
|
32
|
-
className={classNames(
|
|
33
|
-
'w-full h-full flex items-center justify-center bg-semi-bg-1 z-10',
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
style={style}
|
|
37
|
-
>
|
|
38
|
-
{children}
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
export function PageLoading(props: PageLoadingProps) {
|
|
43
|
-
return (
|
|
44
|
-
<FullPage className={props.className} style={props.style}>
|
|
45
|
-
<Spin wrapperClassName="w-full h-full" spinning tip={props.tip} />
|
|
46
|
-
</FullPage>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function PageNotFound({ className, ...props }: PageContentProps) {
|
|
51
|
-
return (
|
|
52
|
-
<FullPage className={className}>
|
|
53
|
-
<Empty
|
|
54
|
-
image={<IconCozIllus404 className="text-[160px]" />}
|
|
55
|
-
darkModeImage={<IconCozIllus404Dark className="text-[160px]" />}
|
|
56
|
-
description="页面丢失了"
|
|
57
|
-
{...props}
|
|
58
|
-
/>
|
|
59
|
-
</FullPage>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function PageError({ className, ...props }: PageContentProps) {
|
|
64
|
-
return (
|
|
65
|
-
<FullPage className={className}>
|
|
66
|
-
<Empty
|
|
67
|
-
image={<IconCozIllusError className="text-[160px]" />}
|
|
68
|
-
darkModeImage={<IconCozIllusErrorDark className="text-[160px]" />}
|
|
69
|
-
description="页面加载失败"
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
</FullPage>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function PageNoAuth({ className, ...props }: PageContentProps) {
|
|
77
|
-
return (
|
|
78
|
-
<FullPage className={className}>
|
|
79
|
-
<Empty
|
|
80
|
-
image={<IconCozIllusLock className="text-[160px]" />}
|
|
81
|
-
darkModeImage={<IconCozIllusLockDark className="text-[160px]" />}
|
|
82
|
-
description="暂无权限"
|
|
83
|
-
{...props}
|
|
84
|
-
></Empty>
|
|
85
|
-
</FullPage>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function PageNoContent({ className, ...props }: PageContentProps) {
|
|
90
|
-
return (
|
|
91
|
-
<FullPage className={className}>
|
|
92
|
-
<Empty
|
|
93
|
-
image={<IconCozIllusEmpty className="text-[160px]" />}
|
|
94
|
-
darkModeImage={<IconCozIllusEmptyDark className="text-[160px]" />}
|
|
95
|
-
{...props}
|
|
96
|
-
/>
|
|
97
|
-
</FullPage>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PrimaryPage } from './primary-header';
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
interface PrimaryPageHeaderProps {
|
|
6
|
-
pageTitle?: ReactNode;
|
|
7
|
-
filterSlot?: ReactNode;
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
headerClassName?: string;
|
|
10
|
-
titleClassName?: string;
|
|
11
|
-
contentClassName?: string;
|
|
12
|
-
className?: string;
|
|
13
|
-
titleSlot?: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const PrimaryPage = ({
|
|
17
|
-
pageTitle,
|
|
18
|
-
filterSlot,
|
|
19
|
-
children,
|
|
20
|
-
contentClassName,
|
|
21
|
-
className,
|
|
22
|
-
headerClassName,
|
|
23
|
-
titleClassName,
|
|
24
|
-
titleSlot,
|
|
25
|
-
}: PrimaryPageHeaderProps) => (
|
|
26
|
-
<div
|
|
27
|
-
className={classNames(
|
|
28
|
-
'pt-2 pb-3 h-full max-h-full flex flex-col',
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
31
|
-
>
|
|
32
|
-
{pageTitle || titleSlot ? (
|
|
33
|
-
<div
|
|
34
|
-
className={classNames(
|
|
35
|
-
'flex items-center justify-between py-4 px-6',
|
|
36
|
-
headerClassName,
|
|
37
|
-
)}
|
|
38
|
-
>
|
|
39
|
-
<div
|
|
40
|
-
className={classNames(
|
|
41
|
-
'text-[20px] font-medium leading-6 coz-fg-plus',
|
|
42
|
-
titleClassName,
|
|
43
|
-
)}
|
|
44
|
-
>
|
|
45
|
-
{pageTitle}
|
|
46
|
-
</div>
|
|
47
|
-
<div>{titleSlot}</div>
|
|
48
|
-
</div>
|
|
49
|
-
) : null}
|
|
50
|
-
{filterSlot ? (
|
|
51
|
-
<div className="box-border coz-fg-secondary pt-1 pb-3 px-6">
|
|
52
|
-
{filterSlot}
|
|
53
|
-
</div>
|
|
54
|
-
) : null}
|
|
55
|
-
<div
|
|
56
|
-
className={classNames(
|
|
57
|
-
'flex-1 h-full max-h-full overflow-hidden px-6',
|
|
58
|
-
contentClassName,
|
|
59
|
-
)}
|
|
60
|
-
>
|
|
61
|
-
{children}
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { Typography } from '@coze-arch/coze-design';
|
|
4
|
-
|
|
5
|
-
import styles from './index.module.less';
|
|
6
|
-
|
|
7
|
-
interface PrimaryTitleProps {
|
|
8
|
-
title: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function PrimaryTitle({ title, className }: PrimaryTitleProps) {
|
|
13
|
-
return (
|
|
14
|
-
<Typography.Text className={classNames(styles['primary-title'], className)}>
|
|
15
|
-
{title}
|
|
16
|
-
</Typography.Text>
|
|
17
|
-
);
|
|
18
|
-
}
|