From 620b11f2ce7636f331d519d1f4b467adb8d5a2d7 Mon Sep 17 00:00:00 2001
From: Col0ring <1561999073@qq.com>
Date: Fri, 13 Sep 2024 19:39:51 +0800
Subject: [PATCH 01/51] feat: integrate ant design
---
.husky/commit-msg | 5 +-
.husky/pre-commit | 5 +-
backend/modelscope_studio/__init__.py | 7 +-
.../modelscope_studio/components/__init__.py | 6 -
.../components/antd/__init__.py | 142 +
.../components/antd/affix/__init__.py | 58 +
.../components/antd/alert/__init__.py | 63 +
.../antd/alert/error_boundary/__init__.py | 61 +
.../components/antd/anchor/__init__.py | 66 +
.../components/antd/anchor/item/__init__.py | 54 +
.../components/antd/auto_complete/__init__.py | 88 +
.../antd/auto_complete/option/__init__.py | 61 +
.../components/antd/avatar/__init__.py | 66 +
.../components/antd/avatar/group/__init__.py | 52 +
.../components/antd/badge/__init__.py | 62 +
.../components/antd/badge/ribbon/__init__.py | 52 +
.../components/antd/breadcrumb/__init__.py | 57 +
.../antd/breadcrumb/item/__init__.py | 98 +
.../components/antd/button/__init__.py | 136 +
.../components/antd/button/group/__init__.py | 50 +
.../components/antd/calendar/__init__.py | 70 +
.../components/antd/card/__init__.py | 129 +
.../components/antd/card/grid/__init__.py | 64 +
.../components/antd/card/meta/__init__.py | 65 +
.../components/antd/carousel/__init__.py | 53 +
.../components/antd/cascader/__init__.py | 101 +
.../components/antd/cascader/constants.py | 2 +
.../antd/cascader/option/__init__.py | 61 +
.../antd/cascader/panel/__init__.py | 84 +
.../components/antd/checkbox/__init__.py | 67 +
.../antd/checkbox/group/__init__.py | 91 +
.../antd/checkbox/group/option/__init__.py | 63 +
.../components/antd/collapse/__init__.py | 88 +
.../components/antd/collapse/item/__init__.py | 63 +
.../components/antd/color_picker/__init__.py | 85 +
.../antd/color_picker/preset/__init__.py | 61 +
.../antd/config_provider/__init__.py | 53 +
.../components/antd/date_picker/__init__.py | 107 +
.../antd/date_picker/preset/__init__.py | 59 +
.../antd/date_picker/range_picker/__init__.py | 98 +
.../components/antd/descriptions/__init__.py | 60 +
.../antd/descriptions/item/__init__.py | 57 +
.../components/antd/divider/__init__.py | 82 +
.../components/antd/drawer/__init__.py | 66 +
.../components/antd/dropdown/__init__.py | 76 +
.../antd/dropdown/button/__init__.py | 82 +
.../components/antd/empty/__init__.py | 55 +
.../components/antd/flex/__init__.py | 79 +
.../components/antd/float_button/__init__.py | 63 +
.../antd/float_button/back_top/__init__.py | 60 +
.../antd/float_button/group/__init__.py | 63 +
.../components/antd/form/__init__.py | 82 +
.../components/antd/form/item/__init__.py | 61 +
.../antd/form/item/rule/__init__.py | 49 +
.../components/antd/grid/col/__init__.py | 102 +
.../components/antd/grid/row/__init__.py | 78 +
.../components/antd/icon/__init__.py | 65 +
.../antd/icon/iconfont_provider/__init__.py | 49 +
.../components/antd/image/__init__.py | 72 +
.../antd/image/preview_group/__init__.py | 66 +
.../components/antd/input/__init__.py | 84 +
.../components/antd/input/otp/__init__.py | 67 +
.../antd/input/password/__init__.py | 82 +
.../components/antd/input/search/__init__.py | 83 +
.../antd/input/textarea/__init__.py | 73 +
.../components/antd/input_number/__init__.py | 84 +
.../components/antd/layout/__init__.py | 68 +
.../antd/layout/content/__init__.py | 58 +
.../components/antd/layout/footer/__init__.py | 58 +
.../components/antd/layout/header/__init__.py | 58 +
.../components/antd/layout/sider/__init__.py | 64 +
.../components/antd/list/__init__.py | 65 +
.../components/antd/list/item/__init__.py | 59 +
.../antd/list/item/meta/__init__.py | 55 +
.../components/antd/mentions/__init__.py | 88 +
.../antd/mentions/option/__init__.py | 65 +
.../components/antd/menu/__init__.py | 84 +
.../components/antd/menu/item/__init__.py | 63 +
.../components/antd/message/__init__.py | 64 +
.../components/antd/modal/__init__.py | 74 +
.../components/antd/notification/__init__.py | 66 +
.../components/antd/pagination/__init__.py | 80 +
.../components/antd/popconfirm/__init__.py | 77 +
.../components/antd/popover/__init__.py | 61 +
.../components/antd/progress/__init__.py | 54 +
.../components/antd/qr_code/__init__.py | 60 +
.../components/antd/radio/__init__.py | 77 +
.../components/antd/radio/button/__init__.py | 73 +
.../components/antd/radio/group/__init__.py | 81 +
.../antd/radio/group/option/__init__.py | 67 +
.../components/antd/rate/__init__.py | 80 +
.../components/antd/result/__init__.py | 53 +
.../components/antd/segmented/__init__.py | 75 +
.../antd/segmented/option/__init__.py | 57 +
.../components/antd/select/__init__.py | 122 +
.../components/antd/select/option/__init__.py | 63 +
.../components/antd/skeleton/__init__.py | 60 +
.../antd/skeleton/avatar/__init__.py | 50 +
.../antd/skeleton/button/__init__.py | 50 +
.../antd/skeleton/image/__init__.py | 50 +
.../antd/skeleton/input/__init__.py | 50 +
.../components/antd/skeleton/node/__init__.py | 50 +
.../components/antd/slider/__init__.py | 89 +
.../components/antd/slider/mark/__init__.py | 65 +
.../components/antd/space/__init__.py | 56 +
.../components/antd/space/compact/__init__.py | 49 +
.../components/antd/spin/__init__.py | 53 +
.../components/antd/statistic/__init__.py | 58 +
.../antd/statistic/countdown/__init__.py | 66 +
.../components/antd/steps/__init__.py | 61 +
.../components/antd/steps/item/__init__.py | 53 +
.../components/antd/switch/__init__.py | 71 +
.../components/antd/table/__init__.py | 91 +
.../components/antd/table/column/__init__.py | 64 +
.../antd/table/column_group/__init__.py | 57 +
.../components/antd/table/constants.py | 5 +
.../antd/table/expandable/__init__.py | 73 +
.../antd/table/row_selection/__init__.py | 104 +
.../table/row_selection/selection/__init__.py | 69 +
.../components/antd/tabs/__init__.py | 82 +
.../components/antd/tabs/item/__init__.py | 53 +
.../components/antd/tag/__init__.py | 66 +
.../antd/tag/checkable_tag/__init__.py | 69 +
.../components/antd/time_picker/__init__.py | 83 +
.../antd/time_picker/range_picker/__init__.py | 98 +
.../components/antd/timeline/__init__.py | 55 +
.../components/antd/timeline/item/__init__.py | 53 +
.../components/antd/tooltip/__init__.py | 61 +
.../components/antd/tour/__init__.py | 77 +
.../components/antd/tour/step/__init__.py | 68 +
.../components/antd/transfer/__init__.py | 101 +
.../components/antd/tree/__init__.py | 115 +
.../antd/tree/directory_tree/__init__.py | 111 +
.../antd/tree/tree_node/__init__.py | 57 +
.../components/antd/tree_select/__init__.py | 99 +
.../antd/tree_select/tree_node/__init__.py | 59 +
.../components/antd/typography/__init__.py | 11 +
.../antd/typography/link/__init__.py | 85 +
.../antd/typography/paragraph/__init__.py | 97 +
.../antd/typography/text/__init__.py | 94 +
.../antd/typography/title/__init__.py | 97 +
.../components/antd/upload/__init__.py | 154 +
.../antd/upload/dragger/__init__.py | 151 +
.../components/antd/watermark/__init__.py | 52 +
.../components/base/__init__.py | 8 +
.../components/base/application/__init__.py | 43 +
.../components/base/div/__init__.py | 91 +
.../components/base/each/__init__.py | 70 +
.../components/base/filter/__init__.py | 42 +
.../components/base/fragment/__init__.py | 48 +
.../components/base/slot/__init__.py | 51 +
.../components/base/span/__init__.py | 91 +
.../components/base/text/__init__.py | 62 +
.../{ => legacy}/Chatbot/__init__.py | 8 +-
.../Chatbot/llm_thinking_presets.py | 0
.../components/{ => legacy}/Flow/__init__.py | 5 +-
.../components/{ => legacy}/Flow/edge.py | 0
.../components/{ => legacy}/Flow/node.py | 0
.../{ => legacy}/Flow/node_schema.py | 0
.../{ => legacy}/Lifecycle/__init__.py | 4 +-
.../{ => legacy}/Markdown/__init__.py | 6 +-
.../{ => legacy}/MultimodalInput/__init__.py | 4 +-
.../{ => legacy}/WaterfallGallery/__init__.py | 4 +-
.../components/legacy/__init__.py | 6 +
backend/modelscope_studio/external.py | 3 +-
.../utils/{ => dev}/__init__.py | 6 +-
.../modelscope_studio/utils/dev/component.py | 149 +
.../utils/{ => dev}/process_links.py | 0
.../utils/dev/resolve_frontend_dir.py | 15 +
config/changelog/package.json | 6 +-
config/lint-config/configs/eslint/basic.mjs | 2 +-
config/lint-config/configs/eslint/react.mjs | 2 +-
config/lint-config/configs/eslint/svelte.mjs | 3 +-
.../lint-config/configs/eslint/typescript.mjs | 16 +-
config/lint-config/eslint.mjs | 2 +-
config/lint-config/package.json | 22 +-
docs/components/Chatbot/demos/accordion.py | 1 -
docs/components/Chatbot/demos/basic.py | 1 -
docs/components/Chatbot/demos/chart.py | 1 -
.../Chatbot/demos/message_config.py | 1 -
docs/components/Chatbot/demos/multi_bots.py | 1 -
docs/components/Chatbot/demos/multimodal.py | 1 -
docs/components/Chatbot/demos/select-box.py | 1 -
docs/components/Docs.py | 1 -
docs/components/Flow/demos/basic.py | 1 -
.../Flow/demos/component_options.py | 1 -
.../components/Flow/demos/custom_node_type.py | 1 -
docs/components/Lifecycle/demos/basic.py | 1 -
.../Lifecycle/demos/language_adaptation.py | 1 -
.../Lifecycle/demos/theme_adaptation.py | 1 -
docs/components/Markdown/demos/accordion.py | 1 -
docs/components/Markdown/demos/basic.py | 1 -
docs/components/Markdown/demos/chart.py | 1 -
docs/components/Markdown/demos/custom-tag.py | 1 -
docs/components/Markdown/demos/custom-tag2.py | 1 -
docs/components/Markdown/demos/custom-tag3.py | 1 -
docs/components/Markdown/demos/custom-tag4.py | 1 -
.../custom_tags/accordion/accordion-title.py | 1 -
.../demos/custom_tags/accordion/basic.py | 1 -
.../Markdown/demos/custom_tags/chart/basic.py | 1 -
.../demos/custom_tags/select-box/basic.py | 1 -
.../custom_tags/select-box/card_shape.py | 1 -
.../select-box/card_shape_width_auto.py | 1 -
.../custom_tags/select-box/python_events.py | 1 -
docs/components/Markdown/demos/multimodal.py | 1 -
docs/components/Markdown/demos/select-box.py | 1 -
.../components/MultimodalInput/demos/basic.py | 1 -
.../MultimodalInput/demos/config_buttons.py | 1 -
.../MultimodalInput/demos/upload_sources.py | 1 -
.../MultimodalInput/demos/with_chatbot.py | 1 -
.../WaterfallGallery/demos/basic.py | 1 -
.../demos/like_click_feedback.py | 1 -
.../WaterfallGallery/demos/load_more.py | 1 -
.../demos/responsive_columns.py | 1 -
frontend/CHANGELOG.md | 21 -
frontend/Chatbot/gradio.config.js | 6 -
frontend/Chatbot/package.json | 27 -
frontend/Flow/gradio.config.js | 6 -
frontend/Markdown/gradio.config.js | 6 -
frontend/MultimodalInput/gradio.config.js | 6 -
frontend/MultimodalInput/package.json | 29 -
frontend/WaterfallGallery/gradio.config.js | 6 -
frontend/WaterfallGallery/package.json | 28 -
frontend/antd/affix/Index.svelte | 70 +
frontend/antd/affix/affix.tsx | 13 +
frontend/antd/affix/gradio.config.js | 3 +
frontend/antd/affix/package.json | 8 +
frontend/antd/alert/Index.svelte | 70 +
frontend/antd/alert/alert.tsx | 40 +
.../antd/alert/error-boundary/Index.svelte | 75 +
.../error-boundary/alert.error-boundary.tsx | 27 +
.../alert/error-boundary/gradio.config.js | 3 +
.../antd/alert/error-boundary/package.json | 8 +
frontend/antd/alert/gradio.config.js | 3 +
frontend/antd/alert/package.json | 8 +
frontend/antd/anchor/Index.svelte | 74 +
frontend/antd/anchor/anchor.tsx | 45 +
frontend/antd/anchor/context.ts | 6 +
frontend/antd/anchor/gradio.config.js | 3 +
frontend/antd/anchor/item/Index.svelte | 78 +
frontend/antd/anchor/item/gradio.config.js | 3 +
frontend/antd/anchor/item/package.json | 8 +
frontend/antd/anchor/package.json | 8 +
frontend/antd/auto-complete/Index.svelte | 80 +
frontend/antd/auto-complete/auto-complete.tsx | 106 +
frontend/antd/auto-complete/context.ts | 6 +
frontend/antd/auto-complete/gradio.config.js | 3 +
.../antd/auto-complete/option/Index.svelte | 91 +
.../auto-complete/option/gradio.config.js | 3 +
.../antd/auto-complete/option/package.json | 8 +
frontend/antd/auto-complete/package.json | 8 +
frontend/antd/avatar/Index.svelte | 75 +
frontend/antd/avatar/avatar.tsx | 23 +
frontend/antd/avatar/gradio.config.js | 3 +
frontend/antd/avatar/group/Index.svelte | 71 +
frontend/antd/avatar/group/avatar.group.tsx | 44 +
frontend/antd/avatar/group/gradio.config.js | 3 +
frontend/antd/avatar/group/package.json | 8 +
frontend/antd/avatar/package.json | 8 +
frontend/antd/badge/Index.svelte | 81 +
frontend/antd/badge/badge.tsx | 20 +
frontend/antd/badge/gradio.config.js | 3 +
frontend/antd/badge/package.json | 8 +
frontend/antd/badge/ribbon/Index.svelte | 74 +
frontend/antd/badge/ribbon/badge.ribbon.tsx | 21 +
frontend/antd/badge/ribbon/gradio.config.js | 3 +
frontend/antd/badge/ribbon/package.json | 8 +
frontend/antd/breadcrumb/Index.svelte | 74 +
frontend/antd/breadcrumb/breadcrumb.tsx | 36 +
frontend/antd/breadcrumb/context.ts | 6 +
frontend/antd/breadcrumb/gradio.config.js | 3 +
.../breadcrumb/item/BreadcrumbItem.svelte | 137 +
frontend/antd/breadcrumb/item/Index.svelte | 42 +
.../antd/breadcrumb/item/gradio.config.js | 3 +
frontend/antd/breadcrumb/item/package.json | 8 +
frontend/antd/breadcrumb/package.json | 8 +
frontend/antd/button/Index.svelte | 141 +
frontend/antd/button/button.tsx | 17 +
frontend/antd/button/gradio.config.js | 3 +
frontend/antd/button/group/Index.svelte | 71 +
frontend/antd/button/group/button.group.less | 20 +
frontend/antd/button/group/button.group.tsx | 26 +
frontend/antd/button/group/gradio.config.js | 3 +
frontend/antd/button/group/package.json | 8 +
frontend/antd/button/package.json | 8 +
frontend/antd/calendar/Index.svelte | 75 +
frontend/antd/calendar/calendar.tsx | 69 +
frontend/antd/calendar/gradio.config.js | 3 +
frontend/antd/calendar/package.json | 8 +
frontend/antd/card/Index.svelte | 129 +
frontend/antd/card/card.tsx | 41 +
frontend/antd/card/gradio.config.js | 3 +
frontend/antd/card/grid/Index.svelte | 69 +
frontend/antd/card/grid/card.grid.tsx | 6 +
frontend/antd/card/grid/gradio.config.js | 3 +
frontend/antd/card/grid/package.json | 8 +
frontend/antd/card/meta/Index.svelte | 79 +
frontend/antd/card/meta/card.meta.tsx | 27 +
frontend/antd/card/meta/gradio.config.js | 3 +
frontend/antd/card/meta/package.json | 8 +
frontend/antd/card/package.json | 8 +
frontend/antd/carousel/Index.svelte | 70 +
frontend/antd/carousel/carousel.tsx | 30 +
frontend/antd/carousel/gradio.config.js | 3 +
frontend/antd/carousel/package.json | 8 +
frontend/antd/cascader/Index.svelte | 80 +
frontend/antd/cascader/cascader.tsx | 144 +
frontend/antd/cascader/context.ts | 6 +
frontend/antd/cascader/gradio.config.js | 3 +
frontend/antd/cascader/option/Index.svelte | 87 +
.../antd/cascader/option/gradio.config.js | 3 +
frontend/antd/cascader/option/package.json | 8 +
frontend/antd/cascader/package.json | 8 +
frontend/antd/cascader/panel/Index.svelte | 82 +
.../antd/cascader/panel/cascader.panel.tsx | 66 +
frontend/antd/cascader/panel/gradio.config.js | 3 +
frontend/antd/cascader/panel/package.json | 8 +
frontend/antd/checkbox/Index.svelte | 76 +
frontend/antd/checkbox/checkbox.tsx | 21 +
frontend/antd/checkbox/context.ts | 6 +
frontend/antd/checkbox/gradio.config.js | 3 +
frontend/antd/checkbox/group/Index.svelte | 82 +
.../antd/checkbox/group/checkbox.group.tsx | 47 +
frontend/antd/checkbox/group/gradio.config.js | 3 +
.../antd/checkbox/group/option/Index.svelte | 92 +
.../checkbox/group/option/gradio.config.js | 3 +
.../antd/checkbox/group/option/package.json | 8 +
frontend/antd/checkbox/group/package.json | 8 +
frontend/antd/checkbox/package.json | 8 +
frontend/antd/collapse/Index.svelte | 81 +
frontend/antd/collapse/collapse.tsx | 58 +
frontend/antd/collapse/context.ts | 6 +
frontend/antd/collapse/gradio.config.js | 3 +
frontend/antd/collapse/item/Index.svelte | 90 +
frontend/antd/collapse/item/gradio.config.js | 3 +
frontend/antd/collapse/item/package.json | 8 +
frontend/antd/collapse/package.json | 8 +
frontend/antd/color-picker/Index.svelte | 82 +
frontend/antd/color-picker/color-picker.tsx | 70 +
frontend/antd/color-picker/context.ts | 6 +
frontend/antd/color-picker/gradio.config.js | 3 +
frontend/antd/color-picker/package.json | 8 +
.../antd/color-picker/preset/Index.svelte | 92 +
.../antd/color-picker/preset/gradio.config.js | 3 +
.../antd/color-picker/preset/package.json | 8 +
frontend/antd/config-provider/Index.svelte | 61 +
.../antd/config-provider/config-provider.tsx | 124 +
.../antd/config-provider/gradio.config.js | 3 +
frontend/antd/config-provider/locales.ts | 74 +
frontend/antd/config-provider/package.json | 8 +
frontend/antd/date-picker/Index.svelte | 79 +
frontend/antd/date-picker/context.ts | 6 +
frontend/antd/date-picker/date-picker.tsx | 207 +
frontend/antd/date-picker/gradio.config.js | 3 +
frontend/antd/date-picker/package.json | 8 +
frontend/antd/date-picker/preset/Index.svelte | 88 +
.../antd/date-picker/preset/gradio.config.js | 3 +
frontend/antd/date-picker/preset/package.json | 8 +
.../date-picker/range-picker/Index.svelte | 84 +
.../range-picker/date-picker.range-picker.tsx | 227 +
.../date-picker/range-picker/gradio.config.js | 3 +
.../date-picker/range-picker/package.json | 8 +
frontend/antd/descriptions/Index.svelte | 78 +
frontend/antd/descriptions/context.ts | 6 +
frontend/antd/descriptions/descriptions.tsx | 37 +
frontend/antd/descriptions/gradio.config.js | 3 +
frontend/antd/descriptions/item/Index.svelte | 90 +
.../antd/descriptions/item/gradio.config.js | 3 +
frontend/antd/descriptions/item/package.json | 8 +
frontend/antd/descriptions/package.json | 8 +
frontend/antd/divider/Index.svelte | 107 +
frontend/antd/divider/divider.tsx | 10 +
frontend/antd/divider/gradio.config.js | 3 +
frontend/antd/divider/package.json | 8 +
frontend/antd/drawer/Index.svelte | 70 +
frontend/antd/drawer/drawer.tsx | 32 +
frontend/antd/drawer/gradio.config.js | 3 +
frontend/antd/drawer/package.json | 8 +
frontend/antd/dropdown/Index.svelte | 77 +
frontend/antd/dropdown/button/Index.svelte | 83 +
.../antd/dropdown/button/dropdown.button.tsx | 62 +
.../antd/dropdown/button/gradio.config.js | 3 +
frontend/antd/dropdown/button/package.json | 8 +
frontend/antd/dropdown/dropdown.tsx | 66 +
frontend/antd/dropdown/gradio.config.js | 3 +
frontend/antd/dropdown/package.json | 8 +
frontend/antd/empty/Index.svelte | 70 +
frontend/antd/empty/empty.tsx | 28 +
frontend/antd/empty/gradio.config.js | 3 +
frontend/antd/empty/package.json | 8 +
frontend/antd/flex/Index.svelte | 98 +
frontend/antd/flex/flex.tsx | 8 +
frontend/antd/flex/gradio.config.js | 3 +
frontend/antd/flex/package.json | 8 +
frontend/antd/float-button/Index.svelte | 67 +
.../antd/float-button/back-top/Index.svelte | 73 +
.../back-top/float-button.back-top.tsx | 42 +
.../float-button/back-top/gradio.config.js | 3 +
.../antd/float-button/back-top/package.json | 8 +
frontend/antd/float-button/float-button.tsx | 42 +
frontend/antd/float-button/gradio.config.js | 3 +
frontend/antd/float-button/group/Index.svelte | 75 +
.../group/float-button.group.less | 30 +
.../float-button/group/float-button.group.tsx | 54 +
.../antd/float-button/group/gradio.config.js | 3 +
frontend/antd/float-button/group/package.json | 8 +
frontend/antd/float-button/package.json | 8 +
frontend/antd/form/Index.svelte | 76 +
frontend/antd/form/context.ts | 7 +
frontend/antd/form/form.tsx | 28 +
frontend/antd/form/gradio.config.js | 3 +
frontend/antd/form/item/Index.svelte | 80 +
frontend/antd/form/item/form.item.tsx | 117 +
frontend/antd/form/item/gradio.config.js | 3 +
frontend/antd/form/item/package.json | 8 +
frontend/antd/form/item/rule/Index.svelte | 64 +
frontend/antd/form/item/rule/global.css | 3 +
frontend/antd/form/item/rule/gradio.config.js | 3 +
frontend/antd/form/item/rule/package.json | 8 +
frontend/antd/form/package.json | 8 +
frontend/antd/grid/col/Index.svelte | 128 +
frontend/antd/grid/col/gradio.config.js | 3 +
frontend/antd/grid/col/package.json | 8 +
frontend/antd/grid/context.ts | 6 +
frontend/antd/grid/row/Index.svelte | 90 +
frontend/antd/grid/row/gradio.config.js | 3 +
frontend/antd/grid/row/package.json | 8 +
frontend/antd/grid/row/row.tsx | 30 +
frontend/antd/icon/Index.svelte | 74 +
frontend/antd/icon/gradio.config.js | 3 +
frontend/antd/icon/icon.tsx | 26 +
.../antd/icon/iconfont-provider/Index.svelte | 56 +
.../antd/icon/iconfont-provider/context.ts | 37 +
.../icon/iconfont-provider/create-iconfont.ts | 3 +
.../icon/iconfont-provider/gradio.config.js | 3 +
.../antd/icon/iconfont-provider/package.json | 8 +
frontend/antd/icon/package.json | 8 +
frontend/antd/image/Index.svelte | 74 +
frontend/antd/image/gradio.config.js | 3 +
frontend/antd/image/image.tsx | 58 +
frontend/antd/image/package.json | 8 +
.../antd/image/preview-group/Index.svelte | 79 +
.../antd/image/preview-group/gradio.config.js | 3 +
.../preview-group/image.preview-group.tsx | 54 +
.../antd/image/preview-group/package.json | 8 +
frontend/antd/input-number/Index.svelte | 76 +
frontend/antd/input-number/gradio.config.js | 3 +
frontend/antd/input-number/input-number.tsx | 85 +
frontend/antd/input-number/package.json | 8 +
frontend/antd/input/Index.svelte | 76 +
frontend/antd/input/gradio.config.js | 3 +
frontend/antd/input/input.tsx | 84 +
frontend/antd/input/otp/Index.svelte | 74 +
frontend/antd/input/otp/gradio.config.js | 3 +
frontend/antd/input/otp/input.otp.tsx | 24 +
frontend/antd/input/otp/package.json | 8 +
frontend/antd/input/package.json | 8 +
frontend/antd/input/password/Index.svelte | 78 +
frontend/antd/input/password/gradio.config.js | 3 +
.../antd/input/password/input.password.tsx | 85 +
frontend/antd/input/password/package.json | 8 +
frontend/antd/input/search/Index.svelte | 76 +
frontend/antd/input/search/gradio.config.js | 3 +
frontend/antd/input/search/input.search.tsx | 99 +
frontend/antd/input/search/package.json | 8 +
frontend/antd/input/textarea/Index.svelte | 78 +
frontend/antd/input/textarea/gradio.config.js | 3 +
.../antd/input/textarea/input.textarea.tsx | 65 +
frontend/antd/input/textarea/package.json | 8 +
frontend/antd/layout/Base.svelte | 71 +
frontend/antd/layout/Index.svelte | 10 +
frontend/antd/layout/content/Index.svelte | 10 +
frontend/antd/layout/content/gradio.config.js | 3 +
frontend/antd/layout/content/package.json | 8 +
frontend/antd/layout/footer/Index.svelte | 10 +
frontend/antd/layout/footer/gradio.config.js | 3 +
frontend/antd/layout/footer/package.json | 8 +
frontend/antd/layout/gradio.config.js | 3 +
frontend/antd/layout/header/Index.svelte | 10 +
frontend/antd/layout/header/gradio.config.js | 3 +
frontend/antd/layout/header/package.json | 8 +
frontend/antd/layout/layout.base.tsx | 39 +
frontend/antd/layout/package.json | 8 +
frontend/antd/layout/sider/Index.svelte | 71 +
frontend/antd/layout/sider/gradio.config.js | 3 +
frontend/antd/layout/sider/layout.sider.tsx | 20 +
frontend/antd/layout/sider/package.json | 8 +
frontend/antd/list/Index.svelte | 70 +
frontend/antd/list/gradio.config.js | 3 +
frontend/antd/list/item/Index.svelte | 65 +
frontend/antd/list/item/gradio.config.js | 3 +
frontend/antd/list/item/list.item.tsx | 28 +
frontend/antd/list/item/meta/Index.svelte | 65 +
frontend/antd/list/item/meta/gradio.config.js | 3 +
.../antd/list/item/meta/list.item.meta.tsx | 28 +
frontend/antd/list/item/meta/package.json | 8 +
frontend/antd/list/item/package.json | 8 +
frontend/antd/list/list.tsx | 22 +
frontend/antd/list/package.json | 8 +
frontend/antd/mentions/Index.svelte | 80 +
frontend/antd/mentions/context.ts | 6 +
frontend/antd/mentions/gradio.config.js | 3 +
frontend/antd/mentions/mentions.tsx | 68 +
frontend/antd/mentions/option/Index.svelte | 96 +
.../antd/mentions/option/gradio.config.js | 3 +
frontend/antd/mentions/option/package.json | 8 +
frontend/antd/mentions/package.json | 8 +
frontend/antd/menu/Index.svelte | 92 +
frontend/antd/menu/context.ts | 6 +
frontend/antd/menu/gradio.config.js | 3 +
frontend/antd/menu/item/Index.svelte | 89 +
frontend/antd/menu/item/gradio.config.js | 3 +
frontend/antd/menu/item/package.json | 8 +
frontend/antd/menu/menu.tsx | 82 +
frontend/antd/menu/package.json | 8 +
frontend/antd/message/Index.svelte | 77 +
frontend/antd/message/gradio.config.js | 3 +
frontend/antd/message/message.tsx | 49 +
frontend/antd/message/package.json | 8 +
frontend/antd/modal/Index.svelte | 70 +
frontend/antd/modal/gradio.config.js | 3 +
frontend/antd/modal/modal.tsx | 90 +
frontend/antd/modal/package.json | 8 +
frontend/antd/notification/Index.svelte | 77 +
frontend/antd/notification/gradio.config.js | 3 +
frontend/antd/notification/notification.tsx | 82 +
frontend/antd/notification/package.json | 8 +
frontend/antd/pagination/Index.svelte | 88 +
frontend/antd/pagination/gradio.config.js | 3 +
frontend/antd/pagination/package.json | 8 +
frontend/antd/pagination/pagination.tsx | 44 +
frontend/antd/popconfirm/Index.svelte | 73 +
frontend/antd/popconfirm/gradio.config.js | 3 +
frontend/antd/popconfirm/package.json | 8 +
frontend/antd/popconfirm/popconfirm.tsx | 64 +
frontend/antd/popover/Index.svelte | 72 +
frontend/antd/popover/gradio.config.js | 3 +
frontend/antd/popover/package.json | 8 +
frontend/antd/popover/popover.tsx | 30 +
frontend/antd/progress/Index.svelte | 70 +
frontend/antd/progress/gradio.config.js | 3 +
frontend/antd/progress/package.json | 8 +
frontend/antd/progress/progress.tsx | 12 +
frontend/antd/qr-code/Index.svelte | 70 +
frontend/antd/qr-code/gradio.config.js | 3 +
frontend/antd/qr-code/package.json | 8 +
frontend/antd/qr-code/qr-code.tsx | 8 +
frontend/antd/radio/Index.svelte | 89 +
frontend/antd/radio/button/Index.svelte | 89 +
frontend/antd/radio/button/gradio.config.js | 3 +
frontend/antd/radio/button/package.json | 8 +
frontend/antd/radio/button/radio.button.tsx | 29 +
frontend/antd/radio/context.ts | 6 +
frontend/antd/radio/gradio.config.js | 3 +
frontend/antd/radio/group/Index.svelte | 80 +
frontend/antd/radio/group/gradio.config.js | 3 +
frontend/antd/radio/group/option/Index.svelte | 100 +
.../antd/radio/group/option/gradio.config.js | 3 +
frontend/antd/radio/group/option/package.json | 8 +
frontend/antd/radio/group/package.json | 8 +
frontend/antd/radio/group/radio.group.less | 20 +
frontend/antd/radio/group/radio.group.tsx | 53 +
frontend/antd/radio/package.json | 8 +
frontend/antd/radio/radio.tsx | 21 +
frontend/antd/rate/Index.svelte | 76 +
frontend/antd/rate/gradio.config.js | 3 +
frontend/antd/rate/package.json | 8 +
frontend/antd/rate/rate.tsx | 40 +
frontend/antd/result/Index.svelte | 70 +
frontend/antd/result/gradio.config.js | 3 +
frontend/antd/result/package.json | 8 +
frontend/antd/result/result.tsx | 23 +
frontend/antd/segmented/Index.svelte | 80 +
frontend/antd/segmented/context.ts | 6 +
frontend/antd/segmented/gradio.config.js | 3 +
frontend/antd/segmented/option/Index.svelte | 81 +
.../antd/segmented/option/gradio.config.js | 3 +
frontend/antd/segmented/option/package.json | 8 +
frontend/antd/segmented/package.json | 8 +
frontend/antd/segmented/segmented.tsx | 35 +
frontend/antd/select/Index.svelte | 80 +
frontend/antd/select/context.ts | 6 +
frontend/antd/select/gradio.config.js | 3 +
frontend/antd/select/option/Index.svelte | 100 +
frontend/antd/select/option/gradio.config.js | 3 +
frontend/antd/select/option/package.json | 8 +
frontend/antd/select/package.json | 8 +
frontend/antd/select/select.tsx | 128 +
frontend/antd/skeleton/Index.svelte | 70 +
frontend/antd/skeleton/avatar/Index.svelte | 72 +
.../antd/skeleton/avatar/gradio.config.js | 3 +
frontend/antd/skeleton/avatar/package.json | 8 +
.../antd/skeleton/avatar/skeleton.avatar.tsx | 8 +
frontend/antd/skeleton/button/Index.svelte | 72 +
.../antd/skeleton/button/gradio.config.js | 3 +
frontend/antd/skeleton/button/package.json | 8 +
.../antd/skeleton/button/skeleton.button.tsx | 8 +
frontend/antd/skeleton/gradio.config.js | 3 +
frontend/antd/skeleton/image/Index.svelte | 72 +
frontend/antd/skeleton/image/gradio.config.js | 3 +
frontend/antd/skeleton/image/package.json | 8 +
.../antd/skeleton/image/skeleton.image.tsx | 8 +
frontend/antd/skeleton/input/Index.svelte | 72 +
frontend/antd/skeleton/input/gradio.config.js | 3 +
frontend/antd/skeleton/input/package.json | 8 +
.../antd/skeleton/input/skeleton.input.tsx | 8 +
frontend/antd/skeleton/node/Index.svelte | 70 +
frontend/antd/skeleton/node/gradio.config.js | 3 +
frontend/antd/skeleton/node/package.json | 8 +
frontend/antd/skeleton/node/skeleton.node.tsx | 8 +
frontend/antd/skeleton/package.json | 8 +
frontend/antd/skeleton/skeleton.tsx | 6 +
frontend/antd/slider/Index.svelte | 80 +
frontend/antd/slider/context.ts | 6 +
frontend/antd/slider/gradio.config.js | 3 +
frontend/antd/slider/mark/Index.svelte | 91 +
frontend/antd/slider/mark/gradio.config.js | 3 +
frontend/antd/slider/mark/package.json | 8 +
frontend/antd/slider/package.json | 8 +
frontend/antd/slider/slider.tsx | 82 +
frontend/antd/space/Index.svelte | 69 +
frontend/antd/space/compact/Index.svelte | 70 +
frontend/antd/space/compact/gradio.config.js | 3 +
frontend/antd/space/compact/package.json | 8 +
frontend/antd/space/compact/space.compact.tsx | 23 +
frontend/antd/space/gradio.config.js | 3 +
frontend/antd/space/package.json | 8 +
frontend/antd/space/space.tsx | 28 +
frontend/antd/spin/Index.svelte | 70 +
frontend/antd/spin/gradio.config.js | 3 +
frontend/antd/spin/package.json | 8 +
frontend/antd/spin/spin.tsx | 23 +
frontend/antd/statistic/Index.svelte | 68 +
.../antd/statistic/countdown/Index.svelte | 73 +
.../antd/statistic/countdown/gradio.config.js | 3 +
.../antd/statistic/countdown/package.json | 8 +
.../countdown/statistic.countdown.tsx | 26 +
frontend/antd/statistic/gradio.config.js | 3 +
frontend/antd/statistic/package.json | 8 +
frontend/antd/statistic/statistic.tsx | 28 +
frontend/antd/steps/Index.svelte | 74 +
frontend/antd/steps/context.ts | 6 +
frontend/antd/steps/gradio.config.js | 3 +
frontend/antd/steps/item/Index.svelte | 73 +
frontend/antd/steps/item/gradio.config.js | 3 +
frontend/antd/steps/item/package.json | 8 +
frontend/antd/steps/package.json | 8 +
frontend/antd/steps/steps.tsx | 36 +
frontend/antd/switch/Index.svelte | 75 +
frontend/antd/switch/gradio.config.js | 3 +
frontend/antd/switch/package.json | 8 +
frontend/antd/switch/switch.tsx | 41 +
frontend/antd/table/Index.svelte | 83 +
frontend/antd/table/column-group/Index.svelte | 83 +
.../antd/table/column-group/gradio.config.js | 3 +
frontend/antd/table/column-group/package.json | 8 +
frontend/antd/table/column/Index.svelte | 142 +
frontend/antd/table/column/gradio.config.js | 3 +
frontend/antd/table/column/package.json | 8 +
frontend/antd/table/context.ts | 27 +
.../antd/table/expandable/Expandable.svelte | 105 +
frontend/antd/table/expandable/Index.svelte | 42 +
.../antd/table/expandable/gradio.config.js | 3 +
frontend/antd/table/expandable/package.json | 8 +
frontend/antd/table/gradio.config.js | 3 +
frontend/antd/table/package.json | 8 +
.../antd/table/row-selection/Index.svelte | 42 +
.../table/row-selection/RowSelection.svelte | 101 +
.../antd/table/row-selection/gradio.config.js | 3 +
.../antd/table/row-selection/package.json | 8 +
.../row-selection/selection/Index.svelte | 93 +
.../row-selection/selection/gradio.config.js | 3 +
.../row-selection/selection/package.json | 8 +
frontend/antd/table/table.tsx | 195 +
frontend/antd/tabs/Index.svelte | 80 +
frontend/antd/tabs/context.ts | 6 +
frontend/antd/tabs/gradio.config.js | 3 +
frontend/antd/tabs/item/Index.svelte | 82 +
frontend/antd/tabs/item/gradio.config.js | 3 +
frontend/antd/tabs/item/package.json | 8 +
frontend/antd/tabs/package.json | 8 +
frontend/antd/tabs/tabs.tsx | 106 +
frontend/antd/tag/Index.svelte | 80 +
frontend/antd/tag/checkable-tag/Index.svelte | 89 +
.../antd/tag/checkable-tag/gradio.config.js | 3 +
frontend/antd/tag/checkable-tag/package.json | 8 +
.../tag/checkable-tag/tag.checkable-tag.tsx | 21 +
frontend/antd/tag/gradio.config.js | 3 +
frontend/antd/tag/package.json | 8 +
frontend/antd/tag/tag.tsx | 24 +
frontend/antd/time-picker/Index.svelte | 75 +
frontend/antd/time-picker/gradio.config.js | 3 +
frontend/antd/time-picker/package.json | 8 +
.../time-picker/range-picker/Index.svelte | 80 +
.../time-picker/range-picker/gradio.config.js | 3 +
.../time-picker/range-picker/package.json | 8 +
.../range-picker/time-picker.range-picker.tsx | 199 +
frontend/antd/time-picker/time-picker.tsx | 187 +
frontend/antd/timeline/Index.svelte | 73 +
frontend/antd/timeline/context.ts | 6 +
frontend/antd/timeline/gradio.config.js | 3 +
frontend/antd/timeline/item/Index.svelte | 82 +
frontend/antd/timeline/item/gradio.config.js | 3 +
frontend/antd/timeline/item/package.json | 8 +
frontend/antd/timeline/package.json | 8 +
frontend/antd/timeline/timeline.tsx | 43 +
frontend/antd/tooltip/Index.svelte | 72 +
frontend/antd/tooltip/gradio.config.js | 3 +
frontend/antd/tooltip/package.json | 8 +
frontend/antd/tooltip/tooltip.tsx | 26 +
frontend/antd/tour/Index.svelte | 84 +
frontend/antd/tour/context.ts | 6 +
frontend/antd/tour/gradio.config.js | 3 +
frontend/antd/tour/package.json | 8 +
frontend/antd/tour/step/Index.svelte | 75 +
frontend/antd/tour/step/gradio.config.js | 3 +
frontend/antd/tour/step/package.json | 8 +
frontend/antd/tour/tour.tsx | 71 +
frontend/antd/transfer/Index.svelte | 76 +
frontend/antd/transfer/gradio.config.js | 3 +
frontend/antd/transfer/package.json | 8 +
frontend/antd/transfer/transfer.tsx | 99 +
frontend/antd/tree-select/Index.svelte | 79 +
frontend/antd/tree-select/context.ts | 6 +
frontend/antd/tree-select/gradio.config.js | 3 +
frontend/antd/tree-select/package.json | 8 +
.../antd/tree-select/tree-node/Index.svelte | 87 +
.../tree-select/tree-node/gradio.config.js | 3 +
.../antd/tree-select/tree-node/package.json | 8 +
frontend/antd/tree-select/tree-select.tsx | 119 +
frontend/antd/tree/Index.svelte | 95 +
frontend/antd/tree/context.ts | 6 +
.../antd/tree/directory-tree/Index.svelte | 96 +
.../antd/tree/directory-tree/gradio.config.js | 3 +
.../antd/tree/directory-tree/package.json | 8 +
frontend/antd/tree/gradio.config.js | 3 +
frontend/antd/tree/package.json | 8 +
frontend/antd/tree/tree-node/Index.svelte | 83 +
frontend/antd/tree/tree-node/gradio.config.js | 3 +
frontend/antd/tree/tree-node/package.json | 8 +
frontend/antd/tree/tree.tsx | 134 +
frontend/antd/typography/Base.svelte | 81 +
frontend/antd/typography/link/Index.svelte | 12 +
.../antd/typography/link/gradio.config.js | 3 +
frontend/antd/typography/link/package.json | 8 +
.../antd/typography/paragraph/Index.svelte | 12 +
.../typography/paragraph/gradio.config.js | 3 +
.../antd/typography/paragraph/package.json | 8 +
frontend/antd/typography/text/Index.svelte | 12 +
.../antd/typography/text/gradio.config.js | 3 +
frontend/antd/typography/text/package.json | 8 +
frontend/antd/typography/title/Index.svelte | 12 +
.../antd/typography/title/gradio.config.js | 3 +
frontend/antd/typography/title/package.json | 8 +
frontend/antd/typography/typography.base.tsx | 152 +
frontend/antd/upload/Index.svelte | 83 +
frontend/antd/upload/dragger/Index.svelte | 85 +
frontend/antd/upload/dragger/gradio.config.js | 3 +
frontend/antd/upload/dragger/package.json | 8 +
.../antd/upload/dragger/upload.dragger.tsx | 146 +
frontend/antd/upload/gradio.config.js | 3 +
frontend/antd/upload/package.json | 8 +
frontend/antd/upload/upload.tsx | 146 +
frontend/antd/watermark/Index.svelte | 73 +
frontend/antd/watermark/gradio.config.js | 3 +
frontend/antd/watermark/package.json | 8 +
frontend/antd/watermark/watermark.tsx | 5 +
frontend/base/application/Index.svelte | 30 +
frontend/base/application/gradio.config.js | 3 +
frontend/base/application/package.json | 8 +
frontend/base/div/Index.svelte | 104 +
frontend/base/div/gradio.config.js | 3 +
frontend/base/div/package.json | 8 +
frontend/base/each/Each.svelte | 18 +
frontend/base/each/Index.svelte | 42 +
frontend/base/each/gradio.config.js | 3 +
frontend/base/each/package.json | 8 +
frontend/base/filter/Index.svelte | 50 +
frontend/base/filter/gradio.config.js | 3 +
frontend/base/filter/package.json | 8 +
frontend/base/fragment/Index.svelte | 38 +
frontend/base/fragment/ShowFragment.svelte | 15 +
frontend/base/fragment/fragment.tsx | 10 +
frontend/base/fragment/gradio.config.js | 3 +
frontend/base/fragment/package.json | 9 +
frontend/base/slot/Index.svelte | 77 +
frontend/base/slot/gradio.config.js | 3 +
frontend/base/slot/package.json | 8 +
frontend/base/span/Index.svelte | 104 +
frontend/base/span/gradio.config.js | 3 +
frontend/base/span/package.json | 8 +
frontend/base/text/Index.svelte | 36 +
frontend/base/text/global.css | 3 +
frontend/base/text/gradio.config.js | 3 +
frontend/base/text/package.json | 8 +
frontend/compiled/tsconfig.build.json | 26 -
frontend/compiled/tsconfig.json | 25 -
frontend/compiled/tsconfig.node.json | 11 -
frontend/compiled/vite.config.ts | 72 -
frontend/defineConfig.js | 18 +
fixtures.d.ts => frontend/fixtures.d.ts | 9 +-
frontend/{ => legacy}/Chatbot/CHANGELOG.md | 0
frontend/{ => legacy}/Chatbot/Index.svelte | 2 +-
frontend/legacy/Chatbot/gradio.config.js | 3 +
.../Chatbot}/package.json | 9 +-
.../Chatbot/shared/ChatBot.svelte | 2 +-
.../{ => legacy}/Chatbot/shared/Copy.svelte | 0
.../Chatbot/shared/FlushingMarkdown.svelte | 0
.../Chatbot/shared/LikeDislike.svelte | 0
.../Chatbot/shared/Pending.svelte | 0
.../Chatbot/shared/llm-thinking-presets.ts | 0
frontend/{ => legacy}/Chatbot/shared/utils.ts | 0
frontend/{ => legacy}/Flow/CHANGELOG.md | 0
frontend/{ => legacy}/Flow/Index.svelte | 2 +-
frontend/legacy/Flow/gradio.config.js | 3 +
frontend/{ => legacy}/Flow/package.json | 15 +-
frontend/{ => legacy}/Flow/schema.json | 0
frontend/{ => legacy}/Flow/schema.ts | 0
frontend/{ => legacy}/Flow/shared/Flow.svelte | 2 +-
frontend/{ => legacy}/Flow/shared/utils.ts | 0
frontend/{ => legacy}/Lifecycle/CHANGELOG.md | 0
frontend/legacy/Lifecycle/gradio.config.js | 3 +
frontend/{ => legacy}/Lifecycle/index.svelte | 0
frontend/legacy/Lifecycle/package.json | 16 +
.../{ => legacy}/Lifecycle/shared/utils.ts | 0
frontend/{ => legacy}/Markdown/CHANGELOG.md | 0
frontend/{ => legacy}/Markdown/Example.svelte | 0
frontend/{ => legacy}/Markdown/Index.svelte | 0
frontend/legacy/Markdown/gradio.config.js | 3 +
frontend/{ => legacy}/Markdown/package.json | 11 +-
.../Markdown/shared/Markdown.svelte | 0
.../{ => legacy}/MultimodalInput/CHANGELOG.md | 0
.../MultimodalInput/Example.svelte | 0
.../{ => legacy}/MultimodalInput/Index.svelte | 2 +-
.../legacy/MultimodalInput/gradio.config.js | 3 +
frontend/legacy/MultimodalInput/package.json | 19 +
.../shared/AudioRecorder.svelte | 0
.../MultimodalInput/shared/FilePreview.svelte | 0
.../MultimodalInput/shared/Input.svelte | 0
.../MultimodalInput/shared/Loader.svelte | 0
.../MultimodalInput/shared/RemoveIcon.svelte | 0
.../shared/SubmitButton.svelte | 0
.../shared/UploadButton.svelte | 0
.../MultimodalInput/shared/UploadIcon.svelte | 0
.../MultimodalInput/shared/Webcam.svelte | 0
.../MultimodalInput/shared/context.ts | 0
.../MultimodalInput/shared/global.d.ts | 0
.../MultimodalInput/shared/utils.ts | 0
.../WaterfallGallery/CHANGELOG.md | 0
.../WaterfallGallery/Index.svelte | 0
.../legacy/WaterfallGallery/gradio.config.js | 3 +
.../WaterfallGallery}/package.json | 9 +-
.../WaterfallGallery/shared/Dislike.svelte | 0
.../WaterfallGallery/shared/Gallery.svelte | 2 +-
.../WaterfallGallery/shared/Image.svelte | 0
.../shared/Waterfall/createWaterfall.ts | 0
.../shared/Waterfall/index.ts | 0
.../shared/Waterfall/layout.ts | 0
.../WaterfallGallery/shared/utils.ts | 0
frontend/{ => legacy}/compiled/CHANGELOG.md | 0
.../compiled/components/FileView/index.svelte | 0
.../FileView/shared/FileView.svelte | 2 +-
.../compiled/components/Flow/index.svelte | 2 +-
.../compiled/components/Markdown/index.svelte | 2 +-
.../compiled/components/ReactComponent.svelte | 2 +-
frontend/{ => legacy}/compiled/global.d.ts | 0
frontend/{ => legacy}/compiled/index.ts | 2 +-
frontend/{ => legacy}/compiled/package.json | 38 +-
.../compiled/src/ComponentConfigProvider.tsx | 0
.../compiled/src/FileView/Pdf.tsx | 0
.../compiled/src/FileView/hooks/usePreview.ts | 0
.../compiled/src/FileView/index.less | 0
.../compiled/src/FileView/index.tsx | 0
.../compiled/src/Flow/FlowContext.ts | 0
.../src/Flow/components/CustomComponent.tsx | 0
.../src/Flow/components/FileUpload.tsx | 0
.../Flow/components/FormListItemWrapper.tsx | 0
.../Flow/flow-components/ConnectionHandle.tsx | 0
.../Flow/flow-components/ConnectionLine.tsx | 0
.../src/Flow/flow-components/Controls.tsx | 0
.../src/Flow/flow-components/Edge.tsx | 0
.../src/Flow/flow-components/Node.tsx | 0
.../src/Flow/flow-components/Sidebar.tsx | 0
.../{ => legacy}/compiled/src/Flow/i18n.ts | 0
.../{ => legacy}/compiled/src/Flow/index.less | 0
.../{ => legacy}/compiled/src/Flow/index.tsx | 0
.../{ => legacy}/compiled/src/Flow/type.ts | 0
.../{ => legacy}/compiled/src/Flow/utils.ts | 0
.../src/Markdown/components/Anchor.tsx | 0
.../src/Markdown/components/Audio.tsx | 0
.../compiled/src/Markdown/components/Code.tsx | 0
.../Markdown/components/CustomComponent.tsx | 0
.../src/Markdown/components/Heading.tsx | 0
.../src/Markdown/components/Image.tsx | 0
.../src/Markdown/components/Video.tsx | 0
.../Markdown/components/custom/Accordion.tsx | 0
.../src/Markdown/components/custom/Chart.tsx | 0
.../src/Markdown/components/custom/File.tsx | 0
.../components/custom/FlushingEnd.tsx | 0
.../Markdown/components/custom/SelectBox.tsx | 0
.../compiled/src/Markdown/context.ts | 0
.../src/Markdown/hooks/useCustomProps.ts | 0
.../compiled/src/Markdown/index.less | 0
.../compiled/src/Markdown/index.tsx | 0
.../compiled/src/Markdown/react-markdown.d.ts | 0
.../rehype-Inline-code-property.ts | 0
.../rehype-plugins/rehype-sanitize/index.d.ts | 0
.../rehype-plugins/rehype-sanitize/index.js | 0
.../rehype-plugins/rehype-sanitize/schema.js | 0
.../remark-plugins/remark-directive-rehype.ts | 0
.../compiled/src/Markdown/type.ts | 0
.../compiled/src/defineComponent.tsx | 0
frontend/{ => legacy}/compiled/src/index.ts | 0
frontend/{ => legacy}/compiled/src/mount.tsx | 0
.../{ => legacy}/compiled/src/polyfills.ts | 0
.../src/shared/hooks/useCustomComponent.ts | 0
.../src/shared/hooks/useMemoizedEqualValue.ts | 0
.../compiled/src/shared/hooks/useRefValue.ts | 0
.../{ => legacy}/compiled/src/shared/index.ts | 0
.../{ => legacy}/compiled/src/shared/type.ts | 0
frontend/{ => legacy}/compiled/src/utils.ts | 0
frontend/package.json | 46 +-
frontend/plugin.js | 168 +
frontend/shared/CHANGELOG.md | 23 -
frontend/svelte-preprocess-react/component.ts | 94 +
frontend/svelte-preprocess-react/context.ts | 16 +
.../events-polyfills.ts | 114 +
frontend/svelte-preprocess-react/index.ts | 8 +
frontend/svelte-preprocess-react/inject.ts | 95 +
.../internal/Bridge.ts | 92 +
.../svelte-preprocess-react/internal/Child.ts | 23 +
.../internal/ReactWrapper.svelte | 59 +
.../svelte-preprocess-react/internal/types.ts | 67 +
frontend/svelte-preprocess-react/polyfills.ts | 4 +
.../svelte-preprocess-react/react-slot.tsx | 121 +
frontend/svelte-preprocess-react/slot.ts | 170 +
frontend/svelte-preprocess-react/sveltify.ts | 88 +
frontend/svelte-preprocess-react/useStore.ts | 37 +
frontend/tsconfig.json | 7 +
frontend/utils/createFunction.ts | 11 +
frontend/utils/createItemsContext.tsx | 86 +
frontend/utils/hooks/useFunction.ts | 9 +
frontend/utils/hooks/useTargets.ts | 43 +
frontend/utils/omitUndefinedProps.ts | 10 +
frontend/utils/renderItems.tsx | 79 +
frontend/utils/renderSlot.tsx | 6 +
frontend/utils/styleObject2String.ts | 66 +
.../{shared/src/index.ts => utils/upload.ts} | 0
package.json | 39 +-
pnpm-lock.yaml | 5471 +++++++----------
pnpm-workspace.yaml | 4 +-
pyproject.toml | 161 +-
tsconfig.json | 20 +-
953 files changed, 33733 insertions(+), 3675 deletions(-)
delete mode 100644 backend/modelscope_studio/components/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/affix/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/alert/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/alert/error_boundary/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/anchor/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/anchor/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/auto_complete/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/auto_complete/option/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/avatar/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/avatar/group/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/badge/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/badge/ribbon/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/breadcrumb/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/breadcrumb/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/button/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/button/group/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/calendar/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/card/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/card/grid/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/card/meta/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/carousel/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/cascader/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/cascader/constants.py
create mode 100644 backend/modelscope_studio/components/antd/cascader/option/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/cascader/panel/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/checkbox/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/checkbox/group/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/checkbox/group/option/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/collapse/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/collapse/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/color_picker/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/color_picker/preset/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/config_provider/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/date_picker/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/date_picker/preset/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/date_picker/range_picker/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/descriptions/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/descriptions/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/divider/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/drawer/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/dropdown/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/dropdown/button/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/empty/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/flex/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/float_button/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/float_button/back_top/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/float_button/group/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/form/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/form/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/form/item/rule/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/grid/col/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/grid/row/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/icon/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/icon/iconfont_provider/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/image/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/image/preview_group/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/input/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/input/otp/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/input/password/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/input/search/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/input/textarea/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/input_number/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/layout/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/layout/content/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/layout/footer/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/layout/header/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/layout/sider/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/list/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/list/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/list/item/meta/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/mentions/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/mentions/option/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/menu/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/menu/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/message/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/modal/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/notification/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/pagination/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/popconfirm/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/popover/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/progress/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/qr_code/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/radio/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/radio/button/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/radio/group/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/radio/group/option/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/rate/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/result/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/segmented/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/segmented/option/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/select/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/select/option/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/skeleton/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/skeleton/avatar/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/skeleton/button/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/skeleton/image/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/skeleton/input/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/skeleton/node/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/slider/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/slider/mark/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/space/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/space/compact/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/spin/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/statistic/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/statistic/countdown/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/steps/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/steps/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/switch/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/table/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/table/column/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/table/column_group/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/table/constants.py
create mode 100644 backend/modelscope_studio/components/antd/table/expandable/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/table/row_selection/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/table/row_selection/selection/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tabs/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tabs/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tag/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tag/checkable_tag/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/time_picker/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/time_picker/range_picker/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/timeline/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/timeline/item/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tooltip/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tour/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tour/step/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/transfer/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tree/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tree/directory_tree/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tree/tree_node/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tree_select/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/tree_select/tree_node/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/typography/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/typography/link/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/typography/paragraph/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/typography/text/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/typography/title/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/upload/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/upload/dragger/__init__.py
create mode 100644 backend/modelscope_studio/components/antd/watermark/__init__.py
create mode 100644 backend/modelscope_studio/components/base/__init__.py
create mode 100644 backend/modelscope_studio/components/base/application/__init__.py
create mode 100644 backend/modelscope_studio/components/base/div/__init__.py
create mode 100644 backend/modelscope_studio/components/base/each/__init__.py
create mode 100644 backend/modelscope_studio/components/base/filter/__init__.py
create mode 100644 backend/modelscope_studio/components/base/fragment/__init__.py
create mode 100644 backend/modelscope_studio/components/base/slot/__init__.py
create mode 100644 backend/modelscope_studio/components/base/span/__init__.py
create mode 100644 backend/modelscope_studio/components/base/text/__init__.py
rename backend/modelscope_studio/components/{ => legacy}/Chatbot/__init__.py (98%)
rename backend/modelscope_studio/components/{ => legacy}/Chatbot/llm_thinking_presets.py (100%)
rename backend/modelscope_studio/components/{ => legacy}/Flow/__init__.py (97%)
rename backend/modelscope_studio/components/{ => legacy}/Flow/edge.py (100%)
rename backend/modelscope_studio/components/{ => legacy}/Flow/node.py (100%)
rename backend/modelscope_studio/components/{ => legacy}/Flow/node_schema.py (100%)
rename backend/modelscope_studio/components/{ => legacy}/Lifecycle/__init__.py (96%)
rename backend/modelscope_studio/components/{ => legacy}/Markdown/__init__.py (96%)
rename backend/modelscope_studio/components/{ => legacy}/MultimodalInput/__init__.py (98%)
rename backend/modelscope_studio/components/{ => legacy}/WaterfallGallery/__init__.py (99%)
create mode 100644 backend/modelscope_studio/components/legacy/__init__.py
rename backend/modelscope_studio/utils/{ => dev}/__init__.py (69%)
create mode 100644 backend/modelscope_studio/utils/dev/component.py
rename backend/modelscope_studio/utils/{ => dev}/process_links.py (100%)
create mode 100644 backend/modelscope_studio/utils/dev/resolve_frontend_dir.py
delete mode 100644 frontend/CHANGELOG.md
delete mode 100644 frontend/Chatbot/gradio.config.js
delete mode 100644 frontend/Chatbot/package.json
delete mode 100644 frontend/Flow/gradio.config.js
delete mode 100644 frontend/Markdown/gradio.config.js
delete mode 100644 frontend/MultimodalInput/gradio.config.js
delete mode 100644 frontend/MultimodalInput/package.json
delete mode 100644 frontend/WaterfallGallery/gradio.config.js
delete mode 100644 frontend/WaterfallGallery/package.json
create mode 100644 frontend/antd/affix/Index.svelte
create mode 100644 frontend/antd/affix/affix.tsx
create mode 100644 frontend/antd/affix/gradio.config.js
create mode 100644 frontend/antd/affix/package.json
create mode 100644 frontend/antd/alert/Index.svelte
create mode 100644 frontend/antd/alert/alert.tsx
create mode 100644 frontend/antd/alert/error-boundary/Index.svelte
create mode 100644 frontend/antd/alert/error-boundary/alert.error-boundary.tsx
create mode 100644 frontend/antd/alert/error-boundary/gradio.config.js
create mode 100644 frontend/antd/alert/error-boundary/package.json
create mode 100644 frontend/antd/alert/gradio.config.js
create mode 100644 frontend/antd/alert/package.json
create mode 100644 frontend/antd/anchor/Index.svelte
create mode 100644 frontend/antd/anchor/anchor.tsx
create mode 100644 frontend/antd/anchor/context.ts
create mode 100644 frontend/antd/anchor/gradio.config.js
create mode 100644 frontend/antd/anchor/item/Index.svelte
create mode 100644 frontend/antd/anchor/item/gradio.config.js
create mode 100644 frontend/antd/anchor/item/package.json
create mode 100644 frontend/antd/anchor/package.json
create mode 100644 frontend/antd/auto-complete/Index.svelte
create mode 100644 frontend/antd/auto-complete/auto-complete.tsx
create mode 100644 frontend/antd/auto-complete/context.ts
create mode 100644 frontend/antd/auto-complete/gradio.config.js
create mode 100644 frontend/antd/auto-complete/option/Index.svelte
create mode 100644 frontend/antd/auto-complete/option/gradio.config.js
create mode 100644 frontend/antd/auto-complete/option/package.json
create mode 100644 frontend/antd/auto-complete/package.json
create mode 100644 frontend/antd/avatar/Index.svelte
create mode 100644 frontend/antd/avatar/avatar.tsx
create mode 100644 frontend/antd/avatar/gradio.config.js
create mode 100644 frontend/antd/avatar/group/Index.svelte
create mode 100644 frontend/antd/avatar/group/avatar.group.tsx
create mode 100644 frontend/antd/avatar/group/gradio.config.js
create mode 100644 frontend/antd/avatar/group/package.json
create mode 100644 frontend/antd/avatar/package.json
create mode 100644 frontend/antd/badge/Index.svelte
create mode 100644 frontend/antd/badge/badge.tsx
create mode 100644 frontend/antd/badge/gradio.config.js
create mode 100644 frontend/antd/badge/package.json
create mode 100644 frontend/antd/badge/ribbon/Index.svelte
create mode 100644 frontend/antd/badge/ribbon/badge.ribbon.tsx
create mode 100644 frontend/antd/badge/ribbon/gradio.config.js
create mode 100644 frontend/antd/badge/ribbon/package.json
create mode 100644 frontend/antd/breadcrumb/Index.svelte
create mode 100644 frontend/antd/breadcrumb/breadcrumb.tsx
create mode 100644 frontend/antd/breadcrumb/context.ts
create mode 100644 frontend/antd/breadcrumb/gradio.config.js
create mode 100644 frontend/antd/breadcrumb/item/BreadcrumbItem.svelte
create mode 100644 frontend/antd/breadcrumb/item/Index.svelte
create mode 100644 frontend/antd/breadcrumb/item/gradio.config.js
create mode 100644 frontend/antd/breadcrumb/item/package.json
create mode 100644 frontend/antd/breadcrumb/package.json
create mode 100644 frontend/antd/button/Index.svelte
create mode 100644 frontend/antd/button/button.tsx
create mode 100644 frontend/antd/button/gradio.config.js
create mode 100644 frontend/antd/button/group/Index.svelte
create mode 100644 frontend/antd/button/group/button.group.less
create mode 100644 frontend/antd/button/group/button.group.tsx
create mode 100644 frontend/antd/button/group/gradio.config.js
create mode 100644 frontend/antd/button/group/package.json
create mode 100644 frontend/antd/button/package.json
create mode 100644 frontend/antd/calendar/Index.svelte
create mode 100644 frontend/antd/calendar/calendar.tsx
create mode 100644 frontend/antd/calendar/gradio.config.js
create mode 100644 frontend/antd/calendar/package.json
create mode 100644 frontend/antd/card/Index.svelte
create mode 100644 frontend/antd/card/card.tsx
create mode 100644 frontend/antd/card/gradio.config.js
create mode 100644 frontend/antd/card/grid/Index.svelte
create mode 100644 frontend/antd/card/grid/card.grid.tsx
create mode 100644 frontend/antd/card/grid/gradio.config.js
create mode 100644 frontend/antd/card/grid/package.json
create mode 100644 frontend/antd/card/meta/Index.svelte
create mode 100644 frontend/antd/card/meta/card.meta.tsx
create mode 100644 frontend/antd/card/meta/gradio.config.js
create mode 100644 frontend/antd/card/meta/package.json
create mode 100644 frontend/antd/card/package.json
create mode 100644 frontend/antd/carousel/Index.svelte
create mode 100644 frontend/antd/carousel/carousel.tsx
create mode 100644 frontend/antd/carousel/gradio.config.js
create mode 100644 frontend/antd/carousel/package.json
create mode 100644 frontend/antd/cascader/Index.svelte
create mode 100644 frontend/antd/cascader/cascader.tsx
create mode 100644 frontend/antd/cascader/context.ts
create mode 100644 frontend/antd/cascader/gradio.config.js
create mode 100644 frontend/antd/cascader/option/Index.svelte
create mode 100644 frontend/antd/cascader/option/gradio.config.js
create mode 100644 frontend/antd/cascader/option/package.json
create mode 100644 frontend/antd/cascader/package.json
create mode 100644 frontend/antd/cascader/panel/Index.svelte
create mode 100644 frontend/antd/cascader/panel/cascader.panel.tsx
create mode 100644 frontend/antd/cascader/panel/gradio.config.js
create mode 100644 frontend/antd/cascader/panel/package.json
create mode 100644 frontend/antd/checkbox/Index.svelte
create mode 100644 frontend/antd/checkbox/checkbox.tsx
create mode 100644 frontend/antd/checkbox/context.ts
create mode 100644 frontend/antd/checkbox/gradio.config.js
create mode 100644 frontend/antd/checkbox/group/Index.svelte
create mode 100644 frontend/antd/checkbox/group/checkbox.group.tsx
create mode 100644 frontend/antd/checkbox/group/gradio.config.js
create mode 100644 frontend/antd/checkbox/group/option/Index.svelte
create mode 100644 frontend/antd/checkbox/group/option/gradio.config.js
create mode 100644 frontend/antd/checkbox/group/option/package.json
create mode 100644 frontend/antd/checkbox/group/package.json
create mode 100644 frontend/antd/checkbox/package.json
create mode 100644 frontend/antd/collapse/Index.svelte
create mode 100644 frontend/antd/collapse/collapse.tsx
create mode 100644 frontend/antd/collapse/context.ts
create mode 100644 frontend/antd/collapse/gradio.config.js
create mode 100644 frontend/antd/collapse/item/Index.svelte
create mode 100644 frontend/antd/collapse/item/gradio.config.js
create mode 100644 frontend/antd/collapse/item/package.json
create mode 100644 frontend/antd/collapse/package.json
create mode 100644 frontend/antd/color-picker/Index.svelte
create mode 100644 frontend/antd/color-picker/color-picker.tsx
create mode 100644 frontend/antd/color-picker/context.ts
create mode 100644 frontend/antd/color-picker/gradio.config.js
create mode 100644 frontend/antd/color-picker/package.json
create mode 100644 frontend/antd/color-picker/preset/Index.svelte
create mode 100644 frontend/antd/color-picker/preset/gradio.config.js
create mode 100644 frontend/antd/color-picker/preset/package.json
create mode 100644 frontend/antd/config-provider/Index.svelte
create mode 100644 frontend/antd/config-provider/config-provider.tsx
create mode 100644 frontend/antd/config-provider/gradio.config.js
create mode 100644 frontend/antd/config-provider/locales.ts
create mode 100644 frontend/antd/config-provider/package.json
create mode 100644 frontend/antd/date-picker/Index.svelte
create mode 100644 frontend/antd/date-picker/context.ts
create mode 100644 frontend/antd/date-picker/date-picker.tsx
create mode 100644 frontend/antd/date-picker/gradio.config.js
create mode 100644 frontend/antd/date-picker/package.json
create mode 100644 frontend/antd/date-picker/preset/Index.svelte
create mode 100644 frontend/antd/date-picker/preset/gradio.config.js
create mode 100644 frontend/antd/date-picker/preset/package.json
create mode 100644 frontend/antd/date-picker/range-picker/Index.svelte
create mode 100644 frontend/antd/date-picker/range-picker/date-picker.range-picker.tsx
create mode 100644 frontend/antd/date-picker/range-picker/gradio.config.js
create mode 100644 frontend/antd/date-picker/range-picker/package.json
create mode 100644 frontend/antd/descriptions/Index.svelte
create mode 100644 frontend/antd/descriptions/context.ts
create mode 100644 frontend/antd/descriptions/descriptions.tsx
create mode 100644 frontend/antd/descriptions/gradio.config.js
create mode 100644 frontend/antd/descriptions/item/Index.svelte
create mode 100644 frontend/antd/descriptions/item/gradio.config.js
create mode 100644 frontend/antd/descriptions/item/package.json
create mode 100644 frontend/antd/descriptions/package.json
create mode 100644 frontend/antd/divider/Index.svelte
create mode 100644 frontend/antd/divider/divider.tsx
create mode 100644 frontend/antd/divider/gradio.config.js
create mode 100644 frontend/antd/divider/package.json
create mode 100644 frontend/antd/drawer/Index.svelte
create mode 100644 frontend/antd/drawer/drawer.tsx
create mode 100644 frontend/antd/drawer/gradio.config.js
create mode 100644 frontend/antd/drawer/package.json
create mode 100644 frontend/antd/dropdown/Index.svelte
create mode 100644 frontend/antd/dropdown/button/Index.svelte
create mode 100644 frontend/antd/dropdown/button/dropdown.button.tsx
create mode 100644 frontend/antd/dropdown/button/gradio.config.js
create mode 100644 frontend/antd/dropdown/button/package.json
create mode 100644 frontend/antd/dropdown/dropdown.tsx
create mode 100644 frontend/antd/dropdown/gradio.config.js
create mode 100644 frontend/antd/dropdown/package.json
create mode 100644 frontend/antd/empty/Index.svelte
create mode 100644 frontend/antd/empty/empty.tsx
create mode 100644 frontend/antd/empty/gradio.config.js
create mode 100644 frontend/antd/empty/package.json
create mode 100644 frontend/antd/flex/Index.svelte
create mode 100644 frontend/antd/flex/flex.tsx
create mode 100644 frontend/antd/flex/gradio.config.js
create mode 100644 frontend/antd/flex/package.json
create mode 100644 frontend/antd/float-button/Index.svelte
create mode 100644 frontend/antd/float-button/back-top/Index.svelte
create mode 100644 frontend/antd/float-button/back-top/float-button.back-top.tsx
create mode 100644 frontend/antd/float-button/back-top/gradio.config.js
create mode 100644 frontend/antd/float-button/back-top/package.json
create mode 100644 frontend/antd/float-button/float-button.tsx
create mode 100644 frontend/antd/float-button/gradio.config.js
create mode 100644 frontend/antd/float-button/group/Index.svelte
create mode 100644 frontend/antd/float-button/group/float-button.group.less
create mode 100644 frontend/antd/float-button/group/float-button.group.tsx
create mode 100644 frontend/antd/float-button/group/gradio.config.js
create mode 100644 frontend/antd/float-button/group/package.json
create mode 100644 frontend/antd/float-button/package.json
create mode 100644 frontend/antd/form/Index.svelte
create mode 100644 frontend/antd/form/context.ts
create mode 100644 frontend/antd/form/form.tsx
create mode 100644 frontend/antd/form/gradio.config.js
create mode 100644 frontend/antd/form/item/Index.svelte
create mode 100644 frontend/antd/form/item/form.item.tsx
create mode 100644 frontend/antd/form/item/gradio.config.js
create mode 100644 frontend/antd/form/item/package.json
create mode 100644 frontend/antd/form/item/rule/Index.svelte
create mode 100644 frontend/antd/form/item/rule/global.css
create mode 100644 frontend/antd/form/item/rule/gradio.config.js
create mode 100644 frontend/antd/form/item/rule/package.json
create mode 100644 frontend/antd/form/package.json
create mode 100644 frontend/antd/grid/col/Index.svelte
create mode 100644 frontend/antd/grid/col/gradio.config.js
create mode 100644 frontend/antd/grid/col/package.json
create mode 100644 frontend/antd/grid/context.ts
create mode 100644 frontend/antd/grid/row/Index.svelte
create mode 100644 frontend/antd/grid/row/gradio.config.js
create mode 100644 frontend/antd/grid/row/package.json
create mode 100644 frontend/antd/grid/row/row.tsx
create mode 100644 frontend/antd/icon/Index.svelte
create mode 100644 frontend/antd/icon/gradio.config.js
create mode 100644 frontend/antd/icon/icon.tsx
create mode 100644 frontend/antd/icon/iconfont-provider/Index.svelte
create mode 100644 frontend/antd/icon/iconfont-provider/context.ts
create mode 100644 frontend/antd/icon/iconfont-provider/create-iconfont.ts
create mode 100644 frontend/antd/icon/iconfont-provider/gradio.config.js
create mode 100644 frontend/antd/icon/iconfont-provider/package.json
create mode 100644 frontend/antd/icon/package.json
create mode 100644 frontend/antd/image/Index.svelte
create mode 100644 frontend/antd/image/gradio.config.js
create mode 100644 frontend/antd/image/image.tsx
create mode 100644 frontend/antd/image/package.json
create mode 100644 frontend/antd/image/preview-group/Index.svelte
create mode 100644 frontend/antd/image/preview-group/gradio.config.js
create mode 100644 frontend/antd/image/preview-group/image.preview-group.tsx
create mode 100644 frontend/antd/image/preview-group/package.json
create mode 100644 frontend/antd/input-number/Index.svelte
create mode 100644 frontend/antd/input-number/gradio.config.js
create mode 100644 frontend/antd/input-number/input-number.tsx
create mode 100644 frontend/antd/input-number/package.json
create mode 100644 frontend/antd/input/Index.svelte
create mode 100644 frontend/antd/input/gradio.config.js
create mode 100644 frontend/antd/input/input.tsx
create mode 100644 frontend/antd/input/otp/Index.svelte
create mode 100644 frontend/antd/input/otp/gradio.config.js
create mode 100644 frontend/antd/input/otp/input.otp.tsx
create mode 100644 frontend/antd/input/otp/package.json
create mode 100644 frontend/antd/input/package.json
create mode 100644 frontend/antd/input/password/Index.svelte
create mode 100644 frontend/antd/input/password/gradio.config.js
create mode 100644 frontend/antd/input/password/input.password.tsx
create mode 100644 frontend/antd/input/password/package.json
create mode 100644 frontend/antd/input/search/Index.svelte
create mode 100644 frontend/antd/input/search/gradio.config.js
create mode 100644 frontend/antd/input/search/input.search.tsx
create mode 100644 frontend/antd/input/search/package.json
create mode 100644 frontend/antd/input/textarea/Index.svelte
create mode 100644 frontend/antd/input/textarea/gradio.config.js
create mode 100644 frontend/antd/input/textarea/input.textarea.tsx
create mode 100644 frontend/antd/input/textarea/package.json
create mode 100644 frontend/antd/layout/Base.svelte
create mode 100644 frontend/antd/layout/Index.svelte
create mode 100644 frontend/antd/layout/content/Index.svelte
create mode 100644 frontend/antd/layout/content/gradio.config.js
create mode 100644 frontend/antd/layout/content/package.json
create mode 100644 frontend/antd/layout/footer/Index.svelte
create mode 100644 frontend/antd/layout/footer/gradio.config.js
create mode 100644 frontend/antd/layout/footer/package.json
create mode 100644 frontend/antd/layout/gradio.config.js
create mode 100644 frontend/antd/layout/header/Index.svelte
create mode 100644 frontend/antd/layout/header/gradio.config.js
create mode 100644 frontend/antd/layout/header/package.json
create mode 100644 frontend/antd/layout/layout.base.tsx
create mode 100644 frontend/antd/layout/package.json
create mode 100644 frontend/antd/layout/sider/Index.svelte
create mode 100644 frontend/antd/layout/sider/gradio.config.js
create mode 100644 frontend/antd/layout/sider/layout.sider.tsx
create mode 100644 frontend/antd/layout/sider/package.json
create mode 100644 frontend/antd/list/Index.svelte
create mode 100644 frontend/antd/list/gradio.config.js
create mode 100644 frontend/antd/list/item/Index.svelte
create mode 100644 frontend/antd/list/item/gradio.config.js
create mode 100644 frontend/antd/list/item/list.item.tsx
create mode 100644 frontend/antd/list/item/meta/Index.svelte
create mode 100644 frontend/antd/list/item/meta/gradio.config.js
create mode 100644 frontend/antd/list/item/meta/list.item.meta.tsx
create mode 100644 frontend/antd/list/item/meta/package.json
create mode 100644 frontend/antd/list/item/package.json
create mode 100644 frontend/antd/list/list.tsx
create mode 100644 frontend/antd/list/package.json
create mode 100644 frontend/antd/mentions/Index.svelte
create mode 100644 frontend/antd/mentions/context.ts
create mode 100644 frontend/antd/mentions/gradio.config.js
create mode 100644 frontend/antd/mentions/mentions.tsx
create mode 100644 frontend/antd/mentions/option/Index.svelte
create mode 100644 frontend/antd/mentions/option/gradio.config.js
create mode 100644 frontend/antd/mentions/option/package.json
create mode 100644 frontend/antd/mentions/package.json
create mode 100644 frontend/antd/menu/Index.svelte
create mode 100644 frontend/antd/menu/context.ts
create mode 100644 frontend/antd/menu/gradio.config.js
create mode 100644 frontend/antd/menu/item/Index.svelte
create mode 100644 frontend/antd/menu/item/gradio.config.js
create mode 100644 frontend/antd/menu/item/package.json
create mode 100644 frontend/antd/menu/menu.tsx
create mode 100644 frontend/antd/menu/package.json
create mode 100644 frontend/antd/message/Index.svelte
create mode 100644 frontend/antd/message/gradio.config.js
create mode 100644 frontend/antd/message/message.tsx
create mode 100644 frontend/antd/message/package.json
create mode 100644 frontend/antd/modal/Index.svelte
create mode 100644 frontend/antd/modal/gradio.config.js
create mode 100644 frontend/antd/modal/modal.tsx
create mode 100644 frontend/antd/modal/package.json
create mode 100644 frontend/antd/notification/Index.svelte
create mode 100644 frontend/antd/notification/gradio.config.js
create mode 100644 frontend/antd/notification/notification.tsx
create mode 100644 frontend/antd/notification/package.json
create mode 100644 frontend/antd/pagination/Index.svelte
create mode 100644 frontend/antd/pagination/gradio.config.js
create mode 100644 frontend/antd/pagination/package.json
create mode 100644 frontend/antd/pagination/pagination.tsx
create mode 100644 frontend/antd/popconfirm/Index.svelte
create mode 100644 frontend/antd/popconfirm/gradio.config.js
create mode 100644 frontend/antd/popconfirm/package.json
create mode 100644 frontend/antd/popconfirm/popconfirm.tsx
create mode 100644 frontend/antd/popover/Index.svelte
create mode 100644 frontend/antd/popover/gradio.config.js
create mode 100644 frontend/antd/popover/package.json
create mode 100644 frontend/antd/popover/popover.tsx
create mode 100644 frontend/antd/progress/Index.svelte
create mode 100644 frontend/antd/progress/gradio.config.js
create mode 100644 frontend/antd/progress/package.json
create mode 100644 frontend/antd/progress/progress.tsx
create mode 100644 frontend/antd/qr-code/Index.svelte
create mode 100644 frontend/antd/qr-code/gradio.config.js
create mode 100644 frontend/antd/qr-code/package.json
create mode 100644 frontend/antd/qr-code/qr-code.tsx
create mode 100644 frontend/antd/radio/Index.svelte
create mode 100644 frontend/antd/radio/button/Index.svelte
create mode 100644 frontend/antd/radio/button/gradio.config.js
create mode 100644 frontend/antd/radio/button/package.json
create mode 100644 frontend/antd/radio/button/radio.button.tsx
create mode 100644 frontend/antd/radio/context.ts
create mode 100644 frontend/antd/radio/gradio.config.js
create mode 100644 frontend/antd/radio/group/Index.svelte
create mode 100644 frontend/antd/radio/group/gradio.config.js
create mode 100644 frontend/antd/radio/group/option/Index.svelte
create mode 100644 frontend/antd/radio/group/option/gradio.config.js
create mode 100644 frontend/antd/radio/group/option/package.json
create mode 100644 frontend/antd/radio/group/package.json
create mode 100644 frontend/antd/radio/group/radio.group.less
create mode 100644 frontend/antd/radio/group/radio.group.tsx
create mode 100644 frontend/antd/radio/package.json
create mode 100644 frontend/antd/radio/radio.tsx
create mode 100644 frontend/antd/rate/Index.svelte
create mode 100644 frontend/antd/rate/gradio.config.js
create mode 100644 frontend/antd/rate/package.json
create mode 100644 frontend/antd/rate/rate.tsx
create mode 100644 frontend/antd/result/Index.svelte
create mode 100644 frontend/antd/result/gradio.config.js
create mode 100644 frontend/antd/result/package.json
create mode 100644 frontend/antd/result/result.tsx
create mode 100644 frontend/antd/segmented/Index.svelte
create mode 100644 frontend/antd/segmented/context.ts
create mode 100644 frontend/antd/segmented/gradio.config.js
create mode 100644 frontend/antd/segmented/option/Index.svelte
create mode 100644 frontend/antd/segmented/option/gradio.config.js
create mode 100644 frontend/antd/segmented/option/package.json
create mode 100644 frontend/antd/segmented/package.json
create mode 100644 frontend/antd/segmented/segmented.tsx
create mode 100644 frontend/antd/select/Index.svelte
create mode 100644 frontend/antd/select/context.ts
create mode 100644 frontend/antd/select/gradio.config.js
create mode 100644 frontend/antd/select/option/Index.svelte
create mode 100644 frontend/antd/select/option/gradio.config.js
create mode 100644 frontend/antd/select/option/package.json
create mode 100644 frontend/antd/select/package.json
create mode 100644 frontend/antd/select/select.tsx
create mode 100644 frontend/antd/skeleton/Index.svelte
create mode 100644 frontend/antd/skeleton/avatar/Index.svelte
create mode 100644 frontend/antd/skeleton/avatar/gradio.config.js
create mode 100644 frontend/antd/skeleton/avatar/package.json
create mode 100644 frontend/antd/skeleton/avatar/skeleton.avatar.tsx
create mode 100644 frontend/antd/skeleton/button/Index.svelte
create mode 100644 frontend/antd/skeleton/button/gradio.config.js
create mode 100644 frontend/antd/skeleton/button/package.json
create mode 100644 frontend/antd/skeleton/button/skeleton.button.tsx
create mode 100644 frontend/antd/skeleton/gradio.config.js
create mode 100644 frontend/antd/skeleton/image/Index.svelte
create mode 100644 frontend/antd/skeleton/image/gradio.config.js
create mode 100644 frontend/antd/skeleton/image/package.json
create mode 100644 frontend/antd/skeleton/image/skeleton.image.tsx
create mode 100644 frontend/antd/skeleton/input/Index.svelte
create mode 100644 frontend/antd/skeleton/input/gradio.config.js
create mode 100644 frontend/antd/skeleton/input/package.json
create mode 100644 frontend/antd/skeleton/input/skeleton.input.tsx
create mode 100644 frontend/antd/skeleton/node/Index.svelte
create mode 100644 frontend/antd/skeleton/node/gradio.config.js
create mode 100644 frontend/antd/skeleton/node/package.json
create mode 100644 frontend/antd/skeleton/node/skeleton.node.tsx
create mode 100644 frontend/antd/skeleton/package.json
create mode 100644 frontend/antd/skeleton/skeleton.tsx
create mode 100644 frontend/antd/slider/Index.svelte
create mode 100644 frontend/antd/slider/context.ts
create mode 100644 frontend/antd/slider/gradio.config.js
create mode 100644 frontend/antd/slider/mark/Index.svelte
create mode 100644 frontend/antd/slider/mark/gradio.config.js
create mode 100644 frontend/antd/slider/mark/package.json
create mode 100644 frontend/antd/slider/package.json
create mode 100644 frontend/antd/slider/slider.tsx
create mode 100644 frontend/antd/space/Index.svelte
create mode 100644 frontend/antd/space/compact/Index.svelte
create mode 100644 frontend/antd/space/compact/gradio.config.js
create mode 100644 frontend/antd/space/compact/package.json
create mode 100644 frontend/antd/space/compact/space.compact.tsx
create mode 100644 frontend/antd/space/gradio.config.js
create mode 100644 frontend/antd/space/package.json
create mode 100644 frontend/antd/space/space.tsx
create mode 100644 frontend/antd/spin/Index.svelte
create mode 100644 frontend/antd/spin/gradio.config.js
create mode 100644 frontend/antd/spin/package.json
create mode 100644 frontend/antd/spin/spin.tsx
create mode 100644 frontend/antd/statistic/Index.svelte
create mode 100644 frontend/antd/statistic/countdown/Index.svelte
create mode 100644 frontend/antd/statistic/countdown/gradio.config.js
create mode 100644 frontend/antd/statistic/countdown/package.json
create mode 100644 frontend/antd/statistic/countdown/statistic.countdown.tsx
create mode 100644 frontend/antd/statistic/gradio.config.js
create mode 100644 frontend/antd/statistic/package.json
create mode 100644 frontend/antd/statistic/statistic.tsx
create mode 100644 frontend/antd/steps/Index.svelte
create mode 100644 frontend/antd/steps/context.ts
create mode 100644 frontend/antd/steps/gradio.config.js
create mode 100644 frontend/antd/steps/item/Index.svelte
create mode 100644 frontend/antd/steps/item/gradio.config.js
create mode 100644 frontend/antd/steps/item/package.json
create mode 100644 frontend/antd/steps/package.json
create mode 100644 frontend/antd/steps/steps.tsx
create mode 100644 frontend/antd/switch/Index.svelte
create mode 100644 frontend/antd/switch/gradio.config.js
create mode 100644 frontend/antd/switch/package.json
create mode 100644 frontend/antd/switch/switch.tsx
create mode 100644 frontend/antd/table/Index.svelte
create mode 100644 frontend/antd/table/column-group/Index.svelte
create mode 100644 frontend/antd/table/column-group/gradio.config.js
create mode 100644 frontend/antd/table/column-group/package.json
create mode 100644 frontend/antd/table/column/Index.svelte
create mode 100644 frontend/antd/table/column/gradio.config.js
create mode 100644 frontend/antd/table/column/package.json
create mode 100644 frontend/antd/table/context.ts
create mode 100644 frontend/antd/table/expandable/Expandable.svelte
create mode 100644 frontend/antd/table/expandable/Index.svelte
create mode 100644 frontend/antd/table/expandable/gradio.config.js
create mode 100644 frontend/antd/table/expandable/package.json
create mode 100644 frontend/antd/table/gradio.config.js
create mode 100644 frontend/antd/table/package.json
create mode 100644 frontend/antd/table/row-selection/Index.svelte
create mode 100644 frontend/antd/table/row-selection/RowSelection.svelte
create mode 100644 frontend/antd/table/row-selection/gradio.config.js
create mode 100644 frontend/antd/table/row-selection/package.json
create mode 100644 frontend/antd/table/row-selection/selection/Index.svelte
create mode 100644 frontend/antd/table/row-selection/selection/gradio.config.js
create mode 100644 frontend/antd/table/row-selection/selection/package.json
create mode 100644 frontend/antd/table/table.tsx
create mode 100644 frontend/antd/tabs/Index.svelte
create mode 100644 frontend/antd/tabs/context.ts
create mode 100644 frontend/antd/tabs/gradio.config.js
create mode 100644 frontend/antd/tabs/item/Index.svelte
create mode 100644 frontend/antd/tabs/item/gradio.config.js
create mode 100644 frontend/antd/tabs/item/package.json
create mode 100644 frontend/antd/tabs/package.json
create mode 100644 frontend/antd/tabs/tabs.tsx
create mode 100644 frontend/antd/tag/Index.svelte
create mode 100644 frontend/antd/tag/checkable-tag/Index.svelte
create mode 100644 frontend/antd/tag/checkable-tag/gradio.config.js
create mode 100644 frontend/antd/tag/checkable-tag/package.json
create mode 100644 frontend/antd/tag/checkable-tag/tag.checkable-tag.tsx
create mode 100644 frontend/antd/tag/gradio.config.js
create mode 100644 frontend/antd/tag/package.json
create mode 100644 frontend/antd/tag/tag.tsx
create mode 100644 frontend/antd/time-picker/Index.svelte
create mode 100644 frontend/antd/time-picker/gradio.config.js
create mode 100644 frontend/antd/time-picker/package.json
create mode 100644 frontend/antd/time-picker/range-picker/Index.svelte
create mode 100644 frontend/antd/time-picker/range-picker/gradio.config.js
create mode 100644 frontend/antd/time-picker/range-picker/package.json
create mode 100644 frontend/antd/time-picker/range-picker/time-picker.range-picker.tsx
create mode 100644 frontend/antd/time-picker/time-picker.tsx
create mode 100644 frontend/antd/timeline/Index.svelte
create mode 100644 frontend/antd/timeline/context.ts
create mode 100644 frontend/antd/timeline/gradio.config.js
create mode 100644 frontend/antd/timeline/item/Index.svelte
create mode 100644 frontend/antd/timeline/item/gradio.config.js
create mode 100644 frontend/antd/timeline/item/package.json
create mode 100644 frontend/antd/timeline/package.json
create mode 100644 frontend/antd/timeline/timeline.tsx
create mode 100644 frontend/antd/tooltip/Index.svelte
create mode 100644 frontend/antd/tooltip/gradio.config.js
create mode 100644 frontend/antd/tooltip/package.json
create mode 100644 frontend/antd/tooltip/tooltip.tsx
create mode 100644 frontend/antd/tour/Index.svelte
create mode 100644 frontend/antd/tour/context.ts
create mode 100644 frontend/antd/tour/gradio.config.js
create mode 100644 frontend/antd/tour/package.json
create mode 100644 frontend/antd/tour/step/Index.svelte
create mode 100644 frontend/antd/tour/step/gradio.config.js
create mode 100644 frontend/antd/tour/step/package.json
create mode 100644 frontend/antd/tour/tour.tsx
create mode 100644 frontend/antd/transfer/Index.svelte
create mode 100644 frontend/antd/transfer/gradio.config.js
create mode 100644 frontend/antd/transfer/package.json
create mode 100644 frontend/antd/transfer/transfer.tsx
create mode 100644 frontend/antd/tree-select/Index.svelte
create mode 100644 frontend/antd/tree-select/context.ts
create mode 100644 frontend/antd/tree-select/gradio.config.js
create mode 100644 frontend/antd/tree-select/package.json
create mode 100644 frontend/antd/tree-select/tree-node/Index.svelte
create mode 100644 frontend/antd/tree-select/tree-node/gradio.config.js
create mode 100644 frontend/antd/tree-select/tree-node/package.json
create mode 100644 frontend/antd/tree-select/tree-select.tsx
create mode 100644 frontend/antd/tree/Index.svelte
create mode 100644 frontend/antd/tree/context.ts
create mode 100644 frontend/antd/tree/directory-tree/Index.svelte
create mode 100644 frontend/antd/tree/directory-tree/gradio.config.js
create mode 100644 frontend/antd/tree/directory-tree/package.json
create mode 100644 frontend/antd/tree/gradio.config.js
create mode 100644 frontend/antd/tree/package.json
create mode 100644 frontend/antd/tree/tree-node/Index.svelte
create mode 100644 frontend/antd/tree/tree-node/gradio.config.js
create mode 100644 frontend/antd/tree/tree-node/package.json
create mode 100644 frontend/antd/tree/tree.tsx
create mode 100644 frontend/antd/typography/Base.svelte
create mode 100644 frontend/antd/typography/link/Index.svelte
create mode 100644 frontend/antd/typography/link/gradio.config.js
create mode 100644 frontend/antd/typography/link/package.json
create mode 100644 frontend/antd/typography/paragraph/Index.svelte
create mode 100644 frontend/antd/typography/paragraph/gradio.config.js
create mode 100644 frontend/antd/typography/paragraph/package.json
create mode 100644 frontend/antd/typography/text/Index.svelte
create mode 100644 frontend/antd/typography/text/gradio.config.js
create mode 100644 frontend/antd/typography/text/package.json
create mode 100644 frontend/antd/typography/title/Index.svelte
create mode 100644 frontend/antd/typography/title/gradio.config.js
create mode 100644 frontend/antd/typography/title/package.json
create mode 100644 frontend/antd/typography/typography.base.tsx
create mode 100644 frontend/antd/upload/Index.svelte
create mode 100644 frontend/antd/upload/dragger/Index.svelte
create mode 100644 frontend/antd/upload/dragger/gradio.config.js
create mode 100644 frontend/antd/upload/dragger/package.json
create mode 100644 frontend/antd/upload/dragger/upload.dragger.tsx
create mode 100644 frontend/antd/upload/gradio.config.js
create mode 100644 frontend/antd/upload/package.json
create mode 100644 frontend/antd/upload/upload.tsx
create mode 100644 frontend/antd/watermark/Index.svelte
create mode 100644 frontend/antd/watermark/gradio.config.js
create mode 100644 frontend/antd/watermark/package.json
create mode 100644 frontend/antd/watermark/watermark.tsx
create mode 100644 frontend/base/application/Index.svelte
create mode 100644 frontend/base/application/gradio.config.js
create mode 100644 frontend/base/application/package.json
create mode 100644 frontend/base/div/Index.svelte
create mode 100644 frontend/base/div/gradio.config.js
create mode 100644 frontend/base/div/package.json
create mode 100644 frontend/base/each/Each.svelte
create mode 100644 frontend/base/each/Index.svelte
create mode 100644 frontend/base/each/gradio.config.js
create mode 100644 frontend/base/each/package.json
create mode 100644 frontend/base/filter/Index.svelte
create mode 100644 frontend/base/filter/gradio.config.js
create mode 100644 frontend/base/filter/package.json
create mode 100644 frontend/base/fragment/Index.svelte
create mode 100644 frontend/base/fragment/ShowFragment.svelte
create mode 100644 frontend/base/fragment/fragment.tsx
create mode 100644 frontend/base/fragment/gradio.config.js
create mode 100644 frontend/base/fragment/package.json
create mode 100644 frontend/base/slot/Index.svelte
create mode 100644 frontend/base/slot/gradio.config.js
create mode 100644 frontend/base/slot/package.json
create mode 100644 frontend/base/span/Index.svelte
create mode 100644 frontend/base/span/gradio.config.js
create mode 100644 frontend/base/span/package.json
create mode 100644 frontend/base/text/Index.svelte
create mode 100644 frontend/base/text/global.css
create mode 100644 frontend/base/text/gradio.config.js
create mode 100644 frontend/base/text/package.json
delete mode 100644 frontend/compiled/tsconfig.build.json
delete mode 100644 frontend/compiled/tsconfig.json
delete mode 100644 frontend/compiled/tsconfig.node.json
delete mode 100644 frontend/compiled/vite.config.ts
create mode 100644 frontend/defineConfig.js
rename fixtures.d.ts => frontend/fixtures.d.ts (62%)
rename frontend/{ => legacy}/Chatbot/CHANGELOG.md (100%)
rename frontend/{ => legacy}/Chatbot/Index.svelte (99%)
create mode 100644 frontend/legacy/Chatbot/gradio.config.js
rename frontend/{Lifecycle => legacy/Chatbot}/package.json (68%)
rename frontend/{ => legacy}/Chatbot/shared/ChatBot.svelte (99%)
rename frontend/{ => legacy}/Chatbot/shared/Copy.svelte (100%)
rename frontend/{ => legacy}/Chatbot/shared/FlushingMarkdown.svelte (100%)
rename frontend/{ => legacy}/Chatbot/shared/LikeDislike.svelte (100%)
rename frontend/{ => legacy}/Chatbot/shared/Pending.svelte (100%)
rename frontend/{ => legacy}/Chatbot/shared/llm-thinking-presets.ts (100%)
rename frontend/{ => legacy}/Chatbot/shared/utils.ts (100%)
rename frontend/{ => legacy}/Flow/CHANGELOG.md (100%)
rename frontend/{ => legacy}/Flow/Index.svelte (97%)
create mode 100644 frontend/legacy/Flow/gradio.config.js
rename frontend/{ => legacy}/Flow/package.json (53%)
rename frontend/{ => legacy}/Flow/schema.json (100%)
rename frontend/{ => legacy}/Flow/schema.ts (100%)
rename frontend/{ => legacy}/Flow/shared/Flow.svelte (97%)
rename frontend/{ => legacy}/Flow/shared/utils.ts (100%)
rename frontend/{ => legacy}/Lifecycle/CHANGELOG.md (100%)
create mode 100644 frontend/legacy/Lifecycle/gradio.config.js
rename frontend/{ => legacy}/Lifecycle/index.svelte (100%)
create mode 100644 frontend/legacy/Lifecycle/package.json
rename frontend/{ => legacy}/Lifecycle/shared/utils.ts (100%)
rename frontend/{ => legacy}/Markdown/CHANGELOG.md (100%)
rename frontend/{ => legacy}/Markdown/Example.svelte (100%)
rename frontend/{ => legacy}/Markdown/Index.svelte (100%)
create mode 100644 frontend/legacy/Markdown/gradio.config.js
rename frontend/{ => legacy}/Markdown/package.json (60%)
rename frontend/{ => legacy}/Markdown/shared/Markdown.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/CHANGELOG.md (100%)
rename frontend/{ => legacy}/MultimodalInput/Example.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/Index.svelte (99%)
create mode 100644 frontend/legacy/MultimodalInput/gradio.config.js
create mode 100644 frontend/legacy/MultimodalInput/package.json
rename frontend/{ => legacy}/MultimodalInput/shared/AudioRecorder.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/FilePreview.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/Input.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/Loader.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/RemoveIcon.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/SubmitButton.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/UploadButton.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/UploadIcon.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/Webcam.svelte (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/context.ts (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/global.d.ts (100%)
rename frontend/{ => legacy}/MultimodalInput/shared/utils.ts (100%)
rename frontend/{ => legacy}/WaterfallGallery/CHANGELOG.md (100%)
rename frontend/{ => legacy}/WaterfallGallery/Index.svelte (100%)
create mode 100644 frontend/legacy/WaterfallGallery/gradio.config.js
rename frontend/{shared => legacy/WaterfallGallery}/package.json (57%)
rename frontend/{ => legacy}/WaterfallGallery/shared/Dislike.svelte (100%)
rename frontend/{ => legacy}/WaterfallGallery/shared/Gallery.svelte (99%)
rename frontend/{ => legacy}/WaterfallGallery/shared/Image.svelte (100%)
rename frontend/{ => legacy}/WaterfallGallery/shared/Waterfall/createWaterfall.ts (100%)
rename frontend/{ => legacy}/WaterfallGallery/shared/Waterfall/index.ts (100%)
rename frontend/{ => legacy}/WaterfallGallery/shared/Waterfall/layout.ts (100%)
rename frontend/{ => legacy}/WaterfallGallery/shared/utils.ts (100%)
rename frontend/{ => legacy}/compiled/CHANGELOG.md (100%)
rename frontend/{ => legacy}/compiled/components/FileView/index.svelte (100%)
rename frontend/{ => legacy}/compiled/components/FileView/shared/FileView.svelte (83%)
rename frontend/{ => legacy}/compiled/components/Flow/index.svelte (86%)
rename frontend/{ => legacy}/compiled/components/Markdown/index.svelte (86%)
rename frontend/{ => legacy}/compiled/components/ReactComponent.svelte (95%)
rename frontend/{ => legacy}/compiled/global.d.ts (100%)
rename frontend/{ => legacy}/compiled/index.ts (87%)
rename frontend/{ => legacy}/compiled/package.json (50%)
rename frontend/{ => legacy}/compiled/src/ComponentConfigProvider.tsx (100%)
rename frontend/{ => legacy}/compiled/src/FileView/Pdf.tsx (100%)
rename frontend/{ => legacy}/compiled/src/FileView/hooks/usePreview.ts (100%)
rename frontend/{ => legacy}/compiled/src/FileView/index.less (100%)
rename frontend/{ => legacy}/compiled/src/FileView/index.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/FlowContext.ts (100%)
rename frontend/{ => legacy}/compiled/src/Flow/components/CustomComponent.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/components/FileUpload.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/components/FormListItemWrapper.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/flow-components/ConnectionHandle.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/flow-components/ConnectionLine.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/flow-components/Controls.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/flow-components/Edge.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/flow-components/Node.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/flow-components/Sidebar.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/i18n.ts (100%)
rename frontend/{ => legacy}/compiled/src/Flow/index.less (100%)
rename frontend/{ => legacy}/compiled/src/Flow/index.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Flow/type.ts (100%)
rename frontend/{ => legacy}/compiled/src/Flow/utils.ts (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/Anchor.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/Audio.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/Code.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/CustomComponent.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/Heading.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/Image.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/Video.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/custom/Accordion.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/custom/Chart.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/custom/File.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/custom/FlushingEnd.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/components/custom/SelectBox.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/context.ts (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/hooks/useCustomProps.ts (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/index.less (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/index.tsx (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/react-markdown.d.ts (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/rehype-plugins/rehype-Inline-code-property.ts (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/rehype-plugins/rehype-sanitize/index.d.ts (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/rehype-plugins/rehype-sanitize/index.js (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/rehype-plugins/rehype-sanitize/schema.js (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/remark-plugins/remark-directive-rehype.ts (100%)
rename frontend/{ => legacy}/compiled/src/Markdown/type.ts (100%)
rename frontend/{ => legacy}/compiled/src/defineComponent.tsx (100%)
rename frontend/{ => legacy}/compiled/src/index.ts (100%)
rename frontend/{ => legacy}/compiled/src/mount.tsx (100%)
rename frontend/{ => legacy}/compiled/src/polyfills.ts (100%)
rename frontend/{ => legacy}/compiled/src/shared/hooks/useCustomComponent.ts (100%)
rename frontend/{ => legacy}/compiled/src/shared/hooks/useMemoizedEqualValue.ts (100%)
rename frontend/{ => legacy}/compiled/src/shared/hooks/useRefValue.ts (100%)
rename frontend/{ => legacy}/compiled/src/shared/index.ts (100%)
rename frontend/{ => legacy}/compiled/src/shared/type.ts (100%)
rename frontend/{ => legacy}/compiled/src/utils.ts (100%)
create mode 100644 frontend/plugin.js
delete mode 100644 frontend/shared/CHANGELOG.md
create mode 100644 frontend/svelte-preprocess-react/component.ts
create mode 100644 frontend/svelte-preprocess-react/context.ts
create mode 100644 frontend/svelte-preprocess-react/events-polyfills.ts
create mode 100644 frontend/svelte-preprocess-react/index.ts
create mode 100644 frontend/svelte-preprocess-react/inject.ts
create mode 100644 frontend/svelte-preprocess-react/internal/Bridge.ts
create mode 100644 frontend/svelte-preprocess-react/internal/Child.ts
create mode 100644 frontend/svelte-preprocess-react/internal/ReactWrapper.svelte
create mode 100644 frontend/svelte-preprocess-react/internal/types.ts
create mode 100644 frontend/svelte-preprocess-react/polyfills.ts
create mode 100644 frontend/svelte-preprocess-react/react-slot.tsx
create mode 100644 frontend/svelte-preprocess-react/slot.ts
create mode 100644 frontend/svelte-preprocess-react/sveltify.ts
create mode 100644 frontend/svelte-preprocess-react/useStore.ts
create mode 100644 frontend/tsconfig.json
create mode 100644 frontend/utils/createFunction.ts
create mode 100644 frontend/utils/createItemsContext.tsx
create mode 100644 frontend/utils/hooks/useFunction.ts
create mode 100644 frontend/utils/hooks/useTargets.ts
create mode 100644 frontend/utils/omitUndefinedProps.ts
create mode 100644 frontend/utils/renderItems.tsx
create mode 100644 frontend/utils/renderSlot.tsx
create mode 100644 frontend/utils/styleObject2String.ts
rename frontend/{shared/src/index.ts => utils/upload.ts} (100%)
diff --git a/.husky/commit-msg b/.husky/commit-msg
index 9b58085f..0c61d206 100755
--- a/.husky/commit-msg
+++ b/.husky/commit-msg
@@ -1,4 +1 @@
-#!/bin/sh
-. "$(dirname "$0")/_/husky.sh"
-
-npx commitlint -e $HUSKY_GIT_PARAMS
+pnpm exec commitlint -e $HUSKY_GIT_PARAMS
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 36af2198..5ee7abd8 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1 @@
-#!/bin/sh
-. "$(dirname "$0")/_/husky.sh"
-
-npx lint-staged
+pnpm exec lint-staged
diff --git a/backend/modelscope_studio/__init__.py b/backend/modelscope_studio/__init__.py
index a86d5328..f635a057 100644
--- a/backend/modelscope_studio/__init__.py
+++ b/backend/modelscope_studio/__init__.py
@@ -1,8 +1,3 @@
-from .components import ModelScopeChatbot as Chatbot
-from .components import ModelScopeFlow as Flow
-from .components import ModelScopeLifecycle as Lifecycle
-from .components import ModelScopeMarkdown as Markdown
-from .components import ModelScopeMultimodalInput as MultimodalInput
-from .components import ModelScopeWaterfallGallery as WaterfallGallery
+from .components.legacy import *
from .external import load
from .version import __version__
diff --git a/backend/modelscope_studio/components/__init__.py b/backend/modelscope_studio/components/__init__.py
deleted file mode 100644
index 190ba297..00000000
--- a/backend/modelscope_studio/components/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from .Chatbot import ModelScopeChatbot
-from .Flow import ModelScopeFlow
-from .Lifecycle import ModelScopeLifecycle
-from .Markdown import ModelScopeMarkdown
-from .MultimodalInput import ModelScopeMultimodalInput
-from .WaterfallGallery import ModelScopeWaterfallGallery
diff --git a/backend/modelscope_studio/components/antd/__init__.py b/backend/modelscope_studio/components/antd/__init__.py
new file mode 100644
index 00000000..cfcad3ca
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/__init__.py
@@ -0,0 +1,142 @@
+from .affix import AntdAffix as Affix
+from .alert import AntdAlert as Alert
+from .alert.error_boundary import AntdAlertErrorBoundary as AlertErrorBoundary
+from .anchor import AntdAnchor as Anchor
+from .anchor.item import AntdAnchorItem as AnchorItem
+from .auto_complete import AntdAutoComplete as AutoComplete
+from .auto_complete.option import AntdAutoCompleteOption as AutoCompleteOption
+from .avatar import AntdAvatar as Avatar
+from .avatar.group import AntdAvatarGroup as AvatarGroup
+from .badge import AntdBadge as Badge
+from .badge.ribbon import AntdBadgeRibbon as BadgeRibbon
+from .breadcrumb import AntdBreadcrumb as Breadcrumb
+from .breadcrumb.item import AntdBreadcrumbItem as BreadcrumbItem
+from .button import AntdButton as Button
+from .button.group import AntdButtonGroup as ButtonGroup
+from .calendar import AntdCalendar as Calendar
+from .card import AntdCard as Card
+from .card.grid import AntdCardGrid as CardGrid
+from .card.meta import AntdCardMeta as CardMeta
+from .carousel import AntdCarousel as Carousel
+from .cascader import AntdCascader as Cascader
+from .cascader.option import AntdCascaderOption as CascaderOption
+from .cascader.panel import AntdCascaderPanel as CascaderPanel
+from .checkbox import AntdCheckbox as Checkbox
+from .checkbox.group import AntdCheckboxGroup as CheckboxGroup
+from .checkbox.group.option import \
+ AntdCheckboxGroupOption as CheckboxGroupOption
+from .collapse import AntdCollapse as Collapse
+from .collapse.item import AntdCollapseItem as CollapseItem
+from .color_picker import AntdColorPicker as ColorPicker
+from .color_picker.preset import AntdColorPickerPreset as ColorPickerPreset
+from .config_provider import AntdConfigProvider as ConfigProvider
+from .date_picker import AntdDatePicker as DatePicker
+from .date_picker.preset import AntdDatePickerPreset as DatePickerPreset
+from .date_picker.range_picker import \
+ AntdDatePickerRangePicker as DatePickerRangePicker
+from .descriptions import AntdDescriptions as Descriptions
+from .descriptions.item import AntdDescriptionsItem as DescriptionsItem
+from .divider import AntdDivider as Divider
+from .drawer import AntdDrawer as Drawer
+from .dropdown import AntdDropdown as Dropdown
+from .dropdown.button import AntdDropdownButton as DropdownButton
+from .empty import AntdEmpty as Empty
+from .flex import AntdFlex as Flex
+from .float_button import AntdFloatButton as FloatButton
+from .float_button.back_top import AntdFloatButtonBackTop as FloatButtonBackTop
+from .float_button.group import AntdFloatButtonGroup as FloatButtonGroup
+from .form import AntdForm as Form
+from .form.item import AntdFormItem as FormItem
+from .form.item.rule import AntdFormItemRule as FormItemRule
+from .grid.col import AntdCol as Col
+from .grid.row import AntdRow as Row
+from .icon import AntdIcon as Icon
+from .icon.iconfont_provider import AntdIconfontProvider as IconfontProvider
+from .image import AntdImage as Image
+from .image.preview_group import AntdImagePreviewGroup as ImagePreviewGroup
+from .input import AntdInput as Input
+from .input.otp import AntdInputOTP as InputOTP
+from .input.password import AntdInputPassword as InputPassword
+from .input.search import AntdInputSearch as InputSearch
+from .input.textarea import AntdInputTextarea as InputTextarea
+from .input_number import AntdInputNumber as InputNumber
+from .layout import AntdLayout as Layout
+from .layout.content import AntdLayoutContent as LayoutContent
+from .layout.footer import AntdLayoutFooter as LayoutFooter
+from .layout.header import AntdLayoutHeader as LayoutHeader
+from .layout.sider import AntdLayoutSider as LayoutSider
+from .list import AntdList as List
+from .list.item import AntdListItem as ListItem
+from .list.item.meta import AntdListItemMeta as ListItemMeta
+from .mentions import AntdMentions as Mentions
+from .mentions.option import AntdMentionsOption as MentionsOption
+from .menu import AntdMenu as Menu
+from .menu.item import AntdMenuItem as MenuItem
+from .message import AntdMessage as Message
+from .modal import AntdModal as Modal
+from .notification import AntdNotification as Notification
+from .pagination import AntdPagination as Pagination
+from .popconfirm import AntdPopconfirm as Popconfirm
+from .popover import AntdPopover as Popover
+from .progress import AntdProgress as Progress
+from .qr_code import AntdQRCode as QRCode
+from .radio import AntdRadio as Radio
+from .radio.button import AntdRadioButton as RadioButton
+from .radio.group import AntdRadioGroup as RadioGroup
+from .radio.group.option import AntdRadioGroupOption as RadioGroupOption
+from .rate import AntdRate as Rate
+from .result import AntdResult as Result
+from .segmented import AntdSegmented as Segmented
+from .segmented.option import AntdSegmentedOption as SegmentedOptions
+from .select import AntdSelect as Select
+from .select.option import AntdSelectOption as SelectOption
+from .skeleton import AntdSkeleton as Skeleton
+from .skeleton.avatar import AntdSkeletonAvatar as SkeletonAvatar
+from .skeleton.button import AntdSkeletonButton as SkeletonButton
+from .skeleton.image import AntdSkeletonImage as SkeletonImage
+from .skeleton.input import AntdSkeletonInput as SkeletonInput
+from .skeleton.node import AntdSkeletonNode as SkeletonNode
+from .slider import AntdSlider as Slider
+from .slider.mark import AntdSliderMark as SliderMark
+from .space import AntdSpace as Space
+from .space.compact import AntdSpaceCompact as SpaceCompact
+from .spin import AntdSpin as Spin
+from .statistic import AntdStatistic as Statistic
+from .statistic import AntdStatisticCountdown as StatisticCountdown
+from .steps import AntdSteps as Steps
+from .steps.item import AntdStepsItem as StepsItem
+from .switch import AntdSwitch as Switch
+from .table import AntdTable as Table
+from .table.column import AntdTableColumn as TableColumn
+from .table.column_group import AntdTableColumnGroup as TableColumnGroup
+from .table.expandable import AntdTableExpandable as TableExpandable
+from .table.row_selection import AntdTableRowSelection as TableRowSelection
+from .table.row_selection.selection import \
+ AntdTableRowSelectionSelection as TableRowSelectionSelection
+from .tabs import AntdTabs as Tabs
+from .tabs.item import AntdTabsItem as TabsItem
+from .tag import AntdTag as Tag
+from .tag.checkable_tag import AntdTagCheckableTag as TagCheckableTag
+from .time_picker import AntdTimePicker as TimePicker
+from .time_picker.range_picker import \
+ AntdTimePickerRangePicker as TimePickerRangePicker
+from .timeline import AntdTimeline as Timeline
+from .timeline.item import AntdTimelineItem as TimelineItem
+from .tooltip import AntdTooltip as Tooltip
+from .tour import AntdTour as Tour
+from .tour.step import AntdTourStep as TourStep
+from .transfer import AntdTransfer as Transfer
+from .tree import AntdTree as Tree
+from .tree.directory_tree import AntdTreeDirectoryTree as TreeDirectoryTree
+from .tree.tree_node import AntdTreeTreeNode as TreeTreeNode
+from .tree_select import AntdTreeSelect as TreeSelect
+from .tree_select.tree_node import AntdTreeSelectTreeNode as TreeSelectTreeNode
+from .typography import AntdTypography as Typography
+from .typography.link import AntdTypographyLink as TypographyLink
+from .typography.paragraph import \
+ AntdTypographyParagraph as TypographyParagraph
+from .typography.text import AntdTypographyText as TypographyText
+from .typography.title import AntdTypographyTitle as TypographyTitle
+from .upload import AntdUpload as Upload
+from .upload.dragger import AntdUploadDragger as UploadDragger
+from .watermark import AntdWatermark as Watermark
diff --git a/backend/modelscope_studio/components/antd/affix/__init__.py b/backend/modelscope_studio/components/antd/affix/__init__.py
new file mode 100644
index 00000000..e1eeb8e2
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/affix/__init__.py
@@ -0,0 +1,58 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdAffix(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True))
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("affix")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/alert/__init__.py b/backend/modelscope_studio/components/antd/alert/__init__.py
new file mode 100644
index 00000000..da574b3e
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/alert/__init__.py
@@ -0,0 +1,63 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .error_boundary import AntdAlertErrorBoundary
+
+
+class AntdAlert(ModelScopeLayoutComponent):
+ """
+ """
+ ErrorBoundary = AntdAlertErrorBoundary
+ EVENTS = [
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['action', 'closable.closeIcon', 'description', 'icon', 'message']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("alert")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/alert/error_boundary/__init__.py b/backend/modelscope_studio/components/antd/alert/error_boundary/__init__.py
new file mode 100644
index 00000000..ba75eb59
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/alert/error_boundary/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdAlertErrorBoundary(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['description', 'message']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("alert", "error-boundary")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/anchor/__init__.py b/backend/modelscope_studio/components/antd/anchor/__init__.py
new file mode 100644
index 00000000..4ba1176b
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/anchor/__init__.py
@@ -0,0 +1,66 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .item import AntdAnchorItem
+
+
+class AntdAnchor(ModelScopeLayoutComponent):
+ """
+ """
+ Item = AntdAnchorItem
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener('affix_change',
+ callback=lambda block: block._internal.update(
+ bind_affix_change_event=True))
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("anchor")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/anchor/item/__init__.py b/backend/modelscope_studio/components/antd/anchor/item/__init__.py
new file mode 100644
index 00000000..d8ceada5
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/anchor/item/__init__.py
@@ -0,0 +1,54 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdAnchorItem(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+ # supported slots
+ SLOTS = ["title"]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("anchor", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/auto_complete/__init__.py b/backend/modelscope_studio/components/antd/auto_complete/__init__.py
new file mode 100644
index 00000000..10bc909d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/auto_complete/__init__.py
@@ -0,0 +1,88 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .option import AntdAutoCompleteOption
+
+
+# as inputs, outputs
+class AntdAutoComplete(ModelScopeDataLayoutComponent):
+ """
+ """
+ Option = AntdAutoCompleteOption
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("blur",
+ callback=lambda block: block._internal.update(
+ bind_blur_event=True)),
+ EventListener("focus",
+ callback=lambda block: block._internal.update(
+ bind_focus_event=True)),
+ EventListener("search",
+ callback=lambda block: block._internal.update(
+ bind_search_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ EventListener("dropdown_visible_change",
+ callback=lambda block: block._internal.update(
+ bind_dropdownVisibleChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['allowClear.clearIcon', 'children', 'notFoundContent']
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("auto-complete")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: None | str) -> None | str:
+ return payload
+
+ def postprocess(self, value: None | str) -> None | str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/auto_complete/option/__init__.py b/backend/modelscope_studio/components/antd/auto_complete/option/__init__.py
new file mode 100644
index 00000000..5df3a1b0
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/auto_complete/option/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdAutoCompleteOption(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+ self.label = label
+
+ FRONTEND_DIR = resolve_frontend_dir("auto-complete", "option")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/avatar/__init__.py b/backend/modelscope_studio/components/antd/avatar/__init__.py
new file mode 100644
index 00000000..169e2eab
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/avatar/__init__.py
@@ -0,0 +1,66 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .group import AntdAvatarGroup
+
+
+class AntdAvatar(ModelScopeLayoutComponent):
+ """
+ """
+ Group = AntdAvatarGroup
+
+ EVENTS = [
+ EventListener("error",
+ callback=lambda block: block._internal.update(
+ bind_error_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['icon', "src"]
+
+ def __init__(
+ self,
+ src: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.src = src
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("avatar")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/avatar/group/__init__.py b/backend/modelscope_studio/components/antd/avatar/group/__init__.py
new file mode 100644
index 00000000..7dc3c52e
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/avatar/group/__init__.py
@@ -0,0 +1,52 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdAvatarGroup(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+ # supported slots
+ SLOTS = ['max.popover.title', 'max.popover.content']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("avatar", 'group')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/badge/__init__.py b/backend/modelscope_studio/components/antd/badge/__init__.py
new file mode 100644
index 00000000..01c4bfdc
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/badge/__init__.py
@@ -0,0 +1,62 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .ribbon import AntdBadgeRibbon
+
+
+class AntdBadge(ModelScopeLayoutComponent):
+ """
+ """
+ Ribbon = AntdBadgeRibbon
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['count', 'text']
+
+ def __init__(
+ self,
+ count: int | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.count = count
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("badge")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/badge/ribbon/__init__.py b/backend/modelscope_studio/components/antd/badge/ribbon/__init__.py
new file mode 100644
index 00000000..bf731376
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/badge/ribbon/__init__.py
@@ -0,0 +1,52 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdBadgeRibbon(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ text: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.text = text
+
+ FRONTEND_DIR = resolve_frontend_dir("badge", 'ribbon')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/breadcrumb/__init__.py b/backend/modelscope_studio/components/antd/breadcrumb/__init__.py
new file mode 100644
index 00000000..454458e3
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/breadcrumb/__init__.py
@@ -0,0 +1,57 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .item import AntdBreadcrumbItem
+
+
+class AntdBreadcrumb(ModelScopeLayoutComponent):
+ """
+ """
+ Item = AntdBreadcrumbItem
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['separator', 'items']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("breadcrumb")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/breadcrumb/item/__init__.py b/backend/modelscope_studio/components/antd/breadcrumb/item/__init__.py
new file mode 100644
index 00000000..a48297ad
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/breadcrumb/item/__init__.py
@@ -0,0 +1,98 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdBreadcrumbItem(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("menu_click",
+ callback=lambda block: block._internal.update(
+ bind_menu_click_event=True)),
+ EventListener("menu_deselect",
+ callback=lambda block: block._internal.update(
+ bind_menu_deselect_event=True)),
+ EventListener("menu_open_change",
+ callback=lambda block: block._internal.update(
+ bind_menu_openChange_event=True)),
+ EventListener("menu_select",
+ callback=lambda block: block._internal.update(
+ bind_menu_select_event=True)),
+ EventListener("dropdown_open_change",
+ callback=lambda block: block._internal.update(
+ bind_dropdownProps_openChange_event=True)),
+ EventListener("dropdown_menu_click",
+ callback=lambda block: block._internal.update(
+ bind_dropdownProps_menu_click_event=True)),
+ EventListener("dropdown_menu_deselect",
+ callback=lambda block: block._internal.update(
+ bind_dropdownProps_menu_deselect_event=True)),
+ EventListener("dropdown_menu_open_change",
+ callback=lambda block: block._internal.update(
+ bind_dropdownProps_menu_openChange_event=True)),
+ EventListener("dropdown_menu_select",
+ callback=lambda block: block._internal.update(
+ bind_dropdownProps_menu_select_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'title',
+ "menu.expandIcon",
+ 'menu.overflowedIndicator',
+ "menu.items",
+ "dropdownProps.menu.expandIcon",
+ 'dropdownProps.menu.overflowedIndicator',
+ "dropdownProps.menu.items",
+ ]
+
+ def __init__(
+ self,
+ title: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.title = title
+
+ FRONTEND_DIR = resolve_frontend_dir("breadcrumb", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/button/__init__.py b/backend/modelscope_studio/components/antd/button/__init__.py
new file mode 100644
index 00000000..6c30753d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/button/__init__.py
@@ -0,0 +1,136 @@
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .group import AntdButtonGroup
+
+
+class AntdButton(ModelScopeLayoutComponent):
+ """
+ To trigger an operation.
+
+ A button means an operation (or a series of operations). Clicking a button will trigger its corresponding business logic.
+
+ In Ant Design we provide 5 types of button.
+
+ Primary button: used for the main action, there can be at most one primary button in a section.
+ Default button: used for a series of actions without priority.
+ Dashed button: commonly used for adding more actions.
+ Text button: used for the most secondary action.
+ Link button: used for external links.
+ And 4 other properties additionally.
+
+ danger: used for actions of risk, like deletion or authorization.
+ ghost: used in situations with complex background, home pages usually.
+ disabled: used when actions are not available.
+ loading: adds a loading spinner in button, avoids multiple submits too.
+ """
+ Group = AntdButtonGroup
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True),
+ doc="Set the handler to handle click event.")
+ ]
+
+ # supported slots
+ SLOTS = ['icon']
+
+ def __init__(
+ self,
+ value: str | None = "Run",
+ props: dict | None = None,
+ *,
+ auto_insert_space: bool = True,
+ block: bool = False,
+ class_names: dict | None = None,
+ danger: bool = False,
+ disabled: bool = False,
+ ghost: bool = False,
+ href: str | None = None,
+ html_type: Literal["button", "submit", "reset"] | None = "button",
+ icon: str | None = None,
+ icon_position: Literal["start", "end"] | None = "start",
+ loading: bool = False,
+ shape: Literal["default", "circle", "round"] | None = "default",
+ size: Literal["large", "middle", "small"] | None = "middle",
+ styles: dict | None = None,
+ href_target: str | None = None,
+ type: Literal["primary", "dashed", "link", "text", "default"]
+ | None = "default",
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ auto_insert_space: We add a space between two Chinese characters by default, which can be removed by setting auto_Insert_Space to false.
+ block: Option to fit button width to its parent width.
+ class_names: Semantic DOM class.
+ danger: Set the danger status of button.
+ disabled: Disabled state of button.
+ ghost: Make background transparent and invert text and border colors.
+ href: Redirect url of link button.
+ html_type: Set the original html type of button, see: MDN.
+ icon: Set the icon component of button.
+ icon_position: Set the icon position of button.
+ loading: Set the loading status of button.
+ shape: Can be set button shape.
+ size: Set the size of button.
+ styles: Semantic DOM style.
+ href_target: Same as target attribute of a, works when href is specified.
+ type: Set button type.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+ self.auto_insert_space = auto_insert_space
+ self.block = block
+ self.class_names = class_names
+ self.danger = danger
+ self.disabled = disabled
+ self.ghost = ghost
+ self.href = href
+ self.html_type = html_type
+ self.icon = icon
+ self.icon_position = icon_position
+ self.loading = loading
+ self.shape = shape
+ self.size = size
+ self.styles = styles
+ self.href_target = href_target
+ self.type = type
+
+ FRONTEND_DIR = resolve_frontend_dir("button")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return "Run"
+
+ def example_value(self) -> Any:
+ return "Run"
diff --git a/backend/modelscope_studio/components/antd/button/group/__init__.py b/backend/modelscope_studio/components/antd/button/group/__init__.py
new file mode 100644
index 00000000..fc3105e3
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/button/group/__init__.py
@@ -0,0 +1,50 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdButtonGroup(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("button", 'group')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/calendar/__init__.py b/backend/modelscope_studio/components/antd/calendar/__init__.py
new file mode 100644
index 00000000..09b7cd4a
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/calendar/__init__.py
@@ -0,0 +1,70 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdCalendar(ModelScopeComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("panel_change",
+ callback=lambda block: block._internal.update(
+ bind_panelChange_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True))
+ ]
+
+ def __init__(
+ self,
+ value: int | str | float | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("calendar")
+
+ def api_info(self) -> dict[str, Any]:
+ return {"anyOf": [{"type": "number"}, {"type": "string"}]}
+
+ @property
+ def skip_api(self):
+ return False
+
+ def preprocess(self, payload: int | float) -> int | float:
+ return payload
+
+ def postprocess(self, value: int | float) -> int | str:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/card/__init__.py b/backend/modelscope_studio/components/antd/card/__init__.py
new file mode 100644
index 00000000..9be1139d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/card/__init__.py
@@ -0,0 +1,129 @@
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .grid import AntdCardGrid
+from .meta import AntdCardMeta
+
+
+class AntdCard(ModelScopeLayoutComponent):
+ """
+ A container for displaying information.
+ A card can be used to display content related to a single subject. The content can consist of multiple elements of varying types and sizes.
+ """
+ Grid = AntdCardGrid
+ Meta = AntdCardMeta
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("tab_change",
+ callback=lambda block: block._internal.update(
+ bind_tabChange_event=True))
+ ]
+
+ # supported slots
+ SLOTS = [
+ "actions",
+ 'cover',
+ 'extra',
+ 'tabBarExtraContent',
+ 'title',
+ ]
+
+ def __exit__(self, *args, **kwargs):
+ self._internal.update(contains_grid=any(
+ isinstance(child, AntdCardGrid) for child in self.children))
+ super().__exit__(*args, **kwargs)
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ actions: str | None = None,
+ active_tab_key: str | None = None,
+ bordered: bool = True,
+ cover: str | None = None,
+ default_active_tab_key: str | None = None,
+ extra: str | None = None,
+ hoverable: bool = False,
+ loading: bool = False,
+ size: Literal["default", "small"] = "default",
+ tab_bar_extra_content: str | None = None,
+ tab_list: list[str] | str | None = None,
+ tab_props: str | None = None,
+ title: str | None = None,
+ type: str | None = None,
+ class_names: dict | None = None,
+ styles: dict | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ actions: The action list, shows at the bottom of the Card.
+ active_tab_key: Current TabPane's key.
+ bordered: Toggles rendering of the border around the card.
+ cover: Card cover.
+ default_active_tab_key: Initial active TabPane's key, if activeTabKey is not set.
+ extra: Content to render in the top-right corner of the card.
+ hoverable: Lift up when hovering card.
+ loading: Shows a loading indicator while the contents of the card are being fetched.
+ size: Size of card.
+ tab_bar_extra_content: Extra content in tab bar.
+ title: Card title.
+ type: Card style type, can be set to inner or not set.
+ class_names: Config Card build-in module's className.
+ styles: Config Card build-in module's style.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.actions = actions
+ self.active_tab_key = active_tab_key
+ self.bordered = bordered
+ self.cover = cover
+ self.default_active_tab_key = default_active_tab_key
+ self.extra = extra
+ self.hoverable = hoverable
+ self.loading = loading
+ self.size = size
+ self.tab_bar_extra_content = tab_bar_extra_content
+ self.tab_list = tab_list
+ self.tab_props = tab_props
+ self.title = title
+ self.type = type
+ self.class_names = class_names
+ self.styles = styles
+
+ FRONTEND_DIR = resolve_frontend_dir("card")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/card/grid/__init__.py b/backend/modelscope_studio/components/antd/card/grid/__init__.py
new file mode 100644
index 00000000..062466bb
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/card/grid/__init__.py
@@ -0,0 +1,64 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdCardGrid(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ hoverable: bool = True,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ hoverable: Lift up when hovering card grid.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ elem_style=elem_style,
+ as_item=as_item,
+ **kwargs)
+ self.props = props
+ self.hoverable = hoverable
+
+ FRONTEND_DIR = resolve_frontend_dir("card", "grid")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/card/meta/__init__.py b/backend/modelscope_studio/components/antd/card/meta/__init__.py
new file mode 100644
index 00000000..2b3ef5dd
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/card/meta/__init__.py
@@ -0,0 +1,65 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdCardMeta(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+ SLOTS = ["title", "description", "avatar"]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ avatar: str | None = None,
+ description: str | None = None,
+ title: str | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ avatar: Avatar or icon.
+ description: Description content.
+ title: Title content.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.avatar = avatar
+ self.description = description
+ self.title = title
+
+ FRONTEND_DIR = resolve_frontend_dir("card", "meta")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/carousel/__init__.py b/backend/modelscope_studio/components/antd/carousel/__init__.py
new file mode 100644
index 00000000..94c7e117
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/carousel/__init__.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdCarousel(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("carousel")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/cascader/__init__.py b/backend/modelscope_studio/components/antd/cascader/__init__.py
new file mode 100644
index 00000000..e7c8a4cc
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/cascader/__init__.py
@@ -0,0 +1,101 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .option import AntdCascaderOption
+from .panel import AntdCascaderPanel
+
+
+# as inputs, outputs
+class AntdCascader(ModelScopeDataLayoutComponent):
+ """
+ """
+ Option = AntdCascaderOption
+ Panel = AntdCascaderPanel
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("search",
+ callback=lambda block: block._internal.update(
+ bind_search_event=True)),
+ EventListener("dropdown_visible_change",
+ callback=lambda block: block._internal.update(
+ bind_dropdownVisibleChange_event=True)),
+ EventListener("load_data",
+ callback=lambda block: block._internal.update(
+ bind_loadData_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'allowClear.clearIcon',
+ 'suffixIcon',
+ 'maxTagPlaceholder',
+ 'notFoundContent',
+ 'expandIcon',
+ 'removeIcon',
+ ]
+
+ def __init__(
+ self,
+ value: list[str] | list[int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("cascader")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [{
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }, {
+ "type": "string"
+ }]
+ }
+
+ def preprocess(
+ self, payload: None | list[str] | list[int | float]
+ ) -> None | list[str] | list[int | float]:
+ return payload
+
+ def postprocess(
+ self, value: None | list[str] | list[int | float]
+ ) -> None | list[str] | list[int | float]:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/cascader/constants.py b/backend/modelscope_studio/components/antd/cascader/constants.py
new file mode 100644
index 00000000..bfb00b1d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/cascader/constants.py
@@ -0,0 +1,2 @@
+SHOW_CHILD = "SHOW_CHILD"
+SHOW_PARENT = "SHOW_PARENT"
diff --git a/backend/modelscope_studio/components/antd/cascader/option/__init__.py b/backend/modelscope_studio/components/antd/cascader/option/__init__.py
new file mode 100644
index 00000000..01511078
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/cascader/option/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdCascaderOption(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+ self.label = label
+
+ FRONTEND_DIR = resolve_frontend_dir("cascader", "option")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/cascader/panel/__init__.py b/backend/modelscope_studio/components/antd/cascader/panel/__init__.py
new file mode 100644
index 00000000..1a44b629
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/cascader/panel/__init__.py
@@ -0,0 +1,84 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdCascaderPanel(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("load_data",
+ callback=lambda block: block._internal.update(
+ bind_loadData_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['notFoundContent', 'expandIcon']
+
+ def __init__(
+ self,
+ value: list[str] | list[int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("cascader", "panel")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [{
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }, {
+ "type": "string"
+ }]
+ }
+
+ def preprocess(
+ self, payload: None | list[str] | list[int | float]
+ ) -> None | list[str] | list[int | float]:
+ return payload
+
+ def postprocess(
+ self, value: None | list[str] | list[int | float]
+ ) -> None | list[str] | list[int | float]:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/checkbox/__init__.py b/backend/modelscope_studio/components/antd/checkbox/__init__.py
new file mode 100644
index 00000000..9654b5d5
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/checkbox/__init__.py
@@ -0,0 +1,67 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .group import AntdCheckboxGroup
+
+
+# as inputs, outputs
+class AntdCheckbox(ModelScopeDataLayoutComponent):
+ """
+ """
+ Group = AntdCheckboxGroup
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ def __init__(
+ self,
+ value: bool | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("checkbox")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "boolean"}
+
+ def preprocess(self, payload: None | bool) -> None | bool:
+ return payload
+
+ def postprocess(self, value: None | bool) -> None | bool:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/checkbox/group/__init__.py b/backend/modelscope_studio/components/antd/checkbox/group/__init__.py
new file mode 100644
index 00000000..36b2027d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/checkbox/group/__init__.py
@@ -0,0 +1,91 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .option import AntdCheckboxGroupOption
+
+
+# as inputs, outputs
+class AntdCheckboxGroup(ModelScopeDataLayoutComponent):
+ """
+ """
+ Option = AntdCheckboxGroupOption
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'options',
+ ]
+
+ def __init__(
+ self,
+ value: list[str | int | float | bool] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("checkbox", "group")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "boolean"
+ },
+ ],
+ }
+ }
+
+ def preprocess(
+ self, payload: None | list[str | int | float | bool] | None
+ ) -> None | list[str | int | float | bool] | None:
+ return payload
+
+ def postprocess(
+ self, value: None | list[str | int | float | bool] | None
+ ) -> None | list[str | int | float | bool] | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/checkbox/group/option/__init__.py b/backend/modelscope_studio/components/antd/checkbox/group/option/__init__.py
new file mode 100644
index 00000000..d9adc723
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/checkbox/group/option/__init__.py
@@ -0,0 +1,63 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ......utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdCheckboxGroupOption(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ label: str | None = None,
+ disabled: bool | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+ self.label = label
+ self.disabled = disabled
+
+ FRONTEND_DIR = resolve_frontend_dir("checkbox", ['group', 'option'])
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/collapse/__init__.py b/backend/modelscope_studio/components/antd/collapse/__init__.py
new file mode 100644
index 00000000..5cdff9ff
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/collapse/__init__.py
@@ -0,0 +1,88 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .item import AntdCollapseItem
+
+
+# as inputs, outputs
+class AntdCollapse(ModelScopeDataLayoutComponent):
+ """
+ """
+ Item = AntdCollapseItem
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ["expandIcon", "items"]
+
+ def __init__(
+ self,
+ value: str | int | float | list[str | int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("collapse")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [{
+ "type": "number"
+ }, {
+ "type": "string"
+ }, {
+ "type": "array",
+ "items": {
+ "anyOf": [{
+ "type": "number"
+ }, {
+ "type": "string"
+ }]
+ }
+ }]
+ }
+
+ def preprocess(
+ self, payload: str | int | float | list[str | int | float]
+ ) -> str | int | float | list[str | int | float]:
+ return payload
+
+ def postprocess(
+ self, value: str | int | float | list[str | int | float]
+ ) -> str | int | float | list[str | int | float]:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/collapse/item/__init__.py b/backend/modelscope_studio/components/antd/collapse/item/__init__.py
new file mode 100644
index 00000000..ca3c9066
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/collapse/item/__init__.py
@@ -0,0 +1,63 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdCollapseItem(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("item_click",
+ callback=lambda block: block._internal.update(
+ bind_itemClick_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['extra', "label", "children"]
+
+ def __init__(
+ self,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.label = label
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("collapse", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/color_picker/__init__.py b/backend/modelscope_studio/components/antd/color_picker/__init__.py
new file mode 100644
index 00000000..1397d68c
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/color_picker/__init__.py
@@ -0,0 +1,85 @@
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .preset import AntdColorPickerPreset
+
+
+# as inputs, outputs
+class AntdColorPicker(ModelScopeDataLayoutComponent):
+ """
+ """
+ Preset = AntdColorPickerPreset
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("change_complete",
+ callback=lambda block: block._internal.update(
+ bind_changeComplete_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ EventListener("format_change",
+ callback=lambda block: block._internal.update(
+ bind_formatChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ["presets"]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ value_format: Literal['hex', 'rgb', 'hsb'] = 'hex',
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value_format = value_format
+
+ FRONTEND_DIR = resolve_frontend_dir("color-picker")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: str) -> str:
+
+ return payload
+
+ def postprocess(self, value: str) -> str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/color_picker/preset/__init__.py b/backend/modelscope_studio/components/antd/color_picker/preset/__init__.py
new file mode 100644
index 00000000..c8fa61b5
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/color_picker/preset/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdColorPickerPreset(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ label: str | None = None,
+ colors: list[str] = None,
+ default_open: bool = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.label = label
+ self.colors = colors
+ self.default_open = default_open
+
+ FRONTEND_DIR = resolve_frontend_dir("color-picker", 'preset')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/config_provider/__init__.py b/backend/modelscope_studio/components/antd/config_provider/__init__.py
new file mode 100644
index 00000000..4fa31035
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/config_provider/__init__.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdConfigProvider(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # see https://ant.design/components/config-provider, pass slot like 'spin.indicator'.
+ SLOTS = []
+
+ def __init__(self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("config-provider")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/date_picker/__init__.py b/backend/modelscope_studio/components/antd/date_picker/__init__.py
new file mode 100644
index 00000000..f95b47d7
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/date_picker/__init__.py
@@ -0,0 +1,107 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .preset import AntdDatePickerPreset
+from .range_picker import AntdDatePickerRangePicker
+
+
+# as inputs, outputs
+class AntdDatePicker(ModelScopeDataLayoutComponent):
+ """
+ """
+ Preset = AntdDatePickerPreset
+ RangePicker = AntdDatePickerRangePicker
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener(
+ "ok",
+ callback=lambda block: block._internal.update(bind_ok_event=True)),
+ EventListener("panel_change",
+ callback=lambda block: block._internal.update(
+ bind_panelChange_event=True)),
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ ]
+
+ def __init__(
+ self,
+ value: str | int | float | list[str | int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("date-picker")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [{
+ "type": "number"
+ }, {
+ "type": "string"
+ }, {
+ "type": "array",
+ "items": {
+ "anyOf": [{
+ "type": "number"
+ }, {
+ "type": "string"
+ }]
+ }
+ }]
+ }
+
+ def preprocess(
+ self, payload: str | int | float | list[str | int | float]
+ ) -> str | int | float | list[str | int | float]:
+ return payload
+
+ def postprocess(
+ self, value: str | int | float | list[str | int | float]
+ ) -> str | int | float | list[str | int | float]:
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/date_picker/preset/__init__.py b/backend/modelscope_studio/components/antd/date_picker/preset/__init__.py
new file mode 100644
index 00000000..a2e6908b
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/date_picker/preset/__init__.py
@@ -0,0 +1,59 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdDatePickerPreset(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ value: int | str | float | None = None,
+ label: str | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.label = label
+ self.value = value
+
+ FRONTEND_DIR = resolve_frontend_dir("date-picker", 'preset')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/date_picker/range_picker/__init__.py b/backend/modelscope_studio/components/antd/date_picker/range_picker/__init__.py
new file mode 100644
index 00000000..f36bbfd1
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/date_picker/range_picker/__init__.py
@@ -0,0 +1,98 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdDatePickerRangePicker(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener(
+ "calendar_change",
+ callback=lambda block: block._internal.update(bind_ok_event=True)),
+ EventListener("focus",
+ callback=lambda block: block._internal.update(
+ bind_calendarChange_event=True)),
+ EventListener("blur",
+ callback=lambda block: block._internal.update(
+ bind_blur_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ 'separator',
+ ]
+
+ def __init__(
+ self,
+ value: tuple[str | int | float, str | int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("date-picker", 'range-picker')
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "type": "array",
+ "items": {
+ "anyOf": [{
+ "type": "number"
+ }, {
+ "type": "string"
+ }]
+ }
+ }
+
+ def preprocess(
+ self, payload: tuple[str | int | float, str | int | float]
+ ) -> tuple[str | int | float, str | int | float]:
+ return payload
+
+ def postprocess(
+ self, value: tuple[str | int | float, str | int | float]
+ ) -> tuple[str | int | float, str | int | float]:
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/descriptions/__init__.py b/backend/modelscope_studio/components/antd/descriptions/__init__.py
new file mode 100644
index 00000000..714f6db6
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/descriptions/__init__.py
@@ -0,0 +1,60 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .item import AntdDescriptionsItem
+
+
+class AntdDescriptions(ModelScopeLayoutComponent):
+ """
+ """
+ Item = AntdDescriptionsItem
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['extra', 'title', "items"]
+
+ def __init__(
+ self,
+ title: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.title = title
+
+ FRONTEND_DIR = resolve_frontend_dir("descriptions")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/descriptions/item/__init__.py b/backend/modelscope_studio/components/antd/descriptions/item/__init__.py
new file mode 100644
index 00000000..aca49320
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/descriptions/item/__init__.py
@@ -0,0 +1,57 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdDescriptionsItem(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['label', 'children']
+
+ def __init__(
+ self,
+ label: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.label = label
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("descriptions", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/divider/__init__.py b/backend/modelscope_studio/components/antd/divider/__init__.py
new file mode 100644
index 00000000..fdfd2090
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/divider/__init__.py
@@ -0,0 +1,82 @@
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdDivider(ModelScopeLayoutComponent):
+ """
+ A divider line separates different content.
+ Divide sections of an article.
+ Divide inline text and links such as the operation column of table.
+ """
+
+ EVENTS = []
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ dashed: bool = False,
+ variant: Literal["dashed", "dotted", "solid"] = "solid",
+ orientation: Literal["left", "right", "center"] = "center",
+ orientation_margin: str | int | None = None,
+ plain: bool = False,
+ type: Literal["horizontal", "horizontal"] = "horizontal",
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ value: The wrapped title.
+ dashed: Whether line is dashed.
+ variant: Whether line is dashed, dotted or solid.
+ orientation: The position of title inside divider.
+ orientation_margin: The margin-left/right between the title and its closest border, while the orientation must be left or right, If a numeric value of type string is provided without a unit, it is assumed to be in pixels (px) by default.
+ plain: Divider text show as plain style.
+ type: The direction type of divider.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+ self.dashed = dashed
+ self.variant = variant
+ self.orientation = orientation
+ self.orientation_margin = orientation_margin
+ self.plain = plain
+ self.type = type
+
+ FRONTEND_DIR = resolve_frontend_dir("divider")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/drawer/__init__.py b/backend/modelscope_studio/components/antd/drawer/__init__.py
new file mode 100644
index 00000000..ec783e36
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/drawer/__init__.py
@@ -0,0 +1,66 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdDrawer(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True))
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'closeIcon',
+ 'extra',
+ 'footer',
+ 'title',
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("drawer")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/dropdown/__init__.py b/backend/modelscope_studio/components/antd/dropdown/__init__.py
new file mode 100644
index 00000000..6a05f605
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/dropdown/__init__.py
@@ -0,0 +1,76 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .button import AntdDropdownButton
+
+
+class AntdDropdown(ModelScopeLayoutComponent):
+ """
+ """
+ Button = AntdDropdownButton
+ EVENTS = [
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ EventListener("menu_click",
+ callback=lambda block: block._internal.update(
+ bind_menu_click_event=True)),
+ EventListener("menu_deselect",
+ callback=lambda block: block._internal.update(
+ bind_menu_deselect_event=True)),
+ EventListener("menu_open_change",
+ callback=lambda block: block._internal.update(
+ bind_menu_openChange_event=True)),
+ EventListener("menu_select",
+ callback=lambda block: block._internal.update(
+ bind_menu_select_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ["menu.expandIcon", 'menu.overflowedIndicator', "menu.items"]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ inner_elem_style: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.inner_elem_style = inner_elem_style
+
+ FRONTEND_DIR = resolve_frontend_dir("dropdown")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/dropdown/button/__init__.py b/backend/modelscope_studio/components/antd/dropdown/button/__init__.py
new file mode 100644
index 00000000..bdb10d37
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/dropdown/button/__init__.py
@@ -0,0 +1,82 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdDropdownButton(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ EventListener("menu_click",
+ callback=lambda block: block._internal.update(
+ bind_menu_click_event=True)),
+ EventListener("menu_deselect",
+ callback=lambda block: block._internal.update(
+ bind_menu_deselect_event=True)),
+ EventListener("menu_open_change",
+ callback=lambda block: block._internal.update(
+ bind_menu_openChange_event=True)),
+ EventListener("menu_select",
+ callback=lambda block: block._internal.update(
+ bind_menu_select_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ "icon", 'buttonsRender', "menu.expandIcon", 'menu.overflowedIndicator',
+ "menu.items"
+ ]
+
+ def __init__(
+ self,
+ value: str | None = "Run",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+
+ FRONTEND_DIR = resolve_frontend_dir("dropdown", "button")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return "Run"
+
+ def example_value(self) -> Any:
+ return "Run"
diff --git a/backend/modelscope_studio/components/antd/empty/__init__.py b/backend/modelscope_studio/components/antd/empty/__init__.py
new file mode 100644
index 00000000..d681dc69
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/empty/__init__.py
@@ -0,0 +1,55 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdEmpty(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['description', 'image']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("empty")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/flex/__init__.py b/backend/modelscope_studio/components/antd/flex/__init__.py
new file mode 100644
index 00000000..e926dad2
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/flex/__init__.py
@@ -0,0 +1,79 @@
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdFlex(ModelScopeLayoutComponent):
+ """
+ A flex layout container for alignment.
+ Good for setting spacing between elements.
+ Suitable for setting various horizontal and vertical alignments.
+ """
+
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ vertical: bool = False,
+ wrap: str | bool = "nowrap",
+ justify: str | None = "normal",
+ align: str | None = "normal",
+ flex: str | None = "normal",
+ gap: Literal["small", "middle", "large"] | str | int | None = None,
+ component: str | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ vertical: Is direction of the flex vertical, use flex-direction: column.
+ wrap: Set whether the element is displayed in a single line or in multiple lines.
+ justify: Sets the alignment of elements in the direction of the main axis.
+ align: Sets the alignment of elements in the direction of the cross axis.
+ flex: flex CSS shorthand properties.
+ gap: Sets the gap between grids.
+ component: custom element type.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.vertical = vertical
+ self.wrap = wrap
+ self.justify = justify
+ self.align = align
+ self.flex = flex
+ self.gap = gap
+ self.component = component
+
+ FRONTEND_DIR = resolve_frontend_dir("flex")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/float_button/__init__.py b/backend/modelscope_studio/components/antd/float_button/__init__.py
new file mode 100644
index 00000000..94f42824
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/float_button/__init__.py
@@ -0,0 +1,63 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .back_top import AntdFloatButtonBackTop
+from .group import AntdFloatButtonGroup
+
+
+class AntdFloatButton(ModelScopeLayoutComponent):
+ """
+ """
+ BackTop = AntdFloatButtonBackTop
+ Group = AntdFloatButtonGroup
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['icon', 'description', 'tooltip', 'badge.count']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("float-button")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/float_button/back_top/__init__.py b/backend/modelscope_studio/components/antd/float_button/back_top/__init__.py
new file mode 100644
index 00000000..42c9b4d9
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/float_button/back_top/__init__.py
@@ -0,0 +1,60 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdFloatButtonBackTop(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['icon', 'description', 'tooltip', 'badge.count']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("float-button", "back-top")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/float_button/group/__init__.py b/backend/modelscope_studio/components/antd/float_button/group/__init__.py
new file mode 100644
index 00000000..dc9795e3
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/float_button/group/__init__.py
@@ -0,0 +1,63 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdFloatButtonGroup(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['icon', 'closeIcon', 'description', 'tooltip', 'badge.count']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("float-button", "group")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/form/__init__.py b/backend/modelscope_studio/components/antd/form/__init__.py
new file mode 100644
index 00000000..baaf00bb
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/form/__init__.py
@@ -0,0 +1,82 @@
+from __future__ import annotations
+
+from typing import Union
+
+from gradio.data_classes import GradioRootModel
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .item import AntdFormItem
+
+
+class AntdFormData(GradioRootModel):
+ root: Union[dict, None] = None
+
+
+class AntdForm(ModelScopeDataLayoutComponent):
+ """
+ """
+ Item = AntdFormItem
+ EVENTS = [
+ EventListener("fields_change",
+ callback=lambda block: block._internal.update(
+ bind_fieldsChange_event=True)),
+ EventListener("finish",
+ callback=lambda block: block._internal.update(
+ bind_finish_event=True)),
+ EventListener("finish_failed",
+ callback=lambda block: block._internal.update(
+ bind_finishFailed_event=True)),
+ EventListener("values_change",
+ callback=lambda block: block._internal.update(
+ bind_valuesChange_event=True)),
+ ]
+
+ data_model = AntdFormData
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ value: dict | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("form")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def preprocess(self, payload: dict | AntdFormData | None) -> dict | None:
+ if isinstance(payload, AntdFormData):
+ return payload.root
+ return payload
+
+ def postprocess(self, value: dict | None) -> dict | None:
+ return value
+
+ def example_payload(self) -> dict:
+ return {}
+
+ def example_value(self) -> dict:
+ return {}
diff --git a/backend/modelscope_studio/components/antd/form/item/__init__.py b/backend/modelscope_studio/components/antd/form/item/__init__.py
new file mode 100644
index 00000000..6fbede17
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/form/item/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .rule import AntdFormItemRule
+
+
+class AntdFormItem(ModelScopeDataLayoutComponent):
+ """
+ """
+ Rule = AntdFormItemRule
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'extra', 'help', 'label', 'tooltip', 'tooltip.title', 'tooltip.icon'
+ ]
+
+ def __init__(
+ self,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ form_name: str | int | float | list[str | int | float]
+ | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.label = label
+ self.form_name = form_name
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("form", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/form/item/rule/__init__.py b/backend/modelscope_studio/components/antd/form/item/rule/__init__.py
new file mode 100644
index 00000000..c2991c21
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/form/item/rule/__init__.py
@@ -0,0 +1,49 @@
+from __future__ import annotations
+
+from ......utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+class AntdFormItemRule(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("form", ["item", "rule"])
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/grid/col/__init__.py b/backend/modelscope_studio/components/antd/grid/col/__init__.py
new file mode 100644
index 00000000..2eb80100
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/grid/col/__init__.py
@@ -0,0 +1,102 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdCol(ModelScopeLayoutComponent):
+ """
+ In the grid system, we define the frame outside the information area based on row and column, to ensure that every area can have stable arrangement.
+
+ Following is a brief look at how it works:
+
+ Establish a set of column in the horizontal space defined by row (abbreviated col).
+ Your content elements should be placed directly in the col, and only col should be placed directly in row.
+ The column grid system is a value of 1-24 to represent its range spans. For example, three columns of equal width can be created by
.
+ If the sum of col spans in a row are more than 24, then the overflowing col as a whole will start a new line arrangement.
+ Our grid systems base on Flex layout to allow the elements within the parent to be aligned horizontally - left, center, right, wide arrangement, and decentralized arrangement. The Grid system also supports vertical alignment - top aligned, vertically centered, bottom-aligned. You can also define the order of elements by using order.
+
+ Layout uses a 24 grid layout to define the width of each "box", but does not rigidly adhere to the grid layout.
+ """
+
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ flex: str | int | None = None,
+ offset: int = 0,
+ order: int = 0,
+ pull: int = 0,
+ push: int = 0,
+ span: int | None = None,
+ xs: int | dict | None = None,
+ sm: int | dict | None = None,
+ md: int | dict | None = None,
+ lg: int | dict | None = None,
+ xl: int | dict | None = None,
+ xxl: int | dict | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ flex: Flex layout style.
+ offset: The number of cells to offset Col from the left.
+ order: Raster order.
+ pull: The number of cells that raster is moved to the left.
+ push: The number of cells that raster is moved to the right.
+ span: Raster number of cells to occupy, 0 corresponds to display: none.
+ xs: screen < 576px and also default setting, could be a span value or an object containing above props.
+ sm: screen ≥ 576px, could be a span value or an object containing above props.
+ md: screen ≥ 768px, could be a span value or an object containing above props.
+ lg: screen ≥ 992px, could be a span value or an object containing above props.
+ xl: screen ≥ 1200px, could be a span value or an object containing above props.
+ xxl: screen ≥ 1600px, could be a span value or an object containing above props.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.flex = flex
+ self.offset = offset
+ self.order = order
+ self.pull = pull
+ self.push = push
+ self.span = span
+ self.xs = xs
+ self.sm = sm
+ self.md = md
+ self.lg = lg
+ self.xl = xl
+ self.xxl = xxl
+
+ FRONTEND_DIR = resolve_frontend_dir("grid", 'col')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/grid/row/__init__.py b/backend/modelscope_studio/components/antd/grid/row/__init__.py
new file mode 100644
index 00000000..a564e8da
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/grid/row/__init__.py
@@ -0,0 +1,78 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdRow(ModelScopeLayoutComponent):
+ """
+ In the grid system, we define the frame outside the information area based on row and column, to ensure that every area can have stable arrangement.
+
+ Following is a brief look at how it works:
+
+ Establish a set of column in the horizontal space defined by row (abbreviated col).
+ Your content elements should be placed directly in the col, and only col should be placed directly in row.
+ The column grid system is a value of 1-24 to represent its range spans. For example, three columns of equal width can be created by .
+ If the sum of col spans in a row are more than 24, then the overflowing col as a whole will start a new line arrangement.
+ Our grid systems base on Flex layout to allow the elements within the parent to be aligned horizontally - left, center, right, wide arrangement, and decentralized arrangement. The Grid system also supports vertical alignment - top aligned, vertically centered, bottom-aligned. You can also define the order of elements by using order.
+
+ Layout uses a 24 grid layout to define the width of each "box", but does not rigidly adhere to the grid layout.
+ """
+
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ align: list[str] | str | dict = "top",
+ gutter: int | dict | list[int] = 0,
+ justify: list[str] | str | dict = "start",
+ wrap: bool = True,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ """
+ Parameters:
+ align: Vertical alignment.
+ gutter: Spacing between grids, could be a number or a object like { xs: 8, sm: 16, md: 24}. Or you can use array to make horizontal and vertical spacing work at the same time [horizontal, vertical].
+ justify: Horizontal arrangement.
+ wrap: Auto wrap line.
+ """
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.align = align
+ self.gutter = gutter
+ self.justify = justify
+ self.wrap = wrap
+
+ FRONTEND_DIR = resolve_frontend_dir("grid", 'row')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/icon/__init__.py b/backend/modelscope_studio/components/antd/icon/__init__.py
new file mode 100644
index 00000000..1efc73a1
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/icon/__init__.py
@@ -0,0 +1,65 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeComponent, resolve_frontend_dir
+from .iconfont_provider import AntdIconfontProvider
+
+
+class AntdIcon(ModelScopeComponent):
+ """
+ """
+
+ IconfontProvider = AntdIconfontProvider
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ value: str | None = "GithubOutlined",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("icon")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> str:
+ return "GithubOutlined"
+
+ def example_value(self) -> str:
+ return "GithubOutlined"
diff --git a/backend/modelscope_studio/components/antd/icon/iconfont_provider/__init__.py b/backend/modelscope_studio/components/antd/icon/iconfont_provider/__init__.py
new file mode 100644
index 00000000..101c16b9
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/icon/iconfont_provider/__init__.py
@@ -0,0 +1,49 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdIconfontProvider(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ script_url: str | list[str] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ render=render,
+ as_item=as_item,
+ **kwargs)
+ self.script_url = script_url
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("icon", "iconfont-provider")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return "GithubOutlined"
+
+ def example_value(self) -> None:
+ return "GithubOutlined"
diff --git a/backend/modelscope_studio/components/antd/image/__init__.py b/backend/modelscope_studio/components/antd/image/__init__.py
new file mode 100644
index 00000000..8153992b
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/image/__init__.py
@@ -0,0 +1,72 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .preview_group import AntdImagePreviewGroup
+
+
+class AntdImage(ModelScopeLayoutComponent):
+ """
+ """
+ PreviewGroup = AntdImagePreviewGroup
+
+ EVENTS = [
+ EventListener("error",
+ callback=lambda block: block._internal.update(
+ bind_error_event=True)),
+ EventListener("preview_transform",
+ callback=lambda block: block._internal.update(
+ bind_preview_transform_event=True)),
+ EventListener("preview_visible_change",
+ callback=lambda block: block._internal.update(
+ bind_preview_visibleChange_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['placeholder', 'preview.mask', 'preview.closeIcon']
+
+ def __init__(
+ self,
+ src: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.src = src
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("image")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/image/preview_group/__init__.py b/backend/modelscope_studio/components/antd/image/preview_group/__init__.py
new file mode 100644
index 00000000..f92e7627
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/image/preview_group/__init__.py
@@ -0,0 +1,66 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdImagePreviewGroup(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("preview_transform",
+ callback=lambda block: block._internal.update(
+ bind_preview_transform_event=True)),
+ EventListener("preview_change",
+ callback=lambda block: block._internal.update(
+ bind_preview_change_event=True)),
+ EventListener("preview_visible_change",
+ callback=lambda block: block._internal.update(
+ bind_preview_visibleChange_event=True))
+ ]
+ # supported slots
+ SLOTS = ['preview.mask', 'preview.closeIcon']
+
+ def __init__(
+ self,
+ items: list[dict | str] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.items = items
+
+ FRONTEND_DIR = resolve_frontend_dir("image", 'preview-group')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/input/__init__.py b/backend/modelscope_studio/components/antd/input/__init__.py
new file mode 100644
index 00000000..7abc07f4
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/input/__init__.py
@@ -0,0 +1,84 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .otp import AntdInputOTP
+from .password import AntdInputPassword
+from .search import AntdInputSearch
+from .textarea import AntdInputTextarea
+
+
+# as inputs, outputs
+class AntdInput(ModelScopeDataLayoutComponent):
+ """
+ """
+ Textarea = AntdInputTextarea
+ Password = AntdInputPassword
+ OTP = AntdInputOTP
+ Search = AntdInputSearch
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("press_enter",
+ callback=lambda block: block._internal.update(
+ bind_pressEnter_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'addonAfter', 'addonBefore', 'allowClear.clearIcon', 'prefix', 'suffix'
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("input")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: None | str) -> None | str:
+ return payload
+
+ def postprocess(self, value: None | str) -> None | str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/input/otp/__init__.py b/backend/modelscope_studio/components/antd/input/otp/__init__.py
new file mode 100644
index 00000000..2df53eb2
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/input/otp/__init__.py
@@ -0,0 +1,67 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdInputOTP(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("input", "otp")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: None | str) -> None | str:
+ return payload
+
+ def postprocess(self, value: None | str) -> None | str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/input/password/__init__.py b/backend/modelscope_studio/components/antd/input/password/__init__.py
new file mode 100644
index 00000000..cc8153a5
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/input/password/__init__.py
@@ -0,0 +1,82 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdInputPassword(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("press_enter",
+ callback=lambda block: block._internal.update(
+ bind_pressEnter_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ EventListener("visibility_toggle_visible_change",
+ callback=lambda block: block._internal.update(
+ bind_visibilityToggle_visibleChange__event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'addonAfter',
+ 'addonBefore',
+ 'allowClear.clearIcon',
+ 'prefix',
+ 'suffix',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("input", "password")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: None | str) -> None | str:
+ return payload
+
+ def postprocess(self, value: None | str) -> None | str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/input/search/__init__.py b/backend/modelscope_studio/components/antd/input/search/__init__.py
new file mode 100644
index 00000000..4a346894
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/input/search/__init__.py
@@ -0,0 +1,83 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdInputSearch(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("press_enter",
+ callback=lambda block: block._internal.update(
+ bind_pressEnter_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ EventListener("search",
+ callback=lambda block: block._internal.update(
+ bind_search_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'addonAfter',
+ 'addonBefore',
+ 'allowClear.clearIcon',
+ 'prefix',
+ 'suffix',
+ 'enterButton',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("input", "search")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: None | str) -> None | str:
+ return payload
+
+ def postprocess(self, value: None | str) -> None | str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/input/textarea/__init__.py b/backend/modelscope_studio/components/antd/input/textarea/__init__.py
new file mode 100644
index 00000000..e8a56c67
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/input/textarea/__init__.py
@@ -0,0 +1,73 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdInputTextarea(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("press_enter",
+ callback=lambda block: block._internal.update(
+ bind_pressEnter_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['allowClear.clearIcon']
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("input", "textarea")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: None | str) -> None | str:
+ return payload
+
+ def postprocess(self, value: None | str) -> None | str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/input_number/__init__.py b/backend/modelscope_studio/components/antd/input_number/__init__.py
new file mode 100644
index 00000000..03939055
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/input_number/__init__.py
@@ -0,0 +1,84 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdInputNumber(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("press_enter",
+ callback=lambda block: block._internal.update(
+ bind_pressEnter_event=True)),
+ EventListener("step",
+ callback=lambda block: block._internal.update(
+ bind_step_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'addonAfter',
+ 'addonBefore',
+ 'controls.upIcon',
+ 'controls.downIcon',
+ 'prefix',
+ 'suffix',
+ ]
+
+ def __init__(
+ self,
+ value: int | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("input-number")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "number"}
+
+ def preprocess(self, payload: None | int) -> None | int:
+ if isinstance(payload, str):
+ return int(payload)
+ return payload
+
+ def postprocess(self, value: None | int) -> None | int:
+ if isinstance(value, str):
+ return int(value)
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/layout/__init__.py b/backend/modelscope_studio/components/antd/layout/__init__.py
new file mode 100644
index 00000000..8b189470
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/layout/__init__.py
@@ -0,0 +1,68 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .content import AntdLayoutContent
+from .footer import AntdLayoutFooter
+from .header import AntdLayoutHeader
+from .sider import AntdLayoutSider
+
+
+class AntdLayout(ModelScopeLayoutComponent):
+ """
+ """
+
+ Content = AntdLayoutContent
+ Footer = AntdLayoutFooter
+ Header = AntdLayoutHeader
+ Sider = AntdLayoutSider
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("layout")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/layout/content/__init__.py b/backend/modelscope_studio/components/antd/layout/content/__init__.py
new file mode 100644
index 00000000..abfb04e3
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/layout/content/__init__.py
@@ -0,0 +1,58 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdLayoutContent(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("layout", 'content')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/layout/footer/__init__.py b/backend/modelscope_studio/components/antd/layout/footer/__init__.py
new file mode 100644
index 00000000..c15a358d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/layout/footer/__init__.py
@@ -0,0 +1,58 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdLayoutFooter(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("layout", 'footer')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/layout/header/__init__.py b/backend/modelscope_studio/components/antd/layout/header/__init__.py
new file mode 100644
index 00000000..2221b533
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/layout/header/__init__.py
@@ -0,0 +1,58 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdLayoutHeader(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True))
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("layout", 'header')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/layout/sider/__init__.py b/backend/modelscope_studio/components/antd/layout/sider/__init__.py
new file mode 100644
index 00000000..d8bf6f12
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/layout/sider/__init__.py
@@ -0,0 +1,64 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdLayoutSider(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("breakpoint",
+ callback=lambda block: block._internal.update(
+ bind_breakpoint_event=True)),
+ EventListener("collapse",
+ callback=lambda block: block._internal.update(
+ bind_collapse_event=True)),
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("layout", 'sider')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/list/__init__.py b/backend/modelscope_studio/components/antd/list/__init__.py
new file mode 100644
index 00000000..ba398cc6
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/list/__init__.py
@@ -0,0 +1,65 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .item import AntdListItem
+
+
+class AntdList(ModelScopeLayoutComponent):
+ """
+ """
+ Item = AntdListItem
+ EVENTS = [
+ EventListener("pagination_change",
+ callback=lambda block: block._internal.update(
+ bind_pagination_change_event=True)),
+ EventListener("pagination_show_size_change",
+ callback=lambda block: block._internal.update(
+ bind_pagination_showSizeChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['footer', 'header', 'loadMore']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("list")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/list/item/__init__.py b/backend/modelscope_studio/components/antd/list/item/__init__.py
new file mode 100644
index 00000000..d68beaf8
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/list/item/__init__.py
@@ -0,0 +1,59 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .meta import AntdListItemMeta
+
+
+class AntdListItem(ModelScopeLayoutComponent):
+ """
+ """
+ Meta = AntdListItemMeta
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ "actions",
+ 'extra',
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("list", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/list/item/meta/__init__.py b/backend/modelscope_studio/components/antd/list/item/meta/__init__.py
new file mode 100644
index 00000000..95bb134c
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/list/item/meta/__init__.py
@@ -0,0 +1,55 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ......utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdListItemMeta(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['avatar', 'description', 'title']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("list", ["item", "meta"])
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/mentions/__init__.py b/backend/modelscope_studio/components/antd/mentions/__init__.py
new file mode 100644
index 00000000..27498d44
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/mentions/__init__.py
@@ -0,0 +1,88 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .option import AntdMentionsOption
+
+
+# as inputs, outputs
+class AntdMentions(ModelScopeDataLayoutComponent):
+ """
+ """
+ Option = AntdMentionsOption
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("blur",
+ callback=lambda block: block._internal.update(
+ bind_blur_event=True)),
+ EventListener("focus",
+ callback=lambda block: block._internal.update(
+ bind_focus_event=True)),
+ EventListener("search",
+ callback=lambda block: block._internal.update(
+ bind_search_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ EventListener("resize",
+ callback=lambda block: block._internal.update(
+ bind_resize_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['allowClear.clearIcon', 'notFoundContent', "options"]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("mentions")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: None | str) -> None | str:
+ return payload
+
+ def postprocess(self, value: None | str) -> None | str:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/mentions/option/__init__.py b/backend/modelscope_studio/components/antd/mentions/option/__init__.py
new file mode 100644
index 00000000..f8f7a9ec
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/mentions/option/__init__.py
@@ -0,0 +1,65 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdMentionsOption(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ disabled: bool | None = None,
+ key: str | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+ self.label = label
+ self.disabled = disabled
+ self.key = key
+
+ FRONTEND_DIR = resolve_frontend_dir("mentions", "option")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/menu/__init__.py b/backend/modelscope_studio/components/antd/menu/__init__.py
new file mode 100644
index 00000000..067ba781
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/menu/__init__.py
@@ -0,0 +1,84 @@
+from __future__ import annotations
+
+from typing import Any, List
+
+from gradio.data_classes import GradioModel
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .item import AntdMenuItem
+
+
+class MenuData(GradioModel):
+ open_keys: List[str] = []
+ selected_keys: List[str] = []
+
+
+# as inputs, outputs
+class AntdMenu(ModelScopeDataLayoutComponent):
+ """
+ """
+ Item = AntdMenuItem
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("deselect",
+ callback=lambda block: block._internal.update(
+ bind_deselect_event=True)),
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ["expandIcon", 'overflowedIndicator', "items"]
+ data_model = MenuData
+
+ def __init__(
+ self,
+ value: MenuData | dict | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("menu")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def preprocess(self, payload: dict | MenuData) -> dict | MenuData:
+ return payload
+
+ def postprocess(self, value: dict | MenuData | None) -> MenuData:
+ if isinstance(value, dict):
+ value = MenuData(**value)
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/menu/item/__init__.py b/backend/modelscope_studio/components/antd/menu/item/__init__.py
new file mode 100644
index 00000000..1d205951
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/menu/item/__init__.py
@@ -0,0 +1,63 @@
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdMenuItem(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("title_click",
+ callback=lambda block: block._internal.update(
+ bind_titleClick_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ["title", 'icon', "label"]
+
+ def __init__(
+ self,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.label = label
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("menu", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/message/__init__.py b/backend/modelscope_studio/components/antd/message/__init__.py
new file mode 100644
index 00000000..256faf0a
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/message/__init__.py
@@ -0,0 +1,64 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdMessage(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['icon', 'content']
+
+ def __init__(
+ self,
+ content: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = False,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.content = content
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("message")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> str:
+ return "Message"
+
+ def example_value(self) -> str:
+ return "Message"
diff --git a/backend/modelscope_studio/components/antd/modal/__init__.py b/backend/modelscope_studio/components/antd/modal/__init__.py
new file mode 100644
index 00000000..a1601872
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/modal/__init__.py
@@ -0,0 +1,74 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdModal(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("ok",
+ callback=lambda block: block._internal.update(
+ bind_cancel_event=True)),
+ EventListener("cancel",
+ callback=lambda block: block._internal.update(
+ bind_cancel_event=True))
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'closeIcon',
+ 'cancelButtonProps.icon',
+ 'cancelText',
+ 'closable.closeIcon',
+ 'closeIcon',
+ 'footer',
+ 'title',
+ 'okButtonProps.icon',
+ 'okText',
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("modal")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/notification/__init__.py b/backend/modelscope_studio/components/antd/notification/__init__.py
new file mode 100644
index 00000000..664f4b36
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/notification/__init__.py
@@ -0,0 +1,66 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdNotification(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['btn', 'closeIcon', "description", "icon", "message"]
+
+ def __init__(
+ self,
+ message: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = False,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.message = message
+
+ FRONTEND_DIR = resolve_frontend_dir("notification")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/pagination/__init__.py b/backend/modelscope_studio/components/antd/pagination/__init__.py
new file mode 100644
index 00000000..9b8536a4
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/pagination/__init__.py
@@ -0,0 +1,80 @@
+from __future__ import annotations
+
+from typing import Optional, Union
+
+from gradio.data_classes import GradioModel
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+class PaginationData(GradioModel):
+ page: int
+ page_size: Optional[Union[int, None]] = None
+
+
+# as inputs, outputs
+class AntdPagination(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("show_size_change",
+ callback=lambda block: block._internal.update(
+ bind_showSizeChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['showQuickJumper.goButton']
+
+ data_model = PaginationData
+
+ def __init__(
+ self,
+ value: int | dict | PaginationData | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("pagination")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def preprocess(self,
+ payload: PaginationData | dict) -> PaginationData | dict:
+ return payload
+
+ def postprocess(self,
+ value: PaginationData | dict | int) -> PaginationData:
+ if isinstance(value, int):
+ value = dict(page=value)
+ if isinstance(value, dict):
+ value = PaginationData(**value)
+ return value
+
+ def example_payload(self) -> None:
+ return {"page": 1, "page_size": 10}
+
+ def example_value(self) -> None:
+ return {"page": 1, "page_size": 10}
diff --git a/backend/modelscope_studio/components/antd/popconfirm/__init__.py b/backend/modelscope_studio/components/antd/popconfirm/__init__.py
new file mode 100644
index 00000000..27c1d24c
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/popconfirm/__init__.py
@@ -0,0 +1,77 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdPopconfirm(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ EventListener("cancel",
+ callback=lambda block: block._internal.update(
+ bind_cancel_event=True)),
+ EventListener("confirm",
+ callback=lambda block: block._internal.update(
+ bind_confirm_event=True)),
+ EventListener("popup_click",
+ callback=lambda block: block._internal.update(
+ bind_popupClick_event=True))
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'title',
+ 'description',
+ 'cancelButtonProps.icon',
+ 'cancelText',
+ 'okButtonProps.icon',
+ 'okText',
+ ]
+
+ def __init__(
+ self,
+ title: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.title = title
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("popconfirm")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> str:
+ return "Popconfirm"
+
+ def example_value(self) -> str:
+ return "Popconfirm"
diff --git a/backend/modelscope_studio/components/antd/popover/__init__.py b/backend/modelscope_studio/components/antd/popover/__init__.py
new file mode 100644
index 00000000..5ff11605
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/popover/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdPopover(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['title', "content"]
+
+ def __init__(
+ self,
+ content: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.content = content
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("popover")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> str:
+ return "Popover"
+
+ def example_value(self) -> str:
+ return "Popover"
diff --git a/backend/modelscope_studio/components/antd/progress/__init__.py b/backend/modelscope_studio/components/antd/progress/__init__.py
new file mode 100644
index 00000000..16786208
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/progress/__init__.py
@@ -0,0 +1,54 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeComponent, resolve_frontend_dir
+
+
+class AntdProgress(ModelScopeComponent):
+ """
+ """
+
+ EVENTS = []
+
+ def __init__(
+ self,
+ percent: int = 0,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.percent = percent
+
+ FRONTEND_DIR = resolve_frontend_dir("progress")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return 0
+
+ def example_value(self) -> Any:
+ return 0
diff --git a/backend/modelscope_studio/components/antd/qr_code/__init__.py b/backend/modelscope_studio/components/antd/qr_code/__init__.py
new file mode 100644
index 00000000..51f610d6
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/qr_code/__init__.py
@@ -0,0 +1,60 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeComponent, resolve_frontend_dir
+
+
+class AntdQRCode(ModelScopeComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("refresh",
+ callback=lambda block: block._internal.update(
+ bind_refresh_event=True)),
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("qr-code")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str) -> str:
+ return payload
+
+ def postprocess(self, value: str) -> str:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/radio/__init__.py b/backend/modelscope_studio/components/antd/radio/__init__.py
new file mode 100644
index 00000000..a475c1fb
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/radio/__init__.py
@@ -0,0 +1,77 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .button import AntdRadioButton
+from .group import AntdRadioGroup
+
+
+# as inputs, outputs
+class AntdRadio(ModelScopeDataLayoutComponent):
+ """
+ """
+ Group = AntdRadioGroup
+ Button = AntdRadioButton
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ def __init__(
+ self,
+ group_value: Any | None = None,
+ value: bool | None = None,
+ props: dict | None = None,
+ *,
+ auto_focus: bool | None = None,
+ default_checked: bool | None = None,
+ disabled: bool | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.group_value = group_value
+ self.auto_focus = auto_focus
+ self.default_checked = default_checked
+ self.disabled = disabled
+
+ FRONTEND_DIR = resolve_frontend_dir("radio")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "boolean"}
+
+ def preprocess(self, payload: None | bool) -> None | bool:
+ return payload
+
+ def postprocess(self, value: None | bool) -> None | bool:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/radio/button/__init__.py b/backend/modelscope_studio/components/antd/radio/button/__init__.py
new file mode 100644
index 00000000..bd5d527e
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/radio/button/__init__.py
@@ -0,0 +1,73 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdRadioButton(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ def __init__(
+ self,
+ group_value: Any | None = None,
+ value: bool | None = None,
+ props: dict | None = None,
+ *,
+ auto_focus: bool | None = None,
+ default_checked: bool | None = None,
+ disabled: bool | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.group_value = group_value
+ self.auto_focus = auto_focus
+ self.default_checked = default_checked
+ self.disabled = disabled
+
+ FRONTEND_DIR = resolve_frontend_dir("radio", 'button')
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "boolean"}
+
+ def preprocess(self, payload: None | bool) -> None | bool:
+ return payload
+
+ def postprocess(self, value: None | bool) -> None | bool:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/radio/group/__init__.py b/backend/modelscope_studio/components/antd/radio/group/__init__.py
new file mode 100644
index 00000000..37338a25
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/radio/group/__init__.py
@@ -0,0 +1,81 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .option import AntdRadioGroupOption
+
+
+# as inputs, outputs
+class AntdRadioGroup(ModelScopeDataLayoutComponent):
+ """
+ """
+ Option = AntdRadioGroupOption
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+ # supported slots
+ SLOTS = ['options']
+
+ def __init__(
+ self,
+ value: Any | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("radio", "group")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "boolean"
+ },
+ ],
+ }
+
+ def preprocess(self, payload: Any | None) -> Any | None:
+ return payload
+
+ def postprocess(self, value: Any | None) -> Any | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/radio/group/option/__init__.py b/backend/modelscope_studio/components/antd/radio/group/option/__init__.py
new file mode 100644
index 00000000..d888d6c3
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/radio/group/option/__init__.py
@@ -0,0 +1,67 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ......utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdRadioGroupOption(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ label: str | None = None,
+ disabled: bool | None = None,
+ title: str | None = None,
+ required: bool | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+ self.label = label
+ self.disabled = disabled
+ self.title = title
+ self.required = required
+
+ FRONTEND_DIR = resolve_frontend_dir("radio", ['group', 'option'])
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/rate/__init__.py b/backend/modelscope_studio/components/antd/rate/__init__.py
new file mode 100644
index 00000000..e6693916
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/rate/__init__.py
@@ -0,0 +1,80 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdRate(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("blur",
+ callback=lambda block: block._internal.update(
+ bind_blur_event=True)),
+ EventListener("focus",
+ callback=lambda block: block._internal.update(
+ bind_focus_event=True)),
+ EventListener("hover_change",
+ callback=lambda block: block._internal.update(
+ bind_hoverChange_event=True)),
+ EventListener("key_down",
+ callback=lambda block: block._internal.update(
+ bind_keyDown_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ["character"]
+
+ def __init__(
+ self,
+ value: int | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("rate")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "number"}
+
+ def preprocess(self, payload: None | int) -> None | int:
+ return payload
+
+ def postprocess(self, value: None | int) -> None | int:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/result/__init__.py b/backend/modelscope_studio/components/antd/result/__init__.py
new file mode 100644
index 00000000..c0d76852
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/result/__init__.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdResult(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['extra', 'icon', 'subTitle', 'title']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("result")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/segmented/__init__.py b/backend/modelscope_studio/components/antd/segmented/__init__.py
new file mode 100644
index 00000000..c89651b7
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/segmented/__init__.py
@@ -0,0 +1,75 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .option import AntdSegmentedOption
+
+
+# as inputs, outputs
+class AntdSegmented(ModelScopeDataLayoutComponent):
+ """
+ """
+ Option = AntdSegmentedOption
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ def __init__(
+ self,
+ value: str | int | float | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("segmented")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, list[str]]:
+ return {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ ]
+ }
+
+ def preprocess(self, payload: str | int | float) -> str | int | float:
+ return payload
+
+ def postprocess(self, value: str | int | float) -> str | int | float:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/segmented/option/__init__.py b/backend/modelscope_studio/components/antd/segmented/option/__init__.py
new file mode 100644
index 00000000..325eabcf
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/segmented/option/__init__.py
@@ -0,0 +1,57 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSegmentedOption(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['icon', "label"]
+
+ def __init__(
+ self,
+ value: str | int | float | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("segmented", "option")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/select/__init__.py b/backend/modelscope_studio/components/antd/select/__init__.py
new file mode 100644
index 00000000..e2cbd03d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/select/__init__.py
@@ -0,0 +1,122 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .option import AntdSelectOption
+
+
+# as inputs, outputs
+class AntdSelect(ModelScopeDataLayoutComponent):
+ """
+ """
+ Option = AntdSelectOption
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("blur",
+ callback=lambda block: block._internal.update(
+ bind_blur_event=True)),
+ EventListener("focus",
+ callback=lambda block: block._internal.update(
+ bind_focus_event=True)),
+ EventListener("search",
+ callback=lambda block: block._internal.update(
+ bind_search_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ EventListener("clear",
+ callback=lambda block: block._internal.update(
+ bind_clear_event=True)),
+ EventListener("popup_scroll",
+ callback=lambda block: block._internal.update(
+ bind_popupScroll_event=True)),
+ EventListener("dropdown_visible_change",
+ callback=lambda block: block._internal.update(
+ bind_dropdownVisibleChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'allowClear.clearIcon', 'maxTagPlaceholder', 'menuItemSelectedIcon',
+ 'notFoundContent', 'removeIcon', 'suffixIcon', 'options'
+ ]
+
+ def __init__(
+ self,
+ value: str | int | float | list[float | int | str] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ key: int | str | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ key=key,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("select")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [
+ {
+ "type": "string",
+ },
+ {
+ "type": "number",
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string",
+ },
+ {
+ "type": "number",
+ },
+ ],
+ },
+ },
+ ]
+ }
+
+ def preprocess(
+ self, payload: str | int | float | list[float | int | str] | None
+ ) -> str | int | float | list[float | int | str] | None:
+ return payload
+
+ def postprocess(
+ self, value: str | int | float | list[float | int | str] | None
+ ) -> str | int | float | list[float | int | str] | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/select/option/__init__.py b/backend/modelscope_studio/components/antd/select/option/__init__.py
new file mode 100644
index 00000000..b33f4e07
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/select/option/__init__.py
@@ -0,0 +1,63 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSelectOption(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['label', 'options']
+
+ def __init__(
+ self,
+ value: str | None = None,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ title: str | None = None,
+ disabled: bool | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+ self.label = label
+ self.disabled = disabled
+ self.title = title
+
+ FRONTEND_DIR = resolve_frontend_dir("select", "option")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/skeleton/__init__.py b/backend/modelscope_studio/components/antd/skeleton/__init__.py
new file mode 100644
index 00000000..62c4b87a
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/skeleton/__init__.py
@@ -0,0 +1,60 @@
+from __future__ import annotations
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .avatar import AntdSkeletonAvatar
+from .button import AntdSkeletonButton
+from .image import AntdSkeletonImage
+from .input import AntdSkeletonInput
+from .node import AntdSkeletonNode
+
+
+class AntdSkeleton(ModelScopeLayoutComponent):
+ """
+ """
+ Node = AntdSkeletonNode
+ Avatar = AntdSkeletonAvatar
+ Button = AntdSkeletonButton
+ Image = AntdSkeletonImage
+ Input = AntdSkeletonInput
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("skeleton")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/skeleton/avatar/__init__.py b/backend/modelscope_studio/components/antd/skeleton/avatar/__init__.py
new file mode 100644
index 00000000..28a138db
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/skeleton/avatar/__init__.py
@@ -0,0 +1,50 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSkeletonAvatar(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("skeleton", "avatar")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/skeleton/button/__init__.py b/backend/modelscope_studio/components/antd/skeleton/button/__init__.py
new file mode 100644
index 00000000..e856eb83
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/skeleton/button/__init__.py
@@ -0,0 +1,50 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSkeletonButton(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("skeleton", "button")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/skeleton/image/__init__.py b/backend/modelscope_studio/components/antd/skeleton/image/__init__.py
new file mode 100644
index 00000000..54f53572
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/skeleton/image/__init__.py
@@ -0,0 +1,50 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSkeletonImage(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("skeleton", "image")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/skeleton/input/__init__.py b/backend/modelscope_studio/components/antd/skeleton/input/__init__.py
new file mode 100644
index 00000000..a6cf6df0
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/skeleton/input/__init__.py
@@ -0,0 +1,50 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSkeletonInput(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("skeleton", "input")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/skeleton/node/__init__.py b/backend/modelscope_studio/components/antd/skeleton/node/__init__.py
new file mode 100644
index 00000000..d1f7ee13
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/skeleton/node/__init__.py
@@ -0,0 +1,50 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSkeletonNode(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("skeleton", "node")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/slider/__init__.py b/backend/modelscope_studio/components/antd/slider/__init__.py
new file mode 100644
index 00000000..2a118402
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/slider/__init__.py
@@ -0,0 +1,89 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .mark import AntdSliderMark
+
+
+# as inputs, outputs
+class AntdSlider(ModelScopeDataLayoutComponent):
+ """
+ """
+ Mark = AntdSliderMark
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("change_complete",
+ callback=lambda block: block._internal.update(
+ bind_changeComplete_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['marks']
+
+ def __init__(
+ self,
+ value: int | float | tuple[int | float, int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("slider")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [
+ {
+ "type": "number",
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "number",
+ },
+ },
+ ]
+ }
+
+ def preprocess(
+ self, payload: int | float | tuple[int | float, int | float] | None
+ ) -> int | float | tuple[int | float, int | float] | None:
+ return payload
+
+ def postprocess(
+ self, value: int | float | tuple[int | float, int | float] | None
+ ) -> int | float | tuple[int | float, int | float] | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/slider/mark/__init__.py b/backend/modelscope_studio/components/antd/slider/mark/__init__.py
new file mode 100644
index 00000000..106a6e49
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/slider/mark/__init__.py
@@ -0,0 +1,65 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSliderMark(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'label',
+ ]
+
+ def __init__(
+ self,
+ number: float | int | None = None,
+ label: str | None = None,
+ props: dict | None = None,
+ *,
+ title: str | None = None,
+ disabled: bool | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.number = number
+ self.label = label
+ self.disabled = disabled
+ self.title = title
+
+ FRONTEND_DIR = resolve_frontend_dir("slider", "mark")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/space/__init__.py b/backend/modelscope_studio/components/antd/space/__init__.py
new file mode 100644
index 00000000..1e05cc8d
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/space/__init__.py
@@ -0,0 +1,56 @@
+from __future__ import annotations
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .compact import AntdSpaceCompact
+
+
+class AntdSpace(ModelScopeLayoutComponent):
+ """
+ """
+ Compact = AntdSpaceCompact
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['split']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("space")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/space/compact/__init__.py b/backend/modelscope_studio/components/antd/space/compact/__init__.py
new file mode 100644
index 00000000..4610fe6e
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/space/compact/__init__.py
@@ -0,0 +1,49 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSpaceCompact(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("space", "compact")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/spin/__init__.py b/backend/modelscope_studio/components/antd/spin/__init__.py
new file mode 100644
index 00000000..0fe9695c
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/spin/__init__.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdSpin(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['tip', 'indicator']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("spin")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/statistic/__init__.py b/backend/modelscope_studio/components/antd/statistic/__init__.py
new file mode 100644
index 00000000..79b74743
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/statistic/__init__.py
@@ -0,0 +1,58 @@
+from __future__ import annotations
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .countdown import AntdStatisticCountdown
+
+
+class AntdStatistic(ModelScopeLayoutComponent):
+ """
+ """
+ Countdown = AntdStatisticCountdown
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['prefix', 'suffix', 'title']
+
+ def __init__(
+ self,
+ value: int | float | str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("statistic")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/statistic/countdown/__init__.py b/backend/modelscope_studio/components/antd/statistic/countdown/__init__.py
new file mode 100644
index 00000000..3483c15c
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/statistic/countdown/__init__.py
@@ -0,0 +1,66 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdStatisticCountdown(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("finish",
+ callback=lambda block: block._internal.update(
+ bind_finish_event=True)),
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['prefix', 'suffix', 'title']
+
+ def __init__(
+ self,
+ value: int | float | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.value = value
+
+ FRONTEND_DIR = resolve_frontend_dir("statistic", "countdown")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str) -> str:
+ return payload
+
+ def postprocess(self, value: str) -> str:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/steps/__init__.py b/backend/modelscope_studio/components/antd/steps/__init__.py
new file mode 100644
index 00000000..92b0c7f7
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/steps/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .item import AntdStepsItem
+
+
+class AntdSteps(ModelScopeLayoutComponent):
+ """
+ """
+ Item = AntdStepsItem
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['progressDot', "items"]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("steps")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/steps/item/__init__.py b/backend/modelscope_studio/components/antd/steps/item/__init__.py
new file mode 100644
index 00000000..e23efeb8
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/steps/item/__init__.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdStepsItem(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['description', "icon", "subTitle", "title"]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("steps", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/switch/__init__.py b/backend/modelscope_studio/components/antd/switch/__init__.py
new file mode 100644
index 00000000..6cbd922f
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/switch/__init__.py
@@ -0,0 +1,71 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdSwitch(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['checkedChildren', 'unCheckedChildren']
+
+ def __init__(
+ self,
+ value: bool | None = False,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("switch")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "boolean"}
+
+ def preprocess(self, payload: None | str) -> None | bool:
+ return payload
+
+ def postprocess(self, value: None | bool) -> None | bool:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/table/__init__.py b/backend/modelscope_studio/components/antd/table/__init__.py
new file mode 100644
index 00000000..a712b9ef
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/table/__init__.py
@@ -0,0 +1,91 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .column import AntdTableColumn
+from .column_group import AntdTableColumnGroup
+from .constants import (EXPAND_COLUMN, SELECTION_ALL, SELECTION_COLUMN,
+ SELECTION_INVERT, SELECTION_NONE)
+from .expandable import AntdTableExpandable
+from .row_selection import AntdTableRowSelection
+
+
+class AntdTable(ModelScopeLayoutComponent):
+ """
+ """
+ Column = AntdTableColumn
+ ColumnGroup = AntdTableColumnGroup
+ Expandable = AntdTableExpandable
+ RowSelection = AntdTableRowSelection
+
+ # constants
+ EXPAND_COLUMN = EXPAND_COLUMN
+ SELECTION_ALL = SELECTION_ALL
+ SELECTION_COLUMN = SELECTION_COLUMN
+ SELECTION_INVERT = SELECTION_INVERT
+ SELECTION_NONE = SELECTION_NONE
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("scroll",
+ callback=lambda block: block._internal.update(
+ bind_scroll_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'footer',
+ 'title',
+ "expandable",
+ "rowSelection"
+ 'loading.tip',
+ 'loading.indicator',
+ 'pagination.showQuickJumper.goButton',
+ 'showSorterTooltip.title',
+ ]
+
+ def __init__(
+ self,
+ data_source: list[dict] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.data_source = data_source
+
+ FRONTEND_DIR = resolve_frontend_dir("table")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/table/column/__init__.py b/backend/modelscope_studio/components/antd/table/column/__init__.py
new file mode 100644
index 00000000..2ee06604
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/table/column/__init__.py
@@ -0,0 +1,64 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTableColumn(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("filter_dropdown_open_change",
+ callback=lambda block: block._internal.update(
+ bind_filterDropdownOpenChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'filterDropdown', 'filterIcon', 'title', 'sortIcon',
+ 'showSorterTooltip.title'
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ built_in_column: str | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.built_in_column = built_in_column
+
+ FRONTEND_DIR = resolve_frontend_dir("table", "column")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/table/column_group/__init__.py b/backend/modelscope_studio/components/antd/table/column_group/__init__.py
new file mode 100644
index 00000000..eef3cb13
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/table/column_group/__init__.py
@@ -0,0 +1,57 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTableColumnGroup(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = [
+ 'title',
+ ]
+
+ def __init__(
+ self,
+ title: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.title = title
+
+ FRONTEND_DIR = resolve_frontend_dir("table", "column-group")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/table/constants.py b/backend/modelscope_studio/components/antd/table/constants.py
new file mode 100644
index 00000000..44227dcd
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/table/constants.py
@@ -0,0 +1,5 @@
+EXPAND_COLUMN = "EXPAND_COLUMN"
+SELECTION_COLUMN = "SELECTION_COLUMN"
+SELECTION_ALL = "SELECT_ALL"
+SELECTION_INVERT = "SELECT_INVERT"
+SELECTION_NONE = "SELECT_NONE"
diff --git a/backend/modelscope_studio/components/antd/table/expandable/__init__.py b/backend/modelscope_studio/components/antd/table/expandable/__init__.py
new file mode 100644
index 00000000..7a10ecca
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/table/expandable/__init__.py
@@ -0,0 +1,73 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdTableExpandable(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("expand",
+ callback=lambda block: block._internal.update(
+ bind_expand_event=True)),
+ EventListener("expanded_rows_change",
+ callback=lambda block: block._internal.update(
+ bind_expandedRowsChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'columnTitle',
+ 'expandIcon',
+ ]
+
+ def __init__(
+ self,
+ value: list[str] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("table", "expandable")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "array", "items": {"type": "string"}}
+
+ def preprocess(self, payload: list[str] | None) -> list[str] | None:
+ return payload
+
+ def postprocess(self, value: list[str] | None) -> list[str] | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/table/row_selection/__init__.py b/backend/modelscope_studio/components/antd/table/row_selection/__init__.py
new file mode 100644
index 00000000..64746137
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/table/row_selection/__init__.py
@@ -0,0 +1,104 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .selection import AntdTableRowSelectionSelection
+
+
+# as inputs, outputs
+class AntdTableRowSelection(ModelScopeDataLayoutComponent):
+ """
+ """
+ Selection = AntdTableRowSelectionSelection
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ EventListener("select_all",
+ callback=lambda block: block._internal.update(
+ bind_selectAll_event=True)),
+ EventListener("select_invert",
+ callback=lambda block: block._internal.update(
+ bind_selectInvert_event=True)),
+ EventListener("select_none",
+ callback=lambda block: block._internal.update(
+ bind_selectNone_event=True)),
+ EventListener("select_multiple",
+ callback=lambda block: block._internal.update(
+ bind_selectMultiple_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'columnTitle',
+ 'selections',
+ ]
+
+ def __init__(
+ self,
+ value: list[str] | list[int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("table", "row-selection")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [{
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }, {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
+ }]
+ }
+
+ def preprocess(
+ self, payload: list[str] | list[int | float] | None
+ ) -> list[str] | list[int | float] | None:
+ return payload
+
+ def postprocess(
+ self, value: list[str] | list[int | float] | None
+ ) -> list[str] | list[int | float] | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/table/row_selection/selection/__init__.py b/backend/modelscope_studio/components/antd/table/row_selection/selection/__init__.py
new file mode 100644
index 00000000..279cf4df
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/table/row_selection/selection/__init__.py
@@ -0,0 +1,69 @@
+from __future__ import annotations
+
+from typing import Literal
+
+from gradio.events import EventListener
+
+from ......utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTableRowSelectionSelection(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'text',
+ ]
+
+ def __init__(
+ self,
+ text: str | None = None,
+ built_in_selection: Literal["SELECT_ALL", "SELECT_INVERT",
+ "SELECT_NONE"] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.text = text
+ self.built_in_selection = built_in_selection
+
+ FRONTEND_DIR = resolve_frontend_dir("table",
+ ["row-selection", 'selection'])
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tabs/__init__.py b/backend/modelscope_studio/components/antd/tabs/__init__.py
new file mode 100644
index 00000000..b0cc1b4a
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tabs/__init__.py
@@ -0,0 +1,82 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .item import AntdTabsItem
+
+
+# as inputs, outputs
+class AntdTabs(ModelScopeDataLayoutComponent):
+ """
+ """
+ Item = AntdTabsItem
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("edit",
+ callback=lambda block: block._internal.update(
+ bind_edit_event=True)),
+ EventListener("tab_click",
+ callback=lambda block: block._internal.update(
+ bind_tabClick_event=True)),
+ EventListener("tab_scroll",
+ callback=lambda block: block._internal.update(
+ bind_tabScroll_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'addIcon', 'removeIcon', 'tabBarExtraContent',
+ 'tabBarExtraContent.left', 'tabBarExtraContent.right', 'more.icon',
+ 'items'
+ ]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tabs")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "string"}
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tabs/item/__init__.py b/backend/modelscope_studio/components/antd/tabs/item/__init__.py
new file mode 100644
index 00000000..918440db
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tabs/item/__init__.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTabsItem(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['closeIcon', "icon", "label", "children"]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tabs", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tag/__init__.py b/backend/modelscope_studio/components/antd/tag/__init__.py
new file mode 100644
index 00000000..49798cc0
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tag/__init__.py
@@ -0,0 +1,66 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .checkable_tag import AntdTagCheckableTag
+
+
+class AntdTag(ModelScopeLayoutComponent):
+ """
+ """
+ CheckableTag = AntdTagCheckableTag
+
+ EVENTS = [
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['icon', 'closeIcon']
+
+ def __init__(
+ self,
+ value: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tag")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return "Tag"
+
+ def example_value(self) -> Any:
+ return "Tag"
diff --git a/backend/modelscope_studio/components/antd/tag/checkable_tag/__init__.py b/backend/modelscope_studio/components/antd/tag/checkable_tag/__init__.py
new file mode 100644
index 00000000..ec7bf516
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tag/checkable_tag/__init__.py
@@ -0,0 +1,69 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdTagCheckableTag(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True))
+ ]
+
+ def __init__(
+ self,
+ label: str | None = None,
+ value: bool | None = False,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.label = label
+
+ FRONTEND_DIR = resolve_frontend_dir("tag", 'checkable-tag')
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "type": "boolean",
+ }
+
+ def preprocess(self, payload: bool | None) -> bool | None:
+ return payload
+
+ def postprocess(self, value: bool | None) -> bool | None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/time_picker/__init__.py b/backend/modelscope_studio/components/antd/time_picker/__init__.py
new file mode 100644
index 00000000..493b3f0b
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/time_picker/__init__.py
@@ -0,0 +1,83 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .range_picker import AntdTimePickerRangePicker
+
+
+# as inputs, outputs
+class AntdTimePicker(ModelScopeDataLayoutComponent):
+ """
+ """
+ RangePicker = AntdTimePickerRangePicker
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True)),
+ EventListener("calendar_change",
+ callback=lambda block: block._internal.update(
+ bind_calendarChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ ]
+
+ def __init__(
+ self,
+ value: str | int | float | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("time-picker")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"anyOf": [{"type": "number"}, {"type": "string"}]}
+
+ def preprocess(self, payload: int | float) -> int | float:
+ return payload
+
+ def postprocess(self, value: int | float | str) -> int | str:
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/time_picker/range_picker/__init__.py b/backend/modelscope_studio/components/antd/time_picker/range_picker/__init__.py
new file mode 100644
index 00000000..c63f36fd
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/time_picker/range_picker/__init__.py
@@ -0,0 +1,98 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdTimePickerRangePicker(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener(
+ "calendar_change",
+ callback=lambda block: block._internal.update(bind_ok_event=True)),
+ EventListener("focus",
+ callback=lambda block: block._internal.update(
+ bind_calendarChange_event=True)),
+ EventListener("blur",
+ callback=lambda block: block._internal.update(
+ bind_blur_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ 'separator',
+ ]
+
+ def __init__(
+ self,
+ value: tuple[str | int | float, str | int | float] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("time-picker", 'range-picker')
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "type": "array",
+ "items": {
+ "anyOf": [{
+ "type": "number"
+ }, {
+ "type": "string"
+ }]
+ }
+ }
+
+ def preprocess(
+ self, payload: tuple[str | int | float, str | int | float]
+ ) -> tuple[str | int | float, str | int | float]:
+ return payload
+
+ def postprocess(
+ self, value: tuple[str | int | float, str | int | float]
+ ) -> tuple[str | int | float, str | int | float]:
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/timeline/__init__.py b/backend/modelscope_studio/components/antd/timeline/__init__.py
new file mode 100644
index 00000000..053d9087
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/timeline/__init__.py
@@ -0,0 +1,55 @@
+from __future__ import annotations
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from .item import AntdTimelineItem
+
+
+class AntdTimeline(ModelScopeLayoutComponent):
+ """
+ """
+ Item = AntdTimelineItem
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['pending', 'pendingDot']
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("timeline")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/timeline/item/__init__.py b/backend/modelscope_studio/components/antd/timeline/item/__init__.py
new file mode 100644
index 00000000..e4026359
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/timeline/item/__init__.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTimelineItem(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ['dot', "label", "children"]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("timeline", "item")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tooltip/__init__.py b/backend/modelscope_studio/components/antd/tooltip/__init__.py
new file mode 100644
index 00000000..ad249ab9
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tooltip/__init__.py
@@ -0,0 +1,61 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTooltip(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("open_change",
+ callback=lambda block: block._internal.update(
+ bind_openChange_event=True))
+ ]
+
+ # supported slots
+ SLOTS = ['title']
+
+ def __init__(
+ self,
+ title: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.title = title
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tooltip")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> str:
+ return "Tooltip"
+
+ def example_value(self) -> str:
+ return "Tooltip"
diff --git a/backend/modelscope_studio/components/antd/tour/__init__.py b/backend/modelscope_studio/components/antd/tour/__init__.py
new file mode 100644
index 00000000..0cc23d55
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tour/__init__.py
@@ -0,0 +1,77 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .step import AntdTourStep
+
+
+# as inputs, outputs
+class AntdTour(ModelScopeDataLayoutComponent):
+ """
+ """
+ Step = AntdTourStep
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True)),
+ EventListener("finish",
+ callback=lambda block: block._internal.update(
+ bind_finish_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = ['closeIcon']
+
+ def __init__(
+ self,
+ value: int | None = None,
+ props: dict | None = None,
+ *,
+ open: bool | None = None,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.open = open
+
+ FRONTEND_DIR = resolve_frontend_dir("tour")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {"type": "number"}
+
+ def preprocess(self, payload: None | int) -> None | int:
+ return payload
+
+ def postprocess(self, value: None | int) -> None | int:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tour/step/__init__.py b/backend/modelscope_studio/components/antd/tour/step/__init__.py
new file mode 100644
index 00000000..479c12b0
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tour/step/__init__.py
@@ -0,0 +1,68 @@
+from __future__ import annotations
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTourStep(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("close",
+ callback=lambda block: block._internal.update(
+ bind_close_event=True)),
+ EventListener("next_button_props_click",
+ callback=lambda block: block._internal.update(
+ bind_nextButtonProps_click_event=True)),
+ EventListener("prev_button_props_click",
+ callback=lambda block: block._internal.update(
+ bind_prevButtonProps_click_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'closeIcon', "cover", "title", "description",
+ "nextButtonProps.children", "prevButtonProps.children"
+ ]
+
+ def __init__(
+ self,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tour", "step")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/transfer/__init__.py b/backend/modelscope_studio/components/antd/transfer/__init__.py
new file mode 100644
index 00000000..bbd65872
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/transfer/__init__.py
@@ -0,0 +1,101 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+# as inputs, outputs
+class AntdTransfer(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("scroll",
+ callback=lambda block: block._internal.update(
+ bind_scroll_event=True)),
+ EventListener("search",
+ callback=lambda block: block._internal.update(
+ bind_search_event=True)),
+ EventListener("select_change",
+ callback=lambda block: block._internal.update(
+ bind_selectChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'selectionsIcon',
+ 'titles',
+ 'footer',
+ 'locale.notFoundContent',
+ 'selectAllLabels',
+ ]
+
+ def __init__(
+ self,
+ value: list[float | int | str] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ key: int | str | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ key=key,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("transfer")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string",
+ },
+ {
+ "type": "number",
+ },
+ ],
+ },
+ },
+
+ def preprocess(
+ self, payload: list[float | int | str] | None
+ ) -> list[float | int | str] | None:
+ return payload
+
+ def postprocess(
+ self, value: list[float | int | str] | None
+ ) -> list[float | int | str] | None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tree/__init__.py b/backend/modelscope_studio/components/antd/tree/__init__.py
new file mode 100644
index 00000000..f4857f36
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tree/__init__.py
@@ -0,0 +1,115 @@
+from __future__ import annotations
+
+from typing import Any, List, Union
+
+from gradio.data_classes import GradioModel
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .directory_tree import AntdTreeDirectoryTree
+from .tree_node import AntdTreeTreeNode
+
+
+class TreeData(GradioModel):
+ expanded_keys: List[str] = []
+ selected_keys: List[str] = []
+ checked_keys: Union[List[str], dict] = []
+
+
+# as inputs, outputs
+class AntdTree(ModelScopeDataLayoutComponent):
+ """
+ """
+ TreeNode = AntdTreeTreeNode
+ DirectoryTree = AntdTreeDirectoryTree
+
+ EVENTS = [
+ EventListener("check",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("drag_end",
+ callback=lambda block: block._internal.update(
+ bind_dragEnd_event=True)),
+ EventListener("drag_enter",
+ callback=lambda block: block._internal.update(
+ bind_dragEnter_event=True)),
+ EventListener("drag_leave",
+ callback=lambda block: block._internal.update(
+ bind_dragLeave_event=True)),
+ EventListener("drag_over",
+ callback=lambda block: block._internal.update(
+ bind_dragOver_event=True)),
+ EventListener("drag_start",
+ callback=lambda block: block._internal.update(
+ bind_dragStart_event=True)),
+ EventListener("drop",
+ callback=lambda block: block._internal.update(
+ bind_dragDrop_event=True)),
+ EventListener("expand",
+ callback=lambda block: block._internal.update(
+ bind_expand_event=True)),
+ EventListener("load",
+ callback=lambda block: block._internal.update(
+ bind_load_event=True)),
+ EventListener("right_click",
+ callback=lambda block: block._internal.update(
+ bind_rightClick_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'switcherLoadingIcon',
+ 'switcherIcon',
+ 'showLine.showLeafIcon',
+ 'icon',
+ 'treeData',
+ 'draggable.icon',
+ ]
+ data_model = TreeData
+
+ def __init__(
+ self,
+ value: TreeData | dict | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tree")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def preprocess(self, payload: dict | TreeData) -> dict | TreeData:
+ return payload
+
+ def postprocess(self, value: dict | TreeData | None) -> TreeData:
+ if isinstance(value, dict):
+ value = TreeData(**value)
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tree/directory_tree/__init__.py b/backend/modelscope_studio/components/antd/tree/directory_tree/__init__.py
new file mode 100644
index 00000000..a4ad54e5
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tree/directory_tree/__init__.py
@@ -0,0 +1,111 @@
+from __future__ import annotations
+
+from typing import Any, List, Union
+
+from gradio.data_classes import GradioModel
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+class TreeData(GradioModel):
+ expanded_keys: List[str] = []
+ selected_keys: List[str] = []
+ checked_keys: Union[List[str], dict] = []
+
+
+# as inputs, outputs
+class AntdTreeDirectoryTree(ModelScopeDataLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("check",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("drag_end",
+ callback=lambda block: block._internal.update(
+ bind_dragEnd_event=True)),
+ EventListener("drag_enter",
+ callback=lambda block: block._internal.update(
+ bind_dragEnter_event=True)),
+ EventListener("drag_leave",
+ callback=lambda block: block._internal.update(
+ bind_dragLeave_event=True)),
+ EventListener("drag_over",
+ callback=lambda block: block._internal.update(
+ bind_dragOver_event=True)),
+ EventListener("drag_start",
+ callback=lambda block: block._internal.update(
+ bind_dragStart_event=True)),
+ EventListener("drop",
+ callback=lambda block: block._internal.update(
+ bind_dragDrop_event=True)),
+ EventListener("expand",
+ callback=lambda block: block._internal.update(
+ bind_expand_event=True)),
+ EventListener("load",
+ callback=lambda block: block._internal.update(
+ bind_load_event=True)),
+ EventListener("right_click",
+ callback=lambda block: block._internal.update(
+ bind_rightClick_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'switcherLoadingIcon',
+ 'switcherIcon',
+ 'showLine.showLeafIcon',
+ 'icon',
+ 'treeData',
+ 'draggable.icon',
+ ]
+ data_model = TreeData
+
+ def __init__(
+ self,
+ value: TreeData | dict | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tree", "directory-tree")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def preprocess(self, payload: dict | TreeData) -> dict | TreeData:
+ return payload
+
+ def postprocess(self, value: dict | TreeData | None) -> TreeData:
+ if isinstance(value, dict):
+ value = TreeData(**value)
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tree/tree_node/__init__.py b/backend/modelscope_studio/components/antd/tree/tree_node/__init__.py
new file mode 100644
index 00000000..34e9739c
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tree/tree_node/__init__.py
@@ -0,0 +1,57 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTreeTreeNode(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ["title", 'icon']
+
+ def __init__(
+ self,
+ title: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.title = title
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tree", "tree-node")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tree_select/__init__.py b/backend/modelscope_studio/components/antd/tree_select/__init__.py
new file mode 100644
index 00000000..27801b9f
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tree_select/__init__.py
@@ -0,0 +1,99 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .tree_node import AntdTreeSelectTreeNode
+
+
+# as inputs, outputs
+class AntdTreeSelect(ModelScopeDataLayoutComponent):
+ """
+ """
+ TreeNode = AntdTreeSelectTreeNode
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_change_event=True)),
+ EventListener("select",
+ callback=lambda block: block._internal.update(
+ bind_select_event=True)),
+ EventListener("search",
+ callback=lambda block: block._internal.update(
+ bind_search_event=True)),
+ EventListener("tree_expand",
+ callback=lambda block: block._internal.update(
+ bind_treeExpand_event=True)),
+ EventListener("popup_scroll",
+ callback=lambda block: block._internal.update(
+ bind_popupScroll_event=True)),
+ EventListener("dropdown_visible_change",
+ callback=lambda block: block._internal.update(
+ bind_dropdownVisibleChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'allowClear.clearIcon',
+ 'maxTagPlaceholder',
+ 'notFoundContent',
+ 'suffixIcon',
+ 'switcherIcon',
+ ]
+
+ def __init__(
+ self,
+ value: str | list[str] | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(value=value,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tree-select")
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, Any]:
+ return {
+ "anyOf": [{
+ "type": "string"
+ }, {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }]
+ }
+
+ def preprocess(self, payload: str | list[str]) -> str | list[str]:
+ return payload
+
+ def postprocess(self, value: str | list[str] | None) -> str | list[str]:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/tree_select/tree_node/__init__.py b/backend/modelscope_studio/components/antd/tree_select/tree_node/__init__.py
new file mode 100644
index 00000000..f40b850f
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/tree_select/tree_node/__init__.py
@@ -0,0 +1,59 @@
+from __future__ import annotations
+
+from typing import Any
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTreeSelectTreeNode(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = ["title"]
+
+ def __init__(
+ self,
+ value: str | None = None,
+ title: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.title = title
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("tree-select", "tree-node")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/antd/typography/__init__.py b/backend/modelscope_studio/components/antd/typography/__init__.py
new file mode 100644
index 00000000..213b9805
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/typography/__init__.py
@@ -0,0 +1,11 @@
+from .link import AntdTypographyLink
+from .paragraph import AntdTypographyParagraph
+from .text import AntdTypographyText
+from .title import AntdTypographyTitle
+
+
+class AntdTypography:
+ Text = AntdTypographyText
+ Title = AntdTypographyTitle
+ Paragraph = AntdTypographyParagraph
+ Link = AntdTypographyLink
diff --git a/backend/modelscope_studio/components/antd/typography/link/__init__.py b/backend/modelscope_studio/components/antd/typography/link/__init__.py
new file mode 100644
index 00000000..03afb6d6
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/typography/link/__init__.py
@@ -0,0 +1,85 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTypographyLink(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("copyable_copy",
+ callback=lambda block: block._internal.update(
+ bind_copyable_copy_event=True)),
+ EventListener("editable_change",
+ callback=lambda block: block._internal.update(
+ bind_editable_change_event=True)),
+ EventListener("editable_cancel",
+ callback=lambda block: block._internal.update(
+ bind_editable_cancel_event=True)),
+ EventListener("editable_start",
+ callback=lambda block: block._internal.update(
+ bind_editable_start_event=True)),
+ EventListener("editable_end",
+ callback=lambda block: block._internal.update(
+ bind_editable_end_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'copyable.icon',
+ 'copyable.tooltips',
+ 'editable.icon',
+ 'editable.tooltip',
+ 'editable.enterIcon',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("typography", "link")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return "Hello"
+
+ def example_value(self) -> Any:
+ return "Hello"
diff --git a/backend/modelscope_studio/components/antd/typography/paragraph/__init__.py b/backend/modelscope_studio/components/antd/typography/paragraph/__init__.py
new file mode 100644
index 00000000..be82e6ad
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/typography/paragraph/__init__.py
@@ -0,0 +1,97 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTypographyParagraph(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("copyable_copy",
+ callback=lambda block: block._internal.update(
+ bind_copyable_copy_event=True)),
+ EventListener("editable_change",
+ callback=lambda block: block._internal.update(
+ bind_editable_change_event=True)),
+ EventListener("editable_cancel",
+ callback=lambda block: block._internal.update(
+ bind_editable_cancel_event=True)),
+ EventListener("editable_start",
+ callback=lambda block: block._internal.update(
+ bind_editable_start_event=True)),
+ EventListener("editable_end",
+ callback=lambda block: block._internal.update(
+ bind_editable_end_event=True)),
+ EventListener("ellipsis_expand",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_expand_event=True)),
+ EventListener("ellipsis_ellipsis",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_ellipsis_event=True)),
+ EventListener("ellipsis_tooltip_open_change",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_tooltip_openChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'copyable.icon',
+ 'copyable.tooltips',
+ 'editable.icon',
+ 'editable.tooltip',
+ 'editable.enterIcon',
+ 'ellipsis.symbol',
+ 'ellipsis.tooltip',
+ 'ellipsis.tooltip.title',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("typography", "paragraph")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return "Hello"
+
+ def example_value(self) -> Any:
+ return "Hello"
diff --git a/backend/modelscope_studio/components/antd/typography/text/__init__.py b/backend/modelscope_studio/components/antd/typography/text/__init__.py
new file mode 100644
index 00000000..868ff1ec
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/typography/text/__init__.py
@@ -0,0 +1,94 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTypographyText(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("copyable_copy",
+ callback=lambda block: block._internal.update(
+ bind_copyable_copy_event=True)),
+ EventListener("editable_change",
+ callback=lambda block: block._internal.update(
+ bind_editable_change_event=True)),
+ EventListener("editable_cancel",
+ callback=lambda block: block._internal.update(
+ bind_editable_cancel_event=True)),
+ EventListener("editable_start",
+ callback=lambda block: block._internal.update(
+ bind_editable_start_event=True)),
+ EventListener("editable_end",
+ callback=lambda block: block._internal.update(
+ bind_editable_end_event=True)),
+ EventListener("ellipsis_ellipsis",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_ellipsis_event=True)),
+ EventListener("ellipsis_tooltip_open_change",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_tooltip_openChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'copyable.icon',
+ 'copyable.tooltips',
+ 'editable.icon',
+ 'editable.tooltip',
+ 'editable.enterIcon',
+ 'ellipsis.symbol',
+ 'ellipsis.tooltip',
+ 'ellipsis.tooltip.title',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("typography", "text")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return "Hello"
+
+ def example_value(self) -> Any:
+ return "Hello"
diff --git a/backend/modelscope_studio/components/antd/typography/title/__init__.py b/backend/modelscope_studio/components/antd/typography/title/__init__.py
new file mode 100644
index 00000000..05740942
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/typography/title/__init__.py
@@ -0,0 +1,97 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdTypographyTitle(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("copyable_copy",
+ callback=lambda block: block._internal.update(
+ bind_copyable_copy_event=True)),
+ EventListener("editable_change",
+ callback=lambda block: block._internal.update(
+ bind_editable_change_event=True)),
+ EventListener("editable_cancel",
+ callback=lambda block: block._internal.update(
+ bind_editable_cancel_event=True)),
+ EventListener("editable_start",
+ callback=lambda block: block._internal.update(
+ bind_editable_start_event=True)),
+ EventListener("editable_end",
+ callback=lambda block: block._internal.update(
+ bind_editable_end_event=True)),
+ EventListener("ellipsis_expand",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_expand_event=True)),
+ EventListener("ellipsis_ellipsis",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_ellipsis_event=True)),
+ EventListener("ellipsis_tooltip_open_change",
+ callback=lambda block: block._internal.update(
+ bind_ellipsis_tooltip_openChange_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'copyable.icon',
+ 'copyable.tooltips',
+ 'editable.icon',
+ 'editable.tooltip',
+ 'editable.enterIcon',
+ 'ellipsis.symbol',
+ 'ellipsis.tooltip',
+ 'ellipsis.tooltip.title',
+ ]
+
+ def __init__(
+ self,
+ value: str | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("typography", "title")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return "Hello"
+
+ def example_value(self) -> Any:
+ return "Hello"
diff --git a/backend/modelscope_studio/components/antd/upload/__init__.py b/backend/modelscope_studio/components/antd/upload/__init__.py
new file mode 100644
index 00000000..177d14c5
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/upload/__init__.py
@@ -0,0 +1,154 @@
+from __future__ import annotations
+
+import tempfile
+from pathlib import Path
+from typing import TYPE_CHECKING, Any, Callable
+
+import gradio_client.utils as client_utils
+from gradio import processing_utils
+from gradio.components.base import Component
+from gradio.data_classes import FileData, ListFiles
+from gradio.events import EventListener
+from gradio.utils import NamedString
+from gradio_client import handle_file
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+from .dragger import AntdUploadDragger
+
+if TYPE_CHECKING:
+ from gradio.components import Timer
+
+
+# as inputs, outputs
+class AntdUpload(ModelScopeDataLayoutComponent):
+ """
+ """
+ Dragger = AntdUploadDragger
+
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("drop",
+ callback=lambda block: block._internal.update(
+ bind_drop_event=True)),
+ EventListener("download",
+ callback=lambda block: block._internal.update(
+ bind_download_event=True)),
+ EventListener("preview",
+ callback=lambda block: block._internal.update(
+ bind_preview_event=True)),
+ EventListener("remove",
+ callback=lambda block: block._internal.update(
+ bind_remove_event=True))
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'showUploadList.extra',
+ 'showUploadList.previewIcon',
+ 'showUploadList.removeIcon',
+ 'showUploadList.downloadIcon',
+ ]
+
+ data_model = ListFiles
+
+ def __init__(
+ self,
+ value: list[str] | Callable | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ key: int | str | None = None,
+ every: Timer | float | None = None,
+ inputs: Component | list[Component] | set[Component] | None = None,
+ render: bool = True,
+ **kwargs):
+
+ super().__init__(as_item=as_item,
+ visible=visible,
+ value=value,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ key=key,
+ elem_style=elem_style,
+ every=every,
+ inputs=inputs,
+ render=render,
+ **kwargs)
+
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("upload")
+
+ def _process_single_file(self, f: FileData) -> NamedString:
+ file_name = f.path
+ file = tempfile.NamedTemporaryFile(delete=False, dir=self.GRADIO_CACHE)
+ file.name = file_name
+ return NamedString(file_name)
+
+ def preprocess(self, payload: ListFiles | None) -> list[str] | None:
+ """
+ Parameters:
+ payload: File information as a list of FileData objects.
+ Returns:
+ Passes the file as a list of `str`.
+ """
+ if payload is None:
+ return None
+
+ return [self._process_single_file(f) for f in payload] # type: ignore
+
+ def _download_files(self, value: list[str]) -> list[str]:
+ downloaded_files = []
+ for file in value:
+ if client_utils.is_http_url_like(file):
+ downloaded_file = processing_utils.save_url_to_cache(
+ file, self.GRADIO_CACHE)
+ downloaded_files.append(downloaded_file)
+ else:
+ downloaded_files.append(file)
+ return downloaded_files
+
+ def postprocess(self, value: list[str] | None) -> ListFiles | None:
+ """
+ Parameters:
+ value: a `list[str]` of filepaths/URLs.
+ Returns:
+ File information as a list of FileData objects.
+ """
+ if value is None:
+ return None
+ value = self._download_files(value)
+ return ListFiles(root=[
+ FileData(
+ path=file,
+ orig_name=Path(file).name,
+ size=Path(file).stat().st_size,
+ ) for file in value
+ ])
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, list[str]]:
+ return ListFiles.model_json_schema()
+
+ def example_payload(self) -> Any:
+ return [
+ handle_file(
+ "https://github.com/gradio-app/gradio/raw/main/test/test_files/sample_file.pdf"
+ )
+ ]
+
+ def example_value(self) -> Any:
+ return [
+ "https://github.com/gradio-app/gradio/raw/main/test/test_files/sample_file.pdf"
+ ]
diff --git a/backend/modelscope_studio/components/antd/upload/dragger/__init__.py b/backend/modelscope_studio/components/antd/upload/dragger/__init__.py
new file mode 100644
index 00000000..0817298f
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/upload/dragger/__init__.py
@@ -0,0 +1,151 @@
+from __future__ import annotations
+
+import tempfile
+from pathlib import Path
+from typing import TYPE_CHECKING, Any, Callable
+
+import gradio_client.utils as client_utils
+from gradio import processing_utils
+from gradio.components.base import Component
+from gradio.data_classes import FileData, ListFiles
+from gradio.events import EventListener
+from gradio.utils import NamedString
+from gradio_client import handle_file
+
+from .....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+if TYPE_CHECKING:
+ from gradio.components import Timer
+
+
+# as inputs, outputs
+class AntdUploadDragger(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = [
+ EventListener("change",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("drop",
+ callback=lambda block: block._internal.update(
+ bind_drop_event=True)),
+ EventListener("download",
+ callback=lambda block: block._internal.update(
+ bind_download_event=True)),
+ EventListener("preview",
+ callback=lambda block: block._internal.update(
+ bind_preview_event=True)),
+ EventListener("remove",
+ callback=lambda block: block._internal.update(
+ bind_remove_event=True))
+ ]
+
+ # supported slots
+ SLOTS = [
+ 'showUploadList.extra',
+ 'showUploadList.previewIcon',
+ 'showUploadList.removeIcon',
+ 'showUploadList.downloadIcon',
+ ]
+
+ data_model = ListFiles
+
+ def __init__(
+ self,
+ value: list[str] | Callable | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ key: int | str | None = None,
+ every: Timer | float | None = None,
+ inputs: Component | list[Component] | set[Component] | None = None,
+ render: bool = True,
+ **kwargs):
+
+ super().__init__(as_item=as_item,
+ visible=visible,
+ value=value,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ key=key,
+ elem_style=elem_style,
+ every=every,
+ inputs=inputs,
+ render=render,
+ **kwargs)
+
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("upload", "dragger")
+
+ def _process_single_file(self, f: FileData) -> NamedString:
+ file_name = f.path
+ file = tempfile.NamedTemporaryFile(delete=False, dir=self.GRADIO_CACHE)
+ file.name = file_name
+ return NamedString(file_name)
+
+ def preprocess(self, payload: ListFiles | None) -> list[str] | None:
+ """
+ Parameters:
+ payload: File information as a list of FileData objects.
+ Returns:
+ Passes the file as a list of `str`.
+ """
+ if payload is None:
+ return None
+
+ return [self._process_single_file(f) for f in payload] # type: ignore
+
+ def _download_files(self, value: list[str]) -> list[str]:
+ downloaded_files = []
+ for file in value:
+ if client_utils.is_http_url_like(file):
+ downloaded_file = processing_utils.save_url_to_cache(
+ file, self.GRADIO_CACHE)
+ downloaded_files.append(downloaded_file)
+ else:
+ downloaded_files.append(file)
+ return downloaded_files
+
+ def postprocess(self, value: list[str] | None) -> ListFiles | None:
+ """
+ Parameters:
+ value: a `list[str]` of filepaths/URLs.
+ Returns:
+ File information as a list of FileData objects.
+ """
+ if value is None:
+ return None
+ value = self._download_files(value)
+ return ListFiles(root=[
+ FileData(
+ path=file,
+ orig_name=Path(file).name,
+ size=Path(file).stat().st_size,
+ ) for file in value
+ ])
+
+ @property
+ def skip_api(self):
+ return False
+
+ def api_info(self) -> dict[str, list[str]]:
+ return ListFiles.model_json_schema()
+
+ def example_payload(self) -> Any:
+ return [
+ handle_file(
+ "https://github.com/gradio-app/gradio/raw/main/test/test_files/sample_file.pdf"
+ )
+ ]
+
+ def example_value(self) -> Any:
+ return [
+ "https://github.com/gradio-app/gradio/raw/main/test/test_files/sample_file.pdf"
+ ]
diff --git a/backend/modelscope_studio/components/antd/watermark/__init__.py b/backend/modelscope_studio/components/antd/watermark/__init__.py
new file mode 100644
index 00000000..6d292daf
--- /dev/null
+++ b/backend/modelscope_studio/components/antd/watermark/__init__.py
@@ -0,0 +1,52 @@
+from __future__ import annotations
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class AntdWatermark(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(
+ self,
+ content: str | list[str] | None = "",
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ self.props = props
+ self.content = content
+
+ FRONTEND_DIR = resolve_frontend_dir("watermark")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> None:
+ return None
+
+ def example_value(self) -> None:
+ return None
diff --git a/backend/modelscope_studio/components/base/__init__.py b/backend/modelscope_studio/components/base/__init__.py
new file mode 100644
index 00000000..60d3a873
--- /dev/null
+++ b/backend/modelscope_studio/components/base/__init__.py
@@ -0,0 +1,8 @@
+from .application import ModelScopeApplication as Application
+from .div import ModelScopeDiv as Div
+from .each import ModelScopeEach as Each
+from .filter import ModelScopeFilter as Filter
+from .fragment import ModelScopeFragment as Fragment
+from .slot import ModelScopeSlot as Slot
+from .span import ModelScopeSpan as Span
+from .text import ModelScopeText as Text
diff --git a/backend/modelscope_studio/components/base/application/__init__.py b/backend/modelscope_studio/components/base/application/__init__.py
new file mode 100644
index 00000000..b62f786b
--- /dev/null
+++ b/backend/modelscope_studio/components/base/application/__init__.py
@@ -0,0 +1,43 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class ModelScopeApplication(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = ["custom"]
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ *,
+ # gradio properties
+ visible: bool = True,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible, render=render, **kwargs)
+
+ FRONTEND_DIR = resolve_frontend_dir("application", type="base")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/base/div/__init__.py b/backend/modelscope_studio/components/base/div/__init__.py
new file mode 100644
index 00000000..60a7b275
--- /dev/null
+++ b/backend/modelscope_studio/components/base/div/__init__.py
@@ -0,0 +1,91 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from ...antd.carousel import AntdCarousel
+from ...antd.space import AntdSpace
+
+
+class ModelScopeDiv(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("dblclick",
+ callback=lambda block: block._internal.update(
+ bind_dblclick_event=True)),
+ EventListener("mousedown",
+ callback=lambda block: block._internal.update(
+ bind_mousedown_event=True)),
+ EventListener("mouseup",
+ callback=lambda block: block._internal.update(
+ bind_mouseup_event=True)),
+ EventListener("mouseover",
+ callback=lambda block: block._internal.update(
+ bind_mouseover_event=True)),
+ EventListener("mouseout",
+ callback=lambda block: block._internal.update(
+ bind_mouseout_event=True)),
+ EventListener("mousemove",
+ callback=lambda block: block._internal.update(
+ bind_mousemove_event=True)),
+ EventListener("scroll",
+ callback=lambda block: block._internal.update(
+ bind_scroll_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ if self.parent and self._internal and (any(
+ isinstance(self.parent, component)
+ for component in [AntdCarousel, AntdSpace])):
+ self._internal.update(fragment=True)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("div", type="base")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/base/each/__init__.py b/backend/modelscope_studio/components/base/each/__init__.py
new file mode 100644
index 00000000..6a11e1f7
--- /dev/null
+++ b/backend/modelscope_studio/components/base/each/__init__.py
@@ -0,0 +1,70 @@
+from __future__ import annotations
+
+from timeit import Timer
+from typing import Callable
+
+from gradio.components.base import Component
+from gradio.data_classes import GradioRootModel
+
+from ....utils.dev import ModelScopeDataLayoutComponent, resolve_frontend_dir
+
+
+class ModelScopeEachData(GradioRootModel):
+ root: list = []
+
+
+# as inputs, outputs
+class ModelScopeEach(ModelScopeDataLayoutComponent):
+ """
+ """
+ EVENTS = []
+ data_model = ModelScopeEachData
+
+ def __init__(
+ self,
+ value: list | Callable = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ key: int | str | None = None,
+ every: Timer | float | None = None,
+ inputs: Component | list[Component] | set[Component] | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ render=render,
+ value=value,
+ as_item=as_item,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ key=key,
+ elem_style=elem_style,
+ every=every,
+ inputs=inputs,
+ **kwargs)
+
+ FRONTEND_DIR = resolve_frontend_dir("each", type='base')
+
+ @property
+ def skip_api(self):
+ return False
+
+ def preprocess(self, payload: list | ModelScopeEachData) -> list:
+ if isinstance(payload, ModelScopeEachData):
+ return payload.root
+ return payload
+
+ def postprocess(self, value: list) -> list:
+ return value
+
+ def example_payload(self) -> list:
+ return []
+
+ def example_value(self) -> list:
+ return []
diff --git a/backend/modelscope_studio/components/base/filter/__init__.py b/backend/modelscope_studio/components/base/filter/__init__.py
new file mode 100644
index 00000000..e37581e8
--- /dev/null
+++ b/backend/modelscope_studio/components/base/filter/__init__.py
@@ -0,0 +1,42 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class ModelScopeFilter(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(self,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ visible: bool = True,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ render=render,
+ as_item=as_item,
+ **kwargs)
+
+ FRONTEND_DIR = resolve_frontend_dir("filter", type='base')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/base/fragment/__init__.py b/backend/modelscope_studio/components/base/fragment/__init__.py
new file mode 100644
index 00000000..bce7db61
--- /dev/null
+++ b/backend/modelscope_studio/components/base/fragment/__init__.py
@@ -0,0 +1,48 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class ModelScopeFragment(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ render=render,
+ as_item=as_item,
+ **kwargs)
+
+ FRONTEND_DIR = resolve_frontend_dir("fragment", type="base")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: None) -> None:
+ return payload
+
+ def postprocess(self, value: None) -> None:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/base/slot/__init__.py b/backend/modelscope_studio/components/base/slot/__init__.py
new file mode 100644
index 00000000..da27db0e
--- /dev/null
+++ b/backend/modelscope_studio/components/base/slot/__init__.py
@@ -0,0 +1,51 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+
+
+class ModelScopeSlot(ModelScopeLayoutComponent):
+ """
+ """
+ EVENTS = []
+
+ def __init__(self,
+ value: str = '',
+ params_mapping: str | None = None,
+ *,
+ skip_context_value: bool = True,
+ as_item: str | None = None,
+ _internal: None = None,
+ visible: bool = True,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ render=render,
+ as_item=as_item,
+ **kwargs)
+ self.params_mapping = params_mapping
+ self.skip_context_value = skip_context_value
+ if isinstance(self.parent, ModelScopeSlot):
+ self.value = f"{self.parent.value}.{value}"
+ else:
+ self.value = value
+
+ FRONTEND_DIR = resolve_frontend_dir("slot", type='base')
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str) -> str:
+ return payload
+
+ def postprocess(self, value: str) -> str:
+
+ return value
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/base/span/__init__.py b/backend/modelscope_studio/components/base/span/__init__.py
new file mode 100644
index 00000000..eafd1ca3
--- /dev/null
+++ b/backend/modelscope_studio/components/base/span/__init__.py
@@ -0,0 +1,91 @@
+from __future__ import annotations
+
+from typing import Any
+
+from gradio.events import EventListener
+
+from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
+from ...antd.carousel import AntdCarousel
+from ...antd.space import AntdSpace
+
+
+class ModelScopeSpan(ModelScopeLayoutComponent):
+ """
+ """
+
+ EVENTS = [
+ EventListener("click",
+ callback=lambda block: block._internal.update(
+ bind_click_event=True)),
+ EventListener("dblclick",
+ callback=lambda block: block._internal.update(
+ bind_dblclick_event=True)),
+ EventListener("mousedown",
+ callback=lambda block: block._internal.update(
+ bind_mousedown_event=True)),
+ EventListener("mouseup",
+ callback=lambda block: block._internal.update(
+ bind_mouseup_event=True)),
+ EventListener("mouseover",
+ callback=lambda block: block._internal.update(
+ bind_mouseover_event=True)),
+ EventListener("mouseout",
+ callback=lambda block: block._internal.update(
+ bind_mouseout_event=True)),
+ EventListener("mousemove",
+ callback=lambda block: block._internal.update(
+ bind_mousemove_event=True)),
+ EventListener("scroll",
+ callback=lambda block: block._internal.update(
+ bind_scroll_event=True)),
+ ]
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ value: str | None = None,
+ props: dict | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ if self.parent and self._internal and (any(
+ isinstance(self.parent, component)
+ for component in [AntdCarousel, AntdSpace])):
+ self._internal.update(fragment=True)
+ self.value = value
+ self.props = props
+
+ FRONTEND_DIR = resolve_frontend_dir("span", type="base")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/base/text/__init__.py b/backend/modelscope_studio/components/base/text/__init__.py
new file mode 100644
index 00000000..a13ac3d7
--- /dev/null
+++ b/backend/modelscope_studio/components/base/text/__init__.py
@@ -0,0 +1,62 @@
+from __future__ import annotations
+
+from typing import Any
+
+from ....utils.dev import ModelScopeComponent, resolve_frontend_dir
+from ...antd.carousel import AntdCarousel
+from ...antd.space import AntdSpace
+
+
+class ModelScopeText(ModelScopeComponent):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = []
+
+ def __init__(
+ self,
+ value: str | None = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True,
+ **kwargs):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render,
+ as_item=as_item,
+ elem_style=elem_style,
+ **kwargs)
+ if self.parent and self._internal and (any(
+ isinstance(self.parent, component)
+ for component in [AntdCarousel, AntdSpace])):
+ self._internal.update(fragment=True)
+ self.value = value
+
+ FRONTEND_DIR = resolve_frontend_dir("text", type="base")
+
+ @property
+ def skip_api(self):
+ return True
+
+ def preprocess(self, payload: str | None) -> str | None:
+ return payload
+
+ def postprocess(self, value: str | None) -> str | None:
+
+ return str(value)
+
+ def example_payload(self) -> Any:
+ return None
+
+ def example_value(self) -> Any:
+ return None
diff --git a/backend/modelscope_studio/components/Chatbot/__init__.py b/backend/modelscope_studio/components/legacy/Chatbot/__init__.py
similarity index 98%
rename from backend/modelscope_studio/components/Chatbot/__init__.py
rename to backend/modelscope_studio/components/legacy/Chatbot/__init__.py
index 7e3ba120..f003414e 100644
--- a/backend/modelscope_studio/components/Chatbot/__init__.py
+++ b/backend/modelscope_studio/components/legacy/Chatbot/__init__.py
@@ -11,9 +11,9 @@
from gradio_client import utils as client_utils
from gradio_client.documentation import document, set_documentation_group
-from modelscope_studio.components.MultimodalInput import MultimodalInputData
-from modelscope_studio.utils import (CustomComponentDict, process_links,
- resolve_frontend_dir)
+from ....utils.dev import (CustomComponentDict, process_links,
+ resolve_frontend_dir)
+from ..MultimodalInput import MultimodalInputData
class FileMessage(GradioModel):
@@ -58,7 +58,7 @@ class ModelScopeChatbot(Component):
Demos: chatbot_simple, chatbot_multimodal
Guides: creating-a-chatbot
"""
- FRONTEND_DIR = resolve_frontend_dir("Chatbot")
+ FRONTEND_DIR = resolve_frontend_dir("Chatbot", type='legacy')
EVENTS = [Events.change, Events.select, Events.like, 'flushed', 'custom']
data_model = ChatbotData
diff --git a/backend/modelscope_studio/components/Chatbot/llm_thinking_presets.py b/backend/modelscope_studio/components/legacy/Chatbot/llm_thinking_presets.py
similarity index 100%
rename from backend/modelscope_studio/components/Chatbot/llm_thinking_presets.py
rename to backend/modelscope_studio/components/legacy/Chatbot/llm_thinking_presets.py
diff --git a/backend/modelscope_studio/components/Flow/__init__.py b/backend/modelscope_studio/components/legacy/Flow/__init__.py
similarity index 97%
rename from backend/modelscope_studio/components/Flow/__init__.py
rename to backend/modelscope_studio/components/legacy/Flow/__init__.py
index 3ab4e99f..5de50c11 100644
--- a/backend/modelscope_studio/components/Flow/__init__.py
+++ b/backend/modelscope_studio/components/legacy/Flow/__init__.py
@@ -9,8 +9,7 @@
from gradio.events import Events
from gradio_client.documentation import document
-from modelscope_studio.utils import CustomComponentDict, resolve_frontend_dir
-
+from ....utils.dev import CustomComponentDict, resolve_frontend_dir
from .edge import *
from .edge import Edge
from .node import *
@@ -44,7 +43,7 @@ class BackgroundPropsDict(TypedDict):
@document()
class ModelScopeFlow(Component):
data_model = FlowData
- FRONTEND_DIR = resolve_frontend_dir("Flow")
+ FRONTEND_DIR = resolve_frontend_dir("Flow", type='legacy')
EVENTS = [Events.change, 'data_change', 'custom']
def __init__(
diff --git a/backend/modelscope_studio/components/Flow/edge.py b/backend/modelscope_studio/components/legacy/Flow/edge.py
similarity index 100%
rename from backend/modelscope_studio/components/Flow/edge.py
rename to backend/modelscope_studio/components/legacy/Flow/edge.py
diff --git a/backend/modelscope_studio/components/Flow/node.py b/backend/modelscope_studio/components/legacy/Flow/node.py
similarity index 100%
rename from backend/modelscope_studio/components/Flow/node.py
rename to backend/modelscope_studio/components/legacy/Flow/node.py
diff --git a/backend/modelscope_studio/components/Flow/node_schema.py b/backend/modelscope_studio/components/legacy/Flow/node_schema.py
similarity index 100%
rename from backend/modelscope_studio/components/Flow/node_schema.py
rename to backend/modelscope_studio/components/legacy/Flow/node_schema.py
diff --git a/backend/modelscope_studio/components/Lifecycle/__init__.py b/backend/modelscope_studio/components/legacy/Lifecycle/__init__.py
similarity index 96%
rename from backend/modelscope_studio/components/Lifecycle/__init__.py
rename to backend/modelscope_studio/components/legacy/Lifecycle/__init__.py
index dbbc72e2..84a585ab 100644
--- a/backend/modelscope_studio/components/Lifecycle/__init__.py
+++ b/backend/modelscope_studio/components/legacy/Lifecycle/__init__.py
@@ -7,7 +7,7 @@
from gradio.events import EventListener
from gradio_client.documentation import document, set_documentation_group
-from modelscope_studio.utils import resolve_frontend_dir
+from ....utils.dev import resolve_frontend_dir
set_documentation_group("component")
@@ -28,7 +28,7 @@ class LifecycleData(GradioModel):
@document()
class ModelScopeLifecycle(Component):
- FRONTEND_DIR = resolve_frontend_dir("Lifecycle")
+ FRONTEND_DIR = resolve_frontend_dir("Lifecycle", type='legacy')
EVENTS = [
EventListener(
diff --git a/backend/modelscope_studio/components/Markdown/__init__.py b/backend/modelscope_studio/components/legacy/Markdown/__init__.py
similarity index 96%
rename from backend/modelscope_studio/components/Markdown/__init__.py
rename to backend/modelscope_studio/components/legacy/Markdown/__init__.py
index d0244184..68216ca4 100644
--- a/backend/modelscope_studio/components/Markdown/__init__.py
+++ b/backend/modelscope_studio/components/legacy/Markdown/__init__.py
@@ -7,8 +7,8 @@
from gradio.events import Events
from gradio_client.documentation import document, set_documentation_group
-from modelscope_studio.utils import (CustomComponentDict, process_links,
- resolve_frontend_dir)
+from ....utils.dev import (CustomComponentDict, process_links,
+ resolve_frontend_dir)
set_documentation_group("component")
@@ -23,7 +23,7 @@ class ModelScopeMarkdown(Component):
Demos: blocks_hello, blocks_kinematics
Guides: key-features
"""
- FRONTEND_DIR = resolve_frontend_dir("Markdown")
+ FRONTEND_DIR = resolve_frontend_dir("Markdown", type='legacy')
EVENTS = [Events.change, "custom"]
@staticmethod
diff --git a/backend/modelscope_studio/components/MultimodalInput/__init__.py b/backend/modelscope_studio/components/legacy/MultimodalInput/__init__.py
similarity index 98%
rename from backend/modelscope_studio/components/MultimodalInput/__init__.py
rename to backend/modelscope_studio/components/legacy/MultimodalInput/__init__.py
index d22eec15..c82b5a00 100644
--- a/backend/modelscope_studio/components/MultimodalInput/__init__.py
+++ b/backend/modelscope_studio/components/legacy/MultimodalInput/__init__.py
@@ -9,7 +9,7 @@
from gradio_client import utils as client_utils
from gradio_client.documentation import document, set_documentation_group
-from modelscope_studio.utils import resolve_frontend_dir
+from ....utils.dev import resolve_frontend_dir
set_documentation_group("component")
@@ -30,7 +30,7 @@ class ModelScopeMultimodalInput(FormComponent):
Demos: hello_world, diff_texts, sentence_builder
Guides: creating-a-chatbot, real-time-speech-recognition
"""
- FRONTEND_DIR = resolve_frontend_dir("MultimodalInput")
+ FRONTEND_DIR = resolve_frontend_dir("MultimodalInput", type='legacy')
EVENTS = [
Events.change,
diff --git a/backend/modelscope_studio/components/WaterfallGallery/__init__.py b/backend/modelscope_studio/components/legacy/WaterfallGallery/__init__.py
similarity index 99%
rename from backend/modelscope_studio/components/WaterfallGallery/__init__.py
rename to backend/modelscope_studio/components/legacy/WaterfallGallery/__init__.py
index cc1e1870..7a258efa 100644
--- a/backend/modelscope_studio/components/WaterfallGallery/__init__.py
+++ b/backend/modelscope_studio/components/legacy/WaterfallGallery/__init__.py
@@ -14,7 +14,7 @@
from gradio_client.utils import is_http_url_like
from PIL import Image as _Image # using _ to minimize namespace pollution
-from modelscope_studio.utils import resolve_frontend_dir
+from ....utils.dev import resolve_frontend_dir
set_documentation_group("component")
@@ -53,7 +53,7 @@ class ModelScopeWaterfallGallery(Component):
doc="Triggered when the image action button is clicked."),
"load_more"
]
- FRONTEND_DIR = resolve_frontend_dir("WaterfallGallery")
+ FRONTEND_DIR = resolve_frontend_dir("WaterfallGallery", type='legacy')
data_model = GalleryData
def __init__(self,
diff --git a/backend/modelscope_studio/components/legacy/__init__.py b/backend/modelscope_studio/components/legacy/__init__.py
new file mode 100644
index 00000000..6c2db370
--- /dev/null
+++ b/backend/modelscope_studio/components/legacy/__init__.py
@@ -0,0 +1,6 @@
+from .Chatbot import ModelScopeChatbot as Chatbot
+from .Flow import ModelScopeFlow as Flow
+from .Lifecycle import ModelScopeLifecycle as Lifecycle
+from .Markdown import ModelScopeMarkdown as Markdown
+from .MultimodalInput import ModelScopeMultimodalInput as MultimodalInput
+from .WaterfallGallery import ModelScopeWaterfallGallery as WaterfallGallery
diff --git a/backend/modelscope_studio/external.py b/backend/modelscope_studio/external.py
index e82c3017..a54f85f4 100644
--- a/backend/modelscope_studio/external.py
+++ b/backend/modelscope_studio/external.py
@@ -5,6 +5,7 @@
import gradio
import gradio.utils
import httpx
+import modelscope_studio.components
from gradio.blocks import Block, BlockContext, Blocks
from gradio.context import Context
from gradio.events import EventListenerMethod
@@ -13,8 +14,6 @@
from gradio_client.client import Endpoint
from packaging import version
-import modelscope_studio.components
-
_endpoint = "https://modelscope.cn"
_studio_endpoint = "https://s5k.cn"
diff --git a/backend/modelscope_studio/utils/__init__.py b/backend/modelscope_studio/utils/dev/__init__.py
similarity index 69%
rename from backend/modelscope_studio/utils/__init__.py
rename to backend/modelscope_studio/utils/dev/__init__.py
index e392f4d3..393cd789 100644
--- a/backend/modelscope_studio/utils/__init__.py
+++ b/backend/modelscope_studio/utils/dev/__init__.py
@@ -1,13 +1,11 @@
from typing import List, Optional, TypedDict
+from .component import *
from .process_links import process_links
+from .resolve_frontend_dir import *
class CustomComponentDict(TypedDict):
props: Optional[List[str]]
template: Optional[str]
js: Optional[str]
-
-
-def resolve_frontend_dir(component: str):
- return f"../../../../frontend/{component}"
diff --git a/backend/modelscope_studio/utils/dev/component.py b/backend/modelscope_studio/utils/dev/component.py
new file mode 100644
index 00000000..3aefb42d
--- /dev/null
+++ b/backend/modelscope_studio/utils/dev/component.py
@@ -0,0 +1,149 @@
+from timeit import Timer
+from typing import Any, Callable
+
+from gradio.component_meta import ComponentMeta
+from gradio.components.base import BlockContext, Component
+
+
+class ModelScopeLayoutComponent(BlockContext, metaclass=ComponentMeta):
+ """
+ """
+
+ EVENTS = []
+
+ # supported slots
+ SLOTS = []
+
+ def __exit__(self, *args, **kwargs):
+ self._internal.update(layout=True)
+ super().__exit__(*args, **kwargs)
+
+ def __init__(
+ self,
+ *,
+ as_item: str | None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ render: bool = True):
+ super().__init__(visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render)
+ self.as_item = as_item
+ if self.parent:
+ self._internal = dict(index=len(self.parent.children) - 1)
+ else:
+ self._internal = dict()
+
+ self.elem_style = elem_style
+
+ @property
+ def skip_api(self):
+ return True
+
+
+class ModelScopeComponent(Component):
+ """
+ """
+
+ def __init__(
+ self,
+ value: Any = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ key: int | str | None = None,
+ every: Timer | float | None = None,
+ inputs: Component | list[Component] | set[Component] | None = None,
+ load_fn: Callable | None = None,
+ render: bool = True):
+ super().__init__(visible=visible,
+ value=value,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ key=key,
+ every=every,
+ inputs=inputs,
+ load_fn=load_fn,
+ render=render)
+ if self.parent:
+ self._internal = dict(index=len(self.parent.children) - 1)
+ else:
+ self._internal = dict()
+ self.as_item = as_item
+ self.elem_style = elem_style
+
+
+class ModelScopeDataLayoutComponent(Component,
+ BlockContext,
+ metaclass=ComponentMeta):
+ """
+ """
+ EVENTS = []
+ # supported slots
+ SLOTS = []
+
+ # fix gradio’s bug
+ @property
+ def component_class_id(self):
+ return self.get_component_class_id()
+
+ @component_class_id.setter
+ def component_class_id(self, value):
+ pass
+
+ @property
+ def skip_api(self):
+ return False
+
+ def __exit__(self, *args, **kwargs):
+ self._internal.update(layout=True)
+ super().__exit__(*args, **kwargs)
+
+ def __init__(
+ self,
+ value: Any = None,
+ *,
+ as_item: str | None = None,
+ _internal: None = None,
+ # gradio properties
+ visible: bool = True,
+ elem_id: str | None = None,
+ elem_classes: list[str] | str | None = None,
+ elem_style: dict | None = None,
+ key: int | str | None = None,
+ every: Timer | float | None = None,
+ inputs: Component | list[Component] | set[Component] | None = None,
+ load_fn: Callable | None = None,
+ render: bool = True,
+ ):
+ super().__init__(
+ visible=visible,
+ value=value,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ key=key,
+ every=every,
+ inputs=inputs,
+ load_fn=load_fn,
+ # disable render twice
+ render=False)
+ BlockContext.__init__(self,
+ visible=visible,
+ elem_id=elem_id,
+ elem_classes=elem_classes,
+ render=render)
+ if self.parent:
+ self._internal = dict(index=len(self.parent.children) - 1)
+ else:
+ self._internal = dict()
+ self.as_item = as_item
+ self.elem_style = elem_style
diff --git a/backend/modelscope_studio/utils/process_links.py b/backend/modelscope_studio/utils/dev/process_links.py
similarity index 100%
rename from backend/modelscope_studio/utils/process_links.py
rename to backend/modelscope_studio/utils/dev/process_links.py
diff --git a/backend/modelscope_studio/utils/dev/resolve_frontend_dir.py b/backend/modelscope_studio/utils/dev/resolve_frontend_dir.py
new file mode 100644
index 00000000..676c9c01
--- /dev/null
+++ b/backend/modelscope_studio/utils/dev/resolve_frontend_dir.py
@@ -0,0 +1,15 @@
+from typing import Literal, Union
+
+
+def resolve_frontend_dir(component: str,
+ sub_component: Union[str, list, tuple] = None,
+ type: Literal['antd', 'base'] = 'antd'):
+ if isinstance(sub_component, list) or isinstance(sub_component, tuple):
+ dir = ''
+ for c in sub_component:
+ dir = dir + f"/{c}"
+ return f"{'../' * len(sub_component)}../../../../../frontend/{type}/{component}{dir}"
+
+ if (sub_component):
+ return f"../../../../../../frontend/{type}/{component}/{sub_component}"
+ return f"../../../../../frontend/{type}/{component}"
diff --git a/config/changelog/package.json b/config/changelog/package.json
index 13acc534..5450e514 100644
--- a/config/changelog/package.json
+++ b/config/changelog/package.json
@@ -20,12 +20,12 @@
},
"dependencies": {
"@changesets/get-github-info": "^0.6.0",
- "@manypkg/get-packages": "^2.2.1",
+ "@manypkg/get-packages": "^2.2.2",
"detect-indent": "^7.0.1"
},
"devDependencies": {
"@changesets/types": "^6.0.0",
- "@types/node": "^20.14.9",
- "tsup": "^8.1.0"
+ "@types/node": "^22.5.4",
+ "tsup": "^8.2.4"
}
}
diff --git a/config/lint-config/configs/eslint/basic.mjs b/config/lint-config/configs/eslint/basic.mjs
index 0ce9c94f..f92eaba2 100644
--- a/config/lint-config/configs/eslint/basic.mjs
+++ b/config/lint-config/configs/eslint/basic.mjs
@@ -5,7 +5,7 @@ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
/**
- * @type {import('eslint').Linter.FlatConfig[]}
+ * @type {import('eslint').Linter.Config[]}
*/
export const basic = [
{
diff --git a/config/lint-config/configs/eslint/react.mjs b/config/lint-config/configs/eslint/react.mjs
index 25dafd9f..a36a4278 100644
--- a/config/lint-config/configs/eslint/react.mjs
+++ b/config/lint-config/configs/eslint/react.mjs
@@ -4,7 +4,7 @@ import reactRefresh from 'eslint-plugin-react-refresh';
import { fixupPluginRules } from '@eslint/compat';
import jsxA11y from 'eslint-plugin-jsx-a11y';
/**
- * @type {import('eslint').Linter.FlatConfig[]}
+ * @type {import('eslint').Linter.Config[]}
*/
export const react = [
eslintPluginReactRecommendedConfig,
diff --git a/config/lint-config/configs/eslint/svelte.mjs b/config/lint-config/configs/eslint/svelte.mjs
index 18ca2469..2bbdf834 100644
--- a/config/lint-config/configs/eslint/svelte.mjs
+++ b/config/lint-config/configs/eslint/svelte.mjs
@@ -1,7 +1,7 @@
import eslintPluginSvelte from 'eslint-plugin-svelte';
/**
- * @type {import('eslint').Linter.FlatConfig[]}
+ * @type {import('eslint').Linter.Config[]}
*/
export const svelte = [
...eslintPluginSvelte.configs['flat/recommended'],
@@ -14,6 +14,7 @@ export const svelte = [
},
rules: {
'svelte/no-at-html-tags': 'off',
+ 'svelte/valid-compile': 'warn',
},
},
];
diff --git a/config/lint-config/configs/eslint/typescript.mjs b/config/lint-config/configs/eslint/typescript.mjs
index 40103e6d..51b0dce5 100644
--- a/config/lint-config/configs/eslint/typescript.mjs
+++ b/config/lint-config/configs/eslint/typescript.mjs
@@ -1,7 +1,7 @@
import eslintPluginImport from 'eslint-plugin-import';
import tseslint from 'typescript-eslint';
/**
- * @type {import('eslint').Linter.FlatConfig[]}
+ * @type {import('eslint').Linter.Config[]}
*/
export const typescript = [
...tseslint.configs.recommended.map((config) => ({
@@ -43,15 +43,11 @@ export const typescript = [
'warn',
{ vars: 'all', varsIgnorePattern: '^_' },
],
- '@typescript-eslint/ban-types': [
- 'error',
- {
- types: {
- '{}': false,
- },
- extendDefaults: true,
- },
- ],
+ '@typescript-eslint/no-unused-expressions': 'off',
+ '@typescript-eslint/ban-types': 'off',
+ '@typescript-eslint/no-empty-object-type': 'off',
+ '@typescript-eslint/no-wrapper-object-types': 'error',
+ '@typescript-eslint/no-unsafe-function-type': 'error',
// import type
'@typescript-eslint/consistent-type-imports': [
'error',
diff --git a/config/lint-config/eslint.mjs b/config/lint-config/eslint.mjs
index 75119b48..9deefb5b 100644
--- a/config/lint-config/eslint.mjs
+++ b/config/lint-config/eslint.mjs
@@ -5,6 +5,6 @@ import { svelte } from './configs/eslint/svelte.mjs';
import { typescript } from './configs/eslint/typescript.mjs';
/**
- * @type {import('eslint').Linter.FlatConfig[]}
+ * @type {import('eslint').Linter.Config[]}
*/
export default [].concat(basic, react, typescript, svelte);
diff --git a/config/lint-config/package.json b/config/lint-config/package.json
index b6f42aa5..24e6235d 100644
--- a/config/lint-config/package.json
+++ b/config/lint-config/package.json
@@ -16,19 +16,19 @@
}
},
"dependencies": {
- "@eslint/compat": "^1.1.0",
- "@eslint/js": "^9.5.0",
- "@typescript-eslint/parser": "^7.14.1",
+ "@eslint/compat": "^1.1.1",
+ "@eslint/js": "^9.7.0",
+ "@typescript-eslint/parser": "^8.5.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
- "eslint-plugin-prettier": "5.1.3",
- "eslint-plugin-react": "^7.34.3",
+ "eslint-plugin-prettier": "5.2.1",
+ "eslint-plugin-react": "^7.36.1",
"eslint-plugin-react-hooks": "^4.6.2",
- "eslint-plugin-react-refresh": "^0.4.7",
+ "eslint-plugin-react-refresh": "^0.4.8",
"eslint-plugin-simple-import-sort": "^12.1.0",
- "eslint-plugin-svelte": "^2.41.0",
+ "eslint-plugin-svelte": "^2.42.0",
"globals": "^15.6.0",
"postcss": "^8.4.38",
"postcss-less": "^6.0.0",
@@ -37,12 +37,12 @@
"stylelint-config-standard": "^36.0.1",
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
"stylelint-order": "^6.0.4",
- "stylelint-prettier": "^5.0.0",
- "svelte-eslint-parser": "^0.39.2",
- "typescript-eslint": "^7.14.1"
+ "stylelint-prettier": "^5.0.2",
+ "svelte-eslint-parser": "^0.41.0",
+ "typescript-eslint": "^8.5.0"
},
"devDependencies": {
- "@types/eslint": "^8.56.10",
+ "@types/eslint": "^9.6.1",
"@types/eslint__js": "^8.42.3"
}
}
diff --git a/docs/components/Chatbot/demos/accordion.py b/docs/components/Chatbot/demos/accordion.py
index 2f6430bd..52adf6d4 100644
--- a/docs/components/Chatbot/demos/accordion.py
+++ b/docs/components/Chatbot/demos/accordion.py
@@ -1,7 +1,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
from modelscope_studio.components.Chatbot.llm_thinking_presets import qwen
diff --git a/docs/components/Chatbot/demos/basic.py b/docs/components/Chatbot/demos/basic.py
index 6c5361d9..3dc3981f 100644
--- a/docs/components/Chatbot/demos/basic.py
+++ b/docs/components/Chatbot/demos/basic.py
@@ -2,7 +2,6 @@
import time
import gradio as gr
-
import modelscope_studio as mgr
conversation = [
diff --git a/docs/components/Chatbot/demos/chart.py b/docs/components/Chatbot/demos/chart.py
index c07b3e0e..0dc39313 100644
--- a/docs/components/Chatbot/demos/chart.py
+++ b/docs/components/Chatbot/demos/chart.py
@@ -1,7 +1,6 @@
import json
import gradio as gr
-
import modelscope_studio as mgr
# echarts options, see: https://echarts.apache.org/en/index.html
diff --git a/docs/components/Chatbot/demos/message_config.py b/docs/components/Chatbot/demos/message_config.py
index b2fe3e1b..12566f3c 100644
--- a/docs/components/Chatbot/demos/message_config.py
+++ b/docs/components/Chatbot/demos/message_config.py
@@ -1,7 +1,6 @@
import time
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/Chatbot/demos/multi_bots.py b/docs/components/Chatbot/demos/multi_bots.py
index ea167a88..e789d4b2 100644
--- a/docs/components/Chatbot/demos/multi_bots.py
+++ b/docs/components/Chatbot/demos/multi_bots.py
@@ -2,7 +2,6 @@
import time
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/Chatbot/demos/multimodal.py b/docs/components/Chatbot/demos/multimodal.py
index 28aebe4c..840349ac 100644
--- a/docs/components/Chatbot/demos/multimodal.py
+++ b/docs/components/Chatbot/demos/multimodal.py
@@ -1,7 +1,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/Chatbot/demos/select-box.py b/docs/components/Chatbot/demos/select-box.py
index 6035ba30..97b73cf9 100644
--- a/docs/components/Chatbot/demos/select-box.py
+++ b/docs/components/Chatbot/demos/select-box.py
@@ -1,7 +1,6 @@
import json
import gradio as gr
-
import modelscope_studio as mgr
# `label` will display on the page, and `value` is the actual selected value.
diff --git a/docs/components/Docs.py b/docs/components/Docs.py
index 71d863bb..bac94ab8 100644
--- a/docs/components/Docs.py
+++ b/docs/components/Docs.py
@@ -3,7 +3,6 @@
from typing import Callable
import gradio as gr
-
import modelscope_studio as mgr
from .parse_markdown import parse_markdown
diff --git a/docs/components/Flow/demos/basic.py b/docs/components/Flow/demos/basic.py
index 920e7fc5..313148e5 100644
--- a/docs/components/Flow/demos/basic.py
+++ b/docs/components/Flow/demos/basic.py
@@ -2,7 +2,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
from modelscope_studio.components.Flow import Edge, Node
diff --git a/docs/components/Flow/demos/component_options.py b/docs/components/Flow/demos/component_options.py
index b080470f..9f6630eb 100644
--- a/docs/components/Flow/demos/component_options.py
+++ b/docs/components/Flow/demos/component_options.py
@@ -2,7 +2,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
from modelscope_studio.components.Flow import BackgroundPropsDict, Edge, Node
diff --git a/docs/components/Flow/demos/custom_node_type.py b/docs/components/Flow/demos/custom_node_type.py
index e40d3e40..e02ab56a 100644
--- a/docs/components/Flow/demos/custom_node_type.py
+++ b/docs/components/Flow/demos/custom_node_type.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
from modelscope_studio.components.Flow import (FlowSchemaDict, Node,
NodeSchemaAttributeDict,
diff --git a/docs/components/Lifecycle/demos/basic.py b/docs/components/Lifecycle/demos/basic.py
index a7c36168..8ba43704 100644
--- a/docs/components/Lifecycle/demos/basic.py
+++ b/docs/components/Lifecycle/demos/basic.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/Lifecycle/demos/language_adaptation.py b/docs/components/Lifecycle/demos/language_adaptation.py
index 9b504300..39321366 100644
--- a/docs/components/Lifecycle/demos/language_adaptation.py
+++ b/docs/components/Lifecycle/demos/language_adaptation.py
@@ -1,7 +1,6 @@
import time
import gradio as gr
-
import modelscope_studio as mgr
messages = {
diff --git a/docs/components/Lifecycle/demos/theme_adaptation.py b/docs/components/Lifecycle/demos/theme_adaptation.py
index dc6a1287..79ca97f4 100644
--- a/docs/components/Lifecycle/demos/theme_adaptation.py
+++ b/docs/components/Lifecycle/demos/theme_adaptation.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/Markdown/demos/accordion.py b/docs/components/Markdown/demos/accordion.py
index 924b3548..360e0c8b 100644
--- a/docs/components/Markdown/demos/accordion.py
+++ b/docs/components/Markdown/demos/accordion.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
with gr.Blocks() as demo:
diff --git a/docs/components/Markdown/demos/basic.py b/docs/components/Markdown/demos/basic.py
index 2c423e26..2b9ab5b2 100644
--- a/docs/components/Markdown/demos/basic.py
+++ b/docs/components/Markdown/demos/basic.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
with gr.Blocks() as demo:
diff --git a/docs/components/Markdown/demos/chart.py b/docs/components/Markdown/demos/chart.py
index e611b159..747eb97b 100644
--- a/docs/components/Markdown/demos/chart.py
+++ b/docs/components/Markdown/demos/chart.py
@@ -1,7 +1,6 @@
import json
import gradio as gr
-
import modelscope_studio as mgr
# echarts options, see: https://echarts.apache.org/en/index.html
diff --git a/docs/components/Markdown/demos/custom-tag.py b/docs/components/Markdown/demos/custom-tag.py
index 530e7027..0863397c 100644
--- a/docs/components/Markdown/demos/custom-tag.py
+++ b/docs/components/Markdown/demos/custom-tag.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
with gr.Blocks() as demo:
diff --git a/docs/components/Markdown/demos/custom-tag2.py b/docs/components/Markdown/demos/custom-tag2.py
index ecbcb487..4958e567 100644
--- a/docs/components/Markdown/demos/custom-tag2.py
+++ b/docs/components/Markdown/demos/custom-tag2.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
with gr.Blocks() as demo:
diff --git a/docs/components/Markdown/demos/custom-tag3.py b/docs/components/Markdown/demos/custom-tag3.py
index c87a9e19..0d4c206e 100644
--- a/docs/components/Markdown/demos/custom-tag3.py
+++ b/docs/components/Markdown/demos/custom-tag3.py
@@ -2,7 +2,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
options = ["a", "b", "c"]
diff --git a/docs/components/Markdown/demos/custom-tag4.py b/docs/components/Markdown/demos/custom-tag4.py
index 4f8e8a81..62bf8098 100644
--- a/docs/components/Markdown/demos/custom-tag4.py
+++ b/docs/components/Markdown/demos/custom-tag4.py
@@ -2,7 +2,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
options = ["a", "b", "c"]
diff --git a/docs/components/Markdown/demos/custom_tags/accordion/accordion-title.py b/docs/components/Markdown/demos/custom_tags/accordion/accordion-title.py
index 1b692f01..728b089a 100644
--- a/docs/components/Markdown/demos/custom_tags/accordion/accordion-title.py
+++ b/docs/components/Markdown/demos/custom_tags/accordion/accordion-title.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
with gr.Blocks() as demo:
diff --git a/docs/components/Markdown/demos/custom_tags/accordion/basic.py b/docs/components/Markdown/demos/custom_tags/accordion/basic.py
index 724b9f5c..cfa9d290 100644
--- a/docs/components/Markdown/demos/custom_tags/accordion/basic.py
+++ b/docs/components/Markdown/demos/custom_tags/accordion/basic.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
with gr.Blocks() as demo:
diff --git a/docs/components/Markdown/demos/custom_tags/chart/basic.py b/docs/components/Markdown/demos/custom_tags/chart/basic.py
index 53d5f776..0a7688bb 100644
--- a/docs/components/Markdown/demos/custom_tags/chart/basic.py
+++ b/docs/components/Markdown/demos/custom_tags/chart/basic.py
@@ -1,7 +1,6 @@
import json
import gradio as gr
-
import modelscope_studio as mgr
# echarts options, see: https://echarts.apache.org/en/index.html
diff --git a/docs/components/Markdown/demos/custom_tags/select-box/basic.py b/docs/components/Markdown/demos/custom_tags/select-box/basic.py
index eb03c2fe..52fea57a 100644
--- a/docs/components/Markdown/demos/custom_tags/select-box/basic.py
+++ b/docs/components/Markdown/demos/custom_tags/select-box/basic.py
@@ -1,7 +1,6 @@
import json
import gradio as gr
-
import modelscope_studio as mgr
options = [{"label": "A", "value": "a"}, "b", "c"]
diff --git a/docs/components/Markdown/demos/custom_tags/select-box/card_shape.py b/docs/components/Markdown/demos/custom_tags/select-box/card_shape.py
index b2813b85..ca9a39bf 100644
--- a/docs/components/Markdown/demos/custom_tags/select-box/card_shape.py
+++ b/docs/components/Markdown/demos/custom_tags/select-box/card_shape.py
@@ -2,7 +2,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
# Card shape supports setting `imgSrc` as the cover.
diff --git a/docs/components/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py b/docs/components/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
index 41e9f63b..437fcacd 100644
--- a/docs/components/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
+++ b/docs/components/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
@@ -2,7 +2,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
# Card shape supports setting `imgSrc` as the cover.
diff --git a/docs/components/Markdown/demos/custom_tags/select-box/python_events.py b/docs/components/Markdown/demos/custom_tags/select-box/python_events.py
index dd585e7a..d77b89a4 100644
--- a/docs/components/Markdown/demos/custom_tags/select-box/python_events.py
+++ b/docs/components/Markdown/demos/custom_tags/select-box/python_events.py
@@ -1,7 +1,6 @@
import json
import gradio as gr
-
import modelscope_studio as mgr
options = [{"label": "A", "value": "a"}, "b", "c"]
diff --git a/docs/components/Markdown/demos/multimodal.py b/docs/components/Markdown/demos/multimodal.py
index ecc5928e..3bffaab3 100644
--- a/docs/components/Markdown/demos/multimodal.py
+++ b/docs/components/Markdown/demos/multimodal.py
@@ -1,7 +1,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/Markdown/demos/select-box.py b/docs/components/Markdown/demos/select-box.py
index 9b69862b..7f5da713 100644
--- a/docs/components/Markdown/demos/select-box.py
+++ b/docs/components/Markdown/demos/select-box.py
@@ -1,7 +1,6 @@
import json
import gradio as gr
-
import modelscope_studio as mgr
# `label` will display on the page, and `value` is the actual selected value.
diff --git a/docs/components/MultimodalInput/demos/basic.py b/docs/components/MultimodalInput/demos/basic.py
index 67d7470d..55249c4b 100644
--- a/docs/components/MultimodalInput/demos/basic.py
+++ b/docs/components/MultimodalInput/demos/basic.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/MultimodalInput/demos/config_buttons.py b/docs/components/MultimodalInput/demos/config_buttons.py
index 493c59a6..6b73382b 100644
--- a/docs/components/MultimodalInput/demos/config_buttons.py
+++ b/docs/components/MultimodalInput/demos/config_buttons.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/MultimodalInput/demos/upload_sources.py b/docs/components/MultimodalInput/demos/upload_sources.py
index 2e9b5476..e9caff69 100644
--- a/docs/components/MultimodalInput/demos/upload_sources.py
+++ b/docs/components/MultimodalInput/demos/upload_sources.py
@@ -1,5 +1,4 @@
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/MultimodalInput/demos/with_chatbot.py b/docs/components/MultimodalInput/demos/with_chatbot.py
index 6ad7784a..fe48acad 100644
--- a/docs/components/MultimodalInput/demos/with_chatbot.py
+++ b/docs/components/MultimodalInput/demos/with_chatbot.py
@@ -1,7 +1,6 @@
import time
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/WaterfallGallery/demos/basic.py b/docs/components/WaterfallGallery/demos/basic.py
index 7f1c2760..8077244b 100644
--- a/docs/components/WaterfallGallery/demos/basic.py
+++ b/docs/components/WaterfallGallery/demos/basic.py
@@ -1,7 +1,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/WaterfallGallery/demos/like_click_feedback.py b/docs/components/WaterfallGallery/demos/like_click_feedback.py
index 10e2c37d..3d3bc39e 100644
--- a/docs/components/WaterfallGallery/demos/like_click_feedback.py
+++ b/docs/components/WaterfallGallery/demos/like_click_feedback.py
@@ -1,7 +1,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/WaterfallGallery/demos/load_more.py b/docs/components/WaterfallGallery/demos/load_more.py
index a6a23e78..835b20e5 100644
--- a/docs/components/WaterfallGallery/demos/load_more.py
+++ b/docs/components/WaterfallGallery/demos/load_more.py
@@ -2,7 +2,6 @@
import time
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/docs/components/WaterfallGallery/demos/responsive_columns.py b/docs/components/WaterfallGallery/demos/responsive_columns.py
index f6bded30..938efb7f 100644
--- a/docs/components/WaterfallGallery/demos/responsive_columns.py
+++ b/docs/components/WaterfallGallery/demos/responsive_columns.py
@@ -1,7 +1,6 @@
import os
import gradio as gr
-
import modelscope_studio as mgr
diff --git a/frontend/CHANGELOG.md b/frontend/CHANGELOG.md
deleted file mode 100644
index b3554459..00000000
--- a/frontend/CHANGELOG.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# @modelscope-studio/frontend
-
-## 0.4.2
-
-No significant changes to this package were made in this release.
-
-## 0.4.1
-
-No significant changes to this package were made in this release.
-
-## 0.4.0
-
-No significant changes to this package were made in this release.
-
-## 0.3.1
-
-No significant changes to this package were made in this release.
-
-## 0.3.0
-
-No significant changes to this package were made in this release.
diff --git a/frontend/Chatbot/gradio.config.js b/frontend/Chatbot/gradio.config.js
deleted file mode 100644
index a185f7a6..00000000
--- a/frontend/Chatbot/gradio.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- plugins: [],
- svelte: {
- preprocess: [],
- },
-};
diff --git a/frontend/Chatbot/package.json b/frontend/Chatbot/package.json
deleted file mode 100644
index 8fad3b26..00000000
--- a/frontend/Chatbot/package.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "@modelscope-studio/chatbot",
- "version": "0.4.2",
- "private": false,
- "description": "ModelScope Gradio Components",
- "repository": "git@github.com:modelscope/modelscope-studio.git",
- "license": "Apache-2.0",
- "type": "module",
- "exports": {
- ".": "./Index.svelte",
- "./package.json": "./package.json"
- },
- "dependencies": {
- "@gradio/atoms": "0.7.4",
- "@gradio/client": "1.1.1",
- "@gradio/icons": "0.4.1",
- "@gradio/statustracker": "0.6.0",
- "@gradio/utils": "0.4.2",
- "@modelscope-studio/compiled": "workspace:*",
- "@modelscope-studio/shared": "workspace:*",
- "dequal": "^2.0.3"
- },
- "devDependencies": {
- "@gradio/preview": "0.9.1"
- },
- "main_changeset": true
-}
diff --git a/frontend/Flow/gradio.config.js b/frontend/Flow/gradio.config.js
deleted file mode 100644
index a185f7a6..00000000
--- a/frontend/Flow/gradio.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- plugins: [],
- svelte: {
- preprocess: [],
- },
-};
diff --git a/frontend/Markdown/gradio.config.js b/frontend/Markdown/gradio.config.js
deleted file mode 100644
index a185f7a6..00000000
--- a/frontend/Markdown/gradio.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- plugins: [],
- svelte: {
- preprocess: [],
- },
-};
diff --git a/frontend/MultimodalInput/gradio.config.js b/frontend/MultimodalInput/gradio.config.js
deleted file mode 100644
index a185f7a6..00000000
--- a/frontend/MultimodalInput/gradio.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- plugins: [],
- svelte: {
- preprocess: [],
- },
-};
diff --git a/frontend/MultimodalInput/package.json b/frontend/MultimodalInput/package.json
deleted file mode 100644
index 1d757150..00000000
--- a/frontend/MultimodalInput/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "@modelscope-studio/multimodal-input",
- "version": "0.4.2",
- "private": false,
- "description": "ModelScope Gradio Components",
- "repository": "git@github.com:modelscope/modelscope-studio.git",
- "license": "Apache-2.0",
- "type": "module",
- "exports": {
- ".": "./Index.svelte",
- "./example": "./Example.svelte",
- "./package.json": "./package.json"
- },
- "dependencies": {
- "@gradio/atoms": "0.7.4",
- "@gradio/button": "^0.2.43",
- "@gradio/client": "1.1.1",
- "@gradio/icons": "0.4.1",
- "@gradio/statustracker": "0.6.0",
- "@gradio/utils": "0.4.2",
- "@modelscope-studio/compiled": "workspace:*",
- "@modelscope-studio/shared": "workspace:*",
- "wavesurfer.js": "^7.8.0"
- },
- "devDependencies": {
- "@gradio/preview": "0.9.1"
- },
- "main_changeset": true
-}
diff --git a/frontend/WaterfallGallery/gradio.config.js b/frontend/WaterfallGallery/gradio.config.js
deleted file mode 100644
index a185f7a6..00000000
--- a/frontend/WaterfallGallery/gradio.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- plugins: [],
- svelte: {
- preprocess: [],
- },
-};
diff --git a/frontend/WaterfallGallery/package.json b/frontend/WaterfallGallery/package.json
deleted file mode 100644
index 678c45b5..00000000
--- a/frontend/WaterfallGallery/package.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "@modelscope-studio/waterfall-gallery",
- "version": "0.4.2",
- "description": "ModelScope Gradio Components",
- "repository": "git@github.com:modelscope/modelscope-studio.git",
- "license": "Apache-2.0",
- "author": "",
- "type": "module",
- "exports": {
- ".": "./Index.svelte",
- "./package.json": "./package.json"
- },
- "dependencies": {
- "@gradio/atoms": "0.7.4",
- "@gradio/button": "^0.2.43",
- "@gradio/client": "1.1.1",
- "@gradio/icons": "0.4.1",
- "@gradio/statustracker": "0.6.0",
- "@gradio/upload": "0.11.2",
- "@gradio/utils": "0.4.2",
- "@modelscope-studio/shared": "workspace:*",
- "dequal": "^2.0.2"
- },
- "devDependencies": {
- "@gradio/preview": "0.9.1"
- },
- "main_changeset": true
-}
diff --git a/frontend/antd/affix/Index.svelte b/frontend/antd/affix/Index.svelte
new file mode 100644
index 00000000..993510e8
--- /dev/null
+++ b/frontend/antd/affix/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedAffix then Affix}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/affix/affix.tsx b/frontend/antd/affix/affix.tsx
new file mode 100644
index 00000000..b19b73a5
--- /dev/null
+++ b/frontend/antd/affix/affix.tsx
@@ -0,0 +1,13 @@
+import { sveltify } from '@svelte-preprocess-react';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { Affix as AAffix, type GetProps } from 'antd';
+
+export const Affix = sveltify>(
+ ({ target, ...props }) => {
+ const targetFunction = useFunction(target);
+ return ;
+ }
+);
+
+export default Affix;
diff --git a/frontend/antd/affix/gradio.config.js b/frontend/antd/affix/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/affix/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/affix/package.json b/frontend/antd/affix/package.json
new file mode 100644
index 00000000..ea4cf744
--- /dev/null
+++ b/frontend/antd/affix/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-affix",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/alert/Index.svelte b/frontend/antd/alert/Index.svelte
new file mode 100644
index 00000000..0bba37c8
--- /dev/null
+++ b/frontend/antd/alert/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedAlert then Alert}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/alert/alert.tsx b/frontend/antd/alert/alert.tsx
new file mode 100644
index 00000000..3356eca7
--- /dev/null
+++ b/frontend/antd/alert/alert.tsx
@@ -0,0 +1,40 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { Alert as AAlert, type GetProps } from 'antd';
+
+export const Alert = sveltify<
+ GetProps,
+ ['action', 'closable.closeIcon', 'description', 'icon', 'message']
+>(({ slots, afterClose, ...props }) => {
+ const afterCloseFunction = useFunction(afterClose);
+ return (
+ : props.action}
+ closable={
+ slots['closable.closeIcon']
+ ? {
+ ...(typeof props.closable === 'object' ? props.closable : {}),
+ closeIcon: ,
+ }
+ : props.closable
+ }
+ description={
+ slots.description ? (
+
+ ) : (
+ props.description
+ )
+ }
+ icon={slots.icon ? : props.icon}
+ message={
+ slots.message ? : props.message
+ }
+ />
+ );
+});
+
+export default Alert;
diff --git a/frontend/antd/alert/error-boundary/Index.svelte b/frontend/antd/alert/error-boundary/Index.svelte
new file mode 100644
index 00000000..dfa2bcf5
--- /dev/null
+++ b/frontend/antd/alert/error-boundary/Index.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedAlertErrorBoundary then AlertErrorBoundary}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/alert/error-boundary/alert.error-boundary.tsx b/frontend/antd/alert/error-boundary/alert.error-boundary.tsx
new file mode 100644
index 00000000..a354c3b1
--- /dev/null
+++ b/frontend/antd/alert/error-boundary/alert.error-boundary.tsx
@@ -0,0 +1,27 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { Alert as AAlert, type GetProps } from 'antd';
+
+export const AlertErrorBoundary = sveltify<
+ GetProps,
+ ['description', 'message']
+>(({ slots, ...props }) => {
+ return (
+
+ ) : (
+ props.description
+ )
+ }
+ message={
+ slots.message ? : props.message
+ }
+ />
+ );
+});
+
+export default AlertErrorBoundary;
diff --git a/frontend/antd/alert/error-boundary/gradio.config.js b/frontend/antd/alert/error-boundary/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/alert/error-boundary/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/alert/error-boundary/package.json b/frontend/antd/alert/error-boundary/package.json
new file mode 100644
index 00000000..d27b6db0
--- /dev/null
+++ b/frontend/antd/alert/error-boundary/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-alert.error-boundary",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/alert/gradio.config.js b/frontend/antd/alert/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/alert/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/alert/package.json b/frontend/antd/alert/package.json
new file mode 100644
index 00000000..8dca7359
--- /dev/null
+++ b/frontend/antd/alert/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-alert",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/anchor/Index.svelte b/frontend/antd/anchor/Index.svelte
new file mode 100644
index 00000000..d22cd0b3
--- /dev/null
+++ b/frontend/antd/anchor/Index.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedAnchor then Anchor}
+ 0 ? $items : $children}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/anchor/anchor.tsx b/frontend/antd/anchor/anchor.tsx
new file mode 100644
index 00000000..f01ff77e
--- /dev/null
+++ b/frontend/antd/anchor/anchor.tsx
@@ -0,0 +1,45 @@
+import { sveltify } from '@svelte-preprocess-react';
+import React, { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { Anchor as AAnchor, type GetProps } from 'antd';
+
+import { type Item } from './context';
+
+type AnchorProps = GetProps;
+export const Anchor = sveltify<
+ AnchorProps & {
+ slotItems: Item[];
+ }
+>(
+ ({
+ getContainer,
+ getCurrentAnchor,
+ children,
+ items,
+ slotItems,
+ ...props
+ }) => {
+ const getContainerFunction = useFunction(getContainer);
+ const getCurrentAnchorFunction = useFunction(getCurrentAnchor);
+ return (
+ <>
+ {children}
+ {
+ // ["title"]
+ return (
+ items ||
+ renderItems[number]>(slotItems)
+ );
+ }, [items, slotItems])}
+ getContainer={getContainerFunction}
+ getCurrentAnchor={getCurrentAnchorFunction}
+ />
+ >
+ );
+ }
+);
+
+export default Anchor;
diff --git a/frontend/antd/anchor/context.ts b/frontend/antd/anchor/context.ts
new file mode 100644
index 00000000..5512087d
--- /dev/null
+++ b/frontend/antd/anchor/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('anchor');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/anchor/gradio.config.js b/frontend/antd/anchor/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/anchor/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/anchor/item/Index.svelte b/frontend/antd/anchor/item/Index.svelte
new file mode 100644
index 00000000..521141c1
--- /dev/null
+++ b/frontend/antd/anchor/item/Index.svelte
@@ -0,0 +1,78 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/anchor/item/gradio.config.js b/frontend/antd/anchor/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/anchor/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/anchor/item/package.json b/frontend/antd/anchor/item/package.json
new file mode 100644
index 00000000..cbc6131a
--- /dev/null
+++ b/frontend/antd/anchor/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-anchor.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/anchor/package.json b/frontend/antd/anchor/package.json
new file mode 100644
index 00000000..e94ace69
--- /dev/null
+++ b/frontend/antd/anchor/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-anchor",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/auto-complete/Index.svelte b/frontend/antd/auto-complete/Index.svelte
new file mode 100644
index 00000000..ebe1b4c5
--- /dev/null
+++ b/frontend/antd/auto-complete/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedAutoComplete then AutoComplete}
+ 0 ? $options : $children}
+ onValueChange={(v) => {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/auto-complete/auto-complete.tsx b/frontend/antd/auto-complete/auto-complete.tsx
new file mode 100644
index 00000000..48d6cd35
--- /dev/null
+++ b/frontend/antd/auto-complete/auto-complete.tsx
@@ -0,0 +1,106 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { AutoCompleteContext } from '@svelte-preprocess-react/context';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { forwardRef, useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { AutoComplete as AAutoComplete, type GetProps } from 'antd';
+
+import { type Item } from './context';
+
+// eslint-disable-next-line react/display-name
+const AutoCompleteChildrenWrapper = forwardRef<
+ HTMLElement,
+ { children?: React.ReactNode }
+>(({ children, ...props }, ref) => {
+ return (
+ {
+ return {
+ ...props,
+ elRef: ref,
+ };
+ }, [props, ref])}
+ >
+ {children}
+
+ );
+});
+
+export const AutoComplete = sveltify<
+ GetProps & {
+ optionItems: Item[];
+ onValueChange: (value: string) => void;
+ },
+ ['allowClear.clearIcon', 'children', 'notFoundContent']
+>(
+ ({
+ slots,
+ children,
+ onValueChange,
+ filterOption,
+ onChange,
+ options,
+ optionItems,
+ getPopupContainer,
+ dropdownRender,
+ elRef,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const filterOptionFunction = useFunction(filterOption);
+ const dropdownRenderFunction = useFunction(dropdownRender);
+ return (
+ <>
+ {slots.children ? null : (
+ {children}
+ )}
+
+ ,
+ }
+ : props.allowClear
+ }
+ options={useMemo(() => {
+ return (
+ options ||
+ renderItems<
+ NonNullable['options']>[number]
+ >(optionItems, {
+ children: 'options',
+ })
+ );
+ }, [optionItems, options])}
+ onChange={(v, ...args) => {
+ onChange?.(v, ...args);
+ onValueChange(v as string);
+ }}
+ notFoundContent={
+ slots.notFoundContent ? (
+
+ ) : (
+ props.notFoundContent
+ )
+ }
+ filterOption={filterOptionFunction || filterOption}
+ getPopupContainer={getPopupContainerFunction}
+ dropdownRender={dropdownRenderFunction}
+ >
+ {slots.children ? (
+
+ {children}
+
+
+ ) : null}
+
+ >
+ );
+ }
+);
+
+export default AutoComplete;
diff --git a/frontend/antd/auto-complete/context.ts b/frontend/antd/auto-complete/context.ts
new file mode 100644
index 00000000..f592e218
--- /dev/null
+++ b/frontend/antd/auto-complete/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('auto-complete');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/auto-complete/gradio.config.js b/frontend/antd/auto-complete/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/auto-complete/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/auto-complete/option/Index.svelte b/frontend/antd/auto-complete/option/Index.svelte
new file mode 100644
index 00000000..835d5eb6
--- /dev/null
+++ b/frontend/antd/auto-complete/option/Index.svelte
@@ -0,0 +1,91 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/auto-complete/option/gradio.config.js b/frontend/antd/auto-complete/option/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/auto-complete/option/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/auto-complete/option/package.json b/frontend/antd/auto-complete/option/package.json
new file mode 100644
index 00000000..9ccc8bb6
--- /dev/null
+++ b/frontend/antd/auto-complete/option/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-auto-complete.option",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/auto-complete/package.json b/frontend/antd/auto-complete/package.json
new file mode 100644
index 00000000..dcce510c
--- /dev/null
+++ b/frontend/antd/auto-complete/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-auto-complete",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/avatar/Index.svelte b/frontend/antd/avatar/Index.svelte
new file mode 100644
index 00000000..b40be400
--- /dev/null
+++ b/frontend/antd/avatar/Index.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedAvatar then Avatar}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/avatar/avatar.tsx b/frontend/antd/avatar/avatar.tsx
new file mode 100644
index 00000000..e4171fce
--- /dev/null
+++ b/frontend/antd/avatar/avatar.tsx
@@ -0,0 +1,23 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { Avatar as AAvatar, type GetProps } from 'antd';
+
+export const Avatar = sveltify, ['icon', 'src']>(
+ ({ slots, children, ...props }) => {
+ return (
+ <>
+ {slots.icon ? children : null}
+ : props.icon}
+ src={slots.src ? : props.src}
+ >
+ {slots.icon ? null : children}
+
+ >
+ );
+ }
+);
+
+export default Avatar;
diff --git a/frontend/antd/avatar/gradio.config.js b/frontend/antd/avatar/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/avatar/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/avatar/group/Index.svelte b/frontend/antd/avatar/group/Index.svelte
new file mode 100644
index 00000000..1000e855
--- /dev/null
+++ b/frontend/antd/avatar/group/Index.svelte
@@ -0,0 +1,71 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedAvatarGroup then AvatarGroup}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/avatar/group/avatar.group.tsx b/frontend/antd/avatar/group/avatar.group.tsx
new file mode 100644
index 00000000..ecc93959
--- /dev/null
+++ b/frontend/antd/avatar/group/avatar.group.tsx
@@ -0,0 +1,44 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useTargets } from '@utils/hooks/useTargets';
+import { Avatar as AAvatar, type GetProps } from 'antd';
+
+export const AvatarGroup = sveltify<
+ GetProps,
+ ['max.popover.title', 'max.popover.content']
+>(({ slots, children, ...props }) => {
+ const targets = useTargets(children);
+ return (
+ <>
+ {children}
+
+ ) : (
+ props.max?.popover?.title
+ ),
+ content: slots['max.popover.content'] ? (
+
+ ) : (
+ props.max?.popover?.content
+ ),
+ },
+ }}
+ >
+ {targets.map((target, index) => {
+ return ;
+ })}
+
+ >
+ );
+});
+
+export default AvatarGroup;
diff --git a/frontend/antd/avatar/group/gradio.config.js b/frontend/antd/avatar/group/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/avatar/group/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/avatar/group/package.json b/frontend/antd/avatar/group/package.json
new file mode 100644
index 00000000..23f26727
--- /dev/null
+++ b/frontend/antd/avatar/group/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-avatar.group",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/avatar/package.json b/frontend/antd/avatar/package.json
new file mode 100644
index 00000000..287dea2c
--- /dev/null
+++ b/frontend/antd/avatar/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-avatar",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/badge/Index.svelte b/frontend/antd/badge/Index.svelte
new file mode 100644
index 00000000..02b2c1c2
--- /dev/null
+++ b/frontend/antd/badge/Index.svelte
@@ -0,0 +1,81 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedBadge then Badge}
+ {#if $mergedProps._internal.layout}
+
+
+
+ {:else}
+
+ {/if}
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/badge/badge.tsx b/frontend/antd/badge/badge.tsx
new file mode 100644
index 00000000..5be3d850
--- /dev/null
+++ b/frontend/antd/badge/badge.tsx
@@ -0,0 +1,20 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { Badge as ABadge, type GetProps } from 'antd';
+
+export const Badge = sveltify, ['count', 'text']>(
+ ({ slots, ...props }) => {
+ return (
+ <>
+ : props.count}
+ text={slots.text ? : props.text}
+ />
+ >
+ );
+ }
+);
+
+export default Badge;
diff --git a/frontend/antd/badge/gradio.config.js b/frontend/antd/badge/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/badge/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/badge/package.json b/frontend/antd/badge/package.json
new file mode 100644
index 00000000..16c946f4
--- /dev/null
+++ b/frontend/antd/badge/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-badge",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/badge/ribbon/Index.svelte b/frontend/antd/badge/ribbon/Index.svelte
new file mode 100644
index 00000000..41fd82dd
--- /dev/null
+++ b/frontend/antd/badge/ribbon/Index.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedBadgeRibbon then BadgeRibbon}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/badge/ribbon/badge.ribbon.tsx b/frontend/antd/badge/ribbon/badge.ribbon.tsx
new file mode 100644
index 00000000..4eb1d5cb
--- /dev/null
+++ b/frontend/antd/badge/ribbon/badge.ribbon.tsx
@@ -0,0 +1,21 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { Badge as ABadge, type GetProps } from 'antd';
+
+export const BadgeRibbon = sveltify, ['text']>(
+ ({ slots, children, ...props }) => {
+ return (
+ <>
+ : props.text}
+ >
+ {children}
+
+ >
+ );
+ }
+);
+
+export default BadgeRibbon;
diff --git a/frontend/antd/badge/ribbon/gradio.config.js b/frontend/antd/badge/ribbon/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/badge/ribbon/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/badge/ribbon/package.json b/frontend/antd/badge/ribbon/package.json
new file mode 100644
index 00000000..653ce009
--- /dev/null
+++ b/frontend/antd/badge/ribbon/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-badge.ribbon",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/breadcrumb/Index.svelte b/frontend/antd/breadcrumb/Index.svelte
new file mode 100644
index 00000000..5bf55556
--- /dev/null
+++ b/frontend/antd/breadcrumb/Index.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedBreadcrumb then Breadcrumb}
+ 0 ? $items : $children}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/breadcrumb/breadcrumb.tsx b/frontend/antd/breadcrumb/breadcrumb.tsx
new file mode 100644
index 00000000..0dd9191a
--- /dev/null
+++ b/frontend/antd/breadcrumb/breadcrumb.tsx
@@ -0,0 +1,36 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { Breadcrumb as ABreadcrumb, type GetProps } from 'antd';
+import type { ItemType } from 'antd/es/breadcrumb/Breadcrumb';
+
+import { type Item } from './context';
+
+export const Breadcrumb = sveltify<
+ GetProps & {
+ slotItems: Item[];
+ },
+ ['separator']
+>(({ slots, items, slotItems, children, ...props }) => {
+ return (
+ <>
+ {children}
+ {
+ return items || renderItems(slotItems);
+ }, [items, slotItems])}
+ separator={
+ slots.separator ? (
+
+ ) : (
+ props.separator
+ )
+ }
+ />
+ >
+ );
+});
+
+export default Breadcrumb;
diff --git a/frontend/antd/breadcrumb/context.ts b/frontend/antd/breadcrumb/context.ts
new file mode 100644
index 00000000..3d66a13d
--- /dev/null
+++ b/frontend/antd/breadcrumb/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('breadcrumb');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/breadcrumb/gradio.config.js b/frontend/antd/breadcrumb/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/breadcrumb/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/breadcrumb/item/BreadcrumbItem.svelte b/frontend/antd/breadcrumb/item/BreadcrumbItem.svelte
new file mode 100644
index 00000000..6105a701
--- /dev/null
+++ b/frontend/antd/breadcrumb/item/BreadcrumbItem.svelte
@@ -0,0 +1,137 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/breadcrumb/item/Index.svelte b/frontend/antd/breadcrumb/item/Index.svelte
new file mode 100644
index 00000000..4b643c58
--- /dev/null
+++ b/frontend/antd/breadcrumb/item/Index.svelte
@@ -0,0 +1,42 @@
+
+
+
+
+{#await AwaitedBreadcrumbItem then BreadcrumbItem}
+
+
+
+{/await}
+
+
diff --git a/frontend/antd/breadcrumb/item/gradio.config.js b/frontend/antd/breadcrumb/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/breadcrumb/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/breadcrumb/item/package.json b/frontend/antd/breadcrumb/item/package.json
new file mode 100644
index 00000000..1fa85b4d
--- /dev/null
+++ b/frontend/antd/breadcrumb/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-breadcrumb.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/breadcrumb/package.json b/frontend/antd/breadcrumb/package.json
new file mode 100644
index 00000000..c9275f91
--- /dev/null
+++ b/frontend/antd/breadcrumb/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-breadcrumb",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/button/Index.svelte b/frontend/antd/button/Index.svelte
new file mode 100644
index 00000000..523a46f5
--- /dev/null
+++ b/frontend/antd/button/Index.svelte
@@ -0,0 +1,141 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedButton then Button}
+
+ {#if $mergedProps._internal.layout}
+
+ {:else}
+ {$mergedProps.value}
+ {/if}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/button/button.tsx b/frontend/antd/button/button.tsx
new file mode 100644
index 00000000..e305597a
--- /dev/null
+++ b/frontend/antd/button/button.tsx
@@ -0,0 +1,17 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { Button as AButton, type GetProps } from 'antd';
+
+export const Button = sveltify, ['icon']>(
+ ({ slots, ...props }) => {
+ return (
+ : props.icon}
+ />
+ );
+ }
+);
+
+export default Button;
diff --git a/frontend/antd/button/gradio.config.js b/frontend/antd/button/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/button/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/button/group/Index.svelte b/frontend/antd/button/group/Index.svelte
new file mode 100644
index 00000000..cc605dca
--- /dev/null
+++ b/frontend/antd/button/group/Index.svelte
@@ -0,0 +1,71 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedButtonGroup then ButtonGroup}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/button/group/button.group.less b/frontend/antd/button/group/button.group.less
new file mode 100644
index 00000000..d37b5513
--- /dev/null
+++ b/frontend/antd/button/group/button.group.less
@@ -0,0 +1,20 @@
+.ms-gr-antd-container {
+ .ms-gr-antd-button-group {
+ react-portal-target {
+ &:not(:first-child) {
+ .ms-gr-antd-button {
+ border-start-start-radius: 0;
+ border-end-start-radius: 0;
+ margin-inline-start: calc(var(--ms-gr-antd-line-width) * -1);
+ }
+ }
+
+ &:not(:last-child) {
+ .ms-gr-antd-button {
+ border-start-end-radius: 0;
+ border-end-end-radius: 0;
+ }
+ }
+ }
+ }
+}
diff --git a/frontend/antd/button/group/button.group.tsx b/frontend/antd/button/group/button.group.tsx
new file mode 100644
index 00000000..a37d5a64
--- /dev/null
+++ b/frontend/antd/button/group/button.group.tsx
@@ -0,0 +1,26 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { Button as AButton, type GetProps, theme } from 'antd';
+
+import './button.group.less';
+
+export const ButtonGroup = sveltify<
+ GetProps & {
+ id?: string;
+ }
+>(({ style, ...props }) => {
+ const { token } = theme.useToken();
+
+ return (
+
+ );
+});
+
+export default ButtonGroup;
diff --git a/frontend/antd/button/group/gradio.config.js b/frontend/antd/button/group/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/button/group/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/button/group/package.json b/frontend/antd/button/group/package.json
new file mode 100644
index 00000000..409e1463
--- /dev/null
+++ b/frontend/antd/button/group/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-button.group",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/button/package.json b/frontend/antd/button/package.json
new file mode 100644
index 00000000..0a94c046
--- /dev/null
+++ b/frontend/antd/button/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-button",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/calendar/Index.svelte b/frontend/antd/calendar/Index.svelte
new file mode 100644
index 00000000..e45b2551
--- /dev/null
+++ b/frontend/antd/calendar/Index.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCalender then Calender}
+ {
+ value = val;
+ }}
+ >
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/calendar/calendar.tsx b/frontend/antd/calendar/calendar.tsx
new file mode 100644
index 00000000..71a5b40e
--- /dev/null
+++ b/frontend/antd/calendar/calendar.tsx
@@ -0,0 +1,69 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { Calendar as ACalendar, type GetProps } from 'antd';
+import dayjs from 'dayjs';
+
+type CalendarProps = GetProps;
+
+function formatDayjs(date: any) {
+ if (typeof date === 'number') {
+ return dayjs(date * 1000);
+ }
+ return dayjs(date);
+}
+
+export const Calendar = sveltify<
+ Omit & {
+ onChange?: (date: number, ...args: any[]) => void;
+ onPanelChange?: (date: number, ...args: any[]) => void;
+ onSelect?: (date: number, ...args: any[]) => void;
+ onValueChange: (date: number) => void;
+ }
+>(
+ ({
+ disabledDate,
+ value,
+ defaultValue,
+ validRange,
+ onChange,
+ onPanelChange,
+ onSelect,
+ onValueChange,
+ ...props
+ }) => {
+ const disabledDateFunction = useFunction(disabledDate);
+ const validValue = useMemo(() => {
+ return value ? formatDayjs(value) : undefined;
+ }, [value]);
+ const validDefaultValue = useMemo(() => {
+ return defaultValue ? formatDayjs(defaultValue) : undefined;
+ }, [defaultValue]);
+ const validValidRange = useMemo(() => {
+ return Array.isArray(validRange)
+ ? (validRange.map((v) => formatDayjs(v)) as [dayjs.Dayjs, dayjs.Dayjs])
+ : undefined;
+ }, [validRange]);
+ return (
+ {
+ onValueChange(date.valueOf() / 1000);
+ onChange?.(date.valueOf() / 1000, ...args);
+ }}
+ onPanelChange={(date, ...args) => {
+ onPanelChange?.(date.valueOf() / 1000, ...args);
+ }}
+ onSelect={(date, ...args) => {
+ onSelect?.(date.valueOf() / 1000, ...args);
+ }}
+ />
+ );
+ }
+);
+
+export default Calendar;
diff --git a/frontend/antd/calendar/gradio.config.js b/frontend/antd/calendar/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/calendar/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/calendar/package.json b/frontend/antd/calendar/package.json
new file mode 100644
index 00000000..c8423b3e
--- /dev/null
+++ b/frontend/antd/calendar/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-calendar",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/card/Index.svelte b/frontend/antd/card/Index.svelte
new file mode 100644
index 00000000..acc847fc
--- /dev/null
+++ b/frontend/antd/card/Index.svelte
@@ -0,0 +1,129 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCard then Card}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/card/card.tsx b/frontend/antd/card/card.tsx
new file mode 100644
index 00000000..af34731b
--- /dev/null
+++ b/frontend/antd/card/card.tsx
@@ -0,0 +1,41 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useTargets } from '@utils/hooks/useTargets';
+import { Card as ACard, type GetProps } from 'antd';
+
+export const Card = sveltify<
+ GetProps & {
+ containsGrid?: boolean;
+ },
+ ['actions', 'cover', 'extra', 'tabBarExtraContent', 'title']
+>(({ children, containsGrid, slots, ...props }) => {
+ const targets = useTargets(children, 'actions');
+ return (
+ : props.title}
+ extra={slots.extra ? : props.extra}
+ cover={slots.cover ? : props.cover}
+ tabBarExtraContent={
+ slots.tabBarExtraContent ? (
+
+ ) : (
+ props.tabBarExtraContent
+ )
+ }
+ actions={
+ targets.length > 0
+ ? targets.map((target, index) => {
+ return ;
+ })
+ : props.actions
+ }
+ >
+ {containsGrid ? : null}
+ {children}
+
+ );
+});
+
+export default Card;
diff --git a/frontend/antd/card/gradio.config.js b/frontend/antd/card/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/card/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/card/grid/Index.svelte b/frontend/antd/card/grid/Index.svelte
new file mode 100644
index 00000000..5fb8c9e8
--- /dev/null
+++ b/frontend/antd/card/grid/Index.svelte
@@ -0,0 +1,69 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCardGrid then CardGrid}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/card/grid/card.grid.tsx b/frontend/antd/card/grid/card.grid.tsx
new file mode 100644
index 00000000..fa8389a2
--- /dev/null
+++ b/frontend/antd/card/grid/card.grid.tsx
@@ -0,0 +1,6 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { Card as ACard, type GetProps } from 'antd';
+
+export const CardGrid = sveltify>(ACard.Grid);
+
+export default CardGrid;
diff --git a/frontend/antd/card/grid/gradio.config.js b/frontend/antd/card/grid/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/card/grid/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/card/grid/package.json b/frontend/antd/card/grid/package.json
new file mode 100644
index 00000000..36b04c82
--- /dev/null
+++ b/frontend/antd/card/grid/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-card.grid",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/card/meta/Index.svelte b/frontend/antd/card/meta/Index.svelte
new file mode 100644
index 00000000..1ba86329
--- /dev/null
+++ b/frontend/antd/card/meta/Index.svelte
@@ -0,0 +1,79 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCardMeta then CardMeta}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/card/meta/card.meta.tsx b/frontend/antd/card/meta/card.meta.tsx
new file mode 100644
index 00000000..968acb61
--- /dev/null
+++ b/frontend/antd/card/meta/card.meta.tsx
@@ -0,0 +1,27 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { Card as ACard, type GetProps } from 'antd';
+
+export const CardMeta = sveltify<
+ GetProps & {
+ id?: string;
+ },
+ ['avatar', 'description', 'title']
+>(({ slots, ...props }) => {
+ return (
+ : props.title}
+ description={
+ slots.description ? (
+
+ ) : (
+ props.description
+ )
+ }
+ avatar={slots.avatar ? : props.avatar}
+ />
+ );
+});
+
+export default CardMeta;
diff --git a/frontend/antd/card/meta/gradio.config.js b/frontend/antd/card/meta/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/card/meta/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/card/meta/package.json b/frontend/antd/card/meta/package.json
new file mode 100644
index 00000000..60208d50
--- /dev/null
+++ b/frontend/antd/card/meta/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-card.meta",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/card/package.json b/frontend/antd/card/package.json
new file mode 100644
index 00000000..36640fa6
--- /dev/null
+++ b/frontend/antd/card/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-card",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/carousel/Index.svelte b/frontend/antd/carousel/Index.svelte
new file mode 100644
index 00000000..492f4ebe
--- /dev/null
+++ b/frontend/antd/carousel/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCarousel then Carousel}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/carousel/carousel.tsx b/frontend/antd/carousel/carousel.tsx
new file mode 100644
index 00000000..c4936611
--- /dev/null
+++ b/frontend/antd/carousel/carousel.tsx
@@ -0,0 +1,30 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { useTargets } from '@utils/hooks/useTargets';
+import { Carousel as ACarousel, type GetProps } from 'antd';
+
+export const Carousel = sveltify>(
+ ({ afterChange, beforeChange, children, ...props }) => {
+ const afterChangeFunction = useFunction(afterChange);
+ const beforeChangeFunction = useFunction(beforeChange);
+ const targets = useTargets(children);
+ return (
+ <>
+ {children}
+
+ {targets.map((target, index) => {
+ return ;
+ })}
+
+ >
+ );
+ }
+);
+
+export default Carousel;
diff --git a/frontend/antd/carousel/gradio.config.js b/frontend/antd/carousel/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/carousel/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/carousel/package.json b/frontend/antd/carousel/package.json
new file mode 100644
index 00000000..4095c70e
--- /dev/null
+++ b/frontend/antd/carousel/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-carousel",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/cascader/Index.svelte b/frontend/antd/cascader/Index.svelte
new file mode 100644
index 00000000..ee11384d
--- /dev/null
+++ b/frontend/antd/cascader/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCascader then Cascader}
+ 0 ? $options : $children}
+ onValueChange={(v) => {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/cascader/cascader.tsx b/frontend/antd/cascader/cascader.tsx
new file mode 100644
index 00000000..da2853a2
--- /dev/null
+++ b/frontend/antd/cascader/cascader.tsx
@@ -0,0 +1,144 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { Cascader as ACascader, type CascaderProps } from 'antd';
+
+import { type Item } from './context';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+
+export const Cascader = sveltify<
+ CascaderProps & {
+ onValueChange: (value: string[] | number[]) => void;
+ onLoadData?: (...args: any[]) => void;
+ optionItems: Item[];
+ },
+ [
+ 'allowClear.clearIcon',
+ 'suffixIcon',
+ 'maxTagPlaceholder',
+ 'notFoundContent',
+ 'expandIcon',
+ 'removeIcon',
+ ]
+>(
+ ({
+ slots,
+ children,
+ onValueChange,
+ onChange,
+ displayRender,
+ elRef,
+ getPopupContainer,
+ tagRender,
+ maxTagPlaceholder,
+ dropdownRender,
+ optionRender,
+ onLoadData,
+ showSearch,
+ optionItems,
+ options,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const displayRenderFunction = useFunction(displayRender);
+ const tagRenderFunction = useFunction(tagRender);
+ const optionRenderFunction = useFunction(optionRender);
+ const dropdownRenderFunction = useFunction(dropdownRender);
+ const maxTagPlaceholderFunction = useFunction(maxTagPlaceholder);
+ const supportShowSearchConfig = typeof showSearch === 'object';
+ const showSearchConfig = getConfig(showSearch);
+ const showSearchFilterFunction = useFunction(showSearchConfig.filter);
+ const showSearchRenderFunction = useFunction(showSearchConfig.render);
+ const showSearchSortFunction = useFunction(showSearchConfig.sort);
+ return (
+ <>
+ {children}
+ {
+ return (
+ options ||
+ renderItems[number]>(
+ optionItems
+ )
+ );
+ }, [options, optionItems])}
+ showSearch={
+ supportShowSearchConfig
+ ? {
+ ...showSearchConfig,
+ filter: showSearchFilterFunction || showSearchConfig.filter,
+ render: showSearchRenderFunction || showSearchConfig.render,
+ sort: showSearchSortFunction || showSearchConfig.sort,
+ }
+ : showSearch
+ }
+ loadData={onLoadData}
+ optionRender={optionRenderFunction}
+ dropdownRender={dropdownRenderFunction}
+ getPopupContainer={getPopupContainerFunction}
+ displayRender={displayRenderFunction}
+ tagRender={tagRenderFunction}
+ onChange={(v, ...args) => {
+ onChange?.(v, ...args);
+ onValueChange(v);
+ }}
+ suffixIcon={
+ slots.suffixIcon ? (
+
+ ) : (
+ props.suffixIcon
+ )
+ }
+ expandIcon={
+ slots.expandIcon ? (
+
+ ) : (
+ props.expandIcon
+ )
+ }
+ removeIcon={
+ slots.removeIcon ? (
+
+ ) : (
+ props.removeIcon
+ )
+ }
+ notFoundContent={
+ slots.notFoundContent ? (
+
+ ) : (
+ props.notFoundContent
+ )
+ }
+ maxTagPlaceholder={
+ maxTagPlaceholderFunction ||
+ (slots.maxTagPlaceholder ? (
+
+ ) : (
+ maxTagPlaceholder
+ ))
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ />
+ >
+ );
+ }
+);
+
+export default Cascader;
diff --git a/frontend/antd/cascader/context.ts b/frontend/antd/cascader/context.ts
new file mode 100644
index 00000000..4620c4bf
--- /dev/null
+++ b/frontend/antd/cascader/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('cascader');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/cascader/gradio.config.js b/frontend/antd/cascader/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/cascader/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/cascader/option/Index.svelte b/frontend/antd/cascader/option/Index.svelte
new file mode 100644
index 00000000..ab6b55f6
--- /dev/null
+++ b/frontend/antd/cascader/option/Index.svelte
@@ -0,0 +1,87 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/cascader/option/gradio.config.js b/frontend/antd/cascader/option/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/cascader/option/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/cascader/option/package.json b/frontend/antd/cascader/option/package.json
new file mode 100644
index 00000000..0bef1896
--- /dev/null
+++ b/frontend/antd/cascader/option/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-cascader.option",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/cascader/package.json b/frontend/antd/cascader/package.json
new file mode 100644
index 00000000..df927b57
--- /dev/null
+++ b/frontend/antd/cascader/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-cascader",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/cascader/panel/Index.svelte b/frontend/antd/cascader/panel/Index.svelte
new file mode 100644
index 00000000..2e256aab
--- /dev/null
+++ b/frontend/antd/cascader/panel/Index.svelte
@@ -0,0 +1,82 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCascaderPanel then CascaderPanel}
+ 0 ? $options : $children}
+ onValueChange={(v) => {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/cascader/panel/cascader.panel.tsx b/frontend/antd/cascader/panel/cascader.panel.tsx
new file mode 100644
index 00000000..fccdd7d9
--- /dev/null
+++ b/frontend/antd/cascader/panel/cascader.panel.tsx
@@ -0,0 +1,66 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { Cascader as ACascader, type CascaderPanelProps } from 'antd';
+
+import { type Item } from '../context';
+
+export const CascaderPanel = sveltify<
+ CascaderPanelProps & {
+ onValueChange: (value: string[] | number[]) => void;
+ onLoadData?: (...args: any[]) => void;
+ optionItems: Item[];
+ children?: React.ReactNode;
+ },
+ ['notFoundContent', 'expandIcon']
+>(
+ ({
+ slots,
+ children,
+ onValueChange,
+ onChange,
+ onLoadData,
+ optionItems,
+ options,
+ ...props
+ }) => {
+ return (
+ <>
+ {children}
+ {
+ return (
+ options ||
+ renderItems[number]>(
+ optionItems
+ )
+ );
+ }, [options, optionItems])}
+ loadData={onLoadData}
+ onChange={(v, ...args) => {
+ onChange?.(v, ...args);
+ onValueChange(v);
+ }}
+ expandIcon={
+ slots.expandIcon ? (
+
+ ) : (
+ props.expandIcon
+ )
+ }
+ notFoundContent={
+ slots.notFoundContent ? (
+
+ ) : (
+ props.notFoundContent
+ )
+ }
+ />
+ >
+ );
+ }
+);
+
+export default CascaderPanel;
diff --git a/frontend/antd/cascader/panel/gradio.config.js b/frontend/antd/cascader/panel/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/cascader/panel/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/cascader/panel/package.json b/frontend/antd/cascader/panel/package.json
new file mode 100644
index 00000000..b5fe37b0
--- /dev/null
+++ b/frontend/antd/cascader/panel/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-cascader.panel",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/checkbox/Index.svelte b/frontend/antd/checkbox/Index.svelte
new file mode 100644
index 00000000..2a77abd8
--- /dev/null
+++ b/frontend/antd/checkbox/Index.svelte
@@ -0,0 +1,76 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCheckbox then Checkbox}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/checkbox/checkbox.tsx b/frontend/antd/checkbox/checkbox.tsx
new file mode 100644
index 00000000..9695d686
--- /dev/null
+++ b/frontend/antd/checkbox/checkbox.tsx
@@ -0,0 +1,21 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { Checkbox as ACheckbox, type GetProps } from 'antd';
+
+export const Checkbox = sveltify<
+ GetProps & {
+ onValueChange: (value: boolean) => void;
+ }
+>(({ onValueChange, onChange, elRef, ...props }) => {
+ return (
+ {
+ onChange?.(e);
+ onValueChange(e.target.checked);
+ }}
+ />
+ );
+});
+
+export default Checkbox;
diff --git a/frontend/antd/checkbox/context.ts b/frontend/antd/checkbox/context.ts
new file mode 100644
index 00000000..0905e21c
--- /dev/null
+++ b/frontend/antd/checkbox/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('checkbox-group');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/checkbox/gradio.config.js b/frontend/antd/checkbox/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/checkbox/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/checkbox/group/Index.svelte b/frontend/antd/checkbox/group/Index.svelte
new file mode 100644
index 00000000..f409452c
--- /dev/null
+++ b/frontend/antd/checkbox/group/Index.svelte
@@ -0,0 +1,82 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCheckboxGroup then CheckboxGroup}
+ 0 ? $options : $children}
+ onValueChange={(v) => {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/checkbox/group/checkbox.group.tsx b/frontend/antd/checkbox/group/checkbox.group.tsx
new file mode 100644
index 00000000..7020542a
--- /dev/null
+++ b/frontend/antd/checkbox/group/checkbox.group.tsx
@@ -0,0 +1,47 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { Checkbox as ACheckbox, type GetProps } from 'antd';
+
+import { type Item } from '../context';
+
+export const CheckboxGroup = sveltify<
+ GetProps & {
+ onValueChange: (value: (string | number | boolean)[]) => void;
+ optionItems: Item[];
+ }
+>(
+ ({
+ onValueChange,
+ onChange,
+ elRef,
+ optionItems,
+ options,
+ children,
+ ...props
+ }) => {
+ return (
+ <>
+ {children}
+ {
+ return (
+ options ||
+ renderItems<
+ NonNullable['options']>[number]
+ >(optionItems)
+ );
+ }, [optionItems, options])}
+ onChange={(v: any[]) => {
+ onChange?.(v);
+ onValueChange(v);
+ }}
+ />
+ >
+ );
+ }
+);
+
+export default CheckboxGroup;
diff --git a/frontend/antd/checkbox/group/gradio.config.js b/frontend/antd/checkbox/group/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/checkbox/group/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/checkbox/group/option/Index.svelte b/frontend/antd/checkbox/group/option/Index.svelte
new file mode 100644
index 00000000..c6932cee
--- /dev/null
+++ b/frontend/antd/checkbox/group/option/Index.svelte
@@ -0,0 +1,92 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/checkbox/group/option/gradio.config.js b/frontend/antd/checkbox/group/option/gradio.config.js
new file mode 100644
index 00000000..7b2fe8dd
--- /dev/null
+++ b/frontend/antd/checkbox/group/option/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/checkbox/group/option/package.json b/frontend/antd/checkbox/group/option/package.json
new file mode 100644
index 00000000..b884ef07
--- /dev/null
+++ b/frontend/antd/checkbox/group/option/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-checkbox.group.option",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/checkbox/group/package.json b/frontend/antd/checkbox/group/package.json
new file mode 100644
index 00000000..e3c9d136
--- /dev/null
+++ b/frontend/antd/checkbox/group/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-checkbox.group",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/checkbox/package.json b/frontend/antd/checkbox/package.json
new file mode 100644
index 00000000..60770025
--- /dev/null
+++ b/frontend/antd/checkbox/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-checkbox",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/collapse/Index.svelte b/frontend/antd/collapse/Index.svelte
new file mode 100644
index 00000000..a6305021
--- /dev/null
+++ b/frontend/antd/collapse/Index.svelte
@@ -0,0 +1,81 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCollapse then Collapse}
+ 0 ? $items : $children}
+ activeKey={$mergedProps.props.activeKey || $mergedProps.value}
+ onValueChange={(val) => {
+ value = val;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/collapse/collapse.tsx b/frontend/antd/collapse/collapse.tsx
new file mode 100644
index 00000000..7044ca21
--- /dev/null
+++ b/frontend/antd/collapse/collapse.tsx
@@ -0,0 +1,58 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { Collapse as ACollapse, type GetProps } from 'antd';
+
+import { type Item } from './context';
+
+type CollapseProps = GetProps;
+export const Collapse = sveltify<
+ CollapseProps & {
+ slotItems: Item[];
+ onValueChange: CollapseProps['onChange'];
+ },
+ ['expandIcon']
+>(
+ ({
+ slots,
+ items,
+ slotItems,
+ children,
+ onChange,
+ onValueChange,
+ ...props
+ }) => {
+ return (
+ <>
+ {children}
+ {
+ onValueChange?.(key);
+ onChange?.(key);
+ }}
+ expandIcon={
+ slots.expandIcon
+ ? () =>
+ slots.expandIcon ? (
+
+ ) : null
+ : props.expandIcon
+ }
+ items={useMemo(() => {
+ // ['label','extra', 'children']
+ return (
+ items ||
+ renderItems[number]>(
+ slotItems
+ )
+ );
+ }, [items, slotItems])}
+ />
+ >
+ );
+ }
+);
+
+export default Collapse;
diff --git a/frontend/antd/collapse/context.ts b/frontend/antd/collapse/context.ts
new file mode 100644
index 00000000..98a19d3d
--- /dev/null
+++ b/frontend/antd/collapse/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('collapse');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/collapse/gradio.config.js b/frontend/antd/collapse/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/collapse/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/collapse/item/Index.svelte b/frontend/antd/collapse/item/Index.svelte
new file mode 100644
index 00000000..7f56cf58
--- /dev/null
+++ b/frontend/antd/collapse/item/Index.svelte
@@ -0,0 +1,90 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+
+{/if}
+
+
diff --git a/frontend/antd/collapse/item/gradio.config.js b/frontend/antd/collapse/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/collapse/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/collapse/item/package.json b/frontend/antd/collapse/item/package.json
new file mode 100644
index 00000000..658794e4
--- /dev/null
+++ b/frontend/antd/collapse/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-collapse.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/collapse/package.json b/frontend/antd/collapse/package.json
new file mode 100644
index 00000000..0c05a87a
--- /dev/null
+++ b/frontend/antd/collapse/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-collapse",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/color-picker/Index.svelte b/frontend/antd/color-picker/Index.svelte
new file mode 100644
index 00000000..4d823c18
--- /dev/null
+++ b/frontend/antd/color-picker/Index.svelte
@@ -0,0 +1,82 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedColorPicker then ColorPicker}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/color-picker/color-picker.tsx b/frontend/antd/color-picker/color-picker.tsx
new file mode 100644
index 00000000..035521e1
--- /dev/null
+++ b/frontend/antd/color-picker/color-picker.tsx
@@ -0,0 +1,70 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { useTargets } from '@utils/hooks/useTargets';
+import { renderItems } from '@utils/renderItems';
+import { ColorPicker as AColorPicker, type GetProps } from 'antd';
+
+import { type Item } from './context';
+
+export const ColorPicker = sveltify<
+ GetProps & {
+ onValueChange: (value: string) => void;
+ onChange?: (value: string, ...args: any[]) => void;
+ value_format: 'rgb' | 'hex' | 'hsb';
+ presetItems: Item[];
+ }
+>(
+ ({
+ onValueChange,
+ onChange,
+ panelRender,
+ showText,
+ value,
+ presets,
+ presetItems,
+ children,
+ value_format,
+ ...props
+ }) => {
+ const panelRenderFunction = useFunction(panelRender);
+ const showTextFunction = useFunction(showText);
+ const targets = useTargets(children);
+
+ return (
+ <>
+ {targets.length === 0 && (
+ {children}
+ )}
+
+ {
+ return (
+ presets ||
+ renderItems<
+ NonNullable['presets']>[number]
+ >(presetItems)
+ );
+ }, [presets, presetItems])}
+ showText={showTextFunction}
+ panelRender={panelRenderFunction}
+ onChange={(v, ...args) => {
+ const color = {
+ rgb: v.toRgbString(),
+ hex: v.toHexString(),
+ hsb: v.toHsbString(),
+ };
+ onChange?.(color[value_format], ...args);
+ onValueChange(color[value_format]);
+ }}
+ >
+ {targets.length === 0 ? null : children}
+
+ >
+ );
+ }
+);
+
+export default ColorPicker;
diff --git a/frontend/antd/color-picker/context.ts b/frontend/antd/color-picker/context.ts
new file mode 100644
index 00000000..6c841d56
--- /dev/null
+++ b/frontend/antd/color-picker/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('color-picker');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/color-picker/gradio.config.js b/frontend/antd/color-picker/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/color-picker/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/color-picker/package.json b/frontend/antd/color-picker/package.json
new file mode 100644
index 00000000..2da5c65c
--- /dev/null
+++ b/frontend/antd/color-picker/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-color-picker",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/color-picker/preset/Index.svelte b/frontend/antd/color-picker/preset/Index.svelte
new file mode 100644
index 00000000..cb410f3a
--- /dev/null
+++ b/frontend/antd/color-picker/preset/Index.svelte
@@ -0,0 +1,92 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/color-picker/preset/gradio.config.js b/frontend/antd/color-picker/preset/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/color-picker/preset/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/color-picker/preset/package.json b/frontend/antd/color-picker/preset/package.json
new file mode 100644
index 00000000..2fa0e813
--- /dev/null
+++ b/frontend/antd/color-picker/preset/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-color-picker.preset",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/config-provider/Index.svelte b/frontend/antd/config-provider/Index.svelte
new file mode 100644
index 00000000..719e90b4
--- /dev/null
+++ b/frontend/antd/config-provider/Index.svelte
@@ -0,0 +1,61 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedConfigProvider then ConfigProvider}
+
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/config-provider/config-provider.tsx b/frontend/antd/config-provider/config-provider.tsx
new file mode 100644
index 00000000..845f7288
--- /dev/null
+++ b/frontend/antd/config-provider/config-provider.tsx
@@ -0,0 +1,124 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useEffect, useState } from 'react';
+import { StyleProvider } from '@ant-design/cssinjs';
+import { useFunction } from '@utils/hooks/useFunction';
+import { ConfigProvider as AConfigProvider, type GetProps, theme } from 'antd';
+import type { Locale } from 'antd/es/locale';
+import dayjs from 'dayjs';
+import { produce } from 'immer';
+
+import 'dayjs/locale/zh-cn';
+
+import { locales } from './locales';
+
+const combinePropsAndSlots = (
+ props: Record,
+ slots: Record
+) => {
+ return produce(props, (draft) => {
+ Object.keys(slots).forEach((slot) => {
+ const splits = slot.split('.');
+ let current = draft;
+ for (let i = 0; i < splits.length - 1; i++) {
+ const split = splits[i];
+ if (!current[split]) {
+ current[split] = {};
+ }
+ current = current[split];
+ }
+ current[splits[splits.length - 1]] = (
+
+ );
+ });
+ });
+};
+
+type ConfigProviderProps = GetProps;
+
+export const ConfigProvider = sveltify<
+ Omit & {
+ theme_mode: string;
+ theme?: Omit & {
+ algorithm?: {
+ // Auto recognition
+ dark?: boolean;
+ compact?: boolean;
+ };
+ };
+ locale?: string;
+ className?: string;
+ style?: React.CSSProperties;
+ id?: string;
+ }
+>(
+ ({
+ slots,
+ theme_mode,
+ id,
+ className,
+ style,
+ locale: localeProp,
+ getTargetContainer,
+ getPopupContainer,
+ children,
+ ...props
+ }) => {
+ const [locale, setLocale] = useState();
+ const algorithm = {
+ dark: theme_mode === 'dark' ? true : false,
+ ...(props.theme?.algorithm || {}),
+ };
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const getTargetContainerFunction = useFunction(getTargetContainer);
+
+ useEffect(() => {
+ if (localeProp && locales[localeProp]) {
+ locales[localeProp]().then((m) => {
+ setLocale(m.default);
+ if (localeProp === 'zh_CN') {
+ dayjs.locale('zh-cn');
+ }
+ });
+ }
+ }, [localeProp]);
+
+ return (
+
+
+ {
+ switch (algo) {
+ case 'dark':
+ return algorithm[algo]
+ ? theme.darkAlgorithm
+ : theme.defaultAlgorithm;
+ case 'compact':
+ return algorithm[algo] ? theme.compactAlgorithm : null;
+ default:
+ return null;
+ }
+ })
+ .filter(Boolean) as NonNullable<
+ ConfigProviderProps['theme']
+ >['algorithm'],
+ }}
+ >
+ {children}
+
+
+
+ );
+ }
+);
+
+export default ConfigProvider;
diff --git a/frontend/antd/config-provider/gradio.config.js b/frontend/antd/config-provider/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/config-provider/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/config-provider/locales.ts b/frontend/antd/config-provider/locales.ts
new file mode 100644
index 00000000..2d0cb08a
--- /dev/null
+++ b/frontend/antd/config-provider/locales.ts
@@ -0,0 +1,74 @@
+import type { Locale } from 'antd/es/locale';
+
+export const locales: Record Promise<{ default: Locale }>> = {
+ ar_EG: () => import('antd/locale/ar_EG'),
+ az_AZ: () => import('antd/locale/az_AZ'),
+ bg_BG: () => import('antd/locale/bg_BG'),
+ bn_BD: () => import('antd/locale/bn_BD'),
+ by_BY: () => import('antd/locale/by_BY'),
+ ca_ES: () => import('antd/locale/ca_ES'),
+ cs_CZ: () => import('antd/locale/cs_CZ'),
+ da_DK: () => import('antd/locale/da_DK'),
+ de_DE: () => import('antd/locale/de_DE'),
+ el_GR: () => import('antd/locale/el_GR'),
+ en_GB: () => import('antd/locale/en_GB'),
+ en_US: () => import('antd/locale/en_US'),
+ es_ES: () => import('antd/locale/es_ES'),
+ et_EE: () => import('antd/locale/et_EE'),
+ eu_ES: () => import('antd/locale/eu_ES'),
+ fa_IR: () => import('antd/locale/fa_IR'),
+ fi_FI: () => import('antd/locale/fi_FI'),
+ fr_BE: () => import('antd/locale/fr_BE'),
+ fr_CA: () => import('antd/locale/fr_CA'),
+ fr_FR: () => import('antd/locale/fr_FR'),
+ ga_IE: () => import('antd/locale/ga_IE'),
+ gl_ES: () => import('antd/locale/gl_ES'),
+ he_IL: () => import('antd/locale/he_IL'),
+ hi_IN: () => import('antd/locale/hi_IN'),
+ hr_HR: () => import('antd/locale/hr_HR'),
+ hu_HU: () => import('antd/locale/hu_HU'),
+ hy_AM: () => import('antd/locale/hy_AM'),
+ id_ID: () => import('antd/locale/id_ID'),
+ is_IS: () => import('antd/locale/is_IS'),
+ it_IT: () => import('antd/locale/it_IT'),
+ ja_JP: () => import('antd/locale/ja_JP'),
+ ka_GE: () => import('antd/locale/ka_GE'),
+ kk_KZ: () => import('antd/locale/kk_KZ'),
+ km_KH: () => import('antd/locale/km_KH'),
+ kmr_IQ: () => import('antd/locale/kmr_IQ'),
+ kn_IN: () => import('antd/locale/kn_IN'),
+ ko_KR: () => import('antd/locale/ko_KR'),
+ ku_IQ: () => import('antd/locale/ku_IQ'),
+ lt_LT: () => import('antd/locale/lt_LT'),
+ lv_LV: () => import('antd/locale/lv_LV'),
+ mk_MK: () => import('antd/locale/mk_MK'),
+ ml_IN: () => import('antd/locale/ml_IN'),
+ mn_MN: () => import('antd/locale/mn_MN'),
+ ms_MY: () => import('antd/locale/ms_MY'),
+ my_MM: () => import('antd/locale/my_MM'),
+ nb_NO: () => import('antd/locale/nb_NO'),
+ ne_NP: () => import('antd/locale/ne_NP'),
+ nl_BE: () => import('antd/locale/nl_BE'),
+ nl_NL: () => import('antd/locale/nl_NL'),
+ pl_PL: () => import('antd/locale/pl_PL'),
+ pt_BR: () => import('antd/locale/pt_BR'),
+ pt_PT: () => import('antd/locale/pt_PT'),
+ ro_RO: () => import('antd/locale/ro_RO'),
+ ru_RU: () => import('antd/locale/ru_RU'),
+ si_LK: () => import('antd/locale/si_LK'),
+ sk_SK: () => import('antd/locale/sk_SK'),
+ sl_SI: () => import('antd/locale/sl_SI'),
+ sr_RS: () => import('antd/locale/sr_RS'),
+ sv_SE: () => import('antd/locale/sv_SE'),
+ ta_IN: () => import('antd/locale/ta_IN'),
+ th_TH: () => import('antd/locale/th_TH'),
+ tk_TK: () => import('antd/locale/tk_TK'),
+ tr_TR: () => import('antd/locale/tr_TR'),
+ uk_UA: () => import('antd/locale/uk_UA'),
+ ur_PK: () => import('antd/locale/ur_PK'),
+ uz_UZ: () => import('antd/locale/uz_UZ'),
+ vi_VN: () => import('antd/locale/vi_VN'),
+ zh_CN: () => import('antd/locale/zh_CN'),
+ zh_HK: () => import('antd/locale/zh_HK'),
+ zh_TW: () => import('antd/locale/zh_TW'),
+};
diff --git a/frontend/antd/config-provider/package.json b/frontend/antd/config-provider/package.json
new file mode 100644
index 00000000..231ea9bb
--- /dev/null
+++ b/frontend/antd/config-provider/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-config-provider",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/date-picker/Index.svelte b/frontend/antd/date-picker/Index.svelte
new file mode 100644
index 00000000..4d214c3b
--- /dev/null
+++ b/frontend/antd/date-picker/Index.svelte
@@ -0,0 +1,79 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDatePicker then DatePicker}
+ {
+ value = val;
+ }}
+ >
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/date-picker/context.ts b/frontend/antd/date-picker/context.ts
new file mode 100644
index 00000000..d90d80aa
--- /dev/null
+++ b/frontend/antd/date-picker/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('date-picker');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/date-picker/date-picker.tsx b/frontend/antd/date-picker/date-picker.tsx
new file mode 100644
index 00000000..3230666f
--- /dev/null
+++ b/frontend/antd/date-picker/date-picker.tsx
@@ -0,0 +1,207 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { DatePicker as ADatePicker, type GetProps } from 'antd';
+import dayjs from 'dayjs';
+
+import { type Item } from './context';
+
+type DatePickerProps = GetProps;
+
+function formatDayjs(date: any): dayjs.Dayjs {
+ if (Array.isArray(date)) {
+ return date.map((d) => {
+ return formatDayjs(d) as dayjs.Dayjs;
+ }) as unknown as dayjs.Dayjs;
+ }
+ if (typeof date === 'number') {
+ return dayjs(date * 1000);
+ }
+ return dayjs(date);
+}
+
+function formatDate(dates: (dayjs.Dayjs | null | undefined)[] | dayjs.Dayjs) {
+ if (Array.isArray(dates)) {
+ return dates.map((date) => {
+ return date ? date.valueOf() / 1000 : null;
+ });
+ }
+ if (typeof dates === 'object' && dates !== null) {
+ return dates.valueOf() / 1000;
+ }
+ return dates;
+}
+
+export const DatePicker = sveltify<
+ Omit & {
+ onChange?: (date: ReturnType, ...args: any[]) => void;
+ onPanelChange?: (
+ date: ReturnType,
+ ...args: any[]
+ ) => void;
+ onValueChange: (date: ReturnType) => void;
+ presetItems: Item[];
+ },
+ [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ ]
+>(
+ ({
+ slots,
+ disabledDate,
+ value,
+ defaultValue,
+ defaultPickerValue,
+ pickerValue,
+ showTime,
+ presets,
+ presetItems,
+ onChange,
+ minDate,
+ maxDate,
+ cellRender,
+ panelRender,
+ getPopupContainer,
+ onValueChange,
+ onPanelChange,
+ children,
+ elRef,
+ ...props
+ }) => {
+ const disabledDateFunction = useFunction(disabledDate);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const cellRenderFunction = useFunction(cellRender);
+ const panelRenderFunction = useFunction(panelRender);
+ const validShowTime = useMemo(() => {
+ if (typeof showTime === 'object') {
+ return {
+ ...showTime,
+ defaultValue: showTime.defaultValue
+ ? formatDayjs(showTime.defaultValue)
+ : undefined,
+ };
+ }
+ return showTime;
+ }, [showTime]);
+ const validValue = useMemo(() => {
+ return value ? formatDayjs(value) : undefined;
+ }, [value]);
+ const validDefaultValue = useMemo(() => {
+ return defaultValue ? formatDayjs(defaultValue) : undefined;
+ }, [defaultValue]);
+ const validDefaultPickerValue = useMemo(() => {
+ return defaultPickerValue ? formatDayjs(defaultPickerValue) : undefined;
+ }, [defaultPickerValue]);
+ const validPickerValue = useMemo(() => {
+ return pickerValue ? formatDayjs(pickerValue) : undefined;
+ }, [pickerValue]);
+ const validMinDate = useMemo(() => {
+ return minDate ? formatDayjs(minDate) : undefined;
+ }, [minDate]);
+ const validMaxDate = useMemo(() => {
+ return maxDate ? formatDayjs(maxDate) : undefined;
+ }, [maxDate]);
+ return (
+ <>
+ {children}
+ {
+ return (
+ presets ||
+ renderItems[number]>(
+ presetItems
+ )
+ ).map((preset) => {
+ return {
+ ...preset,
+ value: formatDayjs(preset.value),
+ };
+ });
+ }, [presets, presetItems])}
+ onPanelChange={(date, ...args) => {
+ const formattedDates = formatDate(date);
+ onPanelChange?.(formattedDates, ...args);
+ }}
+ onChange={(date, ...args) => {
+ const formattedDate = formatDate(date);
+ onChange?.(formattedDate, ...args);
+ onValueChange(formattedDate);
+ }}
+ renderExtraFooter={
+ slots.renderExtraFooter
+ ? () =>
+ slots.renderExtraFooter ? (
+
+ ) : null
+ : props.renderExtraFooter
+ }
+ prevIcon={
+ slots.prevIcon ? (
+
+ ) : (
+ props.prevIcon
+ )
+ }
+ nextIcon={
+ slots.nextIcon ? (
+
+ ) : (
+ props.nextIcon
+ )
+ }
+ suffixIcon={
+ slots.suffixIcon ? (
+
+ ) : (
+ props.suffixIcon
+ )
+ }
+ superNextIcon={
+ slots.superNextIcon ? (
+
+ ) : (
+ props.superNextIcon
+ )
+ }
+ superPrevIcon={
+ slots.superPrevIcon ? (
+
+ ) : (
+ props.superPrevIcon
+ )
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ />
+ >
+ );
+ }
+);
+
+export default DatePicker;
diff --git a/frontend/antd/date-picker/gradio.config.js b/frontend/antd/date-picker/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/date-picker/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/date-picker/package.json b/frontend/antd/date-picker/package.json
new file mode 100644
index 00000000..9525853b
--- /dev/null
+++ b/frontend/antd/date-picker/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-date-picker",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/date-picker/preset/Index.svelte b/frontend/antd/date-picker/preset/Index.svelte
new file mode 100644
index 00000000..a623fa73
--- /dev/null
+++ b/frontend/antd/date-picker/preset/Index.svelte
@@ -0,0 +1,88 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/date-picker/preset/gradio.config.js b/frontend/antd/date-picker/preset/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/date-picker/preset/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/date-picker/preset/package.json b/frontend/antd/date-picker/preset/package.json
new file mode 100644
index 00000000..de1d5182
--- /dev/null
+++ b/frontend/antd/date-picker/preset/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-date-picker.preset",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/date-picker/range-picker/Index.svelte b/frontend/antd/date-picker/range-picker/Index.svelte
new file mode 100644
index 00000000..08582ba0
--- /dev/null
+++ b/frontend/antd/date-picker/range-picker/Index.svelte
@@ -0,0 +1,84 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDatePickerRangePicker then DateRangePicker}
+ {
+ value = val;
+ }}
+ >
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/date-picker/range-picker/date-picker.range-picker.tsx b/frontend/antd/date-picker/range-picker/date-picker.range-picker.tsx
new file mode 100644
index 00000000..e8f74647
--- /dev/null
+++ b/frontend/antd/date-picker/range-picker/date-picker.range-picker.tsx
@@ -0,0 +1,227 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { DatePicker as ADatePicker, type GetProps } from 'antd';
+import dayjs from 'dayjs';
+
+import { type Item } from '../context';
+
+type RangePickerProps = GetProps;
+
+function formatDayjs(date: any) {
+ if (typeof date === 'number') {
+ return dayjs(date * 1000);
+ }
+ return dayjs(date);
+}
+
+function formatDates(
+ dates: [dayjs.Dayjs | null | undefined, dayjs.Dayjs | null | undefined] | null
+): [number | null, number | null] {
+ return (dates?.map((date) => {
+ return date ? date.valueOf() / 1000 : null;
+ }) || [null, null]) as [number | null, number | null];
+}
+
+export const DateRangePicker = sveltify<
+ Omit & {
+ onChange?: (dates: [number | null, number | null], ...args: any[]) => void;
+ onPanelChange?: (
+ dates: [number | null, number | null],
+ ...args: any[]
+ ) => void;
+ onCalendarChange?: (
+ dates: [number | null, number | null],
+ ...args: any[]
+ ) => void;
+ onValueChange: (dates: [number | null, number | null]) => void;
+ presetItems: Item[];
+ },
+ [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ 'separator',
+ ]
+>(
+ ({
+ slots,
+ disabledDate,
+ value,
+ defaultValue,
+ defaultPickerValue,
+ pickerValue,
+ presets,
+ presetItems,
+ showTime,
+ onChange,
+ minDate,
+ maxDate,
+ cellRender,
+ panelRender,
+ getPopupContainer,
+ onValueChange,
+ onPanelChange,
+ onCalendarChange,
+ children,
+ elRef,
+
+ ...props
+ }) => {
+ const disabledDateFunction = useFunction(disabledDate);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const cellRenderFunction = useFunction(cellRender);
+ const panelRenderFunction = useFunction(panelRender);
+ const validShowTime = useMemo(() => {
+ if (typeof showTime === 'object') {
+ return {
+ ...showTime,
+ defaultValue: showTime.defaultValue?.map((v) => formatDayjs(v)),
+ };
+ }
+ return showTime;
+ }, [showTime]);
+ const validValue = useMemo(() => {
+ return value?.map((v) => formatDayjs(v)) as RangePickerProps['value'];
+ }, [value]);
+
+ const validDefaultValue = useMemo(() => {
+ return defaultValue?.map((v) =>
+ formatDayjs(v)
+ ) as RangePickerProps['defaultValue'];
+ }, [defaultValue]);
+ const validDefaultPickerValue = useMemo(() => {
+ if (Array.isArray(defaultPickerValue)) {
+ return defaultPickerValue.map((v) =>
+ formatDayjs(v)
+ ) as RangePickerProps['defaultPickerValue'];
+ }
+ return defaultPickerValue ? formatDayjs(defaultPickerValue) : undefined;
+ }, [defaultPickerValue]);
+ const validPickerValue = useMemo(() => {
+ if (Array.isArray(pickerValue)) {
+ return pickerValue.map((v) =>
+ formatDayjs(v)
+ ) as RangePickerProps['pickerValue'];
+ }
+ return pickerValue ? formatDayjs(pickerValue) : undefined;
+ }, [pickerValue]);
+ const validMinDate = useMemo(() => {
+ return minDate ? formatDayjs(minDate) : undefined;
+ }, [minDate]);
+ const validMaxDate = useMemo(() => {
+ return maxDate ? formatDayjs(maxDate) : undefined;
+ }, [maxDate]);
+ return (
+ <>
+ {children}
+ {
+ return (
+ presets ||
+ renderItems[number]>(
+ presetItems
+ )
+ ).map((preset) => {
+ return {
+ ...preset,
+ value: formatDates(preset.value as any),
+ };
+ }) as NonNullable;
+ }, [presets, presetItems])}
+ onPanelChange={(dates, ...args) => {
+ const formattedDates = formatDates(dates);
+ onPanelChange?.(formattedDates, ...args);
+ }}
+ onChange={(dates, ...args) => {
+ const formattedDates = formatDates(dates);
+ onChange?.(formattedDates, ...args);
+ onValueChange(formattedDates);
+ }}
+ onCalendarChange={(dates, ...args) => {
+ const formattedDates = formatDates(dates);
+ onCalendarChange?.(formattedDates, ...args);
+ }}
+ renderExtraFooter={
+ slots.renderExtraFooter
+ ? () =>
+ slots.renderExtraFooter ? (
+
+ ) : null
+ : props.renderExtraFooter
+ }
+ prevIcon={
+ slots.prevIcon ? (
+
+ ) : (
+ props.prevIcon
+ )
+ }
+ nextIcon={
+ slots.nextIcon ? (
+
+ ) : (
+ props.nextIcon
+ )
+ }
+ suffixIcon={
+ slots.suffixIcon ? (
+
+ ) : (
+ props.suffixIcon
+ )
+ }
+ superNextIcon={
+ slots.superNextIcon ? (
+
+ ) : (
+ props.superNextIcon
+ )
+ }
+ superPrevIcon={
+ slots.superPrevIcon ? (
+
+ ) : (
+ props.superPrevIcon
+ )
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ separator={
+ slots.separator ? (
+
+ ) : (
+ props.separator
+ )
+ }
+ />
+ >
+ );
+ }
+);
+
+export default DateRangePicker;
diff --git a/frontend/antd/date-picker/range-picker/gradio.config.js b/frontend/antd/date-picker/range-picker/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/date-picker/range-picker/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/date-picker/range-picker/package.json b/frontend/antd/date-picker/range-picker/package.json
new file mode 100644
index 00000000..3eabe51a
--- /dev/null
+++ b/frontend/antd/date-picker/range-picker/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-date-picker.range-picker",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/descriptions/Index.svelte b/frontend/antd/descriptions/Index.svelte
new file mode 100644
index 00000000..c886c04d
--- /dev/null
+++ b/frontend/antd/descriptions/Index.svelte
@@ -0,0 +1,78 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDescriptions then Descriptions}
+ 0 ? $items : $children}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/descriptions/context.ts b/frontend/antd/descriptions/context.ts
new file mode 100644
index 00000000..8ad59e83
--- /dev/null
+++ b/frontend/antd/descriptions/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('descriptions');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/descriptions/descriptions.tsx b/frontend/antd/descriptions/descriptions.tsx
new file mode 100644
index 00000000..4d9b3991
--- /dev/null
+++ b/frontend/antd/descriptions/descriptions.tsx
@@ -0,0 +1,37 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { Descriptions as ADescriptions, type GetProps } from 'antd';
+
+import { type Item } from './context';
+
+type DescriptionsProps = GetProps;
+export const Descriptions = sveltify<
+ DescriptionsProps & {
+ slotItems: Item[];
+ },
+ ['extra', 'title']
+>(({ slots, items, slotItems, children, ...props }) => {
+ return (
+ <>
+ {children}
+ : props.extra}
+ title={slots.title ? : props.title}
+ items={useMemo(() => {
+ // ['label', 'children']
+ return (
+ items ||
+ renderItems[number]>(
+ slotItems
+ )
+ );
+ }, [items, slotItems])}
+ />
+ >
+ );
+});
+
+export default Descriptions;
diff --git a/frontend/antd/descriptions/gradio.config.js b/frontend/antd/descriptions/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/descriptions/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/descriptions/item/Index.svelte b/frontend/antd/descriptions/item/Index.svelte
new file mode 100644
index 00000000..fb0e2db4
--- /dev/null
+++ b/frontend/antd/descriptions/item/Index.svelte
@@ -0,0 +1,90 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+
+{/if}
+
+
diff --git a/frontend/antd/descriptions/item/gradio.config.js b/frontend/antd/descriptions/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/descriptions/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/descriptions/item/package.json b/frontend/antd/descriptions/item/package.json
new file mode 100644
index 00000000..995cd23e
--- /dev/null
+++ b/frontend/antd/descriptions/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-descriptions.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/descriptions/package.json b/frontend/antd/descriptions/package.json
new file mode 100644
index 00000000..be97d578
--- /dev/null
+++ b/frontend/antd/descriptions/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-descriptions",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/divider/Index.svelte b/frontend/antd/divider/Index.svelte
new file mode 100644
index 00000000..8dbe0d96
--- /dev/null
+++ b/frontend/antd/divider/Index.svelte
@@ -0,0 +1,107 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDivider then Divider}
+ {#if $mergedProps._internal.layout}
+
+
+
+ {:else if $mergedProps.value}
+
+ {$mergedProps.value}
+
+ {:else}
+
+ {/if}
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/divider/divider.tsx b/frontend/antd/divider/divider.tsx
new file mode 100644
index 00000000..e61d6ddc
--- /dev/null
+++ b/frontend/antd/divider/divider.tsx
@@ -0,0 +1,10 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { Divider as ADivider, type GetProps } from 'antd';
+
+export const Divider = sveltify, ['children']>(
+ ({ ...props }) => {
+ return ;
+ }
+);
+
+export default Divider;
diff --git a/frontend/antd/divider/gradio.config.js b/frontend/antd/divider/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/divider/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/divider/package.json b/frontend/antd/divider/package.json
new file mode 100644
index 00000000..c4b5a5b9
--- /dev/null
+++ b/frontend/antd/divider/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-divider",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/drawer/Index.svelte b/frontend/antd/drawer/Index.svelte
new file mode 100644
index 00000000..858fd517
--- /dev/null
+++ b/frontend/antd/drawer/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDrawer then Drawer}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/drawer/drawer.tsx b/frontend/antd/drawer/drawer.tsx
new file mode 100644
index 00000000..9f3b9376
--- /dev/null
+++ b/frontend/antd/drawer/drawer.tsx
@@ -0,0 +1,32 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { Drawer as ADrawer, type GetProps } from 'antd';
+
+export const Drawer = sveltify<
+ GetProps,
+ ['closeIcon', 'extra', 'footer', 'title']
+>(({ slots, afterOpenChange, getContainer, drawerRender, ...props }) => {
+ const afterOpenChangeFunction = useFunction(afterOpenChange);
+ const getContainerFunction = useFunction(getContainer);
+ const drawerRenderFunction = useFunction(drawerRender);
+ return (
+ : props.closeIcon
+ }
+ extra={slots.extra ? : props.extra}
+ footer={slots.footer ? : props.footer}
+ title={slots.title ? : props.title}
+ drawerRender={drawerRenderFunction}
+ getContainer={
+ typeof getContainer === 'string' ? getContainerFunction : getContainer
+ }
+ />
+ );
+});
+
+export default Drawer;
diff --git a/frontend/antd/drawer/gradio.config.js b/frontend/antd/drawer/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/drawer/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/drawer/package.json b/frontend/antd/drawer/package.json
new file mode 100644
index 00000000..6b5f9ded
--- /dev/null
+++ b/frontend/antd/drawer/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-drawer",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/dropdown/Index.svelte b/frontend/antd/dropdown/Index.svelte
new file mode 100644
index 00000000..02923eb2
--- /dev/null
+++ b/frontend/antd/dropdown/Index.svelte
@@ -0,0 +1,77 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDropdown then Dropdown}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/dropdown/button/Index.svelte b/frontend/antd/dropdown/button/Index.svelte
new file mode 100644
index 00000000..0035a606
--- /dev/null
+++ b/frontend/antd/dropdown/button/Index.svelte
@@ -0,0 +1,83 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDropdownButton then DropdownButton}
+
+ {#if $mergedProps._internal.layout}
+
+ {:else}
+ {$mergedProps.value}
+ {/if}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/dropdown/button/dropdown.button.tsx b/frontend/antd/dropdown/button/dropdown.button.tsx
new file mode 100644
index 00000000..15dde97d
--- /dev/null
+++ b/frontend/antd/dropdown/button/dropdown.button.tsx
@@ -0,0 +1,62 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { type Item } from '@utils/createItemsContext';
+import { useFunction } from '@utils/hooks/useFunction';
+import { useTargets } from '@utils/hooks/useTargets';
+import { renderItems } from '@utils/renderItems';
+import { Dropdown as ADropdown, type GetProps } from 'antd';
+import type { ItemType } from 'antd/es/menu/interface';
+
+export const DropdownButton = sveltify<
+ GetProps & {
+ menuItems: Item[];
+ },
+ ['icon', 'buttonsRender', 'menu.expandIcon', 'menu.overflowedIndicator']
+>(
+ ({
+ getPopupContainer,
+ slots,
+ menuItems,
+ children,
+ dropdownRender,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const dropdownRenderFunction = useFunction(dropdownRender);
+ const buttonsRenderTargets = useTargets(children, 'buttonsRender');
+ return (
+
+ buttonsRenderTargets.map((item, index) => {
+ return ;
+ })
+ : props.buttonsRender
+ }
+ menu={{
+ ...props.menu,
+ items: useMemo(() => {
+ return props.menu?.items || renderItems(menuItems);
+ }, [menuItems, props.menu?.items]),
+ expandIcon: slots['menu.expandIcon'] ? (
+
+ ) : (
+ props.menu?.expandIcon
+ ),
+ overflowedIndicator: slots['menu.overflowedIndicator'] ? (
+
+ ) : (
+ props.menu?.overflowedIndicator
+ ),
+ }}
+ getPopupContainer={getPopupContainerFunction}
+ dropdownRender={dropdownRenderFunction}
+ />
+ );
+ }
+);
+
+export default DropdownButton;
diff --git a/frontend/antd/dropdown/button/gradio.config.js b/frontend/antd/dropdown/button/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/dropdown/button/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/dropdown/button/package.json b/frontend/antd/dropdown/button/package.json
new file mode 100644
index 00000000..b495d44b
--- /dev/null
+++ b/frontend/antd/dropdown/button/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-dropdown.button",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/dropdown/dropdown.tsx b/frontend/antd/dropdown/dropdown.tsx
new file mode 100644
index 00000000..57532569
--- /dev/null
+++ b/frontend/antd/dropdown/dropdown.tsx
@@ -0,0 +1,66 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { type Item } from '@utils/createItemsContext';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { Dropdown as ADropdown, type GetProps } from 'antd';
+import type { ItemType } from 'antd/es/menu/interface';
+
+export const Dropdown = sveltify<
+ GetProps & {
+ menuItems: Item[];
+ innerStyle?: React.CSSProperties;
+ },
+ ['menu.expandIcon', 'menu.overflowedIndicator']
+>(
+ ({
+ getPopupContainer,
+ innerStyle,
+ children,
+ slots,
+ menuItems,
+ dropdownRender,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const dropdownRenderFunction = useFunction(dropdownRender);
+ return (
+ <>
+ {
+ return props.menu?.items || renderItems(menuItems);
+ }, [menuItems, props.menu?.items]),
+ expandIcon: slots['menu.expandIcon'] ? (
+
+ ) : (
+ props.menu?.expandIcon
+ ),
+ overflowedIndicator: slots['menu.overflowedIndicator'] ? (
+
+ ) : (
+ props.menu?.overflowedIndicator
+ ),
+ }}
+ getPopupContainer={getPopupContainerFunction}
+ dropdownRender={dropdownRenderFunction}
+ >
+
+ {children}
+
+
+ >
+ );
+ }
+);
+
+export default Dropdown;
diff --git a/frontend/antd/dropdown/gradio.config.js b/frontend/antd/dropdown/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/dropdown/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/dropdown/package.json b/frontend/antd/dropdown/package.json
new file mode 100644
index 00000000..30b2bd58
--- /dev/null
+++ b/frontend/antd/dropdown/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-dropdown",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/empty/Index.svelte b/frontend/antd/empty/Index.svelte
new file mode 100644
index 00000000..da8d8ff0
--- /dev/null
+++ b/frontend/antd/empty/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedEmpty then Empty}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/empty/empty.tsx b/frontend/antd/empty/empty.tsx
new file mode 100644
index 00000000..a7a7bdf4
--- /dev/null
+++ b/frontend/antd/empty/empty.tsx
@@ -0,0 +1,28 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { Empty as AEmpty, type GetProps } from 'antd';
+
+export const Empty = sveltify<
+ GetProps,
+ ['description', 'image']
+>(({ slots, imageStyle, ...props }) => {
+ return (
+
+ ) : (
+ props.description
+ )
+ }
+ imageStyle={{
+ display: 'inline-block',
+ ...imageStyle,
+ }}
+ image={slots.image ? : props.image}
+ />
+ );
+});
+
+export default Empty;
diff --git a/frontend/antd/empty/gradio.config.js b/frontend/antd/empty/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/empty/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/empty/package.json b/frontend/antd/empty/package.json
new file mode 100644
index 00000000..ba2fc6be
--- /dev/null
+++ b/frontend/antd/empty/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-flex",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/flex/Index.svelte b/frontend/antd/flex/Index.svelte
new file mode 100644
index 00000000..a871f41d
--- /dev/null
+++ b/frontend/antd/flex/Index.svelte
@@ -0,0 +1,98 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedFlex then Flex}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/flex/flex.tsx b/frontend/antd/flex/flex.tsx
new file mode 100644
index 00000000..f63efbba
--- /dev/null
+++ b/frontend/antd/flex/flex.tsx
@@ -0,0 +1,8 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { Flex as AFlex, type GetProps } from 'antd';
+
+export const Flex = sveltify>((props) => {
+ return ;
+});
+
+export default Flex;
diff --git a/frontend/antd/flex/gradio.config.js b/frontend/antd/flex/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/flex/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/flex/package.json b/frontend/antd/flex/package.json
new file mode 100644
index 00000000..ba2fc6be
--- /dev/null
+++ b/frontend/antd/flex/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-flex",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/float-button/Index.svelte b/frontend/antd/float-button/Index.svelte
new file mode 100644
index 00000000..c81a7dee
--- /dev/null
+++ b/frontend/antd/float-button/Index.svelte
@@ -0,0 +1,67 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedFloatButton then FloatButton}
+
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/float-button/back-top/Index.svelte b/frontend/antd/float-button/back-top/Index.svelte
new file mode 100644
index 00000000..56d94c6c
--- /dev/null
+++ b/frontend/antd/float-button/back-top/Index.svelte
@@ -0,0 +1,73 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedFloatButtonBackTop then FloatButtonBackTop}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/float-button/back-top/float-button.back-top.tsx b/frontend/antd/float-button/back-top/float-button.back-top.tsx
new file mode 100644
index 00000000..eb494320
--- /dev/null
+++ b/frontend/antd/float-button/back-top/float-button.back-top.tsx
@@ -0,0 +1,42 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { FloatButton as AFloatButton, type GetProps } from 'antd';
+
+export const FloatButtonBackTop = sveltify<
+ GetProps,
+ ['icon', 'description', 'tooltip', 'badge.count']
+>(({ slots, children, target, ...props }) => {
+ const targetFunction = useFunction(target);
+ return (
+ <>
+ : props.icon}
+ description={
+ slots.description ? (
+
+ ) : (
+ props.description
+ )
+ }
+ tooltip={
+ slots.tooltip ? : props.tooltip
+ }
+ badge={{
+ ...props.badge,
+ count: slots['badge.count'] ? (
+
+ ) : (
+ props.badge?.count
+ ),
+ }}
+ />
+ {children}
+ >
+ );
+});
+
+export default FloatButtonBackTop;
diff --git a/frontend/antd/float-button/back-top/gradio.config.js b/frontend/antd/float-button/back-top/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/float-button/back-top/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/float-button/back-top/package.json b/frontend/antd/float-button/back-top/package.json
new file mode 100644
index 00000000..ad6d78f7
--- /dev/null
+++ b/frontend/antd/float-button/back-top/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-float-button.back-top",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/float-button/float-button.tsx b/frontend/antd/float-button/float-button.tsx
new file mode 100644
index 00000000..290e4750
--- /dev/null
+++ b/frontend/antd/float-button/float-button.tsx
@@ -0,0 +1,42 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { FloatButton as AFloatButton, type GetProps } from 'antd';
+
+export const FloatButton = sveltify<
+ GetProps & {
+ id?: string;
+ },
+ ['icon', 'description', 'tooltip', 'badge.count']
+>(({ slots, children, ...props }) => {
+ return (
+ <>
+ : props.icon}
+ description={
+ slots.description ? (
+
+ ) : (
+ props.description
+ )
+ }
+ tooltip={
+ slots.tooltip ? : props.tooltip
+ }
+ badge={{
+ ...props.badge,
+ count: slots['badge.count'] ? (
+
+ ) : (
+ props.badge?.count
+ ),
+ }}
+ />
+ {/* render the slots */}
+ {children}
+ >
+ );
+});
+
+export default FloatButton;
diff --git a/frontend/antd/float-button/gradio.config.js b/frontend/antd/float-button/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/float-button/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/float-button/group/Index.svelte b/frontend/antd/float-button/group/Index.svelte
new file mode 100644
index 00000000..ef94fa6b
--- /dev/null
+++ b/frontend/antd/float-button/group/Index.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedFloatButtonGroup then FloatButtonGroup}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/float-button/group/float-button.group.less b/frontend/antd/float-button/group/float-button.group.less
new file mode 100644
index 00000000..4125d193
--- /dev/null
+++ b/frontend/antd/float-button/group/float-button.group.less
@@ -0,0 +1,30 @@
+.ms-gr-antd-container {
+ .ms-gr-antd-float-button-group {
+ &.ms-gr-antd-float-button-group-square {
+ react-portal-target {
+ .ms-gr-antd-float-button {
+ border-start-start-radius: 0 !important;
+ border-start-end-radius: 0 !important;
+ }
+
+ &:first-child {
+ .ms-gr-antd-float-button {
+ border-start-start-radius: var(
+ --ms-gr-antd-border-radius-lg
+ ) !important;
+ border-start-end-radius: var(
+ --ms-gr-antd-border-radius-lg
+ ) !important;
+ }
+ }
+
+ &:last-child {
+ .ms-gr-antd-float-button {
+ border-end-start-radius: var(--ms-gr-antd-border-radius-lg);
+ border-end-end-radius: var(--ms-gr-antd-border-radius-lg);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/frontend/antd/float-button/group/float-button.group.tsx b/frontend/antd/float-button/group/float-button.group.tsx
new file mode 100644
index 00000000..6c482504
--- /dev/null
+++ b/frontend/antd/float-button/group/float-button.group.tsx
@@ -0,0 +1,54 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { FloatButton as AFloatButton, type GetProps, theme } from 'antd';
+import cls from 'classnames';
+
+import './float-button.group.less';
+
+export const FloatButtonGroup = sveltify<
+ GetProps & {
+ id?: string;
+ },
+ ['icon', 'closeIcon', 'description', 'tooltip', 'badge.count']
+>(({ slots, style, shape = 'circle', className, ...props }) => {
+ const { token } = theme.useToken();
+
+ return (
+ : props.closeIcon
+ }
+ icon={slots.icon ? : props.icon}
+ description={
+ slots.description ? (
+
+ ) : (
+ props.description
+ )
+ }
+ tooltip={
+ slots.tooltip ? : props.tooltip
+ }
+ badge={{
+ ...props.badge,
+ count: slots['badge.count'] ? (
+
+ ) : (
+ props.badge?.count
+ ),
+ }}
+ />
+ );
+});
+
+export default FloatButtonGroup;
diff --git a/frontend/antd/float-button/group/gradio.config.js b/frontend/antd/float-button/group/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/float-button/group/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/float-button/group/package.json b/frontend/antd/float-button/group/package.json
new file mode 100644
index 00000000..26936512
--- /dev/null
+++ b/frontend/antd/float-button/group/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-float-button.group",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/float-button/package.json b/frontend/antd/float-button/package.json
new file mode 100644
index 00000000..75494ba6
--- /dev/null
+++ b/frontend/antd/float-button/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-float-button",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/form/Index.svelte b/frontend/antd/form/Index.svelte
new file mode 100644
index 00000000..6f52e9cc
--- /dev/null
+++ b/frontend/antd/form/Index.svelte
@@ -0,0 +1,76 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedForm then Form}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/form/context.ts b/frontend/antd/form/context.ts
new file mode 100644
index 00000000..10e6362a
--- /dev/null
+++ b/frontend/antd/form/context.ts
@@ -0,0 +1,7 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems: getRuleItems, getSetItemFn: getSetRuleItemFn } =
+ createItemsContext('form-item-rule');
+
+export { getRuleItems, getSetRuleItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/form/form.tsx b/frontend/antd/form/form.tsx
new file mode 100644
index 00000000..290a2c9f
--- /dev/null
+++ b/frontend/antd/form/form.tsx
@@ -0,0 +1,28 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { useEffect } from 'react';
+import { Form as AForm, type GetProps } from 'antd';
+
+export const Form = sveltify<
+ GetProps & {
+ value: Record;
+ onValueChange: (value: Record) => void;
+ }
+>(({ value, onValueChange, onValuesChange, ...props }) => {
+ const [form] = AForm.useForm();
+ useEffect(() => {
+ form.setFieldsValue(value);
+ }, [form, value]);
+ return (
+ {
+ onValueChange(values);
+ onValuesChange?.(changedValues, values);
+ }}
+ />
+ );
+});
+
+export default Form;
diff --git a/frontend/antd/form/gradio.config.js b/frontend/antd/form/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/form/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/form/item/Index.svelte b/frontend/antd/form/item/Index.svelte
new file mode 100644
index 00000000..5a778338
--- /dev/null
+++ b/frontend/antd/form/item/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedFormItem then FormItem}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/form/item/form.item.tsx b/frontend/antd/form/item/form.item.tsx
new file mode 100644
index 00000000..da7fca2b
--- /dev/null
+++ b/frontend/antd/form/item/form.item.tsx
@@ -0,0 +1,117 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { FormItemContext } from '@svelte-preprocess-react/context';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { Form as AForm, type GetProps } from 'antd';
+
+import { type Item } from '../context';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+
+const FormItemWrapper: React.FC<{
+ children?: React.ReactNode;
+}> = ({ children, ...props }) => {
+ return (
+ {
+ return props;
+ }, [props])}
+ >
+ {children}
+
+ );
+};
+
+export const FormItem = sveltify<
+ GetProps & {
+ ruleItems: Item[];
+ },
+ ['extra', 'help', 'label', 'tooltip', 'tooltip.title', 'tooltip.icon']
+>(
+ ({
+ slots,
+ getValueFromEvent,
+ getValueProps,
+ normalize,
+ shouldUpdate,
+ tooltip,
+ ruleItems,
+ rules,
+ children,
+ ...props
+ }) => {
+ const supportTooltipConfig =
+ slots['tooltip.icon'] ||
+ slots['tooltip.title'] ||
+ typeof tooltip === 'object';
+ const getValueFromEventFunction = useFunction(getValueFromEvent);
+ const getValuePropsFunction = useFunction(getValueProps);
+ const normalizeFunction = useFunction(normalize);
+ const shouldUpdateFunction = useFunction(shouldUpdate);
+ const tooltipConfig = getConfig(tooltip);
+ const tooltipAfterOpenChangeFunction = useFunction(
+ tooltipConfig.afterOpenChange
+ );
+ const tooltipGetPopupContainerFunction = useFunction(
+ tooltipConfig.getPopupContainer
+ );
+ return (
+ {
+ return (
+ rules ||
+ renderItems<
+ NonNullable['rules']>[number]
+ >(ruleItems)
+ );
+ }, [ruleItems, rules])}
+ tooltip={
+ slots['tooltip'] ? (
+
+ ) : supportTooltipConfig ? (
+ {
+ ...tooltipConfig,
+ afterOpenChange: tooltipAfterOpenChangeFunction,
+ getPopupContainer: tooltipGetPopupContainerFunction,
+ icon: slots['tooltip.icon'] ? (
+
+ ) : (
+ tooltipConfig.icon
+ ),
+ title: slots['tooltip.title'] ? (
+
+ ) : (
+ tooltipConfig.title
+ ),
+ }
+ ) : (
+ tooltip
+ )
+ }
+ extra={slots.extra ? : props.extra}
+ help={slots.help ? : props.help}
+ label={slots.label ? : props.label}
+ >
+ {shouldUpdateFunction || shouldUpdate ? (
+ () => {children as React.ReactNode}
+ ) : (
+ {children as React.ReactNode}
+ )}
+
+ );
+ }
+);
+
+export default FormItem;
diff --git a/frontend/antd/form/item/gradio.config.js b/frontend/antd/form/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/form/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/form/item/package.json b/frontend/antd/form/item/package.json
new file mode 100644
index 00000000..a7565d61
--- /dev/null
+++ b/frontend/antd/form/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-form.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/form/item/rule/Index.svelte b/frontend/antd/form/item/rule/Index.svelte
new file mode 100644
index 00000000..9e3451c3
--- /dev/null
+++ b/frontend/antd/form/item/rule/Index.svelte
@@ -0,0 +1,64 @@
+
+
+
+
+
diff --git a/frontend/antd/form/item/rule/global.css b/frontend/antd/form/item/rule/global.css
new file mode 100644
index 00000000..9d7608a9
--- /dev/null
+++ b/frontend/antd/form/item/rule/global.css
@@ -0,0 +1,3 @@
+.ms-gr-antd-noop-class {
+ display: none;
+}
diff --git a/frontend/antd/form/item/rule/gradio.config.js b/frontend/antd/form/item/rule/gradio.config.js
new file mode 100644
index 00000000..7b2fe8dd
--- /dev/null
+++ b/frontend/antd/form/item/rule/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/form/item/rule/package.json b/frontend/antd/form/item/rule/package.json
new file mode 100644
index 00000000..ab511de3
--- /dev/null
+++ b/frontend/antd/form/item/rule/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-form.item.rule",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/form/package.json b/frontend/antd/form/package.json
new file mode 100644
index 00000000..f7796392
--- /dev/null
+++ b/frontend/antd/form/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-form",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/grid/col/Index.svelte b/frontend/antd/grid/col/Index.svelte
new file mode 100644
index 00000000..55629c7d
--- /dev/null
+++ b/frontend/antd/grid/col/Index.svelte
@@ -0,0 +1,128 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+
+{/if}
+
+
diff --git a/frontend/antd/grid/col/gradio.config.js b/frontend/antd/grid/col/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/grid/col/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/grid/col/package.json b/frontend/antd/grid/col/package.json
new file mode 100644
index 00000000..be71674a
--- /dev/null
+++ b/frontend/antd/grid/col/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-col",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/grid/context.ts b/frontend/antd/grid/context.ts
new file mode 100644
index 00000000..38432560
--- /dev/null
+++ b/frontend/antd/grid/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('grid');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/grid/row/Index.svelte b/frontend/antd/grid/row/Index.svelte
new file mode 100644
index 00000000..7a5d55bf
--- /dev/null
+++ b/frontend/antd/grid/row/Index.svelte
@@ -0,0 +1,90 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedRow then Row}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/grid/row/gradio.config.js b/frontend/antd/grid/row/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/grid/row/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/grid/row/package.json b/frontend/antd/grid/row/package.json
new file mode 100644
index 00000000..d6aff6a4
--- /dev/null
+++ b/frontend/antd/grid/row/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-row",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/grid/row/row.tsx b/frontend/antd/grid/row/row.tsx
new file mode 100644
index 00000000..9efea067
--- /dev/null
+++ b/frontend/antd/grid/row/row.tsx
@@ -0,0 +1,30 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { Col as ACol, type GetProps, Row as ARow } from 'antd';
+
+import { type Item } from '../context';
+
+export const Row = sveltify<
+ GetProps & {
+ cols?: Item[];
+ }
+>(({ cols, children, ...props }) => {
+ return (
+
+ {children}
+ {cols?.map((item, index) => {
+ if (!item) {
+ return;
+ }
+ const { el, props: colProps } = item;
+ return (
+
+ {el && }
+
+ );
+ })}
+
+ );
+});
+
+export default Row;
diff --git a/frontend/antd/icon/Index.svelte b/frontend/antd/icon/Index.svelte
new file mode 100644
index 00000000..a8807561
--- /dev/null
+++ b/frontend/antd/icon/Index.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedIcon then Icon}
+
+ {/await}
+{/if}
diff --git a/frontend/antd/icon/gradio.config.js b/frontend/antd/icon/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/icon/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/icon/icon.tsx b/frontend/antd/icon/icon.tsx
new file mode 100644
index 00000000..a58536ed
--- /dev/null
+++ b/frontend/antd/icon/icon.tsx
@@ -0,0 +1,26 @@
+import { sveltify } from '@svelte-preprocess-react';
+import React from 'react';
+import * as icons from '@ant-design/icons';
+import type { GetProps } from 'antd';
+
+export const Icon = sveltify<
+ GetProps & {
+ name: string;
+ Iconfont?: ReturnType;
+ }
+>(({ name, Iconfont, ...props }) => {
+ const icon = icons[name as keyof typeof icons] as React.ComponentType<
+ GetProps
+ >;
+ return (
+ <>
+ {icon ? (
+ React.createElement(icon, props)
+ ) : Iconfont ? (
+
+ ) : null}
+ >
+ );
+});
+
+export default Icon;
diff --git a/frontend/antd/icon/iconfont-provider/Index.svelte b/frontend/antd/icon/iconfont-provider/Index.svelte
new file mode 100644
index 00000000..b5f98d70
--- /dev/null
+++ b/frontend/antd/icon/iconfont-provider/Index.svelte
@@ -0,0 +1,56 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/icon/iconfont-provider/context.ts b/frontend/antd/icon/iconfont-provider/context.ts
new file mode 100644
index 00000000..019e379e
--- /dev/null
+++ b/frontend/antd/icon/iconfont-provider/context.ts
@@ -0,0 +1,37 @@
+import { initialize } from '@svelte-preprocess-react/component';
+import type { createFromIconfontCN } from '@ant-design/icons';
+import type { CustomIconOptions } from '@ant-design/icons/es/components/IconFont';
+import { getContext, setContext } from 'svelte';
+import { type Writable, writable } from 'svelte/store';
+
+const iconfontContextKey = '$$ms-gr-antd-iconfont-context-key';
+
+let createFromIconfont: typeof createFromIconfontCN;
+async function getCreateFromIconfont() {
+ if (createFromIconfont) {
+ return createFromIconfont;
+ }
+ await initialize();
+ createFromIconfont = await import('./create-iconfont').then(
+ (m) => m.createFromIconfontCN
+ );
+ return createFromIconfont;
+}
+
+export function setIconfontContext() {
+ const writableOptions = writable();
+ const writableIconfont = writable>();
+
+ writableOptions.subscribe(async (value) => {
+ const createFromIconfontCN = await getCreateFromIconfont();
+ writableIconfont.set(createFromIconfontCN(value));
+ });
+ setContext(iconfontContextKey, writableIconfont);
+ return writableOptions;
+}
+
+export function getIconfontContext() {
+ return getContext(iconfontContextKey) as
+ | Writable>
+ | undefined;
+}
diff --git a/frontend/antd/icon/iconfont-provider/create-iconfont.ts b/frontend/antd/icon/iconfont-provider/create-iconfont.ts
new file mode 100644
index 00000000..b5d6dd49
--- /dev/null
+++ b/frontend/antd/icon/iconfont-provider/create-iconfont.ts
@@ -0,0 +1,3 @@
+import { createFromIconfontCN } from '@ant-design/icons';
+
+export { createFromIconfontCN };
diff --git a/frontend/antd/icon/iconfont-provider/gradio.config.js b/frontend/antd/icon/iconfont-provider/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/icon/iconfont-provider/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/icon/iconfont-provider/package.json b/frontend/antd/icon/iconfont-provider/package.json
new file mode 100644
index 00000000..7d005fb6
--- /dev/null
+++ b/frontend/antd/icon/iconfont-provider/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-iconfont-provider",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/icon/package.json b/frontend/antd/icon/package.json
new file mode 100644
index 00000000..f7705cfe
--- /dev/null
+++ b/frontend/antd/icon/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-icon",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/image/Index.svelte b/frontend/antd/image/Index.svelte
new file mode 100644
index 00000000..bb411f66
--- /dev/null
+++ b/frontend/antd/image/Index.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedImage then Image}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/image/gradio.config.js b/frontend/antd/image/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/image/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/image/image.tsx b/frontend/antd/image/image.tsx
new file mode 100644
index 00000000..98068833
--- /dev/null
+++ b/frontend/antd/image/image.tsx
@@ -0,0 +1,58 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Image as AImage } from 'antd';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+type ImageProps = GetProps;
+export const Image = sveltify<
+ ImageProps,
+ ['placeholder', 'preview.mask', 'preview.closeIcon']
+>(({ slots, preview, ...props }) => {
+ const previewConfig = getConfig(preview);
+ const supportPreview =
+ slots['preview.mask'] || slots['preview.closeIcon'] || preview !== false;
+ const getContainerFunction = useFunction(previewConfig.getContainer);
+
+ return (
+
+ ) : (
+ previewConfig.mask
+ ),
+ }
+ : {}),
+ closeIcon: slots['preview.closeIcon'] ? (
+
+ ) : (
+ previewConfig.closeIcon
+ ),
+ } as ImageProps['preview'])
+ : false
+ }
+ placeholder={
+ slots.placeholder ? (
+
+ ) : (
+ props.placeholder
+ )
+ }
+ />
+ );
+});
+
+export default Image;
diff --git a/frontend/antd/image/package.json b/frontend/antd/image/package.json
new file mode 100644
index 00000000..7af7f431
--- /dev/null
+++ b/frontend/antd/image/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-image",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/image/preview-group/Index.svelte b/frontend/antd/image/preview-group/Index.svelte
new file mode 100644
index 00000000..6519b11a
--- /dev/null
+++ b/frontend/antd/image/preview-group/Index.svelte
@@ -0,0 +1,79 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedImagePreviewGroup then ImagePreviewGroup}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/image/preview-group/gradio.config.js b/frontend/antd/image/preview-group/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/image/preview-group/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/image/preview-group/image.preview-group.tsx b/frontend/antd/image/preview-group/image.preview-group.tsx
new file mode 100644
index 00000000..2451e3ee
--- /dev/null
+++ b/frontend/antd/image/preview-group/image.preview-group.tsx
@@ -0,0 +1,54 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Image as AImage } from 'antd';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+
+type ImagePreviewGroupProps = GetProps;
+
+export const ImagePreviewGroup = sveltify<
+ GetProps,
+ ['preview.mask', 'preview.closeIcon']
+>(({ slots, preview, ...props }) => {
+ const previewConfig = getConfig(preview);
+ const supportPreview =
+ slots['preview.mask'] || slots['preview.closeIcon'] || preview !== false;
+ const getContainerFunction = useFunction(previewConfig.getContainer);
+ return (
+
+ ) : (
+ previewConfig.mask
+ ),
+ }
+ : {}),
+ closeIcon: slots['preview.closeIcon'] ? (
+
+ ) : (
+ previewConfig.closeIcon
+ ),
+ },
+ } as ImagePreviewGroupProps['preview'])
+ : false
+ }
+ />
+ );
+});
+
+export default ImagePreviewGroup;
diff --git a/frontend/antd/image/preview-group/package.json b/frontend/antd/image/preview-group/package.json
new file mode 100644
index 00000000..4d3157af
--- /dev/null
+++ b/frontend/antd/image/preview-group/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-image.preview-group",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/input-number/Index.svelte b/frontend/antd/input-number/Index.svelte
new file mode 100644
index 00000000..5cffbea1
--- /dev/null
+++ b/frontend/antd/input-number/Index.svelte
@@ -0,0 +1,76 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedInputNumber then InputNumber}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/input-number/gradio.config.js b/frontend/antd/input-number/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/input-number/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/input-number/input-number.tsx b/frontend/antd/input-number/input-number.tsx
new file mode 100644
index 00000000..3d039817
--- /dev/null
+++ b/frontend/antd/input-number/input-number.tsx
@@ -0,0 +1,85 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, InputNumber as AInputNumber } from 'antd';
+
+export const InputNumber = sveltify<
+ GetProps & {
+ onValueChange: (value: number | string | null) => void;
+ },
+ [
+ 'addonAfter',
+ 'addonBefore',
+ 'controls.upIcon',
+ 'controls.downIcon',
+ 'prefix',
+ 'suffix',
+ ]
+>(
+ ({
+ slots,
+ children,
+ onValueChange,
+ onChange,
+ formatter,
+ parser,
+ elRef,
+ ...props
+ }) => {
+ const formatterFunction = useFunction(formatter);
+ const parserFunction = useFunction(parser);
+ return (
+ <>
+ {children}
+ {
+ onChange?.(v);
+ onValueChange(v);
+ }}
+ parser={parserFunction}
+ formatter={formatterFunction}
+ controls={
+ slots['controls.upIcon'] || slots['controls.downIcon']
+ ? {
+ upIcon: slots['controls.upIcon'] ? (
+
+ ) : typeof props.controls === 'object' ? (
+ props.controls.upIcon
+ ) : undefined,
+ downIcon: slots['controls.downIcon'] ? (
+
+ ) : typeof props.controls === 'object' ? (
+ props.controls.downIcon
+ ) : undefined,
+ }
+ : props.controls
+ }
+ addonAfter={
+ slots.addonAfter ? (
+
+ ) : (
+ props.addonAfter
+ )
+ }
+ addonBefore={
+ slots.addonBefore ? (
+
+ ) : (
+ props.addonBefore
+ )
+ }
+ prefix={
+ slots.prefix ? : props.prefix
+ }
+ suffix={
+ slots.suffix ? : props.suffix
+ }
+ />
+ >
+ );
+ }
+);
+
+export default InputNumber;
diff --git a/frontend/antd/input-number/package.json b/frontend/antd/input-number/package.json
new file mode 100644
index 00000000..9fdaf8d2
--- /dev/null
+++ b/frontend/antd/input-number/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-input-number",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/input/Index.svelte b/frontend/antd/input/Index.svelte
new file mode 100644
index 00000000..39d906f7
--- /dev/null
+++ b/frontend/antd/input/Index.svelte
@@ -0,0 +1,76 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedInput then Input}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/input/gradio.config.js b/frontend/antd/input/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/input/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/input/input.tsx b/frontend/antd/input/input.tsx
new file mode 100644
index 00000000..db0e7135
--- /dev/null
+++ b/frontend/antd/input/input.tsx
@@ -0,0 +1,84 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Input as AInput } from 'antd';
+
+export const Input = sveltify<
+ GetProps & {
+ onValueChange: (value: string) => void;
+ },
+ ['addonAfter', 'addonBefore', 'allowClear.clearIcon', 'prefix', 'suffix']
+>(
+ ({
+ slots,
+ children,
+ count,
+ showCount,
+ onValueChange,
+ onChange,
+ elRef,
+ ...props
+ }) => {
+ const countStrategyFunction = useFunction(count?.strategy);
+ const countExceedFormatterFunction = useFunction(count?.exceedFormatter);
+ const countShowFunction = useFunction(count?.show);
+ const showCountFunction = useFunction(
+ typeof showCount === 'object' ? showCount.formatter : undefined
+ );
+ return (
+ <>
+ {children}
+ {
+ onChange?.(e);
+ onValueChange(e.target.value);
+ }}
+ showCount={
+ typeof showCount === 'object' && showCountFunction
+ ? {
+ formatter: showCountFunction,
+ }
+ : showCount
+ }
+ count={{
+ ...count,
+ exceedFormatter: countExceedFormatterFunction,
+ strategy: countStrategyFunction,
+ show: countShowFunction || count?.show,
+ }}
+ addonAfter={
+ slots.addonAfter ? (
+
+ ) : (
+ props.addonAfter
+ )
+ }
+ addonBefore={
+ slots.addonBefore ? (
+
+ ) : (
+ props.addonBefore
+ )
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ prefix={
+ slots.prefix ? : props.prefix
+ }
+ suffix={
+ slots.suffix ? : props.suffix
+ }
+ />
+ >
+ );
+ }
+);
+
+export default Input;
diff --git a/frontend/antd/input/otp/Index.svelte b/frontend/antd/input/otp/Index.svelte
new file mode 100644
index 00000000..5dd2e0c5
--- /dev/null
+++ b/frontend/antd/input/otp/Index.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedInputOTP then InputOTP}
+ {
+ value = v;
+ }}
+ />
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/input/otp/gradio.config.js b/frontend/antd/input/otp/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/input/otp/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/input/otp/input.otp.tsx b/frontend/antd/input/otp/input.otp.tsx
new file mode 100644
index 00000000..dd0d0d40
--- /dev/null
+++ b/frontend/antd/input/otp/input.otp.tsx
@@ -0,0 +1,24 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Input as AInput } from 'antd';
+
+export const InputOTP = sveltify<
+ GetProps & {
+ onValueChange: (value: string) => void;
+ }
+>(({ formatter, onValueChange, onChange, elRef, ...props }) => {
+ const formatterFunction = useFunction(formatter);
+ return (
+ {
+ onChange?.(v);
+ onValueChange(v);
+ }}
+ />
+ );
+});
+
+export default InputOTP;
diff --git a/frontend/antd/input/otp/package.json b/frontend/antd/input/otp/package.json
new file mode 100644
index 00000000..75103044
--- /dev/null
+++ b/frontend/antd/input/otp/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-input.otp",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/input/package.json b/frontend/antd/input/package.json
new file mode 100644
index 00000000..e50771dd
--- /dev/null
+++ b/frontend/antd/input/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-input",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/input/password/Index.svelte b/frontend/antd/input/password/Index.svelte
new file mode 100644
index 00000000..9e808122
--- /dev/null
+++ b/frontend/antd/input/password/Index.svelte
@@ -0,0 +1,78 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedInputPassword then InputPassword}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/input/password/gradio.config.js b/frontend/antd/input/password/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/input/password/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/input/password/input.password.tsx b/frontend/antd/input/password/input.password.tsx
new file mode 100644
index 00000000..7e036514
--- /dev/null
+++ b/frontend/antd/input/password/input.password.tsx
@@ -0,0 +1,85 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Input as AInput } from 'antd';
+
+export const InputPassword = sveltify<
+ GetProps & {
+ onValueChange: (value: string) => void;
+ },
+ ['addonAfter', 'addonBefore', 'allowClear.clearIcon', 'prefix', 'suffix']
+>(
+ ({
+ slots,
+ children,
+ count,
+ showCount,
+ onValueChange,
+ onChange,
+ elRef,
+ ...props
+ }) => {
+ const countStrategyFunction = useFunction(count?.strategy);
+ const countExceedFormatterFunction = useFunction(count?.exceedFormatter);
+ const countShowFunction = useFunction(count?.show);
+ const showCountFunction = useFunction(
+ typeof showCount === 'object' ? showCount.formatter : undefined
+ );
+
+ return (
+ <>
+ {children}
+ {
+ onChange?.(e);
+ onValueChange(e.target.value);
+ }}
+ showCount={
+ typeof showCount === 'object' && showCountFunction
+ ? {
+ formatter: showCountFunction,
+ }
+ : showCount
+ }
+ count={{
+ ...count,
+ exceedFormatter: countExceedFormatterFunction,
+ strategy: countStrategyFunction,
+ show: countShowFunction || count?.show,
+ }}
+ addonAfter={
+ slots.addonAfter ? (
+
+ ) : (
+ props.addonAfter
+ )
+ }
+ addonBefore={
+ slots.addonBefore ? (
+
+ ) : (
+ props.addonBefore
+ )
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ prefix={
+ slots.prefix ? : props.prefix
+ }
+ suffix={
+ slots.suffix ? : props.suffix
+ }
+ />
+ >
+ );
+ }
+);
+
+export default InputPassword;
diff --git a/frontend/antd/input/password/package.json b/frontend/antd/input/password/package.json
new file mode 100644
index 00000000..54930dce
--- /dev/null
+++ b/frontend/antd/input/password/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-input.password",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/input/search/Index.svelte b/frontend/antd/input/search/Index.svelte
new file mode 100644
index 00000000..dfd69468
--- /dev/null
+++ b/frontend/antd/input/search/Index.svelte
@@ -0,0 +1,76 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedInputSearch then InputSearch}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/input/search/gradio.config.js b/frontend/antd/input/search/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/input/search/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/input/search/input.search.tsx b/frontend/antd/input/search/input.search.tsx
new file mode 100644
index 00000000..573c760b
--- /dev/null
+++ b/frontend/antd/input/search/input.search.tsx
@@ -0,0 +1,99 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Input as AInput } from 'antd';
+
+export const InputSearch = sveltify<
+ GetProps & {
+ onValueChange: (value: string) => void;
+ },
+ [
+ 'addonAfter',
+ 'addonBefore',
+ 'allowClear.clearIcon',
+ 'prefix',
+ 'suffix',
+ 'enterButton',
+ ]
+>(
+ ({
+ slots,
+ children,
+ count,
+ showCount,
+ onValueChange,
+ onChange,
+ elRef,
+ ...props
+ }) => {
+ const countStrategyFunction = useFunction(count?.strategy);
+ const countExceedFormatterFunction = useFunction(count?.exceedFormatter);
+ const countShowFunction = useFunction(count?.show);
+ const showCountFunction = useFunction(
+ typeof showCount === 'object' ? showCount.formatter : undefined
+ );
+
+ return (
+ <>
+ {children}
+ {
+ onChange?.(e);
+ onValueChange(e.target.value);
+ }}
+ showCount={
+ typeof showCount === 'object' && showCountFunction
+ ? {
+ formatter: showCountFunction,
+ }
+ : showCount
+ }
+ count={{
+ ...count,
+ exceedFormatter: countExceedFormatterFunction,
+ strategy: countStrategyFunction,
+ show: countShowFunction || count?.show,
+ }}
+ enterButton={
+ slots.enterButton ? (
+
+ ) : (
+ props.enterButton
+ )
+ }
+ addonAfter={
+ slots.addonAfter ? (
+
+ ) : (
+ props.addonAfter
+ )
+ }
+ addonBefore={
+ slots.addonBefore ? (
+
+ ) : (
+ props.addonBefore
+ )
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ prefix={
+ slots.prefix ? : props.prefix
+ }
+ suffix={
+ slots.suffix ? : props.suffix
+ }
+ />
+ >
+ );
+ }
+);
+
+export default InputSearch;
diff --git a/frontend/antd/input/search/package.json b/frontend/antd/input/search/package.json
new file mode 100644
index 00000000..43f662c0
--- /dev/null
+++ b/frontend/antd/input/search/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-input.search",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/input/textarea/Index.svelte b/frontend/antd/input/textarea/Index.svelte
new file mode 100644
index 00000000..79ed21e2
--- /dev/null
+++ b/frontend/antd/input/textarea/Index.svelte
@@ -0,0 +1,78 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedInputTextarea then InputTextarea}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/input/textarea/gradio.config.js b/frontend/antd/input/textarea/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/input/textarea/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/input/textarea/input.textarea.tsx b/frontend/antd/input/textarea/input.textarea.tsx
new file mode 100644
index 00000000..5ecd159b
--- /dev/null
+++ b/frontend/antd/input/textarea/input.textarea.tsx
@@ -0,0 +1,65 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Input as AInput } from 'antd';
+
+export const InputTextarea = sveltify<
+ GetProps & {
+ onValueChange: (value: string) => void;
+ },
+ ['allowClear.clearIcon']
+>(
+ ({
+ slots,
+ children,
+ count,
+ showCount,
+ onValueChange,
+ onChange,
+ elRef,
+ ...props
+ }) => {
+ const countStrategyFunction = useFunction(count?.strategy);
+ const countExceedFormatterFunction = useFunction(count?.exceedFormatter);
+ const countShowFunction = useFunction(count?.show);
+ const showCountFunction = useFunction(
+ typeof showCount === 'object' ? showCount.formatter : undefined
+ );
+
+ return (
+ <>
+ {children}
+ {
+ onChange?.(e);
+ onValueChange(e.target.value);
+ }}
+ showCount={
+ typeof showCount === 'object' && showCountFunction
+ ? {
+ formatter: showCountFunction,
+ }
+ : showCount
+ }
+ count={{
+ ...count,
+ exceedFormatter: countExceedFormatterFunction,
+ strategy: countStrategyFunction,
+ show: countShowFunction || count?.show,
+ }}
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ />
+ >
+ );
+ }
+);
+
+export default InputTextarea;
diff --git a/frontend/antd/input/textarea/package.json b/frontend/antd/input/textarea/package.json
new file mode 100644
index 00000000..09582da9
--- /dev/null
+++ b/frontend/antd/input/textarea/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-input.textarea",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/layout/Base.svelte b/frontend/antd/layout/Base.svelte
new file mode 100644
index 00000000..51eb1f27
--- /dev/null
+++ b/frontend/antd/layout/Base.svelte
@@ -0,0 +1,71 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedLayoutBase then LayoutBase}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/layout/Index.svelte b/frontend/antd/layout/Index.svelte
new file mode 100644
index 00000000..bc283720
--- /dev/null
+++ b/frontend/antd/layout/Index.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/layout/content/Index.svelte b/frontend/antd/layout/content/Index.svelte
new file mode 100644
index 00000000..33b0ffdf
--- /dev/null
+++ b/frontend/antd/layout/content/Index.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/layout/content/gradio.config.js b/frontend/antd/layout/content/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/layout/content/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/layout/content/package.json b/frontend/antd/layout/content/package.json
new file mode 100644
index 00000000..3f340e12
--- /dev/null
+++ b/frontend/antd/layout/content/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-layout.content",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/layout/footer/Index.svelte b/frontend/antd/layout/footer/Index.svelte
new file mode 100644
index 00000000..de1f73b4
--- /dev/null
+++ b/frontend/antd/layout/footer/Index.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/layout/footer/gradio.config.js b/frontend/antd/layout/footer/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/layout/footer/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/layout/footer/package.json b/frontend/antd/layout/footer/package.json
new file mode 100644
index 00000000..606f5a97
--- /dev/null
+++ b/frontend/antd/layout/footer/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-layout.footer",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/layout/gradio.config.js b/frontend/antd/layout/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/layout/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/layout/header/Index.svelte b/frontend/antd/layout/header/Index.svelte
new file mode 100644
index 00000000..cedb6145
--- /dev/null
+++ b/frontend/antd/layout/header/Index.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/layout/header/gradio.config.js b/frontend/antd/layout/header/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/layout/header/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/layout/header/package.json b/frontend/antd/layout/header/package.json
new file mode 100644
index 00000000..dd13c5f0
--- /dev/null
+++ b/frontend/antd/layout/header/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-layout.header",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/layout/layout.base.tsx b/frontend/antd/layout/layout.base.tsx
new file mode 100644
index 00000000..9e02bb90
--- /dev/null
+++ b/frontend/antd/layout/layout.base.tsx
@@ -0,0 +1,39 @@
+import { sveltify } from '@svelte-preprocess-react';
+import React, { useMemo } from 'react';
+import { type GetProps, Layout as ALayout } from 'antd';
+import cls from 'classnames';
+
+export const Base = sveltify<
+ GetProps &
+ GetProps &
+ GetProps &
+ GetProps & {
+ component?: 'header' | 'footer' | 'content' | 'layout';
+ }
+>(({ component, className, ...props }) => {
+ const LayoutComponent = useMemo(() => {
+ switch (component) {
+ case 'content':
+ return ALayout.Content;
+ case 'footer':
+ return ALayout.Footer;
+ case 'header':
+ return ALayout.Header;
+ case 'layout':
+ return ALayout;
+ default:
+ return ALayout;
+ }
+ }, [component]);
+ return (
+
+ );
+});
+
+export default Base;
diff --git a/frontend/antd/layout/package.json b/frontend/antd/layout/package.json
new file mode 100644
index 00000000..91999c66
--- /dev/null
+++ b/frontend/antd/layout/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-layout",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/layout/sider/Index.svelte b/frontend/antd/layout/sider/Index.svelte
new file mode 100644
index 00000000..e943e83c
--- /dev/null
+++ b/frontend/antd/layout/sider/Index.svelte
@@ -0,0 +1,71 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedLayoutSider then LayoutSider}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/layout/sider/gradio.config.js b/frontend/antd/layout/sider/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/layout/sider/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/layout/sider/layout.sider.tsx b/frontend/antd/layout/sider/layout.sider.tsx
new file mode 100644
index 00000000..de7003f5
--- /dev/null
+++ b/frontend/antd/layout/sider/layout.sider.tsx
@@ -0,0 +1,20 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { type GetProps, Layout as ALayout } from 'antd';
+
+export const LayoutSider = sveltify<
+ GetProps,
+ ['trigger']
+>(({ slots, ...props }) => {
+ return (
+ : props.trigger
+ }
+ />
+ );
+});
+
+export default LayoutSider;
diff --git a/frontend/antd/layout/sider/package.json b/frontend/antd/layout/sider/package.json
new file mode 100644
index 00000000..c66bcef8
--- /dev/null
+++ b/frontend/antd/layout/sider/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-layout.sider",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/list/Index.svelte b/frontend/antd/list/Index.svelte
new file mode 100644
index 00000000..8f8c44c5
--- /dev/null
+++ b/frontend/antd/list/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedList then List}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/list/gradio.config.js b/frontend/antd/list/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/list/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/list/item/Index.svelte b/frontend/antd/list/item/Index.svelte
new file mode 100644
index 00000000..c401f1f6
--- /dev/null
+++ b/frontend/antd/list/item/Index.svelte
@@ -0,0 +1,65 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedListItem then ListItem}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/list/item/gradio.config.js b/frontend/antd/list/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/list/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/list/item/list.item.tsx b/frontend/antd/list/item/list.item.tsx
new file mode 100644
index 00000000..1f95c792
--- /dev/null
+++ b/frontend/antd/list/item/list.item.tsx
@@ -0,0 +1,28 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useTargets } from '@utils/hooks/useTargets';
+import { type GetProps, List as AList } from 'antd';
+
+export const ListItem = sveltify<
+ GetProps,
+ ['extra', 'actions']
+>(({ slots, children, ...props }) => {
+ const actionsSlots = useTargets(children, 'actions');
+ return (
+ : props.extra}
+ actions={
+ actionsSlots.length > 0
+ ? actionsSlots.map((slot, index) => {
+ return ;
+ })
+ : props.actions
+ }
+ >
+ {children}
+
+ );
+});
+
+export default ListItem;
diff --git a/frontend/antd/list/item/meta/Index.svelte b/frontend/antd/list/item/meta/Index.svelte
new file mode 100644
index 00000000..27a97b09
--- /dev/null
+++ b/frontend/antd/list/item/meta/Index.svelte
@@ -0,0 +1,65 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedListItemMeta then ListItemMeta}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/list/item/meta/gradio.config.js b/frontend/antd/list/item/meta/gradio.config.js
new file mode 100644
index 00000000..7b2fe8dd
--- /dev/null
+++ b/frontend/antd/list/item/meta/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/list/item/meta/list.item.meta.tsx b/frontend/antd/list/item/meta/list.item.meta.tsx
new file mode 100644
index 00000000..f86d219b
--- /dev/null
+++ b/frontend/antd/list/item/meta/list.item.meta.tsx
@@ -0,0 +1,28 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { type GetProps, List as AList } from 'antd';
+
+export const ListItemMeta = sveltify<
+ GetProps,
+ ['avatar', 'description', 'title']
+>(({ slots, children, ...props }) => {
+ return (
+ <>
+ <>{children}>
+ : props.avatar}
+ description={
+ slots.description ? (
+
+ ) : (
+ props.description
+ )
+ }
+ title={slots.title ? : props.title}
+ />
+ >
+ );
+});
+
+export default ListItemMeta;
diff --git a/frontend/antd/list/item/meta/package.json b/frontend/antd/list/item/meta/package.json
new file mode 100644
index 00000000..c6026085
--- /dev/null
+++ b/frontend/antd/list/item/meta/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-list.item.meta",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/list/item/package.json b/frontend/antd/list/item/package.json
new file mode 100644
index 00000000..e0c3deec
--- /dev/null
+++ b/frontend/antd/list/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-list.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/list/list.tsx b/frontend/antd/list/list.tsx
new file mode 100644
index 00000000..edc393b9
--- /dev/null
+++ b/frontend/antd/list/list.tsx
@@ -0,0 +1,22 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { type GetProps, List as AList } from 'antd';
+
+export const List = sveltify<
+ GetProps,
+ ['footer', 'header', 'loadMore']
+>(({ slots, ...props }) => {
+ return (
+ : props.footer}
+ header={slots.header ? : props.header}
+ loadMore={
+ slots.loadMore ? : props.loadMore
+ }
+ />
+ );
+});
+
+export default List;
diff --git a/frontend/antd/list/package.json b/frontend/antd/list/package.json
new file mode 100644
index 00000000..e0089d46
--- /dev/null
+++ b/frontend/antd/list/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-list",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/mentions/Index.svelte b/frontend/antd/mentions/Index.svelte
new file mode 100644
index 00000000..c0960c22
--- /dev/null
+++ b/frontend/antd/mentions/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedMentions then Mentions}
+ 0 ? $options : $children}
+ onValueChange={(v) => {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/mentions/context.ts b/frontend/antd/mentions/context.ts
new file mode 100644
index 00000000..4a5e0fcd
--- /dev/null
+++ b/frontend/antd/mentions/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('mentions');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/mentions/gradio.config.js b/frontend/antd/mentions/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/mentions/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/mentions/mentions.tsx b/frontend/antd/mentions/mentions.tsx
new file mode 100644
index 00000000..476d494c
--- /dev/null
+++ b/frontend/antd/mentions/mentions.tsx
@@ -0,0 +1,68 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Mentions as AMentions } from 'antd';
+
+import { type Item } from './context';
+
+export const Mentions = sveltify<
+ GetProps & {
+ optionItems: Item[];
+ onValueChange: (value: string) => void;
+ },
+ ['allowClear.clearIcon', 'notFoundContent']
+>(
+ ({
+ slots,
+ children,
+ onValueChange,
+ filterOption,
+ onChange,
+ options,
+ validateSearch,
+ optionItems,
+ getPopupContainer,
+ elRef,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const filterOptionFunction = useFunction(filterOption);
+ const validateSearchFunction = useFunction(validateSearch);
+ return (
+ <>
+ {children}
+
+ {
+ return (
+ options ||
+ renderItems<
+ NonNullable['options']>[number]
+ >(optionItems)
+ );
+ }, [optionItems, options])}
+ onChange={(v, ...args) => {
+ onChange?.(v, ...args);
+ onValueChange(v);
+ }}
+ validateSearch={validateSearchFunction}
+ notFoundContent={
+ slots.notFoundContent ? (
+
+ ) : (
+ props.notFoundContent
+ )
+ }
+ filterOption={filterOptionFunction || filterOption}
+ getPopupContainer={getPopupContainerFunction}
+ />
+ >
+ );
+ }
+);
+
+export default Mentions;
diff --git a/frontend/antd/mentions/option/Index.svelte b/frontend/antd/mentions/option/Index.svelte
new file mode 100644
index 00000000..53c14809
--- /dev/null
+++ b/frontend/antd/mentions/option/Index.svelte
@@ -0,0 +1,96 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/mentions/option/gradio.config.js b/frontend/antd/mentions/option/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/mentions/option/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/mentions/option/package.json b/frontend/antd/mentions/option/package.json
new file mode 100644
index 00000000..d13ba7fe
--- /dev/null
+++ b/frontend/antd/mentions/option/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-mentions.option",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/mentions/package.json b/frontend/antd/mentions/package.json
new file mode 100644
index 00000000..b9c3a6aa
--- /dev/null
+++ b/frontend/antd/mentions/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-mentions",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/menu/Index.svelte b/frontend/antd/menu/Index.svelte
new file mode 100644
index 00000000..21bea1d4
--- /dev/null
+++ b/frontend/antd/menu/Index.svelte
@@ -0,0 +1,92 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedMenu then Menu}
+ 0 ? $items : $children}
+ openKeys={$mergedProps.props.openKeys ||
+ $mergedProps.value?.open_keys ||
+ undefined}
+ selectedKeys={$mergedProps.props.selectedKeys ||
+ $mergedProps.value?.selected_keys ||
+ undefined}
+ onValueChange={({ openKeys, selectedKeys }) => {
+ value = {
+ open_keys: openKeys,
+ selected_keys: selectedKeys,
+ };
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/menu/context.ts b/frontend/antd/menu/context.ts
new file mode 100644
index 00000000..705eb792
--- /dev/null
+++ b/frontend/antd/menu/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('menu');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/menu/gradio.config.js b/frontend/antd/menu/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/menu/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/menu/item/Index.svelte b/frontend/antd/menu/item/Index.svelte
new file mode 100644
index 00000000..8c3d4f29
--- /dev/null
+++ b/frontend/antd/menu/item/Index.svelte
@@ -0,0 +1,89 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/menu/item/gradio.config.js b/frontend/antd/menu/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/menu/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/menu/item/package.json b/frontend/antd/menu/item/package.json
new file mode 100644
index 00000000..33a1b88d
--- /dev/null
+++ b/frontend/antd/menu/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-menu.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/menu/menu.tsx b/frontend/antd/menu/menu.tsx
new file mode 100644
index 00000000..52e77511
--- /dev/null
+++ b/frontend/antd/menu/menu.tsx
@@ -0,0 +1,82 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { omitUndefinedProps } from '@utils/omitUndefinedProps';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Menu as AMenu } from 'antd';
+import type { ItemType } from 'antd/es/menu/interface';
+
+import { type Item } from './context';
+
+export const Menu = sveltify<
+ GetProps & {
+ slotItems: Item[];
+ onValueChange: (options: {
+ openKeys: string[];
+ selectedKeys: string[];
+ }) => void;
+ },
+ ['expandIcon', 'overflowedIndicator']
+>(
+ ({
+ slots,
+ items,
+ slotItems,
+ children,
+ onValueChange,
+ onOpenChange,
+ onSelect,
+ onDeselect,
+ ...props
+ }) => {
+ return (
+ <>
+ {children}
+ {
+ onOpenChange?.(openKeys);
+ onValueChange?.({
+ openKeys,
+ selectedKeys: props.selectedKeys || [],
+ });
+ }}
+ onSelect={(e) => {
+ onSelect?.(e);
+ onValueChange?.({
+ openKeys: props.openKeys || [],
+ selectedKeys: e.selectedKeys,
+ });
+ }}
+ onDeselect={(e) => {
+ onDeselect?.(e);
+ onValueChange?.({
+ openKeys: props.openKeys || [],
+ selectedKeys: e.selectedKeys,
+ });
+ }}
+ items={useMemo(() => {
+ // ['label','icon',"title"]
+ return items || renderItems(slotItems);
+ }, [items, slotItems])}
+ expandIcon={
+ slots.expandIcon ? (
+
+ ) : (
+ props.expandIcon
+ )
+ }
+ overflowedIndicator={
+ slots.overflowedIndicator ? (
+
+ ) : (
+ props.overflowedIndicator
+ )
+ }
+ />
+ >
+ );
+ }
+);
+
+export default Menu;
diff --git a/frontend/antd/menu/package.json b/frontend/antd/menu/package.json
new file mode 100644
index 00000000..5e214f27
--- /dev/null
+++ b/frontend/antd/menu/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-menu",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/message/Index.svelte b/frontend/antd/message/Index.svelte
new file mode 100644
index 00000000..d4be934d
--- /dev/null
+++ b/frontend/antd/message/Index.svelte
@@ -0,0 +1,77 @@
+
+
+
+
+{#await AwaitedMessage then Message}
+ {
+ visible = v;
+ }}
+ >
+
+
+{/await}
+
+
diff --git a/frontend/antd/message/gradio.config.js b/frontend/antd/message/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/message/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/message/message.tsx b/frontend/antd/message/message.tsx
new file mode 100644
index 00000000..87ec1b48
--- /dev/null
+++ b/frontend/antd/message/message.tsx
@@ -0,0 +1,49 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useEffect } from 'react';
+import { message } from 'antd';
+import { type ArgsProps } from 'antd/es/message';
+
+export const Message = sveltify<
+ ArgsProps & {
+ children?: React.ReactNode;
+ visible?: boolean;
+ onVisible?: (visible: boolean) => void;
+ },
+ ['content', 'icon']
+>(({ slots, children, visible, onVisible, onClose, ...props }) => {
+ const [messageApi, contextHolder] = message.useMessage();
+
+ useEffect(() => {
+ if (visible) {
+ messageApi.open({
+ ...props,
+ icon: slots.icon ? : props.icon,
+ content: slots.content ? (
+
+ ) : (
+ props.content
+ ),
+ onClose(...args) {
+ onVisible?.(false);
+ onClose?.(...args);
+ },
+ });
+ } else {
+ messageApi.destroy(props.key);
+ }
+
+ return () => {
+ messageApi.destroy(props.key);
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [visible]);
+ return (
+ <>
+ {children}
+ {contextHolder}
+ >
+ );
+});
+
+export default Message;
diff --git a/frontend/antd/message/package.json b/frontend/antd/message/package.json
new file mode 100644
index 00000000..cc6bf505
--- /dev/null
+++ b/frontend/antd/message/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-message",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/modal/Index.svelte b/frontend/antd/modal/Index.svelte
new file mode 100644
index 00000000..29ed29c8
--- /dev/null
+++ b/frontend/antd/modal/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedModal then Modal}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/modal/gradio.config.js b/frontend/antd/modal/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/modal/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/modal/modal.tsx b/frontend/antd/modal/modal.tsx
new file mode 100644
index 00000000..cb22905d
--- /dev/null
+++ b/frontend/antd/modal/modal.tsx
@@ -0,0 +1,90 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Modal as AModal } from 'antd';
+
+export const Modal = sveltify<
+ GetProps,
+ [
+ 'cancelButtonProps.icon',
+ 'cancelText',
+ 'closable.closeIcon',
+ 'closeIcon',
+ 'footer',
+ 'title',
+ 'okButtonProps.icon',
+ 'okText',
+ ]
+>(
+ ({
+ slots,
+ afterClose,
+ afterOpenChange,
+ getContainer,
+ children,
+ modalRender,
+ ...props
+ }) => {
+ const afterOpenChangeFunction = useFunction(afterOpenChange);
+ const afterCloseFunction = useFunction(afterClose);
+ const getContainerFunction = useFunction(getContainer);
+ const modalRenderFunction = useFunction(modalRender);
+ return (
+ : props.okText}
+ okButtonProps={{
+ ...(props.okButtonProps || {}),
+ icon: slots['okButtonProps.icon'] ? (
+
+ ) : (
+ props.okButtonProps?.icon
+ ),
+ }}
+ cancelText={
+ slots.cancelText ? (
+
+ ) : (
+ props.cancelText
+ )
+ }
+ cancelButtonProps={{
+ ...(props.cancelButtonProps || {}),
+ icon: slots['cancelButtonProps.icon'] ? (
+
+ ) : (
+ props.cancelButtonProps?.icon
+ ),
+ }}
+ closable={
+ slots['closable.closeIcon']
+ ? {
+ ...(typeof props.closable === 'object' ? props.closable : {}),
+ closeIcon: ,
+ }
+ : props.closable
+ }
+ closeIcon={
+ slots.closeIcon ? (
+
+ ) : (
+ props.closeIcon
+ )
+ }
+ footer={slots.footer ? : props.footer}
+ title={slots.title ? : props.title}
+ modalRender={modalRenderFunction}
+ getContainer={
+ typeof getContainer === 'string' ? getContainerFunction : getContainer
+ }
+ >
+ {children}
+
+ );
+ }
+);
+
+export default Modal;
diff --git a/frontend/antd/modal/package.json b/frontend/antd/modal/package.json
new file mode 100644
index 00000000..e1502012
--- /dev/null
+++ b/frontend/antd/modal/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-modal",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/notification/Index.svelte b/frontend/antd/notification/Index.svelte
new file mode 100644
index 00000000..a69c1e4b
--- /dev/null
+++ b/frontend/antd/notification/Index.svelte
@@ -0,0 +1,77 @@
+
+
+
+
+{#await AwaitedNotification then Notification}
+ {
+ visible = v;
+ }}
+ >
+
+
+{/await}
+
+
diff --git a/frontend/antd/notification/gradio.config.js b/frontend/antd/notification/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/notification/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/notification/notification.tsx b/frontend/antd/notification/notification.tsx
new file mode 100644
index 00000000..8f61da89
--- /dev/null
+++ b/frontend/antd/notification/notification.tsx
@@ -0,0 +1,82 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useEffect } from 'react';
+import { notification } from 'antd';
+import { type ArgsProps } from 'antd/es/notification';
+import type { NotificationConfig } from 'antd/es/notification/interface';
+
+export const Notification = sveltify<
+ ArgsProps &
+ NotificationConfig & {
+ children?: React.ReactNode;
+ visible?: boolean;
+ onVisible?: (visible: boolean) => void;
+ },
+ ['btn', 'closeIcon', 'description', 'icon', 'message']
+>(
+ ({
+ slots,
+ bottom,
+ rtl,
+ stack,
+ top,
+ maxCount,
+ children,
+ visible,
+ onClose,
+ onVisible,
+ ...props
+ }) => {
+ const [notificationApi, contextHolder] = notification.useNotification({
+ bottom,
+ rtl,
+ stack,
+ top,
+ maxCount,
+ });
+
+ useEffect(() => {
+ if (visible) {
+ notificationApi.open({
+ ...props,
+ btn: slots.btn ? : props.btn,
+ closeIcon: slots['closeIcon'] ? (
+
+ ) : (
+ props.closeIcon
+ ),
+ description: slots.description ? (
+
+ ) : (
+ props.description
+ ),
+ message: slots.message ? (
+
+ ) : (
+ props.message
+ ),
+ icon: slots.icon ? : props.icon,
+ onClose(...args) {
+ onVisible?.(false);
+ onClose?.(...args);
+ },
+ });
+ } else {
+ notificationApi.destroy(props.key);
+ }
+
+ return () => {
+ notificationApi.destroy(props.key);
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [visible]);
+ return (
+ <>
+ {children}
+ {contextHolder}
+ >
+ );
+ }
+);
+
+export default Notification;
diff --git a/frontend/antd/notification/package.json b/frontend/antd/notification/package.json
new file mode 100644
index 00000000..808605ab
--- /dev/null
+++ b/frontend/antd/notification/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-notification",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/pagination/Index.svelte b/frontend/antd/pagination/Index.svelte
new file mode 100644
index 00000000..87e8eb28
--- /dev/null
+++ b/frontend/antd/pagination/Index.svelte
@@ -0,0 +1,88 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedPagination then Pagination}
+ {
+ value = {
+ page,
+ page_size: pageSize,
+ };
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/pagination/gradio.config.js b/frontend/antd/pagination/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/pagination/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/pagination/package.json b/frontend/antd/pagination/package.json
new file mode 100644
index 00000000..c641fb97
--- /dev/null
+++ b/frontend/antd/pagination/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-pagination",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/pagination/pagination.tsx b/frontend/antd/pagination/pagination.tsx
new file mode 100644
index 00000000..157d340d
--- /dev/null
+++ b/frontend/antd/pagination/pagination.tsx
@@ -0,0 +1,44 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Pagination as APagination } from 'antd';
+
+export const Pagination = sveltify<
+ GetProps & {
+ onValueChange: (page: number, pageSize: number) => void;
+ },
+ ['showQuickJumper.goButton']
+>(
+ ({
+ slots,
+ onValueChange,
+ showTotal,
+ showQuickJumper,
+ onChange,
+ ...props
+ }) => {
+ const showTotalFunction = useFunction(showTotal);
+ return (
+ {
+ onValueChange(page, pageSize);
+ onChange?.(page, pageSize);
+ }}
+ showQuickJumper={
+ slots['showQuickJumper.goButton']
+ ? {
+ goButton: (
+
+ ),
+ }
+ : showQuickJumper
+ }
+ />
+ );
+ }
+);
+
+export default Pagination;
diff --git a/frontend/antd/popconfirm/Index.svelte b/frontend/antd/popconfirm/Index.svelte
new file mode 100644
index 00000000..4daa63f2
--- /dev/null
+++ b/frontend/antd/popconfirm/Index.svelte
@@ -0,0 +1,73 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedPopconfirm then Popconfirm}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/popconfirm/gradio.config.js b/frontend/antd/popconfirm/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/popconfirm/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/popconfirm/package.json b/frontend/antd/popconfirm/package.json
new file mode 100644
index 00000000..779a5b6a
--- /dev/null
+++ b/frontend/antd/popconfirm/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-popconfirm",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/popconfirm/popconfirm.tsx b/frontend/antd/popconfirm/popconfirm.tsx
new file mode 100644
index 00000000..a1708592
--- /dev/null
+++ b/frontend/antd/popconfirm/popconfirm.tsx
@@ -0,0 +1,64 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Popconfirm as APopconfirm } from 'antd';
+
+export const Popconfirm = sveltify<
+ GetProps,
+ [
+ 'title',
+ 'cancelButtonProps.icon',
+ 'cancelText',
+ 'description',
+ 'okButtonProps.icon',
+ 'okText',
+ ]
+>(({ slots, afterOpenChange, getPopupContainer, children, ...props }) => {
+ const afterOpenChangeFunction = useFunction(afterOpenChange);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+
+ return (
+ : props.okText}
+ okButtonProps={{
+ ...(props.okButtonProps || {}),
+ icon: slots['okButtonProps.icon'] ? (
+
+ ) : (
+ props.okButtonProps?.icon
+ ),
+ }}
+ cancelText={
+ slots.cancelText ? (
+
+ ) : (
+ props.cancelText
+ )
+ }
+ cancelButtonProps={{
+ ...(props.cancelButtonProps || {}),
+ icon: slots['cancelButtonProps.icon'] ? (
+
+ ) : (
+ props.cancelButtonProps?.icon
+ ),
+ }}
+ title={slots.title ? : props.title}
+ description={
+ slots.description ? (
+
+ ) : (
+ props.description
+ )
+ }
+ >
+ {children}
+
+ );
+});
+
+export default Popconfirm;
diff --git a/frontend/antd/popover/Index.svelte b/frontend/antd/popover/Index.svelte
new file mode 100644
index 00000000..86bc38da
--- /dev/null
+++ b/frontend/antd/popover/Index.svelte
@@ -0,0 +1,72 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedPopover then Popover}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/popover/gradio.config.js b/frontend/antd/popover/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/popover/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/popover/package.json b/frontend/antd/popover/package.json
new file mode 100644
index 00000000..80623128
--- /dev/null
+++ b/frontend/antd/popover/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-popover",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/popover/popover.tsx b/frontend/antd/popover/popover.tsx
new file mode 100644
index 00000000..f9fb0341
--- /dev/null
+++ b/frontend/antd/popover/popover.tsx
@@ -0,0 +1,30 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Popover as APopover } from 'antd';
+
+export const Popover = sveltify<
+ GetProps,
+ ['title', 'content']
+>(({ slots, afterOpenChange, getPopupContainer, children, ...props }) => {
+ const afterOpenChangeFunction = useFunction(afterOpenChange);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ return (
+ <>
+ : props.title}
+ content={
+ slots.content ? : props.content
+ }
+ >
+ {children}
+
+ >
+ );
+});
+
+export default Popover;
diff --git a/frontend/antd/progress/Index.svelte b/frontend/antd/progress/Index.svelte
new file mode 100644
index 00000000..38ce000d
--- /dev/null
+++ b/frontend/antd/progress/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedProgress then Progress}
+
+ {/await}
+{/if}
diff --git a/frontend/antd/progress/gradio.config.js b/frontend/antd/progress/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/progress/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/progress/package.json b/frontend/antd/progress/package.json
new file mode 100644
index 00000000..36d6abcd
--- /dev/null
+++ b/frontend/antd/progress/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-progress",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/progress/progress.tsx b/frontend/antd/progress/progress.tsx
new file mode 100644
index 00000000..36c31aba
--- /dev/null
+++ b/frontend/antd/progress/progress.tsx
@@ -0,0 +1,12 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Progress as AProgress } from 'antd';
+
+export const Progress = sveltify>(
+ ({ format, ...props }) => {
+ const formatFunction = useFunction(format);
+ return ;
+ }
+);
+
+export default Progress;
diff --git a/frontend/antd/qr-code/Index.svelte b/frontend/antd/qr-code/Index.svelte
new file mode 100644
index 00000000..3b205e3a
--- /dev/null
+++ b/frontend/antd/qr-code/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedQRCode then QRCode}
+
+ {/await}
+{/if}
diff --git a/frontend/antd/qr-code/gradio.config.js b/frontend/antd/qr-code/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/qr-code/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/qr-code/package.json b/frontend/antd/qr-code/package.json
new file mode 100644
index 00000000..ec3a9ac6
--- /dev/null
+++ b/frontend/antd/qr-code/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-qr-code",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/qr-code/qr-code.tsx b/frontend/antd/qr-code/qr-code.tsx
new file mode 100644
index 00000000..16cc6789
--- /dev/null
+++ b/frontend/antd/qr-code/qr-code.tsx
@@ -0,0 +1,8 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, QRCode as AQRCode } from 'antd';
+
+export const QRCode = sveltify>(({ ...props }) => {
+ return ;
+});
+
+export default QRCode;
diff --git a/frontend/antd/radio/Index.svelte b/frontend/antd/radio/Index.svelte
new file mode 100644
index 00000000..03a6db7a
--- /dev/null
+++ b/frontend/antd/radio/Index.svelte
@@ -0,0 +1,89 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedRadio then Radio}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/radio/button/Index.svelte b/frontend/antd/radio/button/Index.svelte
new file mode 100644
index 00000000..21ee337f
--- /dev/null
+++ b/frontend/antd/radio/button/Index.svelte
@@ -0,0 +1,89 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedRadioButton then RadioButton}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/radio/button/gradio.config.js b/frontend/antd/radio/button/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/radio/button/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/radio/button/package.json b/frontend/antd/radio/button/package.json
new file mode 100644
index 00000000..65537416
--- /dev/null
+++ b/frontend/antd/radio/button/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-radio.button",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/radio/button/radio.button.tsx b/frontend/antd/radio/button/radio.button.tsx
new file mode 100644
index 00000000..e69adbbf
--- /dev/null
+++ b/frontend/antd/radio/button/radio.button.tsx
@@ -0,0 +1,29 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Radio as ARadio, theme } from 'antd';
+
+export const Radio = sveltify<
+ GetProps & {
+ onValueChange: (value: boolean) => void;
+ }
+>(({ onValueChange, onChange, elRef, style, ...props }) => {
+ const { token } = theme.useToken();
+
+ return (
+ {
+ onChange?.(e);
+ onValueChange(e.target.checked);
+ }}
+ />
+ );
+});
+
+export default Radio;
diff --git a/frontend/antd/radio/context.ts b/frontend/antd/radio/context.ts
new file mode 100644
index 00000000..10e92743
--- /dev/null
+++ b/frontend/antd/radio/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('radio-group');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/radio/gradio.config.js b/frontend/antd/radio/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/radio/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/radio/group/Index.svelte b/frontend/antd/radio/group/Index.svelte
new file mode 100644
index 00000000..05efeaea
--- /dev/null
+++ b/frontend/antd/radio/group/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedRadioGroup then RadioGroup}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/radio/group/gradio.config.js b/frontend/antd/radio/group/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/radio/group/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/radio/group/option/Index.svelte b/frontend/antd/radio/group/option/Index.svelte
new file mode 100644
index 00000000..d796b37c
--- /dev/null
+++ b/frontend/antd/radio/group/option/Index.svelte
@@ -0,0 +1,100 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/radio/group/option/gradio.config.js b/frontend/antd/radio/group/option/gradio.config.js
new file mode 100644
index 00000000..7b2fe8dd
--- /dev/null
+++ b/frontend/antd/radio/group/option/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/radio/group/option/package.json b/frontend/antd/radio/group/option/package.json
new file mode 100644
index 00000000..e4177891
--- /dev/null
+++ b/frontend/antd/radio/group/option/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-radio.group.option",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/radio/group/package.json b/frontend/antd/radio/group/package.json
new file mode 100644
index 00000000..fca9d782
--- /dev/null
+++ b/frontend/antd/radio/group/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-radio.group",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/radio/group/radio.group.less b/frontend/antd/radio/group/radio.group.less
new file mode 100644
index 00000000..d9a16208
--- /dev/null
+++ b/frontend/antd/radio/group/radio.group.less
@@ -0,0 +1,20 @@
+.ms-gr-antd-container {
+ .ms-gr-antd-radio-group {
+ react-portal-target {
+ &:not(:first-child) {
+ .ms-gr-antd-radio-button {
+ border-start-start-radius: 0;
+ border-end-start-radius: 0;
+ margin-inline-start: calc(var(--ms-gr-antd-line-width) * -1);
+ }
+ }
+
+ &:not(:last-child) {
+ .ms-gr-antd-radio-button {
+ border-start-end-radius: 0;
+ border-end-end-radius: 0;
+ }
+ }
+ }
+ }
+}
diff --git a/frontend/antd/radio/group/radio.group.tsx b/frontend/antd/radio/group/radio.group.tsx
new file mode 100644
index 00000000..7cf02e4b
--- /dev/null
+++ b/frontend/antd/radio/group/radio.group.tsx
@@ -0,0 +1,53 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { FormItemContext } from '@svelte-preprocess-react/context';
+import { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Radio as ARadio } from 'antd';
+
+import { type Item } from '../context';
+
+import './radio.group.less';
+
+export const RadioGroup = sveltify<
+ GetProps & {
+ onValueChange: (value: any) => void;
+ optionItems: Item[];
+ }
+>(
+ ({
+ onValueChange,
+ onChange,
+ elRef,
+ optionItems,
+ options,
+ children,
+ ...props
+ }) => {
+ return (
+ <>
+ {
+ return (
+ options ||
+ renderItems<
+ NonNullable['options']>[number]
+ >(optionItems)
+ );
+ }, [optionItems, options])}
+ onChange={(e) => {
+ onChange?.(e);
+ onValueChange(e.target.value);
+ }}
+ >
+
+ {children}
+
+
+ >
+ );
+ }
+);
+
+export default RadioGroup;
diff --git a/frontend/antd/radio/package.json b/frontend/antd/radio/package.json
new file mode 100644
index 00000000..321b924b
--- /dev/null
+++ b/frontend/antd/radio/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-radio",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/radio/radio.tsx b/frontend/antd/radio/radio.tsx
new file mode 100644
index 00000000..2ab5345c
--- /dev/null
+++ b/frontend/antd/radio/radio.tsx
@@ -0,0 +1,21 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Radio as ARadio } from 'antd';
+
+export const Radio = sveltify<
+ GetProps & {
+ onValueChange: (value: boolean) => void;
+ }
+>(({ onValueChange, onChange, elRef, ...props }) => {
+ return (
+ {
+ onChange?.(e);
+ onValueChange(e.target.checked);
+ }}
+ />
+ );
+});
+
+export default Radio;
diff --git a/frontend/antd/rate/Index.svelte b/frontend/antd/rate/Index.svelte
new file mode 100644
index 00000000..a21646e6
--- /dev/null
+++ b/frontend/antd/rate/Index.svelte
@@ -0,0 +1,76 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedRate then Rate}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/rate/gradio.config.js b/frontend/antd/rate/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/rate/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/rate/package.json b/frontend/antd/rate/package.json
new file mode 100644
index 00000000..ee244ab8
--- /dev/null
+++ b/frontend/antd/rate/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-rate",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/rate/rate.tsx b/frontend/antd/rate/rate.tsx
new file mode 100644
index 00000000..0e75da25
--- /dev/null
+++ b/frontend/antd/rate/rate.tsx
@@ -0,0 +1,40 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { type GetProps, Rate as ARate } from 'antd';
+
+export const Rate = sveltify<
+ GetProps & {
+ onValueChange: (value: number) => void;
+ children?: React.ReactNode;
+ },
+ ['character']
+>(
+ ({
+ slots,
+ children,
+ onValueChange,
+ character,
+ onChange,
+ elRef,
+ ...props
+ }) => {
+ return (
+ <>
+ {children}
+ {
+ onChange?.(v);
+ onValueChange(v);
+ }}
+ character={
+ slots.character ? : character
+ }
+ />
+ >
+ );
+ }
+);
+
+export default Rate;
diff --git a/frontend/antd/result/Index.svelte b/frontend/antd/result/Index.svelte
new file mode 100644
index 00000000..bbb63de6
--- /dev/null
+++ b/frontend/antd/result/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedResult then Result}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/result/gradio.config.js b/frontend/antd/result/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/result/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/result/package.json b/frontend/antd/result/package.json
new file mode 100644
index 00000000..d115d7f2
--- /dev/null
+++ b/frontend/antd/result/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-result",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/result/result.tsx b/frontend/antd/result/result.tsx
new file mode 100644
index 00000000..e2ea9c5a
--- /dev/null
+++ b/frontend/antd/result/result.tsx
@@ -0,0 +1,23 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { type GetProps, Result as AResult } from 'antd';
+
+export const Result = sveltify<
+ GetProps,
+ ['extra', 'icon', 'subTitle', 'title']
+>(({ slots, ...props }) => {
+ return (
+ : props.extra}
+ icon={slots.icon ? : props.icon}
+ subTitle={
+ slots.subTitle ? : props.subTitle
+ }
+ title={slots.title ? : props.title}
+ />
+ );
+});
+
+export default Result;
diff --git a/frontend/antd/segmented/Index.svelte b/frontend/antd/segmented/Index.svelte
new file mode 100644
index 00000000..6217cc75
--- /dev/null
+++ b/frontend/antd/segmented/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSegmented then Segmented}
+ 0 ? $options : $children}
+ onValueChange={(v) => {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/segmented/context.ts b/frontend/antd/segmented/context.ts
new file mode 100644
index 00000000..cc4a8e3c
--- /dev/null
+++ b/frontend/antd/segmented/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('segmented');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/segmented/gradio.config.js b/frontend/antd/segmented/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/segmented/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/segmented/option/Index.svelte b/frontend/antd/segmented/option/Index.svelte
new file mode 100644
index 00000000..d178dade
--- /dev/null
+++ b/frontend/antd/segmented/option/Index.svelte
@@ -0,0 +1,81 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/segmented/option/gradio.config.js b/frontend/antd/segmented/option/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/segmented/option/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/segmented/option/package.json b/frontend/antd/segmented/option/package.json
new file mode 100644
index 00000000..50ce1ac8
--- /dev/null
+++ b/frontend/antd/segmented/option/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-segmented.option",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/segmented/package.json b/frontend/antd/segmented/package.json
new file mode 100644
index 00000000..ec3a9ac6
--- /dev/null
+++ b/frontend/antd/segmented/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-qr-code",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/segmented/segmented.tsx b/frontend/antd/segmented/segmented.tsx
new file mode 100644
index 00000000..f521f14f
--- /dev/null
+++ b/frontend/antd/segmented/segmented.tsx
@@ -0,0 +1,35 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Segmented as ASegmented } from 'antd';
+
+import type { Item } from './context';
+
+type SegmentedProps = GetProps;
+export const Segmented = sveltify<
+ SegmentedProps & {
+ slotItems: Item[];
+ onValueChange: (value: string | number) => void;
+ }
+>(({ slotItems, options, onChange, onValueChange, children, ...props }) => {
+ return (
+ <>
+ {children}
+ {
+ onChange?.(v);
+ onValueChange(v as string | number);
+ }}
+ options={useMemo(() => {
+ // ['label','icon']
+ return (
+ options || renderItems(slotItems)
+ );
+ }, [options, slotItems])}
+ />
+ >
+ );
+});
+
+export default Segmented;
diff --git a/frontend/antd/select/Index.svelte b/frontend/antd/select/Index.svelte
new file mode 100644
index 00000000..e8862057
--- /dev/null
+++ b/frontend/antd/select/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSelect then Select}
+ 0 ? $options : $children}
+ onValueChange={(v) => {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/select/context.ts b/frontend/antd/select/context.ts
new file mode 100644
index 00000000..3849fc4d
--- /dev/null
+++ b/frontend/antd/select/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('select');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/select/gradio.config.js b/frontend/antd/select/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/select/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/select/option/Index.svelte b/frontend/antd/select/option/Index.svelte
new file mode 100644
index 00000000..1dde92fa
--- /dev/null
+++ b/frontend/antd/select/option/Index.svelte
@@ -0,0 +1,100 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/select/option/gradio.config.js b/frontend/antd/select/option/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/select/option/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/select/option/package.json b/frontend/antd/select/option/package.json
new file mode 100644
index 00000000..a64270e2
--- /dev/null
+++ b/frontend/antd/select/option/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-select.option",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/select/package.json b/frontend/antd/select/package.json
new file mode 100644
index 00000000..b7cc7b34
--- /dev/null
+++ b/frontend/antd/select/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-select",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/select/select.tsx b/frontend/antd/select/select.tsx
new file mode 100644
index 00000000..a86b913f
--- /dev/null
+++ b/frontend/antd/select/select.tsx
@@ -0,0 +1,128 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Select as ASelect } from 'antd';
+
+import { type Item } from './context';
+
+export const Select = sveltify<
+ GetProps & {
+ optionItems: Item[];
+ onValueChange: (value: string | number | (string | number)[]) => void;
+ },
+ [
+ 'allowClear.clearIcon',
+ 'maxTagPlaceholder',
+ 'menuItemSelectedIcon',
+ 'notFoundContent',
+ 'removeIcon',
+ 'suffixIcon',
+ ]
+>(
+ ({
+ slots,
+ children,
+ onValueChange,
+ filterOption,
+ onChange,
+ options,
+ optionItems,
+ getPopupContainer,
+ dropdownRender,
+ optionRender,
+ tagRender,
+ labelRender,
+ filterSort,
+ maxTagPlaceholder,
+ elRef,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const filterOptionFunction = useFunction(filterOption);
+ const dropdownRenderFunction = useFunction(dropdownRender);
+ const filterSortFunction = useFunction(filterSort);
+ const optionRenderFunction = useFunction(optionRender);
+ const tagRenderFunction = useFunction(tagRender);
+ const labelRenderFunction = useFunction(labelRender);
+ const maxTagPlaceholderFunction = useFunction(maxTagPlaceholder);
+ return (
+ <>
+ {children}
+
+ {
+ return (
+ options ||
+ renderItems<
+ NonNullable['options']>[number]
+ >(optionItems, {
+ children: 'options',
+ clone: true,
+ })
+ );
+ }, [optionItems, options])}
+ onChange={(v, ...args) => {
+ onChange?.(v, ...args);
+ onValueChange(v as string);
+ }}
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ removeIcon={
+ slots.removeIcon ? (
+
+ ) : (
+ props.removeIcon
+ )
+ }
+ suffixIcon={
+ slots.suffixIcon ? (
+
+ ) : (
+ props.suffixIcon
+ )
+ }
+ notFoundContent={
+ slots.notFoundContent ? (
+
+ ) : (
+ props.notFoundContent
+ )
+ }
+ menuItemSelectedIcon={
+ slots['menuItemSelectedIcon'] ? (
+
+ ) : (
+ props.menuItemSelectedIcon
+ )
+ }
+ filterOption={filterOptionFunction || filterOption}
+ maxTagPlaceholder={
+ maxTagPlaceholderFunction ||
+ (slots.maxTagPlaceholder ? (
+
+ ) : (
+ maxTagPlaceholder
+ ))
+ }
+ getPopupContainer={getPopupContainerFunction}
+ dropdownRender={dropdownRenderFunction}
+ optionRender={optionRenderFunction}
+ tagRender={tagRenderFunction}
+ labelRender={labelRenderFunction}
+ filterSort={filterSortFunction}
+ />
+ >
+ );
+ }
+);
+
+export default Select;
diff --git a/frontend/antd/skeleton/Index.svelte b/frontend/antd/skeleton/Index.svelte
new file mode 100644
index 00000000..46162370
--- /dev/null
+++ b/frontend/antd/skeleton/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSkeleton then Skeleton}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/skeleton/avatar/Index.svelte b/frontend/antd/skeleton/avatar/Index.svelte
new file mode 100644
index 00000000..8efd35e6
--- /dev/null
+++ b/frontend/antd/skeleton/avatar/Index.svelte
@@ -0,0 +1,72 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSkeletonAvatar then SkeletonAvatar}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/skeleton/avatar/gradio.config.js b/frontend/antd/skeleton/avatar/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/skeleton/avatar/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/skeleton/avatar/package.json b/frontend/antd/skeleton/avatar/package.json
new file mode 100644
index 00000000..87906742
--- /dev/null
+++ b/frontend/antd/skeleton/avatar/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-skeleton.avatar",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/skeleton/avatar/skeleton.avatar.tsx b/frontend/antd/skeleton/avatar/skeleton.avatar.tsx
new file mode 100644
index 00000000..eca73bfb
--- /dev/null
+++ b/frontend/antd/skeleton/avatar/skeleton.avatar.tsx
@@ -0,0 +1,8 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Skeleton as ASkeleton } from 'antd';
+
+export const SkeletonAvatar = sveltify>(
+ ASkeleton.Avatar
+);
+
+export default SkeletonAvatar;
diff --git a/frontend/antd/skeleton/button/Index.svelte b/frontend/antd/skeleton/button/Index.svelte
new file mode 100644
index 00000000..a5f4ad74
--- /dev/null
+++ b/frontend/antd/skeleton/button/Index.svelte
@@ -0,0 +1,72 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSkeletonButton then SkeletonButton}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/skeleton/button/gradio.config.js b/frontend/antd/skeleton/button/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/skeleton/button/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/skeleton/button/package.json b/frontend/antd/skeleton/button/package.json
new file mode 100644
index 00000000..ebe408ac
--- /dev/null
+++ b/frontend/antd/skeleton/button/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-skeleton.button",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/skeleton/button/skeleton.button.tsx b/frontend/antd/skeleton/button/skeleton.button.tsx
new file mode 100644
index 00000000..085804e3
--- /dev/null
+++ b/frontend/antd/skeleton/button/skeleton.button.tsx
@@ -0,0 +1,8 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Skeleton as ASkeleton } from 'antd';
+
+export const SkeletonButton = sveltify>(
+ ASkeleton.Button
+);
+
+export default SkeletonButton;
diff --git a/frontend/antd/skeleton/gradio.config.js b/frontend/antd/skeleton/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/skeleton/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/skeleton/image/Index.svelte b/frontend/antd/skeleton/image/Index.svelte
new file mode 100644
index 00000000..e419a72c
--- /dev/null
+++ b/frontend/antd/skeleton/image/Index.svelte
@@ -0,0 +1,72 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSkeletonImage then SkeletonImage}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/skeleton/image/gradio.config.js b/frontend/antd/skeleton/image/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/skeleton/image/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/skeleton/image/package.json b/frontend/antd/skeleton/image/package.json
new file mode 100644
index 00000000..aa15f18c
--- /dev/null
+++ b/frontend/antd/skeleton/image/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-skeleton.image",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/skeleton/image/skeleton.image.tsx b/frontend/antd/skeleton/image/skeleton.image.tsx
new file mode 100644
index 00000000..30ca59f3
--- /dev/null
+++ b/frontend/antd/skeleton/image/skeleton.image.tsx
@@ -0,0 +1,8 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Skeleton as ASkeleton } from 'antd';
+
+export const SkeletonImage = sveltify>(
+ ASkeleton.Image
+);
+
+export default SkeletonImage;
diff --git a/frontend/antd/skeleton/input/Index.svelte b/frontend/antd/skeleton/input/Index.svelte
new file mode 100644
index 00000000..b5b45aa0
--- /dev/null
+++ b/frontend/antd/skeleton/input/Index.svelte
@@ -0,0 +1,72 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSkeletonInput then SkeletonNodeInput}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/skeleton/input/gradio.config.js b/frontend/antd/skeleton/input/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/skeleton/input/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/skeleton/input/package.json b/frontend/antd/skeleton/input/package.json
new file mode 100644
index 00000000..767560d0
--- /dev/null
+++ b/frontend/antd/skeleton/input/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-skeleton.input",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/skeleton/input/skeleton.input.tsx b/frontend/antd/skeleton/input/skeleton.input.tsx
new file mode 100644
index 00000000..e0a760d4
--- /dev/null
+++ b/frontend/antd/skeleton/input/skeleton.input.tsx
@@ -0,0 +1,8 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Skeleton as ASkeleton } from 'antd';
+
+export const SkeletonInput = sveltify>(
+ ASkeleton.Input
+);
+
+export default SkeletonInput;
diff --git a/frontend/antd/skeleton/node/Index.svelte b/frontend/antd/skeleton/node/Index.svelte
new file mode 100644
index 00000000..834903c3
--- /dev/null
+++ b/frontend/antd/skeleton/node/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSkeletonNode then SkeletonNode}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/skeleton/node/gradio.config.js b/frontend/antd/skeleton/node/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/skeleton/node/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/skeleton/node/package.json b/frontend/antd/skeleton/node/package.json
new file mode 100644
index 00000000..29ece7a5
--- /dev/null
+++ b/frontend/antd/skeleton/node/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-skeleton.node",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/skeleton/node/skeleton.node.tsx b/frontend/antd/skeleton/node/skeleton.node.tsx
new file mode 100644
index 00000000..7197790e
--- /dev/null
+++ b/frontend/antd/skeleton/node/skeleton.node.tsx
@@ -0,0 +1,8 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Skeleton as ASkeleton } from 'antd';
+
+export const SkeletonNode = sveltify>(
+ ASkeleton.Node
+);
+
+export default SkeletonNode;
diff --git a/frontend/antd/skeleton/package.json b/frontend/antd/skeleton/package.json
new file mode 100644
index 00000000..ca4cf545
--- /dev/null
+++ b/frontend/antd/skeleton/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-skeleton",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/skeleton/skeleton.tsx b/frontend/antd/skeleton/skeleton.tsx
new file mode 100644
index 00000000..4afebe9a
--- /dev/null
+++ b/frontend/antd/skeleton/skeleton.tsx
@@ -0,0 +1,6 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Skeleton as ASkeleton } from 'antd';
+
+export const Skeleton = sveltify>(ASkeleton);
+
+export default Skeleton;
diff --git a/frontend/antd/slider/Index.svelte b/frontend/antd/slider/Index.svelte
new file mode 100644
index 00000000..b1a7e082
--- /dev/null
+++ b/frontend/antd/slider/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSlider then Slider}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/slider/context.ts b/frontend/antd/slider/context.ts
new file mode 100644
index 00000000..15f4b3d8
--- /dev/null
+++ b/frontend/antd/slider/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('slider');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/slider/gradio.config.js b/frontend/antd/slider/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/slider/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/slider/mark/Index.svelte b/frontend/antd/slider/mark/Index.svelte
new file mode 100644
index 00000000..9611ffb2
--- /dev/null
+++ b/frontend/antd/slider/mark/Index.svelte
@@ -0,0 +1,91 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+
+{/if}
+
+
diff --git a/frontend/antd/slider/mark/gradio.config.js b/frontend/antd/slider/mark/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/slider/mark/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/slider/mark/package.json b/frontend/antd/slider/mark/package.json
new file mode 100644
index 00000000..86aea9ae
--- /dev/null
+++ b/frontend/antd/slider/mark/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-slider.mark",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/slider/package.json b/frontend/antd/slider/package.json
new file mode 100644
index 00000000..d91b64da
--- /dev/null
+++ b/frontend/antd/slider/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-slider",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/slider/slider.tsx b/frontend/antd/slider/slider.tsx
new file mode 100644
index 00000000..aba09f8b
--- /dev/null
+++ b/frontend/antd/slider/slider.tsx
@@ -0,0 +1,82 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Slider as ASlider } from 'antd';
+
+import { type Item } from './context';
+
+type SliderProps = GetProps;
+
+const renderMarks = (items: Item[]) => {
+ return items.reduce(
+ (acc, v) => {
+ const number = v?.props.number;
+ if (number !== undefined) {
+ acc[number] =
+ v?.slots.label instanceof Element ? (
+ {
+ ...v.props,
+ label: ,
+ }
+ ) : v?.slots.children instanceof Element ? (
+
+ ) : (
+ {
+ ...v?.props,
+ }
+ );
+ }
+ return acc;
+ },
+ {} as NonNullable
+ );
+};
+
+export const Slider = sveltify<
+ SliderProps & {
+ onValueChange: (value: number | number[]) => void;
+ children?: React.ReactNode;
+ markItems: Item[];
+ }
+>(
+ ({
+ marks,
+ markItems,
+ children,
+ onValueChange,
+ onChange,
+ elRef,
+ tooltip,
+ ...props
+ }) => {
+ const onSliderChange = (v: number | number[]) => {
+ onChange?.(v as any);
+ onValueChange(v);
+ };
+ const tooltipGetPopupContainerFunction = useFunction(
+ tooltip?.getPopupContainer
+ );
+ const tooltipFormatterFunction = useFunction(tooltip?.formatter);
+ return (
+ <>
+ {children}
+ {
+ return marks || renderMarks(markItems);
+ }, [markItems, marks])}
+ ref={elRef}
+ onChange={onSliderChange}
+ />
+ >
+ );
+ }
+);
+
+export default Slider;
diff --git a/frontend/antd/space/Index.svelte b/frontend/antd/space/Index.svelte
new file mode 100644
index 00000000..3800c6d4
--- /dev/null
+++ b/frontend/antd/space/Index.svelte
@@ -0,0 +1,69 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSpace then Space}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/space/compact/Index.svelte b/frontend/antd/space/compact/Index.svelte
new file mode 100644
index 00000000..82ab2ff6
--- /dev/null
+++ b/frontend/antd/space/compact/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSpaceCompact then SpaceCompact}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/space/compact/gradio.config.js b/frontend/antd/space/compact/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/space/compact/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/space/compact/package.json b/frontend/antd/space/compact/package.json
new file mode 100644
index 00000000..fbdec684
--- /dev/null
+++ b/frontend/antd/space/compact/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-space.compact",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/space/compact/space.compact.tsx b/frontend/antd/space/compact/space.compact.tsx
new file mode 100644
index 00000000..3e11b3f4
--- /dev/null
+++ b/frontend/antd/space/compact/space.compact.tsx
@@ -0,0 +1,23 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useTargets } from '@utils/hooks/useTargets';
+import { type GetProps, Space as ASpace } from 'antd';
+
+export const Space = sveltify>(
+ ({ children, ...props }) => {
+ const targets = useTargets(children);
+ return (
+ <>
+ {children}
+
+ {targets.map((target, index) => {
+ return ;
+ })}
+
+ >
+ );
+ }
+);
+
+export default Space;
diff --git a/frontend/antd/space/gradio.config.js b/frontend/antd/space/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/space/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/space/package.json b/frontend/antd/space/package.json
new file mode 100644
index 00000000..21fd6904
--- /dev/null
+++ b/frontend/antd/space/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-space",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/space/space.tsx b/frontend/antd/space/space.tsx
new file mode 100644
index 00000000..ed5e4993
--- /dev/null
+++ b/frontend/antd/space/space.tsx
@@ -0,0 +1,28 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useTargets } from '@utils/hooks/useTargets';
+import { type GetProps, Space as ASpace } from 'antd';
+
+export const Space = sveltify, ['split']>(
+ ({ slots, children, ...props }) => {
+ const targets = useTargets(children);
+ return (
+ <>
+ {children}
+ : props.split
+ }
+ >
+ {targets.map((target, index) => {
+ return ;
+ })}
+
+ >
+ );
+ }
+);
+
+export default Space;
diff --git a/frontend/antd/spin/Index.svelte b/frontend/antd/spin/Index.svelte
new file mode 100644
index 00000000..fa4ff962
--- /dev/null
+++ b/frontend/antd/spin/Index.svelte
@@ -0,0 +1,70 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSpin then Spin}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/spin/gradio.config.js b/frontend/antd/spin/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/spin/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/spin/package.json b/frontend/antd/spin/package.json
new file mode 100644
index 00000000..2e3a61fd
--- /dev/null
+++ b/frontend/antd/spin/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-spin",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/spin/spin.tsx b/frontend/antd/spin/spin.tsx
new file mode 100644
index 00000000..73d82845
--- /dev/null
+++ b/frontend/antd/spin/spin.tsx
@@ -0,0 +1,23 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { type GetProps, Spin as ASpin } from 'antd';
+
+export const Spin = sveltify<
+ GetProps & {
+ id?: string;
+ },
+ ['tip', 'indicator']
+>(({ slots, ...props }) => {
+ return (
+ : props.tip}
+ indicator={
+ slots.indicator ? : props.indicator
+ }
+ />
+ );
+});
+
+export default Spin;
diff --git a/frontend/antd/statistic/Index.svelte b/frontend/antd/statistic/Index.svelte
new file mode 100644
index 00000000..2b5dd01f
--- /dev/null
+++ b/frontend/antd/statistic/Index.svelte
@@ -0,0 +1,68 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedStatistic then Statistic}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/statistic/countdown/Index.svelte b/frontend/antd/statistic/countdown/Index.svelte
new file mode 100644
index 00000000..5bc8a7a9
--- /dev/null
+++ b/frontend/antd/statistic/countdown/Index.svelte
@@ -0,0 +1,73 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedStatisticCountdown then StatisticCountdown}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/statistic/countdown/gradio.config.js b/frontend/antd/statistic/countdown/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/statistic/countdown/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/statistic/countdown/package.json b/frontend/antd/statistic/countdown/package.json
new file mode 100644
index 00000000..aec187e6
--- /dev/null
+++ b/frontend/antd/statistic/countdown/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-statistic.countdown",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/statistic/countdown/statistic.countdown.tsx b/frontend/antd/statistic/countdown/statistic.countdown.tsx
new file mode 100644
index 00000000..ec52c319
--- /dev/null
+++ b/frontend/antd/statistic/countdown/statistic.countdown.tsx
@@ -0,0 +1,26 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { type GetProps, Statistic as AStatistic } from 'antd';
+
+export const StatisticCountdown = sveltify<
+ GetProps & {
+ children: React.ReactNode;
+ },
+ ['prefix', 'suffix', 'title']
+>(({ children, value, slots, ...props }) => {
+ return (
+ <>
+ {children}
+ : props.title}
+ prefix={slots.prefix ? : props.prefix}
+ suffix={slots.suffix ? : props.suffix}
+ />
+ >
+ );
+});
+
+export default StatisticCountdown;
diff --git a/frontend/antd/statistic/gradio.config.js b/frontend/antd/statistic/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/statistic/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/statistic/package.json b/frontend/antd/statistic/package.json
new file mode 100644
index 00000000..ddb6a524
--- /dev/null
+++ b/frontend/antd/statistic/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-statistic",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/statistic/statistic.tsx b/frontend/antd/statistic/statistic.tsx
new file mode 100644
index 00000000..ceeea3b7
--- /dev/null
+++ b/frontend/antd/statistic/statistic.tsx
@@ -0,0 +1,28 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Statistic as AStatistic } from 'antd';
+
+export const Statistic = sveltify<
+ GetProps & {
+ children: React.ReactNode;
+ },
+ ['prefix', 'suffix', 'title']
+>(({ children, slots, formatter, ...props }) => {
+ const formatterFunction = useFunction(formatter);
+ return (
+ <>
+ {children}
+ : props.title}
+ prefix={slots.prefix ? : props.prefix}
+ suffix={slots.suffix ? : props.suffix}
+ />
+ >
+ );
+});
+
+export default Statistic;
diff --git a/frontend/antd/steps/Index.svelte b/frontend/antd/steps/Index.svelte
new file mode 100644
index 00000000..30769efd
--- /dev/null
+++ b/frontend/antd/steps/Index.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSteps then Steps}
+ 0 ? $items : $children}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/steps/context.ts b/frontend/antd/steps/context.ts
new file mode 100644
index 00000000..0c3e267d
--- /dev/null
+++ b/frontend/antd/steps/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('steps');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/steps/gradio.config.js b/frontend/antd/steps/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/steps/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/steps/item/Index.svelte b/frontend/antd/steps/item/Index.svelte
new file mode 100644
index 00000000..4148025f
--- /dev/null
+++ b/frontend/antd/steps/item/Index.svelte
@@ -0,0 +1,73 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/steps/item/gradio.config.js b/frontend/antd/steps/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/steps/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/steps/item/package.json b/frontend/antd/steps/item/package.json
new file mode 100644
index 00000000..ae4e2ae0
--- /dev/null
+++ b/frontend/antd/steps/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-steps.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/steps/package.json b/frontend/antd/steps/package.json
new file mode 100644
index 00000000..27117ee6
--- /dev/null
+++ b/frontend/antd/steps/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-steps",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/steps/steps.tsx b/frontend/antd/steps/steps.tsx
new file mode 100644
index 00000000..18d7984e
--- /dev/null
+++ b/frontend/antd/steps/steps.tsx
@@ -0,0 +1,36 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Steps as ASteps } from 'antd';
+
+import { type Item } from './context';
+
+export const Steps = sveltify<
+ GetProps & {
+ slotItems: Item[];
+ },
+ ['progressDot']
+>(({ slots, items, slotItems, ...props }) => {
+ return (
+ {
+ return (
+ items ||
+ renderItems['items']>[number]>(
+ slotItems
+ )
+ );
+ }, [items, slotItems])}
+ progressDot={
+ slots.progressDot
+ ? (dot) =>
+ slots.progressDot ? : dot
+ : undefined
+ }
+ />
+ );
+});
+
+export default Steps;
diff --git a/frontend/antd/switch/Index.svelte b/frontend/antd/switch/Index.svelte
new file mode 100644
index 00000000..7cdafb53
--- /dev/null
+++ b/frontend/antd/switch/Index.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedSwitch then Switch}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/switch/gradio.config.js b/frontend/antd/switch/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/switch/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/switch/package.json b/frontend/antd/switch/package.json
new file mode 100644
index 00000000..8a7824be
--- /dev/null
+++ b/frontend/antd/switch/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-switch",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/switch/switch.tsx b/frontend/antd/switch/switch.tsx
new file mode 100644
index 00000000..a638b7d5
--- /dev/null
+++ b/frontend/antd/switch/switch.tsx
@@ -0,0 +1,41 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { type GetProps, Switch as ASwitch } from 'antd';
+
+export const Switch = sveltify<
+ GetProps & {
+ children?: React.ReactNode;
+ onValueChange?: (value: boolean) => void;
+ },
+ ['checkedChildren', 'unCheckedChildren']
+>(({ slots, children, onValueChange, onChange, ...props }) => {
+ return (
+ <>
+ {children}
+ {
+ onValueChange?.(value);
+ onChange?.(value, ...args);
+ }}
+ checkedChildren={
+ slots.checkedChildren ? (
+
+ ) : (
+ props.checkedChildren
+ )
+ }
+ unCheckedChildren={
+ slots.unCheckedChildren ? (
+
+ ) : (
+ props.unCheckedChildren
+ )
+ }
+ />
+ >
+ );
+});
+
+export default Switch;
diff --git a/frontend/antd/table/Index.svelte b/frontend/antd/table/Index.svelte
new file mode 100644
index 00000000..14f8c9b6
--- /dev/null
+++ b/frontend/antd/table/Index.svelte
@@ -0,0 +1,83 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTable then Table}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/table/column-group/Index.svelte b/frontend/antd/table/column-group/Index.svelte
new file mode 100644
index 00000000..677a9f76
--- /dev/null
+++ b/frontend/antd/table/column-group/Index.svelte
@@ -0,0 +1,83 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/table/column-group/gradio.config.js b/frontend/antd/table/column-group/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/table/column-group/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/table/column-group/package.json b/frontend/antd/table/column-group/package.json
new file mode 100644
index 00000000..6ce3205b
--- /dev/null
+++ b/frontend/antd/table/column-group/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-table.column-group",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/table/column/Index.svelte b/frontend/antd/table/column/Index.svelte
new file mode 100644
index 00000000..e1387a35
--- /dev/null
+++ b/frontend/antd/table/column/Index.svelte
@@ -0,0 +1,142 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/table/column/gradio.config.js b/frontend/antd/table/column/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/table/column/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/table/column/package.json b/frontend/antd/table/column/package.json
new file mode 100644
index 00000000..852326d1
--- /dev/null
+++ b/frontend/antd/table/column/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-table.column",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/table/context.ts b/frontend/antd/table/context.ts
new file mode 100644
index 00000000..9246517b
--- /dev/null
+++ b/frontend/antd/table/context.ts
@@ -0,0 +1,27 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems: getColumnItems, getSetItemFn: getSetColumnItemFn } =
+ createItemsContext('table-column');
+
+const { getItems: getSelectionItems, getSetItemFn: getSetSelectionItemFn } =
+ createItemsContext('table-row-selection-selection');
+
+const {
+ getItems: getRowSelectionItems,
+ getSetItemFn: getSetRowSelectionItemFn,
+} = createItemsContext('table-row-selection');
+
+const { getItems: getExpandableItems, getSetItemFn: getSetExpandableItemFn } =
+ createItemsContext('table-expandable');
+
+export {
+ getColumnItems,
+ getExpandableItems,
+ getRowSelectionItems,
+ getSelectionItems,
+ getSetColumnItemFn,
+ getSetExpandableItemFn,
+ getSetRowSelectionItemFn,
+ getSetSelectionItemFn,
+};
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/table/expandable/Expandable.svelte b/frontend/antd/table/expandable/Expandable.svelte
new file mode 100644
index 00000000..80acff39
--- /dev/null
+++ b/frontend/antd/table/expandable/Expandable.svelte
@@ -0,0 +1,105 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/table/expandable/Index.svelte b/frontend/antd/table/expandable/Index.svelte
new file mode 100644
index 00000000..a4c9db3e
--- /dev/null
+++ b/frontend/antd/table/expandable/Index.svelte
@@ -0,0 +1,42 @@
+
+
+
+
+{#await AwaitedExpandable then Expandable}
+
+
+
+{/await}
+
+
diff --git a/frontend/antd/table/expandable/gradio.config.js b/frontend/antd/table/expandable/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/table/expandable/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/table/expandable/package.json b/frontend/antd/table/expandable/package.json
new file mode 100644
index 00000000..80669601
--- /dev/null
+++ b/frontend/antd/table/expandable/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-table.expandable",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/table/gradio.config.js b/frontend/antd/table/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/table/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/table/package.json b/frontend/antd/table/package.json
new file mode 100644
index 00000000..accf96d7
--- /dev/null
+++ b/frontend/antd/table/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-table",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/table/row-selection/Index.svelte b/frontend/antd/table/row-selection/Index.svelte
new file mode 100644
index 00000000..614b6e54
--- /dev/null
+++ b/frontend/antd/table/row-selection/Index.svelte
@@ -0,0 +1,42 @@
+
+
+
+
+{#await AwaitedRowSelection then RowSelection}
+
+
+
+{/await}
+
+
diff --git a/frontend/antd/table/row-selection/RowSelection.svelte b/frontend/antd/table/row-selection/RowSelection.svelte
new file mode 100644
index 00000000..58c3df9f
--- /dev/null
+++ b/frontend/antd/table/row-selection/RowSelection.svelte
@@ -0,0 +1,101 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/table/row-selection/gradio.config.js b/frontend/antd/table/row-selection/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/table/row-selection/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/table/row-selection/package.json b/frontend/antd/table/row-selection/package.json
new file mode 100644
index 00000000..c8f22cd5
--- /dev/null
+++ b/frontend/antd/table/row-selection/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-table.row-selection",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/table/row-selection/selection/Index.svelte b/frontend/antd/table/row-selection/selection/Index.svelte
new file mode 100644
index 00000000..f0595f6b
--- /dev/null
+++ b/frontend/antd/table/row-selection/selection/Index.svelte
@@ -0,0 +1,93 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/table/row-selection/selection/gradio.config.js b/frontend/antd/table/row-selection/selection/gradio.config.js
new file mode 100644
index 00000000..7b2fe8dd
--- /dev/null
+++ b/frontend/antd/table/row-selection/selection/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/table/row-selection/selection/package.json b/frontend/antd/table/row-selection/selection/package.json
new file mode 100644
index 00000000..320a0d64
--- /dev/null
+++ b/frontend/antd/table/row-selection/selection/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-table.selection",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/table/table.tsx b/frontend/antd/table/table.tsx
new file mode 100644
index 00000000..d9cd843b
--- /dev/null
+++ b/frontend/antd/table/table.tsx
@@ -0,0 +1,195 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Table as ATable } from 'antd';
+
+import type { Item } from './context';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+
+type TableProps = GetProps;
+export const Table = sveltify<
+ TableProps & {
+ rowSelectionItems: Item[];
+ expandableItems: Item[];
+ columnItems: Item[];
+ },
+ [
+ 'footer',
+ 'title',
+ 'loading.tip',
+ 'loading.indicator',
+ 'pagination.showQuickJumper.goButton',
+ 'showSorterTooltip.title',
+ ]
+>(
+ ({
+ children,
+ slots,
+ columnItems,
+ columns,
+ getPopupContainer,
+ pagination,
+ loading,
+ rowKey,
+ rowSelection,
+ rowSelectionItems,
+ expandableItems,
+ expandable,
+ sticky,
+ showSorterTooltip,
+ onRow,
+ onHeaderRow,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+
+ const supportLoadingConfig =
+ slots['loading.tip'] || slots['loading.indicator'];
+ const loadingConfig = getConfig(loading);
+ const supportPaginationConfig =
+ slots['pagination.showQuickJumper.goButton'];
+ const paginationConfig = getConfig(pagination);
+ const paginationShowTotalFunction = useFunction(paginationConfig.showTotal);
+ const rowKeyFunction = useFunction(rowKey);
+ const supportShowSorterTooltipConfig =
+ slots['showSorterTooltip.title'] || typeof showSorterTooltip === 'object';
+ const showSorterTooltipConfig = getConfig(showSorterTooltip);
+ const showSorterTooltipAfterOpenChangeFunction = useFunction(
+ showSorterTooltipConfig.afterOpenChange
+ );
+ const showSorterTooltipGetPopupContainerFunction = useFunction(
+ showSorterTooltipConfig.getPopupContainer
+ );
+ const supportStickyConfig = typeof sticky === 'object';
+ const stickyConfig = getConfig(sticky);
+ const stickyGetContainerFunction = useFunction(stickyConfig.getContainer);
+ const onRowFunction = useFunction(onRow);
+ const onHeaderRowFunction = useFunction(onHeaderRow);
+
+ return (
+ <>
+ {children}
+ {
+ return (
+ columns?.map((item) => {
+ if ((item as any) === 'EXPAND_COLUMN') {
+ return ATable.EXPAND_COLUMN;
+ } else if ((item as any) === 'SELECTION_COLUMN') {
+ return ATable.SELECTION_COLUMN;
+ }
+ return item;
+ }) ||
+ renderItems[number]>(
+ columnItems,
+ {
+ fallback: (item) => {
+ if (item === 'EXPAND_COLUMN') {
+ return ATable.EXPAND_COLUMN;
+ } else if (item === 'SELECTION_COLUMN') {
+ return ATable.SELECTION_COLUMN;
+ }
+ return item;
+ },
+ }
+ )
+ );
+ }, [columnItems, columns])}
+ onRow={onRowFunction}
+ onHeaderRow={onHeaderRowFunction}
+ rowSelection={useMemo(() => {
+ return (
+ rowSelection ||
+ renderItems(rowSelectionItems)[0]
+ );
+ }, [rowSelection, rowSelectionItems])}
+ expandable={useMemo(() => {
+ return (
+ expandable ||
+ renderItems(expandableItems)[0]
+ );
+ }, [expandable, expandableItems])}
+ rowKey={rowKeyFunction || rowKey}
+ sticky={
+ supportStickyConfig
+ ? {
+ ...stickyConfig,
+ getContainer: stickyGetContainerFunction,
+ }
+ : sticky
+ }
+ showSorterTooltip={
+ supportShowSorterTooltipConfig
+ ? {
+ ...showSorterTooltipConfig,
+ afterOpenChange: showSorterTooltipAfterOpenChangeFunction,
+ getPopupContainer: showSorterTooltipGetPopupContainerFunction,
+ title: slots['showSorterTooltip.title'] ? (
+
+ ) : (
+ showSorterTooltipConfig.title
+ ),
+ }
+ : showSorterTooltip
+ }
+ pagination={
+ supportPaginationConfig
+ ? {
+ ...paginationConfig,
+ showTotal: paginationShowTotalFunction,
+ showQuickJumper: slots['pagination.showQuickJumper.goButton']
+ ? {
+ goButton: (
+
+ ),
+ }
+ : paginationConfig.showQuickJumper,
+ }
+ : pagination
+ }
+ getPopupContainer={getPopupContainerFunction}
+ loading={
+ supportLoadingConfig
+ ? {
+ ...loadingConfig,
+ tip: slots['loading.tip'] ? (
+
+ ) : (
+ loadingConfig.tip
+ ),
+ indicator: slots['loading.indicator'] ? (
+
+ ) : (
+ loadingConfig.indicator
+ ),
+ }
+ : loading
+ }
+ footer={
+ slots.footer
+ ? () => (slots.footer ? : null)
+ : props.footer
+ }
+ title={
+ slots.title
+ ? () => (slots.title ? : null)
+ : props.title
+ }
+ />
+ >
+ );
+ }
+);
+
+export default Table;
diff --git a/frontend/antd/tabs/Index.svelte b/frontend/antd/tabs/Index.svelte
new file mode 100644
index 00000000..646ac43c
--- /dev/null
+++ b/frontend/antd/tabs/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTabs then Tabs}
+ 0 ? $items : $children}
+ activeKey={$mergedProps.props.activeKey ?? $mergedProps.value}
+ onValueChange={(activeKey) => {
+ value = activeKey;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tabs/context.ts b/frontend/antd/tabs/context.ts
new file mode 100644
index 00000000..f1924a05
--- /dev/null
+++ b/frontend/antd/tabs/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('timeline');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/tabs/gradio.config.js b/frontend/antd/tabs/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/tabs/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tabs/item/Index.svelte b/frontend/antd/tabs/item/Index.svelte
new file mode 100644
index 00000000..ba5c199c
--- /dev/null
+++ b/frontend/antd/tabs/item/Index.svelte
@@ -0,0 +1,82 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+
+{/if}
+
+
diff --git a/frontend/antd/tabs/item/gradio.config.js b/frontend/antd/tabs/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/tabs/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tabs/item/package.json b/frontend/antd/tabs/item/package.json
new file mode 100644
index 00000000..c054777c
--- /dev/null
+++ b/frontend/antd/tabs/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tabs.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tabs/package.json b/frontend/antd/tabs/package.json
new file mode 100644
index 00000000..cd2ec069
--- /dev/null
+++ b/frontend/antd/tabs/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tabs",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tabs/tabs.tsx b/frontend/antd/tabs/tabs.tsx
new file mode 100644
index 00000000..1c07c317
--- /dev/null
+++ b/frontend/antd/tabs/tabs.tsx
@@ -0,0 +1,106 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { omitUndefinedProps } from '@utils/omitUndefinedProps';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Tabs as ATabs } from 'antd';
+
+import { type Item } from './context';
+
+export const Tabs = sveltify<
+ GetProps & {
+ slotItems: Item[];
+ onValueChange: (activeKey: string) => void;
+ },
+ [
+ 'addIcon',
+ 'removeIcon',
+ 'tabBarExtraContent',
+ 'tabBarExtraContent.left',
+ 'tabBarExtraContent.right',
+ 'more.icon',
+ ]
+>(
+ ({
+ slots,
+ indicator,
+ items,
+ onChange,
+ onValueChange,
+ slotItems,
+ more,
+ children,
+ ...props
+ }) => {
+ const indicatorSizeFunction = useFunction(indicator?.size);
+ const getMorePopupContainerFunction = useFunction(more?.getPopupContainer);
+ return (
+ <>
+ {children}
+ {
+ return (
+ items ||
+ renderItems['items']>[number]>(
+ slotItems
+ )
+ );
+ }, [items, slotItems])}
+ more={omitUndefinedProps({
+ ...(more || {}),
+ getPopupContainer:
+ getMorePopupContainerFunction || more?.getPopupContainer,
+ icon: slots['more.icon'] ? (
+
+ ) : (
+ more?.icon
+ ),
+ })}
+ tabBarExtraContent={
+ slots['tabBarExtraContent'] ? (
+
+ ) : slots['tabBarExtraContent.left'] ||
+ slots['tabBarExtraContent.right'] ? (
+ {
+ left: slots['tabBarExtraContent.left'] ? (
+
+ ) : undefined,
+ right: slots['tabBarExtraContent.right'] ? (
+
+ ) : undefined,
+ }
+ ) : (
+ props.tabBarExtraContent
+ )
+ }
+ addIcon={
+ slots.addIcon ? : props.addIcon
+ }
+ removeIcon={
+ slots.removeIcon ? (
+
+ ) : (
+ props.removeIcon
+ )
+ }
+ onChange={(activeKey) => {
+ onChange?.(activeKey);
+ onValueChange(activeKey);
+ }}
+ />
+ >
+ );
+ }
+);
+
+export default Tabs;
diff --git a/frontend/antd/tag/Index.svelte b/frontend/antd/tag/Index.svelte
new file mode 100644
index 00000000..ef6da7ae
--- /dev/null
+++ b/frontend/antd/tag/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTag then Tag}
+
+ {#if $mergedProps._internal.layout}
+
+ {:else}
+ {$mergedProps.value}
+ {/if}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tag/checkable-tag/Index.svelte b/frontend/antd/tag/checkable-tag/Index.svelte
new file mode 100644
index 00000000..432603bb
--- /dev/null
+++ b/frontend/antd/tag/checkable-tag/Index.svelte
@@ -0,0 +1,89 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedCheckableTag then CheckableTag}
+ {
+ value = checked;
+ }}
+ >
+ {#if $mergedProps._internal.layout}
+
+ {:else}
+ {$mergedProps.label}
+ {/if}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tag/checkable-tag/gradio.config.js b/frontend/antd/tag/checkable-tag/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/tag/checkable-tag/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tag/checkable-tag/package.json b/frontend/antd/tag/checkable-tag/package.json
new file mode 100644
index 00000000..20d61835
--- /dev/null
+++ b/frontend/antd/tag/checkable-tag/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tag-checkable-tag",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tag/checkable-tag/tag.checkable-tag.tsx b/frontend/antd/tag/checkable-tag/tag.checkable-tag.tsx
new file mode 100644
index 00000000..3410949c
--- /dev/null
+++ b/frontend/antd/tag/checkable-tag/tag.checkable-tag.tsx
@@ -0,0 +1,21 @@
+import { sveltify } from '@svelte-preprocess-react';
+import React from 'react';
+import { type GetProps, Tag as ATag } from 'antd';
+
+export const CheckableTag = sveltify<
+ GetProps & {
+ onValueChange: (checked: boolean) => void;
+ }
+>(({ onChange, onValueChange, ...props }) => {
+ return (
+ {
+ onChange?.(v);
+ onValueChange(v);
+ }}
+ />
+ );
+});
+
+export default CheckableTag;
diff --git a/frontend/antd/tag/gradio.config.js b/frontend/antd/tag/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/tag/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tag/package.json b/frontend/antd/tag/package.json
new file mode 100644
index 00000000..67affbdb
--- /dev/null
+++ b/frontend/antd/tag/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tag",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tag/tag.tsx b/frontend/antd/tag/tag.tsx
new file mode 100644
index 00000000..685e4667
--- /dev/null
+++ b/frontend/antd/tag/tag.tsx
@@ -0,0 +1,24 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { type GetProps, Tag as ATag } from 'antd';
+
+export const Tag = sveltify, ['closeIcon', 'icon']>(
+ ({ slots, ...props }) => {
+ return (
+ : props.icon}
+ closeIcon={
+ slots.closeIcon ? (
+
+ ) : (
+ props.closeIcon
+ )
+ }
+ />
+ );
+ }
+);
+
+export default Tag;
diff --git a/frontend/antd/time-picker/Index.svelte b/frontend/antd/time-picker/Index.svelte
new file mode 100644
index 00000000..467a6272
--- /dev/null
+++ b/frontend/antd/time-picker/Index.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTimePicker then TimePicker}
+ {
+ value = val;
+ }}
+ >
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/time-picker/gradio.config.js b/frontend/antd/time-picker/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/time-picker/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/time-picker/package.json b/frontend/antd/time-picker/package.json
new file mode 100644
index 00000000..a54cc68f
--- /dev/null
+++ b/frontend/antd/time-picker/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-time-picker",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/time-picker/range-picker/Index.svelte b/frontend/antd/time-picker/range-picker/Index.svelte
new file mode 100644
index 00000000..ede1defa
--- /dev/null
+++ b/frontend/antd/time-picker/range-picker/Index.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTimePickerRangePicker then TimeRangePicker}
+ {
+ value = val;
+ }}
+ >
+
+
+ {/await}
+{/if}
diff --git a/frontend/antd/time-picker/range-picker/gradio.config.js b/frontend/antd/time-picker/range-picker/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/time-picker/range-picker/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/time-picker/range-picker/package.json b/frontend/antd/time-picker/range-picker/package.json
new file mode 100644
index 00000000..b084e010
--- /dev/null
+++ b/frontend/antd/time-picker/range-picker/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-time-picker.range-picker",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/time-picker/range-picker/time-picker.range-picker.tsx b/frontend/antd/time-picker/range-picker/time-picker.range-picker.tsx
new file mode 100644
index 00000000..8244417f
--- /dev/null
+++ b/frontend/antd/time-picker/range-picker/time-picker.range-picker.tsx
@@ -0,0 +1,199 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, TimePicker as ATimePicker } from 'antd';
+import dayjs from 'dayjs';
+
+type RangePickerProps = GetProps;
+
+function formatDayjs(date: any) {
+ if (typeof date === 'number') {
+ return dayjs(date * 1000);
+ }
+ return dayjs(date);
+}
+
+function formatDates(
+ dates: [dayjs.Dayjs | null | undefined, dayjs.Dayjs | null | undefined] | null
+): [number | null, number | null] {
+ return (dates?.map((date) => {
+ return date ? date.valueOf() / 1000 : null;
+ }) || [null, null]) as [number | null, number | null];
+}
+
+export const TimeRangePicker = sveltify<
+ Omit & {
+ onChange?: (dates: [number | null, number | null], ...args: any[]) => void;
+ onPanelChange?: (
+ dates: [number | null, number | null],
+ ...args: any[]
+ ) => void;
+ onCalendarChange?: (
+ dates: [number | null, number | null],
+ ...args: any[]
+ ) => void;
+ onValueChange: (dates: [number | null, number | null]) => void;
+ },
+ [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ 'separator',
+ ]
+>(
+ ({
+ slots,
+ disabledDate,
+ disabledTime,
+ value,
+ defaultValue,
+ defaultPickerValue,
+ pickerValue,
+ onChange,
+ minDate,
+ maxDate,
+ cellRender,
+ panelRender,
+ getPopupContainer,
+ onValueChange,
+ onPanelChange,
+ onCalendarChange,
+ children,
+ elRef,
+ ...props
+ }) => {
+ const disabledDateFunction = useFunction(disabledDate);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const cellRenderFunction = useFunction(cellRender);
+ const panelRenderFunction = useFunction(panelRender);
+ const disabledTimeFunction = useFunction(disabledTime);
+ const validValue = useMemo(() => {
+ return value?.map((v) => formatDayjs(v)) as RangePickerProps['value'];
+ }, [value]);
+
+ const validDefaultValue = useMemo(() => {
+ return defaultValue?.map((v) =>
+ formatDayjs(v)
+ ) as RangePickerProps['defaultValue'];
+ }, [defaultValue]);
+ const validDefaultPickerValue = useMemo(() => {
+ if (Array.isArray(defaultPickerValue)) {
+ return defaultPickerValue.map((v) =>
+ formatDayjs(v)
+ ) as RangePickerProps['defaultPickerValue'];
+ }
+ return defaultPickerValue ? formatDayjs(defaultPickerValue) : undefined;
+ }, [defaultPickerValue]);
+ const validPickerValue = useMemo(() => {
+ if (Array.isArray(pickerValue)) {
+ return pickerValue.map((v) =>
+ formatDayjs(v)
+ ) as RangePickerProps['pickerValue'];
+ }
+ return pickerValue ? formatDayjs(pickerValue) : undefined;
+ }, [pickerValue]);
+ const validMinDate = useMemo(() => {
+ return minDate ? formatDayjs(minDate) : undefined;
+ }, [minDate]);
+ const validMaxDate = useMemo(() => {
+ return maxDate ? formatDayjs(maxDate) : undefined;
+ }, [maxDate]);
+ return (
+ <>
+ {children}
+ {
+ const formattedDates = formatDates(dates);
+ onPanelChange?.(formattedDates, ...args);
+ }}
+ onChange={(dates, ...args) => {
+ const formattedDates = formatDates(dates);
+ onChange?.(formattedDates, ...args);
+ onValueChange(formattedDates);
+ }}
+ onCalendarChange={(dates, ...args) => {
+ const formattedDates = formatDates(dates);
+ onCalendarChange?.(formattedDates, ...args);
+ }}
+ renderExtraFooter={
+ slots.renderExtraFooter
+ ? () =>
+ slots.renderExtraFooter ? (
+
+ ) : null
+ : props.renderExtraFooter
+ }
+ prevIcon={
+ slots.prevIcon ? (
+
+ ) : (
+ props.prevIcon
+ )
+ }
+ nextIcon={
+ slots.nextIcon ? (
+
+ ) : (
+ props.nextIcon
+ )
+ }
+ suffixIcon={
+ slots.suffixIcon ? (
+
+ ) : (
+ props.suffixIcon
+ )
+ }
+ superNextIcon={
+ slots.superNextIcon ? (
+
+ ) : (
+ props.superNextIcon
+ )
+ }
+ superPrevIcon={
+ slots.superPrevIcon ? (
+
+ ) : (
+ props.superPrevIcon
+ )
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ separator={
+ slots.separator ? (
+
+ ) : (
+ props.separator
+ )
+ }
+ />
+ >
+ );
+ }
+);
+
+export default TimeRangePicker;
diff --git a/frontend/antd/time-picker/time-picker.tsx b/frontend/antd/time-picker/time-picker.tsx
new file mode 100644
index 00000000..e6237c5c
--- /dev/null
+++ b/frontend/antd/time-picker/time-picker.tsx
@@ -0,0 +1,187 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, TimePicker as ATimePicker } from 'antd';
+import dayjs from 'dayjs';
+
+type TimePickerProps = GetProps;
+
+function formatDayjs(date: any): dayjs.Dayjs {
+ if (Array.isArray(date)) {
+ return date.map((d) => {
+ return formatDayjs(d) as dayjs.Dayjs;
+ }) as unknown as dayjs.Dayjs;
+ }
+ if (typeof date === 'number') {
+ return dayjs(date * 1000);
+ }
+ return dayjs(date);
+}
+
+function formatDate(dates: (dayjs.Dayjs | null | undefined)[] | dayjs.Dayjs) {
+ if (Array.isArray(dates)) {
+ return dates.map((date) => {
+ return date ? date.valueOf() / 1000 : null;
+ });
+ }
+ if (typeof dates === 'object' && dates !== null) {
+ return dates.valueOf() / 1000;
+ }
+ return dates;
+}
+
+export const TimePicker = sveltify<
+ Omit & {
+ onChange?: (date: ReturnType, ...args: any[]) => void;
+ onPanelChange?: (
+ date: ReturnType,
+ ...args: any[]
+ ) => void;
+ onCalendarChange?: (
+ date: ReturnType,
+ ...args: any[]
+ ) => void;
+ onValueChange: (date: number | string) => void;
+ },
+ [
+ 'allowClear.clearIcon',
+ 'prevIcon',
+ 'nextIcon',
+ 'suffixIcon',
+ 'superNextIcon',
+ 'superPrevIcon',
+ 'renderExtraFooter',
+ ]
+>(
+ ({
+ slots,
+ disabledDate,
+ disabledTime,
+ value,
+ defaultValue,
+ defaultPickerValue,
+ pickerValue,
+ onChange,
+ minDate,
+ maxDate,
+ cellRender,
+ panelRender,
+ getPopupContainer,
+ onValueChange,
+ onPanelChange,
+ onCalendarChange,
+ children,
+ elRef,
+ ...props
+ }) => {
+ const disabledDateFunction = useFunction(disabledDate);
+ const disabledTimeFunction = useFunction(disabledTime);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const cellRenderFunction = useFunction(cellRender);
+ const panelRenderFunction = useFunction(panelRender);
+ const validValue = useMemo(() => {
+ return value ? formatDayjs(value) : undefined;
+ }, [value]);
+ const validDefaultValue = useMemo(() => {
+ return defaultValue ? formatDayjs(defaultValue) : undefined;
+ }, [defaultValue]);
+ const validDefaultPickerValue = useMemo(() => {
+ return defaultPickerValue ? formatDayjs(defaultPickerValue) : undefined;
+ }, [defaultPickerValue]);
+ const validPickerValue = useMemo(() => {
+ return pickerValue ? formatDayjs(pickerValue) : undefined;
+ }, [pickerValue]);
+ const validMinDate = useMemo(() => {
+ return minDate ? formatDayjs(minDate) : undefined;
+ }, [minDate]);
+ const validMaxDate = useMemo(() => {
+ return maxDate ? formatDayjs(maxDate) : undefined;
+ }, [maxDate]);
+ return (
+ <>
+ {children}
+ {
+ const formattedDates = formatDate(date);
+ onPanelChange?.(formattedDates, ...args);
+ }}
+ onChange={(date, ...args) => {
+ const formattedDate = formatDate(date);
+ onChange?.(formattedDate, ...args);
+ onValueChange(formattedDate as number);
+ }}
+ onCalendarChange={(date, ...args) => {
+ const formattedDate = formatDate(date);
+ onCalendarChange?.(formattedDate, ...args);
+ }}
+ renderExtraFooter={
+ slots.renderExtraFooter
+ ? () =>
+ slots.renderExtraFooter ? (
+
+ ) : null
+ : props.renderExtraFooter
+ }
+ prevIcon={
+ slots.prevIcon ? (
+
+ ) : (
+ props.prevIcon
+ )
+ }
+ nextIcon={
+ slots.nextIcon ? (
+
+ ) : (
+ props.nextIcon
+ )
+ }
+ suffixIcon={
+ slots.suffixIcon ? (
+
+ ) : (
+ props.suffixIcon
+ )
+ }
+ superNextIcon={
+ slots.superNextIcon ? (
+
+ ) : (
+ props.superNextIcon
+ )
+ }
+ superPrevIcon={
+ slots.superPrevIcon ? (
+
+ ) : (
+ props.superPrevIcon
+ )
+ }
+ allowClear={
+ slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear
+ }
+ />
+ >
+ );
+ }
+);
+
+export default TimePicker;
diff --git a/frontend/antd/timeline/Index.svelte b/frontend/antd/timeline/Index.svelte
new file mode 100644
index 00000000..2b5e5f33
--- /dev/null
+++ b/frontend/antd/timeline/Index.svelte
@@ -0,0 +1,73 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTimeline then Timeline}
+ 0 ? $items : $children}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/timeline/context.ts b/frontend/antd/timeline/context.ts
new file mode 100644
index 00000000..f1924a05
--- /dev/null
+++ b/frontend/antd/timeline/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('timeline');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/timeline/gradio.config.js b/frontend/antd/timeline/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/timeline/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/timeline/item/Index.svelte b/frontend/antd/timeline/item/Index.svelte
new file mode 100644
index 00000000..a219b00b
--- /dev/null
+++ b/frontend/antd/timeline/item/Index.svelte
@@ -0,0 +1,82 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+
+{/if}
+
+
diff --git a/frontend/antd/timeline/item/gradio.config.js b/frontend/antd/timeline/item/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/timeline/item/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/timeline/item/package.json b/frontend/antd/timeline/item/package.json
new file mode 100644
index 00000000..57cf9b6b
--- /dev/null
+++ b/frontend/antd/timeline/item/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-timeline.item",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/timeline/package.json b/frontend/antd/timeline/package.json
new file mode 100644
index 00000000..4cba30aa
--- /dev/null
+++ b/frontend/antd/timeline/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-timeline",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/timeline/timeline.tsx b/frontend/antd/timeline/timeline.tsx
new file mode 100644
index 00000000..16b7664d
--- /dev/null
+++ b/frontend/antd/timeline/timeline.tsx
@@ -0,0 +1,43 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Timeline as ATimeline } from 'antd';
+
+import { type Item } from './context';
+
+export const Timeline = sveltify<
+ GetProps & {
+ slotItems: Item[];
+ },
+ ['pending', 'pendingDot']
+>(({ slots, items, slotItems, children, ...props }) => {
+ return (
+ <>
+ {children}
+ {
+ return (
+ items ||
+ renderItems<
+ NonNullable['items']>[number]
+ >(slotItems)
+ );
+ }, [items, slotItems])}
+ pending={
+ slots.pending ? : props.pending
+ }
+ pendingDot={
+ slots.pendingDot ? (
+
+ ) : (
+ props.pendingDot
+ )
+ }
+ />
+ >
+ );
+});
+
+export default Timeline;
diff --git a/frontend/antd/tooltip/Index.svelte b/frontend/antd/tooltip/Index.svelte
new file mode 100644
index 00000000..c4d291de
--- /dev/null
+++ b/frontend/antd/tooltip/Index.svelte
@@ -0,0 +1,72 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTooltip then Tooltip}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tooltip/gradio.config.js b/frontend/antd/tooltip/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/tooltip/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tooltip/package.json b/frontend/antd/tooltip/package.json
new file mode 100644
index 00000000..9513a022
--- /dev/null
+++ b/frontend/antd/tooltip/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tooltip",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tooltip/tooltip.tsx b/frontend/antd/tooltip/tooltip.tsx
new file mode 100644
index 00000000..b06d47b6
--- /dev/null
+++ b/frontend/antd/tooltip/tooltip.tsx
@@ -0,0 +1,26 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Tooltip as ATooltip } from 'antd';
+
+export const Tooltip = sveltify, ['title']>(
+ ({ slots, afterOpenChange, getPopupContainer, children, ...props }) => {
+ const afterOpenChangeFunction = useFunction(afterOpenChange);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ return (
+ <>
+ : props.title}
+ >
+ {children}
+
+ >
+ );
+ }
+);
+
+export default Tooltip;
diff --git a/frontend/antd/tour/Index.svelte b/frontend/antd/tour/Index.svelte
new file mode 100644
index 00000000..51adcf2f
--- /dev/null
+++ b/frontend/antd/tour/Index.svelte
@@ -0,0 +1,84 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTour then Tour}
+ 0 ? $steps : $children}
+ onValueChange={(options) => {
+ value = options.current;
+ open = options.open;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tour/context.ts b/frontend/antd/tour/context.ts
new file mode 100644
index 00000000..1e3b613e
--- /dev/null
+++ b/frontend/antd/tour/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('tour');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/tour/gradio.config.js b/frontend/antd/tour/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/tour/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tour/package.json b/frontend/antd/tour/package.json
new file mode 100644
index 00000000..a600928d
--- /dev/null
+++ b/frontend/antd/tour/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tour",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tour/step/Index.svelte b/frontend/antd/tour/step/Index.svelte
new file mode 100644
index 00000000..41ea0bdd
--- /dev/null
+++ b/frontend/antd/tour/step/Index.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/tour/step/gradio.config.js b/frontend/antd/tour/step/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/tour/step/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tour/step/package.json b/frontend/antd/tour/step/package.json
new file mode 100644
index 00000000..265c1054
--- /dev/null
+++ b/frontend/antd/tour/step/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tour.step",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tour/tour.tsx b/frontend/antd/tour/tour.tsx
new file mode 100644
index 00000000..e22ff2d0
--- /dev/null
+++ b/frontend/antd/tour/tour.tsx
@@ -0,0 +1,71 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Tour as ATour } from 'antd';
+
+import { type Item } from './context';
+
+export const Tour = sveltify<
+ GetProps & {
+ slotItems: Item[];
+ children?: React.ReactNode;
+ onValueChange: (options: { current: number; open: boolean }) => void;
+ },
+ ['closeIcon']
+>(
+ ({
+ slots,
+ steps,
+ slotItems,
+ children,
+ onChange,
+ onClose,
+ onValueChange,
+ getPopupContainer,
+ ...props
+ }) => {
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ return (
+ <>
+ {children}
+ {
+ return (
+ steps ||
+ renderItems['steps']>[number]>(
+ slotItems
+ )
+ );
+ }, [steps, slotItems])}
+ onChange={(current) => {
+ onChange?.(current);
+ onValueChange({
+ open: true,
+ current: current,
+ });
+ }}
+ closeIcon={
+ slots.closeIcon ? (
+
+ ) : (
+ props.closeIcon
+ )
+ }
+ getPopupContainer={getPopupContainerFunction}
+ onClose={(current, ...args) => {
+ onClose?.(current, ...args);
+ onValueChange({
+ current,
+ open: false,
+ });
+ }}
+ />
+ >
+ );
+ }
+);
+
+export default Tour;
diff --git a/frontend/antd/transfer/Index.svelte b/frontend/antd/transfer/Index.svelte
new file mode 100644
index 00000000..6c938284
--- /dev/null
+++ b/frontend/antd/transfer/Index.svelte
@@ -0,0 +1,76 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTransfer then Transfer}
+ {
+ value = v;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/transfer/gradio.config.js b/frontend/antd/transfer/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/transfer/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/transfer/package.json b/frontend/antd/transfer/package.json
new file mode 100644
index 00000000..61ae9896
--- /dev/null
+++ b/frontend/antd/transfer/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-transfer",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/transfer/transfer.tsx b/frontend/antd/transfer/transfer.tsx
new file mode 100644
index 00000000..a2188588
--- /dev/null
+++ b/frontend/antd/transfer/transfer.tsx
@@ -0,0 +1,99 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { useTargets } from '@utils/hooks/useTargets';
+import { type GetProps, Transfer as ATransfer } from 'antd';
+
+export const Transfer = sveltify<
+ GetProps & {
+ children?: React.ReactNode;
+ onValueChange: (value: (string | number)[]) => void;
+ },
+ [
+ 'selectionsIcon',
+ 'titles',
+ 'footer',
+ 'locale.notFoundContent',
+ 'selectAllLabels',
+ ]
+>(
+ ({
+ slots,
+ children,
+ render,
+ filterOption,
+ footer,
+ listStyle,
+ locale,
+ onChange,
+ onValueChange,
+ ...props
+ }) => {
+ const titles = useTargets(children, 'titles');
+ const selectAllLabels = useTargets(children, 'selectAllLabels');
+ const renderFunction = useFunction(render);
+ const listStyleFunction = useFunction(listStyle);
+ const footerFunction = useFunction(footer);
+ const filterOptionFunction = useFunction(filterOption);
+ return (
+ <>
+ {children}
+ {
+ onChange?.(targetKeys, ...args);
+ onValueChange(targetKeys as (string | number)[]);
+ }}
+ selectionsIcon={
+ slots.selectionsIcon ? (
+
+ ) : (
+ props.selectionsIcon
+ )
+ }
+ locale={
+ slots['locale.notFoundContent']
+ ? {
+ ...locale,
+ notFoundContent: (
+
+ ),
+ }
+ : locale
+ }
+ render={
+ renderFunction ||
+ ((item) => ({
+ label: item.title || item.label,
+ value: item.value || item.title || item.label,
+ }))
+ }
+ filterOption={filterOptionFunction}
+ footer={
+ footerFunction ||
+ (slots.footer
+ ? () => (slots.footer ? : null)
+ : footer)
+ }
+ titles={
+ titles.length > 0
+ ? titles.map((target, index) => {
+ return ;
+ })
+ : props.titles
+ }
+ listStyle={listStyleFunction || listStyle}
+ selectAllLabels={
+ selectAllLabels.length > 0
+ ? selectAllLabels.map((target, index) => {
+ return ;
+ })
+ : props.selectAllLabels
+ }
+ />
+ >
+ );
+ }
+);
+export default Transfer;
diff --git a/frontend/antd/tree-select/Index.svelte b/frontend/antd/tree-select/Index.svelte
new file mode 100644
index 00000000..54dd0cb6
--- /dev/null
+++ b/frontend/antd/tree-select/Index.svelte
@@ -0,0 +1,79 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTreeSelect then TreeSelect}
+ {
+ value = val;
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tree-select/context.ts b/frontend/antd/tree-select/context.ts
new file mode 100644
index 00000000..6f0734d6
--- /dev/null
+++ b/frontend/antd/tree-select/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('tree-select');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/tree-select/gradio.config.js b/frontend/antd/tree-select/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/tree-select/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tree-select/package.json b/frontend/antd/tree-select/package.json
new file mode 100644
index 00000000..d55ff517
--- /dev/null
+++ b/frontend/antd/tree-select/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tree-select",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tree-select/tree-node/Index.svelte b/frontend/antd/tree-select/tree-node/Index.svelte
new file mode 100644
index 00000000..03f7432d
--- /dev/null
+++ b/frontend/antd/tree-select/tree-node/Index.svelte
@@ -0,0 +1,87 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/tree-select/tree-node/gradio.config.js b/frontend/antd/tree-select/tree-node/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/tree-select/tree-node/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tree-select/tree-node/package.json b/frontend/antd/tree-select/tree-node/package.json
new file mode 100644
index 00000000..7da27141
--- /dev/null
+++ b/frontend/antd/tree-select/tree-node/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tree-select.tree-node",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tree-select/tree-select.tsx b/frontend/antd/tree-select/tree-select.tsx
new file mode 100644
index 00000000..703e16c3
--- /dev/null
+++ b/frontend/antd/tree-select/tree-select.tsx
@@ -0,0 +1,119 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { omitUndefinedProps } from '@utils/omitUndefinedProps';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, TreeSelect as ATreeSelect } from 'antd';
+
+import { type Item } from './context';
+
+type TreeSelectProps = GetProps;
+
+export const TreeSelect = sveltify<
+ TreeSelectProps & {
+ slotItems: Item[];
+ onValueChange: (options: string | string[]) => void;
+ },
+ [
+ 'allowClear.clearIcon',
+ 'maxTagPlaceholder',
+ 'notFoundContent',
+ 'suffixIcon',
+ 'switcherIcon',
+ ]
+>(
+ ({
+ slots,
+ filterTreeNode,
+ getPopupContainer,
+ dropdownRender,
+ tagRender,
+ treeTitleRender,
+ treeData,
+ onValueChange,
+ onChange,
+ children,
+ slotItems,
+ maxTagPlaceholder,
+ elRef,
+ ...props
+ }) => {
+ const filterTreeNodeFunction = useFunction(filterTreeNode);
+ const getPopupContainerFunction = useFunction(getPopupContainer);
+ const maxTagPlaceholderFunction = useFunction(maxTagPlaceholder);
+ const tagRenderFunction = useFunction(tagRender);
+ const dropdownRenderFunction = useFunction(dropdownRender);
+ const treeTitleRenderFunction = useFunction(treeTitleRender);
+
+ const componentProps: TreeSelectProps = useMemo(() => {
+ return {
+ ...props,
+ treeData:
+ treeData ||
+ renderItems[number]>(
+ slotItems
+ ),
+ dropdownRender: dropdownRenderFunction,
+ allowClear: slots['allowClear.clearIcon']
+ ? {
+ clearIcon: ,
+ }
+ : props.allowClear,
+ suffixIcon: slots.suffixIcon ? (
+
+ ) : (
+ props.suffixIcon
+ ),
+ switcherIcon: slots.switcherIcon ? (
+
+ ) : (
+ props.switcherIcon
+ ),
+ getPopupContainer: getPopupContainerFunction,
+ tagRender: tagRenderFunction,
+ treeTitleRender: treeTitleRenderFunction,
+ filterTreeNode: filterTreeNodeFunction || filterTreeNode,
+ maxTagPlaceholder:
+ maxTagPlaceholderFunction ||
+ (slots.maxTagPlaceholder ? (
+
+ ) : (
+ maxTagPlaceholder
+ )),
+ notFoundContent: slots.notFoundContent ? (
+
+ ) : (
+ props.notFoundContent
+ ),
+ };
+ }, [
+ dropdownRenderFunction,
+ filterTreeNode,
+ filterTreeNodeFunction,
+ getPopupContainerFunction,
+ maxTagPlaceholder,
+ maxTagPlaceholderFunction,
+ props,
+ slotItems,
+ slots,
+ tagRenderFunction,
+ treeData,
+ treeTitleRenderFunction,
+ ]);
+ return (
+ <>
+ {children}
+ {
+ onChange?.(v, ...args);
+ onValueChange(v as string | string[]);
+ }}
+ />
+ >
+ );
+ }
+);
+export default TreeSelect;
diff --git a/frontend/antd/tree/Index.svelte b/frontend/antd/tree/Index.svelte
new file mode 100644
index 00000000..6bf7c5a6
--- /dev/null
+++ b/frontend/antd/tree/Index.svelte
@@ -0,0 +1,95 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTree then Tree}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tree/context.ts b/frontend/antd/tree/context.ts
new file mode 100644
index 00000000..1a18e5f6
--- /dev/null
+++ b/frontend/antd/tree/context.ts
@@ -0,0 +1,6 @@
+import { createItemsContext } from '@utils/createItemsContext';
+
+const { getItems, getSetItemFn } = createItemsContext('tree');
+
+export { getItems, getSetItemFn };
+export * from '@utils/createItemsContext';
diff --git a/frontend/antd/tree/directory-tree/Index.svelte b/frontend/antd/tree/directory-tree/Index.svelte
new file mode 100644
index 00000000..7726fdbd
--- /dev/null
+++ b/frontend/antd/tree/directory-tree/Index.svelte
@@ -0,0 +1,96 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedDirectoryTree then DirectoryTree}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/tree/directory-tree/gradio.config.js b/frontend/antd/tree/directory-tree/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/tree/directory-tree/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tree/directory-tree/package.json b/frontend/antd/tree/directory-tree/package.json
new file mode 100644
index 00000000..f8d9e6fe
--- /dev/null
+++ b/frontend/antd/tree/directory-tree/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tree.directory-tree",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tree/gradio.config.js b/frontend/antd/tree/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/tree/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tree/package.json b/frontend/antd/tree/package.json
new file mode 100644
index 00000000..a750487a
--- /dev/null
+++ b/frontend/antd/tree/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tree",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tree/tree-node/Index.svelte b/frontend/antd/tree/tree-node/Index.svelte
new file mode 100644
index 00000000..ef97471a
--- /dev/null
+++ b/frontend/antd/tree/tree-node/Index.svelte
@@ -0,0 +1,83 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/antd/tree/tree-node/gradio.config.js b/frontend/antd/tree/tree-node/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/tree/tree-node/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/tree/tree-node/package.json b/frontend/antd/tree/tree-node/package.json
new file mode 100644
index 00000000..599b30e4
--- /dev/null
+++ b/frontend/antd/tree/tree-node/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-tree.tree-node",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/tree/tree.tsx b/frontend/antd/tree/tree.tsx
new file mode 100644
index 00000000..f4351154
--- /dev/null
+++ b/frontend/antd/tree/tree.tsx
@@ -0,0 +1,134 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { useFunction } from '@utils/hooks/useFunction';
+import { omitUndefinedProps } from '@utils/omitUndefinedProps';
+import { renderItems } from '@utils/renderItems';
+import { type GetProps, Tree as ATree } from 'antd';
+
+import { type Item } from './context';
+
+type TreeProps = GetProps;
+
+export const Tree = sveltify<
+ TreeProps & {
+ slotItems: Item[];
+ directory?: boolean;
+ onValueChange: (options: {
+ expandedKeys?: React.Key[];
+ selectedKeys?: React.Key[];
+ checkedKeys?:
+ | React.Key[]
+ | { checked: React.Key[]; halfChecked: React.Key[] };
+ }) => void;
+ },
+ [
+ 'switcherLoadingIcon',
+ 'switcherIcon',
+ 'showLine.showLeafIcon',
+ 'icon',
+ 'draggable.icon',
+ ]
+>(
+ ({
+ slots,
+ filterTreeNode,
+ treeData,
+ draggable,
+ allowDrop,
+ onValueChange,
+ onCheck,
+ onSelect,
+ onExpand,
+ children,
+ directory,
+ slotItems,
+ ...props
+ }) => {
+ const filterTreeNodeFunction = useFunction(filterTreeNode);
+ const draggableFunction = useFunction(draggable);
+ const draggableNodeDraggableFunction = useFunction(
+ typeof draggable === 'object' ? draggable.nodeDraggable : undefined
+ );
+ const allowDropFunction = useFunction(allowDrop);
+ const TreeComponent = directory ? ATree.DirectoryTree : ATree;
+ const componentProps = useMemo(() => {
+ return {
+ ...props,
+ treeData:
+ treeData ||
+ renderItems[number]>(slotItems),
+ showLine: slots['showLine.showLeafIcon']
+ ? {
+ showLeafIcon: ,
+ }
+ : props.showLine,
+ icon: slots.icon ? : props.icon,
+ switcherLoadingIcon: slots.switcherLoadingIcon ? (
+
+ ) : (
+ props.switcherLoadingIcon
+ ),
+ switcherIcon: slots.switcherIcon ? (
+
+ ) : (
+ props.switcherIcon
+ ),
+ draggable:
+ slots['draggable.icon'] || draggableNodeDraggableFunction
+ ? {
+ icon: slots['draggable.icon'] ? (
+
+ ) : typeof draggable === 'object' ? (
+ draggable.icon
+ ) : undefined,
+ nodeDraggable: draggableNodeDraggableFunction,
+ }
+ : draggableFunction || draggable,
+ };
+ }, [
+ draggable,
+ draggableFunction,
+ draggableNodeDraggableFunction,
+ props,
+ slotItems,
+ slots,
+ treeData,
+ ]);
+ return (
+ <>
+ {children}
+ {
+ onSelect?.(selected, ...args);
+ onValueChange({
+ selectedKeys: selected,
+ expandedKeys: props.expandedKeys,
+ checkedKeys: props.checkedKeys,
+ });
+ }}
+ onExpand={(expanded, ...args) => {
+ onExpand?.(expanded, ...args);
+ onValueChange({
+ expandedKeys: expanded,
+ selectedKeys: props.selectedKeys,
+ checkedKeys: props.checkedKeys,
+ });
+ }}
+ onCheck={(checked, ...args) => {
+ onCheck?.(checked, ...args);
+ onValueChange({
+ checkedKeys: checked,
+ selectedKeys: props.selectedKeys,
+ expandedKeys: props.expandedKeys,
+ });
+ }}
+ />
+ >
+ );
+ }
+);
+export default Tree;
diff --git a/frontend/antd/typography/Base.svelte b/frontend/antd/typography/Base.svelte
new file mode 100644
index 00000000..f728f140
--- /dev/null
+++ b/frontend/antd/typography/Base.svelte
@@ -0,0 +1,81 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedTypographyBase then TypographyBase}
+
+ {#if $mergedProps._internal.layout}
+
+ {:else}
+ {$mergedProps.value}
+ {/if}
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/typography/link/Index.svelte b/frontend/antd/typography/link/Index.svelte
new file mode 100644
index 00000000..aa30731f
--- /dev/null
+++ b/frontend/antd/typography/link/Index.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/typography/link/gradio.config.js b/frontend/antd/typography/link/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/typography/link/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/typography/link/package.json b/frontend/antd/typography/link/package.json
new file mode 100644
index 00000000..47a8971d
--- /dev/null
+++ b/frontend/antd/typography/link/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-typography.link",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/typography/paragraph/Index.svelte b/frontend/antd/typography/paragraph/Index.svelte
new file mode 100644
index 00000000..ea4edc6e
--- /dev/null
+++ b/frontend/antd/typography/paragraph/Index.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/typography/paragraph/gradio.config.js b/frontend/antd/typography/paragraph/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/typography/paragraph/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/typography/paragraph/package.json b/frontend/antd/typography/paragraph/package.json
new file mode 100644
index 00000000..3c201f96
--- /dev/null
+++ b/frontend/antd/typography/paragraph/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-typography.paragraph",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/typography/text/Index.svelte b/frontend/antd/typography/text/Index.svelte
new file mode 100644
index 00000000..3877ea92
--- /dev/null
+++ b/frontend/antd/typography/text/Index.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/typography/text/gradio.config.js b/frontend/antd/typography/text/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/typography/text/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/typography/text/package.json b/frontend/antd/typography/text/package.json
new file mode 100644
index 00000000..6519b5d2
--- /dev/null
+++ b/frontend/antd/typography/text/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-typography.text",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/typography/title/Index.svelte b/frontend/antd/typography/title/Index.svelte
new file mode 100644
index 00000000..c5f2f89c
--- /dev/null
+++ b/frontend/antd/typography/title/Index.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/frontend/antd/typography/title/gradio.config.js b/frontend/antd/typography/title/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/typography/title/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/typography/title/package.json b/frontend/antd/typography/title/package.json
new file mode 100644
index 00000000..3560b395
--- /dev/null
+++ b/frontend/antd/typography/title/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-typography.title",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/typography/typography.base.tsx b/frontend/antd/typography/typography.base.tsx
new file mode 100644
index 00000000..8cab0e54
--- /dev/null
+++ b/frontend/antd/typography/typography.base.tsx
@@ -0,0 +1,152 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import React, { useMemo } from 'react';
+import { type GetProps, Typography } from 'antd';
+import type { EllipsisConfig } from 'antd/es/typography/Base';
+import cls from 'classnames';
+
+import { useTargets } from '../../utils/hooks/useTargets';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+
+export const TypographyBase = sveltify<
+ GetProps &
+ GetProps &
+ GetProps &
+ GetProps & {
+ component: 'title' | 'paragraph' | 'text' | 'link';
+ },
+ [
+ 'copyable.icon',
+ // list
+ 'copyable.tooltips',
+ 'editable.icon',
+ 'editable.tooltip',
+ 'editable.enterIcon',
+ 'ellipsis.symbol',
+ 'ellipsis.tooltip',
+ 'ellipsis.tooltip.title',
+ ]
+>(
+ ({
+ component,
+ className,
+ slots,
+ children,
+ copyable,
+ editable,
+ ellipsis,
+ ...props
+ }) => {
+ const copyableTooltipsTargets = useTargets(children, 'copyable.tooltips');
+ const supportCopy =
+ slots['copyable.icon'] || copyableTooltipsTargets.length > 0 || copyable;
+ const supportEdit =
+ slots['editable.icon'] ||
+ slots['editable.tooltip'] ||
+ slots['editable.enterIcon'] ||
+ editable;
+ const supportEllipsis =
+ slots['ellipsis.symbol'] ||
+ slots['ellipsis.tooltip'] ||
+ slots['ellipsis.tooltip.title'] ||
+ ellipsis;
+ const copyableConfig = getConfig(copyable);
+ const editableConfig = getConfig(editable);
+ const ellipsisConfig = getConfig(ellipsis);
+
+ const TypographyComponent = useMemo(() => {
+ switch (component) {
+ case 'title':
+ return Typography.Title;
+ case 'paragraph':
+ return Typography.Paragraph;
+ case 'text':
+ return Typography.Text;
+ case 'link':
+ return Typography.Link;
+ }
+ }, [component]);
+ return (
+ 0
+ ? copyableTooltipsTargets.map((slot, index) => {
+ return ;
+ })
+ : copyableConfig.tooltips,
+ icon: slots['copyable.icon'] ? (
+
+ ) : (
+ copyableConfig.icon
+ ),
+ }
+ : undefined
+ }
+ editable={
+ supportEdit
+ ? {
+ ...editableConfig,
+ icon: slots['editable.icon'] ? (
+
+ ) : (
+ editableConfig.icon
+ ),
+ tooltip: slots['editable.tooltip'] ? (
+
+ ) : (
+ editableConfig.tooltip
+ ),
+ enterIcon: slots['editable.enterIcon'] ? (
+
+ ) : (
+ editableConfig.enterIcon
+ ),
+ }
+ : undefined
+ }
+ ellipsis={
+ (component === 'link'
+ ? !!supportEllipsis
+ : supportEllipsis
+ ? ({
+ ...ellipsisConfig,
+ symbol: slots['ellipsis.symbol'] ? (
+
+ ) : (
+ ellipsisConfig.symbol
+ ),
+ tooltip: slots['ellipsis.tooltip'] ? (
+
+ ) : (
+ {
+ ...ellipsisConfig.tooltip,
+ title: slots['ellipsis.tooltip.title'] ? (
+
+ ) : (
+ ellipsisConfig.tooltip.title
+ ),
+ }
+ ),
+ } as EllipsisConfig)
+ : undefined) as boolean
+ }
+ >
+ {children}
+
+ );
+ }
+);
+
+export default TypographyBase;
diff --git a/frontend/antd/upload/Index.svelte b/frontend/antd/upload/Index.svelte
new file mode 100644
index 00000000..465262bc
--- /dev/null
+++ b/frontend/antd/upload/Index.svelte
@@ -0,0 +1,83 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedUpload then Upload}
+ {
+ value = v;
+ }}
+ upload={async (files) => {
+ return (
+ (await gradio.client.upload(await prepare_files(files), root)) || []
+ );
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/upload/dragger/Index.svelte b/frontend/antd/upload/dragger/Index.svelte
new file mode 100644
index 00000000..f315f633
--- /dev/null
+++ b/frontend/antd/upload/dragger/Index.svelte
@@ -0,0 +1,85 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedUploadDragger then UploadDragger}
+ {
+ value = v;
+ }}
+ upload={async (files) => {
+ return (
+ (await gradio.client.upload(await prepare_files(files), root)) || []
+ );
+ }}
+ >
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/upload/dragger/gradio.config.js b/frontend/antd/upload/dragger/gradio.config.js
new file mode 100644
index 00000000..1992403d
--- /dev/null
+++ b/frontend/antd/upload/dragger/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/upload/dragger/package.json b/frontend/antd/upload/dragger/package.json
new file mode 100644
index 00000000..38348199
--- /dev/null
+++ b/frontend/antd/upload/dragger/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-upload.dragger",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/upload/dragger/upload.dragger.tsx b/frontend/antd/upload/dragger/upload.dragger.tsx
new file mode 100644
index 00000000..95d78d70
--- /dev/null
+++ b/frontend/antd/upload/dragger/upload.dragger.tsx
@@ -0,0 +1,146 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import type { FileData } from '@gradio/client';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Upload as AUpload } from 'antd';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+export const UploadDragger = sveltify<
+ Omit, 'fileList' | 'onChange'> & {
+ onValueChange?: (value: FileData[]) => void;
+ onChange?: (value: string[]) => void;
+ upload: (files: File[]) => Promise<(FileData | null)[]>;
+ fileList: FileData[];
+ },
+ [
+ 'showUploadList.extra',
+ 'showUploadList.previewIcon',
+ 'showUploadList.removeIcon',
+ 'showUploadList.downloadIcon',
+ ]
+>(
+ ({
+ slots,
+ upload,
+ showUploadList,
+ progress,
+ beforeUpload,
+ customRequest,
+ previewFile,
+ isImageUrl,
+ itemRender,
+ iconRender,
+ data,
+ onChange,
+ onValueChange,
+ onRemove,
+ fileList,
+ ...props
+ }) => {
+ const supportShowUploadListConfig =
+ slots['showUploadList.downloadIcon'] ||
+ slots['showUploadList.removeIcon'] ||
+ slots['showUploadList.previewIcon'] ||
+ slots['showUploadList.extra'] ||
+ typeof showUploadList === 'object';
+ const showUploadListConfig = getConfig(showUploadList);
+ const beforeUploadFunction = useFunction(beforeUpload);
+ const customRequestFunction = useFunction(customRequest);
+ const progressFormatFunction = useFunction(progress?.format);
+ const previewFileFunction = useFunction(previewFile);
+ const isImageUrlFunction = useFunction(isImageUrl);
+ const itemRenderFunction = useFunction(itemRender);
+ const iconRenderFunction = useFunction(iconRender);
+ const dataFunction = useFunction(data);
+ const validFileList = useMemo(() => {
+ return (
+ fileList?.map((file) => ({
+ ...file,
+ name: file.orig_name || file.path,
+ uid: file.url || file.path,
+ status: 'done' as const,
+ })) || []
+ );
+ }, [fileList]);
+ return (
+ {
+ onRemove?.(file);
+ const index = validFileList.findIndex((v) => v.uid === file.uid);
+ const newFileList = fileList.slice();
+ newFileList.splice(index, 1);
+ onValueChange?.(newFileList);
+ onChange?.(newFileList.map((v) => v.path));
+ }}
+ beforeUpload={async (file, files) => {
+ if (beforeUploadFunction) {
+ if (!(await beforeUploadFunction(file, files))) {
+ return false;
+ }
+ }
+ const fileDataList = (await upload([file])).filter(
+ (v) => v
+ ) as FileData[];
+
+ onValueChange?.([...fileList, ...fileDataList]);
+ onChange?.([
+ ...fileList.map((v) => v.path),
+ ...fileDataList.map((v) => v.path),
+ ]);
+ return false;
+ }}
+ customRequest={customRequestFunction}
+ progress={
+ progress
+ ? {
+ ...progress,
+ format: progressFormatFunction,
+ }
+ : progress
+ }
+ showUploadList={
+ supportShowUploadListConfig
+ ? {
+ ...showUploadListConfig,
+ downloadIcon: slots['showUploadList.downloadIcon'] ? (
+
+ ) : (
+ showUploadListConfig.downloadIcon
+ ),
+ removeIcon: slots['showUploadList.removeIcon'] ? (
+
+ ) : (
+ showUploadListConfig.removeIcon
+ ),
+ previewIcon: slots['showUploadList.previewIcon'] ? (
+
+ ) : (
+ showUploadListConfig.previewIcon
+ ),
+ extra: slots['showUploadList.extra'] ? (
+
+ ) : (
+ showUploadListConfig.extra
+ ),
+ }
+ : showUploadList
+ }
+ />
+ );
+ }
+);
+
+export default UploadDragger;
diff --git a/frontend/antd/upload/gradio.config.js b/frontend/antd/upload/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/upload/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/upload/package.json b/frontend/antd/upload/package.json
new file mode 100644
index 00000000..3ae0e15a
--- /dev/null
+++ b/frontend/antd/upload/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-upload",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/upload/upload.tsx b/frontend/antd/upload/upload.tsx
new file mode 100644
index 00000000..c440e942
--- /dev/null
+++ b/frontend/antd/upload/upload.tsx
@@ -0,0 +1,146 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { ReactSlot } from '@svelte-preprocess-react/react-slot';
+import { useMemo } from 'react';
+import type { FileData } from '@gradio/client';
+import { useFunction } from '@utils/hooks/useFunction';
+import { type GetProps, Upload as AUpload } from 'antd';
+
+function getConfig(value: T): Partial> {
+ if (typeof value === 'object' && value !== null) {
+ return value as any;
+ }
+ return {} as any;
+}
+export const Upload = sveltify<
+ Omit, 'fileList' | 'onChange'> & {
+ onValueChange?: (value: FileData[]) => void;
+ onChange?: (value: string[]) => void;
+ upload: (files: File[]) => Promise<(FileData | null)[]>;
+ fileList: FileData[];
+ },
+ [
+ 'showUploadList.extra',
+ 'showUploadList.previewIcon',
+ 'showUploadList.removeIcon',
+ 'showUploadList.downloadIcon',
+ ]
+>(
+ ({
+ slots,
+ upload,
+ showUploadList,
+ progress,
+ beforeUpload,
+ customRequest,
+ previewFile,
+ isImageUrl,
+ itemRender,
+ iconRender,
+ data,
+ onChange,
+ onValueChange,
+ onRemove,
+ fileList,
+ ...props
+ }) => {
+ const supportShowUploadListConfig =
+ slots['showUploadList.downloadIcon'] ||
+ slots['showUploadList.removeIcon'] ||
+ slots['showUploadList.previewIcon'] ||
+ slots['showUploadList.extra'] ||
+ typeof showUploadList === 'object';
+ const showUploadListConfig = getConfig(showUploadList);
+ const beforeUploadFunction = useFunction(beforeUpload);
+ const customRequestFunction = useFunction(customRequest);
+ const progressFormatFunction = useFunction(progress?.format);
+ const previewFileFunction = useFunction(previewFile);
+ const isImageUrlFunction = useFunction(isImageUrl);
+ const itemRenderFunction = useFunction(itemRender);
+ const iconRenderFunction = useFunction(iconRender);
+ const dataFunction = useFunction(data);
+ const validFileList = useMemo(() => {
+ return (
+ fileList?.map((file) => ({
+ ...file,
+ name: file.orig_name || file.path,
+ uid: file.url || file.path,
+ status: 'done' as const,
+ })) || []
+ );
+ }, [fileList]);
+ return (
+ {
+ onRemove?.(file);
+ const index = validFileList.findIndex((v) => v.uid === file.uid);
+ const newFileList = fileList.slice();
+ newFileList.splice(index, 1);
+ onValueChange?.(newFileList);
+ onChange?.(newFileList.map((v) => v.path));
+ }}
+ beforeUpload={async (file, files) => {
+ if (beforeUploadFunction) {
+ if (!(await beforeUploadFunction(file, files))) {
+ return false;
+ }
+ }
+ const fileDataList = (await upload([file])).filter(
+ (v) => v
+ ) as FileData[];
+
+ onValueChange?.([...fileList, ...fileDataList]);
+ onChange?.([
+ ...fileList.map((v) => v.path),
+ ...fileDataList.map((v) => v.path),
+ ]);
+ return false;
+ }}
+ customRequest={customRequestFunction}
+ progress={
+ progress
+ ? {
+ ...progress,
+ format: progressFormatFunction,
+ }
+ : progress
+ }
+ showUploadList={
+ supportShowUploadListConfig
+ ? {
+ ...showUploadListConfig,
+ downloadIcon: slots['showUploadList.downloadIcon'] ? (
+
+ ) : (
+ showUploadListConfig.downloadIcon
+ ),
+ removeIcon: slots['showUploadList.removeIcon'] ? (
+
+ ) : (
+ showUploadListConfig.removeIcon
+ ),
+ previewIcon: slots['showUploadList.previewIcon'] ? (
+
+ ) : (
+ showUploadListConfig.previewIcon
+ ),
+ extra: slots['showUploadList.extra'] ? (
+
+ ) : (
+ showUploadListConfig.extra
+ ),
+ }
+ : showUploadList
+ }
+ />
+ );
+ }
+);
+
+export default Upload;
diff --git a/frontend/antd/watermark/Index.svelte b/frontend/antd/watermark/Index.svelte
new file mode 100644
index 00000000..8534c5df
--- /dev/null
+++ b/frontend/antd/watermark/Index.svelte
@@ -0,0 +1,73 @@
+
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedWatermark then Watermark}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/antd/watermark/gradio.config.js b/frontend/antd/watermark/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/antd/watermark/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/antd/watermark/package.json b/frontend/antd/watermark/package.json
new file mode 100644
index 00000000..bda0363e
--- /dev/null
+++ b/frontend/antd/watermark/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-watermark",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/antd/watermark/watermark.tsx b/frontend/antd/watermark/watermark.tsx
new file mode 100644
index 00000000..6b768081
--- /dev/null
+++ b/frontend/antd/watermark/watermark.tsx
@@ -0,0 +1,5 @@
+import { sveltify } from '@svelte-preprocess-react';
+import { type GetProps, Watermark as AWatermark } from 'antd';
+
+export const Watermark = sveltify>(AWatermark);
+export default Watermark;
diff --git a/frontend/base/application/Index.svelte b/frontend/base/application/Index.svelte
new file mode 100644
index 00000000..1e5862ff
--- /dev/null
+++ b/frontend/base/application/Index.svelte
@@ -0,0 +1,30 @@
+
+
+
+
+{#if visible}
+
+
+
+{/if}
+
+
diff --git a/frontend/base/application/gradio.config.js b/frontend/base/application/gradio.config.js
new file mode 100644
index 00000000..3cf1a1f7
--- /dev/null
+++ b/frontend/base/application/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config({ external: false });
diff --git a/frontend/base/application/package.json b/frontend/base/application/package.json
new file mode 100644
index 00000000..3b0097e7
--- /dev/null
+++ b/frontend/base/application/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-application",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/base/div/Index.svelte b/frontend/base/div/Index.svelte
new file mode 100644
index 00000000..0838d1bf
--- /dev/null
+++ b/frontend/base/div/Index.svelte
@@ -0,0 +1,104 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+ {#if $mergedProps._internal.layout}
+
+ {:else}
+ {$mergedProps.value}
+ {/if}
+
+
+{/if}
+
+
diff --git a/frontend/base/div/gradio.config.js b/frontend/base/div/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/base/div/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/base/div/package.json b/frontend/base/div/package.json
new file mode 100644
index 00000000..0cec1cb7
--- /dev/null
+++ b/frontend/base/div/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-div",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/base/each/Each.svelte b/frontend/base/each/Each.svelte
new file mode 100644
index 00000000..510513a6
--- /dev/null
+++ b/frontend/base/each/Each.svelte
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/frontend/base/each/Index.svelte b/frontend/base/each/Index.svelte
new file mode 100644
index 00000000..48e8d633
--- /dev/null
+++ b/frontend/base/each/Index.svelte
@@ -0,0 +1,42 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#each $mergedProps.value as item, i}
+
+
+
+ {/each}
+{/if}
+
+
diff --git a/frontend/base/each/gradio.config.js b/frontend/base/each/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/base/each/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/base/each/package.json b/frontend/base/each/package.json
new file mode 100644
index 00000000..b39fab86
--- /dev/null
+++ b/frontend/base/each/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-each",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/base/filter/Index.svelte b/frontend/base/filter/Index.svelte
new file mode 100644
index 00000000..538f75e8
--- /dev/null
+++ b/frontend/base/filter/Index.svelte
@@ -0,0 +1,50 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/base/filter/gradio.config.js b/frontend/base/filter/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/base/filter/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/base/filter/package.json b/frontend/base/filter/package.json
new file mode 100644
index 00000000..daf9a8f0
--- /dev/null
+++ b/frontend/base/filter/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-filter",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/base/fragment/Index.svelte b/frontend/base/fragment/Index.svelte
new file mode 100644
index 00000000..f867c55a
--- /dev/null
+++ b/frontend/base/fragment/Index.svelte
@@ -0,0 +1,38 @@
+
+
+
+
+{#if $mergedProps.visible}
+ {#await AwaitedFragment then Fragment}
+
+
+
+ {/await}
+{/if}
+
+
diff --git a/frontend/base/fragment/ShowFragment.svelte b/frontend/base/fragment/ShowFragment.svelte
new file mode 100644
index 00000000..e680b493
--- /dev/null
+++ b/frontend/base/fragment/ShowFragment.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+{#if show}
+
+
+
+{:else}
+
+{/if}
diff --git a/frontend/base/fragment/fragment.tsx b/frontend/base/fragment/fragment.tsx
new file mode 100644
index 00000000..4225728a
--- /dev/null
+++ b/frontend/base/fragment/fragment.tsx
@@ -0,0 +1,10 @@
+import { sveltify } from '@svelte-preprocess-react';
+import React from 'react';
+
+export const Fragment = sveltify<{
+ children?: React.ReactNode;
+}>(({ children }) => {
+ return <>{children}>;
+});
+
+export default Fragment;
diff --git a/frontend/base/fragment/gradio.config.js b/frontend/base/fragment/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/base/fragment/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/base/fragment/package.json b/frontend/base/fragment/package.json
new file mode 100644
index 00000000..d50f25e7
--- /dev/null
+++ b/frontend/base/fragment/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "@modelscope-studio/antd-fragment",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./ShowFragment": "./ShowFragment.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/base/slot/Index.svelte b/frontend/base/slot/Index.svelte
new file mode 100644
index 00000000..e106693d
--- /dev/null
+++ b/frontend/base/slot/Index.svelte
@@ -0,0 +1,77 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+{/if}
+
+
diff --git a/frontend/base/slot/gradio.config.js b/frontend/base/slot/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/base/slot/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/base/slot/package.json b/frontend/base/slot/package.json
new file mode 100644
index 00000000..7ed25fc9
--- /dev/null
+++ b/frontend/base/slot/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-slot",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/base/span/Index.svelte b/frontend/base/span/Index.svelte
new file mode 100644
index 00000000..73e517fc
--- /dev/null
+++ b/frontend/base/span/Index.svelte
@@ -0,0 +1,104 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+
+ {#if $mergedProps._internal.layout}
+
+ {:else}
+ {$mergedProps.value}
+ {/if}
+
+
+{/if}
+
+
diff --git a/frontend/base/span/gradio.config.js b/frontend/base/span/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/base/span/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/base/span/package.json b/frontend/base/span/package.json
new file mode 100644
index 00000000..a8f90145
--- /dev/null
+++ b/frontend/base/span/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-span",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/base/text/Index.svelte b/frontend/base/text/Index.svelte
new file mode 100644
index 00000000..8674dfce
--- /dev/null
+++ b/frontend/base/text/Index.svelte
@@ -0,0 +1,36 @@
+
+
+
+
+{#if $mergedProps.visible}
+
+ {$mergedProps.value}
+
+{/if}
diff --git a/frontend/base/text/global.css b/frontend/base/text/global.css
new file mode 100644
index 00000000..9d7608a9
--- /dev/null
+++ b/frontend/base/text/global.css
@@ -0,0 +1,3 @@
+.ms-gr-antd-noop-class {
+ display: none;
+}
diff --git a/frontend/base/text/gradio.config.js b/frontend/base/text/gradio.config.js
new file mode 100644
index 00000000..916857c0
--- /dev/null
+++ b/frontend/base/text/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config();
diff --git a/frontend/base/text/package.json b/frontend/base/text/package.json
new file mode 100644
index 00000000..0a35c503
--- /dev/null
+++ b/frontend/base/text/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "@modelscope-studio/antd-text",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ }
+}
diff --git a/frontend/compiled/tsconfig.build.json b/frontend/compiled/tsconfig.build.json
deleted file mode 100644
index 0933fc76..00000000
--- a/frontend/compiled/tsconfig.build.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES2020",
- "useDefineForClassFields": true,
- "lib": ["ESNext", "DOM", "DOM.Iterable"],
- "module": "ESNext",
- "skipLibCheck": true,
-
- /* Bundler mode */
- "moduleResolution": "bundler",
- "allowImportingTsExtensions": true,
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "types": ["vite/client"],
-
- /* Linting */
- "strict": true
- // "noUnusedLocals": true,
- // "noUnusedParameters": true,
- // "noFallthroughCasesInSwitch": true
- },
- "include": ["src"],
- "references": [{ "path": "./tsconfig.node.json" }]
-}
diff --git a/frontend/compiled/tsconfig.json b/frontend/compiled/tsconfig.json
deleted file mode 100644
index 75d6e0f8..00000000
--- a/frontend/compiled/tsconfig.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES2020",
- "useDefineForClassFields": true,
- "lib": ["ESNext", "DOM", "DOM.Iterable"],
- "module": "ESNext",
- "skipLibCheck": true,
-
- /* Bundler mode */
- "moduleResolution": "bundler",
- "allowImportingTsExtensions": true,
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "types": ["vite/client"],
- /* Linting */
- "strict": true
- // "noUnusedLocals": true,
- // "noUnusedParameters": true,
- // "noFallthroughCasesInSwitch": true
- },
- "include": ["src", "components", "index.ts", "global.d.ts"],
- "references": [{ "path": "./tsconfig.node.json" }]
-}
diff --git a/frontend/compiled/tsconfig.node.json b/frontend/compiled/tsconfig.node.json
deleted file mode 100644
index 397a3a3a..00000000
--- a/frontend/compiled/tsconfig.node.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "compilerOptions": {
- "composite": true,
- "strict": true,
- "skipLibCheck": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "allowSyntheticDefaultImports": true
- },
- "include": ["vite.config.ts"]
-}
diff --git a/frontend/compiled/vite.config.ts b/frontend/compiled/vite.config.ts
deleted file mode 100644
index 59d9ca8a..00000000
--- a/frontend/compiled/vite.config.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import react from '@vitejs/plugin-react-swc';
-import path from 'path';
-import { defineConfig } from 'vite';
-import dts from 'vite-plugin-dts';
-import { libInjectCss } from 'vite-plugin-lib-inject-css';
-
-const libEntryFile = path.resolve(__dirname, 'src/index.ts');
-const libEntryFileDir = path.dirname(libEntryFile);
-
-const libOutDir = path.resolve(__dirname, 'build-assets');
-// https://vitejs.dev/config/
-export default defineConfig({
- plugins: [
- react(),
- libInjectCss(),
- dts({
- rollupTypes: true,
- tsconfigPath: path.resolve(__dirname, 'tsconfig.build.json'),
- outDir: libOutDir,
- }),
- {
- name: 'inject-polyfill',
- },
- ],
- define: {
- 'process.env.NODE_ENV': JSON.stringify('production'),
- },
- build: {
- minify: true,
- lib: {
- entry: libEntryFile,
- formats: ['es'],
- fileName() {
- return 'index.js';
- },
- },
- outDir: libOutDir,
- rollupOptions: {
- // external: ['react'],
- // css tree shaking
- output: {
- assetFileNames: '[name]/index[extname]',
- chunkFileNames: (chunk) => {
- const entryModuleId = chunk.moduleIds[chunk.moduleIds.length - 1];
- if (entryModuleId.includes('node_modules')) {
- const slices = entryModuleId.split('node_modules/');
- return slices[slices.length - 1];
- }
- if (
- path.basename(entryModuleId, path.extname(entryModuleId)) ===
- 'index'
- ) {
- return '[name]/index.js';
- }
- return '[name].js';
- },
- manualChunks(id, { getModuleInfo }) {
- const entryModuleInfo = getModuleInfo(libEntryFile);
- const entryModuleImportedIds = entryModuleInfo?.importedIds;
- if (entryModuleImportedIds?.includes(id)) {
- const filenameWithoutExt = path.basename(id, path.extname(id));
- if (filenameWithoutExt === 'index') {
- return path.dirname(id).replace(libEntryFileDir + path.sep, '');
- } else {
- return filenameWithoutExt;
- }
- }
- },
- },
- },
- },
-});
diff --git a/frontend/defineConfig.js b/frontend/defineConfig.js
new file mode 100644
index 00000000..e05a0aa1
--- /dev/null
+++ b/frontend/defineConfig.js
@@ -0,0 +1,18 @@
+import react from '@vitejs/plugin-react-swc';
+
+import { ModelScopeStudioVitePlugin } from './plugin.js';
+
+/**
+ * @type {(options:{ external?:boolean; }) => any}
+ */
+export default ({ external } = { external: true }) => {
+ return {
+ plugins: [react(), ModelScopeStudioVitePlugin({ external })],
+ svelte: {
+ preprocess: [],
+ },
+ build: {
+ target: 'modules',
+ },
+ };
+};
diff --git a/fixtures.d.ts b/frontend/fixtures.d.ts
similarity index 62%
rename from fixtures.d.ts
rename to frontend/fixtures.d.ts
index cae0e2a4..713e5df4 100644
--- a/fixtures.d.ts
+++ b/frontend/fixtures.d.ts
@@ -1,8 +1,11 @@
-interface Window {
- __gradio_space__: any;
+declare module 'virtual:component-loader' {
+ export const load_component;
}
-
declare module '*?inline' {
const string: string;
export default string;
}
+
+interface Window {
+ __gradio_space__: any;
+}
diff --git a/frontend/Chatbot/CHANGELOG.md b/frontend/legacy/Chatbot/CHANGELOG.md
similarity index 100%
rename from frontend/Chatbot/CHANGELOG.md
rename to frontend/legacy/Chatbot/CHANGELOG.md
diff --git a/frontend/Chatbot/Index.svelte b/frontend/legacy/Chatbot/Index.svelte
similarity index 99%
rename from frontend/Chatbot/Index.svelte
rename to frontend/legacy/Chatbot/Index.svelte
index 151d0129..1fc4feb5 100644
--- a/frontend/Chatbot/Index.svelte
+++ b/frontend/legacy/Chatbot/Index.svelte
@@ -13,7 +13,7 @@
CustomComponents,
MarkdownCustomData,
} from '@modelscope-studio/compiled';
- import { normalise_file } from '@modelscope-studio/shared';
+ import { normalise_file } from '@utils/upload';
import ChatBot from './shared/ChatBot.svelte';
import {
diff --git a/frontend/legacy/Chatbot/gradio.config.js b/frontend/legacy/Chatbot/gradio.config.js
new file mode 100644
index 00000000..abd9137f
--- /dev/null
+++ b/frontend/legacy/Chatbot/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config({ external: true });
diff --git a/frontend/Lifecycle/package.json b/frontend/legacy/Chatbot/package.json
similarity index 68%
rename from frontend/Lifecycle/package.json
rename to frontend/legacy/Chatbot/package.json
index d8042468..69c83fc3 100644
--- a/frontend/Lifecycle/package.json
+++ b/frontend/legacy/Chatbot/package.json
@@ -1,5 +1,5 @@
{
- "name": "@modelscope-studio/lifecycle",
+ "name": "@modelscope-studio/legacy-chatbot",
"version": "0.4.2",
"private": false,
"description": "ModelScope Gradio Components",
@@ -11,11 +11,8 @@
"./package.json": "./package.json"
},
"dependencies": {
- "@gradio/utils": "0.4.2",
- "svelte-i18n": "^4.0.0"
- },
- "devDependencies": {
- "@gradio/preview": "0.9.1"
+ "@modelscope-studio/legacy-compiled": "workspace:*"
},
+ "devDependencies": {},
"main_changeset": true
}
diff --git a/frontend/Chatbot/shared/ChatBot.svelte b/frontend/legacy/Chatbot/shared/ChatBot.svelte
similarity index 99%
rename from frontend/Chatbot/shared/ChatBot.svelte
rename to frontend/legacy/Chatbot/shared/ChatBot.svelte
index bf568b81..a52ad473 100644
--- a/frontend/Chatbot/shared/ChatBot.svelte
+++ b/frontend/legacy/Chatbot/shared/ChatBot.svelte
@@ -7,7 +7,7 @@
FileView,
type MarkdownCustomData,
} from '@modelscope-studio/compiled';
- import { get_fetchable_url_or_file } from '@modelscope-studio/shared';
+ import { get_fetchable_url_or_file } from '@utils/upload';
import { dequal } from 'dequal/lite';
import { afterUpdate, createEventDispatcher } from 'svelte';
diff --git a/frontend/Chatbot/shared/Copy.svelte b/frontend/legacy/Chatbot/shared/Copy.svelte
similarity index 100%
rename from frontend/Chatbot/shared/Copy.svelte
rename to frontend/legacy/Chatbot/shared/Copy.svelte
diff --git a/frontend/Chatbot/shared/FlushingMarkdown.svelte b/frontend/legacy/Chatbot/shared/FlushingMarkdown.svelte
similarity index 100%
rename from frontend/Chatbot/shared/FlushingMarkdown.svelte
rename to frontend/legacy/Chatbot/shared/FlushingMarkdown.svelte
diff --git a/frontend/Chatbot/shared/LikeDislike.svelte b/frontend/legacy/Chatbot/shared/LikeDislike.svelte
similarity index 100%
rename from frontend/Chatbot/shared/LikeDislike.svelte
rename to frontend/legacy/Chatbot/shared/LikeDislike.svelte
diff --git a/frontend/Chatbot/shared/Pending.svelte b/frontend/legacy/Chatbot/shared/Pending.svelte
similarity index 100%
rename from frontend/Chatbot/shared/Pending.svelte
rename to frontend/legacy/Chatbot/shared/Pending.svelte
diff --git a/frontend/Chatbot/shared/llm-thinking-presets.ts b/frontend/legacy/Chatbot/shared/llm-thinking-presets.ts
similarity index 100%
rename from frontend/Chatbot/shared/llm-thinking-presets.ts
rename to frontend/legacy/Chatbot/shared/llm-thinking-presets.ts
diff --git a/frontend/Chatbot/shared/utils.ts b/frontend/legacy/Chatbot/shared/utils.ts
similarity index 100%
rename from frontend/Chatbot/shared/utils.ts
rename to frontend/legacy/Chatbot/shared/utils.ts
diff --git a/frontend/Flow/CHANGELOG.md b/frontend/legacy/Flow/CHANGELOG.md
similarity index 100%
rename from frontend/Flow/CHANGELOG.md
rename to frontend/legacy/Flow/CHANGELOG.md
diff --git a/frontend/Flow/Index.svelte b/frontend/legacy/Flow/Index.svelte
similarity index 97%
rename from frontend/Flow/Index.svelte
rename to frontend/legacy/Flow/Index.svelte
index 615e03bd..429a4382 100644
--- a/frontend/Flow/Index.svelte
+++ b/frontend/legacy/Flow/Index.svelte
@@ -10,7 +10,7 @@
type FlowCustomData,
type FlowProps,
} from '@modelscope-studio/compiled';
- import { get_fetchable_url_or_file } from '@modelscope-studio/shared';
+ import { get_fetchable_url_or_file } from '@utils/upload';
import Flow from './shared/Flow.svelte';
import { type FlowData } from './shared/utils';
diff --git a/frontend/legacy/Flow/gradio.config.js b/frontend/legacy/Flow/gradio.config.js
new file mode 100644
index 00000000..abd9137f
--- /dev/null
+++ b/frontend/legacy/Flow/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config({ external: true });
diff --git a/frontend/Flow/package.json b/frontend/legacy/Flow/package.json
similarity index 53%
rename from frontend/Flow/package.json
rename to frontend/legacy/Flow/package.json
index 597a938b..f374ad0d 100644
--- a/frontend/Flow/package.json
+++ b/frontend/legacy/Flow/package.json
@@ -1,5 +1,5 @@
{
- "name": "@modelscope-studio/flow",
+ "name": "@modelscope-studio/legacy-flow",
"version": "0.4.2",
"private": false,
"description": "ModelScope Gradio Components",
@@ -14,17 +14,8 @@
"build": "typescript-json-schema --skipLibCheck ./schema.ts FlowSchema > ./schema.json"
},
"dependencies": {
- "@gradio/atoms": "0.7.4",
- "@gradio/client": "1.1.1",
- "@gradio/icons": "0.4.1",
- "@gradio/statustracker": "0.6.0",
- "@gradio/utils": "0.4.2",
- "@modelscope-studio/compiled": "workspace:*",
- "@modelscope-studio/shared": "workspace:*"
- },
- "devDependencies": {
- "@gradio/preview": "0.9.1",
- "typescript-json-schema": "^0.64.0"
+ "@modelscope-studio/legacy-compiled": "workspace:*"
},
+ "devDependencies": {},
"main_changeset": true
}
diff --git a/frontend/Flow/schema.json b/frontend/legacy/Flow/schema.json
similarity index 100%
rename from frontend/Flow/schema.json
rename to frontend/legacy/Flow/schema.json
diff --git a/frontend/Flow/schema.ts b/frontend/legacy/Flow/schema.ts
similarity index 100%
rename from frontend/Flow/schema.ts
rename to frontend/legacy/Flow/schema.ts
diff --git a/frontend/Flow/shared/Flow.svelte b/frontend/legacy/Flow/shared/Flow.svelte
similarity index 97%
rename from frontend/Flow/shared/Flow.svelte
rename to frontend/legacy/Flow/shared/Flow.svelte
index 599d0a7b..09e086b3 100644
--- a/frontend/Flow/shared/Flow.svelte
+++ b/frontend/legacy/Flow/shared/Flow.svelte
@@ -8,7 +8,7 @@
type FlowProps,
type UploadFile,
} from '@modelscope-studio/compiled';
- import { upload } from '@modelscope-studio/shared';
+ import { upload } from '@utils/upload';
import { createEventDispatcher, getContext } from 'svelte';
import { type FlowData } from './utils';
diff --git a/frontend/Flow/shared/utils.ts b/frontend/legacy/Flow/shared/utils.ts
similarity index 100%
rename from frontend/Flow/shared/utils.ts
rename to frontend/legacy/Flow/shared/utils.ts
diff --git a/frontend/Lifecycle/CHANGELOG.md b/frontend/legacy/Lifecycle/CHANGELOG.md
similarity index 100%
rename from frontend/Lifecycle/CHANGELOG.md
rename to frontend/legacy/Lifecycle/CHANGELOG.md
diff --git a/frontend/legacy/Lifecycle/gradio.config.js b/frontend/legacy/Lifecycle/gradio.config.js
new file mode 100644
index 00000000..abd9137f
--- /dev/null
+++ b/frontend/legacy/Lifecycle/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config({ external: true });
diff --git a/frontend/Lifecycle/index.svelte b/frontend/legacy/Lifecycle/index.svelte
similarity index 100%
rename from frontend/Lifecycle/index.svelte
rename to frontend/legacy/Lifecycle/index.svelte
diff --git a/frontend/legacy/Lifecycle/package.json b/frontend/legacy/Lifecycle/package.json
new file mode 100644
index 00000000..9b7c4869
--- /dev/null
+++ b/frontend/legacy/Lifecycle/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "@modelscope-studio/legacy-lifecycle",
+ "version": "0.4.2",
+ "private": false,
+ "description": "ModelScope Gradio Components",
+ "repository": "git@github.com:modelscope/modelscope-studio.git",
+ "license": "Apache-2.0",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
+ },
+ "dependencies": {},
+ "devDependencies": {},
+ "main_changeset": true
+}
diff --git a/frontend/Lifecycle/shared/utils.ts b/frontend/legacy/Lifecycle/shared/utils.ts
similarity index 100%
rename from frontend/Lifecycle/shared/utils.ts
rename to frontend/legacy/Lifecycle/shared/utils.ts
diff --git a/frontend/Markdown/CHANGELOG.md b/frontend/legacy/Markdown/CHANGELOG.md
similarity index 100%
rename from frontend/Markdown/CHANGELOG.md
rename to frontend/legacy/Markdown/CHANGELOG.md
diff --git a/frontend/Markdown/Example.svelte b/frontend/legacy/Markdown/Example.svelte
similarity index 100%
rename from frontend/Markdown/Example.svelte
rename to frontend/legacy/Markdown/Example.svelte
diff --git a/frontend/Markdown/Index.svelte b/frontend/legacy/Markdown/Index.svelte
similarity index 100%
rename from frontend/Markdown/Index.svelte
rename to frontend/legacy/Markdown/Index.svelte
diff --git a/frontend/legacy/Markdown/gradio.config.js b/frontend/legacy/Markdown/gradio.config.js
new file mode 100644
index 00000000..abd9137f
--- /dev/null
+++ b/frontend/legacy/Markdown/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config({ external: true });
diff --git a/frontend/Markdown/package.json b/frontend/legacy/Markdown/package.json
similarity index 60%
rename from frontend/Markdown/package.json
rename to frontend/legacy/Markdown/package.json
index 68896f6b..0a06f5ef 100644
--- a/frontend/Markdown/package.json
+++ b/frontend/legacy/Markdown/package.json
@@ -1,5 +1,5 @@
{
- "name": "@modelscope-studio/markdown",
+ "name": "@modelscope-studio/legacy-markdown",
"version": "0.4.2",
"private": false,
"description": "ModelScope Gradio Components",
@@ -12,13 +12,8 @@
"./package.json": "./package.json"
},
"dependencies": {
- "@gradio/atoms": "0.7.4",
- "@gradio/statustracker": "0.6.0",
- "@gradio/utils": "0.4.2",
- "@modelscope-studio/compiled": "workspace:*"
- },
- "devDependencies": {
- "@gradio/preview": "0.9.1"
+ "@modelscope-studio/legacy-compiled": "workspace:*"
},
+ "devDependencies": {},
"main_changeset": true
}
diff --git a/frontend/Markdown/shared/Markdown.svelte b/frontend/legacy/Markdown/shared/Markdown.svelte
similarity index 100%
rename from frontend/Markdown/shared/Markdown.svelte
rename to frontend/legacy/Markdown/shared/Markdown.svelte
diff --git a/frontend/MultimodalInput/CHANGELOG.md b/frontend/legacy/MultimodalInput/CHANGELOG.md
similarity index 100%
rename from frontend/MultimodalInput/CHANGELOG.md
rename to frontend/legacy/MultimodalInput/CHANGELOG.md
diff --git a/frontend/MultimodalInput/Example.svelte b/frontend/legacy/MultimodalInput/Example.svelte
similarity index 100%
rename from frontend/MultimodalInput/Example.svelte
rename to frontend/legacy/MultimodalInput/Example.svelte
diff --git a/frontend/MultimodalInput/Index.svelte b/frontend/legacy/MultimodalInput/Index.svelte
similarity index 99%
rename from frontend/MultimodalInput/Index.svelte
rename to frontend/legacy/MultimodalInput/Index.svelte
index ff9b6967..ee1f2037 100644
--- a/frontend/MultimodalInput/Index.svelte
+++ b/frontend/legacy/MultimodalInput/Index.svelte
@@ -15,7 +15,7 @@
import type { LoadingStatus } from '@gradio/statustracker';
import { StatusTracker } from '@gradio/statustracker';
import type { Gradio, SelectData } from '@gradio/utils';
- import { upload as gradio_upload } from '@modelscope-studio/shared';
+ import { upload as gradio_upload } from '@utils/upload';
import { getContext } from 'svelte';
import AudioRecorder from './shared/AudioRecorder.svelte';
diff --git a/frontend/legacy/MultimodalInput/gradio.config.js b/frontend/legacy/MultimodalInput/gradio.config.js
new file mode 100644
index 00000000..abd9137f
--- /dev/null
+++ b/frontend/legacy/MultimodalInput/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config({ external: true });
diff --git a/frontend/legacy/MultimodalInput/package.json b/frontend/legacy/MultimodalInput/package.json
new file mode 100644
index 00000000..9df9a0f9
--- /dev/null
+++ b/frontend/legacy/MultimodalInput/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "@modelscope-studio/legacy-multimodal-input",
+ "version": "0.4.2",
+ "private": false,
+ "description": "ModelScope Gradio Components",
+ "repository": "git@github.com:modelscope/modelscope-studio.git",
+ "license": "Apache-2.0",
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./example": "./Example.svelte",
+ "./package.json": "./package.json"
+ },
+ "dependencies": {
+ "@modelscope-studio/legacy-compiled": "workspace:*"
+ },
+ "devDependencies": {},
+ "main_changeset": true
+}
diff --git a/frontend/MultimodalInput/shared/AudioRecorder.svelte b/frontend/legacy/MultimodalInput/shared/AudioRecorder.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/AudioRecorder.svelte
rename to frontend/legacy/MultimodalInput/shared/AudioRecorder.svelte
diff --git a/frontend/MultimodalInput/shared/FilePreview.svelte b/frontend/legacy/MultimodalInput/shared/FilePreview.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/FilePreview.svelte
rename to frontend/legacy/MultimodalInput/shared/FilePreview.svelte
diff --git a/frontend/MultimodalInput/shared/Input.svelte b/frontend/legacy/MultimodalInput/shared/Input.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/Input.svelte
rename to frontend/legacy/MultimodalInput/shared/Input.svelte
diff --git a/frontend/MultimodalInput/shared/Loader.svelte b/frontend/legacy/MultimodalInput/shared/Loader.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/Loader.svelte
rename to frontend/legacy/MultimodalInput/shared/Loader.svelte
diff --git a/frontend/MultimodalInput/shared/RemoveIcon.svelte b/frontend/legacy/MultimodalInput/shared/RemoveIcon.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/RemoveIcon.svelte
rename to frontend/legacy/MultimodalInput/shared/RemoveIcon.svelte
diff --git a/frontend/MultimodalInput/shared/SubmitButton.svelte b/frontend/legacy/MultimodalInput/shared/SubmitButton.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/SubmitButton.svelte
rename to frontend/legacy/MultimodalInput/shared/SubmitButton.svelte
diff --git a/frontend/MultimodalInput/shared/UploadButton.svelte b/frontend/legacy/MultimodalInput/shared/UploadButton.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/UploadButton.svelte
rename to frontend/legacy/MultimodalInput/shared/UploadButton.svelte
diff --git a/frontend/MultimodalInput/shared/UploadIcon.svelte b/frontend/legacy/MultimodalInput/shared/UploadIcon.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/UploadIcon.svelte
rename to frontend/legacy/MultimodalInput/shared/UploadIcon.svelte
diff --git a/frontend/MultimodalInput/shared/Webcam.svelte b/frontend/legacy/MultimodalInput/shared/Webcam.svelte
similarity index 100%
rename from frontend/MultimodalInput/shared/Webcam.svelte
rename to frontend/legacy/MultimodalInput/shared/Webcam.svelte
diff --git a/frontend/MultimodalInput/shared/context.ts b/frontend/legacy/MultimodalInput/shared/context.ts
similarity index 100%
rename from frontend/MultimodalInput/shared/context.ts
rename to frontend/legacy/MultimodalInput/shared/context.ts
diff --git a/frontend/MultimodalInput/shared/global.d.ts b/frontend/legacy/MultimodalInput/shared/global.d.ts
similarity index 100%
rename from frontend/MultimodalInput/shared/global.d.ts
rename to frontend/legacy/MultimodalInput/shared/global.d.ts
diff --git a/frontend/MultimodalInput/shared/utils.ts b/frontend/legacy/MultimodalInput/shared/utils.ts
similarity index 100%
rename from frontend/MultimodalInput/shared/utils.ts
rename to frontend/legacy/MultimodalInput/shared/utils.ts
diff --git a/frontend/WaterfallGallery/CHANGELOG.md b/frontend/legacy/WaterfallGallery/CHANGELOG.md
similarity index 100%
rename from frontend/WaterfallGallery/CHANGELOG.md
rename to frontend/legacy/WaterfallGallery/CHANGELOG.md
diff --git a/frontend/WaterfallGallery/Index.svelte b/frontend/legacy/WaterfallGallery/Index.svelte
similarity index 100%
rename from frontend/WaterfallGallery/Index.svelte
rename to frontend/legacy/WaterfallGallery/Index.svelte
diff --git a/frontend/legacy/WaterfallGallery/gradio.config.js b/frontend/legacy/WaterfallGallery/gradio.config.js
new file mode 100644
index 00000000..abd9137f
--- /dev/null
+++ b/frontend/legacy/WaterfallGallery/gradio.config.js
@@ -0,0 +1,3 @@
+import config from '../../defineConfig.js';
+
+export default config({ external: true });
diff --git a/frontend/shared/package.json b/frontend/legacy/WaterfallGallery/package.json
similarity index 57%
rename from frontend/shared/package.json
rename to frontend/legacy/WaterfallGallery/package.json
index c9dc33ce..6e87c427 100644
--- a/frontend/shared/package.json
+++ b/frontend/legacy/WaterfallGallery/package.json
@@ -1,13 +1,14 @@
{
- "name": "@modelscope-studio/shared",
+ "name": "@modelscope-studio/legacy-waterfall-gallery",
"version": "0.4.2",
"description": "ModelScope Gradio Components",
"repository": "git@github.com:modelscope/modelscope-studio.git",
"license": "Apache-2.0",
"author": "",
- "main": "./src/index.ts",
- "dependencies": {
- "@gradio/client": "1.1.1"
+ "type": "module",
+ "exports": {
+ ".": "./Index.svelte",
+ "./package.json": "./package.json"
},
"main_changeset": true
}
diff --git a/frontend/WaterfallGallery/shared/Dislike.svelte b/frontend/legacy/WaterfallGallery/shared/Dislike.svelte
similarity index 100%
rename from frontend/WaterfallGallery/shared/Dislike.svelte
rename to frontend/legacy/WaterfallGallery/shared/Dislike.svelte
diff --git a/frontend/WaterfallGallery/shared/Gallery.svelte b/frontend/legacy/WaterfallGallery/shared/Gallery.svelte
similarity index 99%
rename from frontend/WaterfallGallery/shared/Gallery.svelte
rename to frontend/legacy/WaterfallGallery/shared/Gallery.svelte
index 77913716..26705d93 100644
--- a/frontend/WaterfallGallery/shared/Gallery.svelte
+++ b/frontend/legacy/WaterfallGallery/shared/Gallery.svelte
@@ -11,7 +11,7 @@
SelectData,
ShareData,
} from '@gradio/utils';
- import { normalise_file } from '@modelscope-studio/shared';
+ import { normalise_file } from '@utils/upload';
import { dequal } from 'dequal';
import { createEventDispatcher, onDestroy, tick } from 'svelte';
diff --git a/frontend/WaterfallGallery/shared/Image.svelte b/frontend/legacy/WaterfallGallery/shared/Image.svelte
similarity index 100%
rename from frontend/WaterfallGallery/shared/Image.svelte
rename to frontend/legacy/WaterfallGallery/shared/Image.svelte
diff --git a/frontend/WaterfallGallery/shared/Waterfall/createWaterfall.ts b/frontend/legacy/WaterfallGallery/shared/Waterfall/createWaterfall.ts
similarity index 100%
rename from frontend/WaterfallGallery/shared/Waterfall/createWaterfall.ts
rename to frontend/legacy/WaterfallGallery/shared/Waterfall/createWaterfall.ts
diff --git a/frontend/WaterfallGallery/shared/Waterfall/index.ts b/frontend/legacy/WaterfallGallery/shared/Waterfall/index.ts
similarity index 100%
rename from frontend/WaterfallGallery/shared/Waterfall/index.ts
rename to frontend/legacy/WaterfallGallery/shared/Waterfall/index.ts
diff --git a/frontend/WaterfallGallery/shared/Waterfall/layout.ts b/frontend/legacy/WaterfallGallery/shared/Waterfall/layout.ts
similarity index 100%
rename from frontend/WaterfallGallery/shared/Waterfall/layout.ts
rename to frontend/legacy/WaterfallGallery/shared/Waterfall/layout.ts
diff --git a/frontend/WaterfallGallery/shared/utils.ts b/frontend/legacy/WaterfallGallery/shared/utils.ts
similarity index 100%
rename from frontend/WaterfallGallery/shared/utils.ts
rename to frontend/legacy/WaterfallGallery/shared/utils.ts
diff --git a/frontend/compiled/CHANGELOG.md b/frontend/legacy/compiled/CHANGELOG.md
similarity index 100%
rename from frontend/compiled/CHANGELOG.md
rename to frontend/legacy/compiled/CHANGELOG.md
diff --git a/frontend/compiled/components/FileView/index.svelte b/frontend/legacy/compiled/components/FileView/index.svelte
similarity index 100%
rename from frontend/compiled/components/FileView/index.svelte
rename to frontend/legacy/compiled/components/FileView/index.svelte
diff --git a/frontend/compiled/components/FileView/shared/FileView.svelte b/frontend/legacy/compiled/components/FileView/shared/FileView.svelte
similarity index 83%
rename from frontend/compiled/components/FileView/shared/FileView.svelte
rename to frontend/legacy/compiled/components/FileView/shared/FileView.svelte
index d95e4d6f..f9cf9a88 100644
--- a/frontend/compiled/components/FileView/shared/FileView.svelte
+++ b/frontend/legacy/compiled/components/FileView/shared/FileView.svelte
@@ -1,5 +1,5 @@
+
+
+
+{#if $$slots.default}
+
+{/if}
+
+
diff --git a/frontend/svelte-preprocess-react/internal/types.ts b/frontend/svelte-preprocess-react/internal/types.ts
new file mode 100644
index 00000000..73298829
--- /dev/null
+++ b/frontend/svelte-preprocess-react/internal/types.ts
@@ -0,0 +1,67 @@
+import type { ComponentClass, FunctionComponent } from 'react';
+import type { Readable } from 'svelte/store';
+
+export type HandlerName = `on${Capitalize}`;
+export type EventName = T extends `on${infer N}`
+ ? Uncapitalize
+ : never;
+
+export type SvelteEventHandlers =
+ T extends Record
+ ? Partial, (e: Value) => void | boolean>>
+ : never;
+
+type Uppercase =
+ | 'A'
+ | 'B'
+ | 'C'
+ | 'D'
+ | 'E'
+ | 'F'
+ | 'G'
+ | 'H'
+ | 'I'
+ | 'J'
+ | 'K'
+ | 'L'
+ | 'M'
+ | 'N'
+ | 'S'
+ | 'T'
+ | 'U'
+ | 'V'
+ | 'W'
+ | 'X'
+ | 'Y'
+ | 'Z';
+
+type ReactEventProp = `on${Uppercase}${string}`;
+type ExcludeProps = T extends ReactEventProp ? T : never;
+type ExcludeEvents = T extends ReactEventProp ? never : T;
+
+export type EventProps = Omit<
+ ReactProps,
+ ExcludeEvents
+>;
+export type OmitEventProps = Omit<
+ ReactProps,
+ ExcludeProps
+>;
+
+export type TreeNode = Omit & {
+ svelteInstance: Readable;
+ reactComponent: FunctionComponent | ComponentClass;
+ key: number;
+ nodes: TreeNode[];
+};
+
+export type SvelteInit = {
+ parent?: TreeNode;
+ props: Readable>;
+ target: Readable;
+ slot: Readable;
+ slotKey: Readable | undefined;
+ slotIndex: Readable | undefined;
+ subSlotIndex: Readable | undefined;
+ onDestroy: (callback: () => void) => void;
+};
diff --git a/frontend/svelte-preprocess-react/polyfills.ts b/frontend/svelte-preprocess-react/polyfills.ts
new file mode 100644
index 00000000..f720760a
--- /dev/null
+++ b/frontend/svelte-preprocess-react/polyfills.ts
@@ -0,0 +1,4 @@
+// Object.hasOwn
+if (!Object.hasOwn) {
+ Object.hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
+}
diff --git a/frontend/svelte-preprocess-react/react-slot.tsx b/frontend/svelte-preprocess-react/react-slot.tsx
new file mode 100644
index 00000000..af919607
--- /dev/null
+++ b/frontend/svelte-preprocess-react/react-slot.tsx
@@ -0,0 +1,121 @@
+import React, { forwardRef, useEffect, useRef } from 'react';
+import { styleObject2HtmlStyle } from '@utils/styleObject2String';
+
+export interface ReactSlotProps {
+ slot: HTMLElement;
+ clone?: boolean;
+ style?: React.CSSProperties;
+ className?: string;
+}
+
+function cloneElementWithEvents(element: HTMLElement) {
+ const clonedElement = element.cloneNode(true) as HTMLElement;
+ // clone eventListener
+ Object.keys(element.getEventListeners()).forEach((eventName) => {
+ const listeners = element.getEventListeners(
+ eventName as keyof ElementEventMap
+ );
+ listeners.forEach(({ listener, type, useCapture }) => {
+ clonedElement.addEventListener(type, listener, useCapture);
+ });
+ });
+ const elementsChildrenArray = Array.from(element.children);
+ for (let i = 0; i < elementsChildrenArray.length; i++) {
+ const child = elementsChildrenArray[i];
+ const clonedChild = cloneElementWithEvents(child as HTMLElement);
+ clonedElement.replaceChild(clonedChild, clonedElement.children[i]);
+ }
+
+ return clonedElement;
+}
+
+function mountElRef(elRef: React.ForwardedRef, el: HTMLElement) {
+ if (elRef) {
+ if (typeof elRef === 'function') {
+ elRef(el);
+ } else {
+ elRef.current = el;
+ }
+ }
+}
+
+// eslint-disable-next-line react/display-name
+export const ReactSlot = forwardRef(
+ ({ slot, clone, className, style }, elRef) => {
+ const ref = useRef();
+ useEffect(() => {
+ if (!ref.current || !slot) {
+ return;
+ }
+ let cloned = slot;
+ function mountElementProps() {
+ let child = cloned as Element;
+ if (
+ cloned.tagName.toLowerCase() === 'svelte-slot' &&
+ cloned.children.length === 1 &&
+ cloned.children[0]
+ ) {
+ child = cloned.children[0];
+ if (
+ child.tagName.toLowerCase() === 'react-portal-target' &&
+ child.children[0]
+ ) {
+ child = child.children[0];
+ }
+ }
+
+ mountElRef(elRef, child as HTMLElement);
+
+ if (className) {
+ child.classList.add(...className.split(' '));
+ }
+ if (style) {
+ const htmlStyle = styleObject2HtmlStyle(style);
+
+ Object.keys(htmlStyle).forEach((key) => {
+ ((child as HTMLElement).style as any)[key] = htmlStyle[key];
+ });
+ }
+ }
+ let observer: MutationObserver | null = null;
+ if (clone && window.MutationObserver) {
+ function render() {
+ cloned = cloneElementWithEvents(slot);
+ cloned.style.display = 'contents';
+ mountElementProps();
+ ref.current?.appendChild(cloned);
+ }
+ render();
+ observer = new window.MutationObserver(() => {
+ if (ref.current?.contains(cloned)) {
+ ref.current?.removeChild(cloned);
+ }
+ render();
+ });
+ observer.observe(slot, {
+ attributes: true,
+ childList: true,
+ subtree: true,
+ });
+ } else {
+ cloned.style.display = 'contents';
+ mountElementProps();
+ ref.current?.appendChild(cloned);
+ }
+
+ return () => {
+ cloned.style.display = '';
+
+ if (ref.current?.contains(cloned)) {
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ ref.current?.removeChild(cloned);
+ }
+ observer?.disconnect();
+ };
+ }, [slot, clone, className, style, elRef]);
+ return React.createElement('react-child', {
+ ref,
+ style: { display: 'contents' },
+ });
+ }
+);
diff --git a/frontend/svelte-preprocess-react/slot.ts b/frontend/svelte-preprocess-react/slot.ts
new file mode 100644
index 00000000..f21cf3fb
--- /dev/null
+++ b/frontend/svelte-preprocess-react/slot.ts
@@ -0,0 +1,170 @@
+import { getContext, setContext } from 'svelte';
+import { get, type Writable, writable } from 'svelte/store';
+
+const slotsKey = '$$ms-gr-antd-slots-key';
+
+export function getSlots() {
+ const slots = writable({} as Record);
+
+ return setContext(slotsKey, slots);
+}
+
+export function getSetSlotFn() {
+ const slots =
+ (getContext(slotsKey) as Writable>) ||
+ writable({});
+
+ return (prevSlot: string, slot: string, el: HTMLElement) => {
+ slots.update((v) => {
+ const newValue = { ...v };
+ if (prevSlot) {
+ Reflect.deleteProperty(newValue, prevSlot);
+ }
+ return { ...newValue, [slot]: el };
+ });
+ };
+}
+
+const slotParamsKey = '$$ms-gr-antd-render-slot-context-key';
+
+export function getSetSlotParamsFn() {
+ const slotParams = setContext(
+ slotParamsKey,
+ writable>({})
+ );
+ return (key: string, params: any[] | ((prevValue: any[]) => any[])) => {
+ slotParams.update((v) => {
+ if (typeof params === 'function') {
+ return {
+ ...v,
+ [key]: params(v[key]),
+ };
+ }
+ return {
+ ...v,
+ [key]: params,
+ };
+ });
+ };
+}
+export function getSlotParams() {
+ return getContext(slotParamsKey) as
+ | Writable>
+ | undefined;
+}
+
+const slotContextKey = '$$ms-gr-antd-context-key';
+export function getSetSlotContextFn() {
+ const value = writable();
+ setContext(slotContextKey, value);
+ return (v: any) => {
+ value.set(v);
+ };
+}
+
+/**
+ *
+ * will run `resetSlotKey` inside
+ */
+export function getSlotContext<
+ T extends {
+ as_item?: string;
+ _internal: Record;
+ },
+>(props: T): [Writable, (props: T) => void] {
+ if (!Reflect.has(props, 'as_item') || !Reflect.has(props, '_internal')) {
+ throw new Error('`as_item` and `_internal` is required');
+ }
+ const slotKey = getSlotKey();
+ const componentSlotContext = setComponentSlotContext({
+ slot: undefined,
+ index: props._internal.index,
+ subIndex: props._internal.subIndex,
+ });
+ if (slotKey) {
+ slotKey.subscribe((v) => {
+ componentSlotContext.slotKey.set(v as string);
+ });
+ }
+ // reset slot key to make sure the sub component does not be affected by gr.Slot()
+ resetSlotKey();
+ const ctx = getContext(slotContextKey) as Writable;
+ const as_item = get(ctx)?.as_item || props.as_item;
+ const initialCtxValue = ctx
+ ? as_item
+ ? get(ctx)[as_item as keyof T]
+ : get(ctx)
+ : {};
+ const mergedProps = writable({
+ ...props,
+ ...initialCtxValue,
+ });
+ if (!ctx) {
+ return [
+ mergedProps,
+ (v) => {
+ mergedProps.set(v);
+ },
+ ];
+ }
+ ctx.subscribe((ctxValue) => {
+ const { as_item: merged_as_item } = get(mergedProps);
+ if (merged_as_item) {
+ ctxValue = (ctxValue as Record)[merged_as_item];
+ }
+ mergedProps.update((prev) => ({
+ ...prev,
+ ...ctxValue,
+ }));
+ });
+
+ return [
+ mergedProps,
+ (v) => {
+ const ctxValue = v.as_item ? get(ctx)[v.as_item as keyof T] : get(ctx);
+ return mergedProps.set({
+ ...v,
+ ...ctxValue,
+ });
+ },
+ ];
+}
+
+const slotKey = '$$ms-gr-antd-slot-key';
+
+export function resetSlotKey() {
+ setContext(slotKey, writable(undefined));
+}
+export function setSlotKey(slot: string) {
+ return setContext(slotKey, writable(slot));
+}
+export function getSlotKey() {
+ return getContext(slotKey) as Writable | undefined;
+}
+
+const componentSlotContextKey = '$$ms-gr-antd-component-slot-context-key';
+
+export function setComponentSlotContext({
+ slot,
+ index,
+ subIndex,
+}: {
+ slot: string | undefined;
+ index: number | undefined;
+ subIndex: number | undefined;
+}) {
+ return setContext(componentSlotContextKey, {
+ slotKey: writable(slot),
+ slotIndex: writable(index),
+ subSlotIndex: writable(subIndex),
+ });
+}
+export function getComponentSlotContext() {
+ return getContext(componentSlotContextKey) as
+ | {
+ slotKey: Writable;
+ slotIndex: Writable;
+ subSlotIndex: Writable;
+ }
+ | undefined;
+}
diff --git a/frontend/svelte-preprocess-react/sveltify.ts b/frontend/svelte-preprocess-react/sveltify.ts
new file mode 100644
index 00000000..7be19c09
--- /dev/null
+++ b/frontend/svelte-preprocess-react/sveltify.ts
@@ -0,0 +1,88 @@
+import type React from 'react';
+import { createPortal } from 'react-dom';
+// eslint-disable-next-line @typescript-eslint/consistent-type-imports
+import { SvelteComponent } from 'svelte';
+import { type Writable, writable } from 'svelte/store';
+
+import ReactWrapper from './internal/ReactWrapper.svelte';
+import type { SvelteInit } from './internal/types';
+
+export type Sveltified> = {
+ new (args: { target: any; props?: P }): SvelteComponent
;
+};
+
+const rerender = window.ms_globals.rerender;
+const tree = window.ms_globals.tree;
+
+type CommonProps = S extends []
+ ? {
+ slots: {};
+ elRef?: React.ForwardedRef